From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none 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=f4e9EpZC; 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 E20665A0274 for ; Mon, 20 Jan 2025 14:15:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737378926; 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=kSOOxTJtybqcQAPxY/KypBJW2X9x+UlCYeFQcHnUJ2k=; b=f4e9EpZCm1Q4gF9kXQe92fmYwF4o43+3BZA/MDyOfWxbjKxUWEXzMVx/fnpHxEJEUENX3N ZV4c5UKEA6tEKCmSUqPpN9vYvCdYN7f7ckP8CD9dLLMXLXVdUcMikq1JAHAHiRfX1MsTlB 36dHqHhFGvUuR2Ub3ZSkg3665Lvsyq0= Received: from mx-prod-mc-04.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-613-8bFG3qABNeqJ2tTrGFOGKg-1; Mon, 20 Jan 2025 08:15:25 -0500 X-MC-Unique: 8bFG3qABNeqJ2tTrGFOGKg-1 X-Mimecast-MFC-AGG-ID: 8bFG3qABNeqJ2tTrGFOGKg Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8675E1955D63 for ; Mon, 20 Jan 2025 13:15:24 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.193.16]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7896C30044D1; Mon, 20 Jan 2025 13:15:23 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH] vhost_user: remove ASSERT() on iovec number Date: Mon, 20 Jan 2025 14:15:22 +0100 Message-ID: <20250120131522.1053992-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: IVz8Rp2zQ1YP06ovr6vc6yaK9YuLShawWoSW-x-B0z8_1737378924 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: UCIDZCH7HN3PQSV2ONQVLRXHBKA5BA75 X-Message-ID-Hash: UCIDZCH7HN3PQSV2ONQVLRXHBKA5BA75 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: Replace ASSERT() on the number of iovec in the element and on the first entry length by a debug() message. Signed-off-by: Laurent Vivier --- vu_common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vu_common.c b/vu_common.c index 431fba6be0c0..d34ae6dc1df3 100644 --- a/vu_common.c +++ b/vu_common.c @@ -195,8 +195,12 @@ static void vu_handle_tx(struct vu_dev *vdev, int index, hdrlen); } else { /* vnet header can be in a separate iovec */ - ASSERT(elem[count].out_num == 2); - ASSERT(elem[count].out_sg[0].iov_len == (size_t)hdrlen); + if (elem[count].out_num != 2) + debug("virtio-net tranmit queue contains more than one buffer ([%d]: %u)", + count, elem[count].out_num); + if (elem[count].out_sg[0].iov_len != (size_t)hdrlen) + debug("virtio-net transmit queue entry not aligned on hdrlen ([%d]: %d != %zu)", + count, hdrlen, elem[count].out_sg[0].iov_len); tap_add_packet(vdev->context, elem[count].out_sg[1].iov_len, (char *)elem[count].out_sg[1].iov_base); -- 2.47.1