From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 432FC4569C for ; Wed, 24 Jul 2024 13:33:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A0AD42F01; Wed, 24 Jul 2024 13:33:47 +0200 (CEST) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mails.dpdk.org (Postfix) with ESMTP id 50F9942D28 for ; Wed, 24 Jul 2024 13:33:45 +0200 (CEST) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2eeb1ba0481so98187671fa.2 for ; Wed, 24 Jul 2024 04:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721820825; x=1722425625; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ziff8tlhdPxt6a6K9q8+JCHxzzSVtdf/dBJBTFYR9hI=; b=Q+kamCDKlSGXGpyzRkVh0GthHSJYxFLW0Ka+D+bTp5LEf1xjtWfXuan4H1+sFhsy0H XHlebm9OxldomgIPFcvaoN9OBATXEUZKIgKqrRFQnH5hqxhSslrt4hKIQSfajgVbjOSg bc2isUpyqgSM/zsYhykhT79AUKjoHKPL/h2MMlKuuya1GHe1xv5bjKzj+oTpjH9+vicL 3WfdgTuJLZH/A8JWsiFTAo/dOmwOOzsBzdru+QY/gYmaM7L+juoSjGyUOV+ZN0XOXL/N mjgW05ciBEpbGOIMZR2HF8R3N7Lwy51EB021RfuYDbnpKpn9bMB2YZ8nnmxG8w9KzxS4 WmuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721820825; x=1722425625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ziff8tlhdPxt6a6K9q8+JCHxzzSVtdf/dBJBTFYR9hI=; b=R9VZGIjbZO/8xSmmoqrZNSaThFrsdiPH1HuvkAmJQJGoVFT5l0ac67NMl/woi42nh5 y+Waxs58K8OCqCa+fU1qk2oejFW2bBOQQz81HyT9F6wvlGjMKaSimUofIPm/J4bAfhih aa9nLaXsC3SssDZETNra2E10aXwiwyLM/GlOjaOcKZZmj4jNzpP8HERmZayl87WDqSu5 GAyI21+UvjP7cquMpBgOzuM14nk/nkCx2aVaeU/Ksbdj9EkCXhGRu3BZNPIyBLjXsO0e mBLYLOzU0xsfxOroRzY399+ZVIw1x05dxI6wbHAPJT6u7WipfVQM0xS+UiyJUmxBx88E DawQ== X-Forwarded-Encrypted: i=1; AJvYcCW+pqUqlBuqBKayTAS3y6hUipEmN39EX66tAgSc6VPOIH7tIvFU9wJGQ+obQ6r04lN+XmMAPmSG/5oG3GZBr0U= X-Gm-Message-State: AOJu0Yx7XbRLEpJW7ugJUqvHRB6drwZlqmmphT6N1hurv1r99gg6Dvxa huTYOZ+WcaOhzkCE7pFOixH2NK0ATiKwD1c/JcKbEH4G9aeQ1pRYX/GohjTr X-Google-Smtp-Source: AGHT+IHwD27k1qmuOaBDEnsi7MFRBSi7ENmOiQiLULlELEjm/NGoq10s08LnPWGA1DNPDyXZs7nVCA== X-Received: by 2002:a2e:8ec9:0:b0:2ef:2658:98f2 with SMTP id 38308e7fff4ca-2ef265899ebmr81471801fa.33.1721820823197; Wed, 24 Jul 2024 04:33:43 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f93bcf13sm24845075e9.46.2024.07.24.04.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:33:42 -0700 (PDT) From: luca.boccassi@gmail.com To: Arkadiusz Kusztal Cc: Brian Dooley , dpdk stable Subject: patch 'crypto/qat: fix placement of OOP offset' has been queued to stable release 22.11.6 Date: Wed, 24 Jul 2024 12:32:46 +0100 Message-Id: <20240724113318.616754-8-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240724113318.616754-1-luca.boccassi@gmail.com> References: <20240715152704.2229503-86-luca.boccassi@gmail.com> <20240724113318.616754-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/68d0c242e461594db53f2a9918a59b6fb3f18c5f Thanks. Luca Boccassi --- >From 68d0c242e461594db53f2a9918a59b6fb3f18c5f Mon Sep 17 00:00:00 2001 From: Arkadiusz Kusztal Date: Thu, 4 Jul 2024 11:26:49 +0100 Subject: [PATCH] crypto/qat: fix placement of OOP offset [ upstream commit 9f0a50dd2bc4acec586616bf5553de4711451991 ] This patch fixes incorrect placement of OOP offset. Data preceding crypto operation is not copied to the output buffer, which is conformant to the API. Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request") Signed-off-by: Arkadiusz Kusztal Acked-by: Brian Dooley --- drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h index 1acb0c4985..266ab74a01 100644 --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h @@ -375,7 +375,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, struct qat_sym_op_cookie *cookie) { union rte_crypto_sym_ofs ofs; - uint32_t max_len = 0; + uint32_t max_len = 0, oop_offset = 0; uint32_t cipher_len = 0, cipher_ofs = 0; uint32_t auth_len = 0, auth_ofs = 0; int is_oop = (op->sym->m_dst != NULL) && @@ -438,6 +438,16 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, max_len = RTE_MAX(cipher_ofs + cipher_len, auth_ofs + auth_len); + /* If OOP, we need to keep in mind that offset needs to start where + * cipher/auth starts, namely no offset on the smaller one + */ + if (is_oop) { + oop_offset = RTE_MIN(auth_ofs, cipher_ofs); + auth_ofs -= oop_offset; + cipher_ofs -= oop_offset; + max_len -= oop_offset; + } + /* digest in buffer check. Needed only for wireless algos */ if (ret == 1) { /* Handle digest-encrypted cases, i.e. @@ -471,9 +481,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, max_len = RTE_MAX(max_len, auth_ofs + auth_len + ctx->digest_length); } - - /* Passing 0 as cipher & auth offsets are assigned into ofs later */ - n_src = rte_crypto_mbuf_to_vec(op->sym->m_src, 0, max_len, + n_src = rte_crypto_mbuf_to_vec(op->sym->m_src, oop_offset, max_len, in_sgl->vec, QAT_SYM_SGL_MAX_NUMBER); if (unlikely(n_src < 0 || n_src > op->sym->m_src->nb_segs)) { op->status = RTE_CRYPTO_OP_STATUS_ERROR; @@ -483,7 +491,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, if (unlikely((op->sym->m_dst != NULL) && (op->sym->m_dst != op->sym->m_src))) { - int n_dst = rte_crypto_mbuf_to_vec(op->sym->m_dst, 0, + int n_dst = rte_crypto_mbuf_to_vec(op->sym->m_dst, oop_offset, max_len, out_sgl->vec, QAT_SYM_SGL_MAX_NUMBER); if (n_dst < 0 || n_dst > op->sym->m_dst->nb_segs) { -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-24 12:29:21.426236716 +0100 +++ 0008-crypto-qat-fix-placement-of-OOP-offset.patch 2024-07-24 12:29:20.671024119 +0100 @@ -1 +1 @@ -From 9f0a50dd2bc4acec586616bf5553de4711451991 Mon Sep 17 00:00:00 2001 +From 68d0c242e461594db53f2a9918a59b6fb3f18c5f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9f0a50dd2bc4acec586616bf5553de4711451991 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 2c5816e696..35c1888082 100644 +index 1acb0c4985..266ab74a01 100644 @@ -23 +24 @@ -@@ -399,7 +399,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, +@@ -375,7 +375,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, @@ -32 +33 @@ -@@ -473,6 +473,16 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, +@@ -438,6 +438,16 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, @@ -46,4 +47,4 @@ - /* digest in buffer check. Needed only for wireless algos - * or combined cipher-crc operations - */ -@@ -513,9 +523,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, + /* digest in buffer check. Needed only for wireless algos */ + if (ret == 1) { + /* Handle digest-encrypted cases, i.e. +@@ -471,9 +481,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, @@ -60 +61 @@ -@@ -525,7 +533,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, +@@ -483,7 +491,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,