From 123b5ebb9816e520d3029146ee233826f4e974bc Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Fri, 16 Oct 2020 14:03:55 +0000 Subject: ipsec: Layout and prefetching of SA struct Type: improvement - collect all DP used variables onto 1st or 2nd cache line - prefetch the 2nd cache line - in encrypt prefetch the likely location of the trailer. Signed-off-by: Neale Ranns Change-Id: I44d58f8d2d469ff71a4f4a71578e7cc1acaeba43 --- src/vnet/ipsec/esp_decrypt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/vnet/ipsec/esp_decrypt.c') diff --git a/src/vnet/ipsec/esp_decrypt.c b/src/vnet/ipsec/esp_decrypt.c index 75092cc9581..ff9fc0c2d37 100644 --- a/src/vnet/ipsec/esp_decrypt.c +++ b/src/vnet/ipsec/esp_decrypt.c @@ -1096,6 +1096,9 @@ esp_decrypt_inline (vlib_main_t * vm, current_sa_index = vnet_buffer (b[0])->ipsec.sad_index; sa0 = pool_elt_at_index (im->sad, current_sa_index); + + /* fetch the second cacheline ASAP */ + CLIB_PREFETCH (sa0->cacheline1, CLIB_CACHE_LINE_BYTES, LOAD); cpd.icv_sz = sa0->integ_icv_size; cpd.iv_sz = sa0->crypto_iv_size; cpd.flags = sa0->flags; -- cgit 1.2.3-korg