The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9be24df73395daedacdf3e5c4ac49d62e12aae2d
commit 9be24df73395daedacdf3e5c4ac49d62e12aae2d Author: Abdul Wasey <[email protected]> AuthorDate: 2026-12-04 14:11:30 +0000 Commit: Kristof Provost <[email protected]> CommitDate: 2026-12-04 18:33:22 +0000 dummynet tests: Add CoDel/PIE masked and reconfiguration cases aqm_masked configures CoDel and PIE on pipes with a mask and CoDel on a queue of a masked WF2Q+ scheduler. aqm_reconfig changes the parameters and the AQM of a pipe and of two queues (one masked) while ping keeps an instance alive, and checks that the AQM is still there and that traffic still passes afterwards. PR: 298731 Reviewed by: kp Signed-off-by: Abdul Wasey <[email protected]> Differential Revision: https://reviews.freebsd.org/D61258 --- tests/sys/netpfil/common/dummynet.sh | 133 +++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index da37060b0954..a688159743f0 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -634,6 +634,133 @@ pls_gilbert_cleanup() +aqm_masked_head() +{ + atf_set descr 'CoDel/PIE on a masked pipe or scheduler' + atf_set require.user root +} + +aqm_masked_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + + # The mask goes to the FIFO scheduler of the pipe, which always has + # a hash table for its instances. That is not a busy flowset. + jexec alcatraz dnctl pipe 1 config bw 10Mb mask dst-ip 0xffffffff codel + atf_check -s exit:0 -o match:"AQM CoDel" jexec alcatraz dnctl pipe 1 show + jexec alcatraz dnctl pipe 2 config bw 10Mb mask dst-ip 0xffffffff pie + atf_check -s exit:0 -o match:"AQM type PIE" jexec alcatraz dnctl pipe 2 show + + jexec alcatraz dnctl sched 3 config type wf2q+ mask dst-ip 0xffffffff + jexec alcatraz dnctl queue 3 config sched 3 codel + atf_check -s exit:0 -o match:"AQM CoDel" jexec alcatraz dnctl queue 3 show + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip from any to any" \ + "pf" \ + "pass dnpipe 1" + + atf_check -s exit:0 -o ignore ping -i .1 -c 3 192.0.2.2 +} + +aqm_masked_cleanup() +{ + firewall_cleanup $1 +} + +aqm_reconfig_head() +{ + atf_set descr 'Reconfigure CoDel/PIE flowsets that have traffic' + atf_set require.user root +} + +aqm_reconfig_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + + # Flowset of a pipe (FIFO scheduler, queue inside the instance). + jexec alcatraz dnctl pipe 1 config bw 10Mb codel + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip from any to any" \ + "pf" \ + "pass dnpipe 1" + + # Keep an instance alive while we reconfigure. + ping -i .1 -c 30 192.0.2.2 > /dev/null & + sleep 1 + + # Changed parameters: the flowset is detached and attached again. + jexec alcatraz dnctl pipe 1 config bw 10Mb queue 100 codel + atf_check -s exit:0 -o match:"AQM CoDel" jexec alcatraz dnctl pipe 1 show + # Unchanged parameters, new AQM. + jexec alcatraz dnctl pipe 1 config bw 10Mb queue 100 pie + atf_check -s exit:0 -o match:"AQM type PIE" jexec alcatraz dnctl pipe 1 show + wait + + # The existing instance needs a working AQM state, or it drops all. + atf_check -s exit:0 -o ignore ping -i .1 -c 3 192.0.2.2 + + # Queues of a WF2Q+ scheduler, one with a mask. + jexec alcatraz dnctl pipe 2 config bw 10Mb + jexec alcatraz dnctl queue 2 config pipe 2 weight 10 codel + jexec alcatraz dnctl queue 3 config pipe 2 mask dst-ip 0xffffffff weight 10 codel + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 queue 2 icmp from any to any" \ + "ipfw add 1010 queue 3 ip from any to any" \ + "pf" \ + "pass dnqueue 3" \ + "pass proto icmp dnqueue 2" + + ping -i .1 -c 30 192.0.2.2 > /dev/null & + sleep 1 + + # Unchanged parameters, new AQM parameters. + jexec alcatraz dnctl queue 2 config pipe 2 weight 10 codel target 20ms + atf_check -s exit:0 -o match:"AQM CoDel target 20ms" \ + jexec alcatraz dnctl queue 2 show + # Changed parameters. + jexec alcatraz dnctl queue 2 config pipe 2 weight 20 codel + atf_check -s exit:0 -o match:"AQM CoDel" jexec alcatraz dnctl queue 2 show + # Same line again on a masked queue. + jexec alcatraz dnctl queue 3 config pipe 2 mask dst-ip 0xffffffff weight 10 codel + atf_check -s exit:0 -o match:"AQM CoDel" jexec alcatraz dnctl queue 3 show + wait + + atf_check -s exit:0 -o ignore ping -i .1 -c 3 192.0.2.2 +} + +aqm_reconfig_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ interface_removal \ ipfw \ @@ -664,5 +791,11 @@ setup_tests \ ipfw \ pf \ pls_gilbert \ + ipfw \ + pf \ + aqm_masked \ + ipfw \ + pf \ + aqm_reconfig \ ipfw \ pf
