qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] net: Add passt netdev backend
@ 2025-06-18 15:57 Laurent Vivier
  2025-06-18 15:57 ` [PATCH v2 01/10] net: Refactor stream logic for reuse in '-net passt' Laurent Vivier
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Laurent Vivier @ 2025-06-18 15:57 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Philippe Mathieu-Daudé,
	Daniel P. Berrangé, Markus Armbruster, Stefan Weil,
	Stefano Garzarella, Jason Wang, Michael S. Tsirkin,
	Dr. David Alan Gilbert, Eric Blake, Paolo Bonzini, Laurent Vivier

This series introduces support for passt as a new network backend for
QEMU.

passt is a modern, unprivileged, user-mode networking solution that
provides guest connectivity by launching an external helper process. This
series adds the core backend and integrates it with vhost-user for
high-performance, accelerated networking.

The series is structured to first improve the general networking code
before adding the new feature. The first patch extracts from the stream
backend the functions that will be reused in the passt backend. The
following patches are a preparatory refactoring to decouple the generic
vhost layer from specific backend implementations (tap, vhost-user, etc.).
This is achieved by replacing hardcoded type checks with a callback-based
system in NetClientInfo, making the vhost infrastructure more modular and
extensible.

With the refactoring in place, subsequent patches introduce the passt
backend itself, reusing the generic stream handling logic. The final
patch adds vhost-user support to passt, which plugs cleanly into the
newly refactored vhost layer.

Some benchmarks:

 Reference '-net user':

  -net user,hostfwd=tcp::10001-:10001

    iperf3 -c localhost -p 10001  -t 60 -4

    [ ID] Interval           Transfer     Bitrate         Retr
    [  5]   0.00-60.00  sec  14.2 GBytes  2.03 Gbits/sec    1            sender
    [  5]   0.00-60.00  sec  14.2 GBytes  2.03 Gbits/sec                  receiver

 New backend '-netdev passt'

  -netdev passt,vhost-user=off,tcp-ports=10001

    iperf3 -c localhost -p 10001  -t 60 -4

    [ ID] Interval           Transfer     Bitrate         Retr
    [  5]   0.00-60.00  sec  27.1 GBytes  3.88 Gbits/sec    0            sender
    [  5]   0.00-60.03  sec  27.1 GBytes  3.88 Gbits/sec                  receiver

  -netdev passt,vhost-user=on,tcp-ports=10001

    iperf3 -c localhost -p 10001  -t 60 -4

    [ ID] Interval           Transfer     Bitrate         Retr
    [  5]   0.00-60.00  sec   224 GBytes  32.1 Gbits/sec    4            sender
    [  5]   0.00-60.05  sec   224 GBytes  32.0 Gbits/sec                  receiver

v2:
  - rebase:
      fix conflict with
        837b87c4c5ba ("net/stream: skip automatic zero-init of large array")
        (why is this needed? A buffer on a stack is normally not initialized...)
  - add path parameter to provide path of passt if it is not in PATH
  - add 2 patches:
        "net: Allow network backends to advertise max TX queue size"
        "net: Consolidate vhost feature bits into NetClientInfo"

Thanks,
Laurent

Laurent Vivier (10):
  net: Refactor stream logic for reuse in '-net passt'
  net: Define net_client_set_link()
  net: Introduce helper to identify vhost-user clients
  net: Add get_vhost_net callback to NetClientInfo
  net: Consolidate vhost feature bits into NetClientInfo
  net: Add get_acked_features callback to NetClientInfo
  net: Add save_acked_features callback to NetClientInfo
  net: Allow network backends to advertise max TX queue size
  net: Add passt network backend
  net/passt: Implement vhost-user backend support

 hmp-commands.hx          |   3 +
 hw/net/vhost_net-stub.c  |   1 -
 hw/net/vhost_net.c       | 139 +------
 hw/net/virtio-net.c      |  18 +-
 include/net/net.h        |  14 +
 include/net/tap.h        |   3 -
 include/net/vhost-user.h |  19 -
 include/net/vhost-vdpa.h |   4 -
 meson.build              |   6 +
 meson_options.txt        |   2 +
 net/clients.h            |   4 +
 net/hub.c                |   3 +
 net/meson.build          |   6 +-
 net/net.c                |  55 ++-
 net/passt.c              | 768 +++++++++++++++++++++++++++++++++++++++
 net/stream.c             | 282 ++++----------
 net/stream_data.c        | 193 ++++++++++
 net/stream_data.h        |  31 ++
 net/tap-win32.c          |   5 -
 net/tap.c                |  39 +-
 net/vhost-user-stub.c    |   1 -
 net/vhost-user.c         |  66 +++-
 net/vhost-vdpa.c         |  10 +-
 qapi/net.json            | 124 +++++++
 qemu-options.hx          |  18 +
 25 files changed, 1399 insertions(+), 415 deletions(-)
 delete mode 100644 include/net/vhost-user.h
 create mode 100644 net/passt.c
 create mode 100644 net/stream_data.c
 create mode 100644 net/stream_data.h

-- 
2.49.0




^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-07-03 10:27 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 15:57 [PATCH v2 00/10] net: Add passt netdev backend Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 01/10] net: Refactor stream logic for reuse in '-net passt' Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 02/10] net: Define net_client_set_link() Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 03/10] net: Introduce helper to identify vhost-user clients Laurent Vivier
2025-07-01  1:36   ` Jason Wang
2025-06-18 15:57 ` [PATCH v2 04/10] net: Add get_vhost_net callback to NetClientInfo Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 05/10] net: Consolidate vhost feature bits into NetClientInfo Laurent Vivier
2025-07-01  1:39   ` Jason Wang
2025-06-18 15:57 ` [PATCH v2 06/10] net: Add get_acked_features callback to NetClientInfo Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 07/10] net: Add save_acked_features " Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 08/10] net: Allow network backends to advertise max TX queue size Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 09/10] net: Add passt network backend Laurent Vivier
2025-06-24  8:16   ` Markus Armbruster
2025-06-24  8:37     ` Laurent Vivier
2025-06-24 11:55       ` Markus Armbruster
2025-06-24 12:03         ` Daniel P. Berrangé
2025-06-24 12:47           ` Laurent Vivier
2025-06-25  6:57             ` Markus Armbruster
2025-06-30 14:22               ` Stefano Brivio
2025-07-01  1:46   ` Jason Wang
2025-07-01 13:00     ` Laurent Vivier
2025-07-03 10:27       ` Stefano Brivio
2025-06-18 15:57 ` [PATCH v2 10/10] net/passt: Implement vhost-user backend support Laurent Vivier

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 NNTP newsgroup(s).