OSDN Git Service

mptcp: break and restart in case mptcp sndbuf is full
authorFlorian Westphal <fw@strlen.de>
Sat, 16 May 2020 08:46:18 +0000 (10:46 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 May 2020 19:35:34 +0000 (12:35 -0700)
commitfb529e62d3f3e85001108213dc323c35f2765575
treeaaa7d625f00a3437813f5dabfaa3a950a7a78d04
parenta0e17064d43e445181bc004d949a4855ea8ccf9c
mptcp: break and restart in case mptcp sndbuf is full

Its not enough to check for available tcp send space.

We also hold on to transmitted data for mptcp-level retransmits.
Right now we will send more and more data if the peer can ack data
at the tcp level fast enough, since that frees up tcp send buffer space.

But we also need to check that data was acked and reclaimed at the mptcp
level.

Therefore add needed check in mptcp_sendmsg, flush tcp data and
wait until more mptcp snd space becomes available if we are over the
limit.  Before we wait for more data, also make sure we start the
retransmit timer if we ran out of sndbuf space.

Otherwise there is a very small chance that we wait forever:

 * receiver is waiting for data
 * sender is blocked because mptcp socket buffer is full
 * at tcp level, all data was acked
 * mptcp-level snd_una was not updated, because last ack
   that acknowledged the last data packet carried an older
   MPTCP-ack.

Restarting the retransmit timer avoids this problem: if TCP
subflow is idle, data is retransmitted from the RTX queue.

New data will make the peer send a new, updated MPTCP-Ack.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c