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 76155457A1 for ; Mon, 12 Aug 2024 15:01:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70D4D40666; Mon, 12 Aug 2024 15:01:55 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2065.outbound.protection.outlook.com [40.107.243.65]) by mails.dpdk.org (Postfix) with ESMTP id 5CEC8402C3 for ; Mon, 12 Aug 2024 15:01:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F/suHRxSvXPnZwNB+fd1wQDOky7hJviAWPlhJpNCz2FAYFYeT5z54jzdlGFMUVtH1gd+Dp+1IFOsFZ2fkP0BJuKhapgJBRNbc4gpKNgZPFIFsBkHwNGBMtZkgU6Dx29fsFQQtSKrOgkkhZoSI/GANnGumr5tWfeabdnigvgYNX9woHd1+XDGfbWn23Oc/M32O+sBBv3Db9TQ1/Vrp2YP7IEm7fhcuP9hq2ZNX+Y40DaclhMnyC/JcYwIJBXH6qQYYoxmoDXeCQD/6QGCAq6Sqzndusv5wzaxVokWTr57b4r9BjFtZRrk+JujrrwOJIzw/ZToPpFXWSuVwtPLAKmMTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=laBU/6uw+w08JnKKWlzjRFR3idIXlLusov1pIW4Fm/w=; b=IS03cfchNm8/sNcH7R/9uFAV91QfgJRPLxN22SHbpS9mPdVuz5y/lqphwsAQ61ITsdRI37O76mCfroB9PMmegmkD3wvVuyclxT56gGSCWbdlhZWUe94E5D7zyF29Ei1DIIvWeF/mC5GlfiGJeeYQiaQxFEQkPVl5X05KYWast/fRFSn7cW17EvSbOigomzCZswCTARJQM86dQACI3C32gapm7Ck0TIiFXlBjM8Qv1RB+b2IO/jIQjOOK4SrghnVJRzAIUDqyV9N0/OMXJKUacIWXVsee2En5ACIMSjvTwDkMt1rzz/j0bK9ZJ79g6qrh8B3Q5s68yOf0Muf3Wu3A8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=laBU/6uw+w08JnKKWlzjRFR3idIXlLusov1pIW4Fm/w=; b=ptVUY1UasPhSwvLXfhomq/wTCv7w8COFl6uvpd4lUk57uB37+22Eo/7RqU22PuPimegyluzsIhs9AbiJogYnDhBnP8FAygbefNFFewT9SFKTf8U10PMyF/4ki/uUc7d6gwGNotL69TTL02Iz6EoaL163x/bA2DcCsMlkItbnJc96rwENJPNanjwlPjpYb7FfuGYex6iua3ZcrUgquZsTO2uiwSndAuirk3+XdWG1LdppR6FKKaWy+TmkJHIH4udvv5eVZEz+IM5FXgObL6AnGSAnwxGTBvILjriraCD05tVXljQ7o9HBeV5syR/n/V8y+jmiVYlk4lLV6SLRG45YoQ== Received: from MW4PR03CA0231.namprd03.prod.outlook.com (2603:10b6:303:b9::26) by LV3PR12MB9411.namprd12.prod.outlook.com (2603:10b6:408:215::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Mon, 12 Aug 2024 13:01:48 +0000 Received: from CO1PEPF000042AE.namprd03.prod.outlook.com (2603:10b6:303:b9:cafe::56) by MW4PR03CA0231.outlook.office365.com (2603:10b6:303:b9::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend Transport; Mon, 12 Aug 2024 13:01:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000042AE.mail.protection.outlook.com (10.167.243.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Mon, 12 Aug 2024 13:01:47 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 12 Aug 2024 06:01:20 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 12 Aug 2024 06:01:18 -0700 From: Xueming Li To: Arkadiusz Kusztal CC: , Brian Dooley , dpdk stable Subject: patch 'crypto/qat: fix placement of OOP offset' has been queued to stable release 23.11.2 Date: Mon, 12 Aug 2024 20:49:50 +0800 Message-ID: <20240812125035.389667-114-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240812125035.389667-1-xuemingl@nvidia.com> References: <20240712110153.309690-23-xuemingl@nvidia.com> <20240812125035.389667-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AE:EE_|LV3PR12MB9411:EE_ X-MS-Office365-Filtering-Correlation-Id: bac1b207-1379-4004-de96-08dcbaceecb2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?KOOWu8sTT8ZQVy+S4o6oP1UbwSATp6NM/2pJR7Mrsfsza3nHbxgplkWrTRrV?= =?us-ascii?Q?fvcWRKpKZsAc9SD7l3xvz4KsLkJVqhx+/yVAx5Ve1MnDD8JAnLFIWfeWZlGS?= =?us-ascii?Q?qhFWNbZ4AXMilWkETuL6gNGteOu/V3w7cak07ZfhB3A4Wq6+qnGpQ9NG7ihA?= =?us-ascii?Q?AuPJuoLrPi01w1ol+nBbeQPs/n63hn3Wt6nytw+H2yj8MPL9+YNL+3epucMi?= =?us-ascii?Q?UxIpf1V4NKgyAP98s52u1qd/SMGFpU4HPAlYqbd5TpFgzZrf64+NwWuL8gry?= =?us-ascii?Q?8pdGIja7pujrSLvsDamQSEyvaZbSJgE8/kXR4/dN3Cfxf8UDOw+uOvqF0GxZ?= =?us-ascii?Q?8dxLje0mcEuOjcb2d9hOaO4on9AcXh8qJeTOgCVioiaKTVsWzsUCj545f0Th?= =?us-ascii?Q?vRR/CmtOa5VlBiN2sadegwEDSYHYam70+5ji3NDx/IS1Y7nUruJoz7RwjY7F?= =?us-ascii?Q?j0+j0uK4f3YkiO3qpdtYM4T4whRm/c0hsuNW51Ku4kexrhvwAwLG44Z06ThA?= =?us-ascii?Q?UCH1bbDDAS/MtfkHNl7zW44CdFLL96tFulTxSOXXrEwp0cQjkIBIIja1/A89?= =?us-ascii?Q?87GYAyU9WyPE/27qK5QK/ALBPSEFHM1U1PcUdW+Seamb44vlxCYthOZmKu4M?= =?us-ascii?Q?8NdNdwjsyfm5S13V0JofuJqaFH0zMuvMdJgPM1F9zmlHbX3ym5fyGehWd08B?= =?us-ascii?Q?7QoagJoK8m0pZy7oomebz27/jLD0E801g6G+pc0r9/H9HRQsjCon31wnWuk6?= =?us-ascii?Q?Px37r9TQf4zm2rniYy/lDegrVlBGvbEiRciHMLW4tcUHRUIOn3CpnRHXTs30?= =?us-ascii?Q?Iaxsydff9Jx1k6Z13ae8O7bs0J9HqBhR0WnabY99jXd9njq15oKQCQY8Gxx2?= =?us-ascii?Q?MrrljK00K7MJ2oXkypb0MWcfxxj83WMWFJTAvuTA0boh4Wqj/IMohYQ1hfYz?= =?us-ascii?Q?+TZddA5BMpi6kwB92//t9xZBKGGu5VerXmyr0xmkHMnnJXXXCwkJpkwou3Si?= =?us-ascii?Q?WmEzKEickduaqMYISIRgWL1IhSXWV8+nfMfM93zJbXE7uoEqDg49ruhMxdzg?= =?us-ascii?Q?+7wa52XtaK0tfN8AyTIAUyvt9rCDg+jmdL1EfPknJlvAV3yEVwcru6xLbiFt?= =?us-ascii?Q?1PDyMiKJl2woz61qHPBSLdta4Fg4Jao7yb6vvfzoOt4b9N8H4A0V5VDnj4A0?= =?us-ascii?Q?erdyUhwlRMcnx+/8zAFINBqRQoPu4UK1ICZzpPVZtvE8nRjB3ev9XZKOiYVG?= =?us-ascii?Q?8P4JRadh7roX0tCBpGjgTIbUr3BKfM9EnTf4I3xplA3EV5h3mtIykSsG3dNw?= =?us-ascii?Q?uZsS+tF38U6HV4oT/un8mrJUC+ym0Z0n8nCE/fxch9krhJpWSPjZP0YcQt7S?= =?us-ascii?Q?TCcni2DIF/BMNb5kcaNvIrP9qN3xrqfF5p3aN5NF7revlYyDl+LXCt/DiBLR?= =?us-ascii?Q?RzhUGTTh/hW90se4qmNJLO8moiU3JL1A?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 13:01:47.4911 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bac1b207-1379-4004-de96-08dcbaceecb2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9411 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 23.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/14/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a408bd0bcb3a3f3cdb83e1d1d08d16f184f59150 Thanks. Xueming Li --- >From a408bd0bcb3a3f3cdb83e1d1d08d16f184f59150 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 Cc: Xueming Li [ 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 b87253ae02..64e892d022 100644 --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h @@ -394,7 +394,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) && @@ -468,6 +468,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 * or combined cipher-crc operations */ @@ -508,9 +518,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; @@ -520,7 +528,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.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-08-12 20:44:06.110492913 +0800 +++ 0113-crypto-qat-fix-placement-of-OOP-offset.patch 2024-08-12 20:44:02.445069363 +0800 @@ -1 +1 @@ -From 9f0a50dd2bc4acec586616bf5553de4711451991 Mon Sep 17 00:00:00 2001 +From a408bd0bcb3a3f3cdb83e1d1d08d16f184f59150 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 9f0a50dd2bc4acec586616bf5553de4711451991 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index 2c5816e696..35c1888082 100644 +index b87253ae02..64e892d022 100644 @@ -23 +25 @@ -@@ -399,7 +399,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, +@@ -394,7 +394,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, @@ -32 +34 @@ -@@ -473,6 +473,16 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, +@@ -468,6 +468,16 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, @@ -49 +51 @@ -@@ -513,9 +523,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, +@@ -508,9 +518,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, @@ -60 +62 @@ -@@ -525,7 +533,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, +@@ -520,7 +528,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op,