From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: Victor Nogueira <victor@mojatatu.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Jiri Pirko <jiri@resnulli.us>, Shuah Khan <shuah@kernel.org>,
William Liu <will@willsroot.io>, Jakub Kicinski <kuba@kernel.org>,
Savino Dicanosa <savy@syst3mfailure.io>,
linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST
FRAMEWORK), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v3 7/7] selftests/tc-testing: Add netem test case exercising loops
Date: Thu, 26 Mar 2026 11:01:06 -0700 [thread overview]
Message-ID: <20260326181701.308275-8-stephen@networkplumber.org> (raw)
In-Reply-To: <20260326181701.308275-1-stephen@networkplumber.org>
From: Victor Nogueira <victor@mojatatu.com>
Add a netem nested duplicate test case to validate that it won't
cause an infinite loop
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
---
.../tc-testing/tc-tests/qdiscs/netem.json | 33 ++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json
index 3c4444961488..7c954989069d 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/netem.json
@@ -336,5 +336,36 @@
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
- }
+ },
+ {
+ "id": "8c17",
+ "name": "Test netem's recursive duplicate",
+ "category": [
+ "qdisc",
+ "netem"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [
+ "$IP link set dev $DUMMY up || true",
+ "$IP addr add 10.10.11.10/24 dev $DUMMY || true",
+ "$TC qdisc add dev $DUMMY root handle 1: netem limit 1 duplicate 100%",
+ "$TC qdisc add dev $DUMMY parent 1: handle 2: netem duplicate 100%"
+ ],
+ "cmdUnderTest": "ping -c 1 10.10.11.11 -W 0.01",
+ "expExitCode": "1",
+ "verifyCmd": "$TC -s -j qdisc ls dev $DUMMY root",
+ "matchJSON": [
+ {
+ "kind": "netem",
+ "handle": "1:",
+ "bytes": 294,
+ "packets": 3
+ }
+ ],
+ "teardown": [
+ "$TC qdisc del dev $DUMMY handle 1: root"
+ ]
+ }
]
--
2.53.0
prev parent reply other threads:[~2026-03-26 18:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 18:00 [PATCH net v3 0/7] net/sched: Fix packet loops in mirred and netem Stephen Hemminger
2026-03-26 18:01 ` [PATCH v3 1/7] net: Introduce skb tc depth field to track packet loops Stephen Hemminger
2026-03-26 18:01 ` [PATCH v3 2/7] net/sched: Revert "net/sched: Restrict conditions for adding duplicating netems to qdisc tree" Stephen Hemminger
2026-03-26 18:01 ` [PATCH v3 3/7] Revert "selftests/tc-testing: Add tests for restrictions on netem duplication" Stephen Hemminger
2026-03-26 18:01 ` [PATCH v3 4/7] net/sched: fix packet loop on netem when duplicate is on Stephen Hemminger
2026-03-26 18:01 ` [PATCH v3 5/7] net/sched: Fix ethx:ingress -> ethy:egress -> ethx:ingress mirred loop Stephen Hemminger
2026-03-26 18:01 ` [PATCH v3 6/7] selftests/tc-testing: Add mirred test cases exercising loops Stephen Hemminger
2026-03-26 18:01 ` Stephen Hemminger [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=20260326181701.308275-8-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=savy@syst3mfailure.io \
--cc=shuah@kernel.org \
--cc=victor@mojatatu.com \
--cc=will@willsroot.io \
/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