[PATCH mptcp-next] Squash-to: "mptcp: use fastclose on more edge scenarios"

Paolo Abeni posted 1 patch 1 year, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/0a7720e1aebc9ae8babf8b4881b7ad2acf672352.1664198754.git.pabeni@redhat.com
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
net/mptcp/protocol.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
[PATCH mptcp-next] Squash-to: "mptcp: use fastclose on more edge scenarios"
Posted by Paolo Abeni 1 year, 7 months ago
The orginal commit applied fastclose too aggressivly.
Specifically, we don't need a fastclose after the completion of
the data_fin handshakr for an orphaned socket.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
paired pktdrill update:
https://github.com/multipath-tcp/packetdrill/pull/88
---
 net/mptcp/protocol.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 0eeb8115c9d0..c99eb4ce948e 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2607,12 +2607,15 @@ static void mptcp_worker(struct work_struct *work)
 	 * closed, but we need the msk around to reply to incoming DATA_FIN,
 	 * even if it is orphaned and in FIN_WAIT2 state
 	 */
-	if (sock_flag(sk, SOCK_DEAD) &&
-	    (mptcp_check_close_timeout(sk) || sk->sk_state == TCP_CLOSE)) {
-		inet_sk_state_store(sk, TCP_CLOSE);
-		mptcp_do_fastclose(sk);
-		__mptcp_destroy_sock(sk);
-		goto unlock;
+	if (sock_flag(sk, SOCK_DEAD)) {
+		if (mptcp_check_close_timeout(sk)) {
+			inet_sk_state_store(sk, TCP_CLOSE);
+			mptcp_do_fastclose(sk);
+		}
+		if (sk->sk_state == TCP_CLOSE) {
+			__mptcp_destroy_sock(sk);
+			goto unlock;
+		}
 	}
 
 	if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))
-- 
2.37.3
Re: [PATCH mptcp-next] Squash-to: "mptcp: use fastclose on more edge scenarios"
Posted by Matthieu Baerts 1 year, 7 months ago
Hi Paolo,

On 26/09/2022 15:26, Paolo Abeni wrote:
> The orginal commit applied fastclose too aggressivly.
> Specifically, we don't need a fastclose after the completion of
> the data_fin handshakr for an orphaned socket.

Thank you for the fix!

Now in our tree:

New patches for t/upstream:
- 3fa214dd96ae: "squashed" in "mptcp: use fastclose on more edge scenarios"
- Results: a24eaf661ebf..e839b37d59fd (export)


Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220926T171410


Cheers,
Matt

PS: I also merged the Packetdrill PR and closed the ticket #303 ;)
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net