• Open vSwitch with 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

  • 相关阅读:
    光纤快速连接器如何安装使用?
    数据的IO和复用
    Scala集合习题Ⅱ
    《C和指针》笔记31:多维数组的数组名、指向多维数组的指针、作为函数参数的多维数组
    以太坊合并在即 从社区思想的角度谈 PoW 和 PoS
    04-JS函数
    fast lio 2 保存每一帧的点云PCD和里程计矩阵 Odom 在txt文件
    SSH访问Centos7中文显示乱码
    【python数据分析刷题】-N02.数据索引
    学习java的第二十七天。。。(输入输出流)
  • 原文地址:https://blog.csdn.net/lingshengxiyou/article/details/127870456