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=MgXjra8X; 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 B5AFD5A068E for ; Fri, 16 Jan 2026 16:52:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768578747; 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=pROCrEd/aBHPGLTXjARlibwgjIYkRetvjsv4nz4yukk=; b=MgXjra8XRrVPH9NR71yTTktOZAimunv95hgbNQdR/6QhEHaoQAWRUiOrj6L0utC/ZNvzK0 VEkH4Sw3tI9htl40BbzZtJmmiA45sOE7IImrIgOaqu08ifokUCjnILBBCWxGWtlSvt/sHL hwNtjeRjzxhdkp3sOCnrsQC19xrUKH0= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-LgBer_ZLO1ik8AyCCVTEIw-1; Fri, 16 Jan 2026 10:52:26 -0500 X-MC-Unique: LgBer_ZLO1ik8AyCCVTEIw-1 X-Mimecast-MFC-AGG-ID: LgBer_ZLO1ik8AyCCVTEIw_1768578745 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8B1831800447 for ; Fri, 16 Jan 2026 15:52:25 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.44.32.149]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8D51B3001DBE; Fri, 16 Jan 2026 15:52:24 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 0/3] Register TCP flows with epoll at creation time Date: Fri, 16 Jan 2026 16:52:20 +0100 Message-ID: <20260116155223.2717168-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: fXCCOM9dyvpgi7rSEQJuyDD7chSd-p5PcY-hMbul4eI_1768578745 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7CSZLIYRW3LU4YIWWSHY2TGNLUGBYC64 X-Message-ID-Hash: 7CSZLIYRW3LU4YIWWSHY2TGNLUGBYC64 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 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 | 37 ++++++++++++++-----------------------=0D tcp_splice.c | 20 ++++++++++----------=0D udp_flow.c | 1 -=0D 6 files changed, 27 insertions(+), 72 deletions(-)=0D =0D --=20=0D 2.52.0=0D =0D