From nobody Wed May 15 01:00:26 2024 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (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 051D54C9C for ; Tue, 19 Dec 2023 02:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="wvm63Vwn" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702951515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wiKp+yp9sD3/MgmOWyQTCXqF1hHLdh1xASrwowdCyY4=; b=wvm63VwngVeR0nIN9BJeINW3jsc/ckM7Fiw6Wg/CuO7uUZyMAd0oc+9Ah41rsDU0fE9GTG 109JGrOcTJ+SVWqsVwp6NfB7lObnUVYLeE79MhnXsAloMyQmM7LVi7BB+mVl1rrQVYuMgr mRmAtTClEsSwrxDy4DlcWsZCqtbvXPk= From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 1/4] Squash to "mptcp: use mptcp_set_state" 1 Date: Tue, 19 Dec 2023 10:03:53 +0800 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Remove the comment. Signed-off-by: Geliang Tang --- net/mptcp/pm_netlink.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index b93683b5e618..bf4d96f6f99a 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1048,9 +1048,6 @@ static int mptcp_pm_nl_create_listen_socket(struct so= ck *sk, if (err) return err; =20 - /* avoid replacing inet_sk_state_store with mptcp_set_state here, as the - * old status is known to be TCP_CLOSE, hence will not affect the count. - */ inet_sk_state_store(newsk, TCP_LISTEN); lock_sock(ssk); err =3D __inet_listen_sk(ssk, backlog); --=20 2.35.3 From nobody Wed May 15 01:00:26 2024 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (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 D0E0F1FDD for ; Tue, 19 Dec 2023 02:05:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="r3Ygk3AC" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702951516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HVMhsKLZTyQR2IW3wdxY5wyDLDlcJPEPOzs7MRL07Go=; b=r3Ygk3ACepmFkSBgndT8d57YvXwGgjGSpir8BI4D6M3ePFwinWZhhj3FSbiyMkiBjj8sZ/ fiG2C6/k6Ctg/wlJ3iXSR19UsR5CE+rqxLroCejxQZSMiOxyUZkNuhNvKnAJlZNDZgZY1P d7uMBx6iWEs1vh//TmKQnIuoMBK8FrY= From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 2/4] mptcp: move inet_sk_state_store under lock Date: Tue, 19 Dec 2023 10:03:54 +0800 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" This patch moves inet_sk_state_store() under the socket lock in mptcp_pm_nl_create_listen_socket(). This is a pre-req patch for using mptcp_set_state() instead of inet_sk_state_store(). Signed-off-by: Geliang Tang --- net/mptcp/pm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index bf4d96f6f99a..c35ae045a925 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1030,6 +1030,7 @@ static int mptcp_pm_nl_create_listen_socket(struct so= ck *sk, =20 lock_sock(newsk); ssk =3D __mptcp_nmpc_sk(mptcp_sk(newsk)); + inet_sk_state_store(newsk, TCP_LISTEN); release_sock(newsk); if (IS_ERR(ssk)) return PTR_ERR(ssk); @@ -1048,7 +1049,6 @@ static int mptcp_pm_nl_create_listen_socket(struct so= ck *sk, if (err) return err; =20 - inet_sk_state_store(newsk, TCP_LISTEN); lock_sock(ssk); err =3D __inet_listen_sk(ssk, backlog); if (!err) --=20 2.35.3 From nobody Wed May 15 01:00:26 2024 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 CDC894695 for ; Tue, 19 Dec 2023 02:05:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="JxcvIHAJ" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702951517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nmbzJ9eI/iTWvQpTVfZNnJC26dc0VdtCIBL1/IQEe78=; b=JxcvIHAJK4W+iRk8nfG17n2h/FxwloJgDS99Dvn8WZ6TLH9smKY607GhIP0OCrqwx9/om4 nFGgZ16qXmkx6oM3OOfcFpHAFC71qroNLdG1eeZWtPZAjTusFBr5OmwHqBRNYT97/x5V6F dpw/H6IwqE2yPoA1aBvAAr/u76ZFlvY= From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 3/4] Squash to "mptcp: use mptcp_set_state" 2 Date: Tue, 19 Dec 2023 10:03:55 +0800 Message-Id: In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Use mptcp_set_state() in mptcp_pm_nl_create_listen_socket(). Signed-off-by: Geliang Tang --- net/mptcp/pm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index c35ae045a925..1b754cf525de 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1030,7 +1030,7 @@ static int mptcp_pm_nl_create_listen_socket(struct so= ck *sk, =20 lock_sock(newsk); ssk =3D __mptcp_nmpc_sk(mptcp_sk(newsk)); - inet_sk_state_store(newsk, TCP_LISTEN); + mptcp_set_state(newsk, TCP_LISTEN); release_sock(newsk); if (IS_ERR(ssk)) return PTR_ERR(ssk); --=20 2.35.3 From nobody Wed May 15 01:00:26 2024 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 922481FDD for ; Tue, 19 Dec 2023 02:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="lR3dduMv" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702951518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/pAa70Rl6BHDRPjsfzgIlQAXFwYVdlodECcstnXA1ZE=; b=lR3dduMv91MF5zhDo71OhaBagmFyumlmlBtCQiTmBAVgmgQkK7n1AcSaJXSCB2T0JOvBxn xvP6WS8SSA/Z3piNUMOg4rciK1OWPXazdAWEUeNDHEJWGjKmqg2A8o/D71oJAC4ao1h/to VPXTGw+DK+3qFtWCZBkY66wmIpXz8g8= From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 4/4] selftests: mptcp: diag: check CURRESTAB counters Date: Tue, 19 Dec 2023 10:03:56 +0800 Message-Id: <6d9def0df5cb5edf499ca2538d7f5bd28721029a.1702951288.git.geliang.tang@linux.dev> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" This patch adds a new helper chk_msk_cestab() to check the current established connections counter MIB_CURRESTAB in diag.sh. Invoke it to check the counter during the connection after every chk_msk_inuse(). Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/self= tests/net/mptcp/diag.sh index 95b498efacd1..649017addb3e 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -182,6 +182,16 @@ chk_msk_inuse() __chk_nr get_msk_inuse $expected "$msg" 0 } =20 +# $1: ns, $2: cestab nr +chk_msk_cestab() +{ + local ns=3D$1 + local cestab=3D$2 + + __chk_nr "mptcp_lib_get_counter ${ns} MPTcpExtMPCurrEstab" \ + "${cestab}" "....chk ${cestab} cestab" "" +} + wait_connected() { local listener_ns=3D"${1}" @@ -219,9 +229,11 @@ chk_msk_nr 2 "after MPC handshake " chk_msk_remote_key_nr 2 "....chk remote_key" chk_msk_fallback_nr 0 "....chk no fallback" chk_msk_inuse 2 "....chk 2 msk in use" +chk_msk_cestab $ns 2 flush_pids =20 chk_msk_inuse 0 "....chk 0 msk in use after flush" +chk_msk_cestab $ns 0 =20 echo "a" | \ timeout ${timeout_test} \ @@ -237,9 +249,11 @@ echo "b" | \ wait_connected $ns 10001 chk_msk_fallback_nr 1 "check fallback" chk_msk_inuse 1 "....chk 1 msk in use" +chk_msk_cestab $ns 1 flush_pids =20 chk_msk_inuse 0 "....chk 0 msk in use after flush" +chk_msk_cestab $ns 0 =20 NR_CLIENTS=3D100 for I in `seq 1 $NR_CLIENTS`; do @@ -261,9 +275,11 @@ done =20 wait_msk_nr $((NR_CLIENTS*2)) "many msk socket present" chk_msk_inuse $((NR_CLIENTS*2)) "....chk many msk in use" +chk_msk_cestab $ns $((NR_CLIENTS*2)) flush_pids =20 chk_msk_inuse 0 "....chk 0 msk in use after flush" +chk_msk_cestab $ns 0 =20 mptcp_lib_result_print_all_tap exit $ret --=20 2.35.3