aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/IPsecUtil.py
diff options
context:
space:
mode:
authorYulong Pei <yulong.pei@intel.com>2020-11-19 13:56:18 -0700
committerVratko Polak <vrpolak@cisco.com>2021-02-19 14:56:13 +0000
commitf0e964d35af36f0923c6ae0421e74d94022cadba (patch)
tree30356991ac278dcf52d2ba1f77d3314047293666 /resources/libraries/python/IPsecUtil.py
parent3a2c37ffa4755d89247684935fd27d8868fbfe4b (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/IPsecUtil.py')
-rw-r--r--resources/libraries/python/IPsecUtil.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/resources/libraries/python/IPsecUtil.py b/resources/libraries/python/IPsecUtil.py
index 99a470d934..2bc10d3ac9 100644
--- a/resources/libraries/python/IPsecUtil.py
+++ b/resources/libraries/python/IPsecUtil.py
@@ -321,6 +321,30 @@ class IPsecUtil:
papi_exec.add(cmd, **args).get_reply(err_msg)
@staticmethod
+ def vpp_ipsec_crypto_sw_scheduler_set_worker(
+ node, worker_index, 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 crypto_enable: Disable or enable crypto work.
+ :type node: dict
+ :type worker_index: 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)
+
+ @staticmethod
def vpp_ipsec_add_sad_entry(
node, sad_id, spi, crypto_alg, crypto_key, integ_alg=None,
integ_key=u"", tunnel_src=None, tunnel_dst=None):