]> git.hungrycats.org Git - linux/commit
netfilter: nf_dup_netdev: add nf_dev_xmit_recursion*() helpers and use them
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 9 Jun 2026 22:03:19 +0000 (00:03 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 14 Jun 2026 11:07:03 +0000 (13:07 +0200)
commit2354e975932dabb06fad239f07a3b68fd1809737
tree25bd0c36ee0e39ce6f9a10e4cbc8fbd1a83e7f16
parent0e2a5d02f1d17c9d31003a46a1f638021c14b3f4
netfilter: nf_dup_netdev: add nf_dev_xmit_recursion*() helpers and use them

Update nft_dup and nft_fwd to use the nf_dev_xmit_recursion() helpers.
This patch also disables BH when transmitting the skb to address a
possible migration to different CPU leading to imbalanced decrementation
of the recursion counters.

This is modeled after Florian Westphal's dev_xmit_recursion*() API
available since commit 97cdcf37b57e ("net: place xmit recursion in
softnet data") according to its current state in the tree.

Fixes: 1d47b55b36d2 ("netfilter: nft_fwd_netdev: use recursion counter in neigh egress path")
Fixes: f37ad9127039 ("netfilter: nf_dup_netdev: Move the recursion counter struct netdev_xmit")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_dup_netdev.h
net/netfilter/nf_dup_netdev.c
net/netfilter/nft_fwd_netdev.c