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 E44F6457A1 for ; Mon, 12 Aug 2024 14:53:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0A5D4066E; Mon, 12 Aug 2024 14:53:44 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2044.outbound.protection.outlook.com [40.107.236.44]) by mails.dpdk.org (Postfix) with ESMTP id 5F64E4029C for ; Mon, 12 Aug 2024 14:53:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o62uaQx2ObeGSdl4tybzkg0LB5pv/QWT4MKBemFftxE2fNFUqAuOvpn+a/QN2QC6KddT223GLQlZo6xEDpCSO2m6IOKqUIO66e4/6tz6Vf+FptCihHrZ6WhFGHzqBrTsoSlnveNzJO6Lgavn9IcTHTL0OKquO/Uy5EMy3AsbhhEHxTetpURWqs98gUjK0ylmKwLNvZQCXWCbA6s54aBj6jWDP5nzDP8k+IrnE7sHWHyVWBCBlOKscH0HIEhsLr+2haKowMqhm2BzL9zgwLaTgwRiq9iz88TfSN1GvbvDl+JIIoxNDtLOV2co1ESIlqQF9lXF8vOFeF8u5H/1Gi7khg== 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=yzAuwgrv0Vhsa8rq8jTcah6+pOubr3qUOzhHxTT6cD0=; b=DAEc05qKzI17YBAhr/iDcIdfUlbxBnFwze/ZsCnTI3LPQ92fvgb5CRJokNrwZbiYQa7r2ASny0XuyinauvtIrt8fyQpHMrUISsoEOlpPjzaOcRmz/wpCn0sNLg5mE9kIawOkOe1BZEaVoFZ++4YrXNYgJ7maI97y/3yYuyc+fmm+U3RmUPl7lS1jcG2RB09SkgqnznoFB8zUkyBgyz+L0T6WSbFXBGQQ2/byN7Hx4Q/jq6+MzUkJk1eLb0w25QS5bNYeboMijSogk4Doev8+8lHvgNmG82K84wXw+H3wUauvy1CIHTZ6zw5i+x82qHa/BH/3U4Maz2rpVZSzSy5mhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=foss.arm.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=yzAuwgrv0Vhsa8rq8jTcah6+pOubr3qUOzhHxTT6cD0=; b=JoC+WP1kNHWEhrV8BakVFe+Vo1y+MQz5z/M7I8bP/Tsjv7CPXGvqFfgLCfwWfk2pjVgxh7rPxSu+gOeuOTs87r7Topjr8d7fkf8lp2gEgKgcPmIE2kO39vEBAINgY1MLwBql5BKL6L821bx3GsVzb7r/kREpYxSESi+ZJVJ7zVvxPFds+AV4ZfFBQnWzEWPFQGdx18MguSsuBZAT70SWqzH0rX5DSAzQliVOasIhxcMplGm+Y66XggzUVUaZ/kVo3hfl1DlesaUlQD2OpHIjSDDtFoRgniHU1MEpiehwbVdC7GnIiYxg7VtWZiKn3YnGQPkua28qaW1KHV3bejOp4g== Received: from SN4PR0501CA0032.namprd05.prod.outlook.com (2603:10b6:803:40::45) by LV3PR12MB9332.namprd12.prod.outlook.com (2603:10b6:408:20f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug 2024 12:53:39 +0000 Received: from SA2PEPF00003F61.namprd04.prod.outlook.com (2603:10b6:803:40:cafe::54) by SN4PR0501CA0032.outlook.office365.com (2603:10b6:803:40::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.15 via Frontend Transport; Mon, 12 Aug 2024 12:53:39 +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 SA2PEPF00003F61.mail.protection.outlook.com (10.167.248.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Mon, 12 Aug 2024 12:53:38 +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 05:53:28 -0700 Received: from nvidia.com (10.126.230.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 05:53:26 -0700 From: Xueming Li To: Jack Bond-Preston CC: , Kai Ji , Wathsala Vithanage , dpdk stable Subject: patch 'crypto/openssl: set cipher padding once' has been queued to stable release 23.11.2 Date: Mon, 12 Aug 2024 20:48:25 +0800 Message-ID: <20240812125035.389667-29-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.230.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: SA2PEPF00003F61:EE_|LV3PR12MB9332:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ee02541-5c99-49ec-c5e0-08dcbacdc972 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?ToeYur3WKxCPgPYb3hC2rcJ0ehR/RiBYsnAmhFrU6MlBPA9R2crgTxZi/3Ij?= =?us-ascii?Q?1PZ+abuHyfxPjXYWepRUozMXvo6rVN2yTXUnAjYwfOTOGjoLoALnVqy+7T6n?= =?us-ascii?Q?luvSPQBN2qNeznXMrjEu3iR1VyzNmrAFINHPkl83KGvNE6OAOGSrYdtVQd5T?= =?us-ascii?Q?MuPKjTWHH1zMeXldnYWZEmFRN9eu5fBjte0Kq4ml7D6DyO/+lcgb0CInb3tA?= =?us-ascii?Q?c8BrvIyC90P1KsWi4b3n/mZ0o0g2CUBkrmFM6ZSBvyyhQblf7x3JHp0gwTMQ?= =?us-ascii?Q?S+G9eIk4Wplf2QuVV/x8tHkk/St6E59o7M/ttRC/oUMT5hBf3brWz2LYDZXw?= =?us-ascii?Q?pKFEn81sX542cPG6EKohj1qrDkEt324PTgTkjRCMYdyW2vVQaGabUu9kvcEf?= =?us-ascii?Q?PUN4+zUJ1ijQ+7wAxXzIYyqZdzd3jmSpDOuZazP/mCrO9LC458phWV2Cr6xM?= =?us-ascii?Q?DHyAVCNpnj7g9h1eoqv/+KN1wMNGyf0QfMLmbKk8/0+CVQiQbaVLYrBdTzNu?= =?us-ascii?Q?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gvkJodM57Iegj?= =?us-ascii?Q?Pm+Ft1Un2OgWtCORyPi6uYaGXIhQWnXz?= 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 12:53:38.9165 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ee02541-5c99-49ec-c5e0-08dcbacdc972 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: SA2PEPF00003F61.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9332 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=4af94ab6e2820c5245b8eee5ee8bd8a347888ee1 Thanks. Xueming Li --- >From 4af94ab6e2820c5245b8eee5ee8bd8a347888ee1 Mon Sep 17 00:00:00 2001 From: Jack Bond-Preston Date: Wed, 3 Jul 2024 13:45:51 +0000 Subject: [PATCH] crypto/openssl: set cipher padding once Cc: Xueming Li [ upstream commit d2bf59017315dc18eb6c9f2d7acd10dfb8d7758e ] Setting the cipher padding has a noticeable performance footprint, and it doesn't need to be done for every call to process_openssl_cipher_{en,de}crypt(). Setting it causes OpenSSL to set it on every future context re-init. Thus, for every buffer after the first one, the padding is being set twice. Instead, just set the cipher padding once - when configuring the session parameters - avoiding the unnecessary double setting behaviour. This is skipped for AEAD ciphers, where disabling padding is not necessary. Throughput performance uplift measurements for AES-CBC-128 encrypt on Ampere Altra Max platform: 1 worker lcore | buffer sz (B) | prev (Gbps) | optimised (Gbps) | uplift | |-----------------+---------------+--------------------+----------| | 64 | 2.97 | 3.72 | 25.2% | | 256 | 8.10 | 9.42 | 16.3% | | 1024 | 14.22 | 15.18 | 6.8% | | 2048 | 16.28 | 16.93 | 4.0% | | 4096 | 17.58 | 17.97 | 2.2% | 8 worker lcores | buffer sz (B) | prev (Gbps) | optimised (Gbps) | uplift | |-----------------+---------------+--------------------+----------| | 64 | 21.27 | 29.85 | 40.3% | | 256 | 60.05 | 75.53 | 25.8% | | 1024 | 110.11 | 121.56 | 10.4% | | 2048 | 128.05 | 135.40 | 5.7% | | 4096 | 139.45 | 143.76 | 3.1% | Signed-off-by: Jack Bond-Preston Acked-by: Kai Ji Reviewed-by: Wathsala Vithanage --- drivers/crypto/openssl/rte_openssl_pmd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index df44cc097e..7518ffa3be 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -619,6 +619,8 @@ openssl_set_session_cipher_parameters(struct openssl_session *sess, return -ENOTSUP; } + EVP_CIPHER_CTX_set_padding(sess->cipher.ctx, 0); + return 0; } @@ -1119,8 +1121,6 @@ process_openssl_cipher_encrypt(struct rte_mbuf *mbuf_src, uint8_t *dst, if (EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv) <= 0) goto process_cipher_encrypt_err; - EVP_CIPHER_CTX_set_padding(ctx, 0); - if (process_openssl_encryption_update(mbuf_src, offset, &dst, srclen, ctx, inplace)) goto process_cipher_encrypt_err; @@ -1169,8 +1169,6 @@ process_openssl_cipher_decrypt(struct rte_mbuf *mbuf_src, uint8_t *dst, if (EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, iv) <= 0) goto process_cipher_decrypt_err; - EVP_CIPHER_CTX_set_padding(ctx, 0); - if (process_openssl_decryption_update(mbuf_src, offset, &dst, srclen, ctx, inplace)) goto process_cipher_decrypt_err; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-08-12 20:44:03.466541424 +0800 +++ 0028-crypto-openssl-set-cipher-padding-once.patch 2024-08-12 20:44:01.965069269 +0800 @@ -1 +1 @@ -From d2bf59017315dc18eb6c9f2d7acd10dfb8d7758e Mon Sep 17 00:00:00 2001 +From 4af94ab6e2820c5245b8eee5ee8bd8a347888ee1 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit d2bf59017315dc18eb6c9f2d7acd10dfb8d7758e ] @@ -36,2 +38,0 @@ -Cc: stable@dpdk.org - @@ -46 +47 @@ -index 7e2e505222..101111e85b 100644 +index df44cc097e..7518ffa3be 100644 @@ -58 +59 @@ -@@ -1124,8 +1126,6 @@ process_openssl_cipher_encrypt(struct rte_mbuf *mbuf_src, uint8_t *dst, +@@ -1119,8 +1121,6 @@ process_openssl_cipher_encrypt(struct rte_mbuf *mbuf_src, uint8_t *dst, @@ -67 +68 @@ -@@ -1174,8 +1174,6 @@ process_openssl_cipher_decrypt(struct rte_mbuf *mbuf_src, uint8_t *dst, +@@ -1169,8 +1169,6 @@ process_openssl_cipher_decrypt(struct rte_mbuf *mbuf_src, uint8_t *dst,