[ovs-dev] [PATCH v6 1/2] doc: Refactor DPDK install documentation

Bodireddy, Bhanuprakash bhanuprakash.bodireddy at intel.com
Tue Jun 7 20:52:52 UTC 2016


Thanks Mauricio for your comments, My comments inline.

>+  it has to be configured with DPDK support and is done by './configure --
>with-dpdk'.
>+  This section focus on generic recipe that suits most cases and for
>distribution
>+  specific instructions, refer [INSTALL.Fedora.md], [INSTALL.RHEL.md] and
>+  [INSTALL.Debian.md].
>
>-9. Rx Mergeable buffers
>+  OVS can be downloaded in compressed format from the OVS release page
>(or)
>+  cloned from git repository if user intends to develop and contribute
>+  patches upstream.
>
> I think it is better just to have one download method, it keeps things simple.

[BHANU] This is done for a reason.  Most of the users would like to work on a stable release and few would be working on the master branch.
One section covers downloading the stable release as compressed file. This section would be updated once 2.6 is released.
Other section comes handy for users working on master.

>
>
>-   Rx Mergeable buffers is a virtio feature that allows chaining of multiple
>-   virtio descriptors to handle large packet sizes. As such, large packets
>-   are handled by reserving and chaining multiple free descriptors
>-   together. Mergeable buffer support is negotiated between the virtio
>-   driver and virtio device and is supported by the DPDK vhost library.
>-   This behavior is typically supported and enabled by default, however
>-   in the case where the user knows that rx mergeable buffers are not
>needed
>
>-DPDK vhost:
>------------
>+### 3.2 Setup DPDK devices using VFIO
>
>-DPDK 16.04 supports two types of vhost:
>+  - Supported with DPDK release >= 1.7 and kernel version >= 3.6
>
>It is already mentioned that DPDK 16.04 is required, then the comment about
>the DPDK version is not necessary.

[OK]

>
>
>+  - VFIO needs support from BIOS and kernel.
>+  - BIOS changes:
>
>-1. vhost-user
>-2. vhost-cuse
>+    Enable VT-d, can be verified from `dmesg | grep -e DMAR -e IOMMU`
>output
>
>-Whatever type of vhost is enabled in the DPDK build specified, is the type
>-that will be enabled in OVS. By default, vhost-user is enabled in DPDK.
>-Therefore, unless vhost-cuse has been enabled in DPDK, vhost-user ports
>-will be enabled in OVS.
>-Please note that support for vhost-cuse is intended to be deprecated in OVS
>-in a future release.
>
>-1. DPDK 16.04 with vhost support enabled as documented in the "Building
>and
>-   Installing section"
>+  Note: If using older DPDK release (or) running kernels < 3.6 UIO drivers to
>be used,
>
>Same here for DPDK version
[OK]

>
>+  please check section 4 (DPDK devices using UIO) for the steps.
>
>-2. QEMU version v2.1.0+
>+### 3.3 Setup OVS
>
>-   QEMU v2.1.0 will suffice, but it is recommended to use v2.2.0 if providing
>-   your VM with memory greater than 1GB due to potential issues with
>memory
>-   mapping larger areas.
>+  1. DB creation (One time step)
>
>
>-DPDK vhost-cuse VM configuration:
>----------------------------------
>+DPDK 'testpmd' application can be run in the Guest VM for high speed
>+packet forwarding between vhostuser ports. This needs DPDK, testpmd to
>be
>+compiled along with kernel modules.
>
>I think that sentence is not clear. What do you mean by "testpmd to be
>compiled along with kernel modules"  ?

[BHANU] This has to reworded.  I meant DPDK should be compiled and UIO module to be loaded to support Userspace IO for DPDK. 

>Below are the steps for setting up
>+the testpmd application in the VM. More information on the vhostuser ports
>+can be found in [Vhost Walkthrough].
>
>-   vhost-cuse ports use a Linux* character device to communicate with QEMU.
>-   By default it is set to `/dev/vhost-net`. It is possible to reuse this
>-   standard device for DPDK vhost, which makes setup a little simpler but it
>-   is better practice to specify an alternative character device in order to
>-   avoid any conflicts if kernel vhost is to be used in parallel.
>+  * Instantiate the Guest
>
>-1. This step is only needed if using an alternative character device.
>+  ```
>+  Qemu version >= 2.2.0
>
>-   The new character device filename must be specified in the ovsdb:
>+  export VM_NAME=Centos-vm
>+  export GUEST_MEM=3072M
>+  export QCOW2_IMAGE=/root/CentOS7_x86_64.qcow2
>+  export VHOST_SOCK_DIR=/usr/local/var/run/openvswitch
>
>-        `./utilities/ovs-vsctl --no-wait set Open_vSwitch . \
>-                          other_config:cuse-dev-name=my-vhost-net`
>+  qemu-system-x86_64 -name $VM_NAME -cpu host -enable-kvm -m
>$GUEST_MEM -object memory-backend-
>file,id=mem,size=$GUEST_MEM,mem-path=/dev/hugepages,share=on -
>numa node,memdev=mem -mem-prealloc -smp sockets=1,cores=2 -drive
>file=$QCOW2_IMAGE -chardev
>socket,id=char0,path=$VHOST_SOCK_DIR/dpdkvhostuser0 -netdev
>type=vhost-user,id=mynet1,chardev=char0,vhostforce -device virtio-net-
>pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=off -chardev
>socket,id=char1,path=$VHOST_SOCK_DIR/dpdkvhostuser1 -netdev
>type=vhost-user,id=mynet2,chardev=char1,vhostforce -device virtio-net-
>pci,mac=00:00:00:00:00:02,netdev=mynet2,mrg_rxbuf=off --nographic -
>snapshot
>
>I would remove all the things that are not exclusively related to vhost user
>ports, for example "-name", "--nographic", "--snapshot". I am not sure if
>putting the disk image is a good idea.

[BHANU] Please treat the above as an example configuration to get the VM instantiated for someone unfamiliar with this environment.  Effort is made to explain the parameters in vhost walkthrough section of Advanced Guide in detail.  Really appreciate your attention to detail. 

>
>+  ```
>
>-   In the example above, the character device to be used will be
>-   `/dev/my-vhost-net`.
>+  * Copy the DPDK Srcs to VM and build DPDK
>
>-2. This step is only needed if reusing the standard character device. It will
>-   conflict with the kernel vhost character device so the user must first
>-   remove it.
>+  ```
>+  cd /root/dpdk/
>+  wget http://dpdk.org/browse/dpdk/snapshot/dpdk-16.04.zip
>+  unzip dpdk-16.04.zip
>+  export DPDK_DIR=/root/dpdk/dpdk-16.04
>+  cd $DPDK_DIR
>+  export DPDK_TARGET=x86_64-native-linuxapp-gcc
>+  export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
>+  make install T=$DPDK_TARGET DESTDIR=install
>+  ```
>
>-       `rm -rf /dev/vhost-net`
>+  * Build the test-pmd application
>
>-3a. Configure virtio-net adaptors:
>-   The following parameters must be passed to the QEMU binary:
>+  ```
>+  cd app/test-pmd
>+  make
>
>I am asking without trying it first, Is not it necessary to set RTE_TARGET and
>RTE_SDK before running make?

[BHANU] One has to set RTE_SDK and RTE_TARGET, will add that.

>
>+  ```
>
>-     ```
>-     -netdev tap,id=<id>,script=no,downscript=no,ifname=<name>,vhost=on
>-     -device virtio-net-pci,netdev=net1,mac=<mac>
>-     ```
>+  * Setup Huge pages and DPDK devices using UIO
>
>
>-Now you may launch your VM using virt-manager, or like so:
>+       # Add flows
>+       ovs-ofctl add-flow br0 idle_timeout=0,in_port=1,action=output:3
>+       ovs-ofctl add-flow br0 idle_timeout=0,in_port=3,action=output:1
>+       ovs-ofctl add-flow br0 idle_timeout=0,in_port=4,action=output:2
>+       ovs-ofctl add-flow br0 idle_timeout=0,in_port=2,action=output:4
>
>What is  "idle_timeout=0" for?, is this strictly necessary?

[BHANU] This isn't mandatory, but a value of '0' will prevent a  flow from expiring.

Regards,
Bhanuprakash.

>
>
>Regards,
>Mauricio V,


More information about the dev mailing list