当前位置:   article > 正文

Open vSwitch with DPDK_openvswitch dpdk

openvswitch dpdk

This document describes how to build and install Open vSwitch using a DPDK datapath. Open vSwitch can use the DPDK library to operate entirely in userspace.

Important

The releases FAQ lists support for the required versions of DPDK for each version of Open vSwitch. If building OVS and DPDK outside of the master build tree users should consult this list first.

Build requirements

In addition to the requirements described in Open vSwitch on Linux, FreeBSD and NetBSD, building Open vSwitch with DPDK will require the following:

  • DPDK 19.11

  • DPDK supported NIC

    Only required when physical ports are in use

  • A suitable kernel

    On Linux Distros running kernel version >= 3.0, only IOMMU needs to enabled via the grub cmdline, assuming you are using VFIO. For older kernels, ensure the kernel is built with UIOHUGETLBFSPROC_PAGE_MONITORHPETHPET_MMAP support. If these are not present, it will be necessary to upgrade your kernel or build a custom kernel with these flags enabled.

Detailed system requirements can be found at DPDK requirements.

Installing

Install DPDK

  1. Download the DPDK sources, extract the file and set DPDK_DIR:

    $ cd /usr/src/
    $ wget https://fast.dpdk.org/rel/dpdk-19.11.tar.xz
    $ tar xf dpdk-19.11.tar.xz
    $ export DPDK_DIR=/usr/src/dpdk-19.11
    $ cd $DPDK_DIR
    
  2. (Optional) Configure DPDK as a shared library

    DPDK can be built as either a static library or a shared library. By default, it is configured for the former. If you wish to use the latter, set CONFIG_RTE_BUILD_SHARED_LIB=y in $DPDK_DIR/config/common_base.

    Note

    Minor performance loss is expected when using OVS with a shared DPDK library compared to a static DPDK library.

  3. Configure and install DPDK

    Build and install the DPDK library:

    $ export DPDK_TARGET=x86_64-native-linuxapp-gcc
    $ export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET
    $ make install T=$DPDK_TARGET DESTDIR=install
    
  4. (Optional) Export the DPDK shared library location

    If DPDK was built as a shared library, export the path to this library for use when building OVS:

    $ export LD_LIBRARY_PATH=$DPDK_DIR/x86_64-native-linuxapp-gcc/lib
    

Install OVS

OVS can be installed using different methods. For OVS to use DPDK, it has to be configured to build against the DPDK library (--with-dpdk).

Note

This section focuses on generic recipe that suits most cases. For distribution specific instructions, refer to one of the more relevant guides.

  1. Ensure the standard OVS requirements, described in Build Requirements, are installed

  2. Bootstrap, if required, as described in Bootstrapping

  3. Configure the package using the --with-dpdk flag:

    $ ./configure --with-dpdk=$DPDK_BUILD
    

    where DPDK_BUILD is the path to the built DPDK library. This can be skipped if DPDK library is installed in its default location.

    If no path is provided to --with-dpdk, but a pkg-config configuration for libdpdk is available the include paths will be generated via an equivalent pkg-config --cflags libdpdk.

    Note

    While --with-dpdk is required, you can pass any other configuration option described in Configuring.

  4. Build and install OVS, as described in Building

Additional information can be found in Open vSwitch on Linux, FreeBSD and NetBSD.

Note

If you are running using the Fedora or Red Hat package, the Open vSwitch daemon will run as a non-root user. This implies that you must have a working IOMMU. Visit the RHEL README for additional information.

Setup

Setup Hugepages

Allocate a number of 2M Huge pages:

  • For persistent allocation of huge pages, write to hugepages.conf file in /etc/sysctl.d:

    $ echo 'vm.nr_hugepages=2048' > /etc/sysctl.d/hugepages.conf
    
  • For run-time allocation of huge pages, use the sysctl utility:

    $ sysctl -w vm.nr_hugepages=N  # where N = No. of 2M huge pages
    

To verify hugepage configuration:

$ grep HugePages_ /proc/meminfo

Mount the hugepa

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/119946
推荐阅读
相关标签
  

闽ICP备14008679号