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
3636
3737 h1_create()
3838 {
39− local dscp;
40−
4139 simple_if_init $h1 192.0.2.1/28
4240 tc qdisc add dev $h1 clsact
4341 dscp_capture_install $h1 10
@@ -67,6 +65,7 @@ h2_destroy() · 23 unmodified lines
6765 dscp_map()
6866 {
6967 local base=$1; shift
68+ local prio
7069
7170 for prio in {0..7}; do
7271 echo app=$prio,5,$((base + prio))
@@ -138,6 +137,7 @@ dscp_ping_test() · 65 unmodified lines
138137 local prio=$1; shift
139138 local dev_10=$1; shift
140139 local dev_20=$1; shift
140+ local key
141141
142142 local dscp_10=$(((prio + 10) << 2))
143143 local dscp_20=$(((prio + 20) << 2))
@@ -175,6 +175,8 @@ dscp_ping_test() · 31 unmodified lines
175175
176176 test_dscp()
177177 {
178+ local prio
179+
178180 for prio in {0..7}; do
179181 dscp_ping_test v$h1 192.0.2.1 192.0.2.2 $prio $h1 $h2
180182 done
tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh+22−2
@@ -31,6 +31,7 @@ ALL_TESTS=" · 30 unmodified lines
3131 ping_ipv4
3232 test_update
3333 test_no_update
34+ test_dscp_leftover
3435 "
3536
3637 lib_dir=$(dirname $0)/../../../net/forwarding
@@ -50,10 +51,13 @@ reprioritize() · 13 unmodified lines
5051 echo ${reprio[$in]}
5152 }
5253
53−h1_create()
54+zero()
5455 {
55− local dscp;
56+ echo 0
57+}
5658
59+h1_create()
60+{
5761 simple_if_init $h1 192.0.2.1/28
5862 tc qdisc add dev $h1 clsact
5963 dscp_capture_install $h1 0
@@ -87,6 +91,7 @@ h2_destroy() · 27 unmodified lines
8791 dscp_map()
8892 {
8993 local base=$1; shift
94+ local prio
9095
9196 for prio in {0..7}; do
9297 echo app=$prio,5,$((base + prio))
@@ -156,6 +161,7 @@ dscp_ping_test() · 63 unmodified lines
156161 local reprio=$1; shift
157162 local dev1=$1; shift
158163 local dev2=$1; shift
164+ local i
159165
160166 local prio2=$($reprio $prio) # ICMP Request egress prio
161167 local prio3=$($reprio $prio2) # ICMP Response egress prio
@@ -205,6 +211,7 @@ __test_update() · 43 unmodified lines
205211 {
206212 local update=$1; shift
207213 local reprio=$1; shift
214+ local prio
208215
209216 sysctl_restore net.ipv4.ip_forward_update_priority
210217 sysctl_set net.ipv4.ip_forward_update_priority $update
@@ -224,6 +231,19 @@ test_no_update() · 13 unmodified lines
224231 __test_update 0 echo
225232 }
226233
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.
236+test_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+
227247 trap cleanup EXIT
228248
229249 setup_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