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. > > No functional change. > > 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(-) > > 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" > > -#define VU_MAX_TX_BUFFER_NB 2 > - > /** > * vu_packet_check_range() - Check if a given memory zone is contained in > * a mapped guest memory region > @@ -184,11 +182,11 @@ static void vu_handle_tx(struct vu_dev *vdev, int index, > count = 0; > out_sg_count = 0; > while (count < ARRAY_SIZE(elem) && > - out_sg_count + VU_MAX_TX_BUFFER_NB <= VIRTQUEUE_MAX_SIZE) { > + out_sg_count + IOV_PER_ELEM <= VIRTQUEUE_MAX_SIZE) { > int ret; > struct iov_tail data; > > - elem[count].out_num = VU_MAX_TX_BUFFER_NB; > + elem[count].out_num = IOV_PER_ELEM; > elem[count].out_sg = &out_sg[out_sg_count]; > elem[count].in_num = 0; > elem[count].in_sg = 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 > > +#define IOV_PER_ELEM (2) > + > static inline void *vu_eth(void *base) > { > return ((char *)base + VNET_HLEN); > -- > 2.53.0 > -- 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