Re: [PATCH net 2/2] selftests: tc-testing: add u32 node ID pool exhaustion test
Jamal Hadi Salim <[email protected]>
| Newsgroups | org.kernel.vger.netdev,org.kernel.vger.stable |
|---|---|
| Message-ID | <CAM0EoMkRjG0-ssck6b39JA_439U3N=s3nEt3Av1PVZzvcA_E1w@mail.gmail.com> |
On Thu, Aug 20, 2026 at 5:52 AM Jamal Hadi Salim <[email protected]> wrote: > > Add a tdc test case (7ec8) that fills the u32 node ID space with 4095 > auto-generated handles, then attempts to add a 4096th. On the fixed > kernel the 4096th filter is rejected with ENOSPC (exit 2). On the > unfixed kernel it silently succeeds with a duplicate handle. > > Fixes: e7614370d6f04 ("net_sched: use idr to allocate u32 filter handles") > Signed-off-by: Jamal Hadi Salim <[email protected]> > --- > .../tc-testing/tc-tests/filters/u32.json | 23 +++++++++++++++++++ > 1 file changed, 23 insertions(+) > > diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json b/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json > index b2ca9d4e991b..b9019b14d05c 100644 > --- a/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json > +++ b/tools/testing/selftests/tc-testing/tc-tests/filters/u32.json > @@ -353,5 +353,28 @@ > "teardown": [ > "$TC qdisc del dev $DEV1 parent root drr" > ] > + }, > + { > + "id": "7ec8", > + "name": "Add u32 filter when node ID pool is exhausted (4096th filter rejected)", > + "category": [ > + "filter", > + "u32" > + ], > + "plugins": { > + "requires": "nsPlugin" > + }, > + "setup": [ > + "$TC qdisc add dev $DUMMY clsact", > + "yes 'filter add dev $DUMMY ingress prio 1 protocol ip u32 match u8 0 0 at 0' | head -n 4095 | $TC -b -" > + ], > + "cmdUnderTest": "$TC filter add dev $DUMMY ingress prio 1 protocol ip u32 match u8 0 0 at 0", > + "expExitCode": "2", > + "verifyCmd": "$TC filter show dev $DUMMY ingress", > + "matchPattern": "pref 1 u32", > + "matchCount": "4095", > + "teardown": [ > + "$TC qdisc del dev $DUMMY clsact" > + ] > } > ] > -- > 2.43.0 Some of our long running tests have failed because primarily of the tdc test in this set. Will resend with a renewed tdc test. Hopefully my attempt at this pw-bot thing works. -- pw-bot: cr