X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FInterfaceUtil.py;h=13a04441b25d87130b8661584296965c6c1c5ff7;hb=e9c8b39d0b6c8b7e72f26ace8233df078811b3a1;hp=42474b496a70e760ba45044eec82737b908287ec;hpb=870c6ad31b7384a7dde834bfa0f6404c545d1171;p=csit.git diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py index 42474b496a..13a04441b2 100644 --- a/resources/libraries/python/InterfaceUtil.py +++ b/resources/libraries/python/InterfaceUtil.py @@ -18,6 +18,7 @@ from enum import IntEnum from ipaddress import ip_address from robot.api import logger +from robot.libraries.BuiltIn import BuiltIn from resources.libraries.python.Constants import Constants from resources.libraries.python.DUTSetup import DUTSetup @@ -1850,7 +1851,7 @@ class InterfaceUtil: DUTSetup.pci_driver_bind(node, pf_pci_addr, kernel_driver) # Initialize PCI VFs. - DUTSetup.set_sriov_numvfs(node, pf_pci_addr, numvfs) + DUTSetup.set_sriov_numvfs(node, pf_pci_addr, numvfs=numvfs) if not numvfs: if osi_layer == u"L2": @@ -2013,7 +2014,7 @@ class InterfaceUtil: @staticmethod def vpp_round_robin_rx_placement_on_all_duts( - nodes, prefix, workers=None): + nodes, prefix, use_dp_cores=False): """Set Round Robin interface RX placement on worker threads on all DUTs. @@ -2024,14 +2025,18 @@ class InterfaceUtil: :param nodes: Topology nodes. :param prefix: Interface name prefix. - :param workers: Comma separated worker index numbers intended for - dataplane work. + :param use_dp_cores: Limit to dataplane cores. :type nodes: dict :type prefix: str - :type workers: str + :type use_dp_cores: bool """ - for node in nodes.values(): - if node[u"type"] == NodeType.DUT: + for node_name, node in nodes.items(): + if node["type"] == NodeType.DUT: + workers = None + if use_dp_cores: + workers = BuiltIn().get_variable_value( + f"${{{node_name}_cpu_dp}}" + ) InterfaceUtil.vpp_round_robin_rx_placement( node, prefix, workers )