mirror of
https://github.com/torvalds/linux.git
synced 2026-10-16 12:50:02 +02:00
The classify-loop fix bounds a walk's non-descending hops, so the guard must not misfire on a legal walk that reaches its leaf through a level-drift lateral chain. Add a case that builds exactly that chain and asserts traffic still reaches the chain's own leaf. A lateral hop can only exist because a bind was legal when it was made and a later class add raised the target's level, so the setup binds each hop while the target is still a leaf and only then deepens it: bind 1:1 -> 1:2 while 1:2 is a leaf, add 1:20 under 1:2, add 1:3 and bind 1:2 -> 1:3 while 1:3 is a leaf, then add 1:30 and 1:31 under 1:3 and bind 1:3 -> 1:31. The walk root -> 1:1 -> 1:2 -> 1:3 -> 1:31 then takes two lateral hops and must reach leaf 1:31. The default class is 1:30, distinct from the asserted leaf, and the verify pattern is anchored to the 1:31 stats line, so neither a fall-through to the default nor a nonzero count on another class can satisfy the check. On the patched kernel the test passes; with the bound forced to zero the walk falls to the default and 1:31 stays idle, so the test fails. Reviewed-by: Victor Nogueira <victor@mojatatu.com> Tested-by: hybris <hybris@mojatatu.ai> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://patch.msgid.link/QDISC-CTUU.v3.20260916184908@mojatatu.com.2 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
208 lines
7.0 KiB
JSON
208 lines
7.0 KiB
JSON
[
|
|
{
|
|
"id": "3254",
|
|
"name": "Create HFSC with default setting",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [],
|
|
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root hfsc",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
|
"matchPattern": "qdisc hfsc 1: root refcnt [0-9]+",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev $DUMMY handle 1: root"
|
|
]
|
|
},
|
|
{
|
|
"id": "0289",
|
|
"name": "Create HFSC with class sc and ul rate setting",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [
|
|
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
|
|
],
|
|
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc sc rate 20000 ul rate 10000",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC class show dev $DUMMY",
|
|
"matchPattern": "class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 20Kbit ul m1 0bit d 0us m2 10Kbit",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev $DUMMY handle 1: root"
|
|
]
|
|
},
|
|
{
|
|
"id": "846a",
|
|
"name": "Create HFSC with class sc umax and dmax setting",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [
|
|
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
|
|
],
|
|
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc sc umax 1540 dmax 5ms rate 10000 ul rate 10000",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC class show dev $DUMMY",
|
|
"matchPattern": "class hfsc 1:1 parent 1: sc m1 2464Kbit d 5ms m2 10Kbit ul m1 0bit d 0us m2 10Kbit",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev $DUMMY handle 1: root"
|
|
]
|
|
},
|
|
{
|
|
"id": "5413",
|
|
"name": "Create HFSC with class rt and ls rate setting",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [
|
|
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
|
|
],
|
|
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc rt rate 20000 ls rate 10000",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC class show dev $DUMMY",
|
|
"matchPattern": "class hfsc 1:1 parent 1: rt m1 0bit d 0us m2 20Kbit ls m1 0bit d 0us m2 10Kbit",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev $DUMMY handle 1: root"
|
|
]
|
|
},
|
|
{
|
|
"id": "9312",
|
|
"name": "Create HFSC with class rt umax and dmax setting",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [
|
|
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
|
|
],
|
|
"cmdUnderTest": "$TC class add dev $DUMMY parent 1: classid 1:1 hfsc rt umax 1540 dmax 5ms rate 10000 ls rate 10000",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC class show dev $DUMMY",
|
|
"matchPattern": "class hfsc 1:1 parent 1: rt m1 2464Kbit d 5ms m2 10Kbit ls m1 0bit d 0us m2 10Kbit",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev $DUMMY handle 1: root"
|
|
]
|
|
},
|
|
{
|
|
"id": "6931",
|
|
"name": "Delete HFSC with handle",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [
|
|
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 11"
|
|
],
|
|
"cmdUnderTest": "$TC qdisc del dev $DUMMY handle 1: root",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
|
"matchPattern": "qdisc hfsc 1: root refcnt [0-9]+",
|
|
"matchCount": "0",
|
|
"teardown": []
|
|
},
|
|
{
|
|
"id": "8436",
|
|
"name": "Show HFSC class",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [],
|
|
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root hfsc",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC class show dev $DUMMY",
|
|
"matchPattern": "class hfsc 1: root",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev $DUMMY handle 1: root"
|
|
]
|
|
},
|
|
{
|
|
"id": "bef4",
|
|
"name": "HFSC rt inner class upgrade to sc",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [
|
|
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 1",
|
|
"$TC class add dev $DUMMY parent 1: classid 1:1 hfsc rt rate 8"
|
|
],
|
|
"cmdUnderTest": "$TC class add dev $DUMMY parent 1:1 classid 1:2 hfsc rt rate 8",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC class show dev $DUMMY",
|
|
"matchPattern": "class hfsc 1:1 parent 1: sc m1 0bit d 0us m2 8bit.*rt m1 0bit d 0us m2 8bit",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev $DUMMY handle 1: root"
|
|
]
|
|
},
|
|
{
|
|
"id": "8c39",
|
|
"name": "HFSC classify walk still reaches leaf after lateral drift",
|
|
"category": [
|
|
"qdisc",
|
|
"hfsc"
|
|
],
|
|
"plugins": {
|
|
"requires": "nsPlugin"
|
|
},
|
|
"setup": [
|
|
"ip link set lo up",
|
|
"$TC qdisc add dev lo handle 1: root hfsc default 30",
|
|
"$TC class add dev lo parent 1: classid 1:1 hfsc rt m2 100kbit",
|
|
"$TC class add dev lo parent 1:1 classid 1:10 hfsc rt m2 50kbit",
|
|
"$TC class add dev lo parent 1: classid 1:2 hfsc rt m2 100kbit",
|
|
"$TC filter add dev lo parent 1: protocol ip prio 1 u32 match u8 0 0 at 0 flowid 1:1",
|
|
"$TC filter add dev lo parent 1:1 protocol ip prio 1 u32 match u8 0 0 at 0 flowid 1:2",
|
|
"$TC class add dev lo parent 1:2 classid 1:20 hfsc rt m2 10kbit",
|
|
"$TC class add dev lo parent 1: classid 1:3 hfsc rt m2 100kbit",
|
|
"$TC filter add dev lo parent 1:2 protocol ip prio 1 u32 match u8 0 0 at 0 flowid 1:3",
|
|
"$TC class add dev lo parent 1:3 classid 1:30 hfsc rt m2 10kbit",
|
|
"$TC class add dev lo parent 1:3 classid 1:31 hfsc rt m2 100kbit",
|
|
"$TC filter add dev lo parent 1:3 protocol ip prio 1 u32 match u8 0 0 at 0 flowid 1:31"
|
|
],
|
|
"cmdUnderTest": "ping -n -c 10 -W 1 127.0.0.1",
|
|
"expExitCode": "0",
|
|
"verifyCmd": "$TC -s class show dev lo",
|
|
"matchPattern": "class hfsc 1:31 parent 1:3 rt[^\\n]*\\n Sent [0-9]+ bytes [1-9][0-9]* pkt",
|
|
"matchCount": "1",
|
|
"teardown": [
|
|
"$TC qdisc del dev lo handle 1: root"
|
|
]
|
|
}
|
|
]
|