Commit 16ce349b authored by Cong Wang's avatar Cong Wang Committed by David S. Miller
Browse files

selftests/tc-testing: Add qdisc limit trimming tests



Added new test cases for FQ, FQ_CODEL, FQ_PIE, and HHF qdiscs to verify queue
trimming behavior when the qdisc limit is dynamically reduced.

Each test injects packets, reduces the qdisc limit, and checks that the new
limit is enforced. This is still best effort since timing qdisc backlog
is not easy.

Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d3cbfd6
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -189,5 +189,29 @@
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root"
        ]
    },
    {
        "id": "deb1",
        "name": "CODEL test qdisc limit trimming",
        "category": ["qdisc", "codel"],
        "plugins": {
            "requires": ["nsPlugin", "scapyPlugin"]
        },
        "setup": [
            "$TC qdisc add dev $DEV1 handle 1: root codel limit 10"
        ],
        "scapy": [
            {
                "iface": "$DEV0",
                "count": 10,
                "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
            }
        ],
        "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root codel limit 1",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $DEV1",
        "matchPattern": "qdisc codel 1: root refcnt [0-9]+ limit 1p target 5ms interval 100ms",
        "matchCount": "1",
        "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
    }
]
+22 −0
Original line number Diff line number Diff line
@@ -377,5 +377,27 @@
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root"
        ]
    },
    {
        "id": "9479",
        "name": "FQ test qdisc limit trimming",
        "category": ["qdisc", "fq"],
        "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
        "setup": [
            "$TC qdisc add dev $DEV1 handle 1: root fq limit 10"
        ],
        "scapy": [
            {
                "iface": "$DEV0",
                "count": 10,
                "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
            }
        ],
        "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root fq limit 1",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $DEV1",
        "matchPattern": "qdisc fq 1: root refcnt [0-9]+ limit 1p",
        "matchCount": "1",
        "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
    }
]
+22 −0
Original line number Diff line number Diff line
@@ -294,5 +294,27 @@
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root"
        ]
    },
    {
        "id": "0436",
        "name": "FQ_CODEL test qdisc limit trimming",
        "category": ["qdisc", "fq_codel"],
        "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
        "setup": [
            "$TC qdisc add dev $DEV1 handle 1: root fq_codel limit 10"
        ],
        "scapy": [
            {
                "iface": "$DEV0",
                "count": 10,
                "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
            }
        ],
        "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root fq_codel limit 1",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $DEV1",
        "matchPattern": "qdisc fq_codel 1: root refcnt [0-9]+ limit 1p flows 1024 quantum.*target 5ms interval 100ms memory_limit 32Mb ecn drop_batch 64",
        "matchCount": "1",
        "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
    }
]
+22 −0
Original line number Diff line number Diff line
@@ -18,5 +18,27 @@
        "matchCount": "1",
        "teardown": [
        ]
    },
    {
        "id": "83bf",
        "name": "FQ_PIE test qdisc limit trimming",
        "category": ["qdisc", "fq_pie"],
        "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
        "setup": [
            "$TC qdisc add dev $DEV1 handle 1: root fq_pie limit 10"
        ],
        "scapy": [
            {
                "iface": "$DEV0",
                "count": 10,
                "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
            }
        ],
        "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root fq_pie limit 1",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $DEV1",
        "matchPattern": "qdisc fq_pie 1: root refcnt [0-9]+ limit 1p",
        "matchCount": "1",
        "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
    }
]
+22 −0
Original line number Diff line number Diff line
@@ -188,5 +188,27 @@
        "teardown": [
            "$TC qdisc del dev $DUMMY handle 1: root"
        ]
    },
    {
        "id": "385f",
        "name": "HHF test qdisc limit trimming",
        "category": ["qdisc", "hhf"],
        "plugins": {"requires": ["nsPlugin", "scapyPlugin"]},
        "setup": [
            "$TC qdisc add dev $DEV1 handle 1: root hhf limit 10"
        ],
        "scapy": [
            {
                "iface": "$DEV0",
                "count": 10,
                "packet": "Ether(type=0x800)/IP(src='10.0.0.10',dst='10.0.0.20')/TCP(sport=5000,dport=10)"
            }
        ],
        "cmdUnderTest": "$TC qdisc change dev $DEV1 handle 1: root hhf limit 1",
        "expExitCode": "0",
        "verifyCmd": "$TC qdisc show dev $DEV1",
        "matchPattern": "qdisc hhf 1: root refcnt [0-9]+ limit 1p.*hh_limit 2048 reset_timeout 40ms admit_bytes 128Kb evict_timeout 1s non_hh_weight 2",
        "matchCount": "1",
        "teardown": ["$TC qdisc del dev $DEV1 handle 1: root"]
    }
]
Loading