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 70DC141D8C for ; Mon, 27 Feb 2023 08:02:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68BF140ED6; Mon, 27 Feb 2023 08:02:15 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2042.outbound.protection.outlook.com [40.107.237.42]) by mails.dpdk.org (Postfix) with ESMTP id 4B06C40A7D for ; Mon, 27 Feb 2023 08:02:14 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XlOIdAwIYS5BR6HmNgKdpem0kMZAE3qahszmCmAtoB5kpP5igUF+/Mev8lLVrmrokFbiSMwMzdOU+ikHCMbh9I1ENObEUvPHvvvang+QNo6HFUkSbemXDggTGBu7muDYwbWibh6y/7D2MIZx5+BFgzxoSL5TPv/RyeVKxn1TE2r2N4DPg3WDwcvqPf3Wnn7BurRI+gasS78c7MCO2NFZFbJjjsk5U44830bB/erU96lLlPHlaEAt6kZ6ioAB0FOLVQaEFzusE/5+bwp6LSQP3X8x2uX1zLoa1eGvWfQ6EQByJbIG5UdwCsRiDMV2cILDOzMgIU0bfYtxFCZhE9+hyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=rwPRs5IncvBI7NMgoPgIk4jNyVHpGzxJOUsu3hcUe0Y=; b=UJpbJu0bDzCxfvF7gx4BD7Uahdt5Mt8Ah/ctJb7zJzaAAY+PpsXAJVNQZaIov+WlfV7N22nI7lND9b0z9d3WaVk9LSsW8EOb+O6p9Q+bJaVlu8eJXsiH9xY6+z46YJvhWoN2XNNRJi36bj2lqjNURFd5ir+WY78XwiPAqG4I2SI6JchIagrU7XvAxD6S/XWmUiqC1pkfxAAYi4k1FEb5/E6L5irsvDB8u68Crba8OnRx3sbJG14r3q1ZC75SIuLcHnz7WDJQlzmAAEjWSM7U1VC2Tj6m+lECsCiUFq/DLOTojPinXC8ViPRoMWMypWLj2h6JJfJnIlAbdZdWReP5vA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=marvell.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 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=rwPRs5IncvBI7NMgoPgIk4jNyVHpGzxJOUsu3hcUe0Y=; b=B7GpqZuKiirnuAITvO+9ELwn8w9PmwXfEpdYzfRYU0KAMuTueNbyrhrXiCG7BW9R/6WKQ8bzFiCysrSAcU99Kcm0QOwceVXyC+sN8a32XLz0bS/rwl72v2QPtkIA/nmoPJfF4XkQfwEZOvY9qcnJTbLOUuaMiSzfCFijSvpIzkcHu4iY6fTBJqgAOhWPVrcmFJftlH/Rg3xlyEMVY+cVGWL7sLb9ZPnjwkIx4B0dtrKXOy3nAILKZ2/EEF/LpLsyFUOrAW0RhgruWHwveTz8o48r8AYbM7pkc1x/SjWDI9AOCwA6ygOIDToQQSqEKj9DGdD2hUv+7zFq9F/YCtV0rQ== Received: from DM6PR08CA0006.namprd08.prod.outlook.com (2603:10b6:5:80::19) by DS7PR12MB6264.namprd12.prod.outlook.com (2603:10b6:8:94::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 07:02:11 +0000 Received: from DS1PEPF0000E64C.namprd02.prod.outlook.com (2603:10b6:5:80:cafe::7) by DM6PR08CA0006.outlook.office365.com (2603:10b6:5:80::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:02:10 +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 DS1PEPF0000E64C.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Mon, 27 Feb 2023 07:02:10 +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.986.36; Sun, 26 Feb 2023 23:02:00 -0800 Received: from nvidia.com (10.126.230.37) 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.986.37; Sun, 26 Feb 2023 23:01:57 -0800 From: Xueming Li To: Gowrishankar Muthukrishnan CC: Anoob Joseph , dpdk stable Subject: patch 'crypto/cnxk: fix digest for empty input data' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 14:58:35 +0800 Message-ID: <20230227070107.15664-7-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E64C:EE_|DS7PR12MB6264:EE_ X-MS-Office365-Filtering-Correlation-Id: a621b99a-7948-4b1a-5bb7-08db18908bce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 45ypNXNBpF1puCtzl8tRAheN88tl9xbST0WH9dh+Ri3JMpt3/Vr0uUPypaSoU/aBLLQ+TGZVyeFlxfmBrQc/nqn9ZvA87m4ZburSym4q1LgofwBysWp258t4DGbVGCC4brlXU8Noaw1r5SxsO4ibHYeSBCCOHlc2cNWJzGXIbn+wJCc7s0dD2x56m55gSAqI8PIpbqSc2RD9pATmVpDYF7xK9K/pQG4J/s3mE1WNdbyoJzxKDz1W+K+EgNU7rTOwtg37PwHWp9Unx9LBijcJQ5Sps7Wxancg0KXTa6YLSsDyWI3jttyBGB69vybpGV7AX5uXteNIczyPB+90At/DwrCqm9HlJmnsK+yYnWI3F2qTD3iLRMGbFYdIDdTsCk43SV2ftbRMAd4g/E8XQE0PToJK7k96ideIH9Ke2NGYJ9wSVBMukZ7+Osr9Tsbze0b4JFJ/xJ0o1x0P2B6VRaoeyJIPDorqAZcbsL1BSAmAe0B+3gYl+DYh7mLLPHrx/u3tKJ2G7sFo7afZaFvbRd2XCS+ACC1GeEx2gHcluVzokxMvnRNKkABYqnuREDrNHAts6qLanZvq7pcdvHimhuATCB/R7UYwPgQ26QJQVUWblr2vSABSLVN3stLuaih/uQtG6YHjBsfuNLhiIMUWrH207PPqKHcs5LLVrO592QDSloejEE/17m53ez+28WwrENN2yeO2wgwCy6PTPFS8rSfJr+z9k3vp/e+m3BV7ixBAMDwr+KGeLk8cCyyjaca5JUAHkOloyBtErOTjWufcaGsPUzNvXkfsGts32jwHbbKDd+M= 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:(13230025)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199018)(46966006)(40470700004)(36840700001)(82740400003)(7636003)(316002)(36860700001)(2906002)(36756003)(40460700003)(5660300002)(8936002)(55016003)(40480700001)(86362001)(53546011)(1076003)(70206006)(70586007)(6286002)(16526019)(186003)(26005)(6916009)(4326008)(54906003)(8676002)(41300700001)(356005)(2616005)(336012)(82310400005)(83380400001)(47076005)(426003)(478600001)(7696005)(966005)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:02:10.1565 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a621b99a-7948-4b1a-5bb7-08db18908bce 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: DS1PEPF0000E64C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6264 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.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 03/01/23. 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=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=193ff405b3aa595ca72cfeafdb267be8bcbcbdff Thanks. Xueming Li --- >From 193ff405b3aa595ca72cfeafdb267be8bcbcbdff Mon Sep 17 00:00:00 2001 From: Gowrishankar Muthukrishnan Date: Tue, 20 Dec 2022 20:02:23 +0530 Subject: [PATCH] crypto/cnxk: fix digest for empty input data Cc: Xueming Li [ upstream commit 2aa77c160f9f6485c95850986e6359355e462de1 ] For an empty input data, digest value is incorrectly generated from previous auth op, in case executed. This is due to incorrect gather component used. Fixes: 7c19abdd0cf1 ("common/cnxk: support 103XX CPT") Signed-off-by: Anoob Joseph Signed-off-by: Gowrishankar Muthukrishnan --- drivers/crypto/cnxk/cnxk_se.h | 46 ++++++++++++++--------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index b07fc22858..32e2b2cd64 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -244,7 +244,7 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i, uint32_t extra_len = extra_buf ? extra_buf->size : 0; uint32_t size = *psize; - for (j = 0; (j < from->buf_cnt) && size; j++) { + for (j = 0; j < from->buf_cnt; j++) { struct roc_se_sglist_comp *to = &list[i >> 2]; uint32_t buf_sz = from->bufs[j].size; void *vaddr = from->bufs[j].vaddr; @@ -311,6 +311,9 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i, if (extra_offset) extra_offset -= size; i++; + + if (unlikely(!size)) + break; } *psize = size; @@ -367,7 +370,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_ uint32_t extra_len = extra_buf ? extra_buf->size : 0; uint32_t size = *psize; - for (j = 0; (j < from->buf_cnt) && size; j++) { + rte_prefetch2(psize); + + for (j = 0; j < from->buf_cnt; j++) { struct roc_se_sg2list_comp *to = &list[i / 3]; uint32_t buf_sz = from->bufs[j].size; void *vaddr = from->bufs[j].vaddr; @@ -433,6 +438,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_ if (extra_offset) extra_offset -= size; i++; + + if (unlikely(!size)) + break; } *psize = size; @@ -884,20 +892,10 @@ cpt_digest_gen_sg_ver1_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa /* input data */ size = data_len; - if (size) { - i = fill_sg_comp_from_iov(gather_comp, i, params->src_iov, 0, - &size, NULL, 0); - if (unlikely(size)) { - plt_dp_err("Insufficient dst IOV size, short by %dB", - size); - return -1; - } - } else { - /* - * Looks like we need to support zero data - * gather ptr in case of hash & hmac - */ - i++; + i = fill_sg_comp_from_iov(gather_comp, i, params->src_iov, 0, &size, NULL, 0); + if (unlikely(size)) { + plt_dp_err("Insufficient dst IOV size, short by %dB", size); + return -1; } ((uint16_t *)in_buffer)[2] = rte_cpu_to_be_16(i); g_size_bytes = ((i + 3) / 4) * sizeof(struct roc_se_sglist_comp); @@ -1008,18 +1006,10 @@ cpt_digest_gen_sg_ver2_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa /* input data */ size = data_len; - if (size) { - i = fill_sg2_comp_from_iov(gather_comp, i, params->src_iov, 0, &size, NULL, 0); - if (unlikely(size)) { - plt_dp_err("Insufficient dst IOV size, short by %dB", size); - return -1; - } - } else { - /* - * Looks like we need to support zero data - * gather ptr in case of hash & hmac - */ - i++; + i = fill_sg2_comp_from_iov(gather_comp, i, params->src_iov, 0, &size, NULL, 0); + if (unlikely(size)) { + plt_dp_err("Insufficient dst IOV size, short by %dB", size); + return -1; } cpt_inst_w5.s.gather_sz = ((i + 2) / 3); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:41.255257500 +0800 +++ 0008-crypto-cnxk-fix-digest-for-empty-input-data.patch 2023-02-27 14:08:40.719237000 +0800 @@ -1 +1 @@ -From 2aa77c160f9f6485c95850986e6359355e462de1 Mon Sep 17 00:00:00 2001 +From 193ff405b3aa595ca72cfeafdb267be8bcbcbdff Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 2aa77c160f9f6485c95850986e6359355e462de1 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index ce4c2bb585..2944d3c287 100644 +index b07fc22858..32e2b2cd64 100644 @@ -23 +25 @@ -@@ -247,7 +247,7 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i, +@@ -244,7 +244,7 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i, @@ -32 +34 @@ -@@ -314,6 +314,9 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i, +@@ -311,6 +311,9 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i, @@ -42 +44 @@ -@@ -370,7 +373,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_ +@@ -367,7 +370,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_ @@ -53 +55 @@ -@@ -436,6 +441,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_ +@@ -433,6 +438,9 @@ fill_sg2_comp_from_iov(struct roc_se_sg2list_comp *list, uint32_t i, struct roc_ @@ -63 +65 @@ -@@ -887,20 +895,10 @@ cpt_digest_gen_sg_ver1_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa +@@ -884,20 +892,10 @@ cpt_digest_gen_sg_ver1_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa @@ -88 +90 @@ -@@ -1011,18 +1009,10 @@ cpt_digest_gen_sg_ver2_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa +@@ -1008,18 +1006,10 @@ cpt_digest_gen_sg_ver2_prep(uint32_t flags, uint64_t d_lens, struct roc_se_fc_pa