Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] selftests: tc-testing: keep IPv6 autoconf out of exact-counter checks
@ 2026-10-15 19:15 Victor Nogueira
  2026-10-21  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Victor Nogueira @ 2026-10-15 19:15 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, jhs, jiri; +Cc: horms, netdev

Several tc-testing cases assert an exact bytes/packets value from a single
injected frame, but count every frame that traverses an egress qdisc (or
match with "protocol all"). Every case creates a fresh veth pair (and, for
the gso_skb cases, a netdevsim device) and brings it up with IPv6 enabled;
a device whose link-local autoconfiguration runs then emits neighbour
solicitations, MLD reports and router solicitations for a few seconds.
Those are ordinary Ethernet frames (0x86DD) and are counted too, so the
exact assertions race with the autoconf burst and fail intermittently. The
$DEV0 peer of the veth pair lives in the init netns, so its frames follow
the init-netns IPv6 sysctls.

Conditions to recreate the bug:
Run the affected cases with IPv6 enabled (the tdc default) on net-next
(7.3.0-rc6+). 4e6b fails intermittently (4/6 here); the four netdevsim
"gso_skb" cases fail intermittently too (fb6c 1/25, 0235 4/15, 476f 4/8).
1922 did not trip in the sampled runs but shares the same setup and is
fixed for uniformity. Each failure carries a stray autoconf frame, e.g.
"bytes: 98 != 188".

The Fix:
Fix the affected cases:

 - actions/ife.json 4e6b injects only an 0xED3E frame but matches with
   "protocol all"; scope the filter to that ethertype.

 - The four netdevsim "gso_skb" cases (fb6c, 1922, 476f, 0235) create $ETH
   from within the case and bring it up immediately before installing the
   qdiscs, so the autoconf burst overlaps the measurement. Set
   "addrgenmode none" before the link is brought up, so the device
   generates no link-local address and the counter holds only the injected
   packet. IPv6 stays usable (a manually added address still works), so
   cases that exercise IPv6 are unaffected. On a kernel without IPv6
   (CONFIG_IPV6=n, or booted with ipv6.disable=1) the attribute is not
   available, so the line is made non-fatal like every neighbouring setup
   line.

With this change the affected cases pass 20/20, and the whole ife.json
(51/51) and infra/qdiscs.json (48/48) suites pass, as do the protocol-ipv6
matchall cases (filters/matchall.json 0596, 41df, 8bd2, 2a4a).

Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
---
 tools/testing/selftests/tc-testing/tc-tests/actions/ife.json  | 2 +-
 tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json b/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json
index ece7ec41bf99..135e9fdc6e02 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json
@@ -1408,7 +1408,7 @@
                 "packet": "Ether(type=0xED3E) / Raw(b'\\x00\\x02\\xaa')"
             }
         ],
-        "cmdUnderTest": "$TC filter add dev $DEV1 ingress protocol all matchall action ife decode pipe index 10",
+        "cmdUnderTest": "$TC filter add dev $DEV1 ingress protocol 0xED3E matchall action ife decode pipe index 10",
         "expExitCode": "0",
         "verifyCmd": "$TC -s -j actions get action ife index 10",
         "matchJSON": [
diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
index 0cf12c50fb74..556a1dda1047 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
@@ -1555,6 +1555,7 @@
         },
         "setup": [
             "echo \"1 1 4\" > /sys/bus/netdevsim/new_device",
+            "$IP link set dev $ETH addrgenmode none || true",
             "$IP link set dev $ETH up || true",
             "$IP l set addr 01:02:03:04:05:06 dev $ETH || true",
             "$IP n add dev $ETH 10.10.11.1 lladdr 01:02:03:04:05:06 dev $ETH || true",
@@ -1598,6 +1599,7 @@
         },
         "setup": [
             "echo \"1 1 4\" > /sys/bus/netdevsim/new_device",
+            "$IP link set dev $ETH addrgenmode none || true",
             "$IP link set dev $ETH up || true",
             "$IP l set addr 01:02:03:04:05:06 dev $ETH || true",
             "$IP n add dev $ETH 10.10.11.1 lladdr 01:02:03:04:05:06 dev $ETH || true",
@@ -1640,6 +1642,7 @@
         },
         "setup": [
             "echo \"1 1 4\" > /sys/bus/netdevsim/new_device",
+            "$IP link set dev $ETH addrgenmode none || true",
             "$IP link set dev $ETH up || true",
             "$IP l set addr 01:02:03:04:05:06 dev $ETH || true",
             "$IP n add dev $ETH 10.10.11.1 lladdr 01:02:03:04:05:06 dev $ETH || true",
@@ -1680,6 +1683,7 @@
         },
         "setup": [
             "echo \"1 1 4\" > /sys/bus/netdevsim/new_device",
+            "$IP link set dev $ETH addrgenmode none || true",
             "$IP link set dev $ETH up || true",
             "$IP l set addr 01:02:03:04:05:06 dev $ETH || true",
             "$IP n add dev $ETH 10.10.11.1 lladdr 01:02:03:04:05:06 dev $ETH || true",
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] selftests: tc-testing: keep IPv6 autoconf out of exact-counter checks
  2026-10-15 19:15 [PATCH net-next] selftests: tc-testing: keep IPv6 autoconf out of exact-counter checks Victor Nogueira
@ 2026-10-21  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-21  2:40 UTC (permalink / raw)
  To: Victor Nogueira; +Cc: davem, edumazet, kuba, pabeni, jhs, jiri, horms, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 15 Oct 2026 16:15:24 -0300 you wrote:
> Several tc-testing cases assert an exact bytes/packets value from a single
> injected frame, but count every frame that traverses an egress qdisc (or
> match with "protocol all"). Every case creates a fresh veth pair (and, for
> the gso_skb cases, a netdevsim device) and brings it up with IPv6 enabled;
> a device whose link-local autoconfiguration runs then emits neighbour
> solicitations, MLD reports and router solicitations for a few seconds.
> Those are ordinary Ethernet frames (0x86DD) and are counted too, so the
> exact assertions race with the autoconf burst and fail intermittently. The
> $DEV0 peer of the veth pair lives in the init netns, so its frames follow
> the init-netns IPv6 sysctls.
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: tc-testing: keep IPv6 autoconf out of exact-counter checks
    https://git.kernel.org/netdev/net-next/c/eeb63e1e0bfc

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-21  2:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 19:15 [PATCH net-next] selftests: tc-testing: keep IPv6 autoconf out of exact-counter checks Victor Nogueira
2026-10-21  2:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox