From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dBJ4dvMS; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 9101D5A061A for ; Fri, 27 Feb 2026 15:03:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772201032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E7eYr86DU13YyY1Fs8ILZajLJ6WEB+iIHCRBwi4fVzI=; b=dBJ4dvMSecxRZ4fqbUYsCHgWrFDibQOp4q3MvmMzW8iIaGZDGiRyPugFNZKXkde/BADUmp KH7pKtCpyeEwARK3hF4uaHTvRX99m6YGwWG5alk1P5GZfNr2bliwDT/V3mF1KbOOy4ylU8 8BSA8PuzrgEzplT5yhRWMcYhlA9Z2w0= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-115-NUp8CWiPODC5FekcD9M2eA-1; Fri, 27 Feb 2026 09:03:51 -0500 X-MC-Unique: NUp8CWiPODC5FekcD9M2eA-1 X-Mimecast-MFC-AGG-ID: NUp8CWiPODC5FekcD9M2eA_1772201030 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6F8F719560B2 for ; Fri, 27 Feb 2026 14:03:50 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.225.86]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7831119560B7; Fri, 27 Feb 2026 14:03:49 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 11/12] vu_common: Prepare to use multibuffer with guest RX Date: Fri, 27 Feb 2026 15:03:29 +0100 Message-ID: <20260227140330.2216753-12-lvivier@redhat.com> In-Reply-To: <20260227140330.2216753-1-lvivier@redhat.com> References: <20260227140330.2216753-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 85rcB-E3-OTTMRQ8gaKN4N7-_wq0auOtdh_EhUCgEx8_1772201030 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: 2HDGT3BMCIGHU2JN3OJ5TNZTNKOPMX6G X-Message-ID-Hash: 2HDGT3BMCIGHU2JN3OJ5TNZTNKOPMX6G X-MailFrom: lvivier@redhat.com 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: Laurent Vivier 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: 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 --- 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