From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v5 6/7] udp: Use epoll instance management for UDP flows
Date: Thu, 23 Oct 2025 12:40:12 +1100 [thread overview]
Message-ID: <aPmHfP5eL-O5-WTe@zatzit> (raw)
In-Reply-To: <20251021210116.314674-7-lvivier@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]
On Tue, Oct 21, 2025 at 11:01:15PM +0200, Laurent Vivier wrote:
> Store the epoll id in the flow_common structure for UDP flows using
> flow_epollid_set() and retrieve the corresponding epoll file descriptor
> with flow_epollfd() instead of passing c->epollfd directly. This makes
> UDP consistent with the recent TCP and ICMP changes.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> udp_flow.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/udp_flow.c b/udp_flow.c
> index 00e231fe1b01..8907f2f72741 100644
> --- a/udp_flow.c
> +++ b/udp_flow.c
> @@ -52,7 +52,7 @@ void udp_flow_close(const struct ctx *c, struct udp_flow *uflow)
> flow_foreach_sidei(sidei) {
> flow_hash_remove(c, FLOW_SIDX(uflow, sidei));
> if (uflow->s[sidei] >= 0) {
> - epoll_del(c->epollfd, uflow->s[sidei]);
> + epoll_del(flow_epollfd(&uflow->f), uflow->s[sidei]);
> close(uflow->s[sidei]);
> uflow->s[sidei] = -1;
> }
> @@ -92,7 +92,9 @@ static int udp_flow_sock(const struct ctx *c,
> ref.data = fref.data;
> ref.fd = s;
>
> - rc = epoll_add(c->epollfd, EPOLLIN, ref);
> + flow_epollid_set(&uflow->f, EPOLLFD_ID_DEFAULT);
> +
> + rc = epoll_add(flow_epollfd(&uflow->f), EPOLLIN, ref);
> if (rc < 0) {
> close(s);
> return rc;
> @@ -101,7 +103,7 @@ static int udp_flow_sock(const struct ctx *c,
> if (flowside_connect(c, s, pif, side) < 0) {
> rc = -errno;
>
> - epoll_del(c->epollfd, s);
> + epoll_del(flow_epollfd(&uflow->f), s);
> close(s);
>
> flow_dbg_perror(uflow, "Couldn't connect flow socket");
> --
> 2.51.0
>
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-10-23 1:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-21 21:01 [PATCH v5 0/7] Refactor epoll handling in preparation for multithreading Laurent Vivier
2025-10-21 21:01 ` [PATCH v5 1/7] util: Simplify epoll_del() interface to take epollfd directly Laurent Vivier
2025-10-21 21:01 ` [PATCH v5 2/7] epoll_ctl: Extract epoll operations Laurent Vivier
2025-10-23 1:29 ` David Gibson
2025-10-21 21:01 ` [PATCH v5 3/7] util: Move epoll registration out of sock_l4_sa() Laurent Vivier
2025-10-21 21:01 ` [PATCH v5 4/7] tcp, flow: Replace per-connection in_epoll flag with an epollid in flow_common Laurent Vivier
2025-10-23 1:39 ` David Gibson
2025-10-30 17:00 ` Stefano Brivio
2025-10-21 21:01 ` [PATCH v5 5/7] icmp: Use epoll instance management for ICMP flows Laurent Vivier
2025-10-21 21:01 ` [PATCH v5 6/7] udp: Use epoll instance management for UDP flows Laurent Vivier
2025-10-23 1:40 ` David Gibson [this message]
2025-10-21 21:01 ` [PATCH v5 7/7] passt: Move main event loop processing into passt_worker() Laurent Vivier
2025-10-23 1:42 ` David Gibson
2025-10-30 17:00 ` [PATCH v5 0/7] Refactor epoll handling in preparation for multithreading 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=aPmHfP5eL-O5-WTe@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=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).