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=PBc2jaQx; 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 88AEC5A0619 for ; Thu, 16 Oct 2025 23:31:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760650289; 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=5uqyanhkLSLQZr7a72M/L0Hp+LvGU2pxLi1vUrn8wzs=; b=PBc2jaQxMJ9CzUxWCWUGWlEfaIFwAXLSrP9SJkI3FC2SYMM5pYfPIdLSHO7YQX9VgVOIFv IhPet3jqQc1KN4hOlH18b8wANv8WO/STJVb6tsL0HjfWKbHHR5l7MEFn3I7Z17Tb1dVkqA XfexYwl1a/M0dEzTMupG1jMLEZycC34= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-pbJ_DevOMzS7gWmcahAbLQ-1; Thu, 16 Oct 2025 17:31:28 -0400 X-MC-Unique: pbJ_DevOMzS7gWmcahAbLQ-1 X-Mimecast-MFC-AGG-ID: pbJ_DevOMzS7gWmcahAbLQ_1760650287 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3f6b44ab789so911763f8f.3 for ; Thu, 16 Oct 2025 14:31:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760650286; x=1761255086; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5uqyanhkLSLQZr7a72M/L0Hp+LvGU2pxLi1vUrn8wzs=; b=Fl0R6i9ELek8NL4UEN++QHot8nEp9AbaeEqwGyj/w76DFs/J1iJiRPzD+KEPyQttj/ lmD7g2v0cBDbb+jczzIW7GLWxZzg3yhAc3oVTEB3n9kKL5h0cl2LSg1gttqDwDhvDZoj DWao44o7fd2/kxBPTt3y3W6Vk/bZGw4Tfnz7qnX/gVBwmB9i9tahhvj7yUEHlfaNJem0 HNy4RBSugp+PqO5hUoBhU/YQwl4CwL+UsOJbhNnu4+GcWaooD0hnFxK9wxxogycx52mb TOJpoICLQR6rsbX4tWEVXukN933mj5t50KehL99Yn+F1CjE4KLQ+kKz23FfxhelJbvU7 +xSA== X-Gm-Message-State: AOJu0YxsP85Z/VDvZaRFOtyNSHUckpvNqJR2UXetbzfF4w1cHZ/VQs+i 5EczV993bqaCxopN2RzxXBcQrvl8PyhKIvZu32q4Xj3mDjpa7s4q7GVwih4wdcoGwV+ROLSR83V /QUmWv1KQNgqf4gKZR3ENkJNDHO6u45gTXRIYOYE6RDDJQK5YWM4gb4AMK0U3SQ== X-Gm-Gg: ASbGncvKyWc6MhJqBjzmgWzcV+cJK2sE5IeEJ0YThDMALsxlCcCLKxMPnxBVG+5DbRo 4i1JWDFETJuo7LojPJSj66uQq0cjYOlB2OMRU5AHBVN8eppaoRXFaM4RW2amOVF1H51g3AidsNM f7jDxSLtDUuzWK9k2ea0s3AA/JOzb8m2mQQm8gJ2uXEBtav2Vm30rgmdhLsOHzUZdUN4xfcXrPi 4FhTUm2un6vT3QBBEOZm4BQlVZ+SbhTWl+y1bpBb6/Mfv3Md1DV1rmsDD9d4RGsdUtlP++xj5Sm GtlQQ5h+k6dVu5wUZRdBkgBNlZyGbgFjS83pZNq3pxi1GCZ0W/U1VdZSAIL0/H9neNkVnsxfyn/ C14IYhdmyhA== X-Received: by 2002:a05:600c:1907:b0:46e:206a:78cc with SMTP id 5b1f17b1804b1-4711791c3b0mr12702465e9.28.1760650286141; Thu, 16 Oct 2025 14:31:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEItSD8edmWEsGXzpBhSjH7AeeV/K+k9VuRg/GCzlpFI2lI2LzbSQy5BRbKByJQlZiQgPqKuQ== X-Received: by 2002:a05:600c:1907:b0:46e:206a:78cc with SMTP id 5b1f17b1804b1-4711791c3b0mr12702365e9.28.1760650285729; Thu, 16 Oct 2025 14:31:25 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-471144b5c29sm48094995e9.12.2025.10.16.14.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Oct 2025 14:31:25 -0700 (PDT) Date: Thu, 16 Oct 2025 23:31:24 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v3 1/6] util: Simplify epoll_del() interface to take epollfd directly Message-ID: <20251016233124.6fcbbe41@elisabeth> In-Reply-To: <20251009130409.3931795-2-lvivier@redhat.com> References: <20251009130409.3931795-1-lvivier@redhat.com> <20251009130409.3931795-2-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: zohl3bJt6VRjJN7TdZO07V_aPe48KGhRDz8C_qlzLuU_1760650287 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: YA2XQU2FDVVGJQ6PUVAGY76B5MBKBCIU X-Message-ID-Hash: YA2XQU2FDVVGJQ6PUVAGY76B5MBKBCIU X-MailFrom: sbrivio@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: passt-dev@passt.top, David Gibson 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: On Thu, 9 Oct 2025 15:04:04 +0200 Laurent Vivier wrote: > Change epoll_del() to accept the epoll file descriptor directly instead > of the full context structure. This simplifies the interface and aligns > with the threading refactoring by reducing dependency on the context > structure for basic epoll operations as we will manage an epollfd per > thread. > > Signed-off-by: Laurent Vivier > Reviewed-by: David Gibson > --- > icmp.c | 2 +- > tap.c | 2 +- > tcp.c | 6 +++--- > tcp_splice.c | 4 ++-- > udp_flow.c | 4 ++-- > util.c | 6 +++--- > util.h | 2 +- > vhost_user.c | 6 +++--- > 8 files changed, 16 insertions(+), 16 deletions(-) > > diff --git a/icmp.c b/icmp.c > index 6dffafb0bf54..bd3108a21675 100644 > --- a/icmp.c > +++ b/icmp.c > @@ -151,7 +151,7 @@ unexpected: > static void icmp_ping_close(const struct ctx *c, > const struct icmp_ping_flow *pingf) > { > - epoll_del(c, pingf->sock); > + epoll_del(c->epollfd, pingf->sock); > close(pingf->sock); > flow_hash_remove(c, FLOW_SIDX(pingf, INISIDE)); > } > diff --git a/tap.c b/tap.c > index 95d309bd1938..134c37a72979 100644 > --- a/tap.c > +++ b/tap.c > @@ -1142,7 +1142,7 @@ void tap_sock_reset(struct ctx *c) > } > > /* Close the connected socket, wait for a new connection */ > - epoll_del(c, c->fd_tap); > + epoll_del(c->epollfd, c->fd_tap); > close(c->fd_tap); > c->fd_tap = -1; > if (c->mode == MODE_VU) > diff --git a/tcp.c b/tcp.c > index 91aa33016f36..9100c67e57e0 100644 > --- a/tcp.c > +++ b/tcp.c > @@ -511,9 +511,9 @@ static int tcp_epoll_ctl(const struct ctx *c, struct tcp_tap_conn *conn) > > if (conn->events == CLOSED) { > if (conn->in_epoll) > - epoll_del(c, conn->sock); > + epoll_del(c->epollfd, conn->sock); > if (conn->timer != -1) > - epoll_del(c, conn->timer); > + epoll_del(c->epollfd, conn->timer); > return 0; > } > > @@ -3456,7 +3456,7 @@ int tcp_flow_migrate_source_ext(const struct ctx *c, > if (c->migrate_no_linger) > close(s); > else > - epoll_del(c, s); > + epoll_del(c->epollfd, s); > > /* Adjustments unrelated to FIN segments: sequence numbers we dumped are > * based on the end of the queues. > diff --git a/tcp_splice.c b/tcp_splice.c > index 26cb63064583..666ee62b738f 100644 > --- a/tcp_splice.c > +++ b/tcp_splice.c > @@ -204,8 +204,8 @@ static void conn_flag_do(const struct ctx *c, struct tcp_splice_conn *conn, > } > > if (flag == CLOSING) { > - epoll_del(c, conn->s[0]); > - epoll_del(c, conn->s[1]); > + epoll_del(c->epollfd, conn->s[0]); > + epoll_del(c->epollfd, conn->s[1]); > } > } > > diff --git a/udp_flow.c b/udp_flow.c > index cef3fb588bbe..84973f807167 100644 > --- a/udp_flow.c > +++ b/udp_flow.c > @@ -51,7 +51,7 @@ void udp_flow_close(const struct ctx *c, struct udp_flow *uflow) > flow_foreach_sidei(sidei) { > flow_hash_remove(c, FLOW_SIDX(uflow, sidei)); > if (uflow->s[sidei] >= 0) { > - epoll_del(c, uflow->s[sidei]); > + epoll_del(c->epollfd, uflow->s[sidei]); > close(uflow->s[sidei]); > uflow->s[sidei] = -1; > } > @@ -88,7 +88,7 @@ static int udp_flow_sock(const struct ctx *c, > if (flowside_connect(c, s, pif, side) < 0) { > int rc = -errno; > > - epoll_del(c, s); > + epoll_del(c->epollfd, s); > close(s); > > flow_dbg_perror(uflow, "Couldn't connect flow socket"); > diff --git a/util.c b/util.c > index c492f904b3fc..88a91b1100f5 100644 > --- a/util.c > +++ b/util.c > @@ -996,12 +996,12 @@ void raw_random(void *buf, size_t buflen) > > /** > * epoll_del() - Remove a file descriptor from our passt epoll > - * @c: Execution context > + * @epollfd: epoll file descriptor to add to Nit: "to delete [the descriptor] from"? It's fixed in 2/6 but still it looks confusing in this patch. -- Stefano