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 6F01E45562 for ; Wed, 3 Jul 2024 17:20:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4F0B0427B8; Wed, 3 Jul 2024 17:20:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 368474279C; Wed, 3 Jul 2024 17:20:53 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4638jdcv004433; Wed, 3 Jul 2024 08:20:49 -0700 Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2040.outbound.protection.outlook.com [104.47.70.40]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 4053du9k2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Jul 2024 08:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WwyjkieqloSOpNbAeaIzEvncTbNAJV/Zyav5mS8kqQVBbeG39KxEe0rtZl4D4BCDW7jzXn3xyo6VbMmRhBEAMN75ho1BQ3sNfdLKEd/wp/sqIPO7cQ0tnJWFqyi3GFWzel181NBJTrN1KPg1MKBefe89RsOMIE0re4BDr4E65dZiSV8F5jRGzL32PISB5PDNCso9q58TbEo8XQnsM0RwztTro+em4T4t+54xk07hBIgwlRIwTkQUGpYKHZJpkoZTrpDDELlWcJ4LOgYaNFRxMVXENzVfHMXUmWqE+4N6/2xZzZ0D+j+eOwAthmnNmZyHjOcGbx3ELEdAbAde/j5dtA== 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=nRCdVycaOo6qiNlQZ7YXMDxGCBWn8d4fCJBQKuUuHcM=; b=Qf52iH9Vf4clKbjWtjqnlaDjCC5O1ZtXyrLdXTqWAESeIi7B6L4RtH+wAJMe20p8E4mReCHDiHbmM5HDWrM0MFYfOj4T3qAm8enGMUZcAJXw/9K3bZ1fqZ8XyCivKM7ior8rKWKGibkWcCTqUm0oXD+dc0c+lFV7ctOWAdOk/PifIvTEgdaIUta/jzW9BycFNW2QajPkClN6gE/g2/K3d3VyWRezNSzn6kc15g6G68YhIMGmPJX2qBwUr5wdjYcAC0njf0qmVjN+9eGWC3nr+1Hnm7u2dsKnS4zSuE/bfhPJrNqSy5mSEurhnZfjdBzP7DDgIJXQvcMnfr/6SChSYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nRCdVycaOo6qiNlQZ7YXMDxGCBWn8d4fCJBQKuUuHcM=; b=ER0ji9bm2Dzf7kBf6f9oa1Mt++0pqUn1gHK8tCmHRyprVozJeBSXZAf72teTUs9YvEsd87UNkOoAdp78W+6tdSGU8j3s0JqKwHuFoK+OLujar1xh0Sm5el5oh56eVzcq1CYGwAlfEjI7TsXnBpckPHV8Ws6LtM/tm1gA4sEhz8Q= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by SA1PR18MB4677.namprd18.prod.outlook.com (2603:10b6:806:1d4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.25; Wed, 3 Jul 2024 15:20:46 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%6]) with mapi id 15.20.7741.017; Wed, 3 Jul 2024 15:20:46 +0000 From: Akhil Goyal To: Jack Bond-Preston , Kai Ji , Fan Zhang CC: "dev@dpdk.org" , "stable@dpdk.org" , Wathsala Vithanage Subject: RE: [EXTERNAL] [PATCH v5 1/5] crypto/openssl: fix GCM and CCM thread unsafe ctxs Thread-Topic: [EXTERNAL] [PATCH v5 1/5] crypto/openssl: fix GCM and CCM thread unsafe ctxs Thread-Index: AQHazU9eaM5TX1UWvUe99YHXmdnvMLHlHQdw Date: Wed, 3 Jul 2024 15:20:46 +0000 Message-ID: References: <20240603160119.1279476-1-jack.bond-preston@foss.arm.com> <20240703134552.1439633-1-jack.bond-preston@foss.arm.com> <20240703134552.1439633-2-jack.bond-preston@foss.arm.com> In-Reply-To: <20240703134552.1439633-2-jack.bond-preston@foss.arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR18MB4484:EE_|SA1PR18MB4677:EE_ x-ms-office365-filtering-correlation-id: 0dfc36bf-9d5c-4c4a-0bea-08dc9b73b64e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?Lk8yFSkgqHqjc06lhEtYXBJ1GUOM+KzgGKpwwI13WyBmsvVtVMWhJfZOrQPs?= =?us-ascii?Q?H5Hv4BnCbd81JxGMPTmjRC9tzK5kt2/BPJpLTwyhkuxDxW+INwuo8rXX+IQs?= =?us-ascii?Q?AaYmY/yhqxUVQg6qwFRaYuoi9lhCsKjS7IkdDNBK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UJ6sdUMiQIyq6JG0AuS013vP6TXEvtwkvEW4gsVF4N/GdcGIW?= =?us-ascii?Q?XFUBvrWKXMSpDB0IfahUx+3dIH+xf1DgGl8qF4ye44E5EyoAVX9uevQIMlQT?= =?us-ascii?Q?8gtf9CSF4qAaD7fdT4CojwuZoUGiiOniU4ZHPs7OCnbAQ/yicomkyeJb6Sgt?= =?us-ascii?Q?i/SwwTrSo177yDe+eFBdqGX9fHSC4Mgj/ap6rwk1Ienk8AHOdRqjSmxBQyG9?= =?us-ascii?Q?P7W1y5ONONM7Hjc0s44AOCDSPNREwPCkX9Pa0nJPikdFhZ7kJ5Q9zy1oG/g+?= =?us-ascii?Q?vycl0iycCwsw4WC/NiRMZ3ftnTt33IhLt4HaB/NnGOqBLqDMswMFdB/uAHA4?= =?us-ascii?Q?j6G1RRTKbh7TL3xPn9gowwUyntFElAbNzxgysbWcxiwNmBDO1w=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?+T4MY8FYQZdf8zHerqPCIlMwst5ALuGN9BHAreAkctEfAlhqEyJtQ19OETHo?= =?us-ascii?Q?+cFoSBTq6uuxwaO1KM4TuxRuFi3epKdo1zYWLInFG2jU4b6MJyeIMt0g6x+3?= =?us-ascii?Q?oWQYhsNsROb4WlyoGAROcNBlpq3gRydwWnwrLH0/7RQIf1hVDIteKqFKe54L?= =?us-ascii?Q?e0MqLuEjJu4GRnqKRu7tEOd2nOxpjWwfOdu4f2moL7dUQWSSXMbAJUNOKVHF?= =?us-ascii?Q?kxFFKL1g+Vz5eko4ZLxTNSVIAdiI6171Ag9YIJKdkNml/QIJA0gMDQKyDHff?= =?us-asc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kXgptxoLuQOhVVEUtZgJaw7oL5Po?= =?us-ascii?Q?M7aFMB3NlYBnSz37x3YMWFi/D+7BMd5qdaLzGOhQ1ETcSx7aASnc82Bm6w+Y?= =?us-ascii?Q?QPBNEWadmy08fqQE6P5mhW/7XcD5+0QuXrPJNXAkgaxZGy3kA+LgD7fMxdM8?= =?us-ascii?Q?9YYoTtbO4ktYV/d7n20C5YkvVpU/8zHGY8ArY/7w3Tihj24uxy4Zq/uVKPL2?= =?us-ascii?Q?FbyHgbP2fu0zfE+GDV+uwOdl7Kif0OHYEKLNAmCiDeMnK9XYGeQBWOYGD5iq?= =?us-ascii?Q?Z3QzfDrj3/2NW+lKlJilItw0tVoXD1rThqeV10bXWHK1ozLs9wO53LRFy/w8?= =?us-ascii?Q?Elx67EWb67PgRUt4/MqhS7L1AF6Ng585EPIZ7oGxxYN5AUlO8BrTrH3y2sI4?= =?us-ascii?Q?pF5872n62wHPBHTkaWU2cMoICyHXTaYpU3h+Qdrj?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dfc36bf-9d5c-4c4a-0bea-08dc9b73b64e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2024 15:20:46.1676 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZPcBq3m0VPR0DlknW37oYW2fm17vRNPFXgaz2sUje7A7oWS2MoAbDNg4JSRQVX3k6KMbD83OgPN3nMORfE638Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR18MB4677 X-Proofpoint-ORIG-GUID: hD4T2nRenTGTEvQYkak3NAg1WnFCjG4d X-Proofpoint-GUID: hD4T2nRenTGTEvQYkak3NAg1WnFCjG4d X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-03_10,2024-07-03_01,2024-05-17_01 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 > Subject: [EXTERNAL] [PATCH v5 1/5] crypto/openssl: fix GCM and CCM thread > unsafe ctxs >=20 > Commit 67ab783b5d70 ("crypto/openssl: use local copy for session > contexts") introduced a fix for concurrency bugs which could occur when > using one OpenSSL PMD session across multiple cores simultaneously. The > solution was to clone the EVP contexts per-buffer to avoid them being > used concurrently. >=20 > However, part of commit 75adf1eae44f ("crypto/openssl: update HMAC > routine with 3.0 EVP API") reverted this fix, only for combined ops > (AES-GCM and AES-CCM). >=20 > Fix the concurrency issue by cloning EVP contexts per-buffer. An extra > workaround is required for OpenSSL versions which are >=3D 3.0.0, and > <=3D 3.2.0. This is because, prior to OpenSSL 3.2.0, EVP_CIPHER_CTX_copy(= ) > is not implemented for AES-GCM or AES-CCM. When using these OpenSSL > versions, create and initialise the context from scratch, per-buffer. >=20 > Throughput performance uplift measurements for AES-GCM-128 encrypt on > Ampere Altra Max platform: > 1 worker lcore > | buffer sz (B) | prev (Gbps) | optimised (Gbps) | uplift | > |-----------------+---------------+--------------------+----------| > | 64 | 2.60 | 1.31 | -49.5% | > | 256 | 7.69 | 4.45 | -42.1% | > | 1024 | 15.33 | 11.30 | -26.3% | > | 2048 | 18.74 | 15.37 | -18.0% | > | 4096 | 21.11 | 18.80 | -10.9% | >=20 > 8 worker lcores > | buffer sz (B) | prev (Gbps) | optimised (Gbps) | uplift | > |-----------------+---------------+--------------------+----------| > | 64 | 19.94 | 2.83 | -85.8% | > | 256 | 58.84 | 11.00 | -81.3% | > | 1024 | 119.71 | 42.46 | -64.5% | > | 2048 | 147.69 | 80.91 | -45.2% | > | 4096 | 167.39 | 121.25 | -27.6% | >=20 > Fixes: 75adf1eae44f ("crypto/openssl: update HMAC routine with 3.0 EVP AP= I") > Cc: stable@dpdk.org Since this fix is reducing the performance significantly. Backporting it alone would reduce performance on stable releases. I would suggest applying all the patches in this series for backports. > Signed-off-by: Jack Bond-Preston > Acked-by: Kai Ji > Reviewed-by: Wathsala Vithanage Applied to dpdk-next-crypto Thanks for the optimizations.