Skip to content

Commit 72b05c1

Browse files
congwangPaolo Abeni
authored andcommitted
selftests/tc-testing: Add a test case for FQ_CODEL with HFSC parent
Add a test case for FQ_CODEL with HFSC 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-4-xiyou.wangcong@gmail.com Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 4cb1837 commit 72b05c1

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
@@ -220,5 +220,36 @@
220220
"$TC qdisc del dev $DUMMY handle 1: root",
221221
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
222222
]
223+
},
224+
{
225+
"id": "a4bf",
226+
"name": "Test FQ_CODEL with HFSC parent - force packet drop with empty queue",
227+
"category": [
228+
"qdisc",
229+
"fq_codel",
230+
"hfsc"
231+
],
232+
"plugins": {
233+
"requires": "nsPlugin"
234+
},
235+
"setup": [
236+
"$IP link set dev $DUMMY up || true",
237+
"$IP addr add 10.10.10.10/24 dev $DUMMY || true",
238+
"$TC qdisc add dev $DUMMY handle 1: root hfsc default 10",
239+
"$TC class add dev $DUMMY parent 1: classid 1:10 hfsc sc rate 1kbit ul rate 1kbit",
240+
"$TC qdisc add dev $DUMMY parent 1:10 handle 10: fq_codel memory_limit 1 flows 1 target 0.1ms interval 1ms",
241+
"$TC filter add dev $DUMMY parent 1: protocol ip prio 1 u32 match ip protocol 1 0xff flowid 1:10",
242+
"ping -c 5 -f -I $DUMMY 10.10.10.1 > /dev/null || true",
243+
"sleep 0.1"
244+
],
245+
"cmdUnderTest": "$TC -s qdisc show dev $DUMMY",
246+
"expExitCode": "0",
247+
"verifyCmd": "$TC -s qdisc show dev $DUMMY | grep -A 5 'qdisc fq_codel'",
248+
"matchPattern": "dropped [1-9][0-9]*",
249+
"matchCount": "1",
250+
"teardown": [
251+
"$TC qdisc del dev $DUMMY handle 1: root",
252+
"$IP addr del 10.10.10.10/24 dev $DUMMY || true"
253+
]
223254
}
224255
]

0 commit comments

Comments
 (0)