dpdk/ipsec: fix digest physical address

VPP-1034

Change-Id: Ib13cf0395bc2e42d24de51347e0aeed8a137f2f2
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
This commit is contained in:
Sergio Gonzalez Monroy
2017-10-18 14:44:24 +01:00
committed by Damjan Marion
parent fb353ce54e
commit c47652c50b
3 changed files with 10 additions and 14 deletions

View File

@ -334,10 +334,6 @@ crypto_op_setup (u8 is_aead, struct rte_mbuf *mb0,
sym_cop->m_src = mb0;
rte_crypto_op_attach_sym_session (cop, session);
if (!digest_paddr)
digest_paddr =
rte_pktmbuf_mtophys_offset (mb0, (uintptr_t) digest - (uintptr_t) mb0);
#if DPDK_NO_AEAD
sym_cop->cipher.data.offset = cipher_off;
sym_cop->cipher.data.length = cipher_len;

View File

@ -236,7 +236,7 @@ dpdk_esp_decrypt_node_fn (vlib_main_t * vm,
u32 cipher_off, cipher_len;
u32 auth_off = 0, auth_len = 0, aad_size = 0;
u8 *aad = NULL, *digest = NULL;
u64 digest_paddr = 0;
u64 digest_paddr;
u8 *iv = rte_pktmbuf_mtod_offset(mb0, void*, sizeof (esp_header_t));
dpdk_cop_priv_t *priv = (dpdk_cop_priv_t *)(sym_cop + 1);
@ -249,6 +249,8 @@ dpdk_esp_decrypt_node_fn (vlib_main_t * vm,
vlib_buffer_get_current (b0) + sizeof(esp_header_t) +
iv_size + payload_len;
digest_paddr = mb0->buf_physaddr + (digest - (u8 *) mb0->buf_addr);
if (is_aead)
{
u32 *_iv = (u32 *) iv;

View File

@ -358,6 +358,12 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
u32 cipher_off, cipher_len;
u32 auth_off = 0, auth_len = 0, aad_size = 0;
u8 *aad = NULL, *digest = NULL;
u64 digest_paddr;
digest =
vlib_buffer_get_current (b0) + b0->current_length - trunc_size;
digest_paddr = mb0->buf_physaddr + (digest - (u8 *) mb0->buf_addr);
if (is_aead)
{
@ -380,10 +386,6 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
*((u32 *) & aad[8]) = sa0->seq_hi;
aad_size = 12;
}
digest =
vlib_buffer_get_current (b0) + b0->current_length -
trunc_size;
}
else
{
@ -393,10 +395,6 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
auth_off = ip_hdr_size;
auth_len = b0->current_length - ip_hdr_size - trunc_size;
digest =
vlib_buffer_get_current (b0) + b0->current_length -
trunc_size;
if (PREDICT_FALSE (sa0->use_esn))
{
*((u32 *) digest) = sa0->seq_hi;
@ -407,7 +405,7 @@ dpdk_esp_encrypt_node_fn (vlib_main_t * vm,
crypto_op_setup (is_aead, mb0, cop, sess,
cipher_off, cipher_len, (u8 *) icb, iv_size,
auth_off, auth_len, aad, aad_size,
digest, 0, trunc_size);
digest, digest_paddr, trunc_size);
if (PREDICT_FALSE (is_ipv6))
{