[dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds

Juraj Linkeš juraj.linkes at pantheon.tech
Fri Feb 19 11:38:58 CET 2021


I believe this is the last patch in the series that needs some more review. I implemented both an allowlist and a blocklist, so please let me know if this would be usable. There's only the implementation, the actual allow/blocklists would have to be added by maintainers/SoC owners.

There's also an open question of whether we want to have the allow/blocklist be exclusive (only one of them supported at a time) or both could be used at the same time. More in TODO/QUERY below.

> ---
>  config/arm/meson.build                        |  4 --
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 ++++
>  drivers/meson.build                           | 41 ++++++++++++++++---
>  meson.build                                   |  2 +
>  4 files changed, 46 insertions(+), 9 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> f948768578..d279724dec 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -16,9 +16,6 @@ flags_common = [
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> 
> -	['RTE_NET_FM10K', false],
> -	['RTE_NET_AVP', false],
> -
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
>  	['RTE_ARCH_ARM64', true],
> @@ -125,7 +122,6 @@ implementer_cavium = {
>  				['RTE_MACHINE', '"octeontx2"'],
>  				['RTE_ARM_FEATURE_ATOMICS', true],
>  				['RTE_USE_C11_MEM_MODEL', true],
> -				['RTE_EAL_IGB_UIO', false],
>  				['RTE_MAX_LCORE', 36],
>  				['RTE_MAX_NUMA_NODES', 1]
>  			]
> diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> index faaf24b95b..1504dbfef0 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -234,3 +234,11 @@ There are other options you may specify in a cross file
> to tailor the build::
>        numa = false        # set to false to force building for a non-NUMA system
>           # if not set or set to true, the build system will build for a NUMA
>           # system only if libnuma is installed
> +
> +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> +
> +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> diff --git a/drivers/meson.build b/drivers/meson.build index
> fdf76120ac..70c1aa4e6c 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -18,8 +18,36 @@ subdirs = [
>  	'baseband', # depends on common and bus.
>  ]
> 
> -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> -		).stdout().split()
> +if meson.is_cross_build()
> +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> +	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
> +endif
> +
> +# add cmdline disabled drivers (comma separated string) # and meson
> +disabled drivers (list) # together into a comma separated string
> +disabled_drivers = ','.join([get_option('disable_drivers'),
> +','.join(disabled_drivers)]).strip(',')
> +if disabled_drivers != ''
> +	disabled_drivers = run_command(list_dir_globs,
> +		disabled_drivers).stdout().split()
> +else
> +	disabled_drivers = []
> +endif
> +
> +if enabled_drivers != []
> +	enabled_drivers = run_command(list_dir_globs,
> +		','.join(enabled_drivers)).stdout().split()
> +endif
> +
> +if disabled_drivers != [] and enabled_drivers != []
> +	# TODO/QUERY we could support both:
> +	# first 'select' only drivers by enabled_drivers
> +	# then 'deselect' those in disabled_drivers
> +	# this would be useful if a directory is in enabled_drivers
> +	# and a driver from that directory is in disabled_drivers
> +	error('Simultaneous disabled drivers and enabled drivers ' +
> +	      'configuration is not supported.') endif
> 
>  default_cflags = machine_args
>  default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -48,7 +76,7 @@
> foreach subpath:subdirs
>  		dpdk_driver_classes += class
>  	endif
>  	# get already enabled drivers of the same class
> -	enabled_drivers = get_variable(class + '_drivers', [])
> +	enabled_class_drivers = get_variable(class + '_drivers', [])
> 
>  	foreach drv:drivers
>  		drv_path = join_paths(class, drv)
> @@ -76,6 +104,9 @@ foreach subpath:subdirs
>  		if disabled_drivers.contains(drv_path)
>  			build = false
>  			reason = 'explicitly disabled via build config'
> +		elif enabled_drivers.length() > 0 and not
> enabled_drivers.contains(drv_path)
> +			build = false
> +			reason = 'not in enabled drivers build config'
>  		else
>  			# pull in driver directory which should update all the
> local variables
>  			subdir(drv_path)
> @@ -108,7 +139,7 @@ foreach subpath:subdirs
>  						'_disable_reason', reason)
>  			endif
>  		else
> -			enabled_drivers += name
> +			enabled_class_drivers += name
>  			lib_name = '_'.join(['rte', class, name])
>  			dpdk_conf.set(lib_name.to_upper(), 1)
> 
> @@ -213,5 +244,5 @@ foreach subpath:subdirs
>  		endif # build
>  	endforeach
> 
> -	set_variable(class + '_drivers', enabled_drivers)
> +	set_variable(class + '_drivers', enabled_class_drivers)
>  endforeach
> diff --git a/meson.build b/meson.build
> index fcc4d4c900..ea7ccfdae3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -22,6 +22,8 @@ dpdk_drivers = []
>  dpdk_extra_ldflags = []
>  dpdk_libs_disabled = []
>  dpdk_drvs_disabled = []
> +disabled_drivers = []
> +enabled_drivers = []
>  abi_version_file = files('ABI_VERSION')
> 
>  if host_machine.cpu_family().startswith('x86')
> --
> 2.20.1



More information about the dev mailing list