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 0927543750; Thu, 21 Dec 2023 13:23:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0BB64027D; Thu, 21 Dec 2023 13:23:09 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id CED55400D6 for ; Thu, 21 Dec 2023 13:23:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703161388; x=1734697388; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fusbRQPYqih6PQHAUYr+67OJ6zqbrJ6yVHc20yRmjtc=; b=m5jY6UUhkcR4Fm5tKRBnQTKCMVZqiz0NNaBJv6bz9SFR4Ni5ZAyDG1Di 9UF2Hm+NG5GMtvnetI/pTro//mM8b9VCcYZDSxg8864WxvNrrIIMNbhVn gUrW36Qeyu1U/rViAIVj6VcgzYQ86i0pFL9a+N2kDFk26uCANShsVZh9q jYAtSQbJMB4MadtVsWv3FNfA9+3Eo1o0LuXzK1c5BJrHLmHha5v44mW76 P9oSV//Q1aKXBtyZDwL0nmUeEBVy9u8vBPICg3v7flk1jox3XyWFxu954 vhhkacJsgaskXd4qmZfRaHO/v5yMfHuAx8FfX1HhXjDBqe0jX53cv3qQK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="14651812" X-IronPort-AV: E=Sophos;i="6.04,293,1695711600"; d="scan'208";a="14651812" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2023 04:23:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="920313581" X-IronPort-AV: E=Sophos;i="6.04,293,1695711600"; d="scan'208";a="920313581" Received: from unknown (HELO silpixa00400886.ir.intel.com) ([10.243.23.150]) by fmsmga001.fm.intel.com with ESMTP; 21 Dec 2023 04:23:05 -0800 From: Brian Dooley To: Kai Ji Cc: dev@dpdk.org, gakhil@marvell.com, Brian Dooley Subject: [PATCH v1] common/qat: option to disable asym driver Date: Thu, 21 Dec 2023 12:23:02 +0000 Message-Id: <20231221122302.2834184-1-brian.dooley@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Currently the QAT sym and asym drivers can only be disabled together when building. Add an option to disable the QAT asym driver. Signed-off-by: Brian Dooley --- drivers/common/qat/meson.build | 22 +++++++++++++++++--- drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c | 2 ++ drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 2 ++ drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c | 2 ++ drivers/crypto/qat/qat_crypto.c | 4 ++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build index 5c36fbb270..2f50302d45 100644 --- a/drivers/common/qat/meson.build +++ b/drivers/common/qat/meson.build @@ -9,6 +9,8 @@ endif qat_crypto = true qat_crypto_path = 'crypto/qat' +qat_crypto_asym = true +qat_crypto_asym_path = 'crypto/qat_asym' qat_crypto_relpath = '../../' + qat_crypto_path qat_compress = true qat_compress_path = 'compress/qat' @@ -20,6 +22,12 @@ if disable_drivers.contains(qat_crypto_path) set_variable(qat_crypto_path.underscorify() + '_disable_reason', 'Explicitly disabled via build config') endif +if get_option('disable_drivers').contains(qat_crypto_asym_path) + qat_crypto_asym = false + dpdk_drvs_disabled += qat_crypto_asym_path + set_variable(qat_crypto_asym_path.underscorify() + '_disable_reason', + 'Explicitly disabled via build config') +endif if disable_drivers.contains(qat_compress_path) qat_compress = false dpdk_drvs_disabled += qat_compress_path @@ -102,9 +110,8 @@ endif if qat_crypto foreach f: ['qat_sym.c', 'qat_sym_session.c', - 'qat_asym.c', 'qat_crypto.c', + 'qat_crypto.c', 'dev/qat_sym_pmd_gen1.c', - 'dev/qat_asym_pmd_gen1.c', 'dev/qat_crypto_pmd_gen2.c', 'dev/qat_crypto_pmd_gen3.c', 'dev/qat_crypto_pmd_gen4.c', @@ -112,5 +119,14 @@ if qat_crypto sources += files(join_paths(qat_crypto_relpath, f)) endforeach deps += ['security'] - cflags += ['-DBUILD_QAT_SYM', '-DBUILD_QAT_ASYM'] + cflags += ['-DBUILD_QAT_SYM'] +endif + +if qat_crypto_asym + foreach f: [ 'qat_asym.c', 'dev/qat_asym_pmd_gen1.c', ] + sources += files(join_paths(qat_crypto_relpath, f)) + endforeach + deps += ['security'] + ext_deps += libcrypto + cflags += ['-DBUILD_QAT_ASYM'] endif diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c b/drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c index df47767749..523e74f398 100644 --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c @@ -337,6 +337,7 @@ RTE_INIT(qat_sym_crypto_gen2_init) qat_sym_create_security_gen1; } +#ifdef BUILD_QAT_ASYM RTE_INIT(qat_asym_crypto_gen2_init) { qat_asym_gen_dev_ops[QAT_GEN2].cryptodev_ops = @@ -348,3 +349,4 @@ RTE_INIT(qat_asym_crypto_gen2_init) qat_asym_gen_dev_ops[QAT_GEN2].set_session = qat_asym_crypto_set_session_gen1; } +#endif diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c b/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c index 02bcdb06b1..3fa90bebc9 100644 --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c @@ -773,6 +773,7 @@ RTE_INIT(qat_sym_crypto_gen3_init) qat_sym_create_security_gen1; } +#ifdef BUILD_QAT_ASYM RTE_INIT(qat_asym_crypto_gen3_init) { qat_asym_gen_dev_ops[QAT_GEN3].cryptodev_ops = @@ -784,3 +785,4 @@ RTE_INIT(qat_asym_crypto_gen3_init) qat_asym_gen_dev_ops[QAT_GEN3].set_session = qat_asym_crypto_set_session_gen1; } +#endif diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c b/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c index de72383d4b..d19db0c2aa 100644 --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c @@ -419,6 +419,7 @@ RTE_INIT(qat_sym_crypto_gen4_init) qat_sym_create_security_gen1; } +#ifdef BUILD_QAT_ASYM RTE_INIT(qat_asym_crypto_gen4_init) { qat_asym_gen_dev_ops[QAT_GEN4].cryptodev_ops = @@ -430,3 +431,4 @@ RTE_INIT(qat_asym_crypto_gen4_init) qat_asym_gen_dev_ops[QAT_GEN4].set_session = qat_asym_crypto_set_session_gen1; } +#endif diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index 861679373b..57590b0086 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -53,8 +53,10 @@ qat_cryptodev_info_get(struct rte_cryptodev *dev, qat_qps_per_service(qat_dev, service_type); info->feature_flags = dev->feature_flags; info->capabilities = qat_private->qat_dev_capabilities; +#ifdef BUILD_QAT_ASYM if (service_type == QAT_SERVICE_ASYMMETRIC) info->driver_id = qat_asym_driver_id; +#endif if (service_type == QAT_SERVICE_SYMMETRIC) info->driver_id = qat_sym_driver_id; @@ -168,8 +170,10 @@ qat_cryptodev_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id, for (i = 0; i < qp->nb_descriptors; i++) { if (service_type == QAT_SERVICE_SYMMETRIC) qat_sym_init_op_cookie(qp->op_cookies[i]); +#ifdef BUILD_QAT_ASYM else qat_asym_init_op_cookie(qp->op_cookies[i]); +#endif } if (qat_private->cipher_crc_offload_enable) { -- 2.25.1