From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202510 header.b=puJxDFZ7; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 6310A5A061B for ; Wed, 22 Oct 2025 03:01:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202510; t=1761094876; bh=h10BDvj4Z2UnEFH81TcfT34UhdGag+ehppIq2yjOOvY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=puJxDFZ7jq+vpwHOk8B0nJ1osUUiYUWUpoRSvOUbEMfnJQKxHP9+wE+JsvYC5l0zL uCBx+fCxn2OD7kUfcXaJr9x0DgkX5XpPhzXRRJ5v7o4HChhic7O31MqL4mTHC+VCYk VGId2NfysPjBAyGStRJsmqGHBw/LrvfF0T8jSUstV9zEbsmGwIQKLmnYsgv9/6DE7Q xWLjKRtSMSh1J9aeHa7ZH1fqH2aYe4VYA31vFpICzU3kTATwIybWq+9FfCQJc8MWkZ gmFfgXwGZKMvY5S4+m6UQZuoVBP+wRpfdJHPhnqrJIoB/H9oK3wmxDDauItYkC7sME iia8vR5nQOliw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4crrT81tQYz4wCv; Wed, 22 Oct 2025 12:01:16 +1100 (AEDT) Date: Wed, 22 Oct 2025 12:00:24 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v4 4/7] tcp, flow: Replace per-connection in_epoll flag with threadnb in flow_common Message-ID: References: <20251017103129.229412-1-lvivier@redhat.com> <20251017103129.229412-5-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h6q8LjlkGLuvPNEK" Content-Disposition: inline In-Reply-To: Message-ID-Hash: O4NTCSJNDHHNBKPNH6BIXX723ND54QZA X-Message-ID-Hash: O4NTCSJNDHHNBKPNH6BIXX723ND54QZA X-MailFrom: dgibson@gandalf.ozlabs.org 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 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: --h6q8LjlkGLuvPNEK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 21, 2025 at 02:14:02PM +0200, Laurent Vivier wrote: > On 20/10/2025 03:34, David Gibson wrote: > > > @@ -570,7 +572,8 @@ static void tcp_timer_ctl(const struct ctx *c, st= ruct tcp_tap_conn *conn) > > > } > > > conn->timer =3D fd; > > > - if (epoll_ctl(c->epollfd, EPOLL_CTL_ADD, conn->timer, &ev)) { > > > + if (epoll_ctl(flow_epollfd(&conn->f), EPOLL_CTL_ADD, > > > + conn->timer, &ev)) { > > Possibly a question for an earlier patch, but is there a reason we > > can't use epoll_add() here? > >=20 >=20 > Yes, the fd we use in epoll_ctl() and the fd stored in ref are not the sa= me. >=20 > The fd in ref is conn->sock (epoll_add() takes fd from ref) but in > epoll_ctl() we add conn->timer (the fd from timerfd_create()). Huh. That seems like a pre-existing bug. I'm pretty sure the epoll ref for the timer ought to have the timer's fd in it. I suspect we just never previously used the ref.fd field for this case. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --h6q8LjlkGLuvPNEK Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmj4LKcACgkQzQJF27ox 2Gd7+BAAgDwOmvUYsUV/OrG7vTujtuWmL8+Q01UvsoGe0QrBizImUGG0k1tOc8gE CN84FCNAY+Wfnqjl6YPwhcVe0rTjuFIABOPQckJ0tCNu5T4AfR9IymO7hegrryAB p4xM5iuKPfPAOXhlv7pmjJvpthtPIc0C7nJCbFl0wXnCXKcNzwr/m6V7YXgggsDc UCJlnpfEEuKfGCVpNF0vEQGKoO28vPZJMhs8Am3hnYRqPvF+QAh3TuXksevv82yE TBgbXPBOclWFLQ/oMC8qkfUEIKPW/WXsuTBgqtjigaQendmBC9Ko+KcriOtwUCUA eva7GU228UeZCBBmNQUtdEsD7d5VR7dcHYviSGr9g3ULe6zc7IJiS5a2/qqgwbvz RovZi4qP36E2Pze7liapzIi19EotGm9OnqA0fK1BUN9e/wolr7I/Jg87w7pOFV44 GLf/zKbedCl6uwE56qvF+zB5gqbgmxtf1oRUVB1Lv8vPvZMUP89cJjOPq+ojE+pC vlXPuOiQqoyaW5b64+ePu73E53IZSM9QwlcBOtZhXiuPSj5UmWfgksVx8y5AsR5Q iN+XV94tk+I4GGx0Vg+wmAehSU4jodXBPjzbIAyglW1n+UgaCphQ+dnhdaKBMLlE NRLCNYUd70ZXdZwE24WmGHABOUKCWcTvbGVyPUfn+VhQ+eUbOK0= =5VdI -----END PGP SIGNATURE----- --h6q8LjlkGLuvPNEK--