On 4/3/25 2:22 PM, Rajesh Mudimadugula wrote:
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 <rmudimadu...@marvell.com>
---
  lib/vhost/vhost_crypto.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
index 3c6c5dc114..ddcd93738b 100644
--- a/lib/vhost/vhost_crypto.c
+++ b/lib/vhost/vhost_crypto.c
@@ -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;

Applied to next-virtio/for-net-next.

Thanks,
Maxime

Reply via email to