[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251126195244.88124-9-xiyou.wangcong@gmail.com>
Date: Wed, 26 Nov 2025 11:52:43 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: stephen@...workplumber.org,
kuba@...nel.org,
Cong Wang <xiyou.wangcong@...il.com>
Subject: [Patch net v5 8/9] selftests/tc-testing: Add a test case for mq with netem duplicate
Given that multi-queue NICs are prevalent and the global spinlock issue with
single netem instances is a known performance limitation, the setup using
mq as a parent for netem is an excellent and highly reasonable pattern for
applying netem effects like 100% duplication efficiently on modern Linux
systems.
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
---
.../tc-testing/tc-tests/infra/qdiscs.json | 31 +++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
index 1f342173e8fe..ce8c9c14dabb 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
@@ -1035,5 +1035,36 @@
"teardown": [
"$TC qdisc del dev $DUMMY clsact"
]
+ },
+ {
+ "id": "94a8",
+ "name": "Test MQ with NETEM duplication",
+ "category": [
+ "qdisc",
+ "mq",
+ "netem"
+ ],
+ "plugins": {
+ "requires": ["nsPlugin", "scapyPlugin"]
+ },
+ "setup": [
+ "$IP link set dev $DEV1 up",
+ "$TC qdisc add dev $DEV1 root handle 1: mq",
+ "$TC qdisc add dev $DEV1 parent 1:1 handle 10: netem duplicate 100%",
+ "$TC qdisc add dev $DEV1 parent 1:2 handle 20: netem duplicate 100%"
+ ],
+ "scapy": {
+ "iface": "$DEV0",
+ "count": 5,
+ "packet": "Ether()/IP(dst='10.10.10.1', src='10.10.10.10')/ICMP()"
+ },
+ "cmdUnderTest": "$TC -s qdisc show dev $DEV1",
+ "expExitCode": "0",
+ "verifyCmd": "$TC -s qdisc show dev $DEV1 | grep -A 5 'qdisc netem' | grep -E 'Sent [0-9]+ bytes [0-9]+ pkt'",
+ "matchPattern": "Sent \\d+ bytes (\\d+) pkt",
+ "matchCount": "2",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 root handle 1: mq"
+ ]
}
]
--
2.34.1
Powered by blists - more mailing lists