qede - Add a statistic for a case where driver drops tx packet due to memory allocati...
authorMichael Shteinbok <michael.shteinbok@cavium.com>
Thu, 29 Nov 2018 08:50:19 +0000 (10:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Nov 2018 18:41:58 +0000 (10:41 -0800)
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: Michael Shteinbok <michael.shteinbok@cavium.com>
Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede.h
drivers/net/ethernet/qlogic/qede/qede_ethtool.c
drivers/net/ethernet/qlogic/qede/qede_fp.c

index 8c0fe59eaad5d1ee8aabf1617908606b52be8e70..613249d1e967d5310df16de8576f3a4d9c317521 100644 (file)
@@ -381,6 +381,7 @@ struct qede_tx_queue {
 
        u64 xmit_pkts;
        u64 stopped_cnt;
+       u64 tx_mem_alloc_err;
 
        __le16 *hw_cons_ptr;
 
index 8cbbd628fd7355c5d63c346775f162a6deaf4bd3..16331c6c6fa7dc00bd82dbf37ddc5568d34dd3e3 100644 (file)
@@ -73,6 +73,7 @@ static const struct {
 } qede_tqstats_arr[] = {
        QEDE_TQSTAT(xmit_pkts),
        QEDE_TQSTAT(stopped_cnt),
+       QEDE_TQSTAT(tx_mem_alloc_err),
 };
 
 #define QEDE_STAT_OFFSET(stat_name, type, base) \
index 1a78027de071f1bc2286f0a6d31288feb8b84584..bdf816fe5a16cf8c5d1cdf4b72812e49e3a6d688 100644 (file)
@@ -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 (qede_pkt_req_lin(skb, xmit_type)) {
                if (skb_linearize(skb)) {
-                       DP_NOTICE(edev,
-                                 "SKB linearization failed - silently dropping this SKB\n");
+                       txq->tx_mem_alloc_err++;
+
                        dev_kfree_skb_any(skb);
                        return NETDEV_TX_OK;
                }