Dumping interface info was broken in v2.18
authorYaroslav Brustinov <[email protected]>
Wed, 22 Feb 2017 12:07:24 +0000 (14:07 +0200)
committerYaroslav Brustinov <[email protected]>
Wed, 22 Feb 2017 12:07:24 +0000 (14:07 +0200)
Change-Id: Icec84cb2912d6e179c5aac536825a04b47bebb2b
Signed-off-by: Yaroslav Brustinov <[email protected]>
scripts/dpdk_nic_bind.py
scripts/dpdk_setup_ports.py
src/main_dpdk.cpp

index 44d618b..7908b7c 100755 (executable)
@@ -603,7 +603,7 @@ def get_info_from_trex(pci_addr_list):
         else:
             print('Error upon running TRex to get interfaces info:\n%s' % stdout)
         sys.exit(1)
-    pci_mac_str = 'PCI: (\S+).+?MAC: (\S+).+?Driver: (\S+)'
+    pci_mac_str = 'PCI: (\S+).+?MAC: (\S+).+?Driver: (\S*)'
     pci_mac_re = re.compile(pci_mac_str)
     for line in stdout.splitlines():
         match = pci_mac_re.match(line)
index d1f4f31..f619bc6 100755 (executable)
@@ -607,12 +607,15 @@ Other network devices
             'net_virtio': 'virtio-pci',
             'net_enic': 'enic',
         }
-        for pci, info in dpdk_nic_bind.get_info_from_trex(dpdk_interfaces).items():
+        nics_info = dpdk_nic_bind.get_info_from_trex(dpdk_interfaces)
+        if not nics_info:
+            raise DpdkSetup('Could not determine interfaces information. Try to run manually: sudo ./t-rex-64 --dump-interfaces')
+        for pci, info in nics_info.items():
             if pci not in self.m_devices:
                 raise DpdkSetup('Internal error: PCI %s is not found among devices' % pci)
             dev = self.m_devices[pci]
             if info['TRex_Driver'] not in drivers_table:
-                print('Got unknown driver %s, description: %s' % (info['TRex_Driver'], dev['Device_str']))
+                print("Got unknown driver '%s', description: %s" % (info['TRex_Driver'], dev['Device_str']))
             else:
                 print('Returning to Linux %s' % pci)
                 dpdk_nic_bind.bind_one(pci, drivers_table[info['TRex_Driver']], False)
index f8ec055..df6f63a 100644 (file)
@@ -5743,7 +5743,7 @@ void dump_interfaces_info() {
         ether_format_addr(mac_str, sizeof mac_str, &mac_addr);
         printf("PCI: %04x:%02x:%02x.%d - MAC: %s - Driver: %s\n",
             pci_addr.domain, pci_addr.bus, pci_addr.devid, pci_addr.function, mac_str,
-            rte_eth_devices[port_id].device->devargs->virt.drv_name);
+            rte_eth_devices[port_id].data->drv_name);
     }
 }