dpdk: fix packet offset for GCM crypto ops 27/31827/2
authorRobert Shearman <robertshearman@gmail.com>
Tue, 30 Mar 2021 10:14:41 +0000 (11:14 +0100)
committerNeale Ranns <neale@graphiant.com>
Wed, 31 Mar 2021 18:26:31 +0000 (18:26 +0000)
commit5ef22f7d2f583d2bc47b51c21d3236a3bec5b240
tree47a13e96a82c3fa5c49cb8ead2bac0ea0450d5ae
parentb2da6d6602876ce7338a4585f14330895e6bf672
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>
src/plugins/dpdk/cryptodev/cryptodev.c