From 1a52d37fc50acd479274c29c2e92b05cf32c3a6d Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 4 Feb 2021 11:33:32 +0000 Subject: ipsec: one thread index per-SA Type: improvement AN SA is uni-drectional therefore it can be used only for encrypt or decrypt, not both. So it only needs one thread ID. free up some space on the 1st cacheline. Signed-off-by: Neale Ranns Change-Id: I21cb7cff70a763cbe2bffead860b574bc80b3136 --- src/vnet/ipsec/esp_encrypt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/vnet/ipsec/esp_encrypt.c') diff --git a/src/vnet/ipsec/esp_encrypt.c b/src/vnet/ipsec/esp_encrypt.c index 4f6976baaee..e5cf1581a69 100644 --- a/src/vnet/ipsec/esp_encrypt.c +++ b/src/vnet/ipsec/esp_encrypt.c @@ -669,16 +669,16 @@ esp_encrypt_inline (vlib_main_t *vm, vlib_node_runtime_t *node, } } - if (PREDICT_FALSE (~0 == sa0->encrypt_thread_index)) + if (PREDICT_FALSE (~0 == sa0->thread_index)) { /* this is the first packet to use this SA, claim the SA * for this thread. this could happen simultaneously on * another thread */ - clib_atomic_cmp_and_swap (&sa0->encrypt_thread_index, ~0, + clib_atomic_cmp_and_swap (&sa0->thread_index, ~0, ipsec_sa_assign_thread (thread_index)); } - if (PREDICT_FALSE (thread_index != sa0->encrypt_thread_index)) + if (PREDICT_FALSE (thread_index != sa0->thread_index)) { esp_set_next_index (is_async, from, nexts, from[b - bufs], &n_async_drop, handoff_next, next); -- cgit 1.2.3-korg