提交 a5ee171d 编写于 作者: P Petr Machata 提交者: David S. Miller

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: b5638d46 ("selftests: mlxsw: Add a test for UC behavior under MC flood")
Signed-off-by: NPetr Machata <petrm@mellanox.com>
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8f3f0935
...@@ -25,24 +25,24 @@ ...@@ -25,24 +25,24 @@
# Thus we set MTU to 10K on all involved interfaces. Then both unicast and # Thus we set MTU to 10K on all involved interfaces. Then both unicast and
# multicast traffic uses 8K frames. # multicast traffic uses 8K frames.
# #
# +-----------------------+ +----------------------------------+ # +---------------------------+ +----------------------------------+
# | H1 | | H2 | # | H1 | | H2 |
# | | | unicast --> + $h2.111 | # | | | unicast --> + $h2.111 |
# | | | traffic | 192.0.2.129/28 | # | multicast | | traffic | 192.0.2.129/28 |
# | multicast | | | e-qos-map 0:1 | # | traffic | | | e-qos-map 0:1 |
# | traffic | | | | # | $h1 + <----- | | | |
# | $h1 + <----- | | + $h2 | # | 192.0.2.65/28 | | | + $h2 |
# +-----|-----------------+ +--------------|-------------------+ # +---------------|-----------+ +--------------|-------------------+
# | | # | |
# +-----|-------------------------------------------------|-------------------+ # +---------------|---------------------------------------|-------------------+
# | + $swp1 + $swp2 | # | $swp1 + + $swp2 |
# | | >1Gbps | >1Gbps | # | >1Gbps | | >1Gbps |
# | +---|----------------+ +----------|----------------+ | # | +-------------|------+ +----------|----------------+ |
# | | + $swp1.1 | | + $swp2.111 | | # | | $swp1.1 + | | + $swp2.111 | |
# | | BR1 | SW | BR111 | | # | | BR1 | SW | BR111 | |
# | | + $swp3.1 | | + $swp3.111 | | # | | $swp3.1 + | | + $swp3.111 | |
# | +---|----------------+ +----------|----------------+ | # | +-------------|------+ +----------|----------------+ |
# | \_________________________________________________/ | # | \_______________________________________/ |
# | | | # | | |
# | + $swp3 | # | + $swp3 |
# | | 1Gbps bottleneck | # | | 1Gbps bottleneck |
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
# | # |
# +--|-----------------+ # +--|-----------------+
# | + $h3 H3 | # | + $h3 H3 |
# | | 192.0.2.66/28 |
# | | | # | | |
# | + $h3.111 | # | + $h3.111 |
# | 192.0.2.130/28 | # | 192.0.2.130/28 |
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
ALL_TESTS=" ALL_TESTS="
ping_ipv4 ping_ipv4
test_mc_aware test_mc_aware
test_uc_aware
" "
lib_dir=$(dirname $0)/../../../net/forwarding lib_dir=$(dirname $0)/../../../net/forwarding
...@@ -68,14 +70,14 @@ source $lib_dir/lib.sh ...@@ -68,14 +70,14 @@ source $lib_dir/lib.sh
h1_create() h1_create()
{ {
simple_if_init $h1 simple_if_init $h1 192.0.2.65/28
mtu_set $h1 10000 mtu_set $h1 10000
} }
h1_destroy() h1_destroy()
{ {
mtu_restore $h1 mtu_restore $h1
simple_if_fini $h1 simple_if_fini $h1 192.0.2.65/28
} }
h2_create() h2_create()
...@@ -97,7 +99,7 @@ h2_destroy() ...@@ -97,7 +99,7 @@ h2_destroy()
h3_create() h3_create()
{ {
simple_if_init $h3 simple_if_init $h3 192.0.2.66/28
mtu_set $h3 10000 mtu_set $h3 10000
vlan_create $h3 111 v$h3 192.0.2.130/28 vlan_create $h3 111 v$h3 192.0.2.130/28
...@@ -108,7 +110,7 @@ h3_destroy() ...@@ -108,7 +110,7 @@ h3_destroy()
vlan_destroy $h3 111 vlan_destroy $h3 111
mtu_restore $h3 mtu_restore $h3
simple_if_fini $h3 simple_if_fini $h3 192.0.2.66/28
} }
switch_create() switch_create()
...@@ -251,7 +253,7 @@ measure_uc_rate() ...@@ -251,7 +253,7 @@ measure_uc_rate()
# average ingress rate to somewhat mitigate this. # average ingress rate to somewhat mitigate this.
local min_ingress=2147483648 local min_ingress=2147483648
mausezahn $h2.111 -p 8000 -A 192.0.2.129 -B 192.0.2.130 -c 0 \ $MZ $h2.111 -p 8000 -A 192.0.2.129 -B 192.0.2.130 -c 0 \
-a own -b $h3mac -t udp -q & -a own -b $h3mac -t udp -q &
sleep 1 sleep 1
...@@ -291,7 +293,7 @@ test_mc_aware() ...@@ -291,7 +293,7 @@ test_mc_aware()
check_err $? "Could not get high enough UC-only ingress rate" check_err $? "Could not get high enough UC-only ingress rate"
local ucth1=${uc_rate[1]} local ucth1=${uc_rate[1]}
mausezahn $h1 -p 8000 -c 0 -a own -b bc -t udp -q & $MZ $h1 -p 8000 -c 0 -a own -b bc -t udp -q &
local d0=$(date +%s) local d0=$(date +%s)
local t0=$(ethtool_stats_get $h3 rx_octets_prio_0) local t0=$(ethtool_stats_get $h3 rx_octets_prio_0)
...@@ -335,6 +337,51 @@ test_mc_aware() ...@@ -335,6 +337,51 @@ test_mc_aware()
echo " egress UC throughput $(humanize ${uc_rate_2[1]})" echo " egress UC throughput $(humanize ${uc_rate_2[1]})"
echo " ingress MC throughput $(humanize $mc_ir)" echo " ingress MC throughput $(humanize $mc_ir)"
echo " egress MC throughput $(humanize $mc_er)" echo " egress MC throughput $(humanize $mc_er)"
echo
}
test_uc_aware()
{
RET=0
$MZ $h2.111 -p 8000 -A 192.0.2.129 -B 192.0.2.130 -c 0 \
-a own -b $h3mac -t udp -q &
local d0=$(date +%s)
local t0=$(ethtool_stats_get $h3 rx_octets_prio_1)
local u0=$(ethtool_stats_get $swp2 rx_octets_prio_1)
sleep 1
local attempts=50
local passes=0
local i
for ((i = 0; i < attempts; ++i)); do
if $ARPING -c 1 -I $h1 -b 192.0.2.66 -q -w 0.1; then
((passes++))
fi
sleep 0.1
done
local d1=$(date +%s)
local t1=$(ethtool_stats_get $h3 rx_octets_prio_1)
local u1=$(ethtool_stats_get $swp2 rx_octets_prio_1)
local interval=$((d1 - d0))
local uc_ir=$(rate $u0 $u1 $interval)
local uc_er=$(rate $t0 $t1 $interval)
((attempts == passes))
check_err $?
# Suppress noise from killing mausezahn.
{ kill %% && wait; } 2>/dev/null
log_test "MC performace under UC overload"
echo " ingress UC throughput $(humanize ${uc_ir})"
echo " egress UC throughput $(humanize ${uc_er})"
echo " sent $attempts BC ARPs, got $passes responses"
} }
trap cleanup EXIT trap cleanup EXIT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册