Hi
When we run dpdk_setup_ports.py to create a new config file, it is failing in recent versions of TRex. I believe this is ultimately caused by the fact that dpdk_nic_bind.py is calling t-rex-64 with the --dump-interfaces argument to determine information about the devices. Depending on the current device configuration (ie. how many devices are bound to vfio-pci, their order, etc.) this only succeeds if the devices being requested are among the first 4 devices that TRex is finding. If the device(s) are not one of the first 4 found it ends up not getting a TRex_Driver assigned to it so it does not match the other devices which causes the script to error.
I think this is caused by the default m_max_ports setting in main_dpdk.cpp which defaults to 4 (and is used to control the loop in dump_interfaces_info()). Near as I can tell, the only way to change the m_max_ports value is via a config file. The fact that this only exists in a config file which is what we are trying to create gets messy -- I have not been able to figure out how to give this information to dpdk_setup_ports.py where it will still generate a new config file.
Am I missing something? Is there a way around this? Or is this just a bug?
Here are some details. On my system, I can simulate the problem by calling t-rex-64 --dump-interfaces the way dpdk_setup_ports.py does:
# show the vfio-pci bound devices...
$ pwd
/sys/module/vfio_pci/drivers/pci:vfio-pci
$ ls -l 00* | sed -e "s/^.*:[0-9]\+\s//"
0000:3b:00.0 -> ../../../../devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0
0000:3b:00.1 -> ../../../../devices/pci0000:3a/0000:3a:00.0/0000:3b:00.1
0000:5e:00.0 -> ../../../../devices/pci0000:5d/0000:5d:00.0/0000:5e:00.0
0000:5e:00.1 -> ../../../../devices/pci0000:5d/0000:5d:00.0/0000:5e:00.1
0000:af:00.0 -> ../../../../devices/pci0000:ae/0000:ae:00.0/0000:af:00.0
0000:af:00.1 -> ../../../../devices/pci0000:ae/0000:ae:00.0/0000:af:00.1
$ ./t-rex-64 --dump-interfaces 0000:3b:00.0 0000:3b:00.1 0000:5e:00.0 0000:5e:00.1 0000:af:00.0 0000:af:00.1
Starting TRex v2.87 please wait ...
Showing interfaces info.
PCI: 0000:3b:00.0 - MAC: 3C:FD:FE:EE:4C:D0 - Driver: net_i40e
PCI: 0000:3b:00.1 - MAC: 3C:FD:FE:EE:4C:D1 - Driver: net_i40e
PCI: 0000:5e:00.0 - MAC: F8:F2:1E:52:59:98 - Driver: net_ixgbe
PCI: 0000:5e:00.1 - MAC: F8:F2:1E:52:59:99 - Driver: net_ixgbe
The 0000:af:00.0|1 devices (which are the same as 0000:3b:00.0|1 -- Intel XXV710 dual port 25Gb) are always missed. I can get t-rex-64 to find them if I build a simple config file and use it instead of specifying the devices on the command line (but that isn't how
dpdk_setup_ports.py/dpdk_nic_bind.py does it):
$ cat trex_cfg.yaml
- version: 2
interfaces: ["0000:3b:00.0","0000:3b:00.1","0000:5e:00.0","0000:5e:00.1","0000:af:00.0","0000:af:00.1"]
$ ./t-rex-64 --dump-interfaces --cfg trex_cfg.yaml
Starting TRex v2.87 please wait ...
Showing interfaces info.
PCI: 0000:3b:00.0 - MAC: 3C:FD:FE:EE:4C:D0 - Driver: net_i40e
PCI: 0000:3b:00.1 - MAC: 3C:FD:FE:EE:4C:D1 - Driver: net_i40e
PCI: 0000:5e:00.0 - MAC: F8:F2:1E:52:59:98 - Driver: net_ixgbe
PCI: 0000:5e:00.1 - MAC: F8:F2:1E:52:59:99 - Driver: net_ixgbe
PCI: 0000:af:00.0 - MAC: 3C:FD:FE:A9:CF:34 - Driver: net_i40e
PCI: 0000:af:00.1 - MAC: 3C:FD:FE:A9:CF:35 - Driver: net_i40e
Karl