Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177284548
D61258.1794083802.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
4 KB
Referenced Files
None
Subscribers
None
D61258.1794083802.diff
View Options
diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh
--- a/tests/sys/netpfil/common/dummynet.sh
+++ b/tests/sys/netpfil/common/dummynet.sh
@@ -610,6 +610,133 @@
+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 \
@@ -637,5 +764,11 @@
ipfw \
pf \
pls_gilbert \
+ ipfw \
+ pf \
+ aqm_masked \
+ ipfw \
+ pf \
+ aqm_reconfig \
ipfw \
pf
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 7, 8:36 PM (6 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41546150
Default Alt Text
D61258.1794083802.diff (4 KB)
Attached To
Mode
D61258: dummynet tests: Add CoDel/PIE masked and reconfiguration cases
Attached
Detach File
Event Timeline