diff options
| author | Alexandre Cassen <acassen@corp.free.fr> | 2026-10-21 21:32:19 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-26 16:16:33 -0700 |
| commit | 4b3a32b56e5bada8e05ddaba1340ade9d0f22679 (patch) | |
| tree | def5dee6ff88d3a413f6682e5729aed76010f855 /tools | |
| parent | 9463e8d8c6922a5aa87f7e4fe6deb4f16925d498 (diff) | |
selftests: tc-testing: test offload flags of reused matchall actions
Check that a skip_hw filter leaves the flags of an action it reuses
unchanged, even when the filter add fails on a later action. Also check
that a filter without skip_hw still cannot reuse a skip_hw action. The
dummy device has no tc offload, so skip_hw stands in for skip_sw.
Signed-off-by: Alexandre Cassen <acassen@corp.free.fr>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20261021193222.1318333-3-acassen@corp.free.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json index f8d28c415bc3..6b3eea401fc8 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json +++ b/tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json @@ -482,6 +482,77 @@ ] }, { + "id": "230c", + "name": "Keep the flags of a gact action reused by a matchall filter with skip_hw", + "category": [ + "filter", + "matchall" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "$TC qdisc add dev $DUMMY ingress", + "$TC filter add dev $DUMMY parent ffff: handle 0x1 prio 1 protocol ipv4 matchall action gact pass index 199" + ], + "cmdUnderTest": "$TC filter add dev $DUMMY parent ffff: handle 0x2 prio 2 protocol ipv4 matchall skip_hw action gact pass index 199", + "expExitCode": "0", + "verifyCmd": "$TC actions get action gact index 199", + "matchPattern": "skip_hw", + "matchCount": "0", + "teardown": [ + "$TC qdisc del dev $DUMMY ingress" + ] + }, + { + "id": "1f7a", + "name": "Keep the flags of a gact action reused by a rejected matchall filter with skip_hw", + "category": [ + "filter", + "matchall" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "$TC qdisc add dev $DUMMY ingress", + "$TC actions add action gact pass index 200", + "$TC filter add dev $DUMMY parent ffff: handle 0x1 prio 1 protocol ipv4 matchall action gact pass index 199" + ], + "cmdUnderTest": "$TC filter add dev $DUMMY parent ffff: handle 0x2 prio 2 protocol ipv4 matchall skip_hw action gact pass index 199 action gact pass index 200", + "expExitCode": "2", + "verifyCmd": "$TC actions get action gact index 199", + "matchPattern": "skip_hw", + "matchCount": "0", + "teardown": [ + "$TC qdisc del dev $DUMMY ingress", + "$TC actions del action gact index 200" + ] + }, + { + "id": "9117", + "name": "Reject the reuse of a skip_hw gact action by a matchall filter without skip_hw", + "category": [ + "filter", + "matchall" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "$TC qdisc add dev $DUMMY ingress", + "$TC filter add dev $DUMMY parent ffff: handle 0x1 prio 1 protocol ipv4 matchall skip_hw action gact pass index 199" + ], + "cmdUnderTest": "$TC filter add dev $DUMMY parent ffff: handle 0x2 prio 2 protocol ipv4 matchall action gact pass index 199", + "expExitCode": "2", + "verifyCmd": "$TC filter get dev $DUMMY parent ffff: handle 2 prio 2 protocol ipv4 matchall", + "matchPattern": "^filter parent ffff: protocol ip pref 2 matchall.*handle 0x2.*", + "matchCount": "0", + "teardown": [ + "$TC qdisc del dev $DUMMY ingress" + ] + }, + { "id": "2638", "name": "Add matchall and try to get it", "category": [ |
