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=202606 header.b=Ok+SY+qf; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 337725A0272 for ; Mon, 22 Jun 2026 04:40:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1782096000; bh=fpgjZ4vJHCY3hZmajUsW+qRt+zYrjZ2QkHNJdhIvZl4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ok+SY+qfCgjFWw3InG/S6n2K2xSNSIykuPND+mTtTUwd1cG4vvBAd7hZQ8+WuoA70 19FOB9e6df3EgJDJSgEkdaioWK/Wh4VIkjNBnjSlXfqXMzDucEs8nTwnl2vAuWJOuC Nc8ZvRwSc77fLwtqvB+I1cwm7RGxe2M6wameub/zMtFAnWbQkl46mdycn2EIbTjo1l Qfvi3i5ArHhIvpwFkfRO/LwZlqbLQOL35rDD2AJorizWl6y/7BaZyCwkZhPZLICB/7 2BfcPI9szYQVGxoT3MyFMSGCNkihMQkWU1751aPzQ1t0ocwzW7rQN0S4o/XNsgGvUa LpQrel7O0UJzA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gkC8w4f0tz4wT7; Mon, 22 Jun 2026 12:40:00 +1000 (AEST) Date: Mon, 22 Jun 2026 12:39:53 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH] udp, icmp: Remove unused timer_run fields from protocol contexts Message-ID: References: <20260619103006.1669522-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rFIHSFwsOu1KsCsH" Content-Disposition: inline In-Reply-To: <20260619103006.1669522-1-lvivier@redhat.com> Message-ID-Hash: GG276YB5DSUT7CGSEFFXW3LNNKACY4JV X-Message-ID-Hash: GG276YB5DSUT7CGSEFFXW3LNNKACY4JV 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: --rFIHSFwsOu1KsCsH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 19, 2026 at 12:30:06PM +0200, Laurent Vivier wrote: > Since 260075bde769 ("tcp, udp, fwd: Run all port scanning from a > single timer"), CALL_PROTO_HANDLER() is only used for TCP. UDP and > ICMP timers now run from flow_defer_handler(), making the timer_run > fields in struct udp_ctx and struct icmp_ctx dead stores. >=20 > Remove the unused fields, drop struct icmp_ctx entirely (it has no > remaining members), and stop initialising them in timer_init(). >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Nice catch. > --- > icmp.h | 7 ------- > passt.c | 2 +- > passt.h | 2 -- > udp.h | 2 -- > 4 files changed, 1 insertion(+), 12 deletions(-) >=20 > diff --git a/icmp.h b/icmp.h > index e8b928b61370..556260461995 100644 > --- a/icmp.h > +++ b/icmp.h > @@ -19,12 +19,5 @@ int icmp_tap_handler(const struct ctx *c, uint8_t pif,= sa_family_t af, > struct iov_tail *data, const struct timespec *now); > void icmp_init(void); > =20 > -/** > - * struct icmp_ctx - Execution context for ICMP routines > - * @timer_run: Timestamp of most recent timer run > - */ > -struct icmp_ctx { > - struct timespec timer_run; > -}; > =20 > #endif /* ICMP_H */ > diff --git a/passt.c b/passt.c > index b1d35d5bf988..677c8471a105 100644 > --- a/passt.c > +++ b/passt.c > @@ -141,7 +141,7 @@ static void random_init(struct ctx *c) > */ > static void timer_init(struct ctx *c, const struct timespec *now) > { > - c->tcp.timer_run =3D c->udp.timer_run =3D c->icmp.timer_run =3D *now; > + c->tcp.timer_run =3D *now; > } > =20 > /** > diff --git a/passt.h b/passt.h > index 3a072945c382..205d7eecede7 100644 > --- a/passt.h > +++ b/passt.h > @@ -194,7 +194,6 @@ struct ip6_ctx { > * @no_udp: Disable UDP operation > * @udp: Context for UDP protocol handler > * @no_icmp: Disable ICMP operation > - * @icmp: Context for ICMP protocol handler > * @mtu: MTU passed via DHCP/NDP > * @no_dns: Do not source/use DNS servers for any purpose > * @no_dns_search: Do not source/use domain search lists for any purpose > @@ -279,7 +278,6 @@ struct ctx { > int no_udp; > struct udp_ctx udp; > int no_icmp; > - struct icmp_ctx icmp; > =20 > int no_dns; > int no_dns_search; > diff --git a/udp.h b/udp.h > index 9ea7de682caf..b50283eab198 100644 > --- a/udp.h > +++ b/udp.h > @@ -26,14 +26,12 @@ void udp_update_l2_buf(const unsigned char *eth_d); > * struct udp_ctx - Execution context for UDP > * @scan_in: Port scanning state for inbound packets > * @scan_out: Port scanning state for outbound packets > - * @timer_run: Timestamp of most recent timer run > * @timeout: Timeout for unidirectional flows (in s) > * @stream_timeout: Timeout for stream-like flows (in s) > */ > struct udp_ctx { > struct fwd_scan scan_in; > struct fwd_scan scan_out; > - struct timespec timer_run; > int timeout; > int stream_timeout; > }; > --=20 > 2.54.0 >=20 --=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 --rFIHSFwsOu1KsCsH Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmo4oHgACgkQzQJF27ox 2Gcpkg/7BVXxzGqaGonn4hRiXNbEr7D4IR16aRUAhGHqqdI4fRXea7Nhm3ak+Hyv +fFEVAnKYmJDkNXFqZjVTd7VGhgIPs9rN6l7PkRCDvilifKYcQ+5vz5iECWSrrmz aHSDT3zqHVtzLvyQ/YLJx+RATPpjOIE540T0hfDbiuJ+SZPJKXNWsxsK0LpfX6vM NCyOMgYTcpJURofs7N2pbSW3F6S4pyMeAtJ+hEfmN7rp1bT/FvQX9jjiPDtMhRBE bR5qZZjIHMvW2yegGHTPHzdJEYQJTNvZrvh7jJCrIeqpi3vYT9wojvoizbwtm1L4 /o9TOcwRUQuHaK+SLStgvfC6mT7ZAbNAsY5YocwoBf7UJPmr2yWwRTFubZk50hlM UV1j5uCzNPeqyiRBEmtNLy2Gbc/IoRWQqzoeWd+dmDwTYNbnTAQtitjvajU/x791 OegptnzgGsbB2ME48dVC/GgZIlW8GUdVkeqP5gasqgr8fuXjEmroKgnkGEKukojO mhpuRwdXIRRMc8ogc6NQt190efvjjYUCj6RP39KTJQ+f7JLpgSqwXrG71dSJKOy4 uJSEAnX14NlJzvwwTxxetKb1M/lKlylIflcgmpRACfl7yFlfRjPG5FCqlv0TS3M2 FGmJ66XCmWogVV7GpHp1nIdc9nYYFqCIVqlI/2FCQ7doy5wGLgY= =e1Vw -----END PGP SIGNATURE----- --rFIHSFwsOu1KsCsH--