All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH mptcp-next 0/4] MP_JOIN fallback for TCP listeners
@ 2022-02-24 23:22 Mat Martineau
  2022-02-24 23:22 ` [RFC PATCH mptcp-next 1/4] mptcp: Move some symbols to be visible outside the MPTCP subsystem Mat Martineau
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Mat Martineau @ 2022-02-24 23:22 UTC (permalink / raw)
  To: mptcp; +Cc: Mat Martineau, fw

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(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-03  1:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-24 23:22 [RFC PATCH mptcp-next 0/4] MP_JOIN fallback for TCP listeners Mat Martineau
2022-02-24 23:22 ` [RFC PATCH mptcp-next 1/4] mptcp: Move some symbols to be visible outside the MPTCP subsystem Mat Martineau
2022-02-24 23:22 ` [RFC PATCH mptcp-next 2/4] tcp: Allow tcp_check_req() to return more status values Mat Martineau
2022-02-24 23:22 ` [RFC PATCH mptcp-next 3/4] tcp: Check for the presence of a MP_JOIN option Mat Martineau
2022-02-24 23:22 ` [RFC PATCH mptcp-next 4/4] tcp: Add TCP hooks for detecting MP_JOIN on a regular TCP listener Mat Martineau
2022-02-24 23:29   ` tcp: Add TCP hooks for detecting MP_JOIN on a regular TCP listener: Build Failure MPTCP CI
2022-02-24 23:34   ` tcp: Add TCP hooks for detecting MP_JOIN on a regular TCP listener: Tests Results MPTCP CI
2022-02-25 15:22   ` [RFC PATCH mptcp-next 4/4] tcp: Add TCP hooks for detecting MP_JOIN on a regular TCP listener Paolo Abeni
2022-03-02 23:57     ` Mat Martineau
2022-03-03  0:44       ` Mat Martineau
2022-02-25 16:19 ` [RFC PATCH mptcp-next 0/4] MP_JOIN fallback for TCP listeners Paolo Abeni
2022-03-03  1:08   ` Mat Martineau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.