748f66f7c0edec688e31d881747542568bd5f81b
[vpp.git] / extras / vpp_config / README.rst
1 Summary:\r
2 \r
3 The purpose of the VPP configuration utility is to allow the user to configure\r
4 VPP in a simple and safe manner. The utility takes input from the user and\r
5 then modifies the key configuration files. The user can then examine these files\r
6 to be sure they are correct and then actually apply the configuration. The user\r
7 can also install a released and stable version of VPP. This is currently\r
8 released with release 17.07.\r
9 \r
10 Use:\r
11 \r
12 The installation and executing of the VPP configuration utility is simple. First\r
13 install the python pip module. Using pip install, then pip install vpp-config.\r
14 Then simply type Òvpp-configÓ and answer the questions. If you are not sure what\r
15 to answer choose the default. For yes or no questions the capital letter\r
16 designates the default. For example, for a question that shows [Y/n] Y is the\r
17 default. For numbers the default is within the brackets for example for a\r
18 question that shows [1024]. 1024 is the default. \r
19 \r
20 The flow of the utility is to inspect the system, if VPP is not install it,\r
21 create dry run configurations, inspect the files created during the dry run,\r
22 apply the configuration and then inspect the system again and then repeat.  \r
23 \r
24 Caveats:\r
25 \r
26 - Only supports Ubuntu, centos7 is coming shortly.\r
27 - When Inspecting the system, you may see a Huge page error, inspect the system a\r
28 few more times, if the error persists it is real.\r
29 \r
30 For Developers:\r
31 \r
32 Modifying the code is reasonable simple. The process would be edit and debug the\r
33 code from the root directory. In order to do this, we need a script that will copy\r
34 or data files to the proper place. This is where they end up with pip install. For\r
35 Ubuntu, this is /usr/local/vpp/vpp-config. I have provided a script that will copy\r
36 the relevant files correctly. I have also provided a script that will clean the\r
37 environment so you can start from scratch. These are the steps to run the utility\r
38 in this environment. The scripts are meant to be run from the root directory.\r
39 \r
40   ./scripts/clean.sh\r
41   ./scripts/cp-data.sh \r
42   ./vpp_config.py \r
43 \r
44 When the utility is installed with pip the wrapper scripts/vpp-config is written to\r
45 /usr/local/bin. However, the starting point when debugging this script locally is\r
46 ./vpp_config.py. Run the utility by executing ./vpp_config.py from the root directory. \r
47 \r
48 The start point in the code is in vpp_config.py. However, most of the work is done in\r
49 the files in ./vpplib\r
50 \r
51 Uploading to PyPi:\r
52 \r
53 To upload this utility to PpPi simple do the following. Currently, I have my own account\r
54 when we want everyone to contribute we will need to change that.\r
55 \r
56   sudo ÐH bash\r
57   cd vpp_config\r
58   python setup.py sdist bdist_wheel\r
59   twine upload dist/*\r
60 \r
61 Example Run:\r
62 \r
63 # pip install vpp-config\r
64 # vpp-config\r
65 \r
66 Welcome to the VPP system configuration utility\r
67 \r
68 These are the files we will modify:\r
69     /etc/vpp/startup.conf\r
70     /etc/sysctl.d/80-vpp.conf\r
71     /etc/default/grub\r
72 \r
73 Before we change them, we'll create working copies in /usr/local/vpp/vpp-config/dryrun\r
74 Please inspect them carefully before applying the actual configuration (option 3)!\r
75 \r
76 What would you like to do?\r
77 \r
78 1) Show basic system information\r
79 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
80        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
81 3) Full configuration (WARNING: This will change the system configuration)\r
82 4) Install/Uninstall VPP.\r
83 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
84 6) Install QEMU patch (Needed when running openstack).\r
85 9 or q) Quit\r
86 \r
87 Command: 1\r
88 \r
89 ==============================\r
90 NODE: DUT1\r
91 \r
92 CPU:\r
93           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
94               CPU(s):    32\r
95   Thread(s) per core:    2\r
96   Core(s) per socket:    8\r
97            Socket(s):    2\r
98    NUMA node0 CPU(s):    0-7,16-23\r
99    NUMA node1 CPU(s):    8-15,24-31\r
100          CPU max MHz:    3600.0000\r
101          CPU min MHz:    1200.0000\r
102                  SMT:    Enabled\r
103 \r
104 VPP Threads: (Name: Cpu Number)\r
105 \r
106 Grub Command Line:\r
107   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
108   Configured: GRUB_CMDLINE_LINUX_DEFAULT=""\r
109 \r
110 Huge Pages:\r
111   Total System Memory           : 65863484 kB\r
112   Total Free Memory             : 41325924 kB\r
113   Actual Huge Page Total        : 8192\r
114   Configured Huge Page Total    : 1024\r
115   Huge Pages Free               : 8192\r
116   Huge Page Size                : 2048 kB\r
117 \r
118 Devices:\r
119 \r
120 Status:\r
121   Not Installed\r
122 \r
123 ==============================\r
124 \r
125 What would you like to do?\r
126 \r
127 1) Show basic system information\r
128 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
129        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
130 3) Full configuration (WARNING: This will change the system configuration)\r
131 4) Install/Uninstall VPP.\r
132 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
133 6) Install QEMU patch (Needed when running openstack).\r
134 9 or q) Quit\r
135 \r
136 Command: 4\r
137 \r
138 There are no VPP packages on node localhost.\r
139 Do you want to install VPP [Y/n]? \r
140 INFO:root: Local Command: ls /etc/apt/sources.list.d/99fd.io.list.orig\r
141 INFO:root:  /etc/apt/sources.list.d/99fd.io.list.orig\r
142 ÉÉ..\r
143 \r
144 What would you like to do?\r
145 \r
146 1) Show basic system information\r
147 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
148        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
149 3) Full configuration (WARNING: This will change the system configuration)\r
150 4) Install/Uninstall VPP.\r
151 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
152 6) Install QEMU patch (Needed when running openstack).\r
153 9 or q) Quit\r
154 \r
155 Command: 1\r
156 \r
157 ==============================\r
158 NODE: DUT1\r
159 \r
160 CPU:\r
161           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
162               CPU(s):    32\r
163   Thread(s) per core:    2\r
164   Core(s) per socket:    8\r
165            Socket(s):    2\r
166    NUMA node0 CPU(s):    0-7,16-23\r
167    NUMA node1 CPU(s):    8-15,24-31\r
168          CPU max MHz:    3600.0000\r
169          CPU min MHz:    1200.0000\r
170                  SMT:    Enabled\r
171 \r
172 VPP Threads: (Name: Cpu Number)\r
173   vpp_main  : 0   \r
174   vpp_stats : 0   \r
175 \r
176 Grub Command Line:\r
177   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
178   Configured: GRUB_CMDLINE_LINUX_DEFAULT=""\r
179 \r
180 Huge Pages:\r
181   Total System Memory           : 65863484 kB\r
182   Total Free Memory             : 55877364 kB\r
183   Actual Huge Page Total        : 1024\r
184   Configured Huge Page Total    : 1024\r
185   Huge Pages Free               : 1024\r
186   Huge Page Size                : 2048 kB\r
187 \r
188 Devices:\r
189 Name                           Socket RXQs RXDescs TXQs TXDescs\r
190 \r
191 Status:\r
192   active (running)\r
193 \r
194 ==============================\r
195 \r
196 What would you like to do?\r
197 \r
198 1) Show basic system information\r
199 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
200        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
201 3) Full configuration (WARNING: This will change the system configuration)\r
202 4) Install/Uninstall VPP.\r
203 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
204 6) Install QEMU patch (Needed when running openstack).\r
205 9 or q) Quit\r
206 \r
207 Command: 2\r
208 \r
209 These device(s) are currently NOT being used by VPP or the OS.\r
210 \r
211 PCI ID          Description                                       \r
212 ----------------------------------------------------------------\r
213 0000:02:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
214 0000:02:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
215 \r
216 Would you like to give any of these devices back to the OS [y/N]? y\r
217 Would you like to use device 0000:02:00.0 for the OS [y/N]? y\r
218 Would you like to use device 0000:02:00.1 for the OS [y/N]? y\r
219 \r
220 These devices have kernel interfaces, but appear to be safe to use with VPP.\r
221 \r
222 PCI ID          Kernel Interface(s)       Description                                       \r
223 ------------------------------------------------------------------------------------------\r
224 0000:90:00.0    enp144s0                  VIC Ethernet NIC                                  \r
225 0000:8f:00.0    enp143s0                  VIC Ethernet NIC                                  \r
226 0000:84:00.0    enp132s0f0,enp132s0f0d1   Ethernet Controller XL710 for 40GbE QSFP+         \r
227 0000:84:00.1    enp132s0f1,enp132s0f1d1   Ethernet Controller XL710 for 40GbE QSFP+         \r
228 0000:08:00.1    enp8s0f1                  I350 Gigabit Network Connection                   \r
229 0000:02:00.0    enp2s0f0                  82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
230 0000:02:00.1    enp2s0f1                  82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
231 0000:86:00.0    enp134s0f0                82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
232 0000:86:00.1    enp134s0f1                82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
233 \r
234 Would you like to use any of these device(s) for VPP [y/N]? y\r
235 Would you like to use device 0000:90:00.0 for VPP [y/N]? \r
236 Would you like to use device 0000:8f:00.0 for VPP [y/N]? \r
237 Would you like to use device 0000:84:00.0 for VPP [y/N]? \r
238 Would you like to use device 0000:84:00.1 for VPP [y/N]? \r
239 Would you like to use device 0000:08:00.1 for VPP [y/N]? \r
240 Would you like to use device 0000:02:00.0 for VPP [y/N]? y\r
241 Would you like to use device 0000:02:00.1 for VPP [y/N]? y\r
242 Would you like to use device 0000:86:00.0 for VPP [y/N]? y\r
243 Would you like to use device 0000:86:00.1 for VPP [y/N]? y\r
244 \r
245 These device(s) will be used by VPP.\r
246 \r
247 PCI ID          Description                                       \r
248 ----------------------------------------------------------------\r
249 0000:86:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
250 0000:86:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
251 0000:02:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
252 0000:02:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
253 \r
254 Would you like to remove any of these device(s) [y/N]? \r
255 \r
256 These device(s) will be used by VPP, please rerun this option if this is incorrect.\r
257 \r
258 PCI ID          Description                                       \r
259 ----------------------------------------------------------------\r
260 0000:86:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
261 0000:86:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
262 0000:02:00.0    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
263 0000:02:00.1    82599ES 10-Gigabit SFI/SFP+ Network Connection    \r
264 \r
265 Your system has 32 core(s) and 2 Numa Nodes.\r
266 To begin, we suggest not reserving any cores for VPP or other processes.\r
267 Then to improve performance try reserving cores as needed. \r
268 \r
269 How many core(s) do you want to reserve for processes other than VPP? [0-16][0]? 4\r
270 How many core(s) shall we reserve for VPP workers[0-4][0]? 2\r
271 Should we reserve 1 core for the VPP Main thread? [Y/n]? \r
272 \r
273 There currently 1024 2048 kB huge pages free.\r
274 Do you want to reconfigure the number of huge pages [y/N]? y\r
275 \r
276 There currently a total of 1024 huge pages.\r
277 How many huge pages do you want [1024 - 22511][1024]? 8192\r
278 \r
279 What would you like to do?\r
280 \r
281 1) Show basic system information\r
282 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
283        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
284 3) Full configuration (WARNING: This will change the system configuration)\r
285 4) Install/Uninstall VPP.\r
286 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
287 6) Install QEMU patch (Needed when running openstack).\r
288 9 or q) Quit\r
289 \r
290 Command: 3\r
291 \r
292 We are now going to configure your system(s).\r
293 \r
294 Are you sure you want to do this [Y/n]? \r
295 These are the changes we will apply to\r
296 the huge page file (/etc/sysctl.d/80-vpp.conf).\r
297 \r
298 1,2d0\r
299 < # Number of 2MB hugepages desired\r
300 < vm.nr_hugepages=1024\r
301 4,7c2,3\r
302 < # Must be greater than or equal to (2 * vm.nr_hugepages).\r
303 < vm.max_map_count=3096\r
304\r
305 < # All groups allowed to access hugepages\r
306 ---\r
307 > vm.nr_hugepages=8192\r
308 > vm.max_map_count=17408\r
309 8a5\r
310 > kernel.shmmax=17179869184\r
311 10,15d6\r
312 < # Shared Memory Max must be greator or equal to the total size of hugepages.\r
313 < # For 2MB pages, TotalHugepageSize = vm.nr_hugepages * 2 * 1024 * 1024\r
314 < # If the existing kernel.shmmax setting  (cat /sys/proc/kernel/shmmax)\r
315 < # is greater than the calculated TotalHugepageSize then set this parameter\r
316 < # to current shmmax value.\r
317 < kernel.shmmax=2147483648\r
318 \r
319 \r
320 Are you sure you want to apply these changes [Y/n]? \r
321 These are the changes we will apply to\r
322 the VPP startup file (/etc/vpp/startup.conf).\r
323 \r
324 3c3\r
325 <   nodaemon\r
326 ---\r
327 >   interactive\r
328 5a6\r
329 >   cli-listen /run/vpp/cli.sock\r
330 17c18,25\r
331 <       ## In the VPP there is one main thread and optionally the user can create worker(s)\r
332 ---\r
333\r
334 >   main-core 8\r
335 >   corelist-workers 9-10,5-6\r
336\r
337 >   scheduler-policy fifo\r
338 >   scheduler-priority 50\r
339\r
340 >         ## In the VPP there is one main thread and optionally the user can create worker(s)\r
341 52,53c60,76\r
342 < # dpdk {\r
343 <       ## Change default settings for all intefaces\r
344 ---\r
345 > dpdk {\r
346\r
347 >   dev 0000:86:00.0 { \r
348 >     num-rx-queues 2\r
349 >   }\r
350 >   dev 0000:86:00.1 { \r
351 >     num-rx-queues 2\r
352 >   }\r
353 >   dev 0000:02:00.0 { \r
354 >     num-rx-queues 2\r
355 >   }\r
356 >   dev 0000:02:00.1 { \r
357 >     num-rx-queues 2\r
358 >   }\r
359 >   num-mbufs 71680\r
360\r
361 >         ## Change default settings for all intefaces\r
362 82a106,115\r
363 >       ## Specify bonded interface and its slaves via PCI addresses\r
364 >       ## \r
365 >         ## Bonded interface in XOR load balance mode (mode 2) with L3 and L4 headers \r
366 >       # vdev eth_bond0,mode=2,slave=0000:02:00.0,slave=0000:03:00.0,xmit_policy=l34\r
367 >       # vdev eth_bond1,mode=2,slave=0000:02:00.1,slave=0000:03:00.1,xmit_policy=l34\r
368 >       ##\r
369 >       ## Bonded interface in Active-Back up mode (mode 1)\r
370 >       # vdev eth_bond0,mode=1,slave=0000:02:00.0,slave=0000:03:00.0\r
371 >       # vdev eth_bond1,mode=1,slave=0000:02:00.1,slave=0000:03:00.1\r
372\r
373 99c132\r
374 < # }\r
375 ---\r
376 > }\r
377 108a142\r
378\r
379 \r
380 \r
381 Are you sure you want to apply these changes [Y/n]? \r
382 \r
383 The configured grub cmdline looks like this:\r
384 GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable isolcpus=1-4,8,9-10,5-6 nohz_full=1-4,8,9-10,5-6 rcu_nocbs=1-4,8,9-10,5-6"\r
385 \r
386 The current boot cmdline looks like this:\r
387 BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
388 \r
389 Do you want to keep the current boot cmdline [Y/n]? \r
390 \r
391 What would you like to do?\r
392 \r
393 1) Show basic system information\r
394 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
395        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
396 3) Full configuration (WARNING: This will change the system configuration)\r
397 4) Install/Uninstall VPP.\r
398 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
399 6) Install QEMU patch (Needed when running openstack).\r
400 9 or q) Quit\r
401 \r
402 Command: 1\r
403 \r
404 ==============================\r
405 NODE: DUT1\r
406 \r
407 CPU:\r
408           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
409               CPU(s):    32\r
410   Thread(s) per core:    2\r
411   Core(s) per socket:    8\r
412            Socket(s):    2\r
413    NUMA node0 CPU(s):    0-7,16-23\r
414    NUMA node1 CPU(s):    8-15,24-31\r
415          CPU max MHz:    3600.0000\r
416          CPU min MHz:    1200.0000\r
417                  SMT:    Enabled\r
418 \r
419 VPP Threads: (Name: Cpu Number)\r
420 \r
421 Grub Command Line:\r
422   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
423   Configured: GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable isolcpus=1-4,8,9-10,5-6 nohz_full=1-4,8,9-10,5-6 rcu_nocbs=1-4,8,9-10,5-6"\r
424 \r
425 Huge Pages:\r
426   Total System Memory           : 65863484 kB\r
427   Total Free Memory             : 41163916 kB\r
428   Actual Huge Page Total        : 8192\r
429   Configured Huge Page Total    : 8192\r
430   Huge Pages Free               : 3108\r
431   Huge Page Size                : 2048 kB\r
432 \r
433 Devices:\r
434 Total Number of Buffers: 71680\r
435 \r
436 Status:\r
437   active (running)\r
438   Sep 27 12:49:59 tf-ucs-3 vpp[13671]: EAL: No free hugepages reported in hugepages-1048576kB\r
439 \r
440 ==============================\r
441 \r
442 What would you like to do?\r
443 \r
444 1) Show basic system information\r
445 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
446        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
447 3) Full configuration (WARNING: This will change the system configuration)\r
448 4) Install/Uninstall VPP.\r
449 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
450 6) Install QEMU patch (Needed when running openstack).\r
451 9 or q) Quit\r
452 \r
453 Command: 1\r
454 \r
455 ==============================\r
456 NODE: DUT1\r
457 \r
458 CPU:\r
459           Model name:    Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz\r
460               CPU(s):    32\r
461   Thread(s) per core:    2\r
462   Core(s) per socket:    8\r
463            Socket(s):    2\r
464    NUMA node0 CPU(s):    0-7,16-23\r
465    NUMA node1 CPU(s):    8-15,24-31\r
466          CPU max MHz:    3600.0000\r
467          CPU min MHz:    1200.0000\r
468                  SMT:    Enabled\r
469 \r
470 VPP Threads: (Name: Cpu Number)\r
471   vpp_stats : 0   \r
472   vpp_wk_2  : 9   \r
473   vpp_wk_3  : 10  \r
474   vpp_wk_0  : 5   \r
475   vpp_wk_1  : 6   \r
476   vpp_main  : 8   \r
477 \r
478 Grub Command Line:\r
479   Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-96-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro\r
480   Configured: GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable isolcpus=1-4,8,9-10,5-6 nohz_full=1-4,8,9-10,5-6 rcu_nocbs=1-4,8,9-10,5-6"\r
481 \r
482 Huge Pages:\r
483   Total System Memory           : 65863484 kB\r
484   Total Free Memory             : 41170684 kB\r
485   Actual Huge Page Total        : 8192\r
486   Configured Huge Page Total    : 8192\r
487   Huge Pages Free               : 7936\r
488   Huge Page Size                : 2048 kB\r
489 \r
490 Devices:\r
491 Total Number of Buffers: 71680\r
492 Name                           Socket RXQs RXDescs TXQs TXDescs\r
493 TenGigabitEthernet2/0/0             0    2    1024    5    1024\r
494 TenGigabitEthernet2/0/1             0    2    1024    5    1024\r
495 TenGigabitEthernet86/0/0            1    2    1024    5    1024\r
496 TenGigabitEthernet86/0/1            1    2    1024    5    1024\r
497 \r
498 Status:\r
499   active (running)\r
500 \r
501 ==============================\r
502 \r
503 What would you like to do?\r
504 \r
505 1) Show basic system information\r
506 2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)\r
507        and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml\r
508 3) Full configuration (WARNING: This will change the system configuration)\r
509 4) Install/Uninstall VPP.\r
510 5) Dry Run from /usr/local/vpp/vpp-config/auto-config.yaml (will not ask questions).\r
511 6) Install QEMU patch (Needed when running openstack).\r
512 9 or q) Quit\r
513 \r
514 Command: q\r
515\r