Commit d8361051 authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller

bnx2x: Don't show port statistics for VFs

VFs are currently showing port statistics, although they can't really access
those - thus all such statistics will always show a value of 0.

This patch removes said statistics from the VF's view as to not confuse the
user.
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarAriel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2dc33bbc
...@@ -2969,8 +2969,9 @@ static void bnx2x_self_test(struct net_device *dev, ...@@ -2969,8 +2969,9 @@ static void bnx2x_self_test(struct net_device *dev,
#define IS_PORT_STAT(i) \ #define IS_PORT_STAT(i) \
((bnx2x_stats_arr[i].flags & STATS_FLAGS_BOTH) == STATS_FLAGS_PORT) ((bnx2x_stats_arr[i].flags & STATS_FLAGS_BOTH) == STATS_FLAGS_PORT)
#define IS_FUNC_STAT(i) (bnx2x_stats_arr[i].flags & STATS_FLAGS_FUNC) #define IS_FUNC_STAT(i) (bnx2x_stats_arr[i].flags & STATS_FLAGS_FUNC)
#define IS_MF_MODE_STAT(bp) \ #define HIDE_PORT_STAT(bp) \
(IS_MF(bp) && !(bp->msg_enable & BNX2X_MSG_STATS)) ((IS_MF(bp) && !(bp->msg_enable & BNX2X_MSG_STATS)) || \
IS_VF(bp))
/* ethtool statistics are displayed for all regular ethernet queues and the /* ethtool statistics are displayed for all regular ethernet queues and the
* fcoe L2 queue if not disabled * fcoe L2 queue if not disabled
...@@ -2992,7 +2993,7 @@ static int bnx2x_get_sset_count(struct net_device *dev, int stringset) ...@@ -2992,7 +2993,7 @@ static int bnx2x_get_sset_count(struct net_device *dev, int stringset)
BNX2X_NUM_Q_STATS; BNX2X_NUM_Q_STATS;
} else } else
num_strings = 0; num_strings = 0;
if (IS_MF_MODE_STAT(bp)) { if (HIDE_PORT_STAT(bp)) {
for (i = 0; i < BNX2X_NUM_STATS; i++) for (i = 0; i < BNX2X_NUM_STATS; i++)
if (IS_FUNC_STAT(i)) if (IS_FUNC_STAT(i))
num_strings++; num_strings++;
...@@ -3047,7 +3048,7 @@ static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf) ...@@ -3047,7 +3048,7 @@ static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
} }
for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) { for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) {
if (IS_MF_MODE_STAT(bp) && IS_PORT_STAT(i)) if (HIDE_PORT_STAT(bp) && IS_PORT_STAT(i))
continue; continue;
strcpy(buf + (k + j)*ETH_GSTRING_LEN, strcpy(buf + (k + j)*ETH_GSTRING_LEN,
bnx2x_stats_arr[i].string); bnx2x_stats_arr[i].string);
...@@ -3105,7 +3106,7 @@ static void bnx2x_get_ethtool_stats(struct net_device *dev, ...@@ -3105,7 +3106,7 @@ static void bnx2x_get_ethtool_stats(struct net_device *dev,
hw_stats = (u32 *)&bp->eth_stats; hw_stats = (u32 *)&bp->eth_stats;
for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) { for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) {
if (IS_MF_MODE_STAT(bp) && IS_PORT_STAT(i)) if (HIDE_PORT_STAT(bp) && IS_PORT_STAT(i))
continue; continue;
if (bnx2x_stats_arr[i].size == 0) { if (bnx2x_stats_arr[i].size == 0) {
/* skip this counter */ /* skip this counter */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment