public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v6 02/12] vhost-user: Advertise multiqueue support
Date: Mon, 3 Aug 2026 12:03:00 +1000	[thread overview]
Message-ID: <am_2yEzmQ6krBJe_@zatzit> (raw)
In-Reply-To: <20260731161617.3550626-3-lvivier@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3147 bytes --]

On Fri, Jul 31, 2026 at 06:16:07PM +0200, Laurent Vivier wrote:
> Allow the guest to negotiate multiple virtqueue pairs by advertising
> VIRTIO_NET_F_MQ and VHOST_USER_PROTOCOL_F_MQ feature flags, and
> increase VHOST_USER_MAX_VQS from 2 to 32, supporting up to 16 queue
> pairs.
> 
> Replace the VHOST_USER_RX_QUEUE, VHOST_USER_TX_QUEUE,
> VHOST_USER_IS_QUEUE_TX(), and VHOST_USER_IS_QUEUE_RX() macros with a
> general set of QPAIR_* macros in passt.h that translate between queue
> pair numbers and virtqueue indices.  These are needed now that queue
> indices are no longer limited to 0 and 1.
> 
> Add a queue pair parameter to vu_send_single(), propagating it to the
> virtqueue selection.  All callers currently pass QPAIR_DEFAULT (0):
> only the first RX queue is used for receiving.  The guest kernel
> selects which TX queue to use for transmission.  Full multi-RX-queue
> load balancing will be implemented separately.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

[snip]
>  /**
> - * vu_send_single() - Send a buffer to the front-end using the RX virtqueue
> - * @c:		execution context
> + * vu_send_single() - Send a buffer to the front-end using a specified virtqueue
> + * @c:		Execution context
> + * @qpair:	Queue pair on which to send the buffer
>   * @buf:	address of the buffer
>   * @size:	size of the buffer
>   *
>   * Return: number of bytes sent, -1 if there is an error
>   */
> -int vu_send_single(const struct ctx *c, const void *buf, size_t size)
> +int vu_send_single(const struct ctx *c, unsigned int qpair, const void *buf, size_t size)
>  {
>  	struct vu_dev *vdev = c->vdev;
> -	struct vu_virtq *vq = &vdev->vq[VHOST_USER_RX_QUEUE];
>  	struct vu_virtq_element elem[VIRTQUEUE_MAX_SIZE];
>  	struct iovec in_sg[VIRTQUEUE_MAX_SIZE];
> +	struct vu_virtq *vq;

Nit: belongs one line lower down...

>  	size_t total, in_total;
>  	int elem_cnt;
>  	int i;
>  
> +	vq = &vdev->vq[QPAIR_TOGUEST_QUEUE(qpair)];
> +

... or you could put this expression in the initialiser and it
wouldn't move at all.


>  	trace("vu_send_single size %zu", size);
>  
>  	if (!vu_queue_enabled(vq) || !vu_queue_started(vq)) {
> diff --git a/vu_common.h b/vu_common.h
> index 817384175a1d..f5603d9ddeb6 100644
> --- a/vu_common.h
> +++ b/vu_common.h
> @@ -23,7 +23,8 @@ void vu_flush(const struct vu_dev *vdev, struct vu_virtq *vq,
>  	      struct vu_virtq_element *elem, int elem_cnt, size_t frame_len);
>  void vu_kick_cb(struct vu_dev *vdev, union epoll_ref ref,
>  		const struct timespec *now);
> -int vu_send_single(const struct ctx *c, const void *buf, size_t size);
> +int vu_send_single(const struct ctx *c, unsigned int qpair, const void *buf,
> +		   size_t size);
>  void vu_pad(const struct iovec *iov, size_t cnt, size_t frame_len);
>  
>  #endif /* VU_COMMON_H */
> -- 
> 2.54.0
> 

-- 
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 --]

  reply	other threads:[~2026-08-03  3:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 16:16 [PATCH v6 00/12] vhost-user: Add " Laurent Vivier
2026-07-31 16:16 ` [PATCH v6 01/12] tap: Remove pool parameter from tap4_handler() and tap6_handler() Laurent Vivier
2026-07-31 16:16 ` [PATCH v6 02/12] vhost-user: Advertise multiqueue support Laurent Vivier
2026-08-03  2:03   ` David Gibson [this message]
2026-07-31 16:16 ` [PATCH v6 03/12] test: Add multiqueue support to vhost-user test infrastructure Laurent Vivier
2026-07-31 16:16 ` [PATCH v6 04/12] tap: Thread queue pair through all remaining tap paths Laurent Vivier
2026-08-03  3:10   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 05/12] arp: Pass queue pair explicitly through ARP send path Laurent Vivier
2026-08-03  3:10   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 06/12] tcp: Pass queue pair explicitly through TCP " Laurent Vivier
2026-08-03  3:17   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 07/12] udp: Pass queue pair explicitly through UDP " Laurent Vivier
2026-08-03  3:22   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 08/12] dhcp/dhcpv6: Pass queue pair explicitly through DHCP " Laurent Vivier
2026-08-03  3:24   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 09/12] icmp: Pass queue pair explicitly through ICMP " Laurent Vivier
2026-08-03  3:26   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 10/12] ndp: Pass queue pair explicitly through NDP " Laurent Vivier
2026-08-03  3:27   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 11/12] flow: Add queue pair tracking to flow management Laurent Vivier
2026-08-03  3:40   ` David Gibson
2026-07-31 16:16 ` [PATCH v6 12/12] flow: Derive epoll fd from queue pair, removing epollid field Laurent Vivier
2026-08-03  3:46   ` 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=am_2yEzmQ6krBJe_@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).