]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: fix __dev_kfree_skb_any() vs drop monitor
authorEric Dumazet <edumazet@google.com>
Thu, 23 Feb 2023 08:38:45 +0000 (08:38 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:52 +0000 (16:47 +0100)
commit3764c055e673e9e7bb44b7d56e110f3a11ad9e99
treef9c1777f43cbc90008e6cce66a63b0298956ece8
parent6643babbf61a24f126b9b85c616fe71c5626449a
net: fix __dev_kfree_skb_any() vs drop monitor

BugLink: https://bugs.launchpad.net/bugs/2011430
[ Upstream commit ac3ad19584b26fae9ac86e4faebe790becc74491 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/dev.c