From: Muhammad Umer <mumer.mobi@gmail.com>
To: jhs@mojatatu.com, jiri@resnulli.us
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, willemb@google.com,
shuah@kernel.org, netdev@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: [PATCH net 2/2] selftests/tc-testing: add gact goto chain cross-block bind tests
Date: Sun, 6 Dec 2026 05:20:12 -0500 [thread overview]
Message-ID: <20261206102012.2264-3-mumer.mobi@gmail.com> (raw)
In-Reply-To: <20261206102012.2264-1-mumer.mobi@gmail.com>
Add two gact cases: binding an action whose goto chain belongs to the
block of another qdisc must fail and leave the action untouched, while
binding it from a filter of the same block keeps working.
The first case fails without the previous patch and passes with it.
These tests were written with the help of an AI assistant.
Signed-off-by: Muhammad Umer <mumer.mobi@gmail.com>
---
.../actions/gact-goto-chain-block.json | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json b/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json
new file mode 100644
index 00000000000..147c5200b52
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json
@@ -0,0 +1,54 @@
+[
+ {
+ "id": "23ab",
+ "name": "Reject binding an action whose goto chain is in another block",
+ "category": [
+ "actions",
+ "gact"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [
+ "$TC qdisc add dev $DUMMY root handle 1: drr",
+ "$TC class add dev $DUMMY parent 1: classid 1:1 drr",
+ "$TC filter add dev $DUMMY parent 1: chain 5 protocol all prio 1 matchall classid 1:1",
+ "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 1 matchall action gact goto chain 5 index 77",
+ "$TC qdisc add dev $DEV1 root handle 2: htb"
+ ],
+ "cmdUnderTest": "$TC filter add dev $DEV1 parent 2: protocol all prio 1 matchall action gact pass index 77",
+ "expExitCode": "2",
+ "verifyCmd": "$TC actions get action gact index 77",
+ "matchPattern": "index 77 ref 1 bind 1",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 root",
+ "$TC qdisc del dev $DUMMY root"
+ ]
+ },
+ {
+ "id": "8ada",
+ "name": "Bind an action whose goto chain is in the same block",
+ "category": [
+ "actions",
+ "gact"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [
+ "$TC qdisc add dev $DUMMY root handle 1: drr",
+ "$TC class add dev $DUMMY parent 1: classid 1:1 drr",
+ "$TC filter add dev $DUMMY parent 1: chain 5 protocol all prio 1 matchall classid 1:1",
+ "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 1 matchall action gact goto chain 5 index 77"
+ ],
+ "cmdUnderTest": "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 2 matchall action gact pass index 77",
+ "expExitCode": "0",
+ "verifyCmd": "$TC actions get action gact index 77",
+ "matchPattern": "index 77 ref 2 bind 2",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DUMMY root"
+ ]
+ }
+]
--
2.53.0
prev parent reply other threads:[~2026-12-06 10:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-06 10:20 [PATCH net 0/2] net/sched: reject binding actions with a goto chain of another block Muhammad Umer
2026-12-06 10:20 ` [PATCH net 1/2] net/sched: act_api: reject binding actions that jump to " Muhammad Umer
2026-12-06 10:20 ` Muhammad Umer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261206102012.2264-3-mumer.mobi@gmail.com \
--to=mumer.mobi@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox