Skip to content

Commit 0d5c27e

Browse files
congwangPaolo Abeni
authored andcommitted
selftests/tc-testing: Add a test case for FQ_CODEL with DRR parent
Add a test case for FQ_CODEL with DRR parent to verify packet drop behavior when the queue becomes empty. This helps ensure proper notification mechanisms between qdiscs. Note this is best-effort, it is hard to play with those parameters perfectly to always trigger ->qlen_notify(). Cc: Pedro Tammela <pctammela@mojatatu.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Reviewed-by: Victor Nogueira <victor@mojatatu.com> Link: https://patch.msgid.link/20250403211636.166257-5-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 72b05c1 commit 0d5c27e

File tree

1 file changed

+31
-0
lines changed
  • tools/testing/selftests/tc-testing/tc-tests/infra

1 file changed

+31
-0
lines changed

tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,5 +251,36 @@
251251
"$TC qdisc del dev $DUMMY handle 1: root",
252252
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
253253
]
254+
},
255+
{
256+
"id": "a4c0",
257+
"name": "Test FQ_CODEL with DRR parent - force packet drop with empty queue",
258+
"category": [
259+
"qdisc",
260+
"fq_codel",
261+
"drr"
262+
],
263+
"plugins": {
264+
"requires": "nsPlugin"
265+
},
266+
"setup": [
267+
"$IP link set dev $DUMMY up || true",
268+
"$IP addr add 10.10.10.10/24 dev $DUMMY || true",
269+
"$TC qdisc add dev $DUMMY handle 1: root drr",
270+
"$TC class add dev $DUMMY parent 1: classid 1:10 drr quantum 1500",
271+
"$TC qdisc add dev $DUMMY parent 1:10 handle 10: fq_codel memory_limit 1 flows 1 target 0.1ms interval 1ms",
272+
"$TC filter add dev $DUMMY parent 1: protocol ip prio 1 u32 match ip protocol 1 0xff flowid 1:10",
273+
"ping -c 5 -f -I $DUMMY 10.10.10.1 > /dev/null || true",
274+
"sleep 0.1"
275+
],
276+
"cmdUnderTest": "$TC -s qdisc show dev $DUMMY",
277+
"expExitCode": "0",
278+
"verifyCmd": "$TC -s qdisc show dev $DUMMY | grep -A 5 'qdisc fq_codel'",
279+
"matchPattern": "dropped [1-9][0-9]*",
280+
"matchCount": "1",
281+
"teardown": [
282+
"$TC qdisc del dev $DUMMY handle 1: root",
283+
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
284+
]
254285
}
255286
]

0 commit comments

Comments
 (0)