Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jul 2023 19:32:52 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e8423423737e - main - pf tests: test double-pass codel
Message-ID:  <202307031932.363JWqhD048025@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=e8423423737ec0c08fc021d58795d5d34a55dda2

commit e8423423737ec0c08fc021d58795d5d34a55dda2
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-07-03 17:06:06 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-07-03 19:32:33 +0000

    pf tests: test double-pass codel
    
    Build a setup where a given packet will be passed through the codel code
    twice. This used to trigger issues with double-free on mtags.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 tests/sys/netpfil/pf/altq.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/tests/sys/netpfil/pf/altq.sh b/tests/sys/netpfil/pf/altq.sh
index 0ced82a3a942..57a9edf11366 100644
--- a/tests/sys/netpfil/pf/altq.sh
+++ b/tests/sys/netpfil/pf/altq.sh
@@ -288,6 +288,55 @@ prioritise_cleanup()
 	altq_cleanup
 }
 
+atf_test_case "codel_vlan" "cleanup"
+codel_vlan_head()
+{
+	atf_set descr 'Test double-pass through ALTQ with codel'
+	atf_set require.user root
+}
+
+codel_vlan_body()
+{
+	altq_init
+	is_altq_supported priq
+	is_altq_supported codel
+
+	j=altq_vlan_codel
+	epair=$(vnet_mkepair)
+
+	vnet_mkjail ${j}a ${epair}a
+	va=$(jexec ${j}a ifconfig vlan create)
+	jexec ${j}a ifconfig ${epair}a up
+	jexec ${j}a ifconfig ${va} vlan 42 vlandev ${epair}a up
+	jexec ${j}a ifconfig ${va} inet 192.0.2.1/24
+
+	vnet_mkjail ${j}b ${epair}b
+	vb=$(jexec ${j}b ifconfig vlan create)
+	jexec ${j}b ifconfig ${epair}b up
+	jexec ${j}b ifconfig ${vb} vlan 42 vlandev ${epair}b up
+	jexec ${j}b ifconfig ${vb} inet 192.0.2.2/24
+
+	# Sanity check
+	atf_check -s exit:0 -o ignore \
+	    jexec ${j}a ping -c 1 192.0.2.2
+
+	jexec ${j}a pfctl -e
+	pft_set_rules ${j}a \
+		"altq on ${epair}a priq bandwidth 10Mb queue { slow }" \
+		"queue slow priority 6 qlimit 50 priq ( default codel )" \
+		"altq on ${va} priq bandwidth 10Mb queue { vslow }" \
+		"queue vslow priority 6 qlimit 50 priq ( default codel )" \
+		"pass queue (slow)"
+
+	atf_check -s exit:0 -o ignore \
+	    jexec ${j}a ping -c 1 192.0.2.2
+}
+
+codel_vlan_cleanup()
+{
+	altq_cleanup
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case "hfsc"
@@ -295,4 +344,5 @@ atf_init_test_cases()
 	atf_add_test_case "cbq_vlan"
 	atf_add_test_case "codel_bridge"
 	atf_add_test_case "prioritise"
+	atf_add_test_case "codel_vlan"
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307031932.363JWqhD048025>