• 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

  • 相关阅读:
    ES本地分片逆文档频率评分策略(Shard Local IDF)导致的评分异常原理解析
    谈谈你对Promise的理解
    手机银行体验性测试:如何获取用户真实感受
    ShardingSphere学习(超详细)
    SpringBoot 整合RabbitMQ 之延迟队列实验
    数制与逻辑代数
    PC端小程序引擎,或许不就未来能解决桌面应用兼容性
    Qt扫盲-QSqlRelationalTableModel 理论总结
    深入了解快速排序:原理、性能分析与 Java 实现
    Python串口小结1
  • 原文地址:https://blog.csdn.net/lingshengxiyou/article/details/127870456