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=bUrDFj12; 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 84CA95A0271 for ; Fri, 13 Feb 2026 12:48:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770983285; 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=8UwuE1/8UkfWKpJu4gZfcrVccKtTqlpvBd+J3UHMKL0=; b=bUrDFj126m7icVy66Ic6yMpe621xIk9cIoxERQJF+P0XnPOJbhQ3Yi3HfRTQzypbgxb/My z6ZQEor93pLxbKw09WfnmYf3kGPcwLmAEni6om58RZR676xkrnopOFoOGt194ufQWMaVde jhNtDjXAkEC91nYSID55fL0ZJs4raPQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-244-3yGzXjmhMT2lF7E4qEKZUg-1; Fri, 13 Feb 2026 06:48:04 -0500 X-MC-Unique: 3yGzXjmhMT2lF7E4qEKZUg-1 X-Mimecast-MFC-AGG-ID: 3yGzXjmhMT2lF7E4qEKZUg_1770983283 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-437159d3ff2so965571f8f.1 for ; Fri, 13 Feb 2026 03:48:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770983282; x=1771588082; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8UwuE1/8UkfWKpJu4gZfcrVccKtTqlpvBd+J3UHMKL0=; b=cJonkScjM/ZEoQWaHVjdkkUhrtzZsdYjtYRfFbfeb6phLIGQs47P7Lj9PSF2u7Grfk VZnhnY7Ly0E5AdLfpVSLJj7qVpgEHJwAAwjifnQ4VNaikPzqm98iK36Thh0pbxK9SSZK 800scihp4ie0D6s1c3gVdk7oi3mB/8WNM3taRZ4mNqFFGBmpdz86QCvZ9pApLSXK+eFm sCbsZklwP8rAY+eE0HIsFoVzkZivK8KxhxSbw79/+XQ+R+81sWLicNCv+6b/MAqpmh9s zatUosZj24Q4RcUiLhhmttBs2e4BTTxaOd+8JU8qd2iT5q7FI5ZVzEB2M6HbmKY8BKTL En+g== X-Gm-Message-State: AOJu0YzRG6NYX70HPU6tXbN3PvwzYodkbGvfcBsDxV2MYk0Lffo3J1K1 wtZDT0F/zHZG/Zksjv+Y/ZRdzVJdxHXRAIQ+JBoTXHEpuhMCoyKe8hYGtjkQpph5vojmUJihIcm 2IPQgg+ih3dMwvsvOFctxs067t6ibDVHxXz6j0p76DHqJ8xwDQvX+4u6jbLSAsk26Y5kOYskGiX CYuY+9SC7Ah8ZLl/x40JZyARRpeYEMdyPMbANL X-Gm-Gg: AZuq6aJ5qPESXB47PXTASuzY4lO/hMe4P5BAnrXOs0+H1NeBaZXCjtD3DowYZpJnzk0 iwiuE5LNc2dxqFSMJC2sfow+PnrUyqZOp4qyeW/UDiT5iaiSrI3JqQ4q/2hLRGm9j9Em+XVWH69 AAQyKNQflm4ey8zLic04rmHuZk6hfnwvxU4ZW2Sm7BZZUukwOfRgsG0M75GAuCcex74F40l/Xz6 07TeZaKqe920aCqjRJMpm3VG+8xaAcdOq+a07HfPbufq4uevwMTvGFHz8X+kacrR2RVwrfPRX+t H70JKPQxVd8k+KYdGKoaSvdEXlN6eyafrkZDki96m8Jblx+OWZhBVWln2jr4rVnugW8K1ipuy5d 8fbbZe8vQ+tgfvQwfdQQtJDOnQjXLrcjN X-Received: by 2002:a5d:588d:0:b0:437:7710:5204 with SMTP id ffacd0b85a97d-43796afa1eemr4183255f8f.53.1770983281717; Fri, 13 Feb 2026 03:48:01 -0800 (PST) X-Received: by 2002:a5d:588d:0:b0:437:7710:5204 with SMTP id ffacd0b85a97d-43796afa1eemr4183198f8f.53.1770983281089; Fri, 13 Feb 2026 03:48:01 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796abe3b3sm6112134f8f.18.2026.02.13.03.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Feb 2026 03:48:00 -0800 (PST) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH 2/2] tcp_vu, udp_vu: Account for virtio net header in minimum frame size Message-ID: <20260213124759.4cfceb52@elisabeth> In-Reply-To: <20260212113932.1047788-3-lvivier@redhat.com> References: <20260212113932.1047788-1-lvivier@redhat.com> <20260212113932.1047788-3-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Fri, 13 Feb 2026 12:48:00 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: XqNhLBvfe3u-zQw_PDP5L_kr9P0XMvYHAQyJqYPp6Fo_1770983283 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 7ZXRGWBXFZXUISW7BVJNQGONV56HKQMG X-Message-ID-Hash: 7ZXRGWBXFZXUISW7BVJNQGONV56HKQMG X-MailFrom: sbrivio@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: 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: On Thu, 12 Feb 2026 12:39:32 +0100 Laurent Vivier wrote: > In the vhost-user paths, the buffers provided by the virtio queue > include the virtio net header (VNET_HLEN) prepended to the Ethernet > frame. The minimum size checks using ETH_ZLEN must therefore account > for this additional header length, otherwise we underestimate the > minimum buffer size needed. Oops, thanks for fixing this. > Use ETH_ZLEN + VNET_HLEN instead of bare ETH_ZLEN in vu_collect() > calls and the corresponding ASSERT() checks. > > Fixes: 0cb8f9003654 ("tcp, udp: Pad batched frames for vhost-user modes to 60 bytes (802.3 minimum)") > Signed-off-by: Laurent Vivier > --- > tcp_vu.c | 8 ++++---- > udp_vu.c | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/tcp_vu.c b/tcp_vu.c > index f7bda4943e43..2d593d534d68 100644 > --- a/tcp_vu.c > +++ b/tcp_vu.c > @@ -90,12 +90,12 @@ int tcp_vu_send_flag(const struct ctx *c, struct tcp_tap_conn *conn, int flags) > vu_set_element(&flags_elem[0], NULL, &flags_iov[0]); > > elem_cnt = vu_collect(vdev, vq, &flags_elem[0], 1, > - MAX(hdrlen + sizeof(*opts), ETH_ZLEN), NULL); > + MAX(hdrlen + sizeof(*opts), ETH_ZLEN + VNET_HLEN), NULL); I'm applying this now but, perhaps as a follow-up, should we consider to clarify further the arguments to vu_collect(), and perhaps related sizes? I'm not the most indicated person to do this I guess, as I keep getting them wrong. :( In this case, I really thought VNET_HLEN would be added internally, because of: * @size: Maximum size of the data in the frame -- Stefano