ADC

Configure a Citrix ADC VPX instance on KVM to use OVS DPDK-based host interfaces

You can configure a Citrix ADC VPX instance running on KVM (Fedora and RHOS) to use Open vSwitch (OVS) with Data Plane Development Kit (DPDK) for better network performance. This document describes how to configure the Citrix ADC VPX instance to operate on thevhost-userports exposed by OVS-DPDK on the KVM host.

OVSis a multilayer virtual switch licensed under the open-source Apache 2.0 license.DPDKis a set of libraries and drivers for fast packet processing.

The following Fedora, RHOS, OVS, and DPDK versions are qualified for configuring a Citrix ADC VPX instance:

Fedora RHOS
Fedora 25 RHOS 7.4
OVS 2.7.0 OVS 2.6.1
DPDK 16.11.12 DPDK 16.11.12

Prerequisites

Before you install DPDK, make sure the host has 1 GB huge pages.

For more information, see thisDPDK system requirements documentation. Here is a summary of the steps required to configure a Citrix ADC VPX instance on KVM to use OVS DPDK-based host interfaces:

  • Install DPDK.
  • Build and Install OVS.
  • Create an OVS bridge.
  • Attach a physical interface to the OVS bridge.
  • Attachvhost-userports to the OVS data path.
  • Provision a KVM-VPX with OVS-DPDK basedvhost-userports.

Install DPDK

To install DPDK, follow the instruction given at thisOpen vSwitch with DPDKdocument.

Build and install OVS

Download OVS from the OVSdownload page. Next, build, and install OVS by using a DPDK datapath. Follow the instructions given in theInstalling Open vSwitchdocument.

For more detailed information,DPDK Getting Started Guide for Linux.

Create an OVS bridge

Depending on your need, type the Fedora or RHOS command to create an OVS bridge:

Fedora command:

> $OVS_DIR/utilities/ovs-vsctl add-br ovs-br0 -- set bridge ovs-br0 datapath_type=netdev 

RHOS command:

ovs-vsctl add-br ovs-br0 -- set bridge ovs-br0 datapath_type=netdev 

Attach the physical interface to the OVS bridge

Bind the ports to DPDK and then attach them to the OVS bridge by typing the following Fedora or RHOS commands:

Fedora command:

> $OVS_DIR/utilities/ovs-vsctl add-port ovs-br0 dpdk0 -- set Interface dpdk0 type=dpdk options:dpdk-devargs=0000:03:00.0 > $OVS_DIR/utilities/ovs-vsctl add-port ovs-br0 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=0000:03:00.1 

RHOS command:

ovs-vsctl add-port ovs-br0 dpdk0 -- set Interface dpdk0 type=dpdk options:dpdk-devargs=0000:03:00.0 ovs-vsctl add-port ovs-br0 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=0000:03:00.1 

Thedpdk-devargsshown as part of the options specifies the PCI BDF of the respective physical NIC.

Attachvhost-userports to the OVS data path

Type the following Fedora or RHOS commands to attachvhost-userports to the OVS data path:

Fedora command:

> $OVS_DIR/utilities/ovs-vsctl add-port ovs-br0 vhost-user1 -- set Interface vhost-user1 type=dpdkvhostuser -- set Interface vhost-user1 mtu_request=9000 > $OVS_DIR/utilities/ovs-vsctl add-port ovs-br0 vhost-user2 -- set Interface vhost-user2 type=dpdkvhostuser -- set Interface vhost-user2 mtu_request=9000 chmod g+w /usr/local/var/run/openvswitch/vhost* 

RHOS command:

ovs-vsctl add-port ovs-br0 vhost-user1 -- set Interface vhost-user1 type=dpdkvhostuser -- set Interface vhost-user1 mtu_request=9000 ovs-vsctl add-port ovs-br0 vhost-user2 -- set Interface vhost-user2 type=dpdkvhostuser -- set Interface vhost-user2 mtu_request=9000 chmod g+w /var/run/openvswitch/vhost* 

Provision a KVM-VPX with OVS-DPDK-basedvhost-userports

You can provision a VPX instance on Fedora KVM with OVS-DPDK-basedvhost-userports only from the CLI by using the following QEMU commands:Fedora command:

qemu-system-x86_64 -name KVM-VPX -cpu host -enable-kvm -m 4096M \ -object memory-backend-file,id=mem,size=4096M,mem-path=/dev/hugepages,share=on -numa node,memdev=mem \ -mem-prealloc -smp sockets=1,cores=2 -drive file=,if=none,id=drive-ide0-0-0,format= \ -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -netdev type=tap,id=hostnet0,script=no,downscript=no,vhost=on \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:3c:d1:ae,bus=pci.0,addr=0x3 \ -chardev socket,id=char0,path= \ -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1,mrg_rxbuf=on \ -chardev socket,id=char1,path= \ -netdev type=vhost-user,id=mynet2,chardev=char1,vhostforce -device virtio-net pci,mac=00:00:00:00:00:02,netdev=mynet2,mrg_rxbuf=on \ --nographic 

For RHOS, use the following sample XML file to provision the Citrix ADC VPX instance, by usingvirsh.

<域类型=“kvm”> <名称> dpdk-vpx1 < /名称> < uuid >edb844b-f6bc-48e6-a4c6-36577f2d68d6 16777216 16777216      6  4096           /machine   hvm        Haswell-noTSX Intel       dpdk-vpx1 aedb844b-f6bc-48e6-a4c6-36577f2d68d6 16777216 16777216      6  4096           /machine   hvm        Haswell-noTSX Intel              destroy restart destroy  /usr/libexec/qemu-kvm     

Points to note

In the XML file, thehugepagesize must be 1 GB, as shown in the sample file.

    

Also, in the sample file vhost-user1 is thevhostuser port bound to ovs-br0.

    

To bring up the Citrix ADC VPX instance, start using thevirshcommand.

Configure a Citrix ADC VPX instance on KVM to use OVS DPDK-based host interfaces