Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
mptcp: Use correct MSS for space-computation
Browse files Browse the repository at this point in the history
We have seen the following WARN:
[  413.544376] ------------[ cut here ]------------
[  413.566704] in_flight 0 cwnd 1 wseq 509214375 snxt 509212959 mss_now 1416 cache 1424
[...]
[  414.485683] Call Trace:
[  414.497589]  mptcp_write_xmit+0xc3/0x490
[  414.516761]  __tcp_push_pending_frames+0x38/0xd0
[  414.539402]  tcp_sendmsg_locked+0x8f8/0xd00
[  414.559813]  tcp_sendmsg+0x27/0x40
[  414.576339]  sock_sendmsg+0x36/0x50
[  414.593346]  sock_write_iter+0x8f/0x100
[  414.612081]  __vfs_write+0x112/0x1a0
[  414.629447]  vfs_write+0xad/0x1a0
[  414.645486]  ksys_write+0x5a/0xd0
[  414.661601]  do_syscall_64+0x5b/0x1b0
[  414.679146]  entry_SYSCALL_64_after_hwframe+0x44/0xa9

mss_now can effectively be different from mss_cache, if for example we
need to combine SACK with data. In that case, mptcp_is_temp_unavailable will
make the wrong decision.

We should get the correct mss from tcp_current_mss right away.

Fixes: 988ec13 ("mptcp: Make sure that we don't overfill subflows")
Signed-off-by: Christoph Paasch <[email protected]>
Signed-off-by: Matthieu Baerts <[email protected]>
(cherry picked from commit 9d3f35b)
Signed-off-by: Matthieu Baerts <[email protected]>
  • Loading branch information
cpaasch authored and matttbe committed Aug 7, 2020
1 parent 1b49105 commit 2ec4990
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/mptcp/mptcp_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ static bool mptcp_is_temp_unavailable(struct sock *sk,
if (in_flight >= tp->snd_cwnd)
return true;

mss_now = tcp_current_mss(sk);

/* Now, check if what is queued in the subflow's send-queue
* already fills the cwnd.
*/
space = (tp->snd_cwnd - in_flight) * tp->mss_cache;
space = (tp->snd_cwnd - in_flight) * mss_now;

if (tp->write_seq - tp->snd_nxt >= space)
return true;

if (zero_wnd_test && !before(tp->write_seq, tcp_wnd_end(tp)))
return true;

mss_now = tcp_current_mss(sk);

/* Don't send on this subflow if we bypass the allowed send-window at
* the per-subflow level. Similar to tcp_snd_wnd_test, but manually
* calculated end_seq (because here at this point end_seq is still at
Expand Down

0 comments on commit 2ec4990

Please sign in to comment.