This is Chapter 1 of the blog series: Open vSwitch with DPDK on Arm. This blog describes how to build and install OvS with DPDK from source on Arm platforms. The high-level steps, in order, are:
The official OvS documentation installs DPDK under /usr/src and all the OvS files under /usr/local by default. In this blog, I install DPDK and OvS in my home directory instead and highlight those steps which have been modified for this purpose.
1. System Requirements: Ensure that the following packages have been installed on the system. If not, you can install them with the following command:
$ sudo apt install build-essential git libnuma-dev libncurses5-dev bc device-tree-compiler dh-autoreconf pciutils psmisc curl libssl
2. Build Requirements: Check for the following build requirements on the system. Install/upgrade the packages if needed
Before proceeding to install DPDK and consequently OvS, it is important to check which DPDK version builds successfully against the latest version of OvS. At the time of writing this blog, OvS version 2.13.90 builds successfully against DPDK version 19.11. You can check the latest version compatibility at this Releases page.
1. Download the DPDK sources and untar the files.
$ wget http://fast.dpdk.org/rel/dpdk-19.11.tar.xz
$ tar xf dpdk-19.11.tar.xz
2. Create the configuration file. DPDK has different configurations available for different Arm-based platforms — ThunderX, ThunderX2, Octeon-Tx2, Bluefield and, N1SDP. Please choose the appropriate one for your platform as they would yield the most optimal performance for that platform. If you are not able to find a config file specific to your platform, the fallback option is to use 'arm64-armv8a-linuxapp-gcc'.
$ cd $HOME/dpdk-19.11/config
$ ls | grep arm64
Since my platform is N1SDP, I will use the platform specific config for it.
$ cd $HOME/dpdk-19.11
$ make config T=arm64-n1sdp-linuxapp-gcc
3. Build and install DPDK library.
$ cd $HOME/dpdk-19.11
$ export RTE_SDK=$HOME/dpdk-19.11
$ export RTE_TARGET=arm64-n1sdp-linuxapp-gcc
$ make -j32 install T=$RTE_TARGET DESTDIR=install
1. Clone the latest version of OvS on the system.
$ git clone https://github.com/openvswitch/ovs.git
As an alternate, you can download the most recent version of the tarball available in the Download section.
$ wget https://www.openvswitch.org/releases/openvswitch-2.12.0.tar.gz
$ tar xvf openvswitch-2.12.0.tar.gz
2. Since I cloned OvS from the Git repository, I need to run boot.sh in the top source directory to build the configure script. This step can be skipped if a released tarball was downloaded instead.
$ cd $HOME/ovs
3. The OvS official documentation provides steps which install all the files under /usr/local. But, as noted before, I will do the OvS with DPDK installation in my home directory. As a result, I create usr, var, and etc directories in my home directory so that at the time of configuration, I can use the appropriate flags to install these files in my home directory instead.
$ mkdir -p usr var etc
4. OvS must be configured with the --dpdk flag to use DPDK datapath. The flag should point to the path where the DPDK library has been built. By default, OvS also expects to find its database in /usr/local/etc/openvswitch. Since I am installing all the executables into my home directory instead, that is, $HOME/usr and $HOME/var instead of /usr/local and /usr/local/var and expect to use $HOME/etc/openvswitch as the default database directory, the configuration is modified accordingly. I have also disabled OpenSSL support by passing the --disable-ssl parameter.
$ export DPDK_BUILD=$RTE_SDK/$RTE_TARGET
$ cd $HOME/ovs
$ sudo ./configure --with-dpdk=$DPDK_BUILD --prefix=$HOME/usr --localstatedir=$HOME/var --sysconfdir=$HOME/etc --disable-ssl
5. Run make.
$ sudo make -j32
6. Run make install to install the executables and manpages into the system. They will now be installed under $HOME/usr/lib.
$ sudo make -j32 install
This blog provided a step-by-step tutorial of how to build and install OvS with DPDK from source. I have demonstrated the procedure using my home directory as the default database directory while the official OvS documentation shows the steps for installation under /usr/local. But in reality, choosing /usr/local or your home directory to install OvS is a personal choice. If you want OvS to be available to all users of the platform, it would be worthwhile to install it in /usr/local.
Another noteworthy point highlighted in this tutorial is to configure DPDK to use the Arm-specific configuration file. This will ensure that certain platform-specific optimizations are enabled by the compiler so that the most optimized performance is obtained on that platform.
If you wish to setup OvS with DPDK for performance benchmarking, check out the following blogs in this series:
Setup for PHY-PHY Test
Setup for PHY-VM-PHY (vHost Loopback) Test
Previous Blog in Series Next Blog in Series