Commit dcc6abae authored by Michael Shteinbok's avatar Michael Shteinbok Committed by David S. Miller

qede - Add a statistic for a case where driver drops tx packet due to memory allocation failure.

skb_linearization can fail due to memory allocation failure.
In such a case, the driver will drop the packet. In such a case
The driver used to print an error message.
This patch replaces this error message by a dedicated statistic.
Signed-off-by: default avatarMichael Shteinbok <michael.shteinbok@cavium.com>
Signed-off-by: default avatarAriel Elior <ariel.elior@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c1cb11bc
...@@ -381,6 +381,7 @@ struct qede_tx_queue { ...@@ -381,6 +381,7 @@ struct qede_tx_queue {
u64 xmit_pkts; u64 xmit_pkts;
u64 stopped_cnt; u64 stopped_cnt;
u64 tx_mem_alloc_err;
__le16 *hw_cons_ptr; __le16 *hw_cons_ptr;
......
...@@ -73,6 +73,7 @@ static const struct { ...@@ -73,6 +73,7 @@ static const struct {
} qede_tqstats_arr[] = { } qede_tqstats_arr[] = {
QEDE_TQSTAT(xmit_pkts), QEDE_TQSTAT(xmit_pkts),
QEDE_TQSTAT(stopped_cnt), QEDE_TQSTAT(stopped_cnt),
QEDE_TQSTAT(tx_mem_alloc_err),
}; };
#define QEDE_STAT_OFFSET(stat_name, type, base) \ #define QEDE_STAT_OFFSET(stat_name, type, base) \
......
...@@ -1466,8 +1466,8 @@ netdev_tx_t qede_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -1466,8 +1466,8 @@ netdev_tx_t qede_start_xmit(struct sk_buff *skb, struct net_device *ndev)
#if ((MAX_SKB_FRAGS + 2) > ETH_TX_MAX_BDS_PER_NON_LSO_PACKET) #if ((MAX_SKB_FRAGS + 2) > ETH_TX_MAX_BDS_PER_NON_LSO_PACKET)
if (qede_pkt_req_lin(skb, xmit_type)) { if (qede_pkt_req_lin(skb, xmit_type)) {
if (skb_linearize(skb)) { if (skb_linearize(skb)) {
DP_NOTICE(edev, txq->tx_mem_alloc_err++;
"SKB linearization failed - silently dropping this SKB\n");
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