X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FCpuUtils.py;h=8871a5b6510ded4fb304174163939bd31cc7833d;hp=5f43e211a233d77da345b8e179be528024cf5901;hb=c3ce59c652caaee06b3090f387f8826c15102703;hpb=68f39d30d623b95dfe13a20d73313b7c173eec2a diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py index 5f43e211a2..8871a5b651 100644 --- a/resources/libraries/python/CpuUtils.py +++ b/resources/libraries/python/CpuUtils.py @@ -388,7 +388,7 @@ class CpuUtils: @staticmethod def get_affinity_trex( - node, if_key, tg_mtc=1, tg_dtc=1, tg_ltc=1): + node, if_key, tg_mtc=1, tg_dtc=1, tg_ltc=1, tg_dtc_offset=0): """Get affinity for T-Rex. Result will be used to pin T-Rex threads. :param node: TG node. @@ -396,11 +396,13 @@ class CpuUtils: :param tg_mtc: TG main thread count. :param tg_dtc: TG dataplane thread count. :param tg_ltc: TG latency thread count. + :param tg_dtc_offset: TG dataplane thread offset. :type node: dict :type if_key: str :type tg_mtc: int :type tg_dtc: int :type tg_ltc: int + :type tg_dtc_offset: int :returns: List of CPUs allocated to T-Rex including numa node. :rtype: int, int, int, list """ @@ -412,12 +414,11 @@ class CpuUtils: smt_used=False) threads = CpuUtils.cpu_slice_of_list_per_node( - node, cpu_node, skip_cnt=tg_mtc, cpu_cnt=tg_dtc, - smt_used=False) + node, cpu_node, skip_cnt=tg_mtc + tg_ltc + tg_dtc_offset, + cpu_cnt=tg_dtc, smt_used=False) latency_thread_id = CpuUtils.cpu_slice_of_list_per_node( - node, cpu_node, skip_cnt=tg_mtc + tg_dtc, cpu_cnt=tg_ltc, - smt_used=False) + node, cpu_node, skip_cnt=tg_mtc, cpu_cnt=tg_ltc, smt_used=False) return master_thread_id[0], latency_thread_id[0], cpu_node, threads