public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH v2 2/5] udp_flow: remove unneeded epoll_ref indirection
Date: Thu,  8 Jan 2026 15:01:16 +0100	[thread overview]
Message-ID: <20260108140119.1204797-3-lvivier@redhat.com> (raw)
In-Reply-To: <20260108140119.1204797-1-lvivier@redhat.com>

The fref union was used to convert flow_sidx_t to uint32_t for
assignment to ref.data.  This is unnecessary since epoll_ref already
contains a flowside member of type flow_sidx_t, so we can assign
directly.

This aligns with how icmp.c and other callers assign flow_sidx_t to
epoll_ref.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 udp_flow.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/udp_flow.c b/udp_flow.c
index 8907f2f72741..0ba788060db7 100644
--- a/udp_flow.c
+++ b/udp_flow.c
@@ -74,10 +74,6 @@ static int udp_flow_sock(const struct ctx *c,
 {
 	const struct flowside *side = &uflow->f.side[sidei];
 	uint8_t pif = uflow->f.pif[sidei];
-	union {
-		flow_sidx_t sidx;
-		uint32_t data;
-	} fref = { .sidx = FLOW_SIDX(uflow, sidei) };
 	union epoll_ref ref;
 	int rc;
 	int s;
@@ -89,7 +85,7 @@ static int udp_flow_sock(const struct ctx *c,
 	}
 
 	ref.type = EPOLL_TYPE_UDP;
-	ref.data = fref.data;
+	ref.flowside = FLOW_SIDX(uflow, sidei);
 	ref.fd = s;
 
 	flow_epollid_set(&uflow->f, EPOLLFD_ID_DEFAULT);
-- 
2.52.0


  parent 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 [PATCH v2 0/5] flow: Introduce flow_epoll_set() to centralize epoll operations Laurent Vivier
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 ` Laurent Vivier [this message]
2026-01-08 23:26   ` [PATCH v2 2/5] udp_flow: remove unneeded epoll_ref indirection 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-3-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).