From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH v3 0/6] vhost-user: Add multiqueue support
Date: Wed, 3 Dec 2025 19:54:28 +0100 [thread overview]
Message-ID: <20251203185435.582096-1-lvivier@redhat.com> (raw)
This series implements multiqueue support for vhost-user mode, allowing passt
to utilize multiple queue pairs for improved network throughput when used with
multi-CPU guest VMs. While this version uses a single thread for packet
processing, it enables the guest kernel to distribute network traffic across
multiple queues and vCPUs.
The implementation advertises support for up to 16 queue pairs (32 virtqueues)
by setting VIRTIO_NET_F_MQ and VHOST_USER_PROTOCOL_F_MQ feature flags.
Packets are routed to the appropriate RX queue based on which TX queue they
originated from, following the virtio specification's automatic receive
steering requirements.
This series adds:
- Multiqueue capability advertisement (VIRTIO_NET_F_MQ and
VHOST_USER_PROTOCOL_F_MQ features)
- Per-queue-pair packet pools to support concurrent queue operations
- Queue pair parameter throughout the network stack, propagated through all
protocol handlers (TCP, UDP, ICMP, ARP, DHCP, DHCPv6, NDP)
- Flow-aware queue routing that tracks the originating TX queue for each flow
and routes return packets to the corresponding RX queue
- Test coverage with VHOST_USER_MQ environment variable to validate multiqueue
functionality across all protocols (TCP, UDP, ICMP) and services (DHCP, NDP)
Current behavior:
- TX queue selection is controlled by the guest kernel's networking stack
- RX packets are routed to queues based on their associated flows, with the
queue assignment updated on each packet from TX to maintain affinity
- Host-initiated flows (e.g., from socket-side connections) currently default
to queue pair 0
The changes are transparent to single-queue operation - passt/pasta modes and
single-queue vhost-user configurations continue to work unchanged, always
using queue pair 0.
v3:
- Removed --max-qpairs configuration option - multiqueue support is now
always enabled up to 16 queue pairs without requiring explicit configuration
- Replaced "tap: Add queue pair parameter throughout the packet processing
path" with "tap: Convert packet pools to per-queue-pair arrays for
multiqueue" - simplified implementation by converting global pools to arrays
rather than passing pool parameters throughout
- Changed qpair parameter type from int to unsigned int throughout the codebase
- Simplified test infrastructure - queues parameter is always set on netdev,
mq=true added to virtio-net only when VHOST_USER_MQ > 1
- Updated QEMU usage hints to always show multiqueue-capable command line
v2:
- New patch: "tap: Remove pool parameter from tap4_handler() and tap6_handler()"
to clean up unused parameters before adding queue pair parameter
- Changed to one packet pool per queue pair instead of shared pools across
all queue pairs
- Split "multiqueue: Add queue-aware flow management..." into two patches:
- "tap: Add queue pair parameter throughout the packet processing path"
- "flow: Add queue pair tracking to flow management"
- Updated test infrastructure patch with refined implementation
Laurent Vivier (6):
tap: Remove pool parameter from tap4_handler() and tap6_handler()
vhost-user: Enable multiqueue
test: Add multiqueue support to vhost-user test infrastructure
vhost-user: Add queue pair parameter throughout the network stack
tap: Convert packet pools to per-queue-pair arrays for multiqueue
flow: Add queue pair tracking to flow management
arp.c | 15 +++--
arp.h | 6 +-
dhcp.c | 5 +-
dhcp.h | 2 +-
dhcpv6.c | 12 ++--
dhcpv6.h | 2 +-
flow.c | 33 +++++++++
flow.h | 17 +++++
fwd.c | 18 ++---
fwd.h | 5 +-
icmp.c | 25 ++++---
icmp.h | 4 +-
ndp.c | 35 ++++++----
ndp.h | 7 +-
netlink.c | 2 +-
tap.c | 177 ++++++++++++++++++++++++++++---------------------
tap.h | 20 +++---
tcp.c | 47 +++++++------
tcp.h | 7 +-
tcp_vu.c | 8 ++-
test/lib/setup | 21 +++---
test/run | 23 +++++++
udp.c | 47 +++++++------
udp.h | 6 +-
udp_flow.c | 8 ++-
udp_flow.h | 2 +-
udp_internal.h | 4 +-
udp_vu.c | 4 +-
vhost_user.c | 10 +--
virtio.h | 2 +-
vu_common.c | 15 +++--
vu_common.h | 3 +-
32 files changed, 374 insertions(+), 218 deletions(-)
--
2.51.1
next reply other threads:[~2025-12-03 18:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-03 18:54 Laurent Vivier [this message]
2025-12-03 18:54 ` [PATCH v3 1/6] tap: Remove pool parameter from tap4_handler() and tap6_handler() Laurent Vivier
2025-12-05 4:14 ` David Gibson
2025-12-03 18:54 ` [PATCH v3 2/6] vhost-user: Enable multiqueue Laurent Vivier
2025-12-10 0:04 ` David Gibson
2025-12-11 7:01 ` Stefano Brivio
2025-12-11 8:29 ` Laurent Vivier
2025-12-03 18:54 ` [PATCH v3 3/6] test: Add multiqueue support to vhost-user test infrastructure Laurent Vivier
2025-12-10 0:05 ` David Gibson
2025-12-03 18:54 ` [PATCH v3 4/6] vhost-user: Add queue pair parameter throughout the network stack Laurent Vivier
2025-12-11 7:01 ` Stefano Brivio
2025-12-11 8:48 ` Laurent Vivier
2025-12-11 12:16 ` Stefano Brivio
2025-12-11 13:26 ` Laurent Vivier
2025-12-11 15:27 ` Stefano Brivio
2025-12-11 16:06 ` Laurent Vivier
2025-12-03 18:54 ` [PATCH v3 5/6] tap: Convert packet pools to per-queue-pair arrays for multiqueue Laurent Vivier
2025-12-03 18:54 ` [PATCH v3 6/6] flow: Add queue pair tracking to flow management Laurent Vivier
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=20251203185435.582096-1-lvivier@redhat.com \
--to=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).