From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v4] iov: Add iov_truncate() helper and use it in vu handlers
Date: Tue, 10 Mar 2026 16:11:27 +0100 (CET) [thread overview]
Message-ID: <20260310161126.4b3c0f56@elisabeth> (raw)
In-Reply-To: <20260306115119.1589020-1-lvivier@redhat.com>
On Fri, 6 Mar 2026 12:51:19 +0100
Laurent Vivier <lvivier@redhat.com> wrote:
> Add a generic iov_truncate() function that truncates an IO vector to a
> given number of bytes, returning the number of iov entries that contain
> data after truncation.
>
> Use it in udp_vu_sock_recv() and tcp_vu_sock_recv() to replace the
> open-coded truncation logic that adjusted iov entries after recvmsg().
> Also convert the direct iov_len assignment in tcp_vu_send_flag() to use
> iov_truncate() for consistency.
>
> Add an ASSERT() in tcp_vu_data_from_sock() to quiet the Coverity error:
>
> passt/tcp_vu.c:457:3:
> 19. overflow_const: Expression "dlen + hdrlen", where "dlen" is known to
> be equal to -86, and "hdrlen" is known to be equal to 86, underflows
> the type of "dlen + hdrlen", which is type "unsigned long".
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>
> Notes:
> v4: add ASSERT() to quiet the Coverity error
> v3: use in tcp_vu_send_flag() too
> v2: use iov_truncate() in udp_vu_sock_recv() too
Applied.
--
Stefano
prev parent reply other threads:[~2026-03-10 15:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 11:51 Laurent Vivier
2026-03-09 9:50 ` David Gibson
2026-03-10 15:11 ` Stefano Brivio [this message]
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=20260310161126.4b3c0f56@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=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).