From: Laurent Vivier <lvivier@redhat.com>
To: passt-dev@passt.top
Cc: Laurent Vivier <lvivier@redhat.com>
Subject: [PATCH v5 00/12] vhost-user: Add multiqueue support
Date: Tue, 16 Jun 2026 14:51:18 +0200 [thread overview]
Message-ID: <20260616125130.1324274-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)
- 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
- Epoll fd derived directly from queue pair, removing the separate epollid
field and adding flow_migrate() for moving flows between queue pairs
- 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.
v5:
- Rebase
- Dropped "tap: Convert packet pools to per-queue-pair arrays for multiqueue"
- Split "vhost-user: Add queue pair parameter throughout the network stack"
into separate per-protocol patches (tap, arp, tcp, udp, dhcp/dhcpv6,
icmp, ndp) for easier review
- New patch: "flow: Derive epoll fd from queue pair, removing epollid field"
derives epoll fd directly from queue pair, removing the redundant epollid
field and adding flow_migrate()/FLOW_MIGRATE() for existing flows
- tcp_keepalive() and tcp_inactivity() now filter flows by queue pair
- Renamed "vhost-user: Enable multiqueue" to "vhost-user: Advertise
multiqueue support"
v4:
- Rebase
- Added QPAIR_DEFAULT, QPAIR_FROMGUEST_QUEUE(), QPAIR_TOGUEST_QUEUE(), and
QPAIR_FROM_QUEUE() macros to centralize queue pair calculations
- Replaced hardcoded 0 with QPAIR_DEFAULT throughout for clarity
- Set queue pair at flow creation time in icmp_ping_new() and udp_flow_new()
rather than after creation
- Removed vhost-user-specific queue macros (VHOST_USER_TX_QUEUE,
VHOST_USER_IS_QUEUE_TX, VHOST_USER_IS_QUEUE_RX) in favor of generic
QPAIR_* macros for better consistency
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 (12):
tap: Remove pool parameter from tap4_handler() and tap6_handler()
vhost-user: Advertise multiqueue support
test: Add multiqueue support to vhost-user test infrastructure
tap: Thread queue pair through all remaining tap paths
arp: Pass queue pair explicitly through ARP send path
tcp: Pass queue pair explicitly through TCP send path
udp: Pass queue pair explicitly through UDP send path
dhcp/dhcpv6: Pass queue pair explicitly through DHCP send path
icmp: Pass queue pair explicitly through ICMP send path
ndp: Pass queue pair explicitly through NDP send path
flow: Add queue pair tracking to flow management
flow: Derive epoll fd from queue pair, removing epollid field
arp.c | 15 +--
arp.h | 6 +-
dhcp.c | 5 +-
dhcp.h | 2 +-
dhcpv6.c | 12 ++-
dhcpv6.h | 2 +-
flow.c | 66 ++++++++-----
flow.h | 28 ++++--
fwd.c | 4 +-
icmp.c | 29 ++++--
icmp.h | 7 +-
ndp.c | 40 ++++----
ndp.h | 7 +-
passt.c | 27 +++---
passt.h | 8 ++
tap.c | 134 ++++++++++++++------------
tap.h | 21 +++--
tcp.c | 249 ++++++++++++++++++++++++++++++-------------------
tcp.h | 15 +--
tcp_buf.c | 10 +-
tcp_internal.h | 7 +-
tcp_splice.c | 2 +-
tcp_vu.c | 22 +++--
tcp_vu.h | 6 +-
test/lib/setup | 21 +++--
test/run | 23 +++++
udp.c | 45 +++++----
udp.h | 9 +-
udp_flow.c | 27 +++---
udp_flow.h | 4 +-
udp_internal.h | 3 +-
udp_vu.c | 6 +-
udp_vu.h | 3 +-
vhost_user.c | 14 ++-
vhost_user.h | 9 --
virtio.h | 2 +-
vu_common.c | 22 +++--
vu_common.h | 3 +-
38 files changed, 557 insertions(+), 358 deletions(-)
--
2.54.0
next reply other threads:[~2026-06-16 12:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 12:51 Laurent Vivier [this message]
2026-06-16 12:51 ` [PATCH v5 01/12] tap: Remove pool parameter from tap4_handler() and tap6_handler() Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 02/12] vhost-user: Advertise multiqueue support Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 03/12] test: Add multiqueue support to vhost-user test infrastructure Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 04/12] tap: Thread queue pair through all remaining tap paths Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 05/12] arp: Pass queue pair explicitly through ARP send path Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 06/12] tcp: Pass queue pair explicitly through TCP " Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 07/12] udp: Pass queue pair explicitly through UDP " Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 08/12] dhcp/dhcpv6: Pass queue pair explicitly through DHCP " Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 09/12] icmp: Pass queue pair explicitly through ICMP " Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 10/12] ndp: Pass queue pair explicitly through NDP " Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 11/12] flow: Add queue pair tracking to flow management Laurent Vivier
2026-06-16 12:51 ` [PATCH v5 12/12] flow: Derive epoll fd from queue pair, removing epollid field 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=20260616125130.1324274-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).