[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250713214748.1377876-5-xiyou.wangcong@gmail.com>
Date: Sun, 13 Jul 2025 14:47:48 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: jhs@...atatu.com,
will@...lsroot.io,
stephen@...workplumber.org,
Cong Wang <xiyou.wangcong@...il.com>
Subject: [Patch v3 net 4/4] selftests/tc-testing: Add a test case for mq with netem duplicate
This is a very reasonable use case for multiqueue NIC, add it to
tc-testing to ensure no one should break it.
Test 94a8: Test MQ with NETEM duplication
[ 753.877611] v0p0id94a8: entered promiscuous mode
[ 753.909783] virtio_net virtio0 enp1s0: entered promiscuous mode
[ 753.936686] virtio_net virtio0 enp1s0: left promiscuous mode
.
Sent 1 packets.
[ 753.984974] v0p0id94a8: left promiscuous mode
[ 754.010725] v0p0id94a8: entered promiscuous mode
.
Sent 1 packets.
[ 754.030879] v0p0id94a8: left promiscuous mode
[ 754.067966] v0p0id94a8: entered promiscuous mode
.
Sent 1 packets.
[ 754.096516] v0p0id94a8: left promiscuous mode
[ 754.129166] v0p0id94a8: entered promiscuous mode
.
Sent 1 packets.
[ 754.156371] v0p0id94a8: left promiscuous mode
[ 754.187278] v0p0id94a8: entered promiscuous mode
.
Sent 1 packets.
[ 754.212102] v0p0id94a8: left promiscuous mode
All test results:
1..1
ok 1 94a8 - Test MQ with NETEM duplication
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
---
.../tc-testing/tc-tests/infra/qdiscs.json | 30 +++++++++++++++++++
1 file changed, 30 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 bfa6de751270..8e206260fa79 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
@@ -701,5 +701,35 @@
"teardown": [
"$TC qdisc del dev $DUMMY root handle 1: prio"
]
+ },
+ {
+ "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%"
+ ],
+ "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": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 root handle 1: mq"
+ ]
}
]
--
2.34.1
Powered by blists - more mailing lists