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=GOwZKNWa; 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 413AA5A0271 for ; Mon, 19 Jan 2026 17:19:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768839560; 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=HYEw/A/gMA8DGoc21zEtZsldrRnQUhUdCXB179PEUvA=; b=GOwZKNWaefoT7wJfNIEP0uWkhhwWFW2AynPQ3gjB9pFlMMLA/Kj2aYed25MHHUp2YVy1XT qA6IwzYHP/rl1fMKTSZmVdR/EH3KzRyPs6yhkB328OP/bluO5Zbk0nKHnyQaBZylSy0gU5 rOV3S81yZpWZRXl6tRrTHj195OszaMg= 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-1-KWsOwygQMWuiO5WWD3HVLA-1; Mon, 19 Jan 2026 11:19:18 -0500 X-MC-Unique: KWsOwygQMWuiO5WWD3HVLA-1 X-Mimecast-MFC-AGG-ID: KWsOwygQMWuiO5WWD3HVLA_1768839557 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 808DF1956059 for ; Mon, 19 Jan 2026 16:19:17 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.224.165]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 824DB19560A2; Mon, 19 Jan 2026 16:19:16 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v2 0/3] Register TCP flows with epoll at creation time Date: Mon, 19 Jan 2026 17:19:12 +0100 Message-ID: <20260119161915.4014677-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: NFzmjGR4-SzbTUunEP6y1_cM1S9U4rdRTIe-l0Dcp6A_1768839557 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YAXQ4E4EZAJBASOB3YF2UYHH6MRQWOFD X-Message-ID-Hash: YAXQ4E4EZAJBASOB3YF2UYHH6MRQWOFD 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: This series simplifies epoll registration by moving it to flow creation=0D time rather than deferring it to the first event update. By registering=0D sockets with epoll immediately (using events=3D0), the epoll control=0D functions can always use EPOLL_CTL_MOD, eliminating the need to track=0D whether a flow is already registered.=0D =0D Patch 1 registers both splice sockets with epoll in tcp_splice_connect()=0D before initiating the connection, allowing tcp_splice_epoll_ctl() to=0D always use EPOLL_CTL_MOD.=0D =0D Patch 2 does the same for regular TCP connections in tcp_conn_from_tap(),= =0D tcp_tap_conn_from_sock(), and tcp_flow_migrate_target(), simplifying=0D tcp_epoll_ctl() by removing the ADD/MOD conditional logic.=0D =0D Patch 3 removes EPOLLFD_ID_INVALID and related infrastructure now that=0D all flows are registered at creation: flow_in_epoll(), flow_epollid_clear()= ,=0D and the defensive checks in flow_epollfd().=0D =0D Thanks,=0D Laurent=0D =0D Changes in v2:=0D - Explained error handling and rollback behavior in commit message=0D (patch 1)=0D - Added error handling for flow_epoll_set() in tcp_conn_from_tap() and=0D tcp_tap_conn_from_sock() (patch 2)=0D - Added ASSERT for epollid bounds check in flow_epollid_register()=0D (patch 3)=0D =0D Laurent Vivier (3):=0D tcp_splice: Register fds with epoll at flow creation=0D tcp: Register fds with epoll at flow creation=0D flow: Remove EPOLLFD_ID_INVALID=0D =0D flow.c | 34 +++-------------------------------=0D flow.h | 6 +-----=0D icmp.c | 1 -=0D tcp.c | 47 ++++++++++++++++++++++++-----------------------=0D tcp_splice.c | 20 ++++++++++----------=0D udp_flow.c | 1 -=0D 6 files changed, 38 insertions(+), 71 deletions(-)=0D =0D --=20=0D 2.52.0=0D =0D