11 Before starting, a few notes:
13 * in our configuration we use only DPDK 18.02, since with the newer versions, such as DPDK 18.05, we obtained several problems during VPP installation (mostly related with MLX4 PMD Drivers).
15 * Some of the commands are taken from `Azure’s DPDK page <https://docs.microsoft.com/en-us/azure/virtual-network/setup-dpdk>`_.
17 To bring DPDK inside Azure, we perform the following procedure:
19 Firstly, we install the DPDK dependencies:
21 .. code-block:: console
23 $ sudo add-apt-repository ppa:canonical-server/dpdk-azure –y
25 $ sudo apt-get install -y librdmacm-dev librdmacm1 build-essential libnuma-dev libmnl-dev
27 Then, we download DPDK 18.02:
29 .. code-block:: console
31 $ sudo wget https://fast.dpdk.org/rel/dpdk-18.02.2.tar.xz
32 $ tar -xvf dpdk-18.02.2.tar.xz
34 Finally, we build DPDK, modifying first its configuration files in order to make VPP compatible with MLX4 drivers:
36 Inside config/common_base, modify:
38 .. code-block:: console
40 CONFIG_RTE_BUILD_SHARED_LIB=n
41 CONFIG_RTE_LIBRTE_MLX4_PMD=y
42 CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS=y
43 CONFIG_RTE_LIBRTE_TAP_PMD=y
44 CONFIG_RTE_LIBRTE_FAILSAFE_PMD=y
48 .. code-block:: console
50 $ make config T=x86_64-native-linuxapp-gcc
51 $ sed -ri 's,(MLX._PMD=)n,\1y,' build/.config
54 Finally we build DPDK:
56 .. code-block:: console
58 $ make install T=x86_64-native-linuxapp-gcc DESTDIR=/home/ciscotest/test EXTRA_CFLAGS='-fPIC -pie'
60 And we reboot the instance:
62 .. code-block:: console
66 After the reboot, we type these commands:
68 .. code-block:: console
70 $ echo 1024 | sudo tee /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages
72 $ sudo mount -t hugetlbfs nodev /mnt/huge
73 $ grep Huge /proc/meminfo
74 $ modprobe -a ib_uverbs
75 $ cd x86_64-native-linuxapp-gcc/
79 $ sudo cp librte_pmd_mlx4_glue.so.18.02.0 /usr/lib
81 **Now we focus on VPP installation:**
83 In our configuration we use VPP 18.07.
85 We perform this procedure in order to install VPP 18.07 with an external DPDK configuration inside Azure.
87 Firstly, we download VPP
89 .. code-block:: console
91 $ git clone https://gerrit.fd.io/r/vpp
94 Then, we build VPP, using the external DPDK configuration we previously made:
96 We modify the path inside the vpp.mk file:
98 .. code-block:: console
100 $ build-data/platforms/vpp.mk
101 $ vpp_uses_external_dpdk = yes
102 $ vpp_dpdk_inc_dir = <PATH_TO_DESTDIR_NAME_FROM_ABOVE>/include/dpdk/
103 $ vpp_dpdk_lib_dir =<PATH_TO_DESTDIR_NAME_FROM_ABOVE>/lib
105 <PATH_TO_DESTDIR_NAME_FROM_ABOVE> is whatever the path used when compiling DPDK above. These paths have to be absolute path in order for it to work.
107 we modify build-data/platforms/vpp.mk to use
109 .. code-block:: console
111 vpp_uses_dpdk_mlx4_pmd = yes
113 .. code-block:: console
117 $ make V=0 PLATFORM=vpp TAG=vpp install-deb
120 Finally, we modify the startup.conf file:
122 .. code-block:: console
125 $ sudo nano startup.conf
127 Inside the DPDK block, the following commands:
129 .. code-block:: console
132 ## Whitelist specific interface by specifying PCI address
137 vdev net_vdev_netvsc0,iface=eth1
138 vdev net_vdev_netvsc1,iface=eth2
140 *Please refer to Azure DPDK document to pick the right iface to use for failsafe vdev.*
145 .. code-block:: console
147 $ sudo service vpp stop
148 $ sudo service vpp start
149 $ sudo service vpp status
152 Now VPP will work inside Azure!