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=Tbltzr1R; 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 C82705A0265 for ; Mon, 11 May 2026 11:53:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778493195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U84nsBk21Zolmz9Xr58KGjVz3juG2UR2HujaqHJ3QEI=; b=Tbltzr1RzF38ES2PaosYJ9xWw3h2KTeT9Yy5ORn6dRKfABTLxeR5VMh3AOqZv6iLZE57vG KXNdckU5hQB7gt3z4tkvfn3DtCRf4+Ihfnm9QXtgol0kh0mXvz0dcfyTeuBmz95e8rBu41 8+Rq3b8gTLADEovs1L0tnJcNTC4XsgQ= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-0UK6r2JTP6mSK3dpieTv-w-1; Mon, 11 May 2026 05:53:14 -0400 X-MC-Unique: 0UK6r2JTP6mSK3dpieTv-w-1 X-Mimecast-MFC-AGG-ID: 0UK6r2JTP6mSK3dpieTv-w_1778493194 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-8b5f089a5c3so72351426d6.3 for ; Mon, 11 May 2026 02:53:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778493194; x=1779097994; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=U84nsBk21Zolmz9Xr58KGjVz3juG2UR2HujaqHJ3QEI=; b=R6SQ2gA09ihb0MUk0s7wnUv+6CpgeKK7tJxLXpPr0ODfWgXd+EugAykyDq1dXzgLRb JzEnwo6PIhZwKxASLtBo+nGtkWckS9cuIC95ifI/ghFBa463u6kqrrUjKdYCqz0zBFas 27p4v9eQ6k+rmevBGTudllDLR7SlCEYFyGJK9xiUwOMGVEeVkMii5VPSTJOZNBcEGnJO PYZcWrE7q6+tlzcWTLSEiF8ceIDLGAzYGY4lu5rrTOm6jKvsLWhxs++KKyG4N3jb/mCX XWJqzNTXgJwLhbsEqlp2hK43MLLCxQuDa+hqiJIqu0ukNH2uhhMnLR0uKY82UzCpc8EZ p+dA== X-Forwarded-Encrypted: i=1; AFNElJ94R819e+8P+RATm9mEpBYO8sDXf/LIPUr0inKZWS8Y1qOkkoGs6w7AQg8K6095g5q0WBPGPLPSLW4=@passt.top X-Gm-Message-State: AOJu0YxBOKuY4Z0T5/1Puotzm4kzB0VUkjd1o2DHhBSXj9Li52M+95/O FlVNIG/2tYdomG5e1z3mbaNHhwQZev9CVomcZ19CmKej2ZU1KYswp9ivHVc2RvxN6ZQGFQ2QpvJ 9v4qLr98xWZaRs6NRsOdQcpwyLF7566piMrwxGNlj4+RNYSrBCRCYMg== X-Gm-Gg: Acq92OE67/xvcBz0cpb0myWHAgk7rJ8QS9j3ncN6mRO1HP1PbXmV2OZ5JtJEiU2lS/x 3i9k35OoxTFNX9tzuhDa5GQXUyhijy9aNWdhjJKlDasAEZcdnkKomnG2+CGHZ7QCOchVhfkl3lC 3+05I0BFg6FfqwFszR5NKtvvRWmkk/a+DhWWP1qM5dd6sFHxIsbbTmPINfK2Yb1yRiEabJbLG64 51C7ifY0imTpGPM+pJQ1bEI9ac5Co7Ucfkacjg/g+FjR2qzS/AxCmRb2j8boHNPeJLGMDu/q6Vr DsjYl4qGsyDLeeG3xtCmb+aQJibaavUnVOlE23jRXVZIoXgZeScEQYCMy5Iktrkx+s44hO/mZCr 3fGXVHpYYK3/i8Ytw0p3D5BMeUxeLW+NJlM8RK1jfvrK++o4guHblWVvour02SHoKGo+2YkIBb7 AM/DJ0migEgW40 X-Received: by 2002:a05:6214:5890:b0:8bf:6a92:84af with SMTP id 6a1803df08f44-8c1a379722amr129198406d6.21.1778493193999; Mon, 11 May 2026 02:53:13 -0700 (PDT) X-Received: by 2002:a05:6214:5890:b0:8bf:6a92:84af with SMTP id 6a1803df08f44-8c1a379722amr129198146d6.21.1778493193485; Mon, 11 May 2026 02:53:13 -0700 (PDT) Received: from [192.168.2.15] (lnsm4-toronto63-142-116-28-118.internet.virginmobile.ca. [142.116.28.118]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8b53cd827c5sm352986896d6.40.2026.05.11.02.53.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 02:53:13 -0700 (PDT) Message-ID: Date: Mon, 11 May 2026 05:53:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 00/10] vhost-user: Preparatory series for multiple iovec entries per virtqueue element To: Laurent Vivier , passt-dev@passt.top References: <20260416155721.3807225-1-lvivier@redhat.com> From: Jon Maloy In-Reply-To: <20260416155721.3807225-1-lvivier@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uVtiVLuPB5OLbt7lWCox7QF3x61WZ_toKyFztWuJ_GU_1778493194 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: KOOIFISCEQ7JNVZZ3UNIJPCV5BGUW5JS X-Message-ID-Hash: KOOIFISCEQ7JNVZZ3UNIJPCV5BGUW5JS X-MailFrom: jmaloy@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 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: Nice series. I responded directly on the patches where I saw some very minor issues. For the rest: Reviewed-by: Jon Maloy On 2026-04-16 11:57, Laurent Vivier wrote: > Currently, the vhost-user path assumes each virtqueue element contains > exactly one iovec entry covering the entire frame. This assumption > breaks as some virtio-net drivers (notably iPXE) provide descriptors where the > vnet header and the frame payload are in separate buffers, resulting in > two iovec entries per virtqueue element. > > This series refactors the vhost-user data path so that frame lengths, > header sizes, and padding are tracked and passed explicitly rather than > being derived from iovec sizes. This decoupling is a prerequisite for > correctly handling padding of multi-buffer frames. > > The changes in this series can be split in 3 groups: > > - New iov helpers (patches 1-2): > > iov_memset() and iov_memcpy() operate across iovec boundaries. > These are needed by the final patch to pad and copy frame data > when a frame spans multiple iovec entries. > > - Structural refactoring (patches 3-5): > > Move vnethdr setup into vu_flush(), separate virtqueue management > from socket I/O in the UDP path, and pass iov arrays explicitly > instead of using file-scoped state. These changes make it possible > to pass explicit frame lengths through the stack, which is required > to pad frames independently of iovec layout. > > - Explicit length passing throughout the stack (patches 6-10): > > Thread explicit L4, L2, frame, and data lengths through checksum, > pcap, vu_flush(), and tcp_fill_headers(), replacing lengths that > were previously derived from iovec sizes. With lengths tracked > explicitly, the final patch can centralise Ethernet frame padding > into vu_collect() and a new vu_pad() helper that correctly pads > frames spanning multiple iovec entries. > > v3: > - csum_udp4()/csum_udp6()/udp_vu_csum receive payload length (dlen) rather than l4len > - Add a length parameter to write_remainder() and use it in pcap_frame() > > v2: > - Rename iov_memcopy() to iov_memcpy() and use clearer parameter names > - Use clearer code in pcap_frame() > - Add braces around bodies in pcap.c and tcp_vu.c for style consistency > - Extract l2len variable in tap_add_packet() and tcp_vu_send_flag() > to avoid repeating the same expression > - Fix indentation alignment of iov_skip_bytes() arguments in tcp_vu_c > - Introduce fill_size variable in vu_flush() > - Reposition comment for ETH_ZLEN in vu_collect() > > Laurent Vivier (10): > iov: Introduce iov_memset() > iov: Add iov_memcpy() to copy data between iovec arrays > vu_common: Move vnethdr setup into vu_flush() > udp_vu: Move virtqueue management from udp_vu_sock_recv() to its > caller > udp_vu: Pass iov explicitly to helpers instead of using file-scoped > array > checksum: Pass explicit L4 length to checksum functions > pcap: Pass explicit L2 length to pcap_iov() > vu_common: Pass explicit frame length to vu_flush() > tcp: Pass explicit data length to tcp_fill_headers() > vhost-user: Centralise Ethernet frame padding in vu_collect() and > vu_pad() > > checksum.c | 43 +++++++----- > checksum.h | 6 +- > iov.c | 78 ++++++++++++++++++++++ > iov.h | 5 ++ > pcap.c | 28 +++++--- > pcap.h | 2 +- > tap.c | 10 +-- > tcp.c | 14 ++-- > tcp_buf.c | 3 +- > tcp_internal.h | 2 +- > tcp_vu.c | 66 ++++++++++--------- > udp.c | 5 +- > udp_vu.c | 173 +++++++++++++++++++++++++------------------------ > util.c | 31 +++++++-- > util.h | 3 +- > vu_common.c | 58 ++++++++++------- > vu_common.h | 5 +- > 17 files changed, 338 insertions(+), 194 deletions(-) >