patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Ji, Kai" <kai.ji@intel.com>
To: "Nicolau, Radu" <radu.nicolau@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [PATCH] crypto/qat: align the the vector address
Date: Thu, 4 Dec 2025 12:18:36 +0000	[thread overview]
Message-ID: <DS0PR11MB7458A283A8B07A869A7C1FAF81A6A@DS0PR11MB7458.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20251202105731.851124-1-radu.nicolau@intel.com>

[-- Attachment #1: Type: text/plain, Size: 3360 bytes --]

Acked-by: Kai Ji <kai.ji@intel.com>


________________________________
From: Nicolau, Radu <radu.nicolau@intel.com>
Sent: Tuesday, December 02, 2025 10:57
To: dev@dpdk.org <dev@dpdk.org>
Cc: Nicolau, Radu <radu.nicolau@intel.com>; stable@dpdk.org <stable@dpdk.org>; Ji, Kai <kai.ji@intel.com>
Subject: [PATCH] crypto/qat: align the the vector address

Align the vector address rather than computed source address to
make sure the alignment is properly propagated.

Fixes: 253174309ff7 ("crypto/qat: fix source buffer alignment")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 33 +++++++++-----------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
index 67dc889b50..22ee0fe4fe 100644
--- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
+++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h
@@ -443,6 +443,21 @@ qat_sym_build_req_set_data(struct icp_qat_fw_la_bulk_req *req,
                         n_dst > QAT_SYM_SGL_MAX_NUMBER))
                 return -1;

+       /* For crypto API only: try to align the in-place buffers*/
+       if (op != NULL && likely(n_dst == 0) && likely(!is_sgl)) {
+               rte_iova_t offset = src_vec[0].iova & RTE_CACHE_LINE_MASK;
+               if (offset) {
+                       rte_iova_t buff_addr = rte_mbuf_iova_get(op->sym->m_src);
+                       /* make sure src_data_start is still within the buffer */
+                       if (src_vec[0].iova - offset >= buff_addr) {
+                               src_vec[0].iova -= offset;
+                               src_vec[0].len += offset;
+                               ofs->ofs.auth.head += offset;
+                               ofs->ofs.cipher.head += offset;
+                       }
+               }
+       }
+
         if (likely(!is_sgl)) {
                 src_data_start = src_vec[0].iova;
                 tl_src = total_len_src =
@@ -503,24 +518,6 @@ qat_sym_build_req_set_data(struct icp_qat_fw_la_bulk_req *req,
                         dst_data_start = src_data_start;
         }

-       /* For crypto API only try to align the in-place buffers*/
-       if (op != NULL && likely(n_dst == 0)) {
-               uint16_t offset = src_data_start & RTE_CACHE_LINE_MASK;
-               if (offset) {
-                       rte_iova_t buff_addr = rte_mbuf_iova_get(op->sym->m_src);
-                       /* make sure src_data_start is still within the buffer */
-                       if (src_data_start - offset >= buff_addr) {
-                               src_data_start -= offset;
-                               dst_data_start = src_data_start;
-                               ofs->ofs.auth.head += offset;
-                               ofs->ofs.cipher.head += offset;
-                               tl_src += offset;
-                               total_len_src = tl_src;
-                               total_len_dst = tl_src;
-                       }
-               }
-       }
-
         req->comn_mid.src_data_addr = src_data_start;
         req->comn_mid.dest_data_addr = dst_data_start;
         req->comn_mid.src_length = total_len_src;
--
2.50.1


[-- Attachment #2: Type: text/html, Size: 8539 bytes --]

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 10:57 Radu Nicolau
2025-12-04 12:18 ` Ji, Kai [this message]

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=DS0PR11MB7458A283A8B07A869A7C1FAF81A6A@DS0PR11MB7458.namprd11.prod.outlook.com \
    --to=kai.ji@intel.com \
    --cc=dev@dpdk.org \
    --cc=radu.nicolau@intel.com \
    --cc=stable@dpdk.org \
    /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).