From 30b8b4a5d49e7884dcb830ffb1167ec4ddcdb931 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 29 May 2019 18:49:25 +0200 Subject: ipsec: fix perf issue in esp_aad_fill Type: fix Fixes: 47feb11 Change-Id: I6b3b97cd361eef19c910c14fd06edb001a4c191b Signed-off-by: Damjan Marion --- src/vnet/ipsec/esp.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vnet/ipsec/esp.h b/src/vnet/ipsec/esp.h index 070726faa34..f36f52a4752 100644 --- a/src/vnet/ipsec/esp.h +++ b/src/vnet/ipsec/esp.h @@ -137,18 +137,21 @@ esp_aad_fill (vnet_crypto_op_t * op, esp_aead_t *aad; aad = (esp_aead_t *) op->aad; - clib_memcpy_fast (aad, esp, 8); + aad->data[0] = esp->spi; if (ipsec_sa_is_set_USE_ESN (sa)) { /* SPI, seq-hi, seq-low */ - aad->data[2] = aad->data[1]; aad->data[1] = clib_host_to_net_u32 (sa->seq_hi); + aad->data[2] = esp->seq; op->aad_len = 12; } else - /* SPI, seq-low */ - op->aad_len = 8; + { + /* SPI, seq-low */ + aad->data[1] = esp->seq; + op->aad_len = 8; + } } #endif /* __ESP_H__ */ -- cgit 1.2.3-korg