]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bnxt: count Tx drops
authorJakub Kicinski <kuba@kernel.org>
Thu, 12 Aug 2021 21:42:42 +0000 (14:42 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Aug 2021 17:26:17 +0000 (10:26 -0700)
Drivers should count packets they are dropping.

Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 389016ea65cf6777889b2315f16746c519ef26f6..dd2d2a5fef15b558f26ac60f528dc0c9789e9713 100644 (file)
@@ -412,6 +412,7 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
        i = skb_get_queue_mapping(skb);
        if (unlikely(i >= bp->tx_nr_rings)) {
                dev_kfree_skb_any(skb);
+               atomic_long_inc(&dev->tx_dropped);
                return NETDEV_TX_OK;
        }
 
@@ -687,6 +688,7 @@ tx_kick_pending:
        if (txr->kick_pending)
                bnxt_txr_db_kick(bp, txr, txr->tx_prod);
        txr->tx_buf_ring[txr->tx_prod].skb = NULL;
+       atomic_long_inc(&dev->tx_dropped);
        return NETDEV_TX_OK;
 }