be2net: Display RoCE specific counters in ethtool -S
authorAjit Khaparde <ajit.khaparde@emulex.com>
Thu, 3 Oct 2013 21:16:50 +0000 (16:16 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Oct 2013 19:50:51 +0000 (15:50 -0400)
SkyHawk-R can support RoCE. Add code to display RoCE specific
counters maintained in hardware.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be.h
drivers/net/ethernet/emulex/benet/be_ethtool.c
drivers/net/ethernet/emulex/benet/be_main.c

index add6d7a953c6a0ad425a3a0b471698c13b768b11..944e6be27c648111451f0488af7591d3cbe4e21d 100644 (file)
@@ -325,6 +325,11 @@ struct be_drv_stats {
        u32 rx_input_fifo_overflow_drop;
        u32 pmem_fifo_overflow_drop;
        u32 jabber_events;
+       u32 rx_roce_bytes_lsd;
+       u32 rx_roce_bytes_msd;
+       u32 rx_roce_frames;
+       u32 roce_drops_payload_len;
+       u32 roce_drops_crc;
 };
 
 struct be_vf_cfg {
index 3dcf817e756dd5969dd64a68553f3c8f50dedba7..08330034d9efab6f303025e95a17775caf657f50 100644 (file)
@@ -116,7 +116,12 @@ static const struct be_ethtool_stat et_stats[] = {
        {DRVSTAT_INFO(rx_drops_mtu)},
        /* Number of packets dropped due to random early drop function */
        {DRVSTAT_INFO(eth_red_drops)},
-       {DRVSTAT_INFO(be_on_die_temperature)}
+       {DRVSTAT_INFO(be_on_die_temperature)},
+       {DRVSTAT_INFO(rx_roce_bytes_lsd)},
+       {DRVSTAT_INFO(rx_roce_bytes_msd)},
+       {DRVSTAT_INFO(rx_roce_frames)},
+       {DRVSTAT_INFO(roce_drops_payload_len)},
+       {DRVSTAT_INFO(roce_drops_crc)}
 };
 #define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats)
 
index 6e3a141c7a679c7bac5dee002365e3f1c69187ee..2d6115c0e99b31472accb37d3722945db424fdb6 100644 (file)
@@ -474,6 +474,14 @@ static void populate_be_v2_stats(struct be_adapter *adapter)
        drvs->rx_drops_no_tpre_descr = rxf_stats->rx_drops_no_tpre_descr;
        drvs->rx_drops_too_many_frags = rxf_stats->rx_drops_too_many_frags;
        adapter->drv_stats.eth_red_drops = pmem_sts->eth_red_drops;
+       if (be_roce_supported(adapter))  {
+               drvs->rx_roce_bytes_lsd = port_stats->roce_bytes_received_lsd;
+               drvs->rx_roce_bytes_msd = port_stats->roce_bytes_received_msd;
+               drvs->rx_roce_frames = port_stats->roce_frames_received;
+               drvs->roce_drops_crc = port_stats->roce_drops_crc;
+               drvs->roce_drops_payload_len =
+                       port_stats->roce_drops_payload_len;
+       }
 }
 
 static void populate_lancer_stats(struct be_adapter *adapter)