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 C1BBAA0562; Wed, 14 Apr 2021 15:27:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A23D1161AE6; Wed, 14 Apr 2021 15:27:52 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id DE2614013F for ; Wed, 14 Apr 2021 15:27:49 +0200 (CEST) IronPort-SDR: PI9Qz54DYisL1yEVIkycJqIpUXXdjcH/gQ9q31VXGoJrhhrJcNvV7Yzo999fXgV2AnmU/P2NgO XXEzD6Ga3JXQ== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="215129858" X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="215129858" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 06:27:43 -0700 IronPort-SDR: gEZ29dckeSDfm5D8OQhP46FzA4yciyZHz9s7E6RhHj4GE3HSY0hAQ0rFf2PfaTqNkvXllaq6qy ewwfj5NrwfNQ== X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="424741644" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.7.48]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 14 Apr 2021 06:27:39 -0700 Date: Wed, 14 Apr 2021 14:27:36 +0100 From: Bruce Richardson To: Juraj =?utf-8?Q?Linke=C5=A1?= 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, ajit.khaparde@broadcom.com, ferruh.yigit@intel.com, aboyer@pensando.io, dev@dpdk.org Message-ID: <20210414132736.GC514@bricha3-MOBL.ger.corp.intel.com> References: <1617957679-7751-1-git-send-email-juraj.linkes@pantheon.tech> <1618405118-20187-1-git-send-email-juraj.linkes@pantheon.tech> <1618405118-20187-2-git-send-email-juraj.linkes@pantheon.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1618405118-20187-2-git-send-email-juraj.linkes@pantheon.tech> Subject: Re: [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds 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 Sender: "dev" On Wed, Apr 14, 2021 at 02:58:36PM +0200, Juraj Linkeš wrote: > Add support for enabling or disabling drivers for Arm cross build. Do > not implement any enable/disable lists yet. > > Enabling drivers is useful when building for an SoC where we only want > to build a few drivers. That way the list won't be too long. > > Similarly, disabling drivers is useful when we want to disable only a > few drivers. > > Both of these are advantageous mainly in aarch64 -> aarch64 (or arch -> > same arch) builds, where the build machine may have the required driver > dependencies, yet we don't want to build drivers for a specific SoC. > > If enable_drivers is a non-empty list, build only those drivers, > otherwise build all drivers and add them to enable_drivers. If > disable_drivers is non-empty list, build all drivers specified in > enable_drivers except those in disable_drivers. > > There are two drivers, bus/pci and bus/vdev, which break the build if > not enabled. Address this by always enabling these if the user disables > them or doesn't specify in their allowlist. > > Also remove the old Makefile arm configuration options which don't do > anything in Meson. > > Signed-off-by: Juraj Linkeš > Reviewed-by: Honnappa Nagarahalli > Reviewed-by: Ruifeng Wang Please see one comment inline below. Otherwise LGTM. Acked-by: Bruce Richardson > --- > buildtools/list-dir-globs.py | 7 ++-- > config/arm/meson.build | 4 --- > config/meson.build | 4 +++ > .../linux_gsg/cross_build_dpdk_for_arm64.rst | 8 +++++ > drivers/common/qat/meson.build | 4 +-- > drivers/meson.build | 32 ++++++++++++++++--- > meson_options.txt | 2 ++ > 7 files changed, 48 insertions(+), 13 deletions(-) > > diff --git a/buildtools/list-dir-globs.py b/buildtools/list-dir-globs.py > index 80b5e801f2..911e267335 100755 > --- a/buildtools/list-dir-globs.py > +++ b/buildtools/list-dir-globs.py > @@ -14,6 +14,7 @@ > os.getenv('MESON_SUBDIR', '.')) > > for path in sys.argv[1].split(','): > - for p in iglob(os.path.join(root, path)): > - if os.path.isdir(p): > - print(os.path.relpath(p)) > + if path: > + for p in iglob(os.path.join(root, path)): > + if os.path.isdir(p): > + print(os.path.relpath(p)) > diff --git a/config/arm/meson.build b/config/arm/meson.build > index aaed89bd5b..2984ae2db3 100644 > --- a/config/arm/meson.build > +++ b/config/arm/meson.build > @@ -17,9 +17,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], > @@ -126,7 +123,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/config/meson.build b/config/meson.build > index 3268cf6804..6e6ef8c0e1 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -63,6 +63,10 @@ if not is_windows > pmd_subdir_opt) > endif > > +# init disable/enable driver lists that will be populated in different places > +disable_drivers = '' > +enable_drivers = '' > + > # set the machine type and cflags for it > if meson.is_cross_build() > machine = host_machine.cpu() > 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..9b9e8ef704 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 > + > + disable_drivers = 'bus/dpaa,crypto/*' # add disabled drivers > + # valid values are dir/subdirs in the drivers directory > + # wildcards are allowed > + > + enable_drivers = 'common/*,bus/*' # build only these drivers > + # valid values are dir/subdirs in the drivers directory > + # wildcards are allowed > diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build > index 3ad7dd5017..fe278f734f 100644 > --- a/drivers/common/qat/meson.build > +++ b/drivers/common/qat/meson.build > @@ -14,13 +14,13 @@ qat_compress = true > qat_compress_path = 'compress/qat' > qat_compress_relpath = '../../' + qat_compress_path > > -if disabled_drivers.contains(qat_crypto_path) > +if disable_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) > +if disable_drivers.contains(qat_compress_path) > qat_compress = false > dpdk_drvs_disabled += qat_compress_path > set_variable(qat_compress_path.underscorify() + '_disable_reason', > diff --git a/drivers/meson.build b/drivers/meson.build > index 45af8749da..00fe70452d 100644 > --- a/drivers/meson.build > +++ b/drivers/meson.build > @@ -20,8 +20,25 @@ 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() > + disable_drivers += ',' + meson.get_cross_property('disable_drivers', []) > + enable_drivers += ',' + meson.get_cross_property('enable_drivers', []) Should the fallbacks here not be empty strings rather than empty values? > +endif > + > +# add cmdline disabled drivers and meson disabled drivers together > +disable_drivers += ',' + get_option('disable_drivers') > +disable_drivers = run_command(list_dir_globs, disable_drivers).stdout().split() > + > +# add cmdline enabled drivers and meson enabled drivers together > +enable_drivers = ',' + get_option('enable_drivers') > +enable_drivers = run_command(list_dir_globs, enable_drivers).stdout().split() > +if enable_drivers.length() == 0 > + enable_drivers = run_command(list_dir_globs, '*/*').stdout().split() > +endif > + > +# these drivers must always be enabled, otherwise the build breaks > +always_enable = ['bus/pci', 'bus/vdev'] > +enable_drivers += always_enable > > default_cflags = machine_args > default_cflags += ['-DALLOW_EXPERIMENTAL_API'] > @@ -75,9 +92,16 @@ foreach subpath:subdirs > ext_deps = [] > pkgconfig_extra_libs = [] > > - if disabled_drivers.contains(drv_path) > + if not enable_drivers.contains(drv_path) > build = false > - reason = 'explicitly disabled via build config' > + reason = 'not in enabled drivers build config' > + elif disable_drivers.contains(drv_path) > + if always_enable.contains(drv_path) > + message('Driver @0@ cannot be disabled, not disabling.'.format(drv_path)) > + else > + build = false > + reason = 'explicitly disabled via build config' > + endif > else > # pull in driver directory which should update all the local variables > subdir(drv_path) > diff --git a/meson_options.txt b/meson_options.txt > index fa207cbada..e1dc351620 100644 > --- a/meson_options.txt > +++ b/meson_options.txt > @@ -10,6 +10,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-', > description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.') > option('enable_docs', type: 'boolean', value: false, > description: 'build documentation') > +option('enable_drivers', type: 'string', value: '', > + description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.') > option('enable_driver_sdk', type: 'boolean', value: false, > description: 'Install headers to build drivers.') > option('enable_kmods', type: 'boolean', value: false, > -- > 2.20.1 >