From f16e9a5507c33642ac04d4b1a8712f8fac238828 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 25 Feb 2021 19:09:24 +0000 Subject: ipsec: Support async mode per-SA Type: feature This feautre only applies to ESP not AH SAs. As well as the gobal switch for ayncs mode, allow individual SAs to be async. If global async is on, all SAs are async. If global async mode is off, then if then an SA can be individually set to async. This preserves the global switch behaviour. the stratergy in the esp encrypt.decrypt nodes is to separate the frame into, 1) sync buffers, 2) async buffers and 3) no-op buffers. Sync buffer will undergo a cyrpto/ath operation, no-op will not, they are dropped or handed-off. Signed-off-by: Neale Ranns Change-Id: Ifc15b10b870b19413ad030ce7f92ed56275d6791 --- src/vnet/ipsec/ipsec_cli.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/vnet/ipsec/ipsec_cli.c') diff --git a/src/vnet/ipsec/ipsec_cli.c b/src/vnet/ipsec/ipsec_cli.c index bb80b328d56..2c7a923adc3 100644 --- a/src/vnet/ipsec/ipsec_cli.c +++ b/src/vnet/ipsec/ipsec_cli.c @@ -98,7 +98,7 @@ ipsec_sa_add_del_command_fn (vlib_main_t * vm, u16 udp_src, udp_dst; int is_add, rv; u32 m_args = 0; - tunnel_t tun; + tunnel_t tun = {}; salt = 0; error = NULL; @@ -161,6 +161,8 @@ ipsec_sa_add_del_command_fn (vlib_main_t * vm, flags |= IPSEC_SA_FLAG_USE_ESN; else if (unformat (line_input, "udp-encap")) flags |= IPSEC_SA_FLAG_UDP_ENCAP; + else if (unformat (line_input, "async")) + flags |= IPSEC_SA_FLAG_IS_ASYNC; else { error = clib_error_return (0, "parse error: '%U'", @@ -198,7 +200,7 @@ ipsec_sa_add_del_command_fn (vlib_main_t * vm, } if (rv) - error = clib_error_return (0, "failed"); + error = clib_error_return (0, "failed: %d", rv); done: unformat_free (line_input); @@ -940,7 +942,6 @@ set_async_mode_command_fn (vlib_main_t * vm, unformat_input_t * input, format_unformat_error, line_input)); } - vnet_crypto_request_async_mode (async_enable); ipsec_set_async_mode (async_enable); unformat_free (line_input); -- cgit 1.2.3-korg