Skip to content

RFC tcp: factor out a couple of helpers

Paolo Abeni mptcp netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tcp: factor out tcp_build_frag()include/net/tcp.h net/ipv4/tcp.c+70 -520 replies
2/2tcp: factor out __tcp_close() helperinclude/net/tcp.h net/ipv4/tcp.c+8 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/2] tcp: factor out a couple of helpers

Upcoming improvement in MPTCP subflows management will require to keep write data enqueued at the MPTCP level. As a side effect, such data could be sent via orphaned TCP subflows after close().

To implement the above MPTCP needs to cope directly with memory allocation failures in do_tcp_sendpages(). The solution proposed in patch 1/2 is to factor-out the relevant slice of do_tcp_sendpages().

Other possible alternatives could be:
- duplicating the relevant code inside MPTCP (will require exposing a few additional TCP helpers)
or
- add an explicit check for orphaned socket in do_tcp_sendpages()

Additionally, due to the above, we will need to dispose of already orphaned TCP subflows, avoiding racing with tcp_done(). We need to check the subflow status and destroy it atomically. The solution proposed in patch 2/2 is to factor-out the unlocked body of tcp_close().

These changes are part of a quite larger MPTCP series, with all the other patches touching only MPTCP code. To hopefully simplify the review, such patches are not included here. Please advice if you prefer otherwise
- e.g. the whole series as RFC.

Paolo Abeni (2):
tcp: factor out tcp_build_frag()
tcp: factor out __tcp_close() helper

 include/net/tcp.h |   4 ++
 net/ipv4/tcp.c    | 128 +++++++++++++++++++++++++++-------------------
 2 files changed, 78 insertions(+), 54 deletions(-)
Signature · 1 line
2.26.2