[dpdk-dev] [TEST] vhost pmd for testing vhost-user
Tetsuya Mukawa
mukawa at igel.co.jp
Thu Nov 6 12:29:24 CET 2014
Hi Xie,
I've written vhost PMD to test vhost-user.
This patch may be useful when you test vhost-user.
Here are steps when I test vhost-user.
1. Start testpmd on the host
$ sudo ./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 1 -m 1024 \
--vdev 'eth_vhost0,iface=/tmp/virtq0' \
--vdev 'eth_vhost1,iface=/tmp/virtq1' -- -i
2, Start QEMU like followings.
$ sudo qemu-system-x86_64 -M pc-1.0 -cpu host -m 4096 -smp 4 -enable-kvm \
-drive file=<patch to img>,if=none,id=drive-virtio-disk0,format=raw \
-device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2 \
-object memory-backend-file,id=mem,size=4096M,mem-path=/mnt/huge,share=on \
-numa node,memdev=mem \
-chardev socket,id=chr0,path=/tmp/virtq0,server \
-netdev vhost-user,id=net0,chardev=chr0,vhostforce \
-device virtio-net-pci,netdev=net0 \
-chardev socket,id=chr1,path=/tmp/virtq1,server \
-netdev vhost-user,id=net1,chardev=chr1,vhostforce \
-device virtio-net-pci,netdev=net1 \
-vnc <ipaddr>:2
3. Bind 2 virtio-net devices to igb_uio on the guest.
4. Start testpmd on the guest.
$ sudo ./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 1 -m 1024 -- -i
5. Start forwarding on the guest.
testpmd> start
6. Start forwarding on the host.
testpmd> start tx_first
7. Stop forwading.
Thanks,
Tetsuya
Tetsuya Mukawa (1):
lib/librte_pmd_vhost: Add vhost pmd
config/common_linuxapp | 5 +
lib/Makefile | 1 +
lib/librte_pmd_vhost/Makefile | 57 ++++
lib/librte_pmd_vhost/rte_eth_vhost.c | 487 +++++++++++++++++++++++++++++++++++
lib/librte_pmd_vhost/rte_eth_vhost.h | 55 ++++
mk/rte.app.mk | 4 +
6 files changed, 609 insertions(+)
create mode 100644 lib/librte_pmd_vhost/Makefile
create mode 100644 lib/librte_pmd_vhost/rte_eth_vhost.c
create mode 100644 lib/librte_pmd_vhost/rte_eth_vhost.h
--
1.9.1
More information about the dev
mailing list