• 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

  • 相关阅读:
    安卓APP源码和报告——学生信息管理系统
    【SpringBoot笔记14】SpringBoot框架之RestTemplate对象及其常用方法
    【MySQL集群一】CentOS 7上搭建MySQL集群:一主一从、多主多从
    我的小程序接口被刷爆了
    设计模式 - 适配器模式
    Frp内网穿透win系统实录
    数据库实验二:图书信息管理系统数据查询与数据更新
    用DIV+CSS技术设计的个人电影网站(web前端网页制作课作业)
    python面试学习
    LangGPT作者教你编写高质量提示词
  • 原文地址:https://blog.csdn.net/lingshengxiyou/article/details/127870456