From: Fan Zhang Date: Fri, 5 Apr 2019 16:04:24 +0000 (+0100) Subject: crypto/virtio: fix IV offset X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fd4fa52cbf733164176269b5cce809403d2ef227;p=dpdk.git crypto/virtio: fix IV offset This patch fixes the incorrect iv offset calculation. Fixes: b063e843fa03 ("crypto/virtio: fix IV physical address") Cc: stable@dpdk.org Signed-off-by: Fan Zhang Acked-by: Konstantin Ananyev Reviewed-by: Maxime Coquelin --- diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c index e32a1ecd6e..e9a63cb5a0 100644 --- a/drivers/crypto/virtio/virtio_rxtx.c +++ b/drivers/crypto/virtio/virtio_rxtx.c @@ -203,8 +203,8 @@ virtqueue_crypto_sym_enqueue_xmit( uint16_t req_data_len = sizeof(struct virtio_crypto_op_data_req); uint32_t indirect_vring_addr_offset = req_data_len + sizeof(struct virtio_crypto_inhdr); - uint32_t indirect_iv_addr_offset = indirect_vring_addr_offset + - sizeof(struct vring_desc) * NUM_ENTRY_VIRTIO_CRYPTO_OP; + uint32_t indirect_iv_addr_offset = + offsetof(struct virtio_crypto_op_cookie, iv); struct rte_crypto_sym_op *sym_op = cop->sym; struct virtio_crypto_session *session = (struct virtio_crypto_session *)get_sym_session_private_data(