Skip to content

Commit

Permalink
net/mlx4_en: Fix off-by-four in ethtool
Browse files Browse the repository at this point in the history
NUM_ALL_STATS was not updated with the new four entries, instead
NUM_FLOW_STATS was updated, fix it. that caused off-by-four for all
counters below pf_*_*.

Fixes: b42de4d ('net/mlx4_en: Show PF own statistics via ethtool')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eran Ben Elisha authored and David S. Miller committed Jun 24, 2015
1 parent 0a51f76 commit 9a2abf5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/ethernet/mellanox/mlx4/mlx4_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ struct mlx4_en_flow_stats_tx {

#define NUM_FLOW_STATS (NUM_FLOW_STATS_RX + NUM_FLOW_STATS_TX + \
NUM_FLOW_PRIORITY_STATS_TX + \
NUM_FLOW_PRIORITY_STATS_RX + \
NUM_PF_STATS)
NUM_FLOW_PRIORITY_STATS_RX)

struct mlx4_en_stat_out_flow_control_mbox {
/* Total number of PAUSE frames received from the far-end port */
Expand Down Expand Up @@ -108,7 +107,7 @@ enum {
};

#define NUM_ALL_STATS (NUM_MAIN_STATS + NUM_PORT_STATS + NUM_PKT_STATS + \
NUM_FLOW_STATS + NUM_PERF_STATS)
NUM_FLOW_STATS + NUM_PERF_STATS + NUM_PF_STATS)

#define MLX4_FIND_NETDEV_STAT(n) (offsetof(struct net_device_stats, n) / \
sizeof(((struct net_device_stats *)0)->n))
Expand Down

0 comments on commit 9a2abf5

Please sign in to comment.