be2net: Add a dma_mapping_error counter in ethtool
authorVasundhara Volam <vasundhara.volam@emulex.com>
Tue, 2 Sep 2014 04:26:50 +0000 (09:56 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Sep 2014 19:46:00 +0000 (12:46 -0700)
Add a dma_mapping_error counter to count the number of packets dropped
due to DMA mapping errors.

Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@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 d491ac614dcf9c9fe04ff05f868034183b3e4e1a..069bdda00c55ce03443813609fd808de34ee0ffe 100644 (file)
@@ -323,6 +323,7 @@ struct be_rx_obj {
 struct be_drv_stats {
        u32 be_on_die_temperature;
        u32 eth_red_drops;
+       u32 dma_map_errors;
        u32 rx_drops_no_pbuf;
        u32 rx_drops_no_txpb;
        u32 rx_drops_no_erx_descr;
index 3a7ade4b313aa75d0d77ac408d9b7931278d3e3e..2fd38261bedb17c7ff8118a7ea7b9f6af090791c 100644 (file)
@@ -119,6 +119,8 @@ static const struct be_ethtool_stat et_stats[] = {
         * is more than 9018 bytes
         */
        {DRVSTAT_INFO(rx_drops_mtu)},
+       /* Number of dma mapping errors */
+       {DRVSTAT_INFO(dma_map_errors)},
        /* Number of packets dropped due to random early drop function */
        {DRVSTAT_INFO(eth_red_drops)},
        {DRVSTAT_INFO(be_on_die_temperature)},
index 7b6dbf880a667b17cd774a2872f2360799d3f8ad..6c2eb6978601a5baac510fe294471464595086a6 100644 (file)
@@ -849,6 +849,7 @@ dma_err:
                unmap_tx_frag(dev, wrb, map_single);
                map_single = false;
                copied -= wrb->frag_len;
+               adapter->drv_stats.dma_map_errors++;
                queue_head_inc(txq);
        }
        return 0;
@@ -1877,7 +1878,7 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp)
                        if (dma_mapping_error(dev, page_dmaaddr)) {
                                put_page(pagep);
                                pagep = NULL;
-                               rx_stats(rxo)->rx_post_fail++;
+                               adapter->drv_stats.dma_map_errors++;
                                break;
                        }
                        page_offset = 0;