DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, arybchenko@solarflare.com,
	ferruh.yigit@intel.com, thomas@monjalon.net, bluca@debian.org,
	Bruce Richardson <bruce.richardson@intel.com>,
	John Griffin <john.griffin@intel.com>,
	Fiona Trahe <fiona.trahe@intel.com>,
	Deepak Kumar Jain <deepak.k.jain@intel.com>,
	Ray Kinsella <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>,
	Ashish Gupta <ashish.gupta@marvell.com>
Subject: [dpdk-dev] [PATCH v4 4/8] qat: build from common folder
Date: Thu, 15 Oct 2020 12:03:55 +0100	[thread overview]
Message-ID: <20201015110359.706644-5-bruce.richardson@intel.com> (raw)
In-Reply-To: <20201015110359.706644-1-bruce.richardson@intel.com>

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 <bruce.richardson@intel.com>
---
 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 7ac1ca73a..abb4f1529 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 8de249289..3409162d0 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 bea1720a0..3a4723c0c 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 a00246980..000000000
--- 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 25b99c19c..bd7a940e6 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 a225f374a..000000000
--- 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 b5ac483d3..b95b00583 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


  parent reply	other threads:[~2020-10-15 11:05 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 16:44 [dpdk-dev] [RFC PATCH 0/5] rework feature enabling macros for compatibility Bruce Richardson
2020-09-16 16:44 ` [dpdk-dev] [RFC PATCH 1/5] app: fix missing dependencies Bruce Richardson
2020-09-16 16:44 ` [dpdk-dev] [RFC PATCH 2/5] examples/l2fwd-crypto: fix missing dependency Bruce Richardson
2020-09-16 16:44 ` [dpdk-dev] [RFC PATCH 3/5] meson: fix compatibility with make build defines Bruce Richardson
2020-09-16 16:44 ` [dpdk-dev] [RFC PATCH 4/5] build: add defines for compatibility with make build Bruce Richardson
2020-09-16 16:44 ` [dpdk-dev] [RFC PATCH 5/5] build: replace use of old build macros Bruce Richardson
2020-09-17 17:59 ` [dpdk-dev] [RFC PATCH 0/5] rework feature enabling macros for compatibility Andrew Rybchenko
2020-09-18  8:41   ` Bruce Richardson
2020-09-18  8:59     ` Andrew Rybchenko
2020-09-18 12:19       ` Ferruh Yigit
2020-09-23 12:46     ` Thomas Monjalon
2020-09-30 16:49       ` Richardson, Bruce
2020-09-30 17:31         ` Thomas Monjalon
2020-09-18 15:12 ` David Marchand
2020-09-30 16:12 ` Ferruh Yigit
2020-09-30 16:19   ` Bruce Richardson
2020-10-02 15:58 ` [dpdk-dev] [RFC PATCH v2 0/8] Rework build macros Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 1/8] app: fix missing dependencies Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 2/8] examples/l2fwd-crypto: fix missing dependency Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 3/8] build: add defines for compatibility with make build Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 4/8] qat: build from common folder Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 5/8] build: remove library name from version map filename Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 6/8] build: standardize component names and defines Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 7/8] build: replace use of old build macros Bruce Richardson
2020-10-02 15:58   ` [dpdk-dev] [RFC PATCH v2 8/8] [v21.02] build: remove compatibility build defines Bruce Richardson
2020-10-14 14:12 ` [dpdk-dev] [PATCH v3 0/7] Rework build macros Bruce Richardson
2020-10-14 14:12   ` [dpdk-dev] [PATCH v3 1/7] app: fix missing dependencies Bruce Richardson
2020-10-15 10:32     ` Luca Boccassi
2020-10-14 14:12   ` [dpdk-dev] [PATCH v3 2/7] examples/l2fwd-crypto: fix missing dependency Bruce Richardson
2020-10-15 10:32     ` Luca Boccassi
2020-10-14 14:13   ` [dpdk-dev] [PATCH v3 3/7] build: add defines for compatibility with make build Bruce Richardson
2020-10-15 10:31     ` Luca Boccassi
2020-10-15 11:20       ` Bruce Richardson
2020-10-14 14:13   ` [dpdk-dev] [PATCH v3 4/7] qat: build from common folder Bruce Richardson
2020-10-15 10:32     ` Luca Boccassi
2020-10-14 14:13   ` [dpdk-dev] [PATCH v3 5/7] build: remove library name from version map filename Bruce Richardson
2020-10-15 10:32     ` Luca Boccassi
2020-10-14 14:13   ` [dpdk-dev] [PATCH v3 6/7] build: standardize component names and defines Bruce Richardson
2020-10-15 10:30     ` Luca Boccassi
2020-10-15 11:18       ` Bruce Richardson
2020-10-15 13:05         ` Luca Boccassi
2020-10-15 14:03           ` Bruce Richardson
2020-10-15 15:32             ` Luca Boccassi
2020-10-15 15:34               ` Bruce Richardson
2020-10-14 14:13   ` [dpdk-dev] [PATCH v3 7/7] build: replace use of old build macros Bruce Richardson
2020-10-15 10:32     ` Luca Boccassi
2020-10-15 11:03 ` [dpdk-dev] [PATCH v4 0/8] Rework " Bruce Richardson
2020-10-15 11:03   ` [dpdk-dev] [PATCH v4 1/8] app: fix missing dependencies Bruce Richardson
2020-10-15 11:03   ` [dpdk-dev] [PATCH v4 2/8] examples/l2fwd-crypto: fix missing dependency Bruce Richardson
2020-10-15 11:03   ` [dpdk-dev] [PATCH v4 3/8] build: add defines for compatibility with make build Bruce Richardson
2020-10-15 11:03   ` Bruce Richardson [this message]
2020-10-15 11:03   ` [dpdk-dev] [PATCH v4 5/8] build: remove library name from version map filename Bruce Richardson
2020-10-18 11:56     ` Xu, Rosen
2020-10-15 11:03   ` [dpdk-dev] [PATCH v4 6/8] devtools/test-null: load all drivers from directory Bruce Richardson
2020-10-15 11:03   ` [dpdk-dev] [PATCH v4 7/8] build: standardize component names and defines Bruce Richardson
2020-10-18 11:55     ` Xu, Rosen
2020-10-15 11:03   ` [dpdk-dev] [PATCH v4 8/8] build: replace use of old build macros Bruce Richardson
2020-10-18 11:55     ` Xu, Rosen
2020-10-15 15:05 ` [dpdk-dev] [PATCH v5 0/8] Rework " Bruce Richardson
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 1/8] app: fix missing dependencies Bruce Richardson
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 2/8] examples/l2fwd-crypto: fix missing dependency Bruce Richardson
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 3/8] build: add defines for compatibility with make build Bruce Richardson
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 4/8] qat: build from common folder Bruce Richardson
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 5/8] build: remove library name from version map filename Bruce Richardson
2020-10-15 15:28     ` Andrew Rybchenko
2020-10-19 20:04       ` Thomas Monjalon
2020-10-18  9:24     ` Xu, Rosen
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 6/8] devtools/test-null: load all drivers from directory Bruce Richardson
2020-10-19 16:58     ` Thomas Monjalon
2020-10-20  8:37       ` Bruce Richardson
2020-10-20 10:01         ` Thomas Monjalon
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 7/8] build: standardize component names and defines Bruce Richardson
2020-10-15 15:32     ` Andrew Rybchenko
2020-10-15 15:35     ` Bruce Richardson
2020-10-18  9:21     ` Xu, Rosen
2020-10-15 15:05   ` [dpdk-dev] [PATCH v5 8/8] build: replace use of old build macros Bruce Richardson
2020-10-15 15:34     ` Andrew Rybchenko
2020-10-18  9:23     ` Xu, Rosen
2020-10-19 19:03     ` Thomas Monjalon
2020-10-19 20:27   ` [dpdk-dev] [PATCH v5 0/8] Rework " Thomas Monjalon
2020-10-20  7:17     ` David Marchand
2020-10-20  8:37       ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015110359.706644-5-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=ashish.gupta@marvell.com \
    --cc=bluca@debian.org \
    --cc=david.marchand@redhat.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=fiona.trahe@intel.com \
    --cc=john.griffin@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).