Setup NICs in Dataplane

Next, determine the device ID for the interfaces. Start the CLI (Entering the TNSR CLI) and run the following command to output the device IDs as seen by the dataplane:

tnsr# configure
tnsr(config)# dataplane dpdk dev ?
  0000:02:01.0           Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet
    Controller (Copper) (rev 01) ( Active Interface eth0 )
  0000:02:02.0           Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet
    Controller (Copper) (rev 01)
  0000:02:03.0           Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet
    Controller (Copper) (rev 01)

Interfaces under host control will be noted in the output with Active Interface. Other listed interfaces are usable by TNSR.

For a fresh installation of TNSR, skip ahead to Configuring Interfaces for TNSR, otherwise continue on to identify host interfaces added after TNSR was installed.

Host Interface Name to Dataplane ID Mapping

The output of the dataplane dpdk dev ? command includes the device IDs in the first column. The device IDs will map to the network cards in a way that is typically easy to determine. For example:

Interface Identifiers

Interface

Identifier

enp0s20f0

0000:00:14.0

enp0s20f1

0000:00:14.1

enp0s20f2

0000:00:14.2

enp0s20f3

0000:00:14.3

enp3s0

0000:03:00.0

enp4s0

0000:04:00.0

The host OS interface name and VPP identifiers contain the same information represented in different ways. They both reference the PCI bus number, slot number, and function number. The Interface name contains the values in decimal while the identifier shown in VPP uses hexadecimal.

Deconstructing the first interface name, it contains the following:

Interface Name Components

Component

Interface Value

VPP ID Value

Device Type

en (Ethernet)

n/a

PCI Bus

p0

00

Bus Slot

s20

14 (Decimal 20 in Hex)

Function

f0

.0

Using this pattern, make a note of the VPP identifiers for the next step. In this example, since enp0s20f1 and enp0s20f2 are the interfaces to use, the corresponding VPP IDs are 0000:00:14.1 and 0000:00:14.2.

Configuring Interfaces for TNSR

Next, edit the dataplane configuration. Start the CLI (Entering the TNSR CLI) and enter configuration mode:

tnsr# configure
tnsr(config)#

Add the device IDs of the interfaces to be used by the VPP dataplane, determined above:

tnsr(config)# dataplane dpdk dev 0000:00:14.1 network
tnsr(config)# dataplane dpdk dev 0000:00:14.2 network

Then commit the configuration:

tnsr(config)# configuration candidate commit

Restart the VPP dataplane:

tnsr(config)# service dataplane restart
tnsr(config)# exit

The interfaces will now be available for TNSR. Start the CLI again and run show interface and verify that the interfaces appear in the output. The output example below has been shortened for brevity:

tnsr# show interface
Interface: GigabitEthernet0/14/1
[...]
Interface: GigabitEthernet0/14/2
[...]
Interface: local0
[...]

The TNSR interface name also reflects the type, followed by the PCI Bus/Slot/Function ID of each interface, using the same hexadecimal notation as VPP.

Note

Once TNSR attaches to interfaces in this way, they will no longer be shown as devices in the host OS. To return a network interface back to host OS control, see Remove TNSR NIC for Host Use.

One exception to this behavior is Mellanox network interfaces as they use the same driver for both host OS and DPDK, they still appear in the host OS.

Troubleshooting

If the interfaces do not appear in the show interface output, the default driver did not attach to those interfaces and they may require a different driver instead. To see a list of available drivers, use the following command from config mode:

tnsr(config)# dataplane dpdk uio-driver ?
  igb_uio               UIO igb driver
  uio_pci_generic       Generic UIO driver
  vfio-pci              VFIO driver

To enable a different driver, complete the command using the chosen driver name, then commit the configuration and restart the dataplane.

Note

Mellanox devices use RDMA and not UIO, so changing this driver will not have any effect on their behavior. If a Mellanox device does not appear automatically, TNSR may not support that device.

tnsr(config)# dataplane dpdk uio-driver igb_uio
tnsr(config)# configuration candidate commit
tnsr(config)# service dataplane restart
tnsr(config)# exit

Then attempt to view the interfaces with show interface again. If they are listed, then the correct driver is now active.