Commit d3de1540 authored by Vasundhara Volam's avatar Vasundhara Volam Committed by David S. Miller

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: default avatarVasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 512bb8a2
...@@ -323,6 +323,7 @@ struct be_rx_obj { ...@@ -323,6 +323,7 @@ struct be_rx_obj {
struct be_drv_stats { struct be_drv_stats {
u32 be_on_die_temperature; u32 be_on_die_temperature;
u32 eth_red_drops; u32 eth_red_drops;
u32 dma_map_errors;
u32 rx_drops_no_pbuf; u32 rx_drops_no_pbuf;
u32 rx_drops_no_txpb; u32 rx_drops_no_txpb;
u32 rx_drops_no_erx_descr; u32 rx_drops_no_erx_descr;
......
...@@ -119,6 +119,8 @@ static const struct be_ethtool_stat et_stats[] = { ...@@ -119,6 +119,8 @@ static const struct be_ethtool_stat et_stats[] = {
* is more than 9018 bytes * is more than 9018 bytes
*/ */
{DRVSTAT_INFO(rx_drops_mtu)}, {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 */ /* Number of packets dropped due to random early drop function */
{DRVSTAT_INFO(eth_red_drops)}, {DRVSTAT_INFO(eth_red_drops)},
{DRVSTAT_INFO(be_on_die_temperature)}, {DRVSTAT_INFO(be_on_die_temperature)},
......
...@@ -849,6 +849,7 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq, ...@@ -849,6 +849,7 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq,
unmap_tx_frag(dev, wrb, map_single); unmap_tx_frag(dev, wrb, map_single);
map_single = false; map_single = false;
copied -= wrb->frag_len; copied -= wrb->frag_len;
adapter->drv_stats.dma_map_errors++;
queue_head_inc(txq); queue_head_inc(txq);
} }
return 0; return 0;
...@@ -1877,7 +1878,7 @@ static void be_post_rx_frags(struct be_rx_obj *rxo, gfp_t gfp) ...@@ -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)) { if (dma_mapping_error(dev, page_dmaaddr)) {
put_page(pagep); put_page(pagep);
pagep = NULL; pagep = NULL;
rx_stats(rxo)->rx_post_fail++; adapter->drv_stats.dma_map_errors++;
break; break;
} }
page_offset = 0; page_offset = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment