Skip to content

Commit 2ca06a2

Browse files
Paolo Abenikuba-moo
authored andcommitted
mptcp: be sure to send ack when mptcp-level window re-opens
mptcp_cleanup_rbuf() is responsible to send acks when the user-space reads enough data to update the receive windows significantly. It tries hard to avoid acquiring the subflow sockets locks by checking conditions similar to the ones implemented at the TCP level. To avoid too much code duplication - the MPTCP protocol can't reuse the TCP helpers as part of the relevant status is maintained into the msk socket - and multiple costly window size computation, mptcp_cleanup_rbuf uses a rough estimate for the most recently advertised window size: the MPTCP receive free space, as recorded as at last-ack time. Unfortunately the above does not allow mptcp_cleanup_rbuf() to detect a zero to non-zero win change in some corner cases, skipping the tcp_cleanup_rbuf call and leaving the peer stuck. After commit ea66758 ("tcp: allow MPTCP to update the announced window"), MPTCP has actually cheap access to the announced window value. Use it in mptcp_cleanup_rbuf() for a more accurate ack generation. Fixes: e385960 ("mptcp: better msk receive window updates") Cc: [email protected] Reported-by: Jakub Kicinski <[email protected]> Closes: https://lore.kernel.org/[email protected] Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Link: https://patch.msgid.link/20250113-net-mptcp-connect-st-flakes-v1-1-0d986ee7b1b6@kernel.org Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 665bcfc commit 2ca06a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

net/mptcp/options.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
607607
}
608608
opts->ext_copy.use_ack = 1;
609609
opts->suboptions = OPTION_MPTCP_DSS;
610-
WRITE_ONCE(msk->old_wspace, __mptcp_space((struct sock *)msk));
611610

612611
/* Add kind/length/subtype/flag overhead if mapping is not populated */
613612
if (dss_size == 0)
@@ -1288,7 +1287,7 @@ static void mptcp_set_rwin(struct tcp_sock *tp, struct tcphdr *th)
12881287
}
12891288
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_RCVWNDCONFLICT);
12901289
}
1291-
return;
1290+
goto update_wspace;
12921291
}
12931292

12941293
if (rcv_wnd_new != rcv_wnd_old) {
@@ -1313,6 +1312,9 @@ static void mptcp_set_rwin(struct tcp_sock *tp, struct tcphdr *th)
13131312
th->window = htons(new_win);
13141313
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_RCVWNDSHARED);
13151314
}
1315+
1316+
update_wspace:
1317+
WRITE_ONCE(msk->old_wspace, tp->rcv_wnd);
13161318
}
13171319

13181320
__sum16 __mptcp_make_csum(u64 data_seq, u32 subflow_seq, u16 data_len, __wsum sum)

0 commit comments

Comments
 (0)