public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH 00/14] RFC: tcp: Don't use separate listening sockets for spliced and non-spliced connections
@ 2022-11-14  6:16 David Gibson
  2022-11-14  6:16 ` [PATCH 01/14] style: Minor corrections to function comments David Gibson
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: David Gibson @ 2022-11-14  6:16 UTC (permalink / raw)
  To: passt-dev, Stefano Brivio; +Cc: David Gibson

We can splice TCP connections in pasta mode if and only if they
originate from localhost.  Currently we separate the two cases by
having separate listening sockets: one listens on the host address for
non-spliceable connections, the other listens on the loopback address
for spliceable connections.

As well as requiring twice as many listening sockets, this has the
drawback of meaning that passt and pasta behaviour differ subtley but
surprisingly: by default passt inbound port forwards will listen on
the unspecified address, but for pasta they will be changed to listen
on the host's interface address.

In fact we don't need to do this.  We can defer the decision about
whether to splice a connection until after we've accepted it, by
testing the peer address to see if it is local.

At least, in principle we can.  This series deals with a number of
complications on the way to accomplishing that.

CAVEAT: The current draft increases the size of tcp_conn above its
current 64 bytes, which is likely to push it into a second cache line
on some machines.  This is fixable, but doing so is fiddly, and I'm
still working on it.

David Gibson (14):
  style: Minor corrections to function comments
  tcp: Remove unused TCP_MAX_SOCKS constant
  tcp: Better helpers for converting between connection pointer and
    index
  tcp_splice: Helpers for converting from index to/from tcp_splice_conn
  tcp: Move connection state structures into a shared header
  tcp: Add connection union type
  tcp: Improved helpers to update connections after moving
  tcp: Unify spliced and non-spliced connection tables
  tcp: Unify tcp_defer_handler and tcp_splice_defer_handler()
  tcp: Partially unify tcp_timer() and tcp_splice_timer()
  tcp: Unify the IN_EPOLL flag
  tcp: Separate helpers to create ns listening sockets
  tcp: Unify part of spliced and non-spliced conn_from_sock path
  tcp: Use the same sockets to listen for spliced and non-spliced
    connections

 Makefile     |   3 +-
 conf.c       |  12 +-
 tap.c        |   6 +-
 tcp.c        | 661 +++++++++++++++++++++++----------------------------
 tcp.h        |   7 +-
 tcp_conn.h   | 208 ++++++++++++++++
 tcp_splice.c | 292 +++++++++--------------
 tcp_splice.h |   4 +-
 8 files changed, 625 insertions(+), 568 deletions(-)
 create mode 100644 tcp_conn.h

-- 
2.38.1


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

end of thread, other threads:[~2022-11-15  4:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14  6:16 [PATCH 00/14] RFC: tcp: Don't use separate listening sockets for spliced and non-spliced connections David Gibson
2022-11-14  6:16 ` [PATCH 01/14] style: Minor corrections to function comments David Gibson
2022-11-14  6:16 ` [PATCH 02/14] tcp: Remove unused TCP_MAX_SOCKS constant David Gibson
2022-11-14  6:17 ` [PATCH 03/14] tcp: Better helpers for converting between connection pointer and index David Gibson
2022-11-14  6:17 ` [PATCH 04/14] tcp_splice: Helpers for converting from index to/from tcp_splice_conn David Gibson
2022-11-14  6:17 ` [PATCH 05/14] tcp: Move connection state structures into a shared header David Gibson
2022-11-14  6:17 ` [PATCH 06/14] tcp: Add connection union type David Gibson
2022-11-14  6:17 ` [PATCH 07/14] tcp: Improved helpers to update connections after moving David Gibson
2022-11-14  6:17 ` [PATCH 08/14] tcp: Unify spliced and non-spliced connection tables David Gibson
2022-11-14  6:17 ` [PATCH 09/14] tcp: Unify tcp_defer_handler and tcp_splice_defer_handler() David Gibson
2022-11-14  6:17 ` [PATCH 10/14] tcp: Partially unify tcp_timer() and tcp_splice_timer() David Gibson
2022-11-14  6:17 ` [PATCH 11/14] tcp: Unify the IN_EPOLL flag David Gibson
2022-11-14  6:17 ` [PATCH 12/14] tcp: Separate helpers to create ns listening sockets David Gibson
2022-11-14  6:17 ` [PATCH 13/14] tcp: Unify part of spliced and non-spliced conn_from_sock path David Gibson
2022-11-14  6:17 ` [PATCH 14/14] tcp: Use the same sockets to listen for spliced and non-spliced connections David Gibson
2022-11-15  1:22 ` [PATCH 00/14] RFC: tcp: Don't use separate listening sockets " Stefano Brivio
2022-11-15  4:57   ` David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).