]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: netfilter: tone-down conntrack clash test
authorFlorian Westphal <fw@strlen.de>
Mon, 21 Jul 2025 22:36:49 +0000 (00:36 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 23 Jul 2025 01:26:54 +0000 (18:26 -0700)
commitdca56cc8b5c3bee889d6cb0d2ee3e933b21cb4ec
tree3912e7fe8ce3e5491670c6f9959b6d4d39ba86e6
parent71c33df471a6ed40cc3ec7902cf889d813219b07
selftests: netfilter: tone-down conntrack clash test

The test is supposed to observe that the 'clash_resolve' stat counter
incremented (i.e., the code path was covered).
This check was incorrect, 'conntrack -S' needs to be called in the
revevant namespace, not the initial netns.

The clash resolution logic in conntrack is only exercised when multiple
packets with the same udp quadruple race. Depending on kernel config,
number of CPUs, scheduling policy etc.  this might not trigger even
after several retries.  Thus the script eventually returns SKIP if the
retry count is exceeded.

The udpclash tool with also exit with a failure if it did not observe
the expected number of replies.

In the script, make a note of this but do not fail anymore, just check if
the clash resolution logic triggered after all.

Remove the 'single-core' test: while unlikely, with preemptible kernel it
should be possible to also trigger clash resolution logic.

With this change the test will either SKIP or pass.

Hard error could be restored later once its clear whats going on, so
also dump 'conntrack -S' when some packets went missing to see if
conntrack dropped them on insert.

Fixes: 78a588363587 ("selftests: netfilter: add conntrack clash resolution test case")
Signed-off-by: Florian Westphal <fw@strlen.de>
Link: https://patch.msgid.link/20250721223652.6956-1-fw@strlen.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/netfilter/conntrack_clash.sh