aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2021-06-11 13:06:34 +0000
committerPeter Mikus <pmikus@cisco.com>2021-06-17 13:26:40 +0000
commita275fa0062158d712152f542b7bc9ec40b5c5f31 (patch)
tree7d55c04747fd49f0ac08c9452976088f2df0791f /resources/libraries
parent70766243f6c00c77fedc00d68114c108528950d6 (diff)
Core: Rework CPU allocation
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I6826add7b3032041632c3952c45a3c64409400b0
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/python/CpuUtils.py121
-rw-r--r--resources/libraries/python/IPsecUtil.py57
-rw-r--r--resources/libraries/python/InterfaceUtil.py52
-rw-r--r--resources/libraries/python/NATUtil.py2
-rw-r--r--resources/libraries/robot/crypto/ipsec.robot40
-rw-r--r--resources/libraries/robot/dpdk/default.robot28
-rw-r--r--resources/libraries/robot/ip/nat.robot2
-rw-r--r--resources/libraries/robot/performance/performance_utils.robot2
-rw-r--r--resources/libraries/robot/shared/container.robot8
-rw-r--r--resources/libraries/robot/shared/default.robot152
-rw-r--r--resources/libraries/robot/shared/interfaces.robot2
11 files changed, 216 insertions, 250 deletions
diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py
index e23404b1dd..f556c51814 100644
--- a/resources/libraries/python/CpuUtils.py
+++ b/resources/libraries/python/CpuUtils.py
@@ -85,29 +85,6 @@ class CpuUtils:
)
@staticmethod
- def worker_count_from_cores_and_smt(phy_cores, smt_used):
- """Simple conversion utility, needs smt from caller.
-
- The implementation assumes we pack 1 or 2 workers per core,
- depending on hyperthreading.
-
- Some keywords use None to indicate no core/worker limit,
- so this converts None to None.
-
- :param phy_cores: How many physical cores to use for workers.
- :param smt_used: Whether symmetric multithreading is used.
- :type phy_cores: Optional[int]
- :type smt_used: bool
- :returns: How many VPP workers fit into the given number of cores.
- :rtype: Optional[int]
- """
- if phy_cores is None:
- return None
- workers_per_core = CpuUtils.NR_OF_THREADS if smt_used else 1
- workers = phy_cores * workers_per_core
- return workers
-
- @staticmethod
def cpu_node_count(node):
"""Return count of numa nodes.
@@ -502,8 +479,8 @@ class CpuUtils:
@staticmethod
def get_cpu_idle_list(node, cpu_node, smt_used, cpu_alloc_str, sep=u","):
- """
- Get idle CPU List
+ """Get idle CPU List.
+
:param node: Node dictionary with cpuinfo.
:param cpu_node: Numa node number.
:param smt_used: True - we want to use SMT, otherwise false.
@@ -521,3 +498,97 @@ class CpuUtils:
cpu_idle_list = [i for i in cpu_list
if str(i) not in cpu_alloc_str.split(sep)]
return cpu_idle_list
+
+ @staticmethod
+ def get_affinity_vpp_vswitch(
+ nodes, node, phy_cores, rx_queues=None, rxd=None, txd=None):
+ """Get affinity or VPP switch.
+
+ :param nodes: Topology nodes.
+ :param node: Topology node string.
+ :param phy_cores: Number of physical cores to allocate.
+ :param rx_queues: Number of RX queues. (Optional, Default: None)
+ :param rxd: Number of RX descriptors. (Optional, Default: None)
+ :param txd: Number of TX descriptors. (Optional, Default: None)
+ :type nodes: dict
+ :type node: str
+ :type phy_cores: int
+ :type rx_queues: int
+ :type rxd: int
+ :type txd: int
+ :returns: Compute resource information dictionary.
+ :rtype: dict
+ """
+ # Number of Data Plane physical cores.
+ dp_cores_count = BuiltIn().get_variable_value(
+ f"${{dp_cores_count}}", phy_cores
+ )
+ # Number of Feature Plane physical cores.
+ fp_cores_count = BuiltIn().get_variable_value(
+ f"${{fp_cores_count}}", phy_cores - dp_cores_count
+ )
+ # Ratio between RX queues and data plane threads.
+ rxq_ratio = BuiltIn().get_variable_value(
+ f"${{rxq_ratio}}", 1
+ )
+
+ dut_pf_keys = BuiltIn().get_variable_value(
+ f"${{{node}_pf_keys}}"
+ )
+ # SMT override in case of non standard test cases.
+ smt_used = BuiltIn().get_variable_value(
+ f"${{smt_used}}", CpuUtils.is_smt_enabled(nodes[node][u"cpuinfo"])
+ )
+
+ cpu_node = Topology.get_interfaces_numa_node(nodes[node], *dut_pf_keys)
+ skip_cnt = Constants.CPU_CNT_SYSTEM
+ cpu_main = CpuUtils.cpu_list_per_node_str(
+ nodes[node], cpu_node,
+ skip_cnt=skip_cnt,
+ cpu_cnt=Constants.CPU_CNT_MAIN,
+ smt_used=False
+ )
+ skip_cnt += Constants.CPU_CNT_MAIN
+ cpu_dp = CpuUtils.cpu_list_per_node_str(
+ nodes[node], cpu_node,
+ skip_cnt=skip_cnt,
+ cpu_cnt=int(dp_cores_count),
+ smt_used=smt_used
+ ) if int(dp_cores_count) else u""
+ skip_cnt = skip_cnt + int(dp_cores_count)
+ cpu_fp = CpuUtils.cpu_list_per_node_str(
+ nodes[node], cpu_node,
+ skip_cnt=skip_cnt,
+ cpu_cnt=int(fp_cores_count),
+ smt_used=smt_used
+ ) if int(fp_cores_count) else u""
+
+ fp_count_int = \
+ int(fp_cores_count) * CpuUtils.NR_OF_THREADS if smt_used \
+ else int(fp_cores_count)
+ dp_count_int = \
+ int(dp_cores_count) * CpuUtils.NR_OF_THREADS if smt_used \
+ else int(dp_cores_count)
+
+ rxq_count_int = rx_queues if rx_queues else int(dp_count_int/rxq_ratio)
+ rxq_count_int = 1 if not rxq_count_int else rxq_count_int
+
+ compute_resource_info = dict()
+ compute_resource_info[u"buffers_numa"] = 215040 if smt_used else 107520
+ compute_resource_info[u"smt_used"] = smt_used
+ compute_resource_info[u"cpu_main"] = cpu_main
+ compute_resource_info[u"cpu_dp"] = cpu_dp
+ compute_resource_info[u"cpu_fp"] = cpu_fp
+ compute_resource_info[u"cpu_wt"] = \
+ u",".join(filter(None, [cpu_dp, cpu_fp]))
+ compute_resource_info[u"cpu_alloc_str"] = \
+ u",".join(filter(None, [cpu_main, cpu_dp, cpu_fp]))
+ compute_resource_info[u"cpu_count_int"] = \
+ int(dp_cores_count) + int(fp_cores_count)
+ compute_resource_info[u"rxd_count_int"] = rxd
+ compute_resource_info[u"txd_count_int"] = txd
+ compute_resource_info[u"rxq_count_int"] = rxq_count_int
+ compute_resource_info[u"fp_count_int"] = fp_count_int
+ compute_resource_info[u"dp_count_int"] = dp_count_int
+
+ return compute_resource_info
diff --git a/resources/libraries/python/IPsecUtil.py b/resources/libraries/python/IPsecUtil.py
index e066bc9424..520cf7b932 100644
--- a/resources/libraries/python/IPsecUtil.py
+++ b/resources/libraries/python/IPsecUtil.py
@@ -29,8 +29,9 @@ from resources.libraries.python.IPAddress import IPAddress
from resources.libraries.python.IPUtil import IPUtil, IpDscp, MPLS_LABEL_INVALID
from resources.libraries.python.PapiExecutor import PapiSocketExecutor
from resources.libraries.python.ssh import scp_node
-from resources.libraries.python.topology import Topology
+from resources.libraries.python.topology import Topology, NodeType
from resources.libraries.python.VatExecutor import VatExecutor
+from resources.libraries.python.VPPUtil import VPPUtil
IPSEC_UDP_PORT_NONE = 0xffff
@@ -324,27 +325,57 @@ class IPsecUtil:
@staticmethod
def vpp_ipsec_crypto_sw_scheduler_set_worker(
- node, worker_index, crypto_enable=False):
+ node, workers, crypto_enable=False):
"""Enable or disable crypto on specific vpp worker threads.
:param node: VPP node to enable or disable crypto for worker threads.
- :param worker_index: VPP worker thread index.
+ :param workers: List of VPP thread numbers.
:param crypto_enable: Disable or enable crypto work.
:type node: dict
- :type worker_index: int
+ :type workers: Iterable[int]
:type crypto_enable: bool
:raises RuntimeError: If failed to enable or disable crypto for worker
thread or if no API reply received.
"""
- cmd = u"crypto_sw_scheduler_set_worker"
- err_msg = f"Failed to disable/enable crypto for worker thread " \
- f"on host {node[u'host']}"
- args = dict(
- worker_index=worker_index,
- crypto_enable=crypto_enable
- )
- with PapiSocketExecutor(node) as papi_exec:
- papi_exec.add(cmd, **args).get_reply(err_msg)
+ for worker in workers:
+ cmd = u"crypto_sw_scheduler_set_worker"
+ err_msg = f"Failed to disable/enable crypto for worker thread " \
+ f"on host {node[u'host']}"
+ args = dict(
+ worker_index=worker - 1,
+ crypto_enable=crypto_enable
+ )
+ with PapiSocketExecutor(node) as papi_exec:
+ papi_exec.add(cmd, **args).get_reply(err_msg)
+
+ @staticmethod
+ def vpp_ipsec_crypto_sw_scheduler_set_worker_on_all_duts(
+ nodes, workers, crypto_enable=False):
+ """Enable or disable crypto on specific vpp worker threads.
+
+ :param node: VPP node to enable or disable crypto for worker threads.
+ :param workers: List of VPP thread numbers.
+ :param crypto_enable: Disable or enable crypto work.
+ :type node: dict
+ :type workers: Iterable[int]
+ :type crypto_enable: bool
+ :raises RuntimeError: If failed to enable or disable crypto for worker
+ thread or if no API reply received.
+ """
+ for node in nodes.values():
+ if node[u"type"] == NodeType.DUT:
+ thread_data = VPPUtil.vpp_show_threads(node)
+ worker_cnt = len(thread_data) - 1
+ if not worker_cnt:
+ return None
+ worker_ids = list()
+ for item in thread_data:
+ if str(item.cpu_id) in workers.split(u","):
+ worker_ids.append(item.id)
+
+ IPsecUtil.vpp_ipsec_crypto_sw_scheduler_set_worker(
+ node, workers=worker_ids, crypto_enable=crypto_enable
+ )
@staticmethod
def vpp_ipsec_add_sad_entry(
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 94c78a1bef..fed2beed3b 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -20,7 +20,6 @@ from ipaddress import ip_address
from robot.api import logger
from resources.libraries.python.Constants import Constants
-from resources.libraries.python.CpuUtils import CpuUtils
from resources.libraries.python.DUTSetup import DUTSetup
from resources.libraries.python.IPAddress import IPAddress
from resources.libraries.python.L2Util import L2Util
@@ -1930,64 +1929,69 @@ class InterfaceUtil:
@staticmethod
def vpp_round_robin_rx_placement(
- node, prefix, dp_worker_limit=None):
+ node, prefix, workers=None):
"""Set Round Robin interface RX placement on all worker threads
on node.
- If specified, dp_core_limit limits the number of physical cores used
+ If specified, workers limits the number of physical cores used
for data plane I/O work. Other cores are presumed to do something else,
e.g. asynchronous crypto processing.
None means all workers are used for data plane work.
- Note this keyword specifies workers, not cores.
:param node: Topology nodes.
:param prefix: Interface name prefix.
- :param dp_worker_limit: How many cores for data plane work.
+ :param workers: Comma separated worker index numbers intended for
+ dataplane work.
:type node: dict
:type prefix: str
- :type dp_worker_limit: Optional[int]
+ :type workers: str
"""
- worker_id = 0
- worker_cnt = len(VPPUtil.vpp_show_threads(node)) - 1
- if dp_worker_limit is not None:
- worker_cnt = min(worker_cnt, dp_worker_limit)
+ thread_data = VPPUtil.vpp_show_threads(node)
+ worker_cnt = len(thread_data) - 1
if not worker_cnt:
- return
+ return None
+ worker_ids = list()
+ if workers:
+ for item in thread_data:
+ if str(item.cpu_id) in workers.split(u","):
+ worker_ids.append(item.id)
+ else:
+ for item in thread_data:
+ if u"vpp_main" not in item.name:
+ worker_ids.append(item.id)
+
+ worker_idx = 0
for placement in InterfaceUtil.vpp_sw_interface_rx_placement_dump(node):
for interface in node[u"interfaces"].values():
if placement[u"sw_if_index"] == interface[u"vpp_sw_index"] \
and prefix in interface[u"name"]:
InterfaceUtil.vpp_sw_interface_set_rx_placement(
node, placement[u"sw_if_index"], placement[u"queue_id"],
- worker_id % worker_cnt
+ worker_ids[worker_idx % len(worker_ids)] - 1
)
- worker_id += 1
+ worker_idx += 1
@staticmethod
def vpp_round_robin_rx_placement_on_all_duts(
- nodes, prefix, dp_core_limit=None):
- """Set Round Robin interface RX placement on all worker threads
+ nodes, prefix, workers=None):
+ """Set Round Robin interface RX placement on worker threads
on all DUTs.
- If specified, dp_core_limit limits the number of physical cores used
+ If specified, workers limits the number of physical cores used
for data plane I/O work. Other cores are presumed to do something else,
e.g. asynchronous crypto processing.
None means all cores are used for data plane work.
- Note this keyword specifies cores, not workers.
:param nodes: Topology nodes.
:param prefix: Interface name prefix.
- :param dp_worker_limit: How many cores for data plane work.
+ :param workers: Comma separated worker index numbers intended for
+ dataplane work.
:type nodes: dict
:type prefix: str
- :type dp_worker_limit: Optional[int]
+ :type workers: str
"""
for node in nodes.values():
if node[u"type"] == NodeType.DUT:
- dp_worker_limit = CpuUtils.worker_count_from_cores_and_smt(
- phy_cores=dp_core_limit,
- smt_used=CpuUtils.is_smt_enabled(node[u"cpuinfo"]),
- )
InterfaceUtil.vpp_round_robin_rx_placement(
- node, prefix, dp_worker_limit
+ node, prefix, workers
)
diff --git a/resources/libraries/python/NATUtil.py b/resources/libraries/python/NATUtil.py
index 60e0e6d1a3..8a5d8c1404 100644
--- a/resources/libraries/python/NATUtil.py
+++ b/resources/libraries/python/NATUtil.py
@@ -288,7 +288,7 @@ class NATUtil:
:rtype: int
"""
# vpp-device tests have not dedicated physical core so
- # ${thr_count_int} == 0 but we need to use one thread
+ # ${dp_count_int} == 0 but we need to use one thread
threads = 1 if not int(threads) else int(threads)
rest, mult = modf(log2(sessions/(10*threads)))
return 2 ** (int(mult) + (1 if rest else 0)) * 10
diff --git a/resources/libraries/robot/crypto/ipsec.robot b/resources/libraries/robot/crypto/ipsec.robot
index dc1265f434..b847667026 100644
--- a/resources/libraries/robot/crypto/ipsec.robot
+++ b/resources/libraries/robot/crypto/ipsec.robot
@@ -232,40 +232,14 @@
| | | VPP Ipsec Set Async Mode | ${nodes['${dut}']}
| | END
-| Disable Crypto Work of VPP Worker Threads on all VPP DUTs
+| Set Data Plane And Feature Plane Workers for IPsec on all VPP DUTs
| | [Documentation]
| | ... | Disable crypto work for specified data plane CPU cores
-| | ... | on all DUT nodes.
-| | ... | Currently only "port" (physical) interfaces are supported.
-| | ... | Will need a redesign if virtual interfaces (memif, vhost-user)
-| | ... | are present.
-| |
-| | ... | *Arguments:*
-| | ... | - dp_cores - Number of physical cores. Type: integer
-| |
-| | [Arguments] | ${dp_cores}
+| | ... | on all DUT nodes (leaving feature plane workers enabled).
+| | ... | Set Round Robin interface RX placement on data plane CPU cores
+| | ... | on all DUT nodes (leaving feature plane workers disabled).
| |
| | VPP Round Robin Rx Placement on all DUTs
-| | ... | ${nodes} | prefix=port | dp_core_limit=${dp_cores}
-| | FOR | ${dut} | IN | @{duts}
-| | | Disable Crypto Work of VPP Worker Threads on node
-| | | ... | ${dut} | ${dp_cores}
-| | END
-
-| Disable Crypto Work of VPP Worker Threads on node
-| | [Documentation]
-| | ... | Disable crypto work for specified data plane cores
-| | ... | on DUT node.
-| |
-| | ... | *Arguments:*
-| | ... | - dut - DUT node. Type: string
-| | ... | - dp_cores - Number of physical cores. Type: integer
-| |
-| | [Arguments] | ${dut} | ${dp_cores}
-| |
-| | # Workers From Physical Cores keyword is currently defined in default.robot
-| | ${dp_worker_count} = | Workers From Physical Cores | ${dp_cores}
-| | FOR | ${worker_index} | IN RANGE | ${dp_worker_count}
-| | | VPP IPSec Crypto SW Scheduler Set Worker
-| | | ... | ${nodes['${dut}']} | ${worker_index} | crypto_enable=${False}
-| | END
+| | ... | ${nodes} | prefix=${EMPTY} | workers=${cpu_dp}
+| | VPP IPSec Crypto SW Scheduler Set Worker on all DUTs
+| | ... | ${nodes} | workers=${cpu_dp} | crypto_enable=${False} \ No newline at end of file
diff --git a/resources/libraries/robot/dpdk/default.robot b/resources/libraries/robot/dpdk/default.robot
index 53e3f9f04e..8b7f4dcd7e 100644
--- a/resources/libraries/robot/dpdk/default.robot
+++ b/resources/libraries/robot/dpdk/default.robot
@@ -35,7 +35,7 @@
| | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False}
| |
| | ${cpu_count_int} | Convert to Integer | ${phy_cores}
-| | ${thr_count_int} | Convert to Integer | ${phy_cores}
+| | ${dp_count_int} | Convert to Integer | ${phy_cores}
| | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
| | FOR | ${dut} | IN | @{duts}
| | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
@@ -43,23 +43,23 @@
| | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
| | | ${cpus}= | Cpu List Per Node Str | ${nodes['${dut}']} | ${numa}
| | | ... | skip_cnt=${2} | cpu_cnt=${cpu_count_int} | smt_used=${smt_used}
-| | | ${thr_count_int}= | Run keyword if | ${smt_used} |
+| | | ${dp_count_int}= | Run keyword if | ${smt_used} |
| | | ... | Evaluate | int(${cpu_count_int}*2) | ELSE | Set variable
-| | | ... | ${thr_count_int}
+| | | ... | ${dp_count_int}
| | | ${rxq_ratio} = | Get Variable Value | \${rxq_ratio} | ${1}
| | | ${rxq_count_int}= | Run Keyword If | ${rx_queues}
| | | ... | Set variable | ${rx_queues}
-| | | ... | ELSE | Evaluate | int(${thr_count_int}/${rxq_ratio})
+| | | ... | ELSE | Evaluate | int(${dp_count_int}/${rxq_ratio})
| | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
| | | ... | Set variable | ${1}
| | | ... | ELSE | Set variable | ${rxq_count_int}
| | | Start testpmd
| | | ... | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
-| | | ... | ${cpus} | ${thr_count_int} | ${rxq_count_int} | ${jumbo_frames}
+| | | ... | ${cpus} | ${dp_count_int} | ${rxq_count_int} | ${jumbo_frames}
| | | ... | ${nic_rxq_size} | ${nic_txq_size}
-| | | Run keyword if | ${thr_count_int} > 1
+| | | Run keyword if | ${dp_count_int} > 1
| | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
-| | | Set Tags | ${thr_count_int}T${cpu_count_int}C
+| | | Set Tags | ${dp_count_int}T${cpu_count_int}C
| | END
| Start l3fwd on all DUTs
@@ -78,7 +78,7 @@
| | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${jumbo_frames}=${False}
| |
| | ${cpu_count_int} | Convert to Integer | ${phy_cores}
-| | ${thr_count_int} | Convert to Integer | ${phy_cores}
+| | ${dp_count_int} | Convert to Integer | ${phy_cores}
| | ${dp_cores}= | Evaluate | ${cpu_count_int}+1
| | FOR | ${dut} | IN | @{duts}
| | | ${numa}= | Get interfaces numa node | ${nodes['${dut}']}
@@ -86,19 +86,19 @@
| | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
| | | ${cpus}= | Cpu List Per Node Str | ${nodes['${dut}']} | ${numa}
| | | ... | skip_cnt=${2} | cpu_cnt=${cpu_count_int} | smt_used=${smt_used}
-| | | ${thr_count_int}= | Run keyword if | ${smt_used} |
+| | | ${dp_count_int}= | Run keyword if | ${smt_used} |
| | | ... | Evaluate | int(${cpu_count_int}*2) | ELSE | Set variable
-| | | ... | ${thr_count_int}
+| | | ... | ${dp_count_int}
| | | ${rxq_count_int}= | Run keyword if | ${rx_queues}
| | | ... | Set variable | ${rx_queues}
-| | | ... | ELSE | Evaluate | int(${thr_count_int}/1)
+| | | ... | ELSE | Evaluate | int(${dp_count_int}/1)
| | | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
| | | ... | Set variable | ${1}
| | | ... | ELSE | Set variable | ${rxq_count_int}
| | | Start l3fwd
| | | ... | ${nodes} | ${nodes['${dut}']} | ${${dut}_pf1}[0] | ${${dut}_pf2}[0]
-| | | ... | ${cpus} | ${thr_count_int} | ${rxq_count_int} | ${jumbo_frames}
-| | | Run keyword if | ${thr_count_int} > 1
+| | | ... | ${cpus} | ${dp_count_int} | ${rxq_count_int} | ${jumbo_frames}
+| | | Run keyword if | ${dp_count_int} > 1
| | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
-| | | Set Tags | ${thr_count_int}T${cpu_count_int}C
+| | | Set Tags | ${dp_count_int}T${cpu_count_int}C
| | END
diff --git a/resources/libraries/robot/ip/nat.robot b/resources/libraries/robot/ip/nat.robot
index 202ade34a5..c33c875389 100644
--- a/resources/libraries/robot/ip/nat.robot
+++ b/resources/libraries/robot/ip/nat.robot
@@ -51,7 +51,7 @@
| | ... | - n_sessions - Expected number of opened sessions.
| |
| | ${max_sessions}= | Compute Max Translations Per Thread
-| | ... | ${n_sessions} | ${thr_count_int}
+| | ... | ${n_sessions} | ${dp_count_int}
| | Enable NAT44 Plugin | ${dut1} | mode=${nat_mode} | sessions=${max_sessions}
| | Configure inside and outside interfaces
| | ... | ${dut1} | ${DUT1_${int}1}[0] | ${DUT1_${int}2}[0]
diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot
index 96b0e0e430..c6c98fbf8a 100644
--- a/resources/libraries/robot/performance/performance_utils.robot
+++ b/resources/libraries/robot/performance/performance_utils.robot
@@ -486,7 +486,7 @@
| | ${smt_used}= | Is SMT enabled | ${nodes['${iperf_server_node}']['cpuinfo']}
| | ${vm_status} | ${value}= | Run Keyword And Ignore Error
| | ... | Get Library Instance | vnf_manager
-| | ${vth}= | Evaluate | (${thr_count_int} + 1)
+| | ${vth}= | Evaluate | (${dp_count_int} + 1)
| | ${cpu_skip_cnt}= | Set Variable If | '${vm_status}' == 'PASS'
| | ... | ${CPU_CNT_SYSTEM}
| | ... | ${${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN} + ${cpu_count_int} + ${vth}}
diff --git a/resources/libraries/robot/shared/container.robot b/resources/libraries/robot/shared/container.robot
index 1d4c9a17b0..4b2ad22527 100644
--- a/resources/libraries/robot/shared/container.robot
+++ b/resources/libraries/robot/shared/container.robot
@@ -325,15 +325,15 @@
| | Acquire all '${container_group}' containers
| | Create all '${container_group}' containers
| | ${cpu_count_int} | Convert to Integer | ${phy_cores}
-| | ${thr_count_int} | Convert to Integer | ${phy_cores}
+| | ${dp_count_int} | Convert to Integer | ${phy_cores}
| | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
-| | ${thr_count_int}= | Run keyword if | ${smt_used}
+| | ${dp_count_int}= | Run keyword if | ${smt_used}
| | ... | Evaluate | int(${cpu_count_int}*2)
-| | ... | ELSE | Set variable | ${thr_count_int}
+| | ... | ELSE | Set variable | ${dp_count_int}
| | ${rxq_ratio} = | Get Variable Value | \${rxq_ratio} | ${1}
| | ${rxq_count_int}= | Run Keyword If | ${rx_queues}
| | ... | Set variable | ${rx_queues}
-| | ... | ELSE | Evaluate | int(${thr_count_int}/${rxq_ratio})
+| | ... | ELSE | Evaluate | int(${dp_count_int}/${rxq_ratio})
| | ${rxq_count_int}= | Run keyword if | ${rxq_count_int} == 0
| | ... | Set variable | ${1}
| | ... | ELSE | Set variable | ${rxq_count_int}
diff --git a/resources/libraries/robot/shared/default.robot b/resources/libraries/robot/shared/default.robot
index 58c2189b9b..4905da5baa 100644
--- a/resources/libraries/robot/shared/default.robot
+++ b/resources/libraries/robot/shared/default.robot
@@ -75,8 +75,6 @@
| ${cpu_alloc_str}= | ${0}
*** Keywords ***
-# TODO: Sort keywords alphabetically.
-
| Call Resetter
| | [Documentation]
| | ... | Check for a presence of test variable \${resetter}.
@@ -123,29 +121,6 @@
| | Should Not Contain Match | ${results} | FAIL
| | ... | msg=At least one of statistic commands failed!
-| Workers From Physical Cores
-| | [Documentation]
-| | ... | Convert from core count to worker count.
-| |
-| | ... | This just calls CpuUtils.worker_count_from_cores_and_smt keyword
-| | ... | with the global \${smt_used} value.
-| | ... | See documentation there.
-| |
-| | ... | *Arguments:*
-| | ... | - phy_cores - Number of physical cores to convert from. Type: integer.
-| |
-| | ... | *Return value:*
-| | ... | - Number of workers active on the given number of cores.
-| |
-| | ... | *Example:*
-| |
-| | ... | \| \${dp_workers} = \| Workers from Physical Cores \| \${1} \|
-| |
-| | [Arguments] | ${phy_cores}
-| |
-| | Run Keyword And Return | Worker Count From Cores And Smt
-| | ... | phy_cores=${phy_cores} | smt_used=${smt_used}
-
| Configure crypto device on all DUTs
| | [Documentation] | Verify if Crypto QAT device virtual functions are
| | ... | initialized on all DUTs. If parameter force_init is set to True, then
@@ -241,9 +216,7 @@
| | ... | automatically map also the sibling logical cores.
| | ... | Keyword will automatically set the appropriate test TAGs in format
| | ... | mTnC, where m=logical_core_count and n=physical_core_count.
-| | ... | RXQ are computed automatically by dividing thread count with number 2
-| | ... | (TODO: Add division by actual number of interfaces). User can manually
-| | ... | override RX, RXD, TXD parameters if needed.
+| | ... | User can manually override RXQ, RXD, TXD parameters if needed.
| |
| | ... | *Arguments:*
| | ... | - phy_cores - Number of physical cores to use. Type: integer
@@ -258,120 +231,33 @@
| | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${rxd}=${None}
| | ... | ${txd}=${None}
| |
-| | ${cpu_count_int} | Convert to Integer | ${phy_cores}
-| | ${thr_count_int} | Convert to Integer | ${phy_cores}
-| | ${rxd_count_int}= | Set variable | ${rxd}
-| | ${txd_count_int}= | Set variable | ${txd}
| | FOR | ${dut} | IN | @{duts}
-| | | ${numa}= | Get interfaces numa node
-| | | ... | ${nodes['${dut}']} | @{${dut}_pf_keys}
-| | | ${smt_used}= | Is SMT enabled | ${nodes['${dut}']['cpuinfo']}
-| | | ${skip_cnt}= | Set variable | ${CPU_CNT_SYSTEM}
-| | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
-| | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${CPU_CNT_MAIN}
-| | | ${skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN}
-| | | ${cpu_wt}= | Run Keyword If | ${cpu_count_int} > 0 |
-| | | ... | Cpu list per node str | ${nodes['${dut}']} | ${numa}
-| | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int}
-| | | ... | smt_used=${smt_used}
-| | | ${thr_count_int}= | Run Keyword If | ${smt_used}
-| | | ... | Evaluate | int(${cpu_count_int}*2)
-| | | ... | ELSE | Set variable | ${thr_count_int}
-| | | ${rxq_ratio} = | Get Variable Value | \${rxq_ratio} | ${1}
-| | | ${rxq_count_int}= | Run Keyword If | ${rx_queues}
-| | | ... | Set variable | ${rx_queues}
-| | | ... | ELSE | Evaluate | int(${thr_count_int}/${rxq_ratio})
-| | | ${rxq_count_int}= | Run Keyword If | ${rxq_count_int} == 0
-| | | ... | Set variable | ${1}
-| | | ... | ELSE | Set variable | ${rxq_count_int}
+| | | &{compute_resource_info}= | Get Affinity VPP Vswitch
+| | | ... | ${nodes} | ${dut} | ${phy_cores} | rx_queues=${rx_queues}
+| | | ... | rxd=${rxd} | txd=${txd}
+| | | Set Test Variable | &{compute_resource_info}
+| | | Create compute resources variables
| | | Run Keyword | ${dut}.Add CPU Main Core | ${cpu_main}
| | | Run Keyword If | ${cpu_count_int} > 0
| | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt}
-| | | Run Keyword If | ${smt_used}
-| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE
-| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${107520}
-| | | Run Keyword If | ${thr_count_int} > 1
-| | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
-| | | Set Tags | ${thr_count_int}T${cpu_count_int}C
+| | | Run Keyword | ${dut}.Add Buffers Per Numa | ${buffers_numa}
| | END
-| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_main}
-| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt}
-| | Set Test Variable | ${smt_used}
-| | Set Test Variable | ${cpu_alloc_str}
-| | Set Test Variable | ${cpu_count_int}
-| | Set Test Variable | ${thr_count_int}
-| | Set Test Variable | ${rxd_count_int}
-| | Set Test Variable | ${txd_count_int}
-| | Set Test Variable | ${rxq_count_int}
-| Add worker threads for GSO tests to all DUTs
-| | [Documentation] | Setup worker threads in vpp startup configuration on all
-| | ... | DUTs. Based on the SMT configuration of DUT if enabled keyword will
-| | ... | automatically map also the sibling logical cores.
-| | ... | Keyword will automatically set the appropriate test TAGs in format
-| | ... | mTnC, where m=logical_core_count and n=physical_core_count.
-| | ... | RXQ are computed automatically by dividing thread count with number 2
-| | ... | (TODO: Add division by actual number of interfaces). User can manually
-| | ... | override RX, RXD, TXD parameters if needed.
-| |
-| | ... | *Arguments:*
-| | ... | - phy_cores - Number of physical cores to use. Type: integer
-| | ... | - rx_queues - Number of RX queues. Type: integer
-| | ... | - rxd - Number of RX descriptors. Type: integer
-| | ... | - txd - Number of TX descriptors. Type: integer
-| |
-| | ... | *Example:*
-| |
-| | ... | \| Add worker threads for GSO tests to all DUTs \| ${1} \| ${1} \|
+| Create compute resources variables
+| | [Documentation]
+| | ... | Create compute resources variables
| |
-| | [Arguments] | ${phy_cores} | ${rx_queues}=${None} | ${rxd}=${None}
-| | ... | ${txd}=${None}
+| | ... | _NOTE:_ This KW sets various suite variables based on computed
+| | ... | resources.
| |
-| | ${cpu_count_int} | Convert to Integer | ${phy_cores}
-| | ${thr_count_int} | Convert to Integer | ${phy_cores}
-| | ${rxd_count_int}= | Set variable | ${rxd}
-| | ${txd_count_int}= | Set variable | ${txd}
-| | FOR | ${dut} | IN | @{duts}
-| | | ${numa}= | Get interfaces numa node
-| | | ... | ${nodes['${dut}']} | @{${dut}_pf_keys}
-| | | ${smt_used}= | Set variable | ${False}
-| | | ${skip_cnt}= | Set variable | ${CPU_CNT_SYSTEM}
-| | | ${cpu_main}= | Cpu list per node str | ${nodes['${dut}']} | ${numa}
-| | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${CPU_CNT_MAIN}
-| | | ${skip_cnt}= | Evaluate | ${CPU_CNT_SYSTEM} + ${CPU_CNT_MAIN}
-| | | ${cpu_wt}= | Run Keyword If | ${cpu_count_int} > 0 |
-| | | ... | Cpu list per node str | ${nodes['${dut}']} | ${numa}
-| | | ... | skip_cnt=${skip_cnt} | cpu_cnt=${cpu_count_int}
-| | | ... | smt_used=${smt_used}
-| | | ${thr_count_int}= | Run Keyword If | ${smt_used}
-| | | ... | Evaluate | int(${cpu_count_int}*2)
-| | | ... | ELSE | Set variable | ${thr_count_int}
-| | | ${rxq_ratio} = | Get Variable Value | \${rxq_ratio} | ${1}
-| | | ${rxq_count_int}= | Run Keyword If | ${rx_queues}
-| | | ... | Set variable | ${rx_queues}
-| | | ... | ELSE | Evaluate | int(${thr_count_int}/${rxq_ratio})
-| | | ${rxq_count_int}= | Run Keyword If | ${rxq_count_int} == 0
-| | | ... | Set variable | ${1}
-| | | ... | ELSE | Set variable | ${rxq_count_int}
-| | | Run Keyword | ${dut}.Add CPU Main Core | ${cpu_main}
-| | | Run Keyword If | ${cpu_count_int} > 0
-| | | ... | ${dut}.Add CPU Corelist Workers | ${cpu_wt}
-| | | Run Keyword If | ${smt_used}
-| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${215040} | ELSE
-| | | ... | Run Keyword | ${dut}.Add Buffers Per Numa | ${107520}
-| | | Run Keyword If | ${thr_count_int} > 1
-| | | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
-| | | Set Tags | ${thr_count_int}T${cpu_count_int}C
+| | ${variables}= | Get Dictionary Keys | ${compute_resource_info}
+| | FOR | ${variable} | IN | @{variables}
+| | | ${value}= | Get From Dictionary | ${compute_resource_info} | ${variable}
+| | | Set Test Variable | ${${variable}} | ${value}
| | END
-| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_main}
-| | ${cpu_alloc_str}= | Catenate | SEPARATOR=, | ${cpu_alloc_str} | ${cpu_wt}
-| | Set Test Variable | ${smt_used}
-| | Set Test Variable | ${cpu_alloc_str}
-| | Set Test Variable | ${cpu_count_int}
-| | Set Test Variable | ${thr_count_int}
-| | Set Test Variable | ${rxd_count_int}
-| | Set Test Variable | ${txd_count_int}
-| | Set Test Variable | ${rxq_count_int}
+| | Run Keyword If | ${dp_count_int} > 1
+| | ... | Set Tags | MTHREAD | ELSE | Set Tags | STHREAD
+| | Set Tags | ${dp_count_int}T${cpu_count_int}C
| Add DPDK VLAN strip offload switch off between DUTs
| | [Documentation]
diff --git a/resources/libraries/robot/shared/interfaces.robot b/resources/libraries/robot/shared/interfaces.robot
index 5bb7c855f3..1a7b32ea00 100644
--- a/resources/libraries/robot/shared/interfaces.robot
+++ b/resources/libraries/robot/shared/interfaces.robot
@@ -151,7 +151,7 @@
| | | Run Keyword If | ${nic_txq_size} > 0
| | | ... | ${dut}.Add DPDK Dev Default TXD | ${nic_txq_size}
| | | Run Keyword If | '${crypto_type}' != '${None}'
-| | | ... | ${dut}.Add DPDK Cryptodev | ${thr_count_int}
+| | | ... | ${dut}.Add DPDK Cryptodev | ${dp_count_int}
| | | Run Keyword | ${dut}.Add DPDK Max Simd Bitwidth | ${GRAPH_NODE_VARIANT}
| | END
| | ${_vlan_strip} | ${value}= | Run Keyword And Ignore Error