1 ## Creating VPP Startup Configuration
2 This document describes how to create the VPP startup configuration
3 file located at `/etc/vpp/contiv-vswitch.conf`.
5 ### Hardware Interface Configuration
6 #### Single-NIC Configuration
7 You need to configure hardware interfaces for use by VPP. First, find out the PCI address of the host's network interface. On
8 Debian-based distributions, you can use `lshw`:
11 sudo lshw -class network -businfo
12 Bus info Device Class Description
13 ========================================================
14 pci@0000:03:00.0 ens160 network VMXNET3 Ethernet Controller
17 In our case, it would be the `ens3` interface with the PCI address
20 Now, add or modify the VPP startup config file (`/etc/vpp/contiv-vswitch.conf`)
21 to contain the proper PCI address:
25 cli-listen /run/vpp/cli.sock
27 coredump-size unlimited
42 #### Multi-NIC Configuration
43 Similar to the single-NIC configuration, use command *lshw* to find the PCI
44 addresses of all the NICs in the system, for example:
47 $ sudo lshw -class network -businfo
48 Bus info Device Class Description
49 ====================================================
50 pci@0000:00:03.0 ens3 network Virtio network device
51 pci@0000:00:04.0 ens4 network Virtio network device
54 In the example above, `ens3` would be the primary interface and `ens4` would
55 be the interface that would be used by VPP. The PCI address of the `ens4`
56 interface would be `0000:00:04.0`.
58 Make sure the selected interface is *shut down*, otherwise VPP
61 sudo ip link set ens4 down
64 Now, add or modify the VPP startup config file in `/etc/vpp/contiv-vswitch.conf`
65 to contain the proper PCI address:
69 cli-listen /run/vpp/cli.sock
71 coredump-size unlimited
86 If assigning multiple NICs to VPP you will need to include each NIC's PCI address
87 in the dpdk stanza in `/etc/vpp/contiv-vswitch.conf`.
89 ##### Assigning all NICs to VPP
90 On a multi-NIC node, it is also possible to assign all NICs from the kernel for
91 use by VPP. First, you need to install the STN daemon, as described [here][1],
92 since you will want the NICs to revert to the kernel if VPP crashes.
94 You also need to configure the NICs in the VPP startup config file
95 in `/etc/vpp/contiv-vswitch.conf`. For example, to use both the primary and
96 secondary NIC, in a two-NIC node, your VPP startup config file would look
102 cli-listen /run/vpp/cli.sock
104 coredump-size unlimited
121 #### Installing `lshw` on CentOS/RedHat/Fedora
122 Note: On CentOS/RedHat/Fedora distributions, `lshw` may not be available
123 by default, install it by
125 sudo yum -y install lshw
128 ### Power-saving Mode
129 In regular operation, VPP takes 100% of one CPU core at all times (poll loop).
130 If high performance and low latency is not required you can "slow-down"
131 the poll-loop and drastically reduce CPU utilization by adding the following
132 stanza to the `unix` section of the VPP startup config file:
140 The power-saving mode is especially useful in VM-based development environments
141 running on laptops or less powerful servers.
144 To troubleshoot VPP configuration issues in production environments, it is
145 strongly recommended to configure VPP API trace. This is done by adding the
146 following stanza to the VPP startup config file:
153 You can set the size of the trace buffer with the <nitems> attribute.