X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fipsec%2Fipsec.c;h=74713458b145967438dba5cd3ed31c2a3e338aff;hb=f16e9a550;hp=84d2293d4826b246a024b98312a18820a31a3b4f;hpb=2d49830c7dabd3104770957724d61f8fa6998235;p=vpp.git diff --git a/src/vnet/ipsec/ipsec.c b/src/vnet/ipsec/ipsec.c index 84d2293d482..74713458b14 100644 --- a/src/vnet/ipsec/ipsec.c +++ b/src/vnet/ipsec/ipsec.c @@ -246,10 +246,9 @@ clib_error_t * ipsec_rsc_in_use (ipsec_main_t * im) { /* return an error is crypto resource are in use */ - if (pool_elts (im->sad) > 0) - return clib_error_return (0, - "%d SA entries configured", - pool_elts (im->sad)); + if (pool_elts (ipsec_sa_pool) > 0) + return clib_error_return (0, "%d SA entries configured", + pool_elts (ipsec_sa_pool)); return (NULL); } @@ -330,21 +329,16 @@ 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, im->sad) - { - 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 */ - pool_foreach (sa, im->sad) - { - sa->crypto_op_data = is_enabled ? - sa->async_op_data.data : sa->sync_op_data.data; - fib_node_unlock (&sa->node); - } + /* 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); + } } static void