aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuval Mintz <Yuval.Mintz@qlogic.com>2014-03-23 12:12:26 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-25 21:07:04 -0400
commitd8361051000f27d2c9467c1f18985f9ce2123415 (patch)
tree11b17d4b7f0dba5c7f67f0bb1529924c4c47f4e8
parent2dc33bbc4f8a5d6a05bf3c673b86c37b825450f3 (diff)
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: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 38fc794c1655..b6de05e3149b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -2969,8 +2969,9 @@ static void bnx2x_self_test(struct net_device *dev,
2969#define IS_PORT_STAT(i) \ 2969#define IS_PORT_STAT(i) \
2970 ((bnx2x_stats_arr[i].flags & STATS_FLAGS_BOTH) == STATS_FLAGS_PORT) 2970 ((bnx2x_stats_arr[i].flags & STATS_FLAGS_BOTH) == STATS_FLAGS_PORT)
2971#define IS_FUNC_STAT(i) (bnx2x_stats_arr[i].flags & STATS_FLAGS_FUNC) 2971#define IS_FUNC_STAT(i) (bnx2x_stats_arr[i].flags & STATS_FLAGS_FUNC)
2972#define IS_MF_MODE_STAT(bp) \ 2972#define HIDE_PORT_STAT(bp) \
2973 (IS_MF(bp) && !(bp->msg_enable & BNX2X_MSG_STATS)) 2973 ((IS_MF(bp) && !(bp->msg_enable & BNX2X_MSG_STATS)) || \
2974 IS_VF(bp))
2974 2975
2975/* ethtool statistics are displayed for all regular ethernet queues and the 2976/* ethtool statistics are displayed for all regular ethernet queues and the
2976 * fcoe L2 queue if not disabled 2977 * fcoe L2 queue if not disabled
@@ -2992,7 +2993,7 @@ static int bnx2x_get_sset_count(struct net_device *dev, int stringset)
2992 BNX2X_NUM_Q_STATS; 2993 BNX2X_NUM_Q_STATS;
2993 } else 2994 } else
2994 num_strings = 0; 2995 num_strings = 0;
2995 if (IS_MF_MODE_STAT(bp)) { 2996 if (HIDE_PORT_STAT(bp)) {
2996 for (i = 0; i < BNX2X_NUM_STATS; i++) 2997 for (i = 0; i < BNX2X_NUM_STATS; i++)
2997 if (IS_FUNC_STAT(i)) 2998 if (IS_FUNC_STAT(i))
2998 num_strings++; 2999 num_strings++;
@@ -3047,7 +3048,7 @@ static void bnx2x_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
3047 } 3048 }
3048 3049
3049 for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) { 3050 for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) {
3050 if (IS_MF_MODE_STAT(bp) && IS_PORT_STAT(i)) 3051 if (HIDE_PORT_STAT(bp) && IS_PORT_STAT(i))
3051 continue; 3052 continue;
3052 strcpy(buf + (k + j)*ETH_GSTRING_LEN, 3053 strcpy(buf + (k + j)*ETH_GSTRING_LEN,
3053 bnx2x_stats_arr[i].string); 3054 bnx2x_stats_arr[i].string);
@@ -3105,7 +3106,7 @@ static void bnx2x_get_ethtool_stats(struct net_device *dev,
3105 3106
3106 hw_stats = (u32 *)&bp->eth_stats; 3107 hw_stats = (u32 *)&bp->eth_stats;
3107 for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) { 3108 for (i = 0, j = 0; i < BNX2X_NUM_STATS; i++) {
3108 if (IS_MF_MODE_STAT(bp) && IS_PORT_STAT(i)) 3109 if (HIDE_PORT_STAT(bp) && IS_PORT_STAT(i))
3109 continue; 3110 continue;
3110 if (bnx2x_stats_arr[i].size == 0) { 3111 if (bnx2x_stats_arr[i].size == 0) {
3111 /* skip this counter */ 3112 /* skip this counter */