3
votes

I am using dpdk library to enhance packet capturing. To use dpdk, we need to bind at least one NIC to dpdk driver. As written in dpdk documentation, I can either use uio_pci_generic or igb_ko driver.

To bind with dpdk driver, they have provided a python script: http://www.dpdk.org/browse/dpdk/plain/tools/dpdk_nic_bind.py

I have two intel NIC's in my system, Intel 82579LM and Intel 82540EM. As given at http://dpdk.org/doc/nics , Intel 82540EM is a supported NIC with driver e1000.

Now, the problem is that I am unable to bind Intel 82540EM with dpdk drivers. I did the following steps:

  1. ifdown INTERFACE_NAME
  2. modprobe uio_pci_generic (or insmod igb_ko)
  3. dpdk_nic_bind.py --bind=uio_pci_generic PCI_ID_OF_NIC

This prints an error 'Error: bind failed for PCI_ID_OF_NIC - Cannot bind to driver uio_pci_generic'. So I tried to bind it manually. I did the following steps to bind NIC manually:

  1. ifdown INTERFACE_NAME
  2. modprobe uio_pci_generic (or insmod igb_ko)
  3. echo "PCI_ID_OF_NIC" > /sys/bus/pci/drivers/e1000/unbind
  4. echo "PCI_ID_OF_NIC" > /sys/bus/pci/drivers/uio_pci_generic/bind

Even then I get 'bash: echo: write error: No such device' error. I tried the same steps with Intel 82579LM, and it binded perfectly, but unfortunately it ain't a supported NIC.

What am I doing wrong?

[EDIT update based on the comment request for Output of lspci -vnnk 01:02.0]

Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02) 
Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter [8086:002e] 
Kernel driver in use: e1000 
Kernel modules: e1000 

00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection [8086:1502] (rev 04) 
Subsystem: Dell Device [1028:052c] Kernel driver in use: e1000e 
Kernel modules: e1000e
1
show output of lspci -nk regarding to your card BDF. - 0andriy
Output of lspci -vnnk 01:02.0 Ethernet controller [0200]: Intel Corporation 82540EM Gigabit Ethernet Controller [8086:100e] (rev 02) Subsystem: Intel Corporation PRO/1000 MT Desktop Adapter [8086:002e] Kernel driver in use: e1000 Kernel modules: e1000 00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection [8086:1502] (rev 04) Subsystem: Dell Device [1028:052c] Kernel driver in use: e1000e Kernel modules: e1000e - user2914066
It's not readable, please update the post, and put the actual values instead of PCI_ID_OF_NIC in current post as well. - 0andriy
DPDK test for Intel 82540EM is through emulated NIC. I have success in using emulated NIC. Offical supported NIC are http://doc.dpdk.org/guides-20.02/nics/igb.html?highlight=known%20issues and emulated NIC https://doc.dpdk.org/guides/nics/e1000em.html. Can you share if this is emulated or physical NIC? - Vipin Varghese
@user2914066 do you have updates to share? as shared in the above command I am able to get it working in qemu. Hence I have to assume this is more with configuration or settings. - Vipin Varghese

1 Answers

0
votes

I have success in using emulated NIC with DPDK using igb_uio and uio_pci_generic. Details shared below.

  • NIC with igb_uio: Sucess
  • NIC with uio_pci_generic: Sucess
  • Intel 82540EM: emulated NIC in Virtual machine
  • DPDK version: stable-18.11.6
  • test application: l2fwd
  • cmd: ./build/l2fwd -w [pcie bdf of the NIC in VM] -- -p 0x1 -T 1

By using full PCIe [S:B:D:F] ie echo "0000:00:19.0" > /sys/bus/pci/drivers/e1000/unbind works for me