blob: f1bfa42778811029dea6afec9a1afd3ef0fb69ae [file] [log] [blame]
Francesco Spinelli22e9c032019-02-28 11:51:24 +01001.. _vppinazure:
2
3.. toctree::
4
5VPP in Azure
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +02006============
Francesco Spinelli22e9c032019-02-28 11:51:24 +01007
8
9
10
11Before starting, a few notes:
12
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020013* 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).
Francesco Spinelli22e9c032019-02-28 11:51:24 +010014
15* Some of the commands are taken from `Azure’s DPDK page <https://docs.microsoft.com/en-us/azure/virtual-network/setup-dpdk>`_.
16
17To bring DPDK inside Azure, we perform the following procedure:
18
19Firstly, we install the DPDK dependencies:
20
21.. code-block:: console
22
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020023 $ sudo add-apt-repository ppa:canonical-server/dpdk-azure y
24 $ sudo apt-get update
25 $ sudo apt-get install -y librdmacm-dev librdmacm1 build-essential libnuma-dev libmnl-dev
Francesco Spinelli22e9c032019-02-28 11:51:24 +010026
27Then, we download DPDK 18.02:
28
29.. code-block:: console
30
31 $ sudo wget https://fast.dpdk.org/rel/dpdk-18.02.2.tar.xz
32 $ tar -xvf dpdk-18.02.2.tar.xz
33
34Finally, we build DPDK, modifying first its configuration files in order to make VPP compatible with MLX4 drivers:
35
36Inside config/common_base, modify:
37
38.. code-block:: console
39
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020040 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
Francesco Spinelli22e9c032019-02-28 11:51:24 +010045
46and then:
47
48.. code-block:: console
49
50 $ make config T=x86_64-native-linuxapp-gcc
51 $ sed -ri 's,(MLX._PMD=)n,\1y,' build/.config
52 $ make
53
54Finally we build DPDK:
55
56.. code-block:: console
57
58 $ make install T=x86_64-native-linuxapp-gcc DESTDIR=/home/ciscotest/test EXTRA_CFLAGS='-fPIC -pie'
59
60And we reboot the instance:
61
62.. code-block:: console
63
Paul Vinciguerra7fa3dd22019-10-27 17:28:10 -040064 $ reboot instance
Francesco Spinelli22e9c032019-02-28 11:51:24 +010065
66After the reboot, we type these commands:
67
68.. code-block:: console
69
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020070 $ echo 1024 | sudo tee /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages
71 $ mkdir /mnt/huge
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/
76 $ ls
77 $ cd lib/
78 $ ls
79 $ sudo cp librte_pmd_mlx4_glue.so.18.02.0 /usr/lib
Francesco Spinelli22e9c032019-02-28 11:51:24 +010080
81**Now we focus on VPP installation:**
82
83In our configuration we use VPP 18.07.
84
85We perform this procedure in order to install VPP 18.07 with an external DPDK configuration inside Azure.
86
87Firstly, we download VPP
88
89.. code-block:: console
90
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +020091 $ git clone https://gerrit.fd.io/r/vpp
92 $ git checkout v18.07
Francesco Spinelli22e9c032019-02-28 11:51:24 +010093
94Then, we build VPP, using the external DPDK configuration we previously made:
95
96We modify the path inside the vpp.mk file:
97
98.. code-block:: console
99
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200100 $ 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
Francesco Spinelli22e9c032019-02-28 11:51:24 +0100104
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.
106
107we modify build-data/platforms/vpp.mk to use
108
109.. code-block:: console
110
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200111 vpp_uses_dpdk_mlx4_pmd = yes
Francesco Spinelli22e9c032019-02-28 11:51:24 +0100112
113.. code-block:: console
114
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200115 $ make build
116 $ cd build-root/
117 $ make V=0 PLATFORM=vpp TAG=vpp install-deb
118 $ sudo dpkg -i *.deb
Francesco Spinelli22e9c032019-02-28 11:51:24 +0100119
120Finally, we modify the startup.conf file:
121
122.. code-block:: console
123
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200124 $ cd /etc/vpp
125 $ sudo nano startup.conf
Francesco Spinelli22e9c032019-02-28 11:51:24 +0100126
127Inside the DPDK block, the following commands:
128
129.. code-block:: console
130
131
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +0200132 ## Whitelist specific interface by specifying PCI address
133 dev 000X:00:0X.0
134 dev 000X:00:0X.0
135
136 # Running failsafe
137 vdev net_vdev_netvsc0,iface=eth1
138 vdev net_vdev_netvsc1,iface=eth2
Francesco Spinelli22e9c032019-02-28 11:51:24 +0100139
140*Please refer to Azure DPDK document to pick the right iface to use for failsafe vdev.*
141
142
143and finally:
144
145.. code-block:: console
146
147 $ sudo service vpp stop
148 $ sudo service vpp start
149 $ sudo service vpp status
150 $ sudo vppctl
151
152Now VPP will work inside Azure!
153
154
155
156
157
158
159
160