From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A7868A04BA; Fri, 2 Oct 2020 18:00:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 09F741DA75; Fri, 2 Oct 2020 17:59:38 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3C1E91D9FC for ; Fri, 2 Oct 2020 17:59:35 +0200 (CEST) IronPort-SDR: ey0GKNUS3NSIEEhdK9Ax9oaZF7YC/BnZmRwtvOfBL19BqneCP1mUCEQo66IrQY7F6nxUpTnFac cS381UYdD96g== X-IronPort-AV: E=McAfee;i="6000,8403,9762"; a="163115264" X-IronPort-AV: E=Sophos;i="5.77,328,1596524400"; d="scan'208";a="163115264" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2020 08:59:34 -0700 IronPort-SDR: ubwaFa7QQZkqr+tXZsQssn2b9qmOAx4yEgXgORDq88rYNhTxtvzggKBeKqD5sdqDtMt6arkXhk S5TBKemOCtFA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,328,1596524400"; d="scan'208";a="309069010" Received: from silpixa00399126.ir.intel.com ([10.237.222.4]) by orsmga003.jf.intel.com with ESMTP; 02 Oct 2020 08:59:33 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, arybchenko@solarflare.com, ferruh.yigit@intel.com, thomas@monjalon.net, Bruce Richardson Date: Fri, 2 Oct 2020 16:58:51 +0100 Message-Id: <20201002155855.622456-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201002155855.622456-1-bruce.richardson@intel.com> References: <20200916164429.244847-1-bruce.richardson@intel.com> <20201002155855.622456-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC PATCH v2 4/8] qat: build from common folder X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since the drivers in the common directory can be processed out of order, in this case following the "bus" directory, we can simplify somewhat the build of the QAT driver to be done entirely from the "common/qat" folder rather than having it's build distributed across 3 folders. This also opens up the possibility of building the QAT driver with crypto only and the compression part disabled. It further allows more sensible naming of the resulting shared library in case of standardizing library names based on device class; i.e. common_qat is more descriptive for a combined crypto/compression driver than either of the other two prefixes individually. Signed-off-by: Bruce Richardson --- drivers/common/meson.build | 2 +- drivers/common/qat/meson.build | 69 ++++++++++++++++--- .../qat/rte_common_qat_version.map} | 0 drivers/compress/meson.build | 2 +- drivers/compress/qat/meson.build | 17 ----- drivers/crypto/meson.build | 1 - drivers/crypto/qat/meson.build | 23 ------- drivers/meson.build | 1 + 8 files changed, 63 insertions(+), 52 deletions(-) rename drivers/{compress/qat/rte_pmd_qat_version.map => common/qat/rte_common_qat_version.map} (100%) delete mode 100644 drivers/compress/qat/meson.build delete mode 100644 drivers/crypto/qat/meson.build diff --git a/drivers/common/meson.build b/drivers/common/meson.build index 7ac1ca73a2..abb4f1529a 100644 --- a/drivers/common/meson.build +++ b/drivers/common/meson.build @@ -6,6 +6,6 @@ if is_windows endif std_deps = ['eal'] -drivers = ['cpt', 'dpaax', 'iavf', 'mvep', 'octeontx', 'octeontx2', 'qat', 'sfc_efx'] +drivers = ['cpt', 'dpaax', 'iavf', 'mvep', 'octeontx', 'octeontx2', 'sfc_efx'] config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON' driver_name_fmt = 'rte_common_@0@' diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build index 8de2492893..3409162d03 100644 --- a/drivers/common/qat/meson.build +++ b/drivers/common/qat/meson.build @@ -1,15 +1,66 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2018 Intel Corporation -# This does not build a driver, but instead holds common files for -# the crypto and compression drivers. -build = false -reason = '' # sentinal value to suppress printout -qat_deps = ['bus_pci'] -qat_sources = files('qat_common.c', +config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON' +driver_name_fmt = 'rte_common_@0@' + +qat_crypto = true +qat_crypto_path = 'crypto/qat' +qat_crypto_relpath = '../../' + qat_crypto_path +qat_compress = true +qat_compress_path = 'compress/qat' +qat_compress_relpath = '../../' + qat_compress_path + +if disabled_drivers.contains(qat_crypto_path) + qat_crypto = false + dpdk_drvs_disabled += qat_crypto_path + set_variable(qat_crypto_path.underscorify() + '_disable_reason', + 'Explicitly disabled via build config') +endif +if disabled_drivers.contains(qat_compress_path) + qat_compress = false + dpdk_drvs_disabled += qat_compress_path + set_variable(qat_compress_path.underscorify() + '_disable_reason', + 'Explicitly disabled via build config') +endif + +libcrypto = dependency('libcrypto', required: false) +if qat_crypto and not libcrypto.found() + qat_crypto = false + dpdk_drvs_disabled += qat_crypto_path + set_variable(qat_crypto_path.underscorify() + '_disable_reason', + 'missing dependency, libcrypto') +endif + +# The driver should not build if both compression and crypto are disabled +#FIXME common code depends on compression files so check only compress! +if not qat_compress # and not qat_crypto + build = false + reason = '' # rely on reason for compress/crypto above + subdir_done() +endif + +deps += ['bus_pci', 'cryptodev', 'net', 'compressdev'] +sources += files('qat_common.c', 'qat_qp.c', 'qat_device.c', 'qat_logs.c') -qat_includes = [include_directories('.', 'qat_adf')] -qat_ext_deps = [] -qat_cflags = [] +includes += include_directories('qat_adf', + qat_crypto_relpath, + qat_compress_relpath) + +if qat_compress + foreach f: ['qat_comp_pmd.c', 'qat_comp.c'] + sources += files(join_paths(qat_compress_relpath, f)) + endforeach +endif + +if qat_crypto + foreach f: ['qat_sym_pmd.c', 'qat_sym.c', 'qat_sym_session.c', + 'qat_asym_pmd.c', 'qat_asym.c'] + sources += files(join_paths(qat_crypto_relpath, f)) + endforeach + deps += ['security'] + ext_deps += libcrypto + cflags += ['-DBUILD_QAT_SYM', '-DBUILD_QAT_ASYM'] +endif diff --git a/drivers/compress/qat/rte_pmd_qat_version.map b/drivers/common/qat/rte_common_qat_version.map similarity index 100% rename from drivers/compress/qat/rte_pmd_qat_version.map rename to drivers/common/qat/rte_common_qat_version.map diff --git a/drivers/compress/meson.build b/drivers/compress/meson.build index bea1720a0b..3a4723c0ce 100644 --- a/drivers/compress/meson.build +++ b/drivers/compress/meson.build @@ -5,7 +5,7 @@ if is_windows subdir_done() endif -drivers = ['isal', 'octeontx', 'qat', 'zlib'] +drivers = ['isal', 'octeontx', 'zlib'] std_deps = ['compressdev'] # compressdev pulls in all other needed deps config_flag_fmt = 'RTE_LIBRTE_PMD_@0@' diff --git a/drivers/compress/qat/meson.build b/drivers/compress/qat/meson.build deleted file mode 100644 index a002469809..0000000000 --- a/drivers/compress/qat/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017-2018 Intel Corporation - - -# Add our sources files to the list -qat_sources += files('qat_comp_pmd.c', - 'qat_comp.c') -qat_includes += include_directories('.') -qat_deps += 'compressdev' -qat_ext_deps += dep - -# build the whole driver -sources += qat_sources -cflags += qat_cflags -deps += qat_deps -ext_deps += qat_ext_deps -includes += qat_includes diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build index 25b99c19cb..bd7a940e6d 100644 --- a/drivers/crypto/meson.build +++ b/drivers/crypto/meson.build @@ -19,7 +19,6 @@ drivers = ['aesni_gcm', 'octeontx', 'octeontx2', 'openssl', - 'qat', 'scheduler', 'snow3g', 'virtio', diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build deleted file mode 100644 index a225f374a6..0000000000 --- a/drivers/crypto/qat/meson.build +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright(c) 2017-2018 Intel Corporation - -# this does not build the QAT driver, instead that is done in the compression -# driver which comes later. Here we just add our sources files to the list -build = false -reason = '' # sentinal value to suppress printout -dep = dependency('libcrypto', required: false) -qat_includes += include_directories('.') -qat_deps += 'cryptodev' -qat_deps += 'net' -qat_deps += 'security' -if dep.found() - # Add our sources files to the list - qat_sources += files('qat_sym_pmd.c', - 'qat_sym.c', - 'qat_sym_session.c', - 'qat_asym_pmd.c', - 'qat_asym.c') - qat_ext_deps += dep - qat_cflags += '-DBUILD_QAT_SYM' - qat_cflags += '-DBUILD_QAT_ASYM' -endif diff --git a/drivers/meson.build b/drivers/meson.build index b5ac483d31..b95b005839 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -6,6 +6,7 @@ subdirs = [ 'common', 'bus', 'common/mlx5', # depends on bus. + 'common/qat', # depends on bus. 'mempool', # depends on common and bus. 'net', # depends on common, bus, mempool 'raw', # depends on common, bus and net. -- 2.25.1