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=iU67KKVR; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 5E0045A0275 for ; Mon, 02 Mar 2026 02:03:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1772413409; bh=/+YxXlCCNOacLp4tyWEXYHqJyihvOmhF7GsZMFfSfOQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iU67KKVRLTla+Sun4Jzn7ppRcMASqRmYl/sp9nmZoRA22vV5AV9mPVQOIOPzbjwZE 1lZvRB+O97IiehTHGzMbXYfvTt8Vu1hGmmJ1LIe3ponb/FGOI2QGhPNXafkvHXB0wP p5W+sxZ+IqF/TblsgzRs79LqS0uJLcGZr4QCCkzdpbBRdFM3DE/zSOUBWGpW75sRu+ GjQu59XAW1hYOtwLbbaqmGRksw7FIv/fQFHGtj8PQLPWdKbuyvxULZ7Zdol1yx5I7j Lf0PNYgCgZd80aIS1XY1Un69RRYRnBCb9wHtUdyAK4PskaSDnKrZSj/zy2iDfQDUgY xzu+Q2boT/iqQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4fPLKF3khkz4w8x; Mon, 02 Mar 2026 12:03:29 +1100 (AEDT) Date: Mon, 2 Mar 2026 11:59:08 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH 11/12] vu_common: Prepare to use multibuffer with guest RX Message-ID: References: <20260227140330.2216753-1-lvivier@redhat.com> <20260227140330.2216753-12-lvivier@redhat.com> MIME-Version: 1.0 In-Reply-To: <20260227140330.2216753-12-lvivier@redhat.com> 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 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iFGy/6UyAGUfNJAz" Content-Disposition: inline Message-ID-Hash: PC3HTYIB7BOG6SFR3AYIQZJ3XHKNZX3M X-Message-ID-Hash: PC3HTYIB7BOG6SFR3AYIQZJ3XHKNZX3M 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: --iFGy/6UyAGUfNJAz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 27, 2026 at 03:03:29PM +0100, Laurent Vivier wrote: > 1b95bd6fa114 ("vhost_user: fix multibuffer from linux") introduces > multibuffer with TX (from the guest), but with iPXE we need to handle > also multibuffer for RX (to the guest). This patch makes the parameter > generic and global. >=20 > No functional change. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson In the sense that it does what it says on the tin. Am I right in thinking this will only allow at most two buffers per element for both to-guest and from-guest paths? Having a fixed number of buffers per element for the from-guest path seems a bit fragile. > --- > vu_common.c | 6 ++---- > vu_common.h | 2 ++ > 2 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/vu_common.c b/vu_common.c > index e32a56d881a3..67d8f3e47338 100644 > --- a/vu_common.c > +++ b/vu_common.c > @@ -20,8 +20,6 @@ > #include "migrate.h" > #include "epoll_ctl.h" > =20 > -#define VU_MAX_TX_BUFFER_NB=092 > - > /** > * vu_packet_check_range() - Check if a given memory zone is contained i= n > * =09=09=09 a mapped guest memory region > @@ -184,11 +182,11 @@ static void vu_handle_tx(struct vu_dev *vdev, int i= ndex, > =09count =3D 0; > =09out_sg_count =3D 0; > =09while (count < ARRAY_SIZE(elem) && > -=09 out_sg_count + VU_MAX_TX_BUFFER_NB <=3D VIRTQUEUE_MAX_SIZE) { > +=09 out_sg_count + IOV_PER_ELEM <=3D VIRTQUEUE_MAX_SIZE) { > =09=09int ret; > =09=09struct iov_tail data; > =20 > -=09=09elem[count].out_num =3D VU_MAX_TX_BUFFER_NB; > +=09=09elem[count].out_num =3D IOV_PER_ELEM; > =09=09elem[count].out_sg =3D &out_sg[out_sg_count]; > =09=09elem[count].in_num =3D 0; > =09=09elem[count].in_sg =3D NULL; > diff --git a/vu_common.h b/vu_common.h > index 51639c04df14..2c2d11abb26f 100644 > --- a/vu_common.h > +++ b/vu_common.h > @@ -9,6 +9,8 @@ > #define VU_COMMON_H > #include > =20 > +#define IOV_PER_ELEM=09(2) > + > static inline void *vu_eth(void *base) > { > =09return ((char *)base + VNET_HLEN); > --=20 > 2.53.0 >=20 --=20 David Gibson (he or they)=09| I'll have my music baroque, and my code david AT gibson.dropbear.id.au=09| minimalist, thank you, not the other way =09=09=09=09| around. http://www.ozlabs.org/~dgibson --iFGy/6UyAGUfNJAz Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmmk4NsACgkQzQJF27ox 2GcqOA/9FNyZgRaf6AytfBKYduJXEwrFoQ15PfKNqbxCuo0w7Zy8NDr1qMk2oyql 26h0RbS5YPvaNPdAz3rQaKR+lis0HjNO5pw9cIn3xHmB3vrH7ED/LvRnZ6Ge8R+6 x5gOngpirYjvw3ZUU2upNUvBQzQktyXs8fb1uBhvj2kgElStooPuhbqvXpQFs8Ve jpMzk9HF9FCSBh7PDAvSMTRsB9EwPUCMjSfDSIPyqveBl4dxncSH2ffbBG6zcS7n A6fesUgfULWJ7emEIXCEAUSwN02QxB7hEGK7TJvOqCt0sdKUX39Q4elezl3HU9a4 qPfDc5ZK+FO1reYM1a9O1JIasnR0Z+1KwcPzK5cmIRAdUSXKo9DkILutgf8H0OyE IydU9QHzgV8rjCYGctDDaJwHjeBqz/hvAyClZs9aFtoYUJIqc0/fDTnJI5YVtNk4 q+L+dJc6+HVQQ3wqF5DHNjAYnyPLP4mcVfvAshMKAMXbYgx+tMCacBACmujIGfCe JYDAGngzX8H0565QSBfn0UiwZTwLR5iTE9CIHUQ8IhTycVaa3vy+z8RAPrlWWuOh zzNFWdF3VA1Sdx2Y2HJq3zJK8d99suNCGc7OtTu/4WSin5ooC8suZHfrr07NYUZ5 pqqMUSgESxRJ/odf5RJ0ZuqCzojg+tE+YeGBWJBNDAwDlqt1wNk= =VoHw -----END PGP SIGNATURE----- --iFGy/6UyAGUfNJAz--