]> git.baikalelectronics.ru Git - kernel.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:26 +0000 (13:55 +0100)
commit18a8d8a87f226b8bb2827cb78eaf0ce5b6787f70
treea84a9c8513ab1bc6547e6779be720b5c8f8be03a
parente468c5f2c7f3031536c43b982b3f2099e8a19477
net: fix __dev_kfree_skb_any() vs drop monitor

[ Upstream commit 1f05c1145090013cabbb87d4bf768614089aa3ab ]

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: 6630035b286c ("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