Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp172801pxb; Mon, 13 Sep 2021 16:14:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9Njf81HUjrEa3e90S/axa3HEkjMZxsbRQhNOVvDXgAcACgdn4CDJNp8o7mTIl5fg/EOYK X-Received: by 2002:a02:664c:: with SMTP id l12mr11869893jaf.140.1631574857939; Mon, 13 Sep 2021 16:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631574857; cv=none; d=google.com; s=arc-20160816; b=yNIBqWqm3b9enQLI8yj1woqE05XLdh0ruAqv+SwkxAgjyHfz1XhWhb2BXDE/I3ONb8 JZy2Jsj7E69013ZnhkBjygyJR+728O119EVDI3dHjKCtOyDpGKBhTWoNFVeVRpsAKghP td2m0cJGDmufevtjVbIVa8iFaDTCZ+VzFjSIY1nhWzR4vYl3MN+nrxDOFALUBr7a+/R0 IjS0677rJZj+UIVIe7vrNFiA/c8FBWrN+tE+Foy/zGkH6JdMmG786gMO1pE8Zp41VuqH v8JVBTLVaTu34ZWGI+rCX4WHdXar5yf1YrR4192jVwE2PlQSm5Gj3BjSkKG0+ZPFrUib Em1Q== 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=xInnnofPj9+gNHHhxaHv33IzY+KlYvPbwpmEq3ADdsE=; b=nHdbi5B1fw6XhK/kPPeTb13PjE7gLZSDuVCZmReEWRc4S/cLs2pv2WGydC7M4kdQto 90DQE4uBeYOgu9IL+Smv1mD4CxU05RjF6UGyo0HG9Ez/HXGNUW4ks+31bD39wUe0PQLg hA5HL+KPrEzXkoTaSRlk/JyB9mxO6Snvz93BBHQkCbNs/QAEMddwhUVhvTf0UbVvjkxY OREJP4FiXh8vRk+5+g+lDUOjk5fS5Xt4gNfa9O7+ONtM7Wd6yAk3Xs8c0CJEYD62QdJA FHmLuCkMmh71cjzUf0zuaELhAezZqxgnJIx2VVf0SzbFqBU665Bvy4COMT0GVpg7hF0j T0gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="PCEQ/Enp"; 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 12si10053926ilx.115.2021.09.13.16.14.07; Mon, 13 Sep 2021 16:14:17 -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="PCEQ/Enp"; 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 S1347594AbhIMOoU (ORCPT + 99 others); Mon, 13 Sep 2021 10:44:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:56448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344690AbhIMOiQ (ORCPT ); Mon, 13 Sep 2021 10:38:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8925061BFE; Mon, 13 Sep 2021 13:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541299; bh=CYiB1aMIWWAMm2ZsmMcPppK+lqU7EK1RD9hO65gN7nM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PCEQ/EnpK3BtwEPVoUxyLlob/C97tR7WQpTANlNpiiit7/MNHnLGy3Y3UHPQvAFmM gG/EmTGKxuAby93KYuKzQXlNOTF0HLllD7W+2utR7wsT+sz3g5KRD4sgzmhMN03UW3 OoMM+UBs9m3RjF+i6+YK7KmgXeQr03ZYIj0TnoAU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juhee Kang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.14 210/334] samples: pktgen: add missing IPv6 option to pktgen scripts Date: Mon, 13 Sep 2021 15:14:24 +0200 Message-Id: <20210913131120.518447439@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@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: Juhee Kang [ Upstream commit 0f0c4f1b72e090b23131700bb155944cc28b2a7b ] Currently, "sample04" and "sample05" are not working properly when running with an IPv6 option("-6"). The commit 0f06a6787e05 ("samples: Add an IPv6 "-6" option to the pktgen scripts") has omitted the addition of this option at "sample04" and "sample05". In order to support IPv6 option, this commit adds logic related to IPv6 option. Fixes: 0f06a6787e05 ("samples: Add an IPv6 "-6" option to the pktgen scripts") Signed-off-by: Juhee Kang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- samples/pktgen/pktgen_sample04_many_flows.sh | 12 +++++++----- samples/pktgen/pktgen_sample05_flow_per_thread.sh | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/samples/pktgen/pktgen_sample04_many_flows.sh b/samples/pktgen/pktgen_sample04_many_flows.sh index 56c5f5af350f..cff51f861506 100755 --- a/samples/pktgen/pktgen_sample04_many_flows.sh +++ b/samples/pktgen/pktgen_sample04_many_flows.sh @@ -13,13 +13,15 @@ root_check_run_with_sudo "$@" # Parameter parsing via include source ${basedir}/parameters.sh # Set some default params, if they didn't get set -[ -z "$DEST_IP" ] && DEST_IP="198.18.0.42" +if [ -z "$DEST_IP" ]; then + [ -z "$IP6" ] && DEST_IP="198.18.0.42" || DEST_IP="FD00::1" +fi [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" [ -z "$CLONE_SKB" ] && CLONE_SKB="0" [ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely if [ -n "$DEST_IP" ]; then - validate_addr $DEST_IP - read -r DST_MIN DST_MAX <<< $(parse_addr $DEST_IP) + validate_addr${IP6} $DEST_IP + read -r DST_MIN DST_MAX <<< $(parse_addr${IP6} $DEST_IP) fi if [ -n "$DST_PORT" ]; then read -r UDP_DST_MIN UDP_DST_MAX <<< $(parse_ports $DST_PORT) @@ -62,8 +64,8 @@ for ((thread = $F_THREAD; thread <= $L_THREAD; thread++)); do # Single destination pg_set $dev "dst_mac $DST_MAC" - pg_set $dev "dst_min $DST_MIN" - pg_set $dev "dst_max $DST_MAX" + pg_set $dev "dst${IP6}_min $DST_MIN" + pg_set $dev "dst${IP6}_max $DST_MAX" if [ -n "$DST_PORT" ]; then # Single destination port or random port range diff --git a/samples/pktgen/pktgen_sample05_flow_per_thread.sh b/samples/pktgen/pktgen_sample05_flow_per_thread.sh index 6e0effabca59..3578d0aa4ac5 100755 --- a/samples/pktgen/pktgen_sample05_flow_per_thread.sh +++ b/samples/pktgen/pktgen_sample05_flow_per_thread.sh @@ -17,14 +17,16 @@ root_check_run_with_sudo "$@" # Parameter parsing via include source ${basedir}/parameters.sh # Set some default params, if they didn't get set -[ -z "$DEST_IP" ] && DEST_IP="198.18.0.42" +if [ -z "$DEST_IP" ]; then + [ -z "$IP6" ] && DEST_IP="198.18.0.42" || DEST_IP="FD00::1" +fi [ -z "$DST_MAC" ] && DST_MAC="90:e2:ba:ff:ff:ff" [ -z "$CLONE_SKB" ] && CLONE_SKB="0" [ -z "$BURST" ] && BURST=32 [ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely if [ -n "$DEST_IP" ]; then - validate_addr $DEST_IP - read -r DST_MIN DST_MAX <<< $(parse_addr $DEST_IP) + validate_addr${IP6} $DEST_IP + read -r DST_MIN DST_MAX <<< $(parse_addr${IP6} $DEST_IP) fi if [ -n "$DST_PORT" ]; then read -r UDP_DST_MIN UDP_DST_MAX <<< $(parse_ports $DST_PORT) @@ -52,8 +54,8 @@ for ((thread = $F_THREAD; thread <= $L_THREAD; thread++)); do # Single destination pg_set $dev "dst_mac $DST_MAC" - pg_set $dev "dst_min $DST_MIN" - pg_set $dev "dst_max $DST_MAX" + pg_set $dev "dst${IP6}_min $DST_MIN" + pg_set $dev "dst${IP6}_max $DST_MAX" if [ -n "$DST_PORT" ]; then # Single destination port or random port range -- 2.30.2