fixes to dpdk startup scripts
authorYaroslav Brustinov <[email protected]>
Wed, 21 Sep 2016 11:23:52 +0000 (14:23 +0300)
committerYaroslav Brustinov <[email protected]>
Wed, 21 Sep 2016 11:23:52 +0000 (14:23 +0300)
scripts/dpdk_nic_bind.py
scripts/dpdk_setup_ports.py

index 528a813..44d4e82 100755 (executable)
@@ -346,7 +346,7 @@ def get_igb_uio_usage():
 def get_pid_using_pci(pci_list):
     if not isinstance(pci_list, list):
         pci_list = [pci_list]
-    pci_list = map(dev_id_from_dev_name, pci_list)
+    pci_list = list(map(dev_id_from_dev_name, pci_list))
     for pid in os.listdir('/proc'):
         try:
             int(pid)
@@ -587,9 +587,9 @@ def get_info_from_trex(pci_addr_list):
     stdout, _ = proc.communicate()
     if proc.returncode:
         if 'PANIC in rte_eal_init' in stdout:
-            print("Could not run TRex to get MAC info about interfaces, check if it's already running.")
+            print("Could not run TRex to get info about interfaces, check if it's already running.")
         else:
-            print('Error upon running TRex to get MAC info:\n%s' % stdout)
+            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_re = re.compile(pci_mac_str)
index 509de2e..4abb2e5 100755 (executable)
@@ -332,7 +332,7 @@ Other network devices
         if if_list and map_driver.args.parent and dpdk_nic_bind.get_igb_uio_usage():
             pid = dpdk_nic_bind.get_pid_using_pci(if_list)
             cmdline = dpdk_nic_bind.read_pid_cmdline(pid)
-            print('Some or all of given interfaces are in use by following process:\n%s' % cmdline)
+            print('Some or all of given interfaces are in use by following process:\npid: %s, cmd: %s' % (pid, cmdline))
             if not dpdk_nic_bind.confirm('Ignore and proceed (y/N):'):
                 sys.exit(1)
 
@@ -351,7 +351,7 @@ Other network devices
             pid = dpdk_nic_bind.get_pid_using_pci(dpdk_interfaces)
             if pid:
                 cmdline = dpdk_nic_bind.read_pid_cmdline(pid)
-                print('DPDK interfaces are in use. Unbinding them might cause following process to hang:\n%s' % cmdline)
+                print('DPDK interfaces are in use. Unbinding them might cause following process to hang:\npid: %s, cmd: %s' % (pid, cmdline))
                 if not dpdk_nic_bind.confirm('Confirm (y/N):'):
                     return
         drivers_table = {