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=UF+EWpEk; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id C37B95A004E for ; Thu, 08 Jan 2026 15:01:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767880884; 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; bh=5aBlL0MWatkiXlRquLFWjexpi6z4whKFywfStfIPQVQ=; b=UF+EWpEkIW1tfx8eQT9RzO5kopc9gZmZvAi+h/GpgYJat64tErE2zW9zHreu2KQ0OVrg5v hXtl8Pl/LE/1bywGKv86EmferpVEXqu7/BCEYdDlDPYVSBdsTYELGcVMAGInQF2cX8CXmi T6Y2spqo4Qt2+4mxN2VDF3IHJo8Thuk= Received: from mx-prod-mc-03.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-552-7R3S6Xf6OtuXMgvxTQLMYg-1; Thu, 08 Jan 2026 09:01:23 -0500 X-MC-Unique: 7R3S6Xf6OtuXMgvxTQLMYg-1 X-Mimecast-MFC-AGG-ID: 7R3S6Xf6OtuXMgvxTQLMYg_1767880882 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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3C8BD1955E7E for ; Thu, 8 Jan 2026 14:01:22 +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 42E1F1801ACC; Thu, 8 Jan 2026 14:01:20 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v2 0/5] flow: Introduce flow_epoll_set() to centralize epoll operations Date: Thu, 8 Jan 2026 15:01:14 +0100 Message-ID: <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: ubKIuILYeERqaYCyF9IA6ozw7ItYAVwt7cHsH5VGavU_1767880882 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YSF7TZRGK4UFKOXSJTOVSUEQH6HFCJMD X-Message-ID-Hash: YSF7TZRGK4UFKOXSJTOVSUEQH6HFCJMD 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: Currently, each protocol handler (TCP, TCP splice, ICMP/ping, UDP) has its= =0D own code to add or modify file descriptors in epoll. This leads to=0D duplicated boilerplate across icmp.c, tcp.c, tcp_splice.c, and udp_flow.c,= =0D with each setting up epoll_ref unions and calling epoll_ctl() with=0D flow-type-specific details.=0D =0D This series introduces flow_epoll_set() in flow.c to handle epoll=0D operations for all flow types in a unified way. The function provides=0D a simpler interface where the caller passes the command, type, events,=0D and file descriptor, and flow_epoll_set() handles the epoll_ref setup=0D and epoll_ctl() call.=0D =0D The API is:=0D =0D int flow_epoll_set(int command, enum epoll_type type,=0D const struct flow_common *f, uint32_t events,=0D int fd, unsigned int sidei);=0D =0D This centralized approach will be essential for queue pair migration in=0D the upcoming multithreading work, where flows need to be moved between=0D different epoll instances owned by different threads.=0D =0D Preparatory patches:=0D - Patch 1 removes dead timer update code in tcp_epoll_ctl()=0D - Patch 2 removes unneeded epoll_ref indirection in udp_flow=0D - Patch 3 refactors udp_flow_sock() to assign the socket internally=0D - Patch 4 refactors tcp_splice_conn_epoll_events() to per-side computation= =0D =0D Core patch:=0D - Patch 5 introduces flow_epoll_set() used by all protocol handlers=0D =0D Changes in v2:=0D - Added patch 1: Remove dead timer update in tcp_epoll_ctl() since flow=0D table compaction was eliminated=0D - Added patch 2: Remove unnecessary epoll_ref indirection in udp_flow.c=0D - Dropped v1 patch 6 (compute events inside flow_epoll_set())=0D - Dropped v1 patch 7 (retrieve fd from flow structure)=0D - Added epoll_ctl() command parameter (EPOLL_CTL_ADD/EPOLL_CTL_MOD)=0D - Callers must set epollfd via flow_epollid_set() before calling=0D flow_epoll_set()=0D - Removed FLOW_EPOLL_TIMER_ADD/FLOW_EPOLL_TIMER_MOD constants=0D - Reduced series from 7 to 5 patches=0D =0D Laurent Vivier (5):=0D tcp: remove timer update in tcp_epoll_ctl()=0D udp_flow: remove unneeded epoll_ref indirection=0D udp_flow: Assign socket to flow inside udp_flow_sock()=0D tcp_splice: Refactor tcp_splice_conn_epoll_events() to per-side=0D computation=0D flow: Introduce flow_epoll_set() to centralize epoll operations=0D =0D flow.c | 33 +++++++++++++++=0D flow.h | 3 ++=0D icmp.c | 11 ++---=0D tcp.c | 72 ++++++++++++++------------------=0D tcp_splice.c | 115 ++++++++++++++++++++++++---------------------------=0D udp_flow.c | 19 +++------=0D 6 files changed, 131 insertions(+), 122 deletions(-)=0D =0D --=20=0D 2.52.0=0D =0D