summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/tc-testing/tc-tests/qdiscs
diff options
context:
space:
mode:
authorDavide Caratti <dcaratti@redhat.com>2026-03-19 19:40:56 +0100
committerJakub Kicinski <kuba@kernel.org>2026-03-20 20:13:14 -0700
commit5754a1c9f9b6e298791c4bb34263f37dfe93ee35 (patch)
treee74d085ed304bc7137e0eff4f5f9a4a6c0bc32c6 /tools/testing/selftests/tc-testing/tc-tests/qdiscs
parentabdf5133bfa12c45d402f7b73d39bca772f3644a (diff)
downloadlwn-5754a1c9f9b6e298791c4bb34263f37dfe93ee35.tar.gz
lwn-5754a1c9f9b6e298791c4bb34263f37dfe93ee35.zip
tc-testing: add a test case for ETS offload
While reviewing the fix for unintentional u32 overflows in ets offload code, Jamal said: [...] > otherwise a tdc test should cover it fine (when you get to the > netdevsim change perhaps) Extend tdc to allow setting hw-tc-offload via ethtool, and add a test case to reproduce the division by zero fixed in [1]. [1] https://lore.kernel.org/all/CAM0EoMm17wsYZmdFLshH3_-GrZtzd=i0xnoO2yiVB=-N4761mw@mail.gmail.com/ Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Co-developed-by: Victor Nogueira <victor@mojatatu.com> Signed-off-by: Victor Nogueira <victor@mojatatu.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Link: https://patch.msgid.link/39129c374cbd00147b8c5afc04db59db62b50acc.1773945414.git.dcaratti@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/tc-testing/tc-tests/qdiscs')
-rw-r--r--tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json
index a5d94cdec605..ee09e6d6fdf3 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json
@@ -984,5 +984,28 @@
"matchCount": "1",
"teardown": [
]
+ },
+ {
+ "id": "41f5",
+ "name": "ETS offload where the sum of quanta wraps u32",
+ "category": [
+ "qdisc",
+ "ets"
+ ],
+ "plugins": {
+ "requires": "nsPlugin"
+ },
+ "setup": [
+ "echo \"1 1 4\" > /sys/bus/netdevsim/new_device",
+ "$ETHTOOL -K $ETH hw-tc-offload on"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $ETH root ets quanta 4294967294 1 1",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $ETH",
+ "matchPattern": "qdisc ets .*bands 3 quanta 4294967294 1 1",
+ "matchCount": "1",
+ "teardown": [
+ "echo \"1\" > /sys/bus/netdevsim/del_device"
+ ]
}
]