From patchwork Mon Mar 1 16:15:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 388749 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3677406jap; Mon, 1 Mar 2021 12:40:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuvPlJHLavulSxQB8whFqvIC4m4HIP327bFpHF3vH3ZX6/8Ev3G5+UDkstVqE69STu++7c X-Received: by 2002:a17:906:3c50:: with SMTP id i16mr16515902ejg.175.1614631210957; Mon, 01 Mar 2021 12:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614631210; cv=none; d=google.com; s=arc-20160816; b=xbSs11JSVNIRaIYK/vLFQZy3STomFobPgYEDMCpv2saBXmaldckLuOUNdU7/6OnfsS tO6HNcQo6t/V4GQjpCk0knmSTxF5czHaMOiBnGGgSNQ8NcMbRQMex/izcxia8HhjWA2c 2sTf7eDfnjo0akdcjNehjV0+XsUuiz7x474mSxWfb2r9hcsEIcMI9Dsds7xJKeCD12/N gGvqddwDFu09hlXToukO92bC6LhmdDg3N2mKG+RUP9k+yn0VihNiw7oJJf70e9SLP2Cb 2rReSJl5wtjgLxjCB0V/n8snewZZbPZlKFxCBX2so/BxUB19brq/Igo2lNo/Ci3s5GZf u+EQ== 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=RjJcbGhfdZ/gO22sEx7IYEZ9A+c+FRxzmtlBk4N2oRM=; b=Qpx4GatodsrFkhU6axyozp6wGGIUykKyBiT415B3J/qjJHzTkI2YM0yJFzvxoAuDbv /PDIaioAYWYa7kUHn/vfJKV53X5FnOcMtE9ybhtPPDmDx6SjFpDT41ph7Hdr529H7k9w yvATdLlWspsuouLUGhYHJfeT4z/H48nQe2UNST84eIkVz+aTnwScJrz82lwtUaRZ9zXb LQNuRUgAy0MuK0YZwxWW5vtYVeIdQVEbRF71cYyhwmrVva8jnJ5pTgN0x5Tx2py0hkys 8rXmQTbibmi1zSIOLRTjEtRYaSmD5+VxgH859Cm5iwd9qVs2hiweWgDqNn4/jxZJQCLL Rukg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pDDiz+4L; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 c10si2534507edv.12.2021.03.01.12.40.10; Mon, 01 Mar 2021 12:40:10 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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=pDDiz+4L; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S243640AbhCAUis (ORCPT + 13 others); Mon, 1 Mar 2021 15:38:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:51428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243244AbhCAUcS (ORCPT ); Mon, 1 Mar 2021 15:32:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 29CA6650B2; Mon, 1 Mar 2021 18:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614622137; bh=+yxJtEY7CGCwsBtOtYkh4AHkeN5E+gqZX7oxIomWLao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDDiz+4LDzMk14WykXjFuqnaeMPKFp/Toy+OHArkOhU17bOJy8gfCQiexyD95In9p f60gnFAy6kwjpuwDWxvZAANLYroFXCqgUDolmObwVcjhnr7YW4njwXQGyCbytDiUWR LIl65ccXBVn3z6nvnJFacsFSM4y6myip6afSUPpo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Jason A. Donenfeld" , Jakub Kicinski Subject: [PATCH 5.11 771/775] wireguard: selftests: test multiple parallel streams Date: Mon, 1 Mar 2021 17:15:39 +0100 Message-Id: <20210301161239.415363284@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161201.679371205@linuxfoundation.org> References: <20210301161201.679371205@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jason A. Donenfeld commit d5a49aa6c3e264a93a7d08485d66e346be0969dd upstream. In order to test ndo_start_xmit being called in parallel, explicitly add separate tests, which should all run on different cores. This should help tease out bugs associated with queueing up packets from different cores in parallel. Currently, it hasn't found those types of bugs, but given future planned work, this is a useful regression to avoid. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/wireguard/netns.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) --- a/tools/testing/selftests/wireguard/netns.sh +++ b/tools/testing/selftests/wireguard/netns.sh @@ -39,7 +39,7 @@ ip0() { pretty 0 "ip $*"; ip -n $netns0 ip1() { pretty 1 "ip $*"; ip -n $netns1 "$@"; } ip2() { pretty 2 "ip $*"; ip -n $netns2 "$@"; } sleep() { read -t "$1" -N 1 || true; } -waitiperf() { pretty "${1//*-}" "wait for iperf:5201 pid $2"; while [[ $(ss -N "$1" -tlpH 'sport = 5201') != *\"iperf3\",pid=$2,fd=* ]]; do sleep 0.1; done; } +waitiperf() { pretty "${1//*-}" "wait for iperf:${3:-5201} pid $2"; while [[ $(ss -N "$1" -tlpH "sport = ${3:-5201}") != *\"iperf3\",pid=$2,fd=* ]]; do sleep 0.1; done; } waitncatudp() { pretty "${1//*-}" "wait for udp:1111 pid $2"; while [[ $(ss -N "$1" -ulpH 'sport = 1111') != *\"ncat\",pid=$2,fd=* ]]; do sleep 0.1; done; } waitiface() { pretty "${1//*-}" "wait for $2 to come up"; ip netns exec "$1" bash -c "while [[ \$(< \"/sys/class/net/$2/operstate\") != up ]]; do read -t .1 -N 0 || true; done;"; } @@ -141,6 +141,19 @@ tests() { n2 iperf3 -s -1 -B fd00::2 & waitiperf $netns2 $! n1 iperf3 -Z -t 3 -b 0 -u -c fd00::2 + + # TCP over IPv4, in parallel + for max in 4 5 50; do + local pids=( ) + for ((i=0; i < max; ++i)) do + n2 iperf3 -p $(( 5200 + i )) -s -1 -B 192.168.241.2 & + pids+=( $! ); waitiperf $netns2 $! $(( 5200 + i )) + done + for ((i=0; i < max; ++i)) do + n1 iperf3 -Z -t 3 -p $(( 5200 + i )) -c 192.168.241.2 & + done + wait "${pids[@]}" + done } [[ $(ip1 link show dev wg0) =~ mtu\ ([0-9]+) ]] && orig_mtu="${BASH_REMATCH[1]}"