Skip to content

Commit 2ea6190

Browse files
Paolo Abenikuba-moo
authored andcommitted
mptcp: schedule rtx timer only after pushing data
The MPTCP protocol usually schedule the retransmission timer only when there is some chances for such retransmissions to happen. With a notable exception: __mptcp_push_pending() currently schedule such timer unconditionally, potentially leading to unnecessary rtx timer expiration. The issue is present since the blamed commit below but become easily reproducible after commit 27b0e70 ("mptcp: drop bogus optimization in __mptcp_check_push()") Fixes: 33d41c9 ("mptcp: more accurate timeout") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20251205-net-mptcp-misc-fixes-6-19-rc1-v1-3-9e4781a6c1b8@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 29f4801 commit 2ea6190

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

net/mptcp/protocol.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
16231623
struct mptcp_sendmsg_info info = {
16241624
.flags = flags,
16251625
};
1626-
bool do_check_data_fin = false;
1626+
bool copied = false;
16271627
int push_count = 1;
16281628

16291629
while (mptcp_send_head(sk) && (push_count > 0)) {
@@ -1665,7 +1665,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
16651665
push_count--;
16661666
continue;
16671667
}
1668-
do_check_data_fin = true;
1668+
copied = true;
16691669
}
16701670
}
16711671
}
@@ -1674,11 +1674,14 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
16741674
if (ssk)
16751675
mptcp_push_release(ssk, &info);
16761676

1677-
/* ensure the rtx timer is running */
1678-
if (!mptcp_rtx_timer_pending(sk))
1679-
mptcp_reset_rtx_timer(sk);
1680-
if (do_check_data_fin)
1677+
/* Avoid scheduling the rtx timer if no data has been pushed; the timer
1678+
* will be updated on positive acks by __mptcp_cleanup_una().
1679+
*/
1680+
if (copied) {
1681+
if (!mptcp_rtx_timer_pending(sk))
1682+
mptcp_reset_rtx_timer(sk);
16811683
mptcp_check_send_data_fin(sk);
1684+
}
16821685
}
16831686

16841687
static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool first)

0 commit comments

Comments
 (0)