From: Damjan Marion Date: Wed, 29 May 2019 16:49:25 +0000 (+0200) Subject: ipsec: fix perf issue in esp_aad_fill X-Git-Tag: v20.01-rc0~523 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F81%2F19881%2F1;p=vpp.git ipsec: fix perf issue in esp_aad_fill Type: fix Fixes: 47feb11 Change-Id: I6b3b97cd361eef19c910c14fd06edb001a4c191b Signed-off-by: Damjan Marion --- 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__ */