From: Cong Wang <xiyou.wangcong@gmail.com>
To: netdev@vger.kernel.org
Cc: Cong Wang <xiyou.wangcong@gmail.com>, William Liu <will@willsroot.io>
Subject: [Patch net v8 5/9] selftests/tc-testing: Add a nested netem duplicate test
Date: Sat, 17 Jan 2026 22:15:11 -0800 [thread overview]
Message-ID: <20260118061515.930322-6-xiyou.wangcong@gmail.com> (raw)
In-Reply-To: <20260118061515.930322-1-xiyou.wangcong@gmail.com>
Integrate the reproducer from William into tc-testing and use scapy
to generate packets for testing:
# ./tdc.py -e 1676
-- ns/SubPlugin.__init__
-- scapy/SubPlugin.__init__
Test 1676: NETEM nested duplicate 100%
[ 1154.071135] v0p0id1676: entered promiscuous mode
[ 1154.101066] virtio_net virtio0 enp1s0: entered promiscuous mode
[ 1154.146301] virtio_net virtio0 enp1s0: left promiscuous mode
.
Sent 1 packets.
[ 1154.173695] v0p0id1676: left promiscuous mode
[ 1154.216159] v0p0id1676: entered promiscuous mode
.
Sent 1 packets.
[ 1154.238398] v0p0id1676: left promiscuous mode
[ 1154.260909] v0p0id1676: entered promiscuous mode
.
Sent 1 packets.
[ 1154.282708] v0p0id1676: left promiscuous mode
[ 1154.309399] v0p0id1676: entered promiscuous mode
.
Sent 1 packets.
[ 1154.337949] v0p0id1676: left promiscuous mode
[ 1154.360924] v0p0id1676: entered promiscuous mode
.
Sent 1 packets.
[ 1154.383522] v0p0id1676: left promiscuous mode
All test results:
1..1
ok 1 1676 - NETEM nested duplicate 100%
Reported-by: William Liu <will@willsroot.io>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
.../tc-testing/tc-tests/qdiscs/netem.json | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
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..03c4ceb22990 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,30 @@
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
+ },
+ {
+ "id": "1676",
+ "name": "NETEM nested duplicate 100%",
+ "category": ["qdisc", "netem"],
+ "setup": [
+ "$TC qdisc add dev $DEV1 root handle 1: netem limit 1000 duplicate 100%",
+ "$TC qdisc add dev $DEV1 parent 1: handle 2: netem limit 1000 duplicate 100%"
+ ],
+ "teardown": [
+ "$TC qdisc del dev $DEV1 root"
+ ],
+ "plugins": {
+ "requires": ["nsPlugin", "scapyPlugin"]
+ },
+ "scapy": {
+ "iface": "$DEV0",
+ "count": 5,
+ "packet": "Ether()/IP(dst='10.10.10.1', src='10.10.10.10')/TCP(sport=12345, dport=80)"
+ },
+ "cmdUnderTest": "$TC -s qdisc show dev $DEV1",
+ "expExitCode": "0",
+ "verifyCmd": "$TC -s qdisc show dev $DEV1",
+ "matchPattern": "Sent [0-9]+ bytes [0-9]+ pkt",
+ "matchCount": "2"
}
]
--
2.34.1
next prev parent reply other threads:[~2026-01-18 6:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-18 6:15 [Patch net v8 0/9] netem: Fix skb duplication logic and prevent infinite loops Cong Wang
2026-01-18 6:15 ` [Patch net v8 1/9] net_sched: Check the return value of qfq_choose_next_agg() Cong Wang
2026-01-18 6:15 ` [Patch net v8 2/9] Revert "net/sched: Restrict conditions for adding duplicating netems to qdisc tree" Cong Wang
2026-01-18 6:15 ` [Patch net v8 3/9] Revert "selftests/tc-testing: Add tests for restrictions on netem duplication" Cong Wang
2026-01-18 6:15 ` [Patch net v8 4/9] net_sched: Implement the right netem duplication behavior Cong Wang
2026-01-18 6:15 ` Cong Wang [this message]
2026-01-18 6:15 ` [Patch net v8 6/9] selftests/tc-testing: Add a test case for prio with netem duplicate Cong Wang
2026-01-18 6:15 ` [Patch net v8 7/9] selftests/tc-testing: Add a test case for mq " Cong Wang
2026-01-18 6:15 ` [Patch net v8 8/9] selftests/tc-testing: Update test cases " Cong Wang
2026-01-18 6:15 ` [Patch net v8 9/9] selftests/tc-testing: Add a test case for HTB with netem Cong Wang
2026-01-18 15:07 ` [Patch net v8 0/9] netem: Fix skb duplication logic and prevent infinite loops Jamal Hadi Salim
2026-01-21 17:08 ` Simon Horman
2026-01-21 18:50 ` Jamal Hadi Salim
2026-01-27 17:15 ` Jakub Kicinski
2026-01-30 20:53 ` Cong Wang
2026-01-30 21:18 ` Jakub Kicinski
2026-01-30 21:32 ` Cong Wang
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=20260118061515.930322-6-xiyou.wangcong@gmail.com \
--to=xiyou.wangcong@gmail.com \
--cc=netdev@vger.kernel.org \
--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