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 9CD80A00C4 for ; Tue, 1 Nov 2022 18:04:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9329440DDB; Tue, 1 Nov 2022 18:04:16 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id C218840223; Tue, 1 Nov 2022 18:04:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667322254; x=1698858254; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=kNe34BDhkwngmEq2FeqDVVzz/lkuoZUK9acGMCKK6PY=; b=J77ZVuqeQoQDQRIR4Y7eWZcUoQK16fpBB61wqM6NWAhqVb8YD+73eQn4 KAEmuNd2CqGBa7EktsvQBQU/vrDzLISpcG+wo+jqVD/L6GzuIUDEVxxAX heImRW/1SjFvLGUBFnzKny+f4XAkWYYvzRu9Jg0fmtY5pEVvcERT8Pv7c 8sXmT6JNgHuioXI7r2iXa1BWPGqOjvpURAWP0qWgsFMCEM8aerIF/HjIq rE8DV9w3UBit72gHEPI9HTsBsbc1pQ/YewNRX5MO4rNg11m93EVpr2wGe 9xIfizQF9owTEhmTb7mX+AC8BZ+xyvMs1xhxbSNG6xfBYD0X60ZLitDNX Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="296620985" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="296620985" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2022 10:04:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="723224346" X-IronPort-AV: E=Sophos;i="5.95,231,1661842800"; d="scan'208";a="723224346" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP; 01 Nov 2022 10:04:04 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 1 Nov 2022 10:04:03 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 1 Nov 2022 10:04:03 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Tue, 1 Nov 2022 10:04:03 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.102) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Tue, 1 Nov 2022 10:04:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FnP6wiIsN8HRSkCZIxZo+bm/ze/tyNgLQRRuE/URTJjKIxm6Ku5tWzioawTe8jU6lBIsWnjw1T3A2eFKXv9B0VAlizNBt30zCMOiyixHcllZI5ROrZv8Au8AUhxxew3zJwaCumwJS+kXiTwSaXmkhXL4sIwZXQScKjagJsQksvlQFSPHn1l77zI+2749N5ZC1b2oQ9RtKbyTpqFMjowyyKfdq1SN0wIN1sYlSKJEl1vqRSjQeeP1VPbSgW/7Fxb43kcwk3EPLghO3a73tyVSNZ6VnmT/5l/KWNk9UcjDi36AKqn5+vHPnt21plGkHKr6f17dIumqBlueU2yB4Z2h8Q== 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=8FWoct2JmZR3wtIXyOEe3Mra/M5udXmIIdJsPMhelpk=; b=SdCHhJVrYC25kn6c8bGr4Tq5DAWLs2TDQ/ZFd/8CCYbZrduUjw/CDbquDvbDOCUzEExNmeeIWPJwu9YSb8oKnx8iPteE/FfVgMv47sM5ryjl6B6oRIoqh9T8qe0JDbTOGT69UJH8uZok2MAK2DBQ1QBaEOh9gFoPtt+UbjZ5u8c6kk6IYN5VI0wGd5XCJDr+NtFEDTH4y1FRtn8+1LWh2qrZkqloQi+Zt6YbMIb/eA0Lu7UQniyxEQNWV8d3IHOBichL7xNJCdJoa1weCraIN6A6U+XO2zQqG53/dpLMWlw4Coqm1lZ5f+/M9aSag8WQFUy8dy3FnlcWuxuBG1z+CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN6PR11MB3408.namprd11.prod.outlook.com (2603:10b6:805:bc::22) by MN2PR11MB4677.namprd11.prod.outlook.com (2603:10b6:208:24e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Tue, 1 Nov 2022 17:04:01 +0000 Received: from SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::53c9:fc70:7345:b561]) by SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::53c9:fc70:7345:b561%7]) with mapi id 15.20.5769.019; Tue, 1 Nov 2022 17:04:01 +0000 From: "Ji, Kai" To: "Dooley, Brian" CC: "dev@dpdk.org" , "stable@dpdk.org" , "gakhil@marvell.com" , "Coyle, David" , "O'Sullivan, Kevin" Subject: RE: [PATCH v1] crypto/qat: fix reallocate OpenSSL version check Thread-Topic: [PATCH v1] crypto/qat: fix reallocate OpenSSL version check Thread-Index: AQHY7VEi5pyEA+/Mj0CymZmGpPeKTa4qSdaA Date: Tue, 1 Nov 2022 17:04:00 +0000 Message-ID: References: <20221031174919.642522-1-brian.dooley@intel.com> In-Reply-To: <20221031174919.642522-1-brian.dooley@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.500.17 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3408:EE_|MN2PR11MB4677:EE_ x-ms-office365-filtering-correlation-id: 23c081e0-8181-4741-40a8-08dabc2b12ba x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tDTAFCqP2ZDZUMVc9VCasTwoFyRP3GSdh45sCwokgWCdaqMqJ7X5oHPfDH0w1Gim5/hNSOV/kGkMKxhjilsIOzn41clhQ35g1Vm+ljJfVAY8MXLhezOI2zOtKRUVWQjXQDE2Wagtt8xQBSBG04Lz70lTil++fjvzbXDyFNvTY+t5oRf1EMo71rD3fBdeaOnAPplBlGRWNugVoDsntROcOpQ4mS/QX81sIThlCZ9rFxmKXYilInoNH9tTFuWdmUk2tiCSH5sgkGyo0r8ZQZ/5HRQSn3jsTRkzzuxxB0Ud0xozL784+o3NIg4RCvtf7sUOwLiDlFi3wNRAw8wUhVf63IvOGwZGMORGL7LSX76yxcsHwe3FAZxiXk7CpPnKlphTsFiTriiPzSNz26bU7QAmCt8Cvz5Cfl7Qu5eHdGII7RYrT4LevNdclTvj8CNkGLLMY2J7Yn+KBzOCADPgOaqetIwatnPfupPog1Y/KD0c5WSQ5lUZQf1TfM4Lg+UzwAMOayEq0eMIrLzXh0o7Rl50ncM2ibOtiIa7mXq83CPwzjRauOmyRZNDMtCHyQp+6YllatUphbUgoL2C/XiIe20WJuYXLlFcZAd1o+mOYW9sjH71mvJfBpw4v8HXgQ+1zwK0TQQHkqhPjqv8ra010PqLZG7RizjIvBcLGB9cLrl+oQUEb5acC8zVW4LWQ2GDtdOUhsXqkrBLy9BRxZdxME2PVP0PSnwRxalud/qHkipeKnQH2zdUYAD/akSlqpEdwkwAGKqrBVxnwuDuV5OPr9KJZQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3408.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(39860400002)(396003)(366004)(136003)(376002)(451199015)(38070700005)(82960400001)(8936002)(38100700002)(86362001)(55016003)(33656002)(122000001)(71200400001)(2906002)(107886003)(66556008)(66446008)(66476007)(64756008)(6636002)(4326008)(6862004)(7696005)(5660300002)(66946007)(76116006)(6506007)(478600001)(52536014)(41300700001)(54906003)(186003)(8676002)(316002)(53546011)(26005)(9686003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rdNMHB2kflfKApv6aJ78ZPCLwU0QLClbObPDxZzCOUpncTH402P+I0lSMCwL?= =?us-ascii?Q?mNPgx/L6TmAkG58geUmvSHOfK8iSkQG9B4WcsY/jXnjfhlhTkYhEFFN4EHyC?= =?us-ascii?Q?M3iYUehEK05qC//NSZ1KBuW4/1g0fD20O7CzBcSOP3DjzBL/dfFu4Jw+z1GP?= =?us-ascii?Q?zhPMxk6bsRu8o5Ebon4CPpken5vGJeMJYNZlkOTvaF0iYdUaZIJZU24fHW/6?= =?us-ascii?Q?+j7OmTns2gRzmr0ZpEVS3ezK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?us-ascii?Q?0sANs49YibN324pJWpkuMkmN+YZU84c+nuWmML/eUgeV+oYjmSisVymucNmD?= =?us-ascii?Q?XyI4U/FdFvX04paCacVznsyfWHe0W5JBng8py3l9WD0gAfoDZh2Z8ksZDjj8?= =?us-ascii?Q?QSc/0S8LApks+nc/RoqNrojesv1pq5ZT423E3OjYA50iKZhFoelbPJ1vrPPd?= =?us-ascii?Q?YcQ4Z+m67egS10jHZ3+aCi3LVAWarWnUlaXbVuE4p6Lenj438+zH8LzRPNhU?= =?us-ascii?Q?HtYlHdgImaNddR3nP/sXzW59kZPoC7ls3S9qBKrAzgfvNgH1EjKtmpxCZ3Dr?= =?us-ascii?Q?/wO+xiksreNFnJnmMMp3B/d1ASCftLuvjzMAnNKZedAPz7HSpqa3+ninISxY?= =?us-ascii?Q?F8Kgs/tEeupNkFi0ySQbu261U72k0C7717J7ubuOFwpZO6//72aAZxnnmH9A?= =?us-ascii?Q?GdbOpmxIypvAepuZwAw=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3408.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23c081e0-8181-4741-40a8-08dabc2b12ba X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2022 17:04:00.9533 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uv+j2/od1be+e0MSZi4XGDg57GVnMoaM/7CLAozQjJE1G6dUVpcvkwy787yU0TMLR5tSGLKl1yk83pmr6XsF6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4677 X-OriginatorOrg: intel.com 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 Please see my comments below, In addition, in qat_sym_session.c l.2642 return qat_sym_gen_dev_ops[qat_dev_gen].set_session((void *)cdev, session); the session pointer should cast to (void *) or we can pass session_private = directly. Regards Kai=20 > -----Original Message----- > From: Dooley, Brian > Sent: Monday, October 31, 2022 5:49 PM > To: Ji, Kai > Cc: dev@dpdk.org; stable@dpdk.org; gakhil@marvell.com; Coyle, David > ; O'Sullivan, Kevin ; > Dooley, Brian > Subject: [PATCH v1] crypto/qat: fix reallocate OpenSSL version check >=20 > Move the ossl_legacy_provider_unload() into the right place for secure pr= otocol > for QAT. Remove unnecessary unload from session destroy. >=20 > Fixes: 52d59b92b06d ("crypto/qat: enable OpenSSL legacy provider in sessi= on") > Cc: kai.ji@intel.com > CC: stable@dpdk.org > Signed-off-by: Brian Dooley > --- > drivers/crypto/qat/qat_sym_session.c | 32 ++++++++++++++-------------- > 1 file changed, 16 insertions(+), 16 deletions(-) >=20 > diff --git a/drivers/crypto/qat/qat_sym_session.c > b/drivers/crypto/qat/qat_sym_session.c > index 71fa595031..6872531d67 100644 > --- a/drivers/crypto/qat/qat_sym_session.c > +++ b/drivers/crypto/qat/qat_sym_session.c > @@ -520,19 +520,19 @@ qat_sym_session_configure(struct rte_cryptodev > *dev, > int ret; >=20 > #if (OPENSSL_VERSION_NUMBER >=3D 0x30000000L) > - OSSL_PROVIDER * legacy; > - OSSL_PROVIDER *deflt; > + OSSL_PROVIDER * legacy; > + OSSL_PROVIDER *deflt; >=20 > - /* Load Multiple providers into the default (NULL) library > context */ > - legacy =3D OSSL_PROVIDER_load(NULL, "legacy"); > - if (legacy =3D=3D NULL) > - return -EINVAL; > + /* Load Multiple providers into the default (NULL) library context */ > + legacy =3D OSSL_PROVIDER_load(NULL, "legacy"); > + if (legacy =3D=3D NULL) > + return -EINVAL; >=20 > - deflt =3D OSSL_PROVIDER_load(NULL, "default"); > - if (deflt =3D=3D NULL) { > - OSSL_PROVIDER_unload(legacy); > - return -EINVAL; > - } > + deflt =3D OSSL_PROVIDER_load(NULL, "default"); > + if (deflt =3D=3D NULL) { > + OSSL_PROVIDER_unload(legacy); > + return -EINVAL; > + } [KJ] please use ossl_legacy_provider_load() helper instead load legacy and = default libs manually here. =20 > #endif > ret =3D qat_sym_session_set_parameters(dev, xform, > CRYPTODEV_GET_SYM_SESS_PRIV(sess), > @@ -545,8 +545,8 @@ qat_sym_session_configure(struct rte_cryptodev *dev, > } >=20 > # if (OPENSSL_VERSION_NUMBER >=3D 0x30000000L) > - OSSL_PROVIDER_unload(legacy); > - OSSL_PROVIDER_unload(deflt); > + OSSL_PROVIDER_unload(legacy); > + OSSL_PROVIDER_unload(deflt); [KJ] you can use ossl_legacy_provider_unload() here > # endif > return 0; > } > @@ -2668,6 +2668,9 @@ qat_security_session_create(void *dev, > return ret; > } >=20 > +#if (OPENSSL_VERSION_NUMBER >=3D 0x30000000L) > + ossl_legacy_provider_unload(); > +#endif > return 0; > } >=20 > @@ -2684,9 +2687,6 @@ qat_security_session_destroy(void *dev > __rte_unused, > memset(s, 0, qat_sym_session_get_private_size(dev)); > } >=20 > -# if (OPENSSL_VERSION_NUMBER >=3D 0x30000000L) > - ossl_legacy_provider_unload(); > -# endif > return 0; > } >=20 > -- > 2.25.1