Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: fix __dev_kfree_skb_any() vs drop monitor

dev_kfree_skb() is aliased to consume_skb().

When a driver is dropping a packet by calling dev_kfree_skb_any()
we should propagate the drop reason instead of pretending
the packet was consumed.

Note: Now we have enum skb_drop_reason we could remove
enum skb_free_reason (for linux-6.4)

v2: added an unlikely(), suggested by Yunsheng Lin.

Fixes: e6247027e517 ("net: introduce dev_consume_skb_any()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
ac3ad195 1862de92

+3 -1
+3 -1
net/core/dev.c
··· 3134 3134 { 3135 3135 if (in_hardirq() || irqs_disabled()) 3136 3136 __dev_kfree_skb_irq(skb, reason); 3137 + else if (unlikely(reason == SKB_REASON_DROPPED)) 3138 + kfree_skb(skb); 3137 3139 else 3138 - dev_kfree_skb(skb); 3140 + consume_skb(skb); 3139 3141 } 3140 3142 EXPORT_SYMBOL(__dev_kfree_skb_any); 3141 3143