History

Merge branch 'mlxsw-Test-coverage-for-DSCP-leftover-fix'

Petr Machata says: ==================== mlxsw: Test coverage for DSCP leftover fix This patch set fixes some global scope pollution issues in the DSCP tests (in patch #1), and then proceeds (in patch #2) to add a new test for checking whether, after DSCP prioritization rules are removed from a port, DSCP rewrites consistently to zero, instead of the last removed rule still staying in effect. ====================

David S. Miller committed 7 years ago

Commit 164f0de2 parents 7084148 d11786b2 files · +26 −4Browse files

Unified · Split

2 files
  1. tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh +4 −2
  2. tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh +22 −2
tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh+4−2
@@ -36,8 +36,6 @@ source $lib_dir/lib.sh · 35 unmodified lines
36 36
37h1_create()37h1_create()
38{38{
39 local dscp;
40
41 simple_if_init $h1 192.0.2.1/2839 simple_if_init $h1 192.0.2.1/28
42 tc qdisc add dev $h1 clsact40 tc qdisc add dev $h1 clsact
43 dscp_capture_install $h1 1041 dscp_capture_install $h1 10
@@ -67,6 +65,7 @@ h2_destroy() · 23 unmodified lines
67dscp_map()65dscp_map()
68{66{
69 local base=$1; shift67 local base=$1; shift
68 local prio
70 69
71 for prio in {0..7}; do70 for prio in {0..7}; do
72 echo app=$prio,5,$((base + prio))71 echo app=$prio,5,$((base + prio))
@@ -138,6 +137,7 @@ dscp_ping_test() · 65 unmodified lines
138 local prio=$1; shift137 local prio=$1; shift
139 local dev_10=$1; shift138 local dev_10=$1; shift
140 local dev_20=$1; shift139 local dev_20=$1; shift
140 local key
141 141
142 local dscp_10=$(((prio + 10) << 2))142 local dscp_10=$(((prio + 10) << 2))
143 local dscp_20=$(((prio + 20) << 2))143 local dscp_20=$(((prio + 20) << 2))
@@ -175,6 +175,8 @@ dscp_ping_test() · 31 unmodified lines
175 175
176test_dscp()176test_dscp()
177{177{
178 local prio
179
178 for prio in {0..7}; do180 for prio in {0..7}; do
179 dscp_ping_test v$h1 192.0.2.1 192.0.2.2 $prio $h1 $h2181 dscp_ping_test v$h1 192.0.2.1 192.0.2.2 $prio $h1 $h2
180 done182 done
tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh+22−2
@@ -31,6 +31,7 @@ ALL_TESTS=" · 30 unmodified lines
31 ping_ipv431 ping_ipv4
32 test_update32 test_update
33 test_no_update33 test_no_update
34 test_dscp_leftover
34"35"
35 36
36lib_dir=$(dirname $0)/../../../net/forwarding37lib_dir=$(dirname $0)/../../../net/forwarding
@@ -50,10 +51,13 @@ reprioritize() · 13 unmodified lines
50 echo ${reprio[$in]}51 echo ${reprio[$in]}
51}52}
52 53
53h1_create()54zero()
54{55{
55 local dscp;56 echo 0
57}
56 58
59h1_create()
60{
57 simple_if_init $h1 192.0.2.1/2861 simple_if_init $h1 192.0.2.1/28
58 tc qdisc add dev $h1 clsact62 tc qdisc add dev $h1 clsact
59 dscp_capture_install $h1 063 dscp_capture_install $h1 0
@@ -87,6 +91,7 @@ h2_destroy() · 27 unmodified lines
87dscp_map()91dscp_map()
88{92{
89 local base=$1; shift93 local base=$1; shift
94 local prio
90 95
91 for prio in {0..7}; do96 for prio in {0..7}; do
92 echo app=$prio,5,$((base + prio))97 echo app=$prio,5,$((base + prio))
@@ -156,6 +161,7 @@ dscp_ping_test() · 63 unmodified lines
156 local reprio=$1; shift161 local reprio=$1; shift
157 local dev1=$1; shift162 local dev1=$1; shift
158 local dev2=$1; shift163 local dev2=$1; shift
164 local i
159 165
160 local prio2=$($reprio $prio) # ICMP Request egress prio166 local prio2=$($reprio $prio) # ICMP Request egress prio
161 local prio3=$($reprio $prio2) # ICMP Response egress prio167 local prio3=$($reprio $prio2) # ICMP Response egress prio
@@ -205,6 +211,7 @@ __test_update() · 43 unmodified lines
205{211{
206 local update=$1; shift212 local update=$1; shift
207 local reprio=$1; shift213 local reprio=$1; shift
214 local prio
208 215
209 sysctl_restore net.ipv4.ip_forward_update_priority216 sysctl_restore net.ipv4.ip_forward_update_priority
210 sysctl_set net.ipv4.ip_forward_update_priority $update217 sysctl_set net.ipv4.ip_forward_update_priority $update
@@ -224,6 +231,19 @@ test_no_update() · 13 unmodified lines
224 __test_update 0 echo231 __test_update 0 echo
225}232}
226 233
234# Test that when the last APP rule is removed, the prio->DSCP map is properly
235# set to zeroes, and that the last APP rule does not stay active in the ASIC.
236test_dscp_leftover()
237{
238 lldptool -T -i $swp2 -V APP -d $(dscp_map 0) >/dev/null
239 lldpad_app_wait_del
240
241 __test_update 0 zero
242
243 lldptool -T -i $swp2 -V APP $(dscp_map 0) >/dev/null
244 lldpad_app_wait_set $swp2
245}
246
227trap cleanup EXIT247trap cleanup EXIT
228 248
229setup_prepare249setup_prepare

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t