Monday, 31 December 2018

DPDK No Ethernet ports

I had been trying to run dpdk on virtualbox hosted on  mac, running Ubuntu 16.04. There are quite a few installation/configuration steps. And if you miss one, all sorts of runtime errors can come up.
If you bump into:

vagrant@ubuntu-xenial:~/dpdk/build/examples/l2fwd$ sudo ./build/l2fwd -l 0-3 -n 4 -- -q 8 -p ffff
EAL: Detected 4 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Probing VFIO support...
EAL: PCI device 0000:00:03.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 8086:100e net_e1000_em
EAL: PCI device 0000:00:08.0 on NUMA socket -1
EAL:   Invalid NUMA socket, default to 0
EAL:   probe driver: 8086:100e net_e1000_em
MAC updating enabled
EAL: Error - exiting with code: 1
  Cause: No Ethernet ports - bye

That could mean you need to bind corrrect kernel driver to the interface. DPDK source contains helper script to view/bind/unbind driver to interface:

In my case, I had to bind if=enp0s8

$ ./usertools/dpdk-devbind.py -s

Network devices using kernel driver
===================================
0000:00:03.0 '82540EM Gigabit Ethernet Controller 100e' if=enp0s3 drv=e1000 unused=igb_uio *Active*
0000:00:08.0 '82540EM Gigabit Ethernet Controller 100e' if=enp0s8 drv=e1000 unused=igb_uio *Active*

so, bind with:

vagrant@ubuntu-xenial:~/dpdk$ sudo ifconfig enp0s8 down
vagrant@ubuntu-xenial:~/dpdk$ sudo ./usertools/dpdk-devbind.py --bind=igb_uio enp0s8

and verify:

vagrant@ubuntu-xenial:~/dpdk$ ./usertools/dpdk-devbind.py -s

Network devices using DPDK-compatible driver
============================================
0000:00:08.0 '82540EM Gigabit Ethernet Controller 100e' drv=igb_uio unused=e1000

Network devices using kernel driver
===================================
0000:00:03.0 '82540EM Gigabit Ethernet Controller 100e' if=enp0s3 drv=e1000 unused=igb_uio *Active*



DPDK docs:  
https://doc.dpdk.org/guides/linux_gsg/linux_drivers.html#binding-and-unbinding-network-ports-to-from-the-kernel-modules



Harry

Author & Editor

A technology enthusiast and addictive blogger who likes to hacking tricks and wish to be the best White Hacket Hacker of the World.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.