From: Jon Maloy <jmaloy@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH v6 3/4] tcp_vu: Support multibuffer frames in tcp_vu_sock_recv()
Date: Sat, 9 May 2026 21:33:48 -0400 [thread overview]
Message-ID: <959ac067-404b-4a89-9988-11d151337f69@redhat.com> (raw)
In-Reply-To: <20260416161618.3826904-4-lvivier@redhat.com>
On 2026-04-16 12:16, Laurent Vivier wrote:
> Previously, tcp_vu_sock_recv() assumed a 1:1 mapping between virtqueue
> elements and iovecs (one iovec per element), enforced by an ASSERT.
> This prevented the use of virtqueue elements with multiple buffers
> (e.g. when mergeable rx buffers are not negotiated and headers are
> provided in a separate buffer).
>
[...]
> - if (dlen > len)
> - dlen = len;
> - len -= dlen;
> + dlen = frame[i].size - hdrlen;
>
> /* The IPv4 header checksum varies only with dlen */
> if (previous_dlen != dlen)
> check |= IP4_CSUM;
> previous_dlen = dlen;
>
> - tcp_vu_prepare(c, conn, iov, buf_cnt, dlen, &check, push);
> + tcp_vu_prepare(c, conn, iov, iov_cnt, dlen, &check, push);
>
> - vu_pad(elem[head[i]].in_sg, buf_cnt, dlen + hdrlen);
> - vu_flush(vdev, vq, &elem[head[i]], buf_cnt, dlen + hdrlen);
> + vu_pad(&iov[frame[i].idx_iovec], frame[i].num_iovec,
> + dlen + hdrlen);
This doesn't look right.
iov is already &iov_vu[frame[i].idx_iovec], set a few lines further up
this patch.
I suspect your intention is to access it the way you do in tcp_vu_prepare:
vu_pad(iov, iov_cnt, dlen + hdrlen);
/jon
>
> if (*c->pcap) {
> - pcap_iov(iov, buf_cnt, VNET_HLEN,
> + pcap_iov(iov, iov_cnt, VNET_HLEN,
> dlen + hdrlen - VNET_HLEN);
> }
> + vu_flush(vdev, vq, &elem[frame[i].idx_element],
> + frame[i].num_element, dlen + hdrlen);
>
> conn->seq_to_tap += dlen;
> }
next prev parent reply other threads:[~2026-05-10 1:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 16:16 [PATCH v6 0/4] vhost-user,tcp: Handle multiple iovec entries per virtqueue element Laurent Vivier
2026-04-16 16:16 ` [PATCH v6 1/4] tcp: Encode checksum computation flags in a single parameter Laurent Vivier
2026-05-09 23:45 ` Jon Maloy
2026-05-11 7:49 ` David Gibson
2026-04-16 16:16 ` [PATCH v6 2/4] tcp_vu: Build headers on the stack and write them into the iovec Laurent Vivier
2026-05-09 23:57 ` Jon Maloy
2026-05-11 7:54 ` David Gibson
2026-04-16 16:16 ` [PATCH v6 3/4] tcp_vu: Support multibuffer frames in tcp_vu_sock_recv() Laurent Vivier
2026-04-17 14:56 ` Laurent Vivier
2026-05-10 1:33 ` Jon Maloy [this message]
2026-05-11 8:24 ` David Gibson
2026-04-16 16:16 ` [PATCH v6 4/4] tcp_vu: Support multibuffer frames in tcp_vu_send_flag() Laurent Vivier
2026-05-10 2:03 ` Jon Maloy
2026-05-11 10:52 ` David Gibson
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=959ac067-404b-4a89-9988-11d151337f69@redhat.com \
--to=jmaloy@redhat.com \
--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).