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=202602 header.b=L501nDYA; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 197835A0627 for ; Tue, 24 Mar 2026 00:11:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1774307506; bh=7JI8SUNaKg9CvIRmNawZFy2GRWBLG7wYnE5nBDl3lV4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L501nDYAX97jxkEpRdoz1eO4HhedHi/J7U/oVRHJHPrAExg4efr9ODbq40KRk5iQx mufM9oXXaNq0w8L4YdBqgPyTJ2nDALGEFcSu/slaJyoDSjDggPDZoHo1Q7mle6fcUn 1JVZelBgFgOpZseL6M7uEOakPB1ZnbuBC9ynuqwmQnQX8JhAV/YQSrQMZ5PAs4wVBW D5jW+3zE0INJZrSYRfdgCEoGGHfDFCMttrCLZL6mvtvm2YtzgNFA+TBMqy9MDBLOyq ndSLRovVTRJi5QXXQ1IGii8IAPdfWi5anmKSx8ODHjZSR8MNd4etCmP55SWnrjT+o6 OGHDLDO1ulNAA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ffppB34CGz4wCW; Tue, 24 Mar 2026 10:11:46 +1100 (AEDT) Date: Tue, 24 Mar 2026 10:08:30 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH trivial 1/3] tcp_vu: Remove redundant eh->h_proto assignments Message-ID: References: <20260320135116.575416-1-lvivier@redhat.com> <20260320135116.575416-2-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="va55UoCZpOx6T310" Content-Disposition: inline In-Reply-To: <20260320135116.575416-2-lvivier@redhat.com> Message-ID-Hash: AYLMZFSNNKX4CIZZOYW2ZTMY6Z5GJ6QC X-Message-ID-Hash: AYLMZFSNNKX4CIZZOYW2ZTMY6Z5GJ6QC 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: --va55UoCZpOx6T310 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 20, 2026 at 02:51:14PM +0100, Laurent Vivier wrote: > tcp_fill_headers() unconditionally sets eh->h_proto based on whether > ip4h or ip6h is non-NULL. The assignments in tcp_vu_send_flag() and > tcp_vu_prepare() are therefore redundant and can be removed. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > tcp_vu.c | 8 -------- > 1 file changed, 8 deletions(-) >=20 > diff --git a/tcp_vu.c b/tcp_vu.c > index fd734e857b3b..c616b1fec2bf 100644 > --- a/tcp_vu.c > +++ b/tcp_vu.c > @@ -105,15 +105,11 @@ int tcp_vu_send_flag(const struct ctx *c, struct tc= p_tap_conn *conn, int flags) > memcpy(eh->h_source, c->our_tap_mac, sizeof(eh->h_source)); > =20 > if (CONN_V4(conn)) { > - eh->h_proto =3D htons(ETH_P_IP); > - > ip4h =3D vu_ip(flags_elem[0].in_sg[0].iov_base); > *ip4h =3D (struct iphdr)L2_BUF_IP4_INIT(IPPROTO_TCP); > =20 > th =3D vu_payloadv4(flags_elem[0].in_sg[0].iov_base); > } else { > - eh->h_proto =3D htons(ETH_P_IPV6); > - > ip6h =3D vu_ip(flags_elem[0].in_sg[0].iov_base); > *ip6h =3D (struct ipv6hdr)L2_BUF_IP6_INIT(IPPROTO_TCP); > th =3D vu_payloadv6(flags_elem[0].in_sg[0].iov_base); > @@ -307,14 +303,10 @@ static void tcp_vu_prepare(const struct ctx *c, str= uct tcp_tap_conn *conn, > /* initialize header */ > =20 > if (!v6) { > - eh->h_proto =3D htons(ETH_P_IP); > - > ip4h =3D vu_ip(base); > *ip4h =3D (struct iphdr)L2_BUF_IP4_INIT(IPPROTO_TCP); > th =3D vu_payloadv4(base); > } else { > - eh->h_proto =3D htons(ETH_P_IPV6); > - > ip6h =3D vu_ip(base); > *ip6h =3D (struct ipv6hdr)L2_BUF_IP6_INIT(IPPROTO_TCP); > =20 > --=20 > 2.53.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 --va55UoCZpOx6T310 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmnBx+0ACgkQzQJF27ox 2GdERg//c+lHtOGETmtCqrTREzioE3f1Q/8Y01WREpHpjOvuK6O4xCT7bGtGUTC0 KGJmzA98Z6b/XrXGx6lgIcMHEHHV22KovdIR3NjV6KENkm6p0uwqJ5fTvE/r+652 AjprtMcMJahRmTO/V+5O14MQs6w9R+VpxXlCAXe8Iic2A/Swjt4hgs4EEt3UH2R1 IA+YZRSjUJJ5qIrD9Ql9ZnRHRjC2VsOd+stLuwU6GPH8rSEfCCTCDZPqntrqVx/G fyBVNo6sUqPZgliYGwpxlLZo4sNQPqfKBYkm2bUSlmNJ/OxzjP/zRbib6dnL3pqG KIBtxez/1rg0WHjRwPb4HdnFROG8xeveev4PV3WFTTnSjt0eBaaUmIO0FB/UIM4T M4+uSyf8f3DmticmwZswkjnisAn1RQ2o9nzUKr4HyY5mhmeWmpGuxvxhvUtinaib Oz1dEjTj0kt8Yzj2aHP/EqM48q2S34t5SafymIKR/20xMkZOMKksGnVfIKAxUiZL 5iedMFORkmfzcvL/i4hB3pQzxS6EXoWe0H9TK2hugLBbchI2cPybpogWprQMZroQ 9eUIR16AIa+S6ZzRYCKUGpHIdmafHBeT1quAcFlW0CaLGpucx9vwYp2MuwMYTvTl W2hZJYj0KAU6ppl/4+XqOIqAQ06elmq4eDaWJWdwWhe6q2EuHKE= =3bIT -----END PGP SIGNATURE----- --va55UoCZpOx6T310--