From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH v2 0/3] Register TCP flows with epoll at creation time
Date: Mon, 19 Jan 2026 17:19:12 +0100 [thread overview]
Message-ID: <20260119161915.4014677-1-lvivier@redhat.com> (raw)
This series simplifies epoll registration by moving it to flow creation
time rather than deferring it to the first event update. By registering
sockets with epoll immediately (using events=0), the epoll control
functions can always use EPOLL_CTL_MOD, eliminating the need to track
whether a flow is already registered.
Patch 1 registers both splice sockets with epoll in tcp_splice_connect()
before initiating the connection, allowing tcp_splice_epoll_ctl() to
always use EPOLL_CTL_MOD.
Patch 2 does the same for regular TCP connections in tcp_conn_from_tap(),
tcp_tap_conn_from_sock(), and tcp_flow_migrate_target(), simplifying
tcp_epoll_ctl() by removing the ADD/MOD conditional logic.
Patch 3 removes EPOLLFD_ID_INVALID and related infrastructure now that
all flows are registered at creation: flow_in_epoll(), flow_epollid_clear(),
and the defensive checks in flow_epollfd().
Thanks,
Laurent
Changes in v2:
- Explained error handling and rollback behavior in commit message
(patch 1)
- Added error handling for flow_epoll_set() in tcp_conn_from_tap() and
tcp_tap_conn_from_sock() (patch 2)
- Added ASSERT for epollid bounds check in flow_epollid_register()
(patch 3)
Laurent Vivier (3):
tcp_splice: Register fds with epoll at flow creation
tcp: Register fds with epoll at flow creation
flow: Remove EPOLLFD_ID_INVALID
flow.c | 34 +++-------------------------------
flow.h | 6 +-----
icmp.c | 1 -
tcp.c | 47 ++++++++++++++++++++++++-----------------------
tcp_splice.c | 20 ++++++++++----------
udp_flow.c | 1 -
6 files changed, 38 insertions(+), 71 deletions(-)
--
2.52.0
next reply other threads:[~2026-01-19 16:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 16:19 Laurent Vivier [this message]
2026-01-19 16:19 ` [PATCH v2 1/3] tcp_splice: Register fds with epoll at flow creation Laurent Vivier
2026-01-20 0:06 ` David Gibson
2026-01-19 16:19 ` [PATCH v2 2/3] tcp: " Laurent Vivier
2026-01-20 0:08 ` David Gibson
2026-01-21 8:13 ` Stefano Brivio
2026-01-21 8:43 ` Laurent Vivier
2026-01-21 11:41 ` Stefano Brivio
2026-01-21 12:18 ` Laurent Vivier
2026-01-19 16:19 ` [PATCH v2 3/3] flow: Remove EPOLLFD_ID_INVALID Laurent Vivier
2026-01-20 0:09 ` David Gibson
2026-01-20 20:24 ` [PATCH v2 0/3] Register TCP flows with epoll at creation time Stefano Brivio
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=20260119161915.4014677-1-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/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).