From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pxqm8D8p; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 92B505A004E for ; Thu, 08 Jan 2026 15:01:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767880891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OK5R3NwWl/PUVEcLLqk1ZI/Nv+XL9aTFOu3SUfHtul0=; b=Pxqm8D8pH5bJsc8H9H6/7cMEK9mXS/F5+eSCNLQ5WP2PHuyNBO5w+2CDlgWTgHmHXS3jIn /2LVgoIMOn1UTPNkjxfjFxYKXzSZj55SQO5W0WEj5p5oTzBSWoeH27EhleoCyyGgVFy8Sg AQRMjzMiNCQu0TgPvH2Fxbt76/WZDNA= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-5-TXoiGn3JNzSg2ObnRi_Ikw-1; Thu, 08 Jan 2026 09:01:26 -0500 X-MC-Unique: TXoiGn3JNzSg2ObnRi_Ikw-1 X-Mimecast-MFC-AGG-ID: TXoiGn3JNzSg2ObnRi_Ikw_1767880885 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7968F1954197 for ; Thu, 8 Jan 2026 14:01:25 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.225.173]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 763E6180066A; Thu, 8 Jan 2026 14:01:24 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v2 2/5] udp_flow: remove unneeded epoll_ref indirection Date: Thu, 8 Jan 2026 15:01:16 +0100 Message-ID: <20260108140119.1204797-3-lvivier@redhat.com> In-Reply-To: <20260108140119.1204797-1-lvivier@redhat.com> References: <20260108140119.1204797-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rI_he8M7NV0_MHMQ-M4W-iUVTcVK0jUzE97y5drwICA_1767880885 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: TAKA6PKJYNEWJSMRGNDX4ZPFE7NP6OOL X-Message-ID-Hash: TAKA6PKJYNEWJSMRGNDX4ZPFE7NP6OOL X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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