DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rajesh Mudimadugula <rmudimadugul@marvell.com>
To: <dev@dpdk.org>
Cc: <maxime.coquelin@redhat.com>, <chenbox@nvidia.com>,
	Rajesh Mudimadugula <rmudimadugul@marvell.com>
Subject: [PATCH 1/2] vhost: fix cipher data length
Date: Thu, 3 Apr 2025 12:22:34 +0000	[thread overview]
Message-ID: <20250403122234.3508100-1-rmudimadugul@marvell.com> (raw)

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(-)

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;
-- 
2.34.1


             reply	other threads:[~2025-04-03 12:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 12:22 Rajesh Mudimadugula [this message]
2025-04-10  5:12 ` [EXTERNAL] " Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250403122234.3508100-1-rmudimadugul@marvell.com \
    --to=rmudimadugul@marvell.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).