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=202508 header.b=AgILYLD/; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 1D5D55A0278 for ; Wed, 06 Aug 2025 08:35:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202508; t=1754462131; bh=YQ57T0WPTGi/pjWBtAg5ibHhJZbIeJB39ucupK4txp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AgILYLD/y0tzRd0XUYyj0vzkgm2PM8hIHYKy2kdMsmOluK9DJzp7boIVgIhtFNdDh 5BZiYimCoCqmpQjJsFnKVy3lC5NPSdiNpVTHWUlgqz463qqO9UOVCPFFOZmemdwo2m E4HTGF2j1G3SP+EoMGzJx/YM8BdGwXNR58+mKNWzvZKiLhekeiHei/qjoUPBGfe56U YTbZulUZNLhfb0hvb6NXEVq+M5WzSJRn65DKvl7ms0BC9S8Nd8yRkiyY+iWp8EUfiS +ZYSs3B8bNGbdcxbLCa/ueIUy9WXsYo9hdZQPfZ5ZmJLmjo6xIBd1wpV7ZKwDJKtCq Rwwu9EZoYvapA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4bxgXM0zSgz4xcm; Wed, 6 Aug 2025 16:35:31 +1000 (AEST) Date: Wed, 6 Aug 2025 16:24:09 +1000 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH v8 22/30] arp: use iov_tail rather than pool Message-ID: References: <20250805154628.301343-1-lvivier@redhat.com> <20250805154628.301343-23-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MbrpYDyRuDq9hD7V" Content-Disposition: inline In-Reply-To: <20250805154628.301343-23-lvivier@redhat.com> Message-ID-Hash: DPGWYJOMRYWJXDT7T3MUTIFB4UWI7MX3 X-Message-ID-Hash: DPGWYJOMRYWJXDT7T3MUTIFB4UWI7MX3 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: --MbrpYDyRuDq9hD7V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 05, 2025 at 05:46:20PM +0200, Laurent Vivier wrote: > The arp() function signature is changed to accept `struct iov_tail *data` > directly, replacing the previous `const struct pool *p` parameter. > Consequently, arp() no longer fetches packet data internally using > packet_data(), streamlining its logic. >=20 > This simplifies callers like tap4_handler(), which now pass the iov_tail > for the L2 ARP frame directly, removing intermediate pool handling. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > arp.c | 14 +++++--------- > arp.h | 2 +- > tap.c | 5 +---- > 3 files changed, 7 insertions(+), 14 deletions(-) >=20 > diff --git a/arp.c b/arp.c > index 8b97df633e70..44677ad15b93 100644 > --- a/arp.c > +++ b/arp.c > @@ -63,11 +63,11 @@ static bool ignore_arp(const struct ctx *c, > /** > * arp() - Check if this is a supported ARP message, reply as needed > * @c: Execution context > - * @p: Packet pool, single packet with Ethernet buffer > + * @data: Single packet with Ethernet buffer > * > * Return: 1 if handled, -1 on failure > */ > -int arp(const struct ctx *c, const struct pool *p) > +int arp(const struct ctx *c, struct iov_tail *data) > { > struct { > struct ethhdr eh; > @@ -80,14 +80,10 @@ int arp(const struct ctx *c, const struct pool *p) > const struct ethhdr *eh; > const struct arphdr *ah; > const struct arpmsg *am; > - struct iov_tail data; > =20 > - if (!packet_get(p, 0, &data)) > - return -1; > - > - eh =3D IOV_REMOVE_HEADER(&data, eh_storage); > - ah =3D IOV_REMOVE_HEADER(&data, ah_storage); > - am =3D IOV_REMOVE_HEADER(&data, am_storage); > + eh =3D IOV_REMOVE_HEADER(data, eh_storage); > + ah =3D IOV_REMOVE_HEADER(data, ah_storage); > + am =3D IOV_REMOVE_HEADER(data, am_storage); > if (!eh || !ah || !am) > return -1; > =20 > diff --git a/arp.h b/arp.h > index ac5cd16e47f4..86bcbf878eda 100644 > --- a/arp.h > +++ b/arp.h > @@ -20,6 +20,6 @@ struct arpmsg { > unsigned char tip[4]; > } __attribute__((__packed__)); > =20 > -int arp(const struct ctx *c, const struct pool *p); > +int arp(const struct ctx *c, struct iov_tail *data); > =20 > #endif /* ARP_H */ > diff --git a/tap.c b/tap.c > index 1d2e6fd802e9..ace735cfc136 100644 > --- a/tap.c > +++ b/tap.c > @@ -722,10 +722,7 @@ resume: > if (!eh) > continue; > if (ntohs(eh->h_proto) =3D=3D ETH_P_ARP) { > - PACKET_POOL_P(pkt, 1, in->buf, in->buf_size); > - > - packet_add(pkt, &data); > - arp(c, pkt); > + arp(c, &data); > continue; > } > =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 --MbrpYDyRuDq9hD7V Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmiS9QIACgkQzQJF27ox 2GehLg//aFKcPq8RPDgtwWtBXO5T0xcIN/5zn7ga6O6IFRNi6xmG6TEeZxU7zOq+ v4ySu4bl9zAyV3sZrC3bVTXuzUlp0krTIbeThcjbE0CMzC2s+m4nw62OuneARYNH A5zMnVBnYwgN/s6uRc7t6BzGWIFB7QACXakLpSDLvU60U9Ast0gRxsKMtSY4QSGf 610NJQXmCergwwxH31t1vbIf2/3/c4+eVnCunlWdHaB6oVrsCNZt7ZlEpRq7LuRJ B/Uwv6uAuE41t8uHA6jNzoZeAsi7TjJgWJ+Txlr8hpgo8v019Fssl/CzUvgjgh3c 03fBlztG19Rcti+wpHx5DeRFygtJ+YY4Zsy9oAxk4H1EG1R1hJoTHxml4kmnKREx eLSHfn7jMGPvLAszmCS+fM94ttTmNGsxcJzyUT4KDhGYPgGAGGbtnToiWdX34xox VfK93mn9HI+6tLf3MkYnwnwnBVUJ1sH7UxwWKP9Rr9uPn1U6sU0bhKcO4JaMIF3X GIowJ31QBzv6+wd+EjrHbsi5lTeVSvyz8OKE/cbMcFpojNvi5w5IDcofBkTblIjA UjW3VR1bGtocznTY+sHXkCJkea4u/aGEl2FpV0Mai9AosEDubfWwBO8Zk4KAwoFJ lWvS6B0WOYAoN4lPt2n5nyPXgjIEBqKmUy4uOM2hvjqyEzFBZDI= =cjgI -----END PGP SIGNATURE----- --MbrpYDyRuDq9hD7V--