From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: [PATCH net 4/4] selftests: mlxsw: qos_mc_aware: Add a test for UC awareness Date: Wed, 31 Oct 2018 09:56:46 +0000 Message-ID: <20181031095601.29846-5-idosch@mellanox.com> References: <20181031095601.29846-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "davem@davemloft.net" , Jiri Pirko , Petr Machata , mlxsw , Ido Schimmel To: "netdev@vger.kernel.org" Return-path: Received: from mail-eopbgr50083.outbound.protection.outlook.com ([40.107.5.83]:6062 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728035AbeJaSyQ (ORCPT ); Wed, 31 Oct 2018 14:54:16 -0400 In-Reply-To: <20181031095601.29846-1-idosch@mellanox.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: From: Petr Machata 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 Signed-off-by: Ido Schimmel --- .../drivers/net/mlxsw/qos_mc_aware.sh | 93 ++++++++++++++----- 1 file changed, 70 insertions(+), 23 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh b/to= ols/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 @@ # Thus we set MTU to 10K on all involved interfaces. Then both unicast and # multicast traffic uses 8K frames. # -# +-----------------------+ +------------------------------= ----+ -# | H1 | | = H2 | -# | | | unicast --> + $h2.111 = | -# | | | traffic | 192.0.2.129/28= | -# | multicast | | | e-qos-map 0:1 = | -# | traffic | | | = | -# | $h1 + <----- | | + $h2 = | -# +-----|-----------------+ +--------------|---------------= ----+ -# | | -# +-----|-------------------------------------------------|---------------= ----+ -# | + $swp1 + $swp2 = | -# | | >1Gbps | >1Gbps = | -# | +---|----------------+ +----------|---------------= -+ | -# | | + $swp1.1 | | + $swp2.111 = | | +# +---------------------------+ +------------------------------= ----+ +# | H1 | | = H2 | +# | | | unicast --> + $h2.111 = | +# | multicast | | traffic | 192.0.2.129/28= | +# | traffic | | | e-qos-map 0:1 = | +# | $h1 + <----- | | | = | +# | 192.0.2.65/28 | | | + $h2 = | +# +---------------|-----------+ +--------------|---------------= ----+ +# | | +# +---------------|---------------------------------------|---------------= ----+ +# | $swp1 + + $swp2 = | +# | >1Gbps | | >1Gbps = | +# | +-------------|------+ +----------|---------------= -+ | +# | | $swp1.1 + | | + $swp2.111 = | | # | | BR1 | SW | BR111 = | | -# | | + $swp3.1 | | + $swp3.111 = | | -# | +---|----------------+ +----------|---------------= -+ | -# | \_________________________________________________/ = | +# | | $swp3.1 + | | + $swp3.111 = | | +# | +-------------|------+ +----------|---------------= -+ | +# | \_______________________________________/ = | # | | = | # | + $swp3 = | # | | 1Gbps bottleneck = | @@ -51,6 +51,7 @@ # | # +--|-----------------+ # | + $h3 H3 | +# | | 192.0.2.66/28 | # | | | # | + $h3.111 | # | 192.0.2.130/28 | @@ -59,6 +60,7 @@ ALL_TESTS=3D" ping_ipv4 test_mc_aware + test_uc_aware " =20 lib_dir=3D$(dirname $0)/../../../net/forwarding @@ -68,14 +70,14 @@ source $lib_dir/lib.sh =20 h1_create() { - simple_if_init $h1 + simple_if_init $h1 192.0.2.65/28 mtu_set $h1 10000 } =20 h1_destroy() { mtu_restore $h1 - simple_if_fini $h1 + simple_if_fini $h1 192.0.2.65/28 } =20 h2_create() @@ -97,7 +99,7 @@ h2_destroy() =20 h3_create() { - simple_if_init $h3 + simple_if_init $h3 192.0.2.66/28 mtu_set $h3 10000 =20 vlan_create $h3 111 v$h3 192.0.2.130/28 @@ -108,7 +110,7 @@ h3_destroy() vlan_destroy $h3 111 =20 mtu_restore $h3 - simple_if_fini $h3 + simple_if_fini $h3 192.0.2.66/28 } =20 switch_create() @@ -251,7 +253,7 @@ measure_uc_rate() # average ingress rate to somewhat mitigate this. local min_ingress=3D2147483648 =20 - 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 & sleep 1 =20 @@ -291,7 +293,7 @@ test_mc_aware() check_err $? "Could not get high enough UC-only ingress rate" local ucth1=3D${uc_rate[1]} =20 - 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 & =20 local d0=3D$(date +%s) local t0=3D$(ethtool_stats_get $h3 rx_octets_prio_0) @@ -335,6 +337,51 @@ test_mc_aware() echo " egress UC throughput $(humanize ${uc_rate_2[1]})" echo " ingress MC throughput $(humanize $mc_ir)" echo " egress MC throughput $(humanize $mc_er)" + echo +} + +test_uc_aware() +{ + RET=3D0 + + $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=3D$(date +%s) + local t0=3D$(ethtool_stats_get $h3 rx_octets_prio_1) + local u0=3D$(ethtool_stats_get $swp2 rx_octets_prio_1) + sleep 1 + + local attempts=3D50 + local passes=3D0 + local i + + for ((i =3D 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=3D$(date +%s) + local t1=3D$(ethtool_stats_get $h3 rx_octets_prio_1) + local u1=3D$(ethtool_stats_get $swp2 rx_octets_prio_1) + + local interval=3D$((d1 - d0)) + local uc_ir=3D$(rate $u0 $u1 $interval) + local uc_er=3D$(rate $t0 $t1 $interval) + + ((attempts =3D=3D 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" } =20 trap cleanup EXIT --=20 2.17.2