Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp377301pxj; Tue, 18 May 2021 05:33:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxW5fwN2GKEuHHrC3cvlaOZfEHx/S1KH4kwTHjzpwCviHgFLJqJ0jOydqcsdO42GPzF/hE X-Received: by 2002:aa7:c718:: with SMTP id i24mr6642467edq.43.1621341204430; Tue, 18 May 2021 05:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621341204; cv=none; d=google.com; s=arc-20160816; b=XoWzyff2wvuQvCwbyK7CYXu34Dw+bML8xm4jyMmWvvDVWPOAn9r7UP6zfF2ooYAmmD R7llA0Cign/U09+ra9xylwTr9k/kkFlzpep7xmkplrk1TC85FE4SUPDAoIBoCON0UgwV 1HMuG30Mkz/KFHjg1gRToWCCiQjOQjn8+5h4wFAaY/Dhv7N/pvajXhO2nmiMlrb4VBhe 2sUMcRMA6dNA93QI6a7xIGQwg0Le9bqSoYjaEc5zkCfpUNvwKj3oGks6PwQgrOaZYQSG hlflviUz4D50m0VtkIAYrNoV8iDFeEX0wauZLx7iNio6jKtrR2/81yugxxMnw2ag3god I0DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3ACqzX8CkXEsPrO9FWSKaLtbKcYOKD/VQUahfuMssn4=; b=NfIV0h6P87j/fi225M4+I639WZDbFueMktTmnKif6eRcd/8JQvIL4Dcm1UG1zAfNKe Ha3FfOsPIuGE3hNhypk8MdftUGA+Aa2pQZBsfTDS68fmZupwnRPrE0TdXOyM8l4DLuLG EGKy0LbFXynlquBoiBdyaNX5R+WJ1con0dHrcAhwEss2DbCL9g5Z90JIKNNaJmk8IBVh ByVUZFfH3EAPhD5Lvl+wdMQ2pOikdW+Ssj+MaDnOqqAjy/i9MWE4zskOTI38saKqLc9C y3dFIE0otw0yrDc3qZekPTd5nJXrX+0tOTAB5kf6w1sTaW4hWuxV4U30GQEs1LOev7tQ hMHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RQNOTFsm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk7si12620093ejb.717.2021.05.18.05.33.00; Tue, 18 May 2021 05:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RQNOTFsm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243450AbhEQP2V (ORCPT + 99 others); Mon, 17 May 2021 11:28:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:36296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243491AbhEQPON (ORCPT ); Mon, 17 May 2021 11:14:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 620B361C53; Mon, 17 May 2021 14:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261918; bh=sZURDu140O4z/6zp/lezuwLrla+Z+0BMu7Yr4aR4Sfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQNOTFsmlADdK3IZv3R9YlY+GlBfIjZDzU0T0EZjB3/+d1vfr9FYUPKki8ubNoP9z 6KjrmCbOERUj1qYiOkLz9Jz3Pwxqvnj4xyBPqHKtbZ4yiuWbmKo2MmlU7fvdsYk/Cp Vi2GxPc47A1l8Y7Q+hWQEitOBBuO/TAMV/0pdDdA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Petr Machata , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 085/289] selftests: mlxsw: Fix mausezahn invocation in ERSPAN scale test Date: Mon, 17 May 2021 16:00:10 +0200 Message-Id: <20210517140308.046268861@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Petr Machata [ Upstream commit 1233898ab758cbcf5f6fea10b8dd16a0b2c24fab ] The mirror_gre_scale test creates as many ERSPAN sessions as the underlying chip supports, and tests that they all work. In order to determine that it issues a stream of ICMP packets and checks if they are mirrored as expected. However, the mausezahn invocation missed the -6 flag to identify the use of IPv6 protocol, and was sending ICMP messages over IPv6, as opposed to ICMP6. It also didn't pass an explicit source IP address, which apparently worked at some point in the past, but does not anymore. To fix these issues, extend the function mirror_test() in mirror_lib by detecting the IPv6 protocol addresses, and using a different ICMP scheme. Fix __mirror_gre_test() in the selftest itself to pass a source IP address. Signed-off-by: Petr Machata Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../drivers/net/mlxsw/mirror_gre_scale.sh | 3 ++- .../selftests/net/forwarding/mirror_lib.sh | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh index 6f3a70df63bc..e00435753008 100644 --- a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh @@ -120,12 +120,13 @@ __mirror_gre_test() sleep 5 for ((i = 0; i < count; ++i)); do + local sip=$(mirror_gre_ipv6_addr 1 $i)::1 local dip=$(mirror_gre_ipv6_addr 1 $i)::2 local htun=h3-gt6-$i local message icmp6_capture_install $htun - mirror_test v$h1 "" $dip $htun 100 10 + mirror_test v$h1 $sip $dip $htun 100 10 icmp6_capture_uninstall $htun done } diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index 13db1cb50e57..6406cd76a19d 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -20,6 +20,13 @@ mirror_uninstall() tc filter del dev $swp1 $direction pref 1000 } +is_ipv6() +{ + local addr=$1; shift + + [[ -z ${addr//[0-9a-fA-F:]/} ]] +} + mirror_test() { local vrf_name=$1; shift @@ -29,9 +36,17 @@ mirror_test() local pref=$1; shift local expect=$1; shift + if is_ipv6 $dip; then + local proto=-6 + local type="icmp6 type=128" # Echo request. + else + local proto= + local type="icmp echoreq" + fi + local t0=$(tc_rule_stats_get $dev $pref) - $MZ $vrf_name ${sip:+-A $sip} -B $dip -a own -b bc -q \ - -c 10 -d 100msec -t icmp type=8 + $MZ $proto $vrf_name ${sip:+-A $sip} -B $dip -a own -b bc -q \ + -c 10 -d 100msec -t $type sleep 0.5 local t1=$(tc_rule_stats_get $dev $pref) local delta=$((t1 - t0)) -- 2.30.2