From nobody Sat Dec 21 17:25:28 2024 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 1D138171E4F for ; Mon, 9 Sep 2024 03:46: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=1725853566; cv=none; b=HTtZJqe9BkQXeVjFL6mKnYUfS2mjrE7+ftmiBdJlqJXhrI5MLiua54HQTG2YFoxWBydfYbjox5tfAR1kPBmulmwwe42gx7DxlHHy3D4AxmQE51GlA3uxLWX4jewGpDcQahKrXlpAIfN1C6akzbCiw3AwC0fAlRVHmBQIOG49LnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725853566; c=relaxed/simple; bh=NMfSo/BWgyFRZXBAlo7PBd8RIfso8UCUT7cUYKAlSY0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JeSR8K7XajGVfe5OaNCsVVjl89hLsfhbHX8D5M6cUKunv4hGWAO7qas+PKGx+SNAywCioK1gb0lpJtwZg/p5SAJ55N64DAoslWf8MnRy9NzT+lwu1nZvsC5inaNKgMX6dhRmzCH+ElY6qhJ6Vtwy3KJ7NXwjbfkRk4YLCnU+p0w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pypNZvTy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pypNZvTy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7175EC4CEC9; Mon, 9 Sep 2024 03:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725853565; bh=NMfSo/BWgyFRZXBAlo7PBd8RIfso8UCUT7cUYKAlSY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pypNZvTydM+L7mf5jkNBrL2bsFvMGlogBzyVfvc4sWVpqopOs0PFynIFKe/HHxsOP 8mn17SCffMuuBzH2Co5txdunoJ5HjI8XgPmUCGAnzIS/+ve7coCV3COJ7rSEvjUzmC KIdSejkWnHJT9y/IzMxBHwudrSb2Ogd3D676D4YYPv3TigANjKG64Hzacme4liErhb B1JFWmRE710pY3a+/vsok6uzPV4UiGUZYdmjh1bcp4ST8+j21+17tm4WYaJ+fmNBQE LUd98P0XfUFcqmnqejKjoQRd+CTcSp3pe6ekW0i91bTJmEPB6unOaWWQxM6aK6W3sW 36OSBM4R/XpZw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next 1/2] mptcp: implement mptcp_pm_connection_closed Date: Mon, 9 Sep 2024 11:45:56 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 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 Content-Type: text/plain; charset="utf-8" From: Geliang Tang The MPTCP path manager event handler mptcp_pm_connection_closed interface is added in the commit "mptcp: Add path manager interface", but it was an empty function from then on. It makes sense to invoke mptcp_event with the MPTCP_EVENT_CLOSED event type in it. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) --- net/mptcp/pm.c | 3 +++ net/mptcp/protocol.c | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 620264c75dc2..16c336c51940 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -154,6 +154,9 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk,= const struct sock *ssk) void mptcp_pm_connection_closed(struct mptcp_sock *msk) { pr_debug("msk=3D%p\n", msk); + + if (msk->token) + mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL); } =20 void mptcp_pm_subflow_established(struct mptcp_sock *msk) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 7ef59e17d03a..a12149d8f718 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3121,8 +3121,7 @@ bool __mptcp_close(struct sock *sk, long timeout) =20 sock_hold(sk); pr_debug("msk=3D%p state=3D%d\n", sk, sk->sk_state); - if (msk->token) - mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL); + mptcp_pm_connection_closed(msk); =20 if (sk->sk_state =3D=3D TCP_CLOSE) { __mptcp_destroy_sock(sk); @@ -3188,8 +3187,7 @@ static int mptcp_disconnect(struct sock *sk, int flag= s) mptcp_stop_rtx_timer(sk); mptcp_stop_tout_timer(sk); =20 - if (msk->token) - mptcp_event(MPTCP_EVENT_CLOSED, msk, NULL, GFP_KERNEL); + mptcp_pm_connection_closed(msk); =20 /* msk->subflow is still intact, the following will not free the first * subflow --=20 2.43.0 From nobody Sat Dec 21 17:25:28 2024 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 9847C193 for ; Mon, 9 Sep 2024 03:46:07 +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=1725853567; cv=none; b=QBV1Rv3r7Hz6E65bqXs9kgWAyq1F4jzcK5bg9BLOAyTw/oXGG9lpSeFwcSNrWNFZT71yS5iBx2yjyEtsRVyH4i9ZB2BtyL/Rgon79qczGAfXagQUKSccf+CHf3yGCf8dBrfu6hjrEK4TuAXvEd5o8PRZQG+ga8JXulw2Xvfab9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725853567; c=relaxed/simple; bh=YNj9H09pZ8af6W51VC2jImFXex8KHQ3uU2eQrRE+X64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=svqk8Fb5RFtUu6AORqMlGQWBFMFu4HuDybHMciYUX4HW8pIXF2FEBVeQJw7GML3yvRP+FSlpD0qrrGNGrsBZFoGTEMTvnczGnvQlJgSiiSfo0jAxT3GCEd8F3SHvdFca1+8Dzw0cu/OZ1NGlEIT1L8t0xbh2THkeSP0Sb0RdIJ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XNlinHl1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XNlinHl1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4ACA8C4CEC5; Mon, 9 Sep 2024 03:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725853567; bh=YNj9H09pZ8af6W51VC2jImFXex8KHQ3uU2eQrRE+X64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XNlinHl1lBLUItF3eCH7P4s+ovoWAXcxJ6PvxolUctfW/WZEa3UZ72jSIxFIJwuWf 7gJMnXZ7Pp9t2yu1gFoC/hIOEAZ+F32fQezwaO3B5gmuGMUIsmmNIw0lUvKPfyQoHk LpnKKWovbWjkB1JkPh2LT9mx2e/tiLzzhzX2Du7P6iJIDBfU1vySx+pjLwflUjYIvo jd16RA4YgDE4pgNe+uN1vqFab20sgDmigki50RykWjOL2Tl7+R1Zpq50+wfloP6pqp lhhcaxiXDvCDfbQNaYth7O5onapcc5f0kw67fGtyS76U6vHZjbQEYZ8QCGeVCrYvNw kPOZuR1k1Jzxg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next 2/2] mptcp: add back mptcp_pm_subflow_closed Date: Mon, 9 Sep 2024 11:45:57 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 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 Content-Type: text/plain; charset="utf-8" From: Geliang Tang The MPTCP path manager event handler mptcp_pm_subflow_closed interface is added in the commit "mptcp: Add path manager interface", but removed in the commit "mptcp: do not block subflows creation on errors". This patch adds it back and changes its 2nd parameter from "u8 id" to "struct sock *ssk". Invoke mptcp_event with the MPTCP_EVENT_SUB_CLOSED event type in it. Signed-off-by: Geliang Tang --- net/mptcp/pm.c | 7 +++++++ net/mptcp/protocol.c | 2 +- net/mptcp/protocol.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 16c336c51940..23f73f07a9e7 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -176,6 +176,13 @@ void mptcp_pm_subflow_established(struct mptcp_sock *m= sk) spin_unlock_bh(&pm->lock); } =20 +void mptcp_pm_subflow_closed(struct mptcp_sock *msk, struct sock *ssk) +{ + pr_debug("msk=3D%p", msk); + + mptcp_event(MPTCP_EVENT_SUB_CLOSED, msk, ssk, GFP_KERNEL); +} + void mptcp_pm_subflow_check_next(struct mptcp_sock *msk, const struct mptcp_subflow_context *subflow) { diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index a12149d8f718..69859eb2d891 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2515,7 +2515,7 @@ void mptcp_close_ssk(struct sock *sk, struct sock *ss= k, subflow->close_event_done =3D true; =20 if (sk->sk_state =3D=3D TCP_ESTABLISHED) - mptcp_event(MPTCP_EVENT_SUB_CLOSED, mptcp_sk(sk), ssk, GFP_KERNEL); + mptcp_pm_subflow_closed(mptcp_sk(sk), ssk); =20 /* subflow aborted before reaching the fully_established status * attempt the creation of the next subflow diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index d25d2dac88a5..0c8ab6071a3f 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -996,6 +996,7 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk,= const struct sock *ssk); bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk); void mptcp_pm_connection_closed(struct mptcp_sock *msk); void mptcp_pm_subflow_established(struct mptcp_sock *msk); +void mptcp_pm_subflow_closed(struct mptcp_sock *msk, struct sock *ssk); bool mptcp_pm_nl_check_work_pending(struct mptcp_sock *msk); void mptcp_pm_subflow_check_next(struct mptcp_sock *msk, const struct mptcp_subflow_context *subflow); --=20 2.43.0