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=b3RzNi1i; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 1901D5A0262 for ; Mon, 09 Mar 2026 10:47:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773049669; 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; bh=WKmjTQTSe3AZP7DlM5+oOZosZIbj5ryuoqcwLs3aeTU=; b=b3RzNi1ikuZC/c9v21yYiBSqrKpZahscPbwaSjzTJfexq1N0OuVgwDY/QQRHfEqWDqCjhE yNc64AYx+geMoeCWhoAYyPsBwk5aUErOyJyWuwgqJUmbln9s+KBgiYpuGngomd7M0aWCy6 PW1zuw5FWQyni4abGIcf0Mm1VzPFeuU= Received: from mx-prod-mc-01.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-520-X_cLBdoVNYG4MJCudBAFjw-1; Mon, 09 Mar 2026 05:47:47 -0400 X-MC-Unique: X_cLBdoVNYG4MJCudBAFjw-1 X-Mimecast-MFC-AGG-ID: X_cLBdoVNYG4MJCudBAFjw_1773049666 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B34E4195608F for ; Mon, 9 Mar 2026 09:47:46 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.226.4]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BA3271956095; Mon, 9 Mar 2026 09:47:45 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v2 00/13] vhost-user,udp: Handle multiple iovec entries per virtqueue element Date: Mon, 9 Mar 2026 10:47:31 +0100 Message-ID: <20260309094744.1907754-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: TkjNPfjC82G00eT6-Fq62MvsdI4lgKv_CQBe_UHQq5s_1773049666 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CVGFTLW4A34M4CXZVXJ45Q27HYBEY2A2 X-Message-ID-Hash: CVGFTLW4A34M4CXZVXJ45Q27HYBEY2A2 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: Some virtio-net drivers (notably iPXE) provide descriptors where the=0D vnet header and the frame payload are in separate buffers, resulting in=0D two iovec entries per virtqueue element. Currently, the RX (host to=0D guest) path assumes a single iovec per element, which triggers:=0D =0D ASSERTION FAILED in virtqueue_map_desc (virtio.c:403):=0D num_sg < max_num_sg=0D =0D This series reworks the UDP vhost-user receive path to support multiple=0D iovec entries per element, fixing the iPXE crash.=0D =0D This series only addresses the UDP path. TCP vhost-user will be=0D updated to use multi-iov elements in a subsequent series.=0D =0D v2:=0D - add iov_truncate(), iov_memset()=0D - remove iov_tail_truncate() and iov_tail_zero_end()=0D - manage 802.3 minimum frame size=0D =0D Laurent Vivier (13):=0D iov: Add iov_truncate() helper and use it in vu handlers=0D vhost-user: Centralise 802.3 frame padding in vu_collect() and=0D vu_flush()=0D vhost-user: Use ARRAY_SIZE(elem) instead of VIRTQUEUE_MAX_SIZE=0D udp_vu: Use iov_tail to manage virtqueue buffers=0D udp_vu: Move virtqueue management from udp_vu_sock_recv() to its=0D caller=0D iov: Add IOV_PUT_HEADER() to write header data back to iov_tail=0D udp: Pass iov_tail to udp_update_hdr4()/udp_update_hdr6()=0D udp_vu: Use iov_tail in udp_vu_prepare()=0D vu_common: Pass iov_tail to vu_set_vnethdr()=0D vu_common: Accept explicit iovec counts in vu_set_element()=0D vu_common: Accept explicit iovec count per element in vu_init_elem()=0D vu_common: Prepare to use multibuffer with guest RX=0D vhost-user,udp: Use 2 iovec entries per element=0D =0D iov.c | 69 +++++++++++++++++=0D iov.h | 17 ++++-=0D tcp_vu.c | 73 +++++++++---------=0D udp.c | 72 +++++++++---------=0D udp_internal.h | 10 ++-=0D udp_vu.c | 197 +++++++++++++++++++++++++------------------------=0D vu_common.c | 127 +++++++++++++++++++------------=0D vu_common.h | 20 +++--=0D 8 files changed, 356 insertions(+), 229 deletions(-)=0D =0D --=20=0D 2.53.0=0D =0D