aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
diff options
context:
space:
mode:
authorEran Ben Elisha <eranbe@mellanox.com>2015-03-30 17:45:24 +0300
committerDavid S. Miller <davem@davemloft.net>2015-03-31 16:36:50 -0400
commit3da8a36cc5c2a172bb42f8dc89638f5b41d7d7a6 (patch)
treedd68732106614f7711cb3f72e886a2d0c3b5d10b /drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
parentnet/mlx4_en: Support general selective view of ethtool statistics (diff)
downloadlinux-dev-3da8a36cc5c2a172bb42f8dc89638f5b41d7d7a6.tar.xz
linux-dev-3da8a36cc5c2a172bb42f8dc89638f5b41d7d7a6.zip
net/mlx4_en: Protect access to the statistics bitmap
This will allow parallel access to the statistics bitmap. A pre-step for adding PFC counters, where the statistics bitmap can be dynamically changed when modifying the PFC setting. Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index a612bfd921f7..d5d971a408f2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -485,6 +485,11 @@ enum {
#define MLX4_EN_MAC_HASH_SIZE (1 << BITS_PER_BYTE)
#define MLX4_EN_MAC_HASH_IDX 5
+struct mlx4_en_stats_bitmap {
+ DECLARE_BITMAP(bitmap, NUM_ALL_STATS);
+ struct mutex mutex; /* for mutual access to stats bitmap */
+};
+
struct mlx4_en_priv {
struct mlx4_en_dev *mdev;
struct mlx4_en_port_profile *prof;
@@ -561,7 +566,7 @@ struct mlx4_en_priv {
struct mlx4_en_perf_stats pstats;
struct mlx4_en_pkt_stats pkstats;
struct mlx4_en_port_stats port_stats;
- DECLARE_BITMAP(stats_bitmap, NUM_ALL_STATS);
+ struct mlx4_en_stats_bitmap stats_bitmap;
struct list_head mc_list;
struct list_head curr_list;
u64 broadcast_id;
@@ -731,7 +736,7 @@ int mlx4_en_start_port(struct net_device *dev);
void mlx4_en_stop_port(struct net_device *dev, int detach);
void mlx4_en_set_stats_bitmap(struct mlx4_dev *dev,
- unsigned long *stats_bitmap);
+ struct mlx4_en_stats_bitmap *stats_bitmap);
void mlx4_en_free_resources(struct mlx4_en_priv *priv);
int mlx4_en_alloc_resources(struct mlx4_en_priv *priv);