Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp327551rdb; Thu, 22 Feb 2024 05:14:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVH+b/j137eYOqoUclLSBXAOdRIINQg8FLUYkx7sJjYXvbmaZB/cYF68TI/kHdpmi59geGwOx2IKoal39ZgKo2E6Hc/sA4QKWRn5mpJiA== X-Google-Smtp-Source: AGHT+IFKQvRqTVajDwbCCjXTpkgIKaFQ0CAOJV68h4RNpZCiuK6ZGtHQtUHXJEWk8wBz7dLI2cTn X-Received: by 2002:a1f:eb41:0:b0:4c9:9ff9:b334 with SMTP id j62-20020a1feb41000000b004c99ff9b334mr10149452vkh.4.1708607652510; Thu, 22 Feb 2024 05:14:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708607652; cv=pass; d=google.com; s=arc-20160816; b=a1YcB/K2xrxNc2pFrrZNAz53vTxw0pwNA6SaPBkvwrXovw6ecFc5LWXaaCKlHG5kON /PRvd6OGfYyDtMaGhQ3RwXRDx8tFRQ4zIopR/boqiONezNy4bZJVW+94FZzSBejIRh2X H0R1ns7dgHFP07+hFAvIaAxRUWVQR5KnjcOhwBI6XSn2vWzWC9coTGlQdXG3/yzFoILe arncNguus+8g8Kvl3a6INECM9NzPi3JcNc7eSXzK0mBC5IZroDK4jH/LVPHv3qHzDbK7 9VbgXTN8bNQnSXNdhRp1pdntV3uVvov5ndpWD7CH0Rhhk42ULRrcVc9qtXYCnH/VHKqE 0dXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OJvjJkIfccSPQmHlDEoKUK4fw9YeWa3H5X94AeAWm8E=; fh=n90iJOHKK/pD0umVkWEnjTpEl3j+Jn6wQNAK8L/otdc=; b=WEzjR0MegCbJKai72wf3IpXBn5/DDk7fb9cUUrc0vM7/P5iJsBR1Jy1dvQxk/nuT5i P9Actw+iH+C0Z2jEOC733DO8fd/9Du6/+qcTMGpzBlw6FTdFv0NQhpeCEBOBQTTYHKH/ yx8innPYyKAlAzTg2qJN+XfjwuVwDInoNb5W8r7T6wzQV+0USoWQSSGPGOKHtr/olD4C 4xVjDyA7FNdkIaPHKTcKpgYgKrsMQVgclGfBfvHRvtwSKa//FscrF8z349TwQ1NVEXNU tmCOUp5E5Lp+Xbtl1ibBsAhRmkj6RRib34LqtBvIEnpEqSNBxCHqZrVsP1MLXhnw9LNs PYQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OAeTY3fS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j7-20020a056122090700b004cf21884e6bsi901549vka.306.2024.02.22.05.14.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 05:14:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OAeTY3fS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76568-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3F4901C20D6A for ; Thu, 22 Feb 2024 13:14:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67D86134CC6; Thu, 22 Feb 2024 13:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OAeTY3fS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89AC712FF95; Thu, 22 Feb 2024 13:13:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708607623; cv=none; b=YjHn3DqxCZ2xjQju6PqyiMM/zzYz1bZJi9ggTx+FLuyQN3gB85NCGOMR4yNbBiBkgSCWF29jn6c/ADB15iQ4SMkm180Dc5K2sYH+gM/Cn7cOUYhp1ddSiBPMR7qBGnyGRqB0o9NcpCso2/s/I/uS1B857N9TBv8JxChT8cg9yb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708607623; c=relaxed/simple; bh=6OzfR5St32D1ssiPndCMGGUD7Z7DoQf2u0dqtnL026Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mY8bUIncS9L3Y7a1UxHytBU0PT8kQQRymiWAWp3gALPRMCHuUtlQh8FOEDx8zbtwco5EmvX3yjN8GqdH22IoBk91NsUvoYd0hQ0yLl5Qj5yc20lr19ofPZ/EmY0NNFCyS66dI3C9FNUqMZxQMoRnfx6F9wyGRQQ7GB3+Za6rPDw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OAeTY3fS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1C78C433F1; Thu, 22 Feb 2024 13:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708607623; bh=6OzfR5St32D1ssiPndCMGGUD7Z7DoQf2u0dqtnL026Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OAeTY3fS/OcZeu4gttXoRy4eOkX7GsE7tkpmuOObXKBrKxsP1cLy0sSdOOmEdJwLt bBio7Khp5uxXWBSTmNPmu+KWattjJtUwz9GaLqf83TJF6WQTwR+r6nyFnCGhTGB9e+ D/eH69N/XwQmFyyswnQeF98uEnS/xoQ2YvUE+4HThieiyNzAubRL0qJ7175AizmlLw lpxjV3Ho5kv8TIhemS9HkrjVVWzuNu6ArvMTU8oLj6m+DKiOmRu74kgRiQGo8JSD0Y 3fREI6cO1lkdXAA9av0+DeI0VMcvVbsz3ciIghVmjUynl5x6vlAlwnZsI6VVHppm7P N/Otv6CbOTTOw== Date: Thu, 22 Feb 2024 13:13:38 +0000 From: Simon Horman To: Paolo Abeni Cc: netdev@vger.kernel.org, Matthieu Baerts , Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Shuah Khan , mptcp@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 2/2] selftests: mptcp: explicitly trigger the listener diag code-path Message-ID: <20240222131338.GA960874@kernel.org> References: <1116d80f808ea870f3f77fe927dbd6c622d062ae.1708515908.git.pabeni@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1116d80f808ea870f3f77fe927dbd6c622d062ae.1708515908.git.pabeni@redhat.com> On Wed, Feb 22, 2024 at 12:46:59PM +0100, Paolo Abeni wrote: >l The mptcp diag interface already experienced a few locking bugs > that lockdep and appropriate coverage have detected in advance. > > Let's add a test-case triggering the relevant code path, to prevent > similar issues in the future. > > Signed-off-by: Paolo Abeni > --- > tools/testing/selftests/net/mptcp/diag.sh | 30 +++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh > index 60a7009ce1b5..3ab584b38566 100755 > --- a/tools/testing/selftests/net/mptcp/diag.sh > +++ b/tools/testing/selftests/net/mptcp/diag.sh > @@ -81,6 +81,21 @@ chk_msk_nr() > __chk_msk_nr "grep -c token:" "$@" > } > > +chk_listener_nr() > +{ > + local expected=$1 > + local msg="$2" > + > + if [ $expected -gt 0 ] && \ > + ! mptcp_lib_kallsyms_has "mptcp_diag_dump_listeners"; then > + printf "%-50s%s\n" "$msg - mptcp" "[ skip ]" > + mptcp_lib_result_skip "many listener sockets" > + else > + __chk_nr "ss -inmlHMON $ns | wc -l" "$expected" "$msg - mptcp" > + fi > + __chk_nr "ss -inmlHtON $ns | wc -l" "$expected" "$msg - subflows" > +} > + > wait_msk_nr() > { > local condition="grep -c token:" > @@ -279,5 +294,20 @@ flush_pids > chk_msk_inuse 0 "many->0" > chk_msk_cestab 0 "many->0" > > +chk_listener_nr 0 "no listener sockets" > +NR_SERVERS=100 > +for I in $(seq 1 $NR_SERVERS); do > + ip netns exec $ns ./mptcp_connect -p $((I + 20001)) -l 0.0.0.0 2>&1 >/dev/null & > + mptcp_lib_wait_local_port_listen $ns $((I + 20001)) > +done > + > +chk_listener_nr $NR_SERVERS "many listener sockets" > + > +# gracefull termination nit, as you plan to re-spin anyway: graceful > +for I in $(seq 1 $NR_SERVERS); do > + echo a | ip netns exec $ns ./mptcp_connect -p $((I + 20001)) 127.0.0.1 2>&1 >/dev/null I'm not sure of the validity of this but shellcheck complains that: SC2069 (warning): To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify). Also for the same constriction slightly earlier in this patch. > +done > +flush_pids > + > mptcp_lib_result_print_all_tap > exit $ret > -- > 2.43.0 > >