public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH v2 00/10] RFC: Clean up TCP epoll mask handling
@ 2024-09-13  4:32 David Gibson
  2024-09-13  4:32 ` [PATCH v2 01/10] tcp: Make some extra functions private David Gibson
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: David Gibson @ 2024-09-13  4:32 UTC (permalink / raw)
  To: passt-dev, Stefano Brivio; +Cc: David Gibson

This is a draft series culminating in greatly simplifying the handling
of the epoll event mask for TCP sockets.  Doing that requires two
major preliminaries:

1) We also need to alter event mask handling for the tap interface, to
   track and report when it's ready to accept more data.  We need this
   to "unstick" connections where we have pending data on the socket,
   but weren't able to forward it because we ran out of tap interface
   buffer space.

2) We need to alter handling of ack sequence numbers to the tap
   device.  Without this, the event mask changes expose a fragility
   where depending on the precise order things are called we could
   update the ack pointer without actually sending an ack to the tap
   interface.

This is not ready to go yet.  For one thing it tanks some of the
throughput numbers for reasons I haven't yet diagnosed.  It could also
certainly do with another set of eyes looking critically over the
event logic changes.

In addition, the fragility of the ack-to-tap handling remains.  The
series fixes the specific problem, but it remains non-obviously unsafe
to call tcp_update_seqack_from_tap() if a packet isn't going to be
immediately and unconditionally sent to the guest.  I've been trying
to figure out how to make that more robust without introducing
additional TCP_INFO calls, but my brain's seizing up a bit at this
point.

Patches 1..4/10 are preliminary cleanups which should be safe, though.
Feel free to apply as many of those ones as you're happy with.

David Gibson (10):
  tcp: Make some extra functions private
  tcp: Clean up tcpi_snd_wnd probing
  tcp: Simplify ifdef logic in tcp_update_seqack_wnd()
  tcp: Make tcp_update_seqack_wnd()s force_seq parameter explicitly
    boolean
  tcp: On socket EPOLLOUT, send new ACK to tap immediately
  tap: Re-introduce EPOLLET for tap connections
  tap: Keep track of whether there might be space in the tap buffers
  tcp: Keep track of connections blocked due to a full tap interface
  tcp: Move deferred handling functions later in tcp.c
  tcp: Simplify epoll event mask management

 tap.c          |  58 ++++++++---
 tap.h          |   1 +
 tcp.c          | 265 ++++++++++++++++++++++++++++---------------------
 tcp.h          |  13 +--
 tcp_buf.c      |  15 +--
 tcp_buf.h      |   6 +-
 tcp_conn.h     |   1 +
 tcp_internal.h |   6 +-
 8 files changed, 222 insertions(+), 143 deletions(-)

-- 
2.46.0


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

end of thread, other threads:[~2024-09-18  1:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-13  4:32 [PATCH v2 00/10] RFC: Clean up TCP epoll mask handling David Gibson
2024-09-13  4:32 ` [PATCH v2 01/10] tcp: Make some extra functions private David Gibson
2024-09-13  4:32 ` [PATCH v2 02/10] tcp: Clean up tcpi_snd_wnd probing David Gibson
2024-09-17 21:54   ` Stefano Brivio
2024-09-18  1:27     ` David Gibson
2024-09-13  4:32 ` [PATCH v2 03/10] tcp: Simplify ifdef logic in tcp_update_seqack_wnd() David Gibson
2024-09-17 21:54   ` Stefano Brivio
2024-09-18  1:31     ` David Gibson
2024-09-13  4:32 ` [PATCH v2 04/10] tcp: Make tcp_update_seqack_wnd()s force_seq parameter explicitly boolean David Gibson
2024-09-13  4:32 ` [PATCH v2 05/10] tcp: On socket EPOLLOUT, send new ACK to tap immediately David Gibson
2024-09-13  4:32 ` [PATCH v2 06/10] tap: Re-introduce EPOLLET for tap connections David Gibson
2024-09-13  4:32 ` [PATCH v2 07/10] tap: Keep track of whether there might be space in the tap buffers David Gibson
2024-09-13  4:32 ` [PATCH v2 08/10] tcp: Keep track of connections blocked due to a full tap interface David Gibson
2024-09-13  4:32 ` [PATCH v2 09/10] tcp: Move deferred handling functions later in tcp.c David Gibson
2024-09-13  4:32 ` [PATCH v2 10/10] tcp: Simplify epoll event mask management 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).