public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v3 00/14] Introduce forwarding table
Date: Thu,  8 Jan 2026 13:29:34 +1100	[thread overview]
Message-ID: <20260108022948.2657573-1-david@gibson.dropbear.id.au> (raw)

This creates a new data structure for recording our port forwarding: a
table of individual forwarding rules.  This is intended to replace the
existing forwarding mode, map and delta structures.  For now, only the
delta[] array is removed.  map is still used, but only for automatic
forwards.  Mode is still used, but only has significance during
configuration.

There's still a lot that can be done for flexible forwarding, but this
introduces the core data structure, and does enough to fix at least
one concrete defect with the current logic (bug 187).  I think it
would be a good point to give it a solid review and maybe merge.

I'm aware that this is a very large complex series, that will be
difficult to review.  I think that's more or less inevitable
implementing a feature as broad and complex as "flexible forwarding".
If it helps at all, I'm fine if it's not reviewed all at once - I
won't assume review is complete until either you say so, or I get
comments or R-b on each patch.

This applies on top of all 3 of my outstanding series in this area:
"Allow listen functions to return fds", "Clean ups to epoll
references" (v2) and "Small cleanups to splice forwarding logic".

David Gibson (14):
  inany: Extend inany_ntop() to treat NULL as a fully unspecified
    address
  conf, fwd: Keep a table of our port forwarding configuration
  conf: Accurately record ifname and address for outbound forwards
  conf, fwd: Record "auto" port forwards in forwarding table
  fwd: Make space to store listening sockets in forward table
  ip: Add ipproto_name() function
  fwd, tcp, udp: Set up listening sockets based on forward table
  tcp, udp: Remove old auto-forwarding socket arrays
  conf, fwd: Check forwarding table for conflicting rules
  fwd: Generate auto-forward exclusions from socket fd tables
  flow, fwd: Consult rules table when forwarding a new flow from socket
  fwd: Remap ports based directly on forwarding rule
  fwd, tcp, udp: Add forwarding rule to listening socket epoll
    references
  flow, fwd: Optimise forwarding rule lookup using epoll ref when
    possible

 conf.c         | 118 +++++++++------
 flow.c         |  59 ++++++--
 flow_table.h   |   2 +-
 fwd.c          | 379 ++++++++++++++++++++++++++++++++++++++++++++++---
 fwd.h          |  68 ++++++++-
 icmp.c         |   2 +-
 inany.c        |  28 +++-
 inany.h        |   1 +
 ip.c           |  26 ++++
 ip.h           |   2 +
 tcp.c          | 154 ++------------------
 tcp.h          |   6 +-
 udp.c          | 147 +++----------------
 udp.h          |   7 +-
 udp_flow.c     |  14 +-
 udp_flow.h     |   2 +-
 udp_internal.h |   4 +-
 17 files changed, 641 insertions(+), 378 deletions(-)

-- 
2.52.0


             reply	other threads:[~2026-01-08  2:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-08  2:29 David Gibson [this message]
2026-01-08  2:29 ` [PATCH v3 01/14] inany: Extend inany_ntop() to treat NULL as a fully unspecified address David Gibson
2026-01-08 13:16   ` Laurent Vivier
2026-01-08  2:29 ` [PATCH v3 02/14] conf, fwd: Keep a table of our port forwarding configuration David Gibson
2026-01-08  2:29 ` [PATCH v3 03/14] conf: Accurately record ifname and address for outbound forwards David Gibson
2026-01-08  2:29 ` [PATCH v3 04/14] conf, fwd: Record "auto" port forwards in forwarding table David Gibson
2026-01-08  2:29 ` [PATCH v3 05/14] fwd: Make space to store listening sockets in forward table David Gibson
2026-01-08  2:29 ` [PATCH v3 06/14] ip: Add ipproto_name() function David Gibson
2026-01-08 13:22   ` Laurent Vivier
2026-01-08 23:12     ` David Gibson
2026-01-08  2:29 ` [PATCH v3 07/14] fwd, tcp, udp: Set up listening sockets based on forward table David Gibson
2026-01-08  2:29 ` [PATCH v3 08/14] tcp, udp: Remove old auto-forwarding socket arrays David Gibson
2026-01-08  2:29 ` [PATCH v3 09/14] conf, fwd: Check forwarding table for conflicting rules David Gibson
2026-01-08  2:29 ` [PATCH v3 10/14] fwd: Generate auto-forward exclusions from socket fd tables David Gibson
2026-01-08  2:29 ` [PATCH v3 11/14] flow, fwd: Consult rules table when forwarding a new flow from socket David Gibson
2026-01-08  2:29 ` [PATCH v3 12/14] fwd: Remap ports based directly on forwarding rule David Gibson
2026-01-08  2:29 ` [PATCH v3 13/14] fwd, tcp, udp: Add forwarding rule to listening socket epoll references David Gibson
2026-01-08  2:29 ` [PATCH v3 14/14] flow, fwd: Optimise forwarding rule lookup using epoll ref when possible David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260108022948.2657573-1-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).