diff options
author | Petr Machata <petrm@mellanox.com> | 2018-10-31 05:56:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-31 15:56:59 -0400 |
commit | a5ee171d087ee632a5f190bb3ce1c0f98e06ec0a (patch) | |
tree | b189bb2159a9655bb89282d5f730de19e899a24c | |
parent | 8f3f09358c81248109463b3cae254b7db4ea9af0 (diff) |
selftests: mlxsw: qos_mc_aware: Add a test for UC awareness
In a previous patch, mlxsw was updated to configure a minimum bandwidth
allowance on MC TCs. Test that this indeed fixes the problem of UC
traffic overload pushing out all MC traffic.
Fixes: b5638d46c90a ("selftests: mlxsw: Add a test for UC behavior under MC flood")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rwxr-xr-x | tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh | 93 |
1 files changed, 70 insertions, 23 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh index a8fc36d670e1..117f6f35d72f 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh | |||
@@ -25,24 +25,24 @@ | |||
25 | # Thus we set MTU to 10K on all involved interfaces. Then both unicast and | 25 | # Thus we set MTU to 10K on all involved interfaces. Then both unicast and |
26 | # multicast traffic uses 8K frames. | 26 | # multicast traffic uses 8K frames. |
27 | # | 27 | # |
28 | # +-----------------------+ +----------------------------------+ | 28 | # +---------------------------+ +----------------------------------+ |
29 | # | H1 | | H2 | | 29 | # | H1 | | H2 | |
30 | # | | | unicast --> + $h2.111 | | 30 | # | | | unicast --> + $h2.111 | |
31 | # | | | traffic | 192.0.2.129/28 | | 31 | # | multicast | | traffic | 192.0.2.129/28 | |
32 | # | multicast | | | e-qos-map 0:1 | | 32 | # | traffic | | | e-qos-map 0:1 | |
33 | # | traffic | | | | | 33 | # | $h1 + <----- | | | | |
34 | # | $h1 + <----- | | + $h2 | | 34 | # | 192.0.2.65/28 | | | + $h2 | |
35 | # +-----|-----------------+ +--------------|-------------------+ | 35 | # +---------------|-----------+ +--------------|-------------------+ |
36 | # | | | 36 | # | | |
37 | # +-----|-------------------------------------------------|-------------------+ | 37 | # +---------------|---------------------------------------|-------------------+ |
38 | # | + $swp1 + $swp2 | | 38 | # | $swp1 + + $swp2 | |
39 | # | | >1Gbps | >1Gbps | | 39 | # | >1Gbps | | >1Gbps | |
40 | # | +---|----------------+ +----------|----------------+ | | 40 | # | +-------------|------+ +----------|----------------+ | |
41 | # | | + $swp1.1 | | + $swp2.111 | | | 41 | # | | $swp1.1 + | | + $swp2.111 | | |
42 | # | | BR1 | SW | BR111 | | | 42 | # | | BR1 | SW | BR111 | | |
43 | # | | + $swp3.1 | | + $swp3.111 | | | 43 | # | | $swp3.1 + | | + $swp3.111 | | |
44 | # | +---|----------------+ +----------|----------------+ | | 44 | # | +-------------|------+ +----------|----------------+ | |
45 | # | \_________________________________________________/ | | 45 | # | \_______________________________________/ | |
46 | # | | | | 46 | # | | | |
47 | # | + $swp3 | | 47 | # | + $swp3 | |
48 | # | | 1Gbps bottleneck | | 48 | # | | 1Gbps bottleneck | |
@@ -51,6 +51,7 @@ | |||
51 | # | | 51 | # | |
52 | # +--|-----------------+ | 52 | # +--|-----------------+ |
53 | # | + $h3 H3 | | 53 | # | + $h3 H3 | |
54 | # | | 192.0.2.66/28 | | ||
54 | # | | | | 55 | # | | | |
55 | # | + $h3.111 | | 56 | # | + $h3.111 | |
56 | # | 192.0.2.130/28 | | 57 | # | 192.0.2.130/28 | |
@@ -59,6 +60,7 @@ | |||
59 | ALL_TESTS=" | 60 | ALL_TESTS=" |
60 | ping_ipv4 | 61 | ping_ipv4 |
61 | test_mc_aware | 62 | test_mc_aware |
63 | test_uc_aware | ||
62 | " | 64 | " |
63 | 65 | ||
64 | lib_dir=$(dirname $0)/../../../net/forwarding | 66 | lib_dir=$(dirname $0)/../../../net/forwarding |
@@ -68,14 +70,14 @@ source $lib_dir/lib.sh | |||
68 | 70 | ||
69 | h1_create() | 71 | h1_create() |
70 | { | 72 | { |
71 | simple_if_init $h1 | 73 | simple_if_init $h1 192.0.2.65/28 |
72 | mtu_set $h1 10000 | 74 | mtu_set $h1 10000 |
73 | } | 75 | } |
74 | 76 | ||
75 | h1_destroy() | 77 | h1_destroy() |
76 | { | 78 | { |
77 | mtu_restore $h1 | 79 | mtu_restore $h1 |
78 | simple_if_fini $h1 | 80 | simple_if_fini $h1 192.0.2.65/28 |
79 | } | 81 | } |
80 | 82 | ||
81 | h2_create() | 83 | h2_create() |
@@ -97,7 +99,7 @@ h2_destroy() | |||
97 | 99 | ||
98 | h3_create() | 100 | h3_create() |
99 | { | 101 | { |
100 | simple_if_init $h3 | 102 | simple_if_init $h3 192.0.2.66/28 |
101 | mtu_set $h3 10000 | 103 | mtu_set $h3 10000 |
102 | 104 | ||
103 | vlan_create $h3 111 v$h3 192.0.2.130/28 | 105 | vlan_create $h3 111 v$h3 192.0.2.130/28 |
@@ -108,7 +110,7 @@ h3_destroy() | |||
108 | vlan_destroy $h3 111 | 110 | vlan_destroy $h3 111 |
109 | 111 | ||
110 | mtu_restore $h3 | 112 | mtu_restore $h3 |
111 | simple_if_fini $h3 | 113 | simple_if_fini $h3 192.0.2.66/28 |
112 | } | 114 | } |
113 | 115 | ||
114 | switch_create() | 116 | switch_create() |
@@ -251,7 +253,7 @@ measure_uc_rate() | |||
251 | # average ingress rate to somewhat mitigate this. | 253 | # average ingress rate to somewhat mitigate this. |
252 | local min_ingress=2147483648 | 254 | local min_ingress=2147483648 |
253 | 255 | ||
254 | mausezahn $h2.111 -p 8000 -A 192.0.2.129 -B 192.0.2.130 -c 0 \ | 256 | $MZ $h2.111 -p 8000 -A 192.0.2.129 -B 192.0.2.130 -c 0 \ |
255 | -a own -b $h3mac -t udp -q & | 257 | -a own -b $h3mac -t udp -q & |
256 | sleep 1 | 258 | sleep 1 |
257 | 259 | ||
@@ -291,7 +293,7 @@ test_mc_aware() | |||
291 | check_err $? "Could not get high enough UC-only ingress rate" | 293 | check_err $? "Could not get high enough UC-only ingress rate" |
292 | local ucth1=${uc_rate[1]} | 294 | local ucth1=${uc_rate[1]} |
293 | 295 | ||
294 | mausezahn $h1 -p 8000 -c 0 -a own -b bc -t udp -q & | 296 | $MZ $h1 -p 8000 -c 0 -a own -b bc -t udp -q & |
295 | 297 | ||
296 | local d0=$(date +%s) | 298 | local d0=$(date +%s) |
297 | local t0=$(ethtool_stats_get $h3 rx_octets_prio_0) | 299 | local t0=$(ethtool_stats_get $h3 rx_octets_prio_0) |
@@ -335,6 +337,51 @@ test_mc_aware() | |||
335 | echo " egress UC throughput $(humanize ${uc_rate_2[1]})" | 337 | echo " egress UC throughput $(humanize ${uc_rate_2[1]})" |
336 | echo " ingress MC throughput $(humanize $mc_ir)" | 338 | echo " ingress MC throughput $(humanize $mc_ir)" |
337 | echo " egress MC throughput $(humanize $mc_er)" | 339 | echo " egress MC throughput $(humanize $mc_er)" |
340 | echo | ||
341 | } | ||
342 | |||
343 | test_uc_aware() | ||
344 | { | ||
345 | RET=0 | ||
346 | |||
347 | $MZ $h2.111 -p 8000 -A 192.0.2.129 -B 192.0.2.130 -c 0 \ | ||
348 | -a own -b $h3mac -t udp -q & | ||
349 | |||
350 | local d0=$(date +%s) | ||
351 | local t0=$(ethtool_stats_get $h3 rx_octets_prio_1) | ||
352 | local u0=$(ethtool_stats_get $swp2 rx_octets_prio_1) | ||
353 | sleep 1 | ||
354 | |||
355 | local attempts=50 | ||
356 | local passes=0 | ||
357 | local i | ||
358 | |||
359 | for ((i = 0; i < attempts; ++i)); do | ||
360 | if $ARPING -c 1 -I $h1 -b 192.0.2.66 -q -w 0.1; then | ||
361 | ((passes++)) | ||
362 | fi | ||
363 | |||
364 | sleep 0.1 | ||
365 | done | ||
366 | |||
367 | local d1=$(date +%s) | ||
368 | local t1=$(ethtool_stats_get $h3 rx_octets_prio_1) | ||
369 | local u1=$(ethtool_stats_get $swp2 rx_octets_prio_1) | ||
370 | |||
371 | local interval=$((d1 - d0)) | ||
372 | local uc_ir=$(rate $u0 $u1 $interval) | ||
373 | local uc_er=$(rate $t0 $t1 $interval) | ||
374 | |||
375 | ((attempts == passes)) | ||
376 | check_err $? | ||
377 | |||
378 | # Suppress noise from killing mausezahn. | ||
379 | { kill %% && wait; } 2>/dev/null | ||
380 | |||
381 | log_test "MC performace under UC overload" | ||
382 | echo " ingress UC throughput $(humanize ${uc_ir})" | ||
383 | echo " egress UC throughput $(humanize ${uc_er})" | ||
384 | echo " sent $attempts BC ARPs, got $passes responses" | ||
338 | } | 385 | } |
339 | 386 | ||
340 | trap cleanup EXIT | 387 | trap cleanup EXIT |