[PATCH net-next] selftests: tc-testing: keep IPv6 autoconf out of exact-counter checks

DORMANTno replies REVIEWED: 2 (2M)

From: Victor Nogueira <hidden>
Date: 2026-10-15 19:15:33
Subsystem: kernel selftest framework, the rest · Maintainers: Shuah Khan, Shuah Khan, Linus Torvalds

1 review trailer.

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help