Skip to content

RFC mptcp: cope better with tcp_sendpage allocation

Paolo Abeni mptcp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tcp: factor out do_tcp_sendfrag()include/net/tcp.h net/ipv4/tcp.c+71 -520 replies
2/2mptcp: use do_tcp_sendfrag()net/mptcp/protocol.c+9 -120 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [MPTCP] [RFC PATCH 0/2] mptcp: cope better with tcp_sendpage allocation

The current export branch suffers of the following issue:

https://github.com/multipath-tcp/mptcp_net-next/issues/97

To fix the above, MPTCP needs to be able to cope with memory allocation failure in do_tcp_sendpages().

In this attempt, the relevant code is factored out of do_tcp_sendpages(), in a smaller helper, so that mptcp_sendmsg_frag() can avoid touching ssk->sk_socket.

There are other possible alternatives:
- add an explicit check in do_tcp_sendpages() for NULL sk->sk_socket
pro: very simple and little invasive
cons: hackysh?!?
- inline/open-code the relevant part of do_tcp_sendpages in mptcp_sendmsg_frag()
pro: no need to change core TCP code
cons: code duplication, need to change the scope for a couple of TCP internal
helpers (removing the 'static' keyword)

As a follow-up I would try to pre-allocate skbs and extensions, so that push_pending could be called in BH context and we could avoid using the work queue.

I'm looking for feedback on the less ugly/more upstreamable approach

Paolo Abeni (2):
tcp: factor out do_tcp_sendfrag()
mptcp: use do_tcp_sendfrag()

 include/net/tcp.h    |   3 ++
 net/ipv4/tcp.c       | 120 ++++++++++++++++++++++++-------------------
 net/mptcp/protocol.c |  21 ++++----
 3 files changed, 80 insertions(+), 64 deletions(-)
Signature · 1 line
2.26.2