diff options
author | Neale Ranns <neale@graphiant.com> | 2021-02-25 19:09:24 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2021-03-05 10:34:55 +0000 |
commit | f16e9a5507c33642ac04d4b1a8712f8fac238828 (patch) | |
tree | 4e38ba12c88fde939317d091f45026471f0f506b /src/vnet/ipsec/ipsec.c | |
parent | fc81134a26458a8358483b0d2908a6b83afb7f11 (diff) |
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 <neale@graphiant.com>
Change-Id: Ifc15b10b870b19413ad030ce7f92ed56275d6791
Diffstat (limited to 'src/vnet/ipsec/ipsec.c')
-rw-r--r-- | src/vnet/ipsec/ipsec.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/vnet/ipsec/ipsec.c b/src/vnet/ipsec/ipsec.c index 45ae5acd4b0..74713458b14 100644 --- a/src/vnet/ipsec/ipsec.c +++ b/src/vnet/ipsec/ipsec.c @@ -329,20 +329,15 @@ ipsec_set_async_mode (u32 is_enabled) ipsec_main_t *im = &ipsec_main; ipsec_sa_t *sa; - /* lock all SAs before change im->async_mode */ - pool_foreach (sa, ipsec_sa_pool) - { - fib_node_lock (&sa->node); - } + vnet_crypto_request_async_mode (is_enabled); im->async_mode = is_enabled; - /* change SA crypto op data before unlock them */ + /* change SA crypto op data */ pool_foreach (sa, ipsec_sa_pool) { sa->crypto_op_data = - is_enabled ? sa->async_op_data.data : sa->sync_op_data.data; - fib_node_unlock (&sa->node); + (is_enabled ? sa->async_op_data.data : sa->sync_op_data.data); } } |