Skip to content

RFC MP_JOIN fallback for TCP listeners

Mat Martineau mptcp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mptcp: Move some symbols to be visible outside the MPTCP subsysteminclude/net/mptcp.h net/mptcp/protocol.h+18 -120 replies
2/4tcp: Allow tcp_check_req() to return more status valuesinclude/net/tcp.h net/ipv4/tcp_input.c net/ipv4/tcp_ipv4.c +2 more+20 -120 replies
3/4tcp: Check for the presence of a MP_JOIN optioninclude/linux/tcp.h net/ipv4/tcp_input.c+10 -10 replies
4/4tcp: Add TCP hooks for detecting MP_JOIN on a regular TCP listenernet/ipv4/tcp_ipv4.c net/ipv4/tcp_minisocks.c net/ipv6/tcp_ipv6.c+21 -15 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 mptcp-next 0/4] MP_JOIN fallback for TCP listeners

In discussion of Florian's "replace per-addr listener sockets" series, I proposed this:

One possibility that doesn't disturb the hot path too much: Let the TCP listener try to handle the SYN. In tcp_parse_options(), add just enough code to set a bit in struct tcp_options_received if MP_JOIN is present (don't fully parse the MPTCP option). If MP_JOIN is there and MPTCP is enabled, return early from tcp_check_req() and have tcp_v4_rcv() treat it similar to req_stolen==true. Instead of kicking back to a regular lookup, try a token lookup.

It seemed to me that the hot path impact would be minimal. To better show that, I put together these RFC patches. Only one conditional is added to the hot path, checking a bit in struct tcp_received options (which should be in the data cache anyway). The other hooks are:

* tcp_parse_options() switch statement (only executed if a MPTCP option is present).

* The tcp_check_req()-returned-NULL error paths for IPv4 and IPv6.

In addition, the added code in this series is almost entirely optimized out if CONFIG_MPTCP is not set. With one more ifdef for the tcp_parse_option() change, the optimized kernel binary may even be entirely unchanged.

Compared to Florian's proposal (add token lookup before the listener lookup) this does change more lines of TCP code, but has less runtime impact.

Major caveat: this is very lightly tested, build and a quick check to make sure it didn't break TCP.

This applies on top of "mptcp: replace per-addr listener sockets" v4.

Mat Martineau (4):
mptcp: Move some symbols to be visible outside the MPTCP subsystem
tcp: Allow tcp_check_req() to return more status values
tcp: Check for the presence of a MP_JOIN option
tcp: Add TCP hooks for detecting MP_JOIN on a regular TCP listener

 include/linux/tcp.h      |  3 ++-
 include/net/mptcp.h      | 18 ++++++++++++++++++
 include/net/tcp.h        | 10 +++++++++-
 net/ipv4/tcp_input.c     | 12 ++++++++++--
 net/ipv4/tcp_ipv4.c      | 13 ++++++++++---
 net/ipv4/tcp_minisocks.c | 14 ++++++++++----
 net/ipv6/tcp_ipv6.c      | 13 ++++++++++---
 net/mptcp/protocol.h     | 12 ------------
 8 files changed, 69 insertions(+), 26 deletions(-)
Signature · 1 line
2.35.1