]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: nft_queue.sh: add a parallel stress test
authorFernando Fernandez Mancera <fmancera@suse.de>
Mon, 6 Apr 2026 21:18:31 +0000 (23:18 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 8 Apr 2026 11:34:51 +0000 (13:34 +0200)
commitdde1a6084c5ca9d143a562540d5453454d79ea15
treec4fd91980373125079d65da77ef2c315f104b142
parent936206e3f6ff411581e615e930263d6f8b78df9d
selftests: nft_queue.sh: add a parallel stress test

Introduce a new stress test to check for race conditions in the
nfnetlink_queue subsystem, where an entry is freed while another CPU is
concurrently walking the global rhashtable.

To trigger this, `nf_queue.c` is extended with two new flags:
  * -O (out-of-order): Buffers packet IDs and flushes them in reverse.
  * -b (bogus verdicts): Floods the kernel with non-existent packet IDs.

The bogus verdict loop forces the kernel's lookup function to perform
full rhashtable bucket traversals (-ENOENT). Combined with reverse-order
flushing and heavy parallel UDP/ping flooding across 8 queues, this puts
the nfnetlink_queue code under pressure.

Joint work with Florian Westphal.

Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
tools/testing/selftests/net/netfilter/nf_queue.c
tools/testing/selftests/net/netfilter/nft_queue.sh