aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk
diff options
context:
space:
mode:
authorRobert Shearman <robertshearman@gmail.com>2021-03-30 11:14:41 +0100
committerNeale Ranns <neale@graphiant.com>2021-03-31 18:26:31 +0000
commit5ef22f7d2f583d2bc47b51c21d3236a3bec5b240 (patch)
tree47a13e96a82c3fa5c49cb8ead2bac0ea0450d5ae /src/plugins/dpdk
parentb2da6d6602876ce7338a4585f14330895e6bf672 (diff)
dpdk: fix packet offset for GCM crypto ops
The crypto op data offset passed into DPDK is relative to the mbuf buffer address plus the mbuf data offset, therefore the mbuf data offset needs to be set rather than left at whatever previous value it was at, which is likely to be incorrect and result in the wrong portion of the packet being encrypted/decrypted for GCM. The fe->crypto_start_offset field is relative to the start of the vlib buffer (as opposed to the current data pointer), so set the mbuf data_off field to VLIB_BUFFER_PRE_DATA_SIZE when performing a GCM crypto op enqueue to match the crypto_start_offset semantics. This then matches the behaviour in the non-GCM case. Type: fix Change-Id: I0ac2a44139387158765a3e04cfcaa5ee6f11d395 Signed-off-by: Robert Shearman <robertshearman@gmail.com>
Diffstat (limited to 'src/plugins/dpdk')
-rw-r--r--src/plugins/dpdk/cryptodev/cryptodev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/dpdk/cryptodev/cryptodev.c b/src/plugins/dpdk/cryptodev/cryptodev.c
index d87a16c37a0..cd9d104224b 100644
--- a/src/plugins/dpdk/cryptodev/cryptodev.c
+++ b/src/plugins/dpdk/cryptodev/cryptodev.c
@@ -684,6 +684,7 @@ cryptodev_frame_gcm_enqueue (vlib_main_t * vm,
}
sop->m_src = rte_mbuf_from_vlib_buffer (b);
+ sop->m_src->data_off = VLIB_BUFFER_PRE_DATA_SIZE;
sop->m_dst = 0;
/* mbuf prepend happens in the tx, but vlib_buffer happens in the nodes,
* so we have to manually adjust mbuf data_off here so cryptodev can