Update of VPP_STABLE_VER and DPDK_STABLE_VER
[csit.git] / resources / libraries / python / InterfaceUtil.py
index 878edd6..7fc7f85 100644 (file)
@@ -26,7 +26,7 @@ from resources.libraries.python.VatExecutor import VatExecutor, VatTerminal
 from resources.libraries.python.VatJsonUtil import VatJsonUtil
 from resources.libraries.python.VPPUtil import VPPUtil
 from resources.libraries.python.parsers.JsonParser import JsonParser
-
+from resources.libraries.python.CpuUtils import CpuUtils
 
 class InterfaceUtil(object):
     """General utilities for managing interfaces"""
@@ -582,7 +582,10 @@ class InterfaceUtil(object):
                     try:
                         numa_node = int(out)
                         if numa_node < 0:
-                            raise ValueError
+                            if CpuUtils.cpu_node_count(node) == 1:
+                                numa_node = 0
+                            else:
+                                raise ValueError
                     except ValueError:
                         logger.trace('Reading numa location failed for: {0}'\
                             .format(if_pci))
@@ -1335,11 +1338,11 @@ class InterfaceUtil(object):
         current_driver = DUTSetup.get_pci_dev_driver(node,\
             pf_pci_addr.replace(':', r'\:'))
 
+        VPPUtil.stop_vpp_service(node)
         if current_driver != kernel_driver:
             # PCI device must be re-bound to kernel driver before creating VFs.
             DUTSetup.verify_kernel_module(node, kernel_driver, force_load=True)
             # Stop VPP to prevent deadlock.
-            VPPUtil.stop_vpp_service(node)
             # Unbind from current driver.
             DUTSetup.pci_driver_unbind(node, pf_pci_addr)
             # Bind to kernel driver.