diff options
author | Yulong Pei <yulong.pei@intel.com> | 2020-11-19 13:56:18 -0700 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2021-02-19 14:56:13 +0000 |
commit | f0e964d35af36f0923c6ae0421e74d94022cadba (patch) | |
tree | 30356991ac278dcf52d2ba1f77d3314047293666 /resources/libraries/python/CpuUtils.py | |
parent | 3a2c37ffa4755d89247684935fd27d8868fbfe4b (diff) |
Add test suites for crypto sw scheduler engine
This patch is to add test suites for vpp plugin crypto_sw_scheduler,
IPsec sync mode is to do crypto and packet forward work in same worker cores,
crypto_sw_scheduler can schedule crypto work to other async crypto cores to
improve whole crypto processing capability.
This test suites configure fixed 1 rx queues per port, then measure IPsec
performance with 1, 2, 3 crypto cores.
This patchset include 1, 2, 4, 8 ipsec tunnels test cases.
+Vratko help to change to count total physical cores instead of previous only
count crypto cores in test cases.
Change-Id: I0e67182e3d13273890a23703d838101900e25126
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Signed-off-by: pmikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries/python/CpuUtils.py')
-rw-r--r-- | resources/libraries/python/CpuUtils.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/resources/libraries/python/CpuUtils.py b/resources/libraries/python/CpuUtils.py index 70177f5d9a..170cbe6b2e 100644 --- a/resources/libraries/python/CpuUtils.py +++ b/resources/libraries/python/CpuUtils.py @@ -85,6 +85,29 @@ 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. |