]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
qlcnic: Add eSwitch statistics support
authorShahed Shaikh <shahed.shaikh@qlogic.com>
Wed, 24 Apr 2013 12:42:41 +0000 (12:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Apr 2013 23:34:05 +0000 (19:34 -0400)
o Read eSwitch statistics from adapter and display them as part
  of ethtool statistics.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c

index fd0829c2839d9a2d718c34ed784f2b5ecc855ffc..c40b077d43da92a04533c19a6b4cd20139ee833b 100644 (file)
@@ -2922,6 +2922,9 @@ static u64 *qlcnic_83xx_fill_stats(struct qlcnic_adapter *adapter,
                /* fill in MAC rx frame stats */
                for (k += 6; k < 80; k += 2)
                        data = qlcnic_83xx_copy_stats(cmd, data, k);
+               /* fill in eSwitch stats */
+               for (; k < total_regs; k += 2)
+                       data = qlcnic_83xx_copy_stats(cmd, data, k);
                break;
        case QLC_83XX_STAT_RX:
                for (k = 2; k < 8; k += 2)
index 4be411c2628a0e518f12b0bb55cc93d615564a06..1f1d85e6f2afd1e4cb1581f03088333b034726a3 100644 (file)
@@ -381,7 +381,7 @@ enum qlcnic_83xx_states {
 #define QLC_83XX_STAT_MAC      1
 #define QLC_83XX_TX_STAT_REGS  14
 #define QLC_83XX_RX_STAT_REGS  40
-#define QLC_83XX_MAC_STAT_REGS 80
+#define QLC_83XX_MAC_STAT_REGS 94
 
 #define QLC_83XX_GET_FUNC_PRIVILEGE(VAL, FN)   (0x3 & ((VAL) >> (FN * 2)))
 #define QLC_83XX_SET_FUNC_OPMODE(VAL, FN)      ((VAL) << (FN * 2))
index 59350c287f639ee31fbcce7995d0f772faa6706b..629d901637e13764af36b590d6a4eca6515b0a48 100644 (file)
@@ -115,6 +115,13 @@ static const char qlcnic_83xx_mac_stats_strings[][ETH_GSTRING_LEN] = {
        "mac_rx_dropped",
        "mac_crc_error",
        "mac_align_error",
+       "eswitch_frames",
+       "eswitch_bytes",
+       "eswitch_multicast_frames",
+       "eswitch_broadcast_frames",
+       "eswitch_unicast_frames",
+       "eswitch_error_free_frames",
+       "eswitch_error_free_bytes",
 };
 
 #define QLCNIC_STATS_LEN       ARRAY_SIZE(qlcnic_gstrings_stats)