cxgb4: add per rx-queue counter for packet errors
authorGanesh Goudar <ganeshgr@chelsio.com>
Fri, 14 Sep 2018 09:16:04 +0000 (14:46 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Sep 2018 15:40:53 +0000 (08:40 -0700)
print per rx-queue packet errors in sge_qinfo

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
drivers/net/ethernet/chelsio/cxgb4/sge.c

index 298701edb6387c1dcb4e333265f0b165c8dcfffd..b5010bd32ea3ebfb7ac14a07b9ad6e83203e089d 100644 (file)
@@ -692,6 +692,7 @@ struct sge_eth_stats {              /* Ethernet queue statistics */
        unsigned long rx_cso;       /* # of Rx checksum offloads */
        unsigned long vlan_ex;      /* # of Rx VLAN extractions */
        unsigned long rx_drops;     /* # of packets dropped due to no mem */
+       unsigned long bad_rx_pkts;  /* # of packets with err_vec!=0 */
 };
 
 struct sge_eth_rxq {                /* SW Ethernet Rx queue */
index 0f72f9c4ec74c6f42722d3e731071b535d1bab33..cab492ec8f5904d6adfffcb4cb95e11a9dcc8efe 100644 (file)
@@ -2784,6 +2784,7 @@ do { \
                RL("LROmerged:", stats.lro_merged);
                RL("LROpackets:", stats.lro_pkts);
                RL("RxDrops:", stats.rx_drops);
+               RL("RxBadPkts:", stats.bad_rx_pkts);
                TL("TSO:", tso);
                TL("TxCSO:", tx_cso);
                TL("VLANins:", vlan_ins);
index 6807bc3a44fb7fad1fd6c229bafef6b5a8c063a1..b90188401d4a2a30a647fb2f241ec94f53db5081 100644 (file)
@@ -2830,6 +2830,10 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
 
        csum_ok = pkt->csum_calc && !err_vec &&
                  (q->netdev->features & NETIF_F_RXCSUM);
+
+       if (err_vec)
+               rxq->stats.bad_rx_pkts++;
+
        if (((pkt->l2info & htonl(RXF_TCP_F)) ||
             tnl_hdr_len) &&
            (q->netdev->features & NETIF_F_GRO) && csum_ok && !pkt->ip_frag) {