aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/CpuUtils.py
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2023-05-18 05:59:39 +0000
committerPeter Mikus <peter.mikus@protonmail.ch>2023-05-24 05:08:08 +0000
commitb020a7f84b18ff6885cf2a2141d27f9bb995172b (patch)
tree9954cfeb2c16d0e7a81f6f5341803b4d0ece5b64 /resources/libraries/python/CpuUtils.py
parent0d6639a38336a3f73e276d81c86ea0d0895e1f40 (diff)
refactor(trex): Startup configuration
Signed-off-by: pmikus <peter.mikus@protonmail.ch> Change-Id: I16defefa5edd01638bc382be4f5e8cbca4fe9453
Diffstat (limited to 'resources/libraries/python/CpuUtils.py')
-rw-r--r--resources/libraries/python/CpuUtils.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py
index 5805ba7787..1e306f025e 100644
--- a/resources/libraries/python/CpuUtils.py
+++ b/resources/libraries/python/CpuUtils.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2023 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -388,25 +388,23 @@ class CpuUtils:
@staticmethod
def get_affinity_trex(
- node, if1_pci, if2_pci, tg_mtc=1, tg_dtc=1, tg_ltc=1):
+ node, if_key, tg_mtc=1, tg_dtc=1, tg_ltc=1):
"""Get affinity for T-Rex. Result will be used to pin T-Rex threads.
:param node: TG node.
- :param if1_pci: TG first interface.
- :param if2_pci: TG second interface.
+ :param if_key: TG first interface.
:param tg_mtc: TG main thread count.
:param tg_dtc: TG dataplane thread count.
:param tg_ltc: TG latency thread count.
:type node: dict
- :type if1_pci: str
- :type if2_pci: str
+ :type if_key: str
:type tg_mtc: int
:type tg_dtc: int
:type tg_ltc: int
:returns: List of CPUs allocated to T-Rex including numa node.
:rtype: int, int, int, list
"""
- interface_list = [if1_pci, if2_pci]
+ interface_list = [if_key]
cpu_node = Topology.get_interfaces_numa_node(node, *interface_list)
master_thread_id = CpuUtils.cpu_slice_of_list_per_node(