Finally managed to run l2fwd with virtio PMD. Providing details as promised.
1. For some reason, when l2fwd is running, virtual screen stops updating. The
system itself is NOT frozen: l2fwd forwards packets, processes can be
launched using QEMU guest agent, input is received and processed. Since this
doesn't happen with different driver and ported upstream DPDK, there is
obviously a software bug either in netUIO or in draft DPDK, not in QEMU.
2. Testing setup
Schematically:
+-------------------+ +-------------------+ +-------------------+
| Linux guest Alice | | Windows guest | | Linux guest Bob |
| | | | | |
| 172.16.0.1/24 | | __l2fwd__ | | 172.16.0.2/24 |
| 02:00:ac:10:00:01 | | / \ | | 02:00:ac:10:00:02 |
| ens4 | | 00:04.0 00:05.0 | | ens4 |
+-------------------+ +-------------------+ +-------------------+
| QEMU dp | | dp0 QEMU dp1 | | dp QEMU |
+-------------------+ +-------------------+ +-------------------+
connect listen listen connect
:10000 :10000 :10001 :10001
Linux host \___________/ \_________/
Windows VM (Windows 10 Pro):
qemu-system-x86_64 \
-enable-kvm -cpu host -smp 'cores=4,sockets=1,threads=1' -m 6G -drive
"file=$disk,format=qcow2" \
-netdev 'socket,listen=:10000,id=dp0' -device
'virtio-net-pci,disable-modern=off,disable-legacy=on,netdev=dp0' \
-netdev 'socket,listen=:10001,id=dp1' -device
'virtio-net-pci,disable-modern=off,disable-legacy=on,netdev=dp1'
Linux VM "Alice" (Debian 10):
qemu-system-x86_64 \
-enable-kvm -cpu host -smp 'cores=2,sockets=1,threads=1' -m 1G drive
"file=$disk,format=qcow2" \
-netdev "socket,connect=:10000,id=dp" -device
'virtio-net-pci,disable-modern=off,disable-legacy=on,netdev=dp'
Linux VM "Bob" (Debian 10):
qemu-system-x86_64 \
-enable-kvm -cpu host -smp 'cores=2,sockets=1,threads=1' -m 1G drive
"file=$disk,format=qcow2" \
-netdev "socket,connect=:10001,id=dp" -device
'virtio-net-pci,disable-modern=off,disable-legacy=on,netdev=dp'
(Note: non-essential QEMU options omitted, like management NIC).
Driver: netUIO + multi-BAR patches from Narcisa + virtio HW ID patch.
DPDK: windpdk-v18.08-clang + PCI patch + patches for virtio.
Endpoint setup:
root@alice# ip link set ens4 address 02:00:ac:10:00:01
root@alice# ip address add 172.16.0.1/24 dev ens4
root@alice# ip link set ens4 up
root@bob# ip link set ens4 address 02:00:ac:10:00:02
root@bob# ip address add 172.16.0.2/24 dev ens4
root@bob# ip link set ens4 up
DUT setup:
Z:\dpdk\x64\Debug\netuio\netuio> pnputil /add-driver netuio.inf /install
Z:\dpdk\x64\Debug\l2fwd> l2fwd.exe -c3 -- -p3 -T1 --no-mac-updating
(display stops updating, exit later with Ctrl+C)
Validate connectivity:
root@alice# ping 172.16.0.2
3. Patch instruction is a bit involved:
* Base on windpdk-v18.08-clang.
* Import drivers/net/virtio from v18.08 (not attached due to size).
* Apply windpdk-virtio-1.patch (attached).
* Apply multi-BAR patches (not attached due to not being mine).
* Apply windpdk-virtio-2.patch (attached).
There is one patch in windpdk-virtio-2.patch that splits PCI config I/O of
arbitrary size to a series of 4/2/1 accesses. It is implemented in user-mode
because it was easier to debug, but maybe it should be moved to netUIO, so
that any region of PCI config space can be read/written in a single syscall.
--
Dmitry Kozlyuk