From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 3/3] tcp_vu: Pass virtqueue pointer to tcp_vu_sock_recv()
Date: Mon, 8 Sep 2025 12:00:21 +1000 [thread overview]
Message-ID: <aL44tZqzNT2li77C@zatzit> (raw)
In-Reply-To: <20250905154935.389634-4-lvivier@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2368 bytes --]
On Fri, Sep 05, 2025 at 05:49:35PM +0200, Laurent Vivier wrote:
> Pass the virtqueue pointer to tcp_vu_sock_recv() to enable proper
> queue selection for multiqueue support. This ensures that received
> packets are processed on the same virtqueue as the caller.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> tcp_vu.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tcp_vu.c b/tcp_vu.c
> index cb39bc20355b..c6b5b91ec266 100644
> --- a/tcp_vu.c
> +++ b/tcp_vu.c
> @@ -171,6 +171,7 @@ int tcp_vu_send_flag(const struct ctx *c, struct tcp_tap_conn *conn, int flags)
>
> /** tcp_vu_sock_recv() - Receive datastream from socket into vhost-user buffers
> * @c: Execution context
> + * @vq: virtqueue to use to receive data
> * @conn: Connection pointer
> * @v6: Set for IPv6 connections
> * @already_sent: Number of bytes already sent
> @@ -181,13 +182,12 @@ int tcp_vu_send_flag(const struct ctx *c, struct tcp_tap_conn *conn, int flags)
> * Return: number of bytes received from the socket, or a negative error code
> * on failure.
> */
> -static ssize_t tcp_vu_sock_recv(const struct ctx *c,
> +static ssize_t tcp_vu_sock_recv(const struct ctx *c, struct vu_virtq *vq,
> const struct tcp_tap_conn *conn, bool v6,
> uint32_t already_sent, size_t fillsize,
> int *iov_cnt, int *head_cnt)
> {
> - struct vu_dev *vdev = c->vdev;
> - struct vu_virtq *vq = &vdev->vq[VHOST_USER_RX_QUEUE];
> + const struct vu_dev *vdev = c->vdev;
> struct msghdr mh_sock = { 0 };
> uint16_t mss = MSS_GET(conn);
> int s = conn->sock;
> @@ -398,7 +398,7 @@ int tcp_vu_data_from_sock(const struct ctx *c, struct tcp_tap_conn *conn)
> /* collect the buffers from vhost-user and fill them with the
> * data from the socket
> */
> - len = tcp_vu_sock_recv(c, conn, v6, already_sent, fillsize,
> + len = tcp_vu_sock_recv(c, vq, conn, v6, already_sent, fillsize,
> &iov_cnt, &head_cnt);
> if (len < 0) {
> if (len != -EAGAIN && len != -EWOULDBLOCK) {
> --
> 2.50.1
>
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-09-08 2:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 15:49 [PATCH 0/3] This series contains fixes and improvements to the vhost-user implementation Laurent Vivier
2025-09-05 15:49 ` [PATCH 1/3] vhost-user: Fix VHOST_USER_GET_QUEUE_NUM to return number of queues Laurent Vivier
2025-09-08 1:58 ` David Gibson
2025-09-05 15:49 ` [PATCH 2/3] udp_vu: Pass virtqueue pointer to udp_vu_sock_recv() Laurent Vivier
2025-09-08 1:59 ` David Gibson
2025-09-05 15:49 ` [PATCH 3/3] tcp_vu: Pass virtqueue pointer to tcp_vu_sock_recv() Laurent Vivier
2025-09-08 2:00 ` David Gibson [this message]
2025-09-09 20:24 ` [PATCH 0/3] This series contains fixes and improvements to the vhost-user implementation 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=aL44tZqzNT2li77C@zatzit \
--to=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).