What causes EIO (-5) from dpdk? - dpdk

Trying to get Intel adapter E810-XXVDA2 to work with VPP (using vfio-pci driver) and cannot figure out the error. When I use the adapter outside of VPP/DPDK, it works just fine (uses ice driver).
Adapter: Intel(R) Ethernet Network Adapter E810-XXVDA2, driver: vfio-pci
VPP: v22.02
Linux: kernel 5.13.0-40-generic, Ubuntu focal 20.04.3 LTS
When interface is specified in /etc/vpp/startup.conf and started with vppctl:
vpp# show hardware-interfaces TwentyFiveGigabitEthernet37/0/0
Name Idx Link Hardware
TwentyFiveGigabitEthernet37/0/0 1 up TwentyFiveGigabitEthernet37/0/0
...
rx bytes ok 2613819
rx missed 18468
Errors:
rte_eth_dev_start[port:0, errno:-5]: Unknown error -5
rte_eth_dev_start[port:0, errno:-5]: Unknown error -5
What does the -5 (EIO) from dpdk mean? Thanks in advance!
EDIT:
I was able to get past this error. Going by the suggestion from #VipinVarghese, I turned on logging (which for VPP users means adding log-level pmd,8 to dpdk section and default-log-level debug in logging section of /etc/vpp/startup.conf).
There I saw that there was a second error which needed me to update ice driver. I was at 1.3.4, I moved it to 1.8.8. After that, both errors got resolved.
The errors were:
2022/05/04 19:58:48:594 error dpdk Interface TwentyFiveGigabitEthernet37/0/0 error -5: Unknown error -5
2022/05/04 19:58:48:594 error interface sw_set_flags_helper: dpdk_interface_admin_up_down: Interface start failed
2022/05/04 19:58:48:595 notice dpdk ice_tx_queue_start(): >>
2022/05/04 19:58:48:595 notice dpdk ice_rx_queue_start(): >>
2022/05/04 19:58:48:595 notice dpdk ice_program_hw_rx_queue(): Port (0) - Rx queue (0) is set with RXDID : 22
2022/05/04 19:58:48:595 notice dpdk ice_program_hw_rx_queue(): currently package doesn't support RXDID (22)
2022/05/04 19:58:48:595 notice dpdk ice_rx_queue_start(): fail to program RX queue 0
2022/05/04 19:58:48:595 notice dpdk ice_dev_start(): fail to start Rx queue 0
RXDID #22 (ICE_RXDID_COMMS_OVS) was not supported until later versions.

DPDK ICE (columibaville E810) PMD can return EIO at 2 different places
HW or device reset - hw->resetting
Traffic Manager configuration - hw->tm_conf
Hence to nail down on the exact problem, always run it with DPDK EAL_INIT option --log-level=pmd,8. This will help to capture more details with respect to PMD. I highly recommend to use the appropriate driver and firmware version against the DPDK version as mentioned in section 25.3.
[Update] updating the linux driver (which in turn houses the DDP and firmware) has solved the issue for #schugcove.

Related

DPDK Number of ports must be even

I spent some time trying to figure out how to fix the "number of ports must be even" error. I've seen this answer which explains how to run DPDK inside a VM. I was wondering if there is a solution that does not require one.
My platform: Debian 10, Linux 5.8 (on a laptop) with an e1000e NIC driver
What I want to do: Make the skeleton (basicfwd) app work
My problem: rte_eth_dev_count_avail returns 0
What I did up until now: I followed the documentation and tried to setup a vfio_pci driver to my ethernet device.
Two things:
When I bind a device with the vfio_pci driver it loses its IP
interface
I can't create VF devices because I can't write in /sys/bus/pci/devices/ even when I su root
The skeleton program is not working with this so I tried using another driver.
I bound the device to the uio_pci_generic driver. It does bind to it but the app still doesn't work. Here is the dpdk-devbind.py --status output:
Network devices using DPDK-compatible driver
============================================
0000:00:1f.6 'Device 0d4f' drv=uio_pci_generic unused=e1000e
What happens when I launch the program:
$ sudo ./build/examples/dpdk-skeleton -l 0-3 -n 4 -a 0000:00:1f.6
EAL: Detected 8 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: No legacy callbacks, legacy socket not created
EAL: Error - exiting with code: 1
Cause: Error: number of ports must be even
Thanks for reading, any help is appreciated !
In VM I am able to get e1000 bind with the following steps
Start VM with 82540EM Gigabit Ethernet Controller
Download and build DPDK 21.02
insmod igb_uio or modprobe uio_pci_generic
bind with vfio-pci fails with vfio-pci: probe of 0000:00:08.0 failed with error -22
start the application with ./a.out -l 1 --log-level=pmd,8
build application: gcc basicfwd.c $(pkg-config --libs --cflags --static libdpdk
Logs:
e1000_null_phy_generic(): e1000_null_phy_generic
e1000_read_phy_reg_m88(): e1000_read_phy_reg_m88
e1000_null_ops_generic(): e1000_null_ops_generic
e1000_read_phy_reg_mdic(): e1000_read_phy_reg_mdic
e1000_null_phy_generic(): e1000_null_phy_generic
e1000_read_phy_reg_m88(): e1000_read_phy_reg_m88
e1000_null_ops_generic(): e1000_null_ops_generic
e1000_read_phy_reg_mdic(): e1000_read_phy_reg_mdic
e1000_null_phy_generic(): e1000_null_phy_generic
e1000_setup_copper_link_generic(): Unable to establish link!!!
e1000_setup_link_generic(): Initializing the Flow Control address, type and timer regs
e1000_set_fc_watermarks_generic(): e1000_set_fc_watermarks_generic
e1000_clear_hw_cntrs_82540(): e1000_clear_hw_cntrs_82540
e1000_clear_hw_cntrs_base_generic(): e1000_clear_hw_cntrs_base_generic
e1000_check_for_copper_link_generic(): e1000_check_for_copper_link
e1000_phy_has_link_generic(): e1000_phy_has_link_generic
e1000_read_phy_reg_m88(): e1000_read_phy_reg_m88
e1000_null_ops_generic(): e1000_null_ops_generic
e1000_read_phy_reg_mdic(): e1000_read_phy_reg_mdic
e1000_null_phy_generic(): e1000_null_phy_generic
e1000_read_phy_reg_m88(): e1000_read_phy_reg_m88
e1000_null_ops_generic(): e1000_null_ops_generic
e1000_read_phy_reg_mdic(): e1000_read_phy_reg_mdic
e1000_null_phy_generic(): e1000_null_phy_generic
e1000_null_ops_generic(): e1000_null_ops_generic
eth_em_dev_init(): port_id 0 vendorID=0x8086 deviceID=0x100e
note: unmodified skeleton requires an even number of ports to work properly.
Hence there is no issue with e1000 and DPDK usability
[EDIT-1] had a live debug with Jeremy, the issue is now reproduced on a physical machine with physical NIC (an not emulated e1000). Checking the PCIe details the physical NIC is not in the list of supported Intel DPDK NIC. Requested to use a physical NIC recommend from DPDK.

The ports always returns 0 when I run suricata based dpdk

I have installed DPDK-19.11.1 LTS successfully as follows:
And the NIC I have bound as follows:
If I run an example (dpdk/dpdk-stable-19.11.3/examples/skeleton/build/basicfwd),the function rte_eth_dev_count_avail() returns the ports I bound with dpdk-devbind.py.
I have also installed Suricata-4.1.4 on Ubuntu 16.04 LTS,but when I run suricata,the dpdk ports always returns 0:
So I want to know how can I solve this problem?
Checking the update in the ticket https://github.com/vipinpv85/DPDK_SURICATA-4_1_1/issues/11, the solution is already shared as can you please check if you are using the latest version? If yes please add support for 1G Intel NIC in your environment and update ASAP
hence please add the missing PMD for your use case.
[EDIT-2] the DPDK PMD used for 1G Intel NIC is rte_pmd_e1000
[EDIT-3] had live debug, show case the change to be added for Makfile. Tested and it works
Thanks for vipin's kind help. I have solve this problem successfully.
This is because in dpdk/suricata-4.1.4/src/Makefile, there is only support for i40e. So I add the -lrte_pmd_e1000 -Wl for i350.

Gdb can't connect to OpenOCD on stm32

Trying to debug my sample blink_led code on STM32L476 Nucleo-64 board but gdb can't connect to OpenOCD (connection drops almost instantly with error). I've read plenty of posts here and there but none of them helped. Tried adding commands to OpenOCD using -c but no change of behavior.
My code compiles both in Release and Debug config in Eclipse. I can flash the bin file using drag and drop (while the board has built-in STLink add-on) and looks the code runs perfectly on the board (LED blinks).
Cross compiling on Centos7 using the following versions:
Toolchain (gdb): gcc-arm-none-eabi-8-2018-q4-major
OpenOCD: 0.10.0-11-20190118-1134
As using eclipse didn't work I tried the command line,
(I'm not an experienced developer in this environment so I could not find any config file closer to my stm32l476 board than the stm32l4discovery.cfg, please let me know if there might be some issues using it)
./bin/openocd -f scripts/board/stm32l4discovery.cfg -c "init"
It starts,
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:37)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 500 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : clock speed 500 kHz
Info : STLINK V2J28M17 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.244386
Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Then starting GDB:
./arm-none-eabi-gdb ~/eclipse-workspace/test-blink-led/Debug/test-blink-led.elf
then running the following command in gdb:
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
Remote connection closed
As it shows gdb connection drops instantly and OpenOCD prompts the following errors:
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080022e6 msp: 0x20017ff8
Info : device id = 0x10076415
Warn : STM32 flash size failed, probe inaccurate - assuming 1024k flash
Info : flash size = 1024kbytes
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected
Error: jtag status contains invalid mode value - communication failure
Polling target stm32l4x.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms
So from those geeks who do it on a similar platform on a daily basis, can anyone help and tell me where am I doing wrong. Does missing any compile-time flag might result in this problem?
I'm scratching my head for a couple of days now so please let me have your hints.
One of the reasons may be that your STLINK firmware seems pretty old (STLINK V2J28M17 as your log shows). I suggest downloading the STSW-LINK007 application to upgrade the firmware. The software is a multiplatform Java application. It works flawlessly in Debian GNU/Linux.
Currently, I use another gdb server texane/stlink for my debugging task with GDB without any problem on some Nucleo and also custom boards. I use target extended-remote command to join the port of the server. Maybe you can try to connect with this command also under OpenOCD.
Try
telnet localhost 4444
it worked for me, while 3333 didn't

X710 (i40e) NIC DPDK bind Error in centos 7.3

When I use dpdk-devbind.py to bind a port of Network port of X710. I get error:
Error: bind failed for 0000:20.00.0 - Cannot bind to driver uio_pci_generic.
Error: unbind failed for 0000:20:00.0 - Cannot open /sys/bus/pci/drivers//unbind
The command was run by root user. Linux version is: 3.10.0-693.21.1.el7.x86_64. It is run in CentOS 7.3.
Same haredware, same command run in CentOS 7 (Linux: 3.10.0-123.el7.x86_64), the bind work well.
In addition, CentOS 7.3 with Intel X520 work well with dpdk.
Something else: before bind command from dpdp, in CentOS 7, ifconfig cannot view i40e port. but in CentOS 7.3, it can see the ports.
Looks like Linux Kernel problem, but when I upgrade kernel to 4.16 (mainline) or 4.4 (longterm), I get ERST: cannot request mem error. Anything else I can try?
you should bind with igb_uio , generic is not supported for this type of intel controller.

STM32F722EZ Nucleo, ST-Link-v2-1, Openocd 0.10.0 open failed in "init" and "ocd_bouncer"

Windows7 64bit
With the Nucleo connected to USB port I was able to use ST-LINK Utility to download the hex file to the board successfully. But after execute the command:
..\bin\openocd.exe -f board\st_nucleo_f7.cfg
With st_nucleof7.cfg contains following lines:
source [find interface/stlink-v2-1.cfg]
transport select hla_swd
source [find target/stm32f7x.cfg]
reset_config srst_only
...and stlink-v2-1.cfg has:
interface hla
hla_layout stlink
hla_device_desc "ST-LINK/V2-1"
hla_vid_pid 0x0483 0x374b
...and Device Manager shows USB Device as "STLINK dongle" with Hardware lds Value as:
USB\VID_0483&PID_374B&REV_0100&MI_00
USB\VID_0483&PID_374B&MI_00
It seems all VID and PID are matched.
...but I got the following error. Could someone tell me what is wrong in my setup please?
GNU ARM Eclipse 64-bits Open On-Chip Debugger 0.10.0-00113-g0f83948 (2017-01-24-
18:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results mi
ght differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Error: open failed
in procedure 'init'
in procedure 'ocd_bouncer'
Thanks,
Brian
I found the answer here:
https://www.eevblog.com/forum/microcontrollers/openocd-fail-to-open-stm32-nucleo-board/
Evidently OpenOCD cannot connect to USB 3.0 port. I switched to another port and it worked!!!
Why no one at OpenOCD instructs that it doesn't work with usb 3.0? I have spent a few days on this problem.
I still don't know how to tell which port has 2.0 or 3.0 version looking at the Device Manager.