diff options
author | Vasundhara Volam <vasundhara.volam@emulex.com> | 2014-09-02 00:26:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-02 15:46:00 -0400 |
commit | d3de154071c14549c4b99d06a063bf3761e482c3 (patch) | |
tree | 24c384126970f6bc7fea431f48d49f81338672b6 /drivers | |
parent | 512bb8a244d2854953c65c0b36b0d0812fced7d5 (diff) |
be2net: Add a dma_mapping_error counter in ethtool
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 3 |
3 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index d491ac614dcf..069bdda00c55 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -323,6 +323,7 @@ struct be_rx_obj { | |||
323 | struct be_drv_stats { | 323 | struct be_drv_stats { |
324 | u32 be_on_die_temperature; | 324 | u32 be_on_die_temperature; |
325 | u32 eth_red_drops; | 325 | u32 eth_red_drops; |
326 | u32 dma_map_errors; | ||
326 | u32 rx_drops_no_pbuf; | 327 | u32 rx_drops_no_pbuf; |
327 | u32 rx_drops_no_txpb; | 328 | u32 rx_drops_no_txpb; |
328 | u32 rx_drops_no_erx_descr; | 329 | u32 rx_drops_no_erx_descr; |
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c index 3a7ade4b313a..2fd38261bedb 100644 --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c | |||
@@ -119,6 +119,8 @@ static const struct be_ethtool_stat et_stats[] = { | |||
119 | * is more than 9018 bytes | 119 | * is more than 9018 bytes |
120 | */ | 120 | */ |
121 | {DRVSTAT_INFO(rx_drops_mtu)}, | 121 | {DRVSTAT_INFO(rx_drops_mtu)}, |
122 | /* Number of dma mapping errors */ | ||
123 | {DRVSTAT_INFO(dma_map_errors)}, | ||
122 | /* Number of packets dropped due to random early drop function */ | 124 | /* Number of packets dropped due to random early drop function */ |
123 | {DRVSTAT_INFO(eth_red_drops)}, | 125 | {DRVSTAT_INFO(eth_red_drops)}, |
124 | {DRVSTAT_INFO(be_on_die_temperature)}, | 126 | {DRVSTAT_INFO(be_on_die_temperature)}, |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 7b6dbf880a66..6c2eb6978601 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -849,6 +849,7 @@ dma_err: | |||
849 | unmap_tx_frag(dev, wrb, map_single); | 849 | unmap_tx_frag(dev, wrb, map_single); |
850 | map_single = false; | 850 | map_single = false; |
851 | copied -= wrb->frag_len; | 851 | copied -= wrb->frag_len; |
852 | adapter->drv_stats.dma_map_errors++; | ||
852 | queue_head_inc(txq); | 853 | queue_head_inc(txq); |
853 | } | 854 | } |
854 | return 0; | 855 | return 0; |
@@ -1877,7 +1878,7 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp) | |||
1877 | if (dma_mapping_error(dev, page_dmaaddr)) { | 1878 | if (dma_mapping_error(dev, page_dmaaddr)) { |
1878 | put_page(pagep); | 1879 | put_page(pagep); |
1879 | pagep = NULL; | 1880 | pagep = NULL; |
1880 | rx_stats(rxo)->rx_post_fail++; | 1881 | adapter->drv_stats.dma_map_errors++; |
1881 | break; | 1882 | break; |
1882 | } | 1883 | } |
1883 | page_offset = 0; | 1884 | page_offset = 0; |