Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3012072pxj; Mon, 17 May 2021 15:32:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV+GA7gefesR3qdoTmVyVOEcivRwz1wL+oWQsE6xZFvTSFh2J1N8TphoLX2qLlP5XkW2Rc X-Received: by 2002:a17:906:cb1:: with SMTP id k17mr2243040ejh.307.1621290754789; Mon, 17 May 2021 15:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621290754; cv=none; d=google.com; s=arc-20160816; b=nJNBNQgPlhZEGMCU15hNrcRK1VaIoSn6JoSZ4BOWXGYFPpMat6wMgavXIIfRvRsFQW N30XJcSGhDtTpjK8A8+GAtrgq9XeHaEIPmJkkpYJklqEkk14+/9Kec4O8Lwjo978/rgv fWhjwXxobX3zAcFBfytZelgaifHm50XBvHtemPe5sjunr/0pQXQ7E1SXQh9+vYhNQ15M ykuxXpWX4/fBAAbkX2mVrEESx/4dk6fAE1R/RTYcnQVz7vsF6YuLdKZWMf/8Jm0y7Db2 4ikykRiaCLXAV2UUfMcvPhVj3m2kayjhAR1A+hKwBqXLAhRCwKDOJYWdNDI0f2XIxibL IgzQ== 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=CWErtlBtrHym9lE3Wc/r+dz9ZT47p5qEJxdNp84aFSNkKVomsxUs95qDVITUXwsetZ uZKmMaaH7bQbCBs/CsCd5gWfsys75NYVdGU/NqfpQ0KaWjHRacmB6QB5pIjDcqhBVq1f 1EXYlHTnjB89nSm0qjx7SXZwPASAlklU80fIf922hvisrrgxUjivtRXG+RqbHSdgZyOq 7n/wZtsmglmUUZ9v+n3NttADtvTB6FbV+FgWDxJaF2WRmZF6C8HVYQNGTTsAIkTqQ/42 gqAu5kodnaqhh53P6UPGSJbGjgBaCM6AD5Zio2je66qIn9XzNBit/6xzTrtTMIGLzkWn AeNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="oi+Gh/uf"; 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 p13si15022307edt.516.2021.05.17.15.32.08; Mon, 17 May 2021 15:32:34 -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="oi+Gh/uf"; 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 S233732AbhEQOPv (ORCPT + 99 others); Mon, 17 May 2021 10:15:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:46778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238492AbhEQONB (ORCPT ); Mon, 17 May 2021 10:13:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 945976128A; Mon, 17 May 2021 14:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260510; bh=sZURDu140O4z/6zp/lezuwLrla+Z+0BMu7Yr4aR4Sfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oi+Gh/ufomUkf754nzDzGjshZ+GlZ/aQx/pTvIwyqGtK8S8FVDfqKN9CTn1Rn+uxt IrfHHV7p118CNVofxohJ6DeZnh3lL5mS8Dbm0dCZ89brp156aJsLoXRBYtuO4/mIJL gmxYDUuEqyfktcRzDqOcvkaFYM3kAMmTUTxyxG9Y= 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.12 114/363] selftests: mlxsw: Fix mausezahn invocation in ERSPAN scale test Date: Mon, 17 May 2021 15:59:40 +0200 Message-Id: <20210517140306.480732682@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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