Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/tc-testing: Test htb_dequeue_tree with deactivation and row emptying

Ensure that any deactivation and row emptying that occurs
during htb_dequeue_tree does not cause a kernel panic.
This scenario originally triggered a kernel BUG_ON, and
we are checking for a graceful fail now.

Signed-off-by: William Liu <will@willsroot.io>
Signed-off-by: Savino Dicanosa <savy@syst3mfailure.io>
Link: https://patch.msgid.link/20250717022912.221426-1-will@willsroot.io
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

William Liu and committed by
Jakub Kicinski
88b06e4f 0e1d5d9b

+26
+26
tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
··· 128 128 ] 129 129 }, 130 130 { 131 + "id": "5456", 132 + "name": "Test htb_dequeue_tree with deactivation and row emptying", 133 + "category": [ 134 + "qdisc", 135 + "htb" 136 + ], 137 + "plugins": { 138 + "requires": "nsPlugin" 139 + }, 140 + "setup": [ 141 + "$IP link set dev $DUMMY up || true", 142 + "$IP addr add 10.10.11.10/24 dev $DUMMY || true", 143 + "$TC qdisc add dev $DUMMY root handle 1: htb default 1", 144 + "$TC class add dev $DUMMY parent 1: classid 1:1 htb rate 64bit ", 145 + "$TC qdisc add dev $DUMMY parent 1:1 handle 2: netem", 146 + "$TC qdisc add dev $DUMMY parent 2:1 handle 3: blackhole" 147 + ], 148 + "cmdUnderTest": "ping -c1 -W0.01 -I $DUMMY 10.10.11.11", 149 + "expExitCode": "1", 150 + "verifyCmd": "$TC -j qdisc show dev $DUMMY", 151 + "matchJSON": [], 152 + "teardown": [ 153 + "$TC qdisc del dev $DUMMY root" 154 + ] 155 + }, 156 + { 131 157 "id": "c024", 132 158 "name": "Test TBF with SKBPRIO - catch qlen corner cases", 133 159 "category": [