Binding DPDK to a NIC without loosing connection

4

I want to bind DPDK to a NIC and I'm following this documentation here
If I only have one physical NIC, how do we ensure that we don't loose connection to the machine while running the dpdk_nic_bind command?

More specifically, I have a Google compute VM on which I'm trying to do this, and obviously my SSH connection gets lost when I am at this step. What is the workaround for this?

Nithish Inpursuit Ofhappiness

Posted 2017-04-30T21:23:18.807

Reputation: 161

Answers

0

There is direct no workaround for this. However, there are few options to run a DPDK app without using physical NICs:

Running DPDK inside a Virtual Machine

  1. Run a virtual machine with as many NICs as you need.
  2. Inside Virtual Machine, bind NICs to UIO.
  3. Inside Virtual Machine, run DPDK and it should work OK with NICs inside Virtual Machine.

For more information, please have a look at DPDK Poll Mode Driver for Emulated Virtio NIC.

Please note, this option might not be available on VM, i.e. you might not be able to run a VM inside a VM.

Using DPDK Virtual Device

  1. Compile DPDK with libpcap support.
  2. Configure host to run a DPDK app as usual (i.e. enable huge pages etc).
  3. Do not bind any NICs to UIO.
  4. Create few TUN/TAP interfaces, bridge them with a physical NIC.
  5. Run a DPDK application as usual, but pass few --vdev arguments to create few Virtual Devices, for example:

    testpmd -l 0-3 -n 4 \ --vdev 'net_pcap0,iface=tun0' --vdev 'net_pcap1,iface=tun1' ...

For more information, please have a look at DPDK libpcap Poll Mode Driver.

Please note, this options will significantly reduce DPDK performance due to use Linux kernel functionality and pcap library.

Using NIC Virtual Functions:

  1. Configure SR-IOV support on the host.
  2. Configure few Virtual Functions on the host NIC.
  3. On host, bind few NIV Virtual Functions to vfio-pci
  4. On host, run DPDK and it should work OK with NIC Virtual Functions.

For general description of SR-IOV, you might find useful DPDK Intel Virtual Function Driver.

Please note, this option might not be available on VM.

Andriy Berestovskyy

Posted 2017-04-30T21:23:18.807

Reputation: 178