net: bcmgenet: Be drop monitor friendly while re-allocating headroom
authorDoug Berger <opendmb@gmail.com>
Wed, 18 Dec 2019 00:51:14 +0000 (16:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Dec 2019 02:11:10 +0000 (18:11 -0800)
During bcmgenet_put_tx_csum() make sure we differentiate a SKB
headroom re-allocation failure from the normal swap and replace
path.

Signed-off-by: Doug Berger <opendmb@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index 13e9154db25360916de8085bc08d1ed59e0972b5..e2bca19bf10b8f4eb20af90707e32bea1182a38b 100644 (file)
@@ -1499,11 +1499,12 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev,
                 * enough headroom for us to insert 64B status block.
                 */
                new_skb = skb_realloc_headroom(skb, sizeof(*status));
-               dev_kfree_skb(skb);
                if (!new_skb) {
+                       dev_kfree_skb_any(skb);
                        dev->stats.tx_dropped++;
                        return NULL;
                }
+               dev_consume_skb_any(skb);
                skb = new_skb;
        }