Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1473012rbb; Mon, 26 Feb 2024 10:14:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVFP2r4/0bYXae+2nVdyIZsUhh3l3UCbq3DkEFEVCXqC9+Jgv7tGI1uFEtR3RCewjqWIIjRT5djRE31Ecdj9rzF+klZnG9Ph/kmq3/ndA== X-Google-Smtp-Source: AGHT+IGiWo1lqsVUHQvIV+4MYs2gJEb9axIMLgIEBwCUQvcT0qo7F34qp+MkdTnWmqPGqd/iQOeW X-Received: by 2002:a05:6358:1287:b0:17b:5c81:839e with SMTP id e7-20020a056358128700b0017b5c81839emr10525797rwi.7.1708971250000; Mon, 26 Feb 2024 10:14:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708971249; cv=pass; d=google.com; s=arc-20160816; b=baA4a/QcyEpvqUuVQfqgnfnO5pRkEZup1ZT+xfW8QWMvBHALdp9LP4AKIoR6rc53y3 YHmPu3a2gSOd34gtsqW2tw0g6D/ORKx3w7txfKygKabQCAdYahP5wgHpAN0J1+S6Z15v AOmqLjBj61UaAOzWqnxCK6mQzWrMsjGCVYG6zMzsopZtVTDWTV5m/LwBLLgK6bmplHk0 Y3p55cEFKB/nIhJJE0YtkRlswvcRR/1U6A1urMA4uk0i/7q+UJLmbIFBMcH0OZ101pbL Wvijh902t53WlFxYXAO8lsk4A6LU5Xt50GMYbwfgA8thNxzqw9RgZ6SvyJfuj4uLyu0h l4MA== 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=6cXjyLkcrHV0fyL+siRkXUyRjYaVlM6DEPqeM5AVlDM=; fh=F83PMCXfVLwjB9TI94jQZ7DFys89qJjF92o1w9y7oKg=; b=I7XNyVzSt4uQXBNH043ikBXB70AbtH+s5C9S3zk+Tb7/7VGiKdCcTA4Mq395zNQMJR L0IMDrVB+TMBVJb6iuXsrmlQhtyNPH2cialJZ+vqu0HIEGIfHvdGRxLP7kqYtIsl9Ih3 k3Oycpbphr+tBnV7hfh0Phs76D3ty8E2EuRDJlwCtCps9RsWjBQn7Xvo5Mpx0DuewU2P hNzzkuQly2sz2CGuCL3Dt4FArcKrp5y9SVBrftepfx87rgydSos2sLdWgUXLrLkOyN2Q pFjrr+xg7erIC4xzFcFK58ASRwhAMB2gWhvgS9gZ01rt4/1nIX6Cr8c5sRWKAgZlC8c4 c9Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="M832y/Kf"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82093-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i4-20020a636d04000000b005cdf88fbc11si4113837pgc.48.2024.02.26.10.14.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 10:14:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82093-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="M832y/Kf"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-82093-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82093-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B9A40B314DE for ; Mon, 26 Feb 2024 17:45:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FBEA130E29; Mon, 26 Feb 2024 17:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M832y/Kf" 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 5108012E1F8; Mon, 26 Feb 2024 17:42:05 +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=1708969326; cv=none; b=tbsUG+L10Uq1TlDT6l3t1a+ii1OsAPFUnAv7m0gqhjjK4XGopS1GSw1LCiduTHq0l1qs7A2Db9/rHQjTWeRXVocPeeg4K90ZUYqDj7cdTy6fAsVlrKOTz8ztv1cnUD3RnS+rBftmyGuK8ZkPB/WxhPrFN1h7/915QbP1Zxe4Qec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708969326; c=relaxed/simple; bh=iwCMXGQsbQGxiwJHs3E7w0+xefWy7qifrPJJKX5kaWM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XDSvpPApulPUj9DpmPRRIOGDP13+JoR9zQcH4KuNpwmBZl0NaMw1bk5X5WbXdvZ7k/90P3teYHHIlHxmVrPgXC+BOA75YHbk9avQnX/dJGVuWZkw4vlflBT2VmjBbrCH8QDIFCpIsQBSoZeztscUZ8Vlyp9VTzIRFeY7/kTmAEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M832y/Kf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91435C433F1; Mon, 26 Feb 2024 17:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708969325; bh=iwCMXGQsbQGxiwJHs3E7w0+xefWy7qifrPJJKX5kaWM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M832y/Kf5o1+ndCigTMjJT0fqyP07vheldOXHsrUIazVUsDR1n2cK1kUPBNZJ32tI GqPO/GOeqgoHtwrWa28KMr+p3w/oHNMyBKu4+FshHmfKOHClC11AY1UMrhC77B+dDt UvpOd7A7Xb9p94SZmSp10hBvODDMZO2OyOSgh8XW0cEdskgxj4lGQLxxSeNhj+Wojr PzrbU4Q5ISYRdIlG4hyDAPSH8yvGFMOsbAVKBk/LchidazNKTboLZwyCxyb7JLYkEF xgcBRTlePUqNPjwz8nx9jdFtb6Q8cLlWhyTy76KBtLOWEDfx+DFmrm0PZ6DR9dXIf1 GwjHvFAT250og== Date: Mon, 26 Feb 2024 17:40:31 +0000 From: Simon Horman To: Matthieu Baerts Cc: Paolo Abeni , netdev@vger.kernel.org, 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: <20240226174031.GH13129@kernel.org> References: <1116d80f808ea870f3f77fe927dbd6c622d062ae.1708515908.git.pabeni@redhat.com> <20240222131338.GA960874@kernel.org> <22424f1c-3f76-454d-9de4-486c3f2f2478@kernel.org> 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: <22424f1c-3f76-454d-9de4-486c3f2f2478@kernel.org> On Thu, Feb 22, 2024 at 03:49:44PM +0100, Matthieu Baerts wrote: > Hi Simon, > > Thank you for the review! > > On 22/02/2024 2:13 pm, Simon Horman wrote: > > 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 > > Paolo sent a new version on MPTCP ML only. When applying the new > version, I fixed this: > > https://lore.kernel.org/mptcp/e98b8b07-558c-498a-97fb-dd5cab11e439@kernel.org/ > > >> +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. > > Good catch! > > I should add shellcheck support in our CI to catch that :) > > I just applied the suggested modification in our tree [1]. The new > version that will be sent to netdev will no longer have this issue. > > https://github.com/multipath-tcp/mptcp_net-next/commit/31f1460d552c Thanks Matt, much appreciated.