Skip to content

mptcp: add and use wmem_queued accounting

Florian Westphal mptcp 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v1 RFC6 patches 8 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mptcp: add wmem_queued accountingnet/mptcp/protocol.c+8 -10 replies
2/4mptcp: allow partial cleaning of rtx head dfragnet/mptcp/protocol.c+25 -30 replies
3/4mptcp: add and use mptcp RTX flagnet/mptcp/options.c net/mptcp/protocol.c net/mptcp/protocol.h+23 -80 replies
4/4sendmsg: block until mptcp sk is writeablenet/mptcp/protocol.c+16 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [MPTCP] [PATCH v2 0/4] mptcp: add and use wmem_queued accounting

This is v2 of the wmem accouting patch set.

I've dropped the ack_seq patches, we can resurrect them later on if needed.

After adding wmem thresholds, mptcp can deadlock at connection level when both sides call write() at the same time and sndbuf is exhausted.

This won't happen in the selftests because it only sends small amounts of data at a time and will always call read() if data is available. It could happen with code that sends large amount of data at once though, or when sndbuf is reduced via setsockopt:

Unlike TCP, which acknowledges in-sequence bytes queued to the socket, MPTCP updates its ack_seq only when recv() is called.

In case both peers are blocked in write, no updates of the mptcp ack sequence space occurs. This in turn can prevent both peers from making any progress: even if all data is queued on the peer, it will look like no data arrived and thus no wmem can be freed up for the write() to complete.

Resolving this will need more work to get pushed into the data_ready callback, which is hard because of need to synchronize with other subflows used by same mptcp socket.

The following changes since commit 6e61dd3c078fe69ac2e442a9251d771a61dcc62f:

subflow: wake parent mptcp socket on subflow state change (2019-11-08 15:22:58 +0000)

are available in the Git repository at:

git://git.breakpoint.cc/fw/mptcp-next.git wmem_acct_06

for you to fetch changes up to eea081f8828bbe2c503873319374a7666c6b6af2:

sendmsg: block until mptcp sk is writeable (2019-11-12 14:53:29 +0100)

----------------------------------------------------------------
Florian Westphal (4):
mptcp: add wmem_queued accounting
mptcp: allow partial cleaning of rtx head dfrag
mptcp: add and use mptcp RTX flag
sendmsg: block until mptcp sk is writeable

 net/mptcp/options.c  |  2 +-
 net/mptcp/protocol.c | 77 +++++++++++++++++++++++++++++++++++++++++++++-------
 net/mptcp/protocol.h |  3 +-
 3 files changed, 70 insertions(+), 12 deletions(-)