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=gCLx9L60; 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 633955A0626 for ; Thu, 09 Oct 2025 15:04:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760015065; 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=Ph43i0XvPZ4sTaGLNhbg4Dednv4X/gnrbjeiDayZVXA=; b=gCLx9L60F84El0t00IRZh/HW18k9Tki/D/oc3Cj5z5W4B2zs3/iYTHXd1KCsP2FYq3F2rL rpXLs/jUMZxq7YyWRDRv6hVD5SsAf//awSj3yEcBpKcbnIyTIMjaPHpWe9+e4P74irSKPf DxMvoOSKpjEf5HAmKFng5MQLlwtJGQw= Received: from mx-prod-mc-04.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-689-4krw-pk_Po-Etpb4TG_eSw-1; Thu, 09 Oct 2025 09:04:22 -0400 X-MC-Unique: 4krw-pk_Po-Etpb4TG_eSw-1 X-Mimecast-MFC-AGG-ID: 4krw-pk_Po-Etpb4TG_eSw_1760015061 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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 803221955F27 for ; Thu, 9 Oct 2025 13:04:21 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.224.166]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6EB4E18001C6; Thu, 9 Oct 2025 13:04:20 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v3 5/6] icmp: Use thread-based epoll management for ICMP flows Date: Thu, 9 Oct 2025 15:04:08 +0200 Message-ID: <20251009130409.3931795-6-lvivier@redhat.com> In-Reply-To: <20251009130409.3931795-1-lvivier@redhat.com> References: <20251009130409.3931795-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: si1B6azA8gOpDlr83_fUlsS-laAlL7q9R4vP_u5LH6g_1760015061 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: JLMB5ETI7STX3JJKWDKHL3MF6YIKHI4R X-Message-ID-Hash: JLMB5ETI7STX3JJKWDKHL3MF6YIKHI4R 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: Store the thread number in the flow_common structure for ICMP ping flows using flow_epollfd_set() and retrieve the corresponding epoll file descriptor with flow_epollfd_get() instead of passing c->epollfd directly. This makes ICMP consistent with the recent TCP changes and follows the pattern established in previous commit. Signed-off-by: Laurent Vivier --- icmp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/icmp.c b/icmp.c index 56dfac6c958e..5e03e0841ed4 100644 --- a/icmp.c +++ b/icmp.c @@ -149,7 +149,7 @@ unexpected: static void icmp_ping_close(const struct ctx *c, const struct icmp_ping_flow *pingf) { - epoll_del(c->epollfd, pingf->sock); + epoll_del(flow_epollfd_get(&pingf->f), pingf->sock); close(pingf->sock); flow_hash_remove(c, FLOW_SIDX(pingf, INISIDE)); } @@ -206,11 +206,13 @@ static struct icmp_ping_flow *icmp_ping_new(const struct ctx *c, if (pingf->sock > FD_REF_MAX) goto cancel; + flow_epollfd_set(&pingf->f, 0, c->epollfd); + ref.type = EPOLL_TYPE_PING; ref.flowside = FLOW_SIDX(flow, TGTSIDE); ref.fd = pingf->sock; - if (epoll_add(c->epollfd, EPOLLIN, &ref) < 0) { + if (epoll_add(flow_epollfd_get(&pingf->f), EPOLLIN, &ref) < 0) { close(pingf->sock); goto cancel; } -- 2.50.1