From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH] vhost_user: remove ASSERT() on iovec number
Date: Mon, 20 Jan 2025 14:15:22 +0100 [thread overview]
Message-ID: <20250120131522.1053992-1-lvivier@redhat.com> (raw)
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 <lvivier@redhat.com>
---
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);
--
@@ -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
next reply other threads:[~2025-01-20 13:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 13:15 Laurent Vivier [this message]
2025-01-20 20:00 ` [PATCH] vhost_user: remove ASSERT() on iovec number Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250120131522.1053992-1-lvivier@redhat.com \
--to=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).