From patchwork Mon Mar 1 16:15:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 388708 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3612689jap; Mon, 1 Mar 2021 11:03:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2imcrq5GwPScEx6imOkGWlqn16+1h23CcywkFRnX8cf9QxINp229xbQHMfu8UQDaPBm2N X-Received: by 2002:a05:6402:5255:: with SMTP id t21mr3638051edd.91.1614625427458; Mon, 01 Mar 2021 11:03:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614625427; cv=none; d=google.com; s=arc-20160816; b=QQTr41Py35k6zc9bNMczgkJE+t/O46TAAW5gHPGnDNSpCaP9yqrTErSqqWEhfZjyTz IJJJJRtbY+a4TiPKZa/EGVeSEYQjDj2jjpesv98+ZIAeDdSP+L9DccX7j0siqGVHw5R/ Nb+Ulz5y2+7oZYHOJ29GLRsuWGr3Yj83M86yAnFuRVHqIJIVLYuP/CLtXOTiTtNnohZ5 Z2wOteyo9ovymDT7VOm96q/FFoNUuEdMtKNK3BnCFPqWty5jeZ5gtatlGbjDXTaRBU3C VfWcHl4uUAu2PLmcogRM+xQF/kcVn2n6ujYtqpzX+azfqIVyjnRXEa6y+SDxCQyAWB6k Y1bg== 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=J7EQ+oftYdcS/ehsKBV4w0DFufwu5gP9gbM7Nsy1VPhsbydG7oJ+fMzqzNYyAU6m73 cDNUKFnqfwIkSBtYbJ613OG+S9c15nSELbBI3l5IwRgJEZVT2rzfo1B6gKYsc228nHnj gmSNIEXas3KQ9W5IUu/0/dai6WPom7p/5lM4t9ims5ATzTEuNyLgCsP5fMqtc8t7Qrjr Gtly7d6M8kaGUBDQ2zRFaORk3OnlgHgfP1RR08Fs3gzs/qBjdP6o67THxbVj/4tSnIWv kQFPW/UuOONCyoQX7HYKv4/CGh+BhPTiYG8knMY6fxutUMjlmcGgu00qP6gBADwlPj6v /wvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eXTXEG9U; 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 bm6si1710182edb.554.2021.03.01.11.03.47; Mon, 01 Mar 2021 11:03:47 -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=eXTXEG9U; 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 S240599AbhCATCP (ORCPT + 13 others); Mon, 1 Mar 2021 14:02:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:57716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240643AbhCASzw (ORCPT ); Mon, 1 Mar 2021 13:55:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A9F95652A5; Mon, 1 Mar 2021 17:33:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614620028; bh=+yxJtEY7CGCwsBtOtYkh4AHkeN5E+gqZX7oxIomWLao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eXTXEG9UAl2su55guN7cn64BnwTboButcI3RuLrbvILo5ZcgvgPlgG6Ebocq4kXmw +CUkb75/HGmAnp0vd4yOM5IbBRwckHUwD2UySsOp+eY55I6SWBUtaIinrHXJCsSJBH JJr9zDk683pQY9uWaxBfgsIO+JR73uMVl2adAMBg= 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.10 659/663] wireguard: selftests: test multiple parallel streams Date: Mon, 1 Mar 2021 17:15:07 +0100 Message-Id: <20210301161214.461225577@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@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]}"