Commit bc617526 authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

be2net: add a counter for pkts dropped in xmit path

In the xmit path, the driver may drop some pkts due to reasons such as
DMA mapping errors, out of memory conditions or to protect HW from
unrecoverable errors. Add a counter in TX-stats for such drops.
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2632bafd
...@@ -225,6 +225,7 @@ struct be_tx_stats { ...@@ -225,6 +225,7 @@ struct be_tx_stats {
u64 tx_compl; u64 tx_compl;
ulong tx_jiffies; ulong tx_jiffies;
u32 tx_stops; u32 tx_stops;
u32 tx_drv_drops; /* pkts dropped by driver */
struct u64_stats_sync sync; struct u64_stats_sync sync;
struct u64_stats_sync sync_compl; struct u64_stats_sync sync_compl;
}; };
......
...@@ -155,7 +155,9 @@ static const struct be_ethtool_stat et_tx_stats[] = { ...@@ -155,7 +155,9 @@ static const struct be_ethtool_stat et_tx_stats[] = {
/* Number of times the TX queue was stopped due to lack /* Number of times the TX queue was stopped due to lack
* of spaces in the TXQ. * of spaces in the TXQ.
*/ */
{DRVSTAT_TX_INFO(tx_stops)} {DRVSTAT_TX_INFO(tx_stops)},
/* Pkts dropped in the driver's transmit path */
{DRVSTAT_TX_INFO(tx_drv_drops)}
}; };
#define ETHTOOL_TXSTATS_NUM (ARRAY_SIZE(et_tx_stats)) #define ETHTOOL_TXSTATS_NUM (ARRAY_SIZE(et_tx_stats))
......
...@@ -935,8 +935,10 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -935,8 +935,10 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
u32 start = txq->head; u32 start = txq->head;
skb = be_xmit_workarounds(adapter, skb, &skip_hw_vlan); skb = be_xmit_workarounds(adapter, skb, &skip_hw_vlan);
if (!skb) if (!skb) {
tx_stats(txo)->tx_drv_drops++;
return NETDEV_TX_OK; return NETDEV_TX_OK;
}
wrb_cnt = wrb_cnt_for_skb(adapter, skb, &dummy_wrb); wrb_cnt = wrb_cnt_for_skb(adapter, skb, &dummy_wrb);
...@@ -965,6 +967,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -965,6 +967,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, struct net_device *netdev)
be_tx_stats_update(txo, wrb_cnt, copied, gso_segs, stopped); be_tx_stats_update(txo, wrb_cnt, copied, gso_segs, stopped);
} else { } else {
txq->head = start; txq->head = start;
tx_stats(txo)->tx_drv_drops++;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} }
return NETDEV_TX_OK; return NETDEV_TX_OK;
......
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