Skip to contentSkip to conversation

selftests/tc-testing: Add test for echo of big TC filters

PATCH Superseded Toke Høiland-Jørgensen 2 participants 2 messages Apr 9, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/tc-testing: Add test for echo of big TC filters

Add a selftest that checks whether the kernel can successfully echo a big tc filter, to test the fix introduced in commit:

369609fc6272 ("tc: Ensure we have enough buffer space when sending filter netlink notifications")

---
 .../tc-testing/tc-tests/filters/u32.json      | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
tools/testing/selftests/tc-testing/tc-tests/filters/u32.json +22 -0
index b2ca9d4e991b..67117f86fef0 100644
@@ -353,5 +353,27 @@
         "teardown": [
             "$TC qdisc del dev $DEV1 parent root drr"
         ]
+    },
+    {
+        "id": "33f4",
+        "name": "Check echo of big filter command",
+        "category": [
+            "filter",
+            "u32"
+        ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
+        "setup": [
+            "$TC qdisc add dev $DEV1 parent root handle 10: fq_codel"
+        ],
+        "cmdUnderTest": "bash -c '$TC -echo filter add dev $DEV1 parent 10: u32 match u32 0 0 $(for i in $(seq 32); do echo action pedit munge ip dport set 22; done) | grep \"added filter\"'",
+        "verifyCmd": "",
+        "expExitCode": "0",
+        "matchCount": "0",
+        "matchPattern": "",
+        "teardown": [
+            "$TC qdisc del dev $DEV1 parent root fq_codel"
+        ]
     }
 ]
Signature · 1 line
2.49.0
#1 lore raw
Quoted 8 lines · Toke Høiland-Jørgensen

Add a selftest that checks whether the kernel can successfully echo a big tc filter, to test the fix introduced in commit:

369609fc6272 ("tc: Ensure we have enough buffer space when sending filter netlink notifications")

---
 .../tc-testing/tc-tests/filters/u32.json      | 22 +++++++++++++++++++

I think tools/testing/selftests/tc-testing/tc-tests/infra/actions.json is a better place since this is not specific to u32 filter (although you use it for testing).

Thanks!