Skip to content

mptcp: update mptcp ack sequence outside of recv path

Florian Westphal netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7mptcp: add and use mptcp_data_ready helpernet/mptcp/protocol.c net/mptcp/protocol.h net/mptcp/subflow.c+13 -101 reply
2/7mptcp: add work queue skeletonnet/mptcp/protocol.c net/mptcp/protocol.h+23 -01 reply
3/7mptcp: update mptcp ack sequence from work queuenet/mptcp/protocol.c+165 -691 reply
4/7mptcp: add rmem queue accountingnet/mptcp/protocol.c+17 -11 reply
5/7mptcp: remove mptcp_read_actornet/mptcp/protocol.c net/mptcp/protocol.h net/mptcp/subflow.c+13 -391 reply
6/7mptcp: avoid work queue scheduling if possiblenet/mptcp/protocol.c net/mptcp/protocol.h net/mptcp/subflow.c+31 -41 reply
7/7mptcp: defer work schedule until mptcp lock is releasednet/mptcp/protocol.c+36 -21 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchMat Martineau
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/7] mptcp: update mptcp ack sequence outside of recv path

This series moves mptcp-level ack sequence update outside of the recvmsg path. Current approach has two problems:

1. There is delay between arrival of new data and the time we can ack this data.
2. If userspace doesn't call recv for some time, mptcp ack_seq is not updated at all, even if this data is queued in the subflow socket receive queue.

Move skbs from the subflow socket receive queue to the mptcp-level receive queue, updating the mptcp-level ack sequence and have recv take skbs from the mptcp-level receive queue.

The first place where we will attempt to update the mptcp level acks is from the subflows' data_ready callback, even before we make userspace aware of new data.

Because of possible deadlock (we need to take the mptcp socket lock while already holding the subflow sockets lock), we may still need to defer the mptcp-level ack update. In such case, this work will be either done from work queue or recv path, depending on which runs sooner.

In order to avoid pointless scheduling of the work queue, work will be queued from the mptcp sockets lock release callback. This allows to detect when the socket owner did drain the subflow socket receive queue.

Please see individual patches for more information.

Florian Westphal (5):
mptcp: add and use mptcp_data_ready helper
mptcp: update mptcp ack sequence from work queue
mptcp: add rmem queue accounting
mptcp: remove mptcp_read_actor
mptcp: avoid work queue scheduling if possible

Paolo Abeni (2):
mptcp: add work queue skeleton
mptcp: defer work schedule until mptcp lock is released

 net/mptcp/protocol.c | 364 ++++++++++++++++++++++++++++++++++++++-------------
 net/mptcp/protocol.h |   9 +-
 net/mptcp/subflow.c  |  32 ++---
 3 files changed, 289 insertions(+), 116 deletions(-)