FDIO Quick Start Guide PDF
FDIO Quick Start Guide PDF
Overview 2
Configuration Utility 2
Installing FDIO 2
Installing with APT (Latest Released Version) 3
Installing with YUM (Latest Released Version) 3
Start and quickly verify VPP installation 4
Setting the Interface IP Addresses 4
CLI 5
vppctl 5
Some useful commands 6
Show interface, clear interfaces 6
Show error, Clear error 7
Show hardware, clear hardware 7
Trace packets 8
Show Fib 9
Configuration 9
Startup (startup.conf) 9
Devices 10
Miscellaneous 10
My Changes 11
Hugepages (80-vpp.conf) 11
Exec command, scripts and startup.conf 12
Using the exec command. 12
Exec command and startup.conf 13
Directories 15
src/vpp/conf 15
build-root/build-vpp_debug-native/dpdk/dpdk-17.02/usertools/ 16
build-root/install-vpp_debug-native/vpp/bin/ 16
dpdk-devbind.py 16
src/scripts/vnet/ 16
src/vnet/ 16
src/vnet/devices/ 17
1 Overview
This document will describe downloading, installing and running FDIO. We will talk about the
installing FDIO, the build tree, configuration files and scripts. This isn’t meant to be a detailed
description, but more a way to quickly ramp up and understand the basics of FDIO. VPP is a
core technology in FDIO and thus referenced as VPP in many places in this document.. In this
doc commands that start with “# “ should be root and “$ “ are not.
2 Configuration Utility
The VPP configuration can be used to safely and easily configure a system for use with VPP.
Information on how to use this utility can be found at the following:
https://wiki.fd.io/view/VPP/Configuration_Tool
3 Installing FDIO
Later in this document we describe how to build FDIO and its packages. This section will
describe how VPP can be installed and run without building the packages
The following link describes how to install FDIO from the packages. I will summarize it here.
https://wiki.fd.io/view/VPP/Installing_VPP_binaries_from_packages
# cat /etc/apt/sources.list.d/99fd.io.list
deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io.ubuntu.xenial.main/ ./
# apt-get update
…..
Reading package lists...
[fdio-stable-1801]
name=fd.io stable/1801 branch latest merge
baseurl=https://nexus.fd.io/content/repositories/fd.io.centos7/
enabled=1
gpgcheck=0
Install VPP:
Start VPP:
Verify that vpp is using some interfaces using the vppctl command. The vppctl command is used
to run the vpp cli.
$ ping 30.0.0.2
PING 30.0.0.2 (30.0.0.2) 56(84) bytes of data.
64 bytes from 30.0.0.2: icmp_seq=1 ttl=255 time=0.729 ms
64 bytes from 30.0.0.2: icmp_seq=2 ttl=255 time=0.540 ms
4 CLI
FDIO comes with a rudimentary command line interface. The FDIO CLI is a work in progress. It
is expected to be an ongoing work and to be updated regularly. It does have command line recall
and a rudimentary help.
Although not a complete description of the CLI, a decent description can be found at the
following link.
https://wiki.fd.io/view/VPP/Command-line_Interface_(CLI)_Guide
4.1 vppctl
The usual way to access the cli is using the “vppctl”. It can be used from the linux command line
or used to start a shell where VPP commands can executed from. Use exit or ctrl-d to exit from
the shell.
Excuting vppctl from the linux command line and creating a shell :
root@tf-ucs-3:/scratch/jdenisco/fdio.1704/build-root# vppctl
_______ _ _ _____ ___
__/ __/ _ \ (_)__ | | / / _ \/ _ \
_/ _// // / / / _ \ | |/ / ___/ ___/
/_/ /____(_)_/\___/ |___/_/ /_/
vpp# sh int
Name Idx State Counter Count
TenGigabitEthernet2/0/0 1 up
TenGigabitEthernet2/0/1 2 up
TenGigabitEthernet86/0/0 3 up
TenGigabitEthernet86/0/1 4 up
local0 0 down
vpp#
vpp# sh err
Count Node Reason
2 ip4-glean ARP requests sent
10 ip4-icmp-input echo replies sent
2 arp-input ARP replies received
tx frames ok 3
tx bytes ok 256
….
vpp# clear hardware
00:07:04:001708: dpdk-input
TenGigabitEthernet86/0/0 rx queue 0
buffer 0xed8bb8: current data 14, length 84, free-list 0, clone-count 0, totlen-nifb 0, trace 0x0
PKT MBUF: port 2, nb_segs 1, pkt_len 98
buf_len 2176, data_len 98, ol_flags 0x182, data_off 128, phys_addr 0x7672ee40
packet_type 0x0
Packet Offload Flags
PKT_RX_RSS_HASH (0x0002) RX packet with RSS hash result
PKT_RX_IP_CKSUM_GOOD (0x0080) IP cksum of RX pkt. is valid
PKT_RX_L4_CKSUM_GOOD (0x0100) L4 cksum of RX pkt. is valid
IP4: 90:e2:ba:4b:fa:70 -> 90:e2:ba:96:cd:4c
ICMP: 30.0.0.1 -> 30.0.0.2
tos 0x00, ttl 64, length 84, checksum 0x73a0
…
unicast-ip4-chain
…
5 Configuration
There are 2 configuration files you need to know in order to configure FDIO. After FDIO is
installed these files will be in place. The files are /etc/vpp/startup.conf and
/etc/sysctl.d/80-vpp.conf.
I will specify these devices in the startup.conf in the section that starts “## Whitelist specific
interface by specifying PCI address”. I will specify my devices, using the PCI IDs like so.
If no devices are specified VPP will take all the ports that are not link up.
5.1.2 Miscellaneous
There are a couple of other values I will change in this file. In the section “unix {“, I will add the
keyword “interactive”. This will allow us to use the FDIO cli to be enabled when starting FDIO
manually. I will also specify the driver near the section of the file “## Change UIO driver used”
to specify uio_pci_generic.
5.1.3 My Changes
My changes to the default FDIO startup.conf are as follows:
unix {
nodaemon
+ interactive
log /tmp/vpp.log
full-coredump
}
@@ -72,7 +73,10 @@ dpdk {
# }
In some cases, for example if vpp or dpdk crashes, the huge pages may not get cleaned up. You
will know this because HugePages Free will be 0. If this happens they need to be deleted. You
can do this by finding where they are and then deleting them.
root@tf-ucs-3:/# rm /dev/hugepages/rtmem*
# cat set-up-interfaces
comment { connected to TenGigabitEthernet2/0/1 }
set int ip address TenGigabitEthernet2/0/0 10.0.0.2/8
set int state TenGigabitEthernet2/0/0 up
# vppctl
_______ _ _ _____ ___
__/ __/ _ \ (_)__ | | / / _ \/ _ \
_/ _// // / / / _ \ | |/ / ___/ ___/
/_/ /____(_)_/\___/ |___/_/ /_/
vpp# exit
Notice the “show interface address” command show IP addresses associated with the interfaces.
unix {
nodaemon
interactive
log /tmp/vpp.log
full-coredump
exec /scratch/jdenisco/quickstart/set-up-interfaces
}
6 Downloading and Building FDIO
It is only necessary to download and build FDIO if you are interested in Developing or
debugging FDIO.
After downloading FDIO the first time and before building the binaries and packages you need
to install the dependencies and bootstrap the build environment. These 2 steps only need to be
done once per tree.
# make install-dep
Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Ign:3 https://nexus.fd.io/content/repositories/fd.io.stable.1701.ubuntu.xenial.main ./ InRelease
…….
# make bootstrap
make[1]: Entering directory 'fdio.1704/build-root'
@@@@ Arch for platform 'native' is native @@@@
@@@@ Finding source for tools @@@@
@@@@ Makefile fragment found in fdio.1704/build-root/packages/tools.mk @@@@
@@@@ Source found in fdio.1704/src @@@@
…….
After setting up and bootstrapping the build environment, using the steps above, the binaries and
packages can be built with the following:
# cd build-root
# source ./path_setup
The vpp binaries can built using the make command in the build-root directory. To build images
with debug symbols use the following:
# make PLATFORM=vpp TAG=vpp_debug vpp-install
@@@@ Arch for platform 'vpp' is native @@@@
@@@@ Finding source for dpdk @@@@
@@@@ Makefile fragment found in fdio.1704/build-data/packages/dpdk.mk @@@@
@@@@ Source found in fdio.1704/dpdk @@@@
@@@@ Arch for platform 'vpp' is native @@@@
@@@@ Finding source for vpp @@@@
…..
This does the same as executing “make debug” from the root directory (fdio.1704). To build an
image without symbols use “TAG=vpp” instead of “TAG=vpp_debug”. “make release” in the
root directory builds the binaries without debug symbols.
# ls *.deb
vpp_17.04-rc2~1-g5e189f1_amd64.deb vpp-api-python_17.04-rc2~1-g5e189f1_amd64.deb
vpp-lib_17.04-rc2~1-g5e189f1_amd64.deb vpp-api-java_17.04-rc2~1-g5e189f1_amd64.deb
vpp-dbg_17.04-rc2~1-g5e189f1_amd64.deb vpp-plugins_17.04-rc2~1-g5e189f1_amd64.deb
vpp-api-lua_17.04-rc2~1-g5e189f1_amd64.deb vpp-dev_17.04-rc2~1-g5e189f1_amd64.deb
8 Directories
After pulling and building FDIO there are a few directories worth looking at.
8.1 src/vpp/conf
This directory contains default configuration files.
# ls
80-vpp.conf startup.conf
8.2 build-root/build-vpp_debug-native/dpdk/dpdk-17.02/usertools/
This directory is provided with the dpdk. The 2 import scripts are cpu_layout.py and
dpdk-devbind.py
# ls ./build-root/build-vpp_debug-native/dpdk/dpdk-17.02/usertools/
cpu_layout.py dpdk-devbind.py dpdk-pmdinfo.py dpdk-setup.sh
8.3 build-root/install-vpp_debug-native/vpp/bin/
This directory contains the vpp executables. The most useful files are vpp and vppctl. These files
are copied to/usr/bin after FDIO is installed. You can use the binary file “vpp” located in this
directory with gdb to help debug FDIO.
root@tf-ucs-3# ls ./build-root/install-vpp_debug-native/vpp/bin
elftool svmdbtool svmtool vpp vppapigen vpp_api_test vppctl vpp_get_metrics vpp_json_test
vpp_restart
8.3.1 dpdk-devbind.py
The dpdk-devbind.py script is provided with the Intel DPDK. It is included with FDIO. After the
FDIO is built, this script and other DPDK tools can be found in
build-root/build-vpp_debug-native/dpdk/dpdk-17.02/usertools/.
8.4 src/scripts/vnet/
This directory has some very useful examples using the FDIO traffic generator and general
configuration.
# ls src/scripts/vnet/
arp4 dhcp ip6 l2efpfilter_perf l2flood mcast pcap rightpeer snat_det
…..
8.5 src/vnet/
This directory contains most of the important source code.
# ls src/vnet
adj config.h fib interface.api interface_output.c lawful-intercept misc.c
ppp
….
8.6 src/vnet/devices/
This directory contains the device drivers. For example, the vhost driver is in
src/vnet/devices/virtio.
# ls src/vnet/devices/virtio/
dir.dox vhost_user.api vhost_user_api.c vhost-user.c vhost-user.h
# ls *.deb
vpp_17.04-rc2~1-g5e189f1_amd64.deb vpp-api-python_17.04-rc2~1-g5e189f1_amd64.deb
vpp-lib_17.04-rc2~1-g5e189f1_amd64.deb vpp-api-java_17.04-rc2~1-g5e189f1_amd64.deb
vpp-dbg_17.04-rc2~1-g5e189f1_amd64.deb vpp-plugins_17.04-rc2~1-g5e189f1_amd64.deb
vpp-api-lua_17.04-rc2~1-g5e189f1_amd64.deb vpp-dev_17.04-rc2~1-g5e189f1_amd64.deb
We will install the packages vpp-lib, vpp-plugins, vpp, and vpp-api-python. We will install them
in this order so the dependencies work. I have also inserted some faults so we can walk through a
typical debug sequence.
# dpkg -i *.deb
Selecting previously unselected package vpp-lib.
(Reading database ... 140058 files and directories currently installed.)
Preparing to unpack .../vpp-lib_17.04-rc2~1-g5e189f1_amd64.deb ...
….
After installing VPP it should be started. I will check this using the ps command.
In this case VPP is not running. To debug I will run VPP manually. You can also check error
messages using “service vpp status”
# /usr/bin/vpp -c /etc/vpp/startup.conf
vlib_plugin_early_init:360: plugin path /usr/lib/vpp_plugins
load_one_plugin:188: Loaded plugin: acl_plugin.so (Access Control Lists)
….
0: load_one_plugin:63: Loaded plugin: /usr/lib/vpp_api_test_plugins/ioam_export_test_plugin.so
0: load_one_plugin:63: Loaded plugin: /usr/lib/vpp_api_test_plugins/ioam_vxlan_gpe_test_plugin.so
0: dpdk_config: unknown input `uio_pci_generic'
……
VPP once again did not start. In this case, I have an incorrect statement in my startup.conf.
Notice the error “dpdk_config: unknown input `uio_pci_generic'”. I will fix it and try again.
# /usr/bin/vpp -c /etc/vpp/startup.conf
vlib_plugin_early_init:360: plugin path /usr/lib/vpp_plugins
load_one_plugin:188: Loaded plugin: acl_plugin.so (Access Control Lists)
….
0: dpdk_ipsec_process:241: DPDK Cryptodev support is disabled, default to OpenSSL IPsec
0: dpdk_lib_init:536: DPDK drivers found no ports...
0: dpdk_lib_init:540: DPDK drivers found 0 ports...
This looks better and I get to the prompt. The “interactive” keyword we specified in the
startup.conf enables this prompt. However, I do not see any interfaces when I type “sh int” (show
interfaces).
DBGvpp# sh int
Name Idx State Counter Count
local0 0 down
This usually means the driver did not load. Notice “0: dpdk_lib_init:540: DPDK drivers found 0
ports...”. In this case, I did not load the uio_pci_driver. I will do that then try again.
# modprobe uio_pci_generic
# /usr/bin/vpp -c /etc/vpp/startup.conf
vlib_plugin_early_init:360: plugin path /usr/lib/vpp_plugins
load_one_plugin:188: Loaded plugin: acl_plugin.so (Access Control Lists)
load_one_plugin:188: Loaded plugin: dpdk_plugin.so (Data Plane Development Kit (DPDK))
…….
0: dpdk_ipsec_process:241: DPDK Cryptodev support is disabled, default to OpenSSL IPsec
0: dpdk_lib_init:540: DPDK drivers found 4 ports...
……
DBGvpp# sh int
Name Idx State Counter Count
TenGigabitEthernet2/0/0 1 down
TenGigabitEthernet2/0/1 2 down
TenGigabitEthernet86/0/0 3 down
TenGigabitEthernet86/0/1 4 down
local0 0 down
DBGvpp# quit
This looks good. Now I will quit and will start and check VPP with the service command. vppctl
is a command that allows you to run VPP cli from the user prompt.
# modprobe uio_pci_generic
# dpkg -i vpp-lib_17.04-rc2~1-g5e189f1_amd64.deb
Selecting previously unselected package vpp-lib.
(Reading database ... 139943 files and directories currently installed.)
…..
# dpkg -i vpp_17.04-rc2~1-g5e189f1_amd64.deb
Selecting previously unselected package vpp.
(Reading database ... 139983 files and directories currently installed.)
Preparing to unpack vpp_17.04-rc2~1-g5e189f1_amd64.deb ...
Unpacking vpp (17.04-rc2~1-g5e189f1) ...
….
# dpkg -i vpp-plugins_17.04-rc2~1-g5e189f1_amd64.deb
Selecting previously unselected package vpp-plugins.
(Reading database ... 140032 files and directories currently installed.)
Preparing to unpack vpp-plugins_17.04-rc2~1-g5e189f1_amd64.deb ...
Unpacking vpp-plugins (17.04-rc2~1-g5e189f1) ...
Setting up vpp-plugins (17.04-rc2~1-g5e189f1) ...
# service vpp start
# ps -eaf | grep vpp
root 1194 1 96 12:27 ? 00:00:04 /usr/bin/vpp -c /etc/vpp/startup.conf
root 1204 11029 0 12:27 pts/1 00:00:00 grep --color=auto vpp
# vppctl show int
Name Idx State Counter Count
TenGigabitEthernet2/0/0 1 down
TenGigabitEthernet2/0/1 2 down
TenGigabitEthernet86/0/0 3 down
TenGigabitEthernet86/0/1 4 down
local0 0 down
# ./dpdk-devbind.py --status
We will now uninstall VPP using apt. If we had installed the packages with dpdk we would use
“dpkg –r” to remove the packages.
With the packages removed we still see that the system does not have the ports back.
# ./dpdk-devbind.py --status
We give the ports back to the kernel using the –b option like so: