The vdpa sample application creates vhost-user sockets by using the vDPA backend. vDPA stands for vhost Data Path Acceleration which utilizes virtio ring compatible devices to serve virtio driver directly to enable datapath acceleration. As vDPA driver can help to set up vhost datapath, this application doesn’t need to launch dedicated worker threads for vhost enqueue/dequeue operations.
This section shows the steps of how to start VMs with vDPA vhost-user backend and verify network connection & live migration.
To compile the sample application see Compiling the Sample Applications.
The application is located in the vdpa sub-directory.
./vdpa [EAL options] -- [--client] [--interactive|-i] or [--iface SOCKET_PATH]
where
Take IFCVF driver for example:
./vdpa -c 0x2 -n 4 --socket-mem 1024,1024 \
-w 0000:06:00.3,vdpa=1 -w 0000:06:00.4,vdpa=1 \
-- --interactive
Note
Here 0000:06:00.3 and 0000:06:00.4 refer to virtio ring compatible devices, and we need to bind vfio-pci to them before running vdpa sample.
Then we can create 2 vdpa ports in interactive cmdline.
vdpa> list
device id device address queue num supported features
0 0000:06:00.3 1 0x14c238020
1 0000:06:00.4 1 0x14c238020
2 0000:06:00.5 1 0x14c238020
vdpa> create /tmp/vdpa-socket0 0000:06:00.3
vdpa> create /tmp/vdpa-socket1 0000:06:00.4
qemu-system-x86_64 -cpu host -enable-kvm \
<snip>
-mem-prealloc \
-chardev socket,id=char0,path=<socket_file created in above steps> \
-netdev type=vhost-user,id=vdpa,chardev=char0 \
-device virtio-net-pci,netdev=vdpa,mac=00:aa:bb:cc:dd:ee,page-per-vq=on \
After the VMs launches, we can login the VMs and configure the ip, verify the network connection via ping or netperf.
Note
Suggest to use QEMU 3.0.0 which extends vhost-user for vDPA.
vDPA supports cross-backend live migration, user can migrate SW vhost backend VM to vDPA backend VM and vice versa. Here are the detailed steps. Assume A is the source host with SW vhost VM and B is the destination host with vDPA.
B: <qemu-command-line> -incoming tcp:0:4444 (or other PORT))
A: (qemu) migrate -d tcp:<B ip>:4444 (or other PORT)
A: (qemu) info migrate