From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v3 07/11] ms/mptcp: cleanup fallback dummy mapping generation
Date: Mon, 16 Nov 2026 22:05:59 +0200 [thread overview]
Message-ID: <20261116204557.718500-8-eva.kurchatova@virtuozzo.com> (raw)
In-Reply-To: <20261116204557.718500-1-eva.kurchatova@virtuozzo.com>
From: Paolo Abeni <pabeni@redhat.com>
MPTCP currently access ack_seq outside the msk socket log scope to
generate the dummy mapping for fallback socket. Soon we are going
to introduce backlog usage and even for fallback socket the ack_seq
value will be significantly off outside of the msk socket lock scope.
Avoid relying on ack_seq for dummy mapping generation, using instead
the subflow sequence number. Note that in case of disconnect() and
(re)connect() we must ensure that any previous state is re-set.
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Geliang Tang <geliang@kernel.org>
Tested-by: Geliang Tang <geliang@kernel.org>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251121-net-next-mptcp-memcg-backlog-imp-v1-6-1f34b6c1e0b1@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 2834f8edd74d5dda368087a654c0e52b141e9893)
https://virtuozzo.atlassian.net/browse/VSTOR-153491
Feature: fix ms/net
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
net/mptcp/protocol.c | 3 +++
net/mptcp/subflow.c | 8 +++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 2dcce47a1ef7..e0048bfda370 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3299,6 +3299,9 @@ static int mptcp_disconnect(struct sock *sk, int flags)
msk->rcvspace_init = 0;
msk->fastclosing = 0;
+ /* for fallback's sake */
+ WRITE_ONCE(msk->ack_seq, 0);
+
WRITE_ONCE(sk->sk_shutdown, 0);
sk_error_report(sk);
return 0;
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 040a7f1bdcf0..eeb4c926a66b 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -490,6 +490,9 @@ static void subflow_set_remote_key(struct mptcp_sock *msk,
mptcp_crypto_key_sha(subflow->remote_key, NULL, &subflow->iasn);
subflow->iasn++;
+ /* for fallback's sake */
+ subflow->map_seq = subflow->iasn;
+
WRITE_ONCE(msk->remote_key, subflow->remote_key);
WRITE_ONCE(msk->ack_seq, subflow->iasn);
WRITE_ONCE(msk->can_ack, true);
@@ -1432,9 +1435,12 @@ static bool subflow_check_data_avail(struct sock *ssk)
skb = skb_peek(&ssk->sk_receive_queue);
subflow->map_valid = 1;
- subflow->map_seq = READ_ONCE(msk->ack_seq);
subflow->map_data_len = skb->len;
subflow->map_subflow_seq = tcp_sk(ssk)->copied_seq - subflow->ssn_offset;
+ subflow->map_seq = __mptcp_expand_seq(subflow->map_seq,
+ subflow->iasn +
+ TCP_SKB_CB(skb)->seq -
+ subflow->ssn_offset - 1);
WRITE_ONCE(subflow->data_avail, true);
return true;
}
--
2.56.1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-16 20:47 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 20:05 [Devel] [PATCH hci-8.1 v3 00/11] ms/mptcp: stability fixes Eva Kurchatova
2026-11-16 20:05 ` [Devel] [PATCH hci-8.1 v3 01/11] ms/mptcp: fix retransmission loop when csum is enabled Eva Kurchatova
2026-11-16 20:50 ` no-reply
2026-11-16 20:05 ` [Devel] [PATCH hci-8.1 v3 02/11] ms/mptcp: move the retrans loop to a separate helper Eva Kurchatova
2026-11-16 20:50 ` no-reply
2026-11-16 20:05 ` [Devel] [PATCH hci-8.1 v3 03/11] ms/mptcp: move the stale logic out of retrans scheduler Eva Kurchatova
2026-11-16 20:52 ` no-reply
2026-11-17 11:25 ` Konstantin Khorenko
2026-11-16 20:05 ` [Devel] [PATCH hci-8.1 v3 04/11] ms/mptcp: let the retrans scheduler do its job Eva Kurchatova
2026-11-16 20:55 ` no-reply
2026-11-16 20:05 ` [Devel] [PATCH hci-8.1 v3 05/11] ms/mptcp: close TOCTOU race while computing rcv_wnd Eva Kurchatova
2026-11-16 20:53 ` no-reply
2026-11-16 20:05 ` [Devel] [PATCH hci-8.1 v3 06/11] ms/mptcp: allow subflow rcv wnd to shrink Eva Kurchatova
2026-11-16 20:56 ` no-reply
2026-11-16 20:05 ` Eva Kurchatova [this message]
2026-11-16 20:58 ` [Devel] [PATCH hci-8.1 v3 07/11] ms/mptcp: cleanup fallback dummy mapping generation no-reply
2026-11-16 20:06 ` [Devel] [PATCH hci-8.1 v3 08/11] ms/mptcp: explicitly drop over memory limits Eva Kurchatova
2026-11-16 20:58 ` no-reply
2026-11-16 20:06 ` [Devel] [PATCH hci-8.1 v3 09/11] ms/mptcp: implemented OoO queue pruning Eva Kurchatova
2026-11-16 21:00 ` no-reply
2026-11-16 20:06 ` [Devel] [PATCH hci-8.1 v3 10/11] ms/mptcp: being below memory limit is a likely() condition Eva Kurchatova
2026-11-16 20:59 ` no-reply
2026-11-16 20:06 ` [Devel] [PATCH hci-8.1 v3 11/11] ms/mptcp: avoid pruning for OoW data Eva Kurchatova
2026-11-16 21:00 ` no-reply
2026-11-16 20:58 ` [Devel] [PATCH hci-8.1 v3 00/11] ms/mptcp: stability fixes Eva Kurchatova (Virtuozzo)
2026-11-17 11:25 ` Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116204557.718500-8-eva.kurchatova@virtuozzo.com \
--to=eva.kurchatova@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.