Files
linux/tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfq.json
Octavian Purdila 26e705184e selftests/tc-testing: sfq: check that a derived limit of 1 is rejected
Because the limit is updated indirectly when other parameters are
updated, there are cases where even though the user requests a limit
of 2 it can actually be set to 1.

Add the following test cases to check that the kernel rejects them:
- limit 2 depth 1 flows 1
- limit 2 depth 1 divisor 1

Signed-off-by: Octavian Purdila <tavip@google.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2025-04-09 12:55:48 +01:00

269 lines
7.6 KiB
JSON

[
{
"id": "7482",
"name": "Create SFQ with default setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum.*depth 127 divisor 1024",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "c186",
"name": "Create SFQ with limit setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq limit 8",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 8p",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "ae23",
"name": "Create SFQ with perturb setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq perturb 10",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "depth 127 divisor 1024 perturb 10sec",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "a430",
"name": "Create SFQ with quantum setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq quantum 9000",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 9000b depth 127 divisor 1024",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "4539",
"name": "Create SFQ with divisor setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq divisor 512",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 127 divisor 512",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "b089",
"name": "Create SFQ with flows setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq flows 20",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "99a0",
"name": "Create SFQ with depth setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq depth 64",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 64 divisor 1024",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "7389",
"name": "Create SFQ with headdrop setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq headdrop",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 127 headdrop divisor 1024",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "6472",
"name": "Create SFQ with redflowlimit setting",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq redflowlimit 100000 min 8000 max 60000 probability 0.20 ecn headdrop",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc sfq 1: root refcnt [0-9]+ limit 127p quantum 1514b depth 127 headdrop divisor 1024 ewma 6 min 8000b max 60000b probability 0.2 ecn",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "8929",
"name": "Show SFQ class",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class sfq 1:",
"matchCount": "0",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root"
]
},
{
"id": "4d6f",
"name": "Check that limit of 1 is rejected",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
],
"cmdUnderTest": "./scripts/sfq_rejects_limit_1.py $DUMMY",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "sfq",
"matchCount": "0",
"teardown": [
]
},
{
"id": "7f8f",
"name": "Check that a derived limit of 1 is rejected (limit 2 depth 1 flows 1)",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq limit 2 depth 1 flows 1",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "sfq",
"matchCount": "0",
"teardown": []
},
{
"id": "5168",
"name": "Check that a derived limit of 1 is rejected (limit 2 depth 1 divisor 1)",
"category": [
"qdisc",
"sfq"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfq limit 2 depth 1 divisor 1",
"expExitCode": "2",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "sfq",
"matchCount": "0",
"teardown": []
}
]