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 A436F44173 for ; Thu, 6 Jun 2024 12:44:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D58542EEC; Thu, 6 Jun 2024 12:44:36 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id D1B0A40299; Thu, 6 Jun 2024 12:44:33 +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 4567v54o002137; Thu, 6 Jun 2024 03:44:29 -0700 Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3yk9638kpt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jun 2024 03:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HyNHWJUYr4mzGTn+9mI4d8K1HylALAUc/G1IwtTSHmwE+bL3lyWOksnycAbDrt9BzXk6c9MUAFEcNyHT6Zk0eg4+QDRMNXNX1rZRmFBj676zA5XNrIWQ1NDoT9KSUd/DdNJI0qnbfKj6uYHncFe7F8YBJx/NmrTz8DkB+i1EFT9CahlV3SpTPZwfT0MscdqxaE8DCkH/zTb9nogWOMwiLLZ8lk/j8MEuk6KzIn8gV7owjdcWteZpcTx29efAN4YOytF2ZId5hD7mH/dgl5Dhq4Q+u76ZmnFA63pFjbrcKah1b784FSWx/I4EfdLyC8vwAO9xso0Ufl1+/qsoakwpyQ== 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=z0LNDKrerjtwPN+IQ0UY+ZFFBMrM5+MyFC563cUZdGg=; b=QZu9oVg1FCg88Qk7PXsv6b+okXBzoiicy2iKhMv6vsrvCZoK0Gpk6cjDrm5ykDfN0vL4Kc15LD48uvtg5vFq2PsAR+9EaIK4esh7YKwOHp1ZkDhALvRCxXGnSnVofOGx5rAsUJqoMkpfr7yalqRyp8C1+JeOeLONCx5Z5JK/OCO/VfXpelrldunpSm1DPXn4XHd8ZvslsMECkGNkPzBpGEEVvd5GGscv7cH4DtJ+tCSpTeYxS5ZjAlNpSs++JrcF4aNHoTNyk1b0KPlSJQCOXdDxBaJkzicGJOgd/9TcLaNwSmMsIrvBdqoBWSbRG9AKgmW6xzIowA4InCR+MY6fhw== 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=z0LNDKrerjtwPN+IQ0UY+ZFFBMrM5+MyFC563cUZdGg=; b=tYG2JFviRIB8uZPtrDqOvJJRzuur2qvh4mhDG1/Qw/MglWCowqZgLBGm1/C/mD5CQ7VkUPCwNNn+e3vVAJ5TDqCB0uyCPuEIzGnBEpyBb+FDH/5MZnjLSpl1fAALMT+NCP8myv3N5hWpG43qR6WFdtJNB/XvS+UPklF9DOpsve0= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by PH0PR18MB3798.namprd18.prod.outlook.com (2603:10b6:510:24::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.33; Thu, 6 Jun 2024 10:44:27 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::3c98:dd36:4897:a51d%5]) with mapi id 15.20.7633.033; Thu, 6 Jun 2024 10:44:26 +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 v3 1/5] crypto/openssl: fix GCM and CCM thread unsafe ctxs Thread-Topic: [EXTERNAL] [PATCH v3 1/5] crypto/openssl: fix GCM and CCM thread unsafe ctxs Thread-Index: AQHat/s4V+KWsKzlNkO2Ggdw76H2oLG6jLug Date: Thu, 6 Jun 2024 10:44:26 +0000 Message-ID: References: <20240603160119.1279476-1-jack.bond-preston@foss.arm.com> <20240606102043.2926695-1-jack.bond-preston@foss.arm.com> <20240606102043.2926695-2-jack.bond-preston@foss.arm.com> In-Reply-To: <20240606102043.2926695-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_|PH0PR18MB3798:EE_ x-ms-office365-filtering-correlation-id: 142bdb73-bf5e-49b8-3b74-08dc8615a31f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|376005|366007|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?3pxGr59nk+QyySFJj9OQ+kYsgmUn9NMdYiFoJvy2RCLQSuaI2ndCsoCjbivD?= =?us-ascii?Q?u2YrMOqOIglo9hQffy8K2tXutCq0qzbEaqjRlTft+sAKlYiuZnYQoTXW538i?= =?us-ascii?Q?Qv7UUtQlUQFnXfpNFLAB0afW2xOf6IpQo4kugYCed5zHN4vx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qXgTg8xF2PHPOVwNr0Gjib30Mc8?= =?us-ascii?Q?7cgTySbE4yRIP2y15nTgeFnFhMdFvKGFwJtv/kkOWUQTIdoqAwy1a9vKIojH?= =?us-ascii?Q?a4i/eVAo+H6Awl5dhQoEEnZYklBTYNi992F3MgyPGjtKOvBTc2jl5Z829QW1?= =?us-ascii?Q?T5d3vUQSnQoKbm8bSeGlnwbIsXJzbdweWSM3xgb8e88IEahCofGPGXbUePXo?= =?us-ascii?Q?3MDvWjZOB7+Zaln2adl8GAOM+c+I/Vr4qCWY8k4+7IK3klMWn7RU5dmHWc05?= =?us-ascii?Q?GDqcrHRcn5Hintisz1k/5vV5dAKMTCjRua/2o/1qK/Xxr9hWE9dbbei+JdgO?= =?us-ascii?Q?UAxhMvo=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:(13230031)(1800799015)(376005)(366007)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?umru8z6YH2KZpK5htA7T5SdATSg0PNBfEqUE7EtV1+4UwZmxbpWouBCW50Ir?= =?us-ascii?Q?jaSDFgXLAVa4jOQq+kEu98D6wAnOdRx9QEEqUJljmjENu5MwFopSr7ZyYzTv?= =?us-ascii?Q?2svwU3OKYqyfDb0GbtNyiE70t8KYjhUtzorYXrxBfwJu8cJCBqFsKvqhHEPO?= =?us-ascii?Q?BpNkrRZyVA9/nbRmN01uLQc7+TUtT/S5petCbDBrDO1u05WYaBUKtdJI9k7X?= =?us-ascii?Q?EqQw9zWYcCqip/YIfXGYM6qq1RrlvlQvCQshE4EP4ojkv7KHEqJJsK8yqQ/h?= =?us-ascii?Q?2efsqpElO5nL7f5+6C5+taD+kH0eLYNYJ0RSDwwflivNqYu1stIMio0pS/bw?= =?us-ascii?Q?wd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1XMgNUSXS5JPwZrTlz5ITwVQpz?= =?us-ascii?Q?hsRHDr4C1fBXgMLPPsEdJvN59eV2tQk74IXrj9UZzHAH+eEbf5USoG3h10c9?= =?us-ascii?Q?O1KAfy59r+XzAaFPvniC5q6rfOkJTSHaddBSN56P6m80VcDSLQGq+L92aMV9?= =?us-ascii?Q?NwabcCyCWvyie/VUpYPQkJBCn5cdq6oQCYyCJrkwoavDuftt7x57Mhm/HecF?= =?us-ascii?Q?2TAVcY7MAyAc2kAEEChyAuf/sm7HtsssqMDvQUIhuSi4YmfIpcgStC9s+JSt?= =?us-ascii?Q?DMenqIN/1HuVsJS57FoYEDrSnYg+MIImYrHvPF4R3uQ/rG8Z41IklKUJnvGB?= =?us-ascii?Q?2cFn7gGJ/p9Q4UVeaaw=3D?= 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: 142bdb73-bf5e-49b8-3b74-08dc8615a31f X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jun 2024 10:44:26.8633 (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: dCuuaRJ91GICSBomtue42NVfmqjXVIvOPddJwxB16gqI0iYytk6/5kWPWG5vSedXFEUrLIVhURX8WxhcXCJK2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR18MB3798 X-Proofpoint-ORIG-GUID: H4XcBNebPklsjzOwx-ddsiIR-Gs9iD16 X-Proofpoint-GUID: H4XcBNebPklsjzOwx-ddsiIR-Gs9iD16 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-06-06_01,2024-06-06_02,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 v3 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 > Signed-off-by: Jack Bond-Preston > Reviewed-by: Wathsala Vithanage Hi Kai, Please review these optimizations. Regards, Akhil