aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/IPsecUtil.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2023-08-17 14:53:26 +0200
committerVratko Polak <vrpolak@cisco.com>2023-08-17 14:53:26 +0200
commit38c04b2566c3ecf2109611628783dd1c8a1be99a (patch)
tree730f7624a6182904279e84594b71e5b8b1c03253 /resources/libraries/python/IPsecUtil.py
parent0634490c0557d94856f6061c323cf6a2592f294b (diff)
feat(swasync): switch to polling mode
Performance of adaptive mode is bad (different bug), keep continuity of ipsec swasync tests (when VPP allows). As 23.06-release does not have the new API message, the new CSIT code needs to be more careful around CRC checking. + Add new crc collection with the new API call used. + Also keep the old collection so older VPP does not fail. + Document how papi executor works with VPP without a message. + Prevent CRC checker from raising bodus errors with old VPP. Change-Id: I9ff933a8a9558289d22d55526905d63e7894378c Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/IPsecUtil.py')
-rw-r--r--resources/libraries/python/IPsecUtil.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/resources/libraries/python/IPsecUtil.py b/resources/libraries/python/IPsecUtil.py
index 39c6a4ce2f..873b6af5d8 100644
--- a/resources/libraries/python/IPsecUtil.py
+++ b/resources/libraries/python/IPsecUtil.py
@@ -318,6 +318,8 @@ class IPsecUtil:
def vpp_ipsec_set_async_mode(node, async_enable=1):
"""Set IPsec async mode on|off.
+ Unconditionally, attempt to switch crypto dispatch into polling mode.
+
:param node: VPP node to set IPsec async mode.
:param async_enable: Async mode on or off.
:type node: dict
@@ -325,13 +327,23 @@ class IPsecUtil:
:raises RuntimeError: If failed to set IPsec async mode or if no API
reply received.
"""
- cmd = u"ipsec_set_async_mode"
- err_msg = f"Failed to set IPsec async mode on host {node[u'host']}"
- args = dict(
- async_enable=async_enable
- )
with PapiSocketExecutor(node) as papi_exec:
+ cmd = u"ipsec_set_async_mode"
+ err_msg = f"Failed to set IPsec async mode on host {node[u'host']}"
+ args = dict(
+ async_enable=async_enable
+ )
papi_exec.add(cmd, **args).get_reply(err_msg)
+ cmd = "crypto_set_async_dispatch_v2"
+ err_msg = "Failed to set dispatch mode."
+ args = dict(mode=0, adaptive=False)
+ try:
+ papi_exec.add(cmd, **args).get_reply(err_msg)
+ except (AttributeError, RuntimeError):
+ # Expected when VPP build does not have the _v2 yet
+ # (after and before the first CRC check).
+ # TODO: Fail here when testing of pre-23.10 builds is over.
+ pass
@staticmethod
def vpp_ipsec_crypto_sw_scheduler_set_worker(