From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH v2 0/5] flow: Introduce flow_epoll_set() to centralize epoll operations
Date: Thu, 8 Jan 2026 15:01:14 +0100 [thread overview]
Message-ID: <20260108140119.1204797-1-lvivier@redhat.com> (raw)
Currently, each protocol handler (TCP, TCP splice, ICMP/ping, UDP) has its
own code to add or modify file descriptors in epoll. This leads to
duplicated boilerplate across icmp.c, tcp.c, tcp_splice.c, and udp_flow.c,
with each setting up epoll_ref unions and calling epoll_ctl() with
flow-type-specific details.
This series introduces flow_epoll_set() in flow.c to handle epoll
operations for all flow types in a unified way. The function provides
a simpler interface where the caller passes the command, type, events,
and file descriptor, and flow_epoll_set() handles the epoll_ref setup
and epoll_ctl() call.
The API is:
int flow_epoll_set(int command, enum epoll_type type,
const struct flow_common *f, uint32_t events,
int fd, unsigned int sidei);
This centralized approach will be essential for queue pair migration in
the upcoming multithreading work, where flows need to be moved between
different epoll instances owned by different threads.
Preparatory patches:
- Patch 1 removes dead timer update code in tcp_epoll_ctl()
- Patch 2 removes unneeded epoll_ref indirection in udp_flow
- Patch 3 refactors udp_flow_sock() to assign the socket internally
- Patch 4 refactors tcp_splice_conn_epoll_events() to per-side computation
Core patch:
- Patch 5 introduces flow_epoll_set() used by all protocol handlers
Changes in v2:
- Added patch 1: Remove dead timer update in tcp_epoll_ctl() since flow
table compaction was eliminated
- Added patch 2: Remove unnecessary epoll_ref indirection in udp_flow.c
- Dropped v1 patch 6 (compute events inside flow_epoll_set())
- Dropped v1 patch 7 (retrieve fd from flow structure)
- Added epoll_ctl() command parameter (EPOLL_CTL_ADD/EPOLL_CTL_MOD)
- Callers must set epollfd via flow_epollid_set() before calling
flow_epoll_set()
- Removed FLOW_EPOLL_TIMER_ADD/FLOW_EPOLL_TIMER_MOD constants
- Reduced series from 7 to 5 patches
Laurent Vivier (5):
tcp: remove timer update in tcp_epoll_ctl()
udp_flow: remove unneeded epoll_ref indirection
udp_flow: Assign socket to flow inside udp_flow_sock()
tcp_splice: Refactor tcp_splice_conn_epoll_events() to per-side
computation
flow: Introduce flow_epoll_set() to centralize epoll operations
flow.c | 33 +++++++++++++++
flow.h | 3 ++
icmp.c | 11 ++---
tcp.c | 72 ++++++++++++++------------------
tcp_splice.c | 115 ++++++++++++++++++++++++---------------------------
udp_flow.c | 19 +++------
6 files changed, 131 insertions(+), 122 deletions(-)
--
2.52.0
next reply other threads:[~2026-01-08 14:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 14:01 Laurent Vivier [this message]
2026-01-08 14:01 ` [PATCH v2 1/5] tcp: remove timer update in tcp_epoll_ctl() Laurent Vivier
2026-01-08 23:26 ` David Gibson
2026-01-08 14:01 ` [PATCH v2 2/5] udp_flow: remove unneeded epoll_ref indirection Laurent Vivier
2026-01-08 23:26 ` David Gibson
2026-01-08 14:01 ` [PATCH v2 3/5] udp_flow: Assign socket to flow inside udp_flow_sock() Laurent Vivier
2026-01-08 14:01 ` [PATCH v2 4/5] tcp_splice: Refactor tcp_splice_conn_epoll_events() to per-side computation Laurent Vivier
2026-01-08 14:01 ` [PATCH v2 5/5] flow: Introduce flow_epoll_set() to centralize epoll operations Laurent Vivier
2026-01-08 23:33 ` David Gibson
2026-01-09 9:26 ` Laurent Vivier
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=20260108140119.1204797-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).