X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=resources%2Flibraries%2Fpython%2FCpuUtils.py;h=e4fff010f1ac79fa70fdc9de254488b5ad5f85bc;hb=HEAD;hp=7840b5fa6c661a9f95c4fc7db154ec6c4e9e9092;hpb=76fcd8422842d0756338502213de561eaa93e670;p=csit.git diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py index 7840b5fa6c..518469bd31 100644 --- a/resources/libraries/python/CpuUtils.py +++ b/resources/libraries/python/CpuUtils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2024 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: @@ -247,6 +247,9 @@ class CpuUtils: """Return list of DUT node related list of CPU numbers. The main computing unit is physical core count. + On SMT enabled DUTs, both sibling logical cores are used, + unless Robot variable \${smt_used} is set to False. + :param node: DUT node. :param cpu_node: Numa node number. :param nf_chains: Number of NF chains. @@ -278,6 +281,7 @@ class CpuUtils: raise RuntimeError(u"NodeID is out of range!") smt_used = CpuUtils.is_smt_enabled(node[u"cpuinfo"]) + smt_used = BuiltIn().get_variable_value("\${smt_used}", smt_used) cpu_list = CpuUtils.cpu_list_per_node(node, cpu_node, smt_used) # CPU thread sibling offset. sib = len(cpu_list) // CpuUtils.NR_OF_THREADS @@ -524,15 +528,15 @@ class CpuUtils: continue # Number of Data Plane physical cores. dp_cores_count = BuiltIn().get_variable_value( - "${{dp_cores_count}}", phy_cores + "${dp_cores_count}", phy_cores ) # Number of Feature Plane physical cores. fp_cores_count = BuiltIn().get_variable_value( - "${{fp_cores_count}}", phy_cores - dp_cores_count + "${fp_cores_count}", phy_cores - dp_cores_count ) # Ratio between RX queues and data plane threads. rxq_ratio = BuiltIn().get_variable_value( - "${{rxq_ratio}}", 1 + "${rxq_ratio}", 1 ) dut_pf_keys = BuiltIn().get_variable_value( @@ -540,7 +544,7 @@ class CpuUtils: ) # SMT override in case of non standard test cases. smt_used = BuiltIn().get_variable_value( - "${{smt_used}}", CpuUtils.is_smt_enabled(node["cpuinfo"]) + "${smt_used}", CpuUtils.is_smt_enabled(node["cpuinfo"]) ) cpu_node = Topology.get_interfaces_numa_node(node, *dut_pf_keys)