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 18CEEA00C4 for ; Mon, 31 Oct 2022 18:49:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A006410D3; Mon, 31 Oct 2022 18:49:28 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 83F8B40223; Mon, 31 Oct 2022 18:49:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667238565; x=1698774565; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=UQR3c5pDBIusVbkXB9HxGZghYQFbwoEw9HjEmmZq+Iw=; b=AmsvJXJz/hM6HjA1yjyoKfCBoZbaHRi/BKEP6rZbFtR4sAhBgNC6sSqR EHNe+yb610nLUiff+O26yP+cgngjs3L6zeBWRV0kWscqWXuKipxdPo2Xy K/nCapP3rG8CuJYkG1zmz1/ma7pTo6UHJVZSXcNPArIwpoUQoJzHFlBnX lgY7yCw2up22MrD+UY5eBL4Tu5AdhTKxuCYXIYz7ghgz0bR9TEeG5V8Vl jJeVZA2tkzMAYrQulYA9yRD6FHhUQGygncoJm+Yxvnu8FgnjppHZoR1zv 9P90SreWvOtX7jJm5x7HSnHppxE8jWvvSv6NrO696xEd/nzclfk4ZmxNh Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="310051623" X-IronPort-AV: E=Sophos;i="5.95,228,1661842800"; d="scan'208";a="310051623" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2022 10:49:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10517"; a="664870738" X-IronPort-AV: E=Sophos;i="5.95,228,1661842800"; d="scan'208";a="664870738" Received: from silpixa00400883.ir.intel.com ([10.243.23.148]) by orsmga008.jf.intel.com with ESMTP; 31 Oct 2022 10:49:22 -0700 From: Brian Dooley To: Kai Ji Cc: dev@dpdk.org, stable@dpdk.org, gakhil@marvell.com, david.coyle@intel.com, kevin.osullivan@intel.com, Brian Dooley Subject: [PATCH v1] crypto/qat: fix reallocate OpenSSL version check Date: Mon, 31 Oct 2022 17:49:19 +0000 Message-Id: <20221031174919.642522-1-brian.dooley@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Move the ossl_legacy_provider_unload() into the right place for secure protocol for QAT. Remove unnecessary unload from session destroy. Fixes: 52d59b92b06d ("crypto/qat: enable OpenSSL legacy provider in session") 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(-) 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; #if (OPENSSL_VERSION_NUMBER >= 0x30000000L) - OSSL_PROVIDER * legacy; - OSSL_PROVIDER *deflt; + OSSL_PROVIDER * legacy; + OSSL_PROVIDER *deflt; - /* Load Multiple providers into the default (NULL) library context */ - legacy = OSSL_PROVIDER_load(NULL, "legacy"); - if (legacy == NULL) - return -EINVAL; + /* Load Multiple providers into the default (NULL) library context */ + legacy = OSSL_PROVIDER_load(NULL, "legacy"); + if (legacy == NULL) + return -EINVAL; - deflt = OSSL_PROVIDER_load(NULL, "default"); - if (deflt == NULL) { - OSSL_PROVIDER_unload(legacy); - return -EINVAL; - } + deflt = OSSL_PROVIDER_load(NULL, "default"); + if (deflt == NULL) { + OSSL_PROVIDER_unload(legacy); + return -EINVAL; + } #endif ret = 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, } # if (OPENSSL_VERSION_NUMBER >= 0x30000000L) - OSSL_PROVIDER_unload(legacy); - OSSL_PROVIDER_unload(deflt); + OSSL_PROVIDER_unload(legacy); + OSSL_PROVIDER_unload(deflt); # endif return 0; } @@ -2668,6 +2668,9 @@ qat_security_session_create(void *dev, return ret; } +#if (OPENSSL_VERSION_NUMBER >= 0x30000000L) + ossl_legacy_provider_unload(); +#endif return 0; } @@ -2684,9 +2687,6 @@ qat_security_session_destroy(void *dev __rte_unused, memset(s, 0, qat_sym_session_get_private_size(dev)); } -# if (OPENSSL_VERSION_NUMBER >= 0x30000000L) - ossl_legacy_provider_unload(); -# endif return 0; } -- 2.25.1