Skip to content

net: Add passt netdev backend

Laurent Vivier qemu-devel 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest11 patches 0 repliesNew
  2. v311 patches 1 replySuperseded
  3. v210 patches 12 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v18 patches4 repliesSuperseded

Changes in v4 from the cover letter

- back to v2 parameters (except debug and trace parameters) + v3 generic "param"
- update documentation

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11net: Refactor stream logic for reuse in '-net passt'net/meson.build net/stream.c net/stream_data.c +1 more+290 -2190 replies
2/11net: Define net_client_set_link()include/net/net.h net/net.c net/vhost-user.c+23 -140 replies
3/11vhost_net: Rename vhost_set_vring_enable() for clarityhw/net/vhost_net-stub.c hw/net/vhost_net.c hw/net/virtio-net.c +1 more+6 -60 replies
4/11net: Add get_vhost_net callback to NetClientInfohw/net/vhost_net.c include/net/net.h include/net/tap.h +6 more+24 -470 replies
5/11net: Consolidate vhost feature bits into vhost_net structurehw/net/vhost_net.c include/hw/virtio/vhost.h include/net/vhost-vdpa.h +4 more+69 -900 replies
6/11net: Add get_acked_features callback to VhostNetOptionshw/net/vhost_net.c include/net/vhost-user.h include/net/vhost_net.h +3 more+10 -70 replies
7/11net: Add save_acked_features callback to vhost_nethw/net/vhost_net-stub.c hw/net/vhost_net.c include/hw/virtio/vhost.h +6 more+13 -250 replies
8/11net: Allow network backends to advertise max TX queue sizehw/net/vhost_net.c hw/net/virtio-net.c include/hw/virtio/vhost.h +4 more+18 -120 replies
9/11net: Add is_vhost_user flag to vhost_net structhw/net/vhost_net.c hw/net/virtio-net.c include/hw/virtio/vhost.h +4 more+13 -30 replies
10/11net: Add passt network backenddocs/system/devices/net.rst hmp-commands.hx meson.build +9 more+731 -40 replies
11/11net/passt: Implement vhost-user backend supportdocs/system/devices/net.rst net/passt.c qapi/net.json +1 more+369 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 00/11] net: Add passt netdev backend

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

The purpose of this new backend is to help to use passt daemon as easily as the user backend ('-nic passt' as we have '-nic user'). All the passt functionalities will not be available to keep it simple, and the goal is not to be supported by libvirt, as in these cases the best way to use passt will be to use stream or vhost-user backend with an externaly started passt daemon.

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 and vhost-net, 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

v4:
- back to v2 parameters (except debug and trace parameters) + v3 generic "param"
- update documentation

v3:
- tested with
-nic passt
and
-nic passt,model=virtio,vhost-user=on

and fixed passt_check_peer_type()
- moved new fields from NetClientInfo to vhost-net struct
- Remove most of the hardcoded parameters to introduce a generic "param" parameter, like:
-nic passt,param=--tcp-ports=10001,param=--udp-ports=10001
- added patches:
vhost_net: Rename vhost_set_vring_enable() for clarity
net: Add is_vhost_user flag to vhost_net struct
(this one replaces "net: Introduce helper to identify vhost-user clients")
- update documentation

v2:
- rebase:
fix conflict with
837b87c4c5ba ("net/stream: skip automatic zero-init of large array")
- 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 (11):
net: Refactor stream logic for reuse in '-net passt'
net: Define net_client_set_link()
vhost_net: Rename vhost_set_vring_enable() for clarity
net: Add get_vhost_net callback to NetClientInfo
net: Consolidate vhost feature bits into vhost_net structure
net: Add get_acked_features callback to VhostNetOptions
net: Add save_acked_features callback to vhost_net
net: Allow network backends to advertise max TX queue size
net: Add is_vhost_user flag to vhost_net struct
net: Add passt network backend
net/passt: Implement vhost-user backend support

 docs/system/devices/net.rst   |  50 ++-
 hmp-commands.hx               |   3 +
 hw/net/vhost_net-stub.c       |   3 +-
 hw/net/vhost_net.c            | 145 +------
 hw/net/virtio-net.c           |  36 +-
 include/hw/virtio/vhost.h     |   5 +
 include/net/net.h             |   3 +
 include/net/tap.h             |   3 -
 include/net/vhost-user.h      |  19 -
 include/net/vhost-vdpa.h      |   4 -
 include/net/vhost_net.h       |  10 +-
 meson.build                   |   6 +
 meson_options.txt             |   2 +
 net/clients.h                 |   4 +
 net/hub.c                     |   3 +
 net/meson.build               |   6 +-
 net/net.c                     |  36 +-
 net/passt.c                   | 753 ++++++++++++++++++++++++++++++++++
 net/stream.c                  | 282 +++----------
 net/stream_data.c             | 193 +++++++++
 net/stream_data.h             |  31 ++
 net/tap-win32.c               |   5 -
 net/tap.c                     |  43 +-
 net/vhost-user-stub.c         |   1 -
 net/vhost-user.c              |  60 ++-
 net/vhost-vdpa.c              |  11 +-
 qapi/net.json                 | 118 ++++++
 qemu-options.hx               | 153 ++++++-
 scripts/meson-buildoptions.sh |   3 +
 29 files changed, 1564 insertions(+), 427 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
Signature · 1 line
2.49.0