aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/InterfaceUtil.py
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2023-07-25 10:47:12 +0000
committerPeter Mikus <peter.mikus@protonmail.ch>2023-07-27 08:25:02 +0000
commit9c926fdd75cc1d65faa1ee50ce9133e754fdd498 (patch)
tree2d14680dc9a7dc43b935559bb176de2f1503613f /resources/libraries/python/InterfaceUtil.py
parentf58649004a975b8e02dd3935669fd5e15c525817 (diff)
feat(core): Core allocation
Signed-off-by: pmikus <peter.mikus@protonmail.ch> Change-Id: I782b87190dbee6e0a12c97f616b80539cd6614bd
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r--resources/libraries/python/InterfaceUtil.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 42474b496a..7d9164d8f3 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
@@ -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
)