[RFC,2/2] build: disable drivers from file
diff mbox series

Message ID 1600867161-15673-3-git-send-email-juraj.linkes@pantheon.tech
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series
  • Arm build options rework
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Juraj Linkeš Sept. 23, 2020, 1:19 p.m. UTC
Add the capability to specify which drivers will NOT be build in a file.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .../arm/{ => armada}/arm64_armada_linux_gcc   |  2 +-
 config/arm/armada/meson.build                 | 31 +++++++++++++++++++
 drivers/meson.build                           | 13 +++++---
 3 files changed, 41 insertions(+), 5 deletions(-)
 rename config/arm/{ => armada}/arm64_armada_linux_gcc (93%)
 create mode 100644 config/arm/armada/meson.build

Comments

Bruce Richardson Sept. 23, 2020, 1:58 p.m. UTC | #1
On Wed, Sep 23, 2020 at 03:19:21PM +0200, Juraj Linkeš wrote:
> Add the capability to specify which drivers will NOT be build in a file.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .../arm/{ => armada}/arm64_armada_linux_gcc   |  2 +-
>  config/arm/armada/meson.build                 | 31 +++++++++++++++++++
>  drivers/meson.build                           | 13 +++++---
>  3 files changed, 41 insertions(+), 5 deletions(-)
>  rename config/arm/{ => armada}/arm64_armada_linux_gcc (93%)
>  create mode 100644 config/arm/armada/meson.build
> 
> diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/armada/arm64_armada_linux_gcc
> similarity index 93%
> rename from config/arm/arm64_armada_linux_gcc
> rename to config/arm/armada/arm64_armada_linux_gcc
> index fa40c0398..8b4b5c8ad 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/armada/arm64_armada_linux_gcc
> @@ -14,4 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
>  
>  [properties]
> -implementor_id = '0x56'
> +machine = 'armada'
> diff --git a/config/arm/armada/meson.build b/config/arm/armada/meson.build
> new file mode 100644
> index 000000000..22fdce5fe
> --- /dev/null
> +++ b/config/arm/armada/meson.build
> @@ -0,0 +1,31 @@
> +flags = {
> +	'common': [
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MACHINE', '"armv8a"'],
> +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> +		['CONFIG_RTE_LIBRTE_COMMON_DPAAX=n', false],
> +		['CONFIG_RTE_LIBRTE_FSLMC_BUS=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA2_PMD=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA_PMD=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_CAAM_JR=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PFE_PMD=n', false],
> +		['CONFIG_RTE_LIBRTE_ENETC_PMD=n', false],
> +		['CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n', false],
> +		['CONFIG_RTE_LIBRTE_VHOST_NUMA=n', false]
> +	],

Rather than setting a list of flags like this make-style, why not have a
disabled-drivers setting, and add that to any user-provided ones? It would
save making any changes to the drivers/meson.build file, and therefore be
a lot cleaner. It would also allow using wildcards etc. to disable whole
classes of drivers
Juraj Linkeš Sept. 24, 2020, 8:31 a.m. UTC | #2
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, September 23, 2020 3:59 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [RFC PATCH 2/2] build: disable drivers from file
> 
> On Wed, Sep 23, 2020 at 03:19:21PM +0200, Juraj Linkeš wrote:
> > Add the capability to specify which drivers will NOT be build in a file.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  .../arm/{ => armada}/arm64_armada_linux_gcc   |  2 +-
> >  config/arm/armada/meson.build                 | 31 +++++++++++++++++++
> >  drivers/meson.build                           | 13 +++++---
> >  3 files changed, 41 insertions(+), 5 deletions(-)  rename
> > config/arm/{ => armada}/arm64_armada_linux_gcc (93%)  create mode
> > 100644 config/arm/armada/meson.build
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/armada/arm64_armada_linux_gcc
> > similarity index 93%
> > rename from config/arm/arm64_armada_linux_gcc rename to
> > config/arm/armada/arm64_armada_linux_gcc
> > index fa40c0398..8b4b5c8ad 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/armada/arm64_armada_linux_gcc
> > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x56'
> > +machine = 'armada'
> > diff --git a/config/arm/armada/meson.build
> > b/config/arm/armada/meson.build new file mode 100644 index
> > 000000000..22fdce5fe
> > --- /dev/null
> > +++ b/config/arm/armada/meson.build
> > @@ -0,0 +1,31 @@
> > +flags = {
> > +	'common': [
> > +		['RTE_CACHE_LINE_SIZE', 64],
> > +		['RTE_MACHINE', '"armv8a"'],
> > +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> > +		['CONFIG_RTE_LIBRTE_COMMON_DPAAX=n', false],
> > +		['CONFIG_RTE_LIBRTE_FSLMC_BUS=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA2_PMD=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA_PMD=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_CAAM_JR=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV=n',
> false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=n',
> false],
> > +		['CONFIG_RTE_LIBRTE_PFE_PMD=n', false],
> > +		['CONFIG_RTE_LIBRTE_ENETC_PMD=n', false],
> > +		['CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n', false],
> > +		['CONFIG_RTE_LIBRTE_VHOST_NUMA=n', false]
> > +	],
> 
> Rather than setting a list of flags like this make-style, why not have a disabled-
> drivers setting, and add that to any user-provided ones? It would save making
> any changes to the drivers/meson.build file, and therefore be a lot cleaner. It
> would also allow using wildcards etc. to disable whole classes of drivers
> 

I didn't think of this, thanks for the suggestion, that's much better.

Patch
diff mbox series

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/armada/arm64_armada_linux_gcc
similarity index 93%
rename from config/arm/arm64_armada_linux_gcc
rename to config/arm/armada/arm64_armada_linux_gcc
index fa40c0398..8b4b5c8ad 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/armada/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@  cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+machine = 'armada'
diff --git a/config/arm/armada/meson.build b/config/arm/armada/meson.build
new file mode 100644
index 000000000..22fdce5fe
--- /dev/null
+++ b/config/arm/armada/meson.build
@@ -0,0 +1,31 @@ 
+flags = {
+	'common': [
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MACHINE', '"armv8a"'],
+		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
+		['CONFIG_RTE_LIBRTE_COMMON_DPAAX=n', false],
+		['CONFIG_RTE_LIBRTE_FSLMC_BUS=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA2_PMD=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA_PMD=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_CAAM_JR=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PFE_PMD=n', false],
+		['CONFIG_RTE_LIBRTE_ENETC_PMD=n', false],
+		['CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n', false],
+		['CONFIG_RTE_LIBRTE_VHOST_NUMA=n', false]
+	],
+	'armada': [
+		['RTE_MAX_NUMA_NODES', 1],
+		['RTE_MAX_LCORE', 16]
+	]
+}
+
+machine_args = ['-march=armv8-a+crc']
diff --git a/drivers/meson.build b/drivers/meson.build
index 5f9526557..c5deb6136 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -76,9 +76,17 @@  foreach subpath:subdirs
 		ext_deps = []
 		pkgconfig_extra_libs = []
 
+		if fmt_name == ''
+			fmt_name = name
+		endif
+		conf_flag = config_flag_fmt.format(fmt_name.to_upper())
+
 		if disabled_drivers.contains(drv_path)
 			build = false
 			reason = 'Explicitly disabled via build config'
+		elif dpdk_conf.has(conf_flag) and not dpdk_conf.get(conf_flag)
+			build = false
+			reason = 'Disabled via configuration file'
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
@@ -113,10 +121,7 @@  foreach subpath:subdirs
 		else
 			enabled_drivers += name
 
-			if fmt_name == ''
-				fmt_name = name
-			endif
-			dpdk_conf.set(config_flag_fmt.format(fmt_name.to_upper()),1)
+			dpdk_conf.set(conf_flag, 1)
 			lib_name = driver_name_fmt.format(fmt_name)
 
 			dpdk_extra_ldflags += pkgconfig_extra_libs