aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2025-09-05 17:49:35 +0200
committerStefano Brivio <sbrivio@redhat.com>2025-09-09 21:14:35 +0200
commitc10d8c987127e1a6ccea5057b70d66e69a374a23 (patch)
tree26cd4ec3d43f665f77b72ed17f86f51d69558353
parented18d4c7ee69140723754ae8fe381927dfaab075 (diff)
downloadpasst-c10d8c987127e1a6ccea5057b70d66e69a374a23.tar
passt-c10d8c987127e1a6ccea5057b70d66e69a374a23.tar.gz
passt-c10d8c987127e1a6ccea5057b70d66e69a374a23.tar.bz2
passt-c10d8c987127e1a6ccea5057b70d66e69a374a23.tar.lz
passt-c10d8c987127e1a6ccea5057b70d66e69a374a23.tar.xz
passt-c10d8c987127e1a6ccea5057b70d66e69a374a23.tar.zst
passt-c10d8c987127e1a6ccea5057b70d66e69a374a23.zip
tcp_vu: Pass virtqueue pointer to tcp_vu_sock_recv()
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> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--tcp_vu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tcp_vu.c b/tcp_vu.c
index cb39bc2..c6b5b91 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) {