Documentation/vhost-user-ovs-dpdk

From QEMU
Revision as of 18:24, 10 September 2015 by Marcel (talk | contribs)

Vhost-user with OVS/DPDK as backend

The purpose of this document is to describe the steps needed to setup a development machine for vhost-user testing. All the information here is taken from various sources available online.

The goal is to connect guests' virtio-net devices having vhost-user backend to OVS dpdkvhostuser ports and be able to run any kind of network traffic between them.

Prerequisites

  • Ensure you have hugepages enabled in kernel command line:
 default_hugepagesz=2M hugepagesz=2M hugepages=1024

DPDK setup

  • Get the sources
git clone git://dpdk.org/dpdk
cd dpdk
  • Edit the configuration file:
diff --git a/config/common_linuxapp b/config/common_linuxapp
index 0de43d5..5260501 100644
--- a/config/common_linuxapp
+++ b/config/common_linuxapp
@@ -81,12 +81,12 @@ CONFIG_RTE_ARCH_STRICT_ALIGN=n
 #
 # Compile to share library
 #
-CONFIG_RTE_BUILD_SHARED_LIB=n
+CONFIG_RTE_BUILD_SHARED_LIB=y

 #
 # Combine to one single library
 #
-CONFIG_RTE_BUILD_COMBINE_LIBS=n
+CONFIG_RTE_BUILD_COMBINE_LIBS=y

 #
 # Use newest code breaking previous ABI
  • Build it
export RTE_SDK=<dpdk_folder>
export RTE_TARGET=x86_64-native-linuxapp-gcc
make -j<cpu num> T=x86_64-native-linuxapp-gcc EXTRA_CFLAGS='-g'
yes | sudo cp -f ./x86_64-native-linuxapp-gcc/lib/libdpdk.so /lib64/libdpdk.so (optional, if ovs is having problems finding the library)

OVS setup

  • Get the sources:
 git clone https://github.com/openvswitch/ovs
 cd ovs
  • Build it:
./boot.sh
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-dpdk=<dpdk dir>/x86_64-native-linuxapp-gcc  --disable-ssl --with-debug  CFLAGS='-g'
make -j <cpu num>

QEMU setup

  • Get the sources:
git://git.qemu.org/qemu.git
cd qemu
  • Build it:
./configure --target-list=x86_64-softmmu --enable-debug --extra-cflags='-g'
make -j <cpu num>