[1/2] vhost: fix cipher data length
Checks
Commit Message
This patch fixes cipher data length, in the event of algorithm
chaining. When enqueuing crypto op to vhost backend
cipher.data.length is set correctly which is in
virtqueue_crypto_sym_pkt_header_arrange(). This field is computed
and assigned wrongly instead of using passed value. This is
rectified and using correct cipher data length in vhost crypto.
Fixes: 3bb595ecd682 ("vhost/crypto: add request handler")
Signed-off-by: Rajesh Mudimadugula <rmudimadugul@marvell.com>
---
lib/vhost/vhost_crypto.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
> This patch fixes cipher data length, in the event of algorithm
> chaining. When enqueuing crypto op to vhost backend
> cipher.data.length is set correctly which is in
> virtqueue_crypto_sym_pkt_header_arrange(). This field is computed
> and assigned wrongly instead of using passed value. This is
> rectified and using correct cipher data length in vhost crypto.
>
> Fixes: 3bb595ecd682 ("vhost/crypto: add request handler")
Cc: stable@dpdk.org
>
> Signed-off-by: Rajesh Mudimadugula <rmudimadugul@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
@@ -1358,8 +1358,7 @@ prepare_sym_chain_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,
op->sess_type = RTE_CRYPTO_OP_WITH_SESSION;
op->sym->cipher.data.offset = chain->para.cipher_start_src_offset;
- op->sym->cipher.data.length = chain->para.src_data_len -
- chain->para.cipher_start_src_offset;
+ op->sym->cipher.data.length = chain->para.len_to_cipher;
op->sym->auth.data.offset = chain->para.hash_start_src_offset;
op->sym->auth.data.length = chain->para.len_to_hash;