From: Amit Gupta <agupta3@marvell.com> Add a condition to check if octeontx drivers are disabled. octeontx drivers are built only if dependent drivers i.e. ethdev, mempool and common/octeontx are enabled. BugZilla ID # BUG 387 Change-Id: Idf9578fc04345e690ac48b4836faff2e25170331 Signed-off-by: Amit Gupta <agupta3@marvell.com> --- drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build index a06a2c8..50e7972 100644 --- a/drivers/net/octeontx/base/meson.build +++ b/drivers/net/octeontx/base/meson.build @@ -9,17 +9,33 @@ sources = [ depends = ['ethdev', 'mempool_octeontx'] static_objs = [] -foreach d: depends - static_objs += [get_variable('static_rte_' + d)] + +disabled_drivers = get_option('disable_drivers').split(',') + +build = true +foreach disable_path: disabled_drivers + if (('net/octeontx' == disable_path) or + ('event/octeontx' == disable_path) or + ('common/octeontx' == disable_path) or + ('mempool/octeontx' == disable_path)) + build = false + endif endforeach c_args = cflags if allow_experimental_apis - c_args += '-DALLOW_EXPERIMENTAL_API' + c_args += '-DALLOW_EXPERIMENTAL_API' endif -base_lib = static_library('octeontx_base', sources, - c_args: c_args, - dependencies: static_objs, -) -base_objs = base_lib.extract_all_objects() +if build + foreach d: depends + static_objs += [get_variable('static_rte_' + d)] + endforeach + + base_lib = static_library('octeontx_base', sources, + c_args: c_args, + dependencies: static_objs, + ) + + base_objs = base_lib.extract_all_objects() +endif -- 1.8.3.1
From: Amit Gupta <agupta3@marvell.com> Add a condition to check if octeontx drivers are disabled. octeontx drivers are built only if dependent drivers i.e. ethdev, mempool and common/octeontx are enabled. BugZilla ID # BUG 387 Signed-off-by: Amit Gupta <agupta3@marvell.com> --- drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build index a06a2c8..50e7972 100644 --- a/drivers/net/octeontx/base/meson.build +++ b/drivers/net/octeontx/base/meson.build @@ -9,17 +9,33 @@ sources = [ depends = ['ethdev', 'mempool_octeontx'] static_objs = [] -foreach d: depends - static_objs += [get_variable('static_rte_' + d)] + +disabled_drivers = get_option('disable_drivers').split(',') + +build = true +foreach disable_path: disabled_drivers + if (('net/octeontx' == disable_path) or + ('event/octeontx' == disable_path) or + ('common/octeontx' == disable_path) or + ('mempool/octeontx' == disable_path)) + build = false + endif endforeach c_args = cflags if allow_experimental_apis - c_args += '-DALLOW_EXPERIMENTAL_API' + c_args += '-DALLOW_EXPERIMENTAL_API' endif -base_lib = static_library('octeontx_base', sources, - c_args: c_args, - dependencies: static_objs, -) -base_objs = base_lib.extract_all_objects() +if build + foreach d: depends + static_objs += [get_variable('static_rte_' + d)] + endforeach + + base_lib = static_library('octeontx_base', sources, + c_args: c_args, + dependencies: static_objs, + ) + + base_objs = base_lib.extract_all_objects() +endif -- 1.8.3.1
On Mon, Feb 17, 2020 at 8:48 AM <agupta3@marvell.com> wrote: > > From: Amit Gupta <agupta3@marvell.com> > > Add a condition to check if octeontx drivers are disabled. > octeontx drivers are built only if dependent drivers i.e. > ethdev, mempool and common/octeontx are enabled. > > BugZilla ID # BUG 387 Interesting format, but we prefer consistency, you can see this in git history. Bugzilla ID: xxx This can be caught by running the devtools/check-git-log.sh script. > > Signed-off-by: Amit Gupta <agupta3@marvell.com> > --- > drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++-------- > 1 file changed, 24 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build > index a06a2c8..50e7972 100644 > --- a/drivers/net/octeontx/base/meson.build > +++ b/drivers/net/octeontx/base/meson.build > @@ -9,17 +9,33 @@ sources = [ > > depends = ['ethdev', 'mempool_octeontx'] > static_objs = [] > -foreach d: depends > - static_objs += [get_variable('static_rte_' + d)] > + > +disabled_drivers = get_option('disable_drivers').split(',') > + > +build = true > +foreach disable_path: disabled_drivers > + if (('net/octeontx' == disable_path) or > + ('event/octeontx' == disable_path) or > + ('common/octeontx' == disable_path) or > + ('mempool/octeontx' == disable_path)) > + build = false > + endif > endforeach I am no meson expert, but I'd say you can put a subdir_done() if your check is false and then you don't need to check the build variable later. Besides, you can most likely do this check at the top of this file alongside "depends". Cc: Bruce who commented on this bz. > > c_args = cflags > if allow_experimental_apis > - c_args += '-DALLOW_EXPERIMENTAL_API' > + c_args += '-DALLOW_EXPERIMENTAL_API' Unrelated change + whitespace damage after. > endif > -base_lib = static_library('octeontx_base', sources, > - c_args: c_args, > - dependencies: static_objs, > -) > > -base_objs = base_lib.extract_all_objects() > +if build > + foreach d: depends > + static_objs += [get_variable('static_rte_' + d)] > + endforeach > + > + base_lib = static_library('octeontx_base', sources, > + c_args: c_args, > + dependencies: static_objs, > + ) > + > + base_objs = base_lib.extract_all_objects() > +endif > -- > 1.8.3.1 > -- David Marchand
On Mon, Feb 17, 2020 at 01:17:49PM +0530, agupta3@marvell.com wrote:
> From: Amit Gupta <agupta3@marvell.com>
>
> Add a condition to check if octeontx drivers are disabled.
> octeontx drivers are built only if dependent drivers i.e.
> ethdev, mempool and common/octeontx are enabled.
>
> BugZilla ID # BUG 387
>
> Signed-off-by: Amit Gupta <agupta3@marvell.com>
> ---
> drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++--------
> 1 file changed, 24 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build
> index a06a2c8..50e7972 100644
> --- a/drivers/net/octeontx/base/meson.build
> +++ b/drivers/net/octeontx/base/meson.build
> @@ -9,17 +9,33 @@ sources = [
>
> depends = ['ethdev', 'mempool_octeontx']
> static_objs = []
> -foreach d: depends
> - static_objs += [get_variable('static_rte_' + d)]
> +
> +disabled_drivers = get_option('disable_drivers').split(',')
> +
> +build = true
> +foreach disable_path: disabled_drivers
> + if (('net/octeontx' == disable_path) or
> + ('event/octeontx' == disable_path) or
> + ('common/octeontx' == disable_path) or
> + ('mempool/octeontx' == disable_path))
> + build = false
> + endif
> endforeach
>
> c_args = cflags
> if allow_experimental_apis
> - c_args += '-DALLOW_EXPERIMENTAL_API'
> + c_args += '-DALLOW_EXPERIMENTAL_API'
> endif
> -base_lib = static_library('octeontx_base', sources,
> - c_args: c_args,
> - dependencies: static_objs,
> -)
>
> -base_objs = base_lib.extract_all_objects()
> +if build
> + foreach d: depends
> + static_objs += [get_variable('static_rte_' + d)]
> + endforeach
> +
> + base_lib = static_library('octeontx_base', sources,
> + c_args: c_args,
> + dependencies: static_objs,
> + )
> +
> + base_objs = base_lib.extract_all_objects()
> +endif
A better fix here might be possible using the fact that the get_variable()
call allows passing a fallback value in the case of failure. Therefore
something like the below might work cleaner:
foreach d: depends
static_obj = [get_variable('static_rte_' + d, '']
if static_obj == ''
build = false
reason = '....'
subdir_done()
endif
static_objs += static_obj
...
Maybe a disabler object could be used also.
Regards,
/Bruce
> -----Original Message----- > From: Bruce Richardson <bruce.richardson@intel.com> > Sent: Monday, February 17, 2020 4:19 PM > To: Amit Gupta <agupta3@marvell.com> > Cc: Harman Kalra <hkalra@marvell.com>; dev@dpdk.org > Subject: [EXT] Re: [dpdk-dev] [PATCH] net/octeontx: meson build fix if > octeontx drivers are disabled > > External Email > > ---------------------------------------------------------------------- > On Mon, Feb 17, 2020 at 01:17:49PM +0530, agupta3@marvell.com wrote: > > From: Amit Gupta <agupta3@marvell.com> > > > > Add a condition to check if octeontx drivers are disabled. > > octeontx drivers are built only if dependent drivers i.e. > > ethdev, mempool and common/octeontx are enabled. > > > > BugZilla ID # BUG 387 > > > > Signed-off-by: Amit Gupta <agupta3@marvell.com> > > --- > > drivers/net/octeontx/base/meson.build | 32 > > ++++++++++++++++++++++++-------- > > 1 file changed, 24 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/net/octeontx/base/meson.build > > b/drivers/net/octeontx/base/meson.build > > index a06a2c8..50e7972 100644 > > --- a/drivers/net/octeontx/base/meson.build > > +++ b/drivers/net/octeontx/base/meson.build > > @@ -9,17 +9,33 @@ sources = [ > > > > depends = ['ethdev', 'mempool_octeontx'] static_objs = [] -foreach > > d: depends > > - static_objs += [get_variable('static_rte_' + d)] > > + > > +disabled_drivers = get_option('disable_drivers').split(',') > > + > > +build = true > > +foreach disable_path: disabled_drivers > > + if (('net/octeontx' == disable_path) or > > + ('event/octeontx' == disable_path) or > > + ('common/octeontx' == disable_path) or > > + ('mempool/octeontx' == disable_path)) > > + build = false > > + endif > > endforeach > > > > c_args = cflags > > if allow_experimental_apis > > - c_args += '-DALLOW_EXPERIMENTAL_API' > > + c_args += '-DALLOW_EXPERIMENTAL_API' > > endif > > -base_lib = static_library('octeontx_base', sources, > > - c_args: c_args, > > - dependencies: static_objs, > > -) > > > > -base_objs = base_lib.extract_all_objects() > > +if build > > + foreach d: depends > > + static_objs += [get_variable('static_rte_' + d)] > > + endforeach > > + > > + base_lib = static_library('octeontx_base', sources, > > + c_args: c_args, > > + dependencies: static_objs, > > + ) > > + > > + base_objs = base_lib.extract_all_objects() endif > > A better fix here might be possible using the fact that the get_variable() call > allows passing a fallback value in the case of failure. Therefore something like > the below might work cleaner: ACK, will update the same in V2 > > foreach d: depends > static_obj = [get_variable('static_rte_' + d, ''] > if static_obj == '' > build = false > reason = '....' > subdir_done() > endif > static_objs += static_obj > ... > > Maybe a disabler object could be used also. > > Regards, > /Bruce
> -----Original Message----- > From: David Marchand <david.marchand@redhat.com> > Sent: Monday, February 17, 2020 3:24 PM > To: Amit Gupta <agupta3@marvell.com> > Cc: Harman Kalra <hkalra@marvell.com>; dev <dev@dpdk.org>; Bruce > Richardson <bruce.richardson@intel.com> > Subject: [EXT] Re: [dpdk-dev] [PATCH] net/octeontx: meson build fix if > octeontx drivers are disabled > > External Email > > ---------------------------------------------------------------------- > On Mon, Feb 17, 2020 at 8:48 AM <agupta3@marvell.com> wrote: > > > > From: Amit Gupta <agupta3@marvell.com> > > > > Add a condition to check if octeontx drivers are disabled. > > octeontx drivers are built only if dependent drivers i.e. > > ethdev, mempool and common/octeontx are enabled. > > > > BugZilla ID # BUG 387 > > Interesting format, but we prefer consistency, you can see this in git history. > Bugzilla ID: xxx > > This can be caught by running the devtools/check-git-log.sh script. ACK, will update the same in V2 > > > > > > Signed-off-by: Amit Gupta <agupta3@marvell.com> > > --- > > drivers/net/octeontx/base/meson.build | 32 > > ++++++++++++++++++++++++-------- > > 1 file changed, 24 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/net/octeontx/base/meson.build > > b/drivers/net/octeontx/base/meson.build > > index a06a2c8..50e7972 100644 > > --- a/drivers/net/octeontx/base/meson.build > > +++ b/drivers/net/octeontx/base/meson.build > > @@ -9,17 +9,33 @@ sources = [ > > > > depends = ['ethdev', 'mempool_octeontx'] static_objs = [] -foreach > > d: depends > > - static_objs += [get_variable('static_rte_' + d)] > > + > > +disabled_drivers = get_option('disable_drivers').split(',') > > + > > +build = true > > +foreach disable_path: disabled_drivers > > + if (('net/octeontx' == disable_path) or > > + ('event/octeontx' == disable_path) or > > + ('common/octeontx' == disable_path) or > > + ('mempool/octeontx' == disable_path)) > > + build = false > > + endif > > endforeach > > I am no meson expert, but I'd say you can put a subdir_done() if your check > is false and then you don't need to check the build variable later. > Besides, you can most likely do this check at the top of this file alongside > "depends". ACK, will update the same in V2 > > Cc: Bruce who commented on this bz. > > > > > c_args = cflags > > if allow_experimental_apis > > - c_args += '-DALLOW_EXPERIMENTAL_API' > > + c_args += '-DALLOW_EXPERIMENTAL_API' > > Unrelated change + whitespace damage after. > ACK, will update the same in V2 > > > > > endif > > -base_lib = static_library('octeontx_base', sources, > > - c_args: c_args, > > - dependencies: static_objs, > > -) > > > > -base_objs = base_lib.extract_all_objects() > > +if build > > + foreach d: depends > > + static_objs += [get_variable('static_rte_' + d)] > > + endforeach > > + > > + base_lib = static_library('octeontx_base', sources, > > + c_args: c_args, > > + dependencies: static_objs, > > + ) > > + > > + base_objs = base_lib.extract_all_objects() endif > > -- > > 1.8.3.1 > > > > > -- > David Marchand
From: Amit Gupta <agupta3@marvell.com> Add a additional condition to check if all required internal dependencies are met before building octeontx drivers using meson. Bugzilla ID: 387 Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson") Signed-off-by: Amit Gupta <agupta3@marvell.com> --- v2: - rebased to v20.02 - upstream comments incorporated. drivers/net/octeontx/base/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build index a06a2c8..035aeda 100644 --- a/drivers/net/octeontx/base/meson.build +++ b/drivers/net/octeontx/base/meson.build @@ -10,7 +10,11 @@ sources = [ depends = ['ethdev', 'mempool_octeontx'] static_objs = [] foreach d: depends - static_objs += [get_variable('static_rte_' + d)] + test_dep_obj = '@0@'.format(get_variable('static_rte_' + d, '')) + if test_dep_obj == '' + subdir_done() + endif + static_objs += get_variable('static_rte_' + d) endforeach c_args = cflags -- 1.8.3.1
On Mon, Mar 02, 2020 at 12:01:55PM +0530, agupta3@marvell.com wrote:
> From: Amit Gupta <agupta3@marvell.com>
>
> Add a additional condition to check if all required internal
> dependencies are met before building octeontx drivers using meson.
>
> Bugzilla ID: 387
>
> Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson")
>
> Signed-off-by: Amit Gupta <agupta3@marvell.com>
> ---
> v2:
> - rebased to v20.02
> - upstream comments incorporated.
>
> drivers/net/octeontx/base/meson.build | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build
> index a06a2c8..035aeda 100644
> --- a/drivers/net/octeontx/base/meson.build
> +++ b/drivers/net/octeontx/base/meson.build
> @@ -10,7 +10,11 @@ sources = [
> depends = ['ethdev', 'mempool_octeontx']
> static_objs = []
> foreach d: depends
> - static_objs += [get_variable('static_rte_' + d)]
> + test_dep_obj = '@0@'.format(get_variable('static_rte_' + d, ''))
> + if test_dep_obj == ''
> + subdir_done()
> + endif
> + static_objs += get_variable('static_rte_' + d)
> endforeach
very minor nit - you can use "test_dep_obj" here rather than calling
get_variable twice.
/Bruce
test_dep_obj is being formatted as string object, so can't be used as static obj..
Amit
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Monday, March 2, 2020 4:23 PM
> To: Amit Gupta <agupta3@marvell.com>
> Cc: Harman Kalra <hkalra@marvell.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [EXT] Re: [dpdk-dev] [PATCH v2 1/1] net/octeontx: fix meson build
> for disabled octeontx drivers
>
> External Email
>
> ----------------------------------------------------------------------
> On Mon, Mar 02, 2020 at 12:01:55PM +0530, agupta3@marvell.com wrote:
> > From: Amit Gupta <agupta3@marvell.com>
> >
> > Add a additional condition to check if all required internal
> > dependencies are met before building octeontx drivers using meson.
> >
> > Bugzilla ID: 387
> >
> > Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson")
> >
> > Signed-off-by: Amit Gupta <agupta3@marvell.com>
> > ---
> > v2:
> > - rebased to v20.02
> > - upstream comments incorporated.
> >
> > drivers/net/octeontx/base/meson.build | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/octeontx/base/meson.build
> > b/drivers/net/octeontx/base/meson.build
> > index a06a2c8..035aeda 100644
> > --- a/drivers/net/octeontx/base/meson.build
> > +++ b/drivers/net/octeontx/base/meson.build
> > @@ -10,7 +10,11 @@ sources = [
> > depends = ['ethdev', 'mempool_octeontx'] static_objs = [] foreach
> > d: depends
> > - static_objs += [get_variable('static_rte_' + d)]
> > + test_dep_obj = '@0@'.format(get_variable('static_rte_' + d, ''))
> > + if test_dep_obj == ''
> > + subdir_done()
> > + endif
> > + static_objs += get_variable('static_rte_' + d)
> > endforeach
>
> very minor nit - you can use "test_dep_obj" here rather than calling
> get_variable twice.
>
> /Bruce
On Tue, Mar 03, 2020 at 03:10:56AM +0000, Amit Gupta wrote:
>
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Monday, March 2, 2020 4:23 PM
> > To: Amit Gupta <agupta3@marvell.com>
> > Cc: Harman Kalra <hkalra@marvell.com>; dev@dpdk.org; stable@dpdk.org
> > Subject: [EXT] Re: [dpdk-dev] [PATCH v2 1/1] net/octeontx: fix meson build
> > for disabled octeontx drivers
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > On Mon, Mar 02, 2020 at 12:01:55PM +0530, agupta3@marvell.com wrote:
> > > From: Amit Gupta <agupta3@marvell.com>
> > >
> > > Add a additional condition to check if all required internal
> > > dependencies are met before building octeontx drivers using meson.
> > >
> > > Bugzilla ID: 387
> > >
> > > Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson")
> > >
> > > Signed-off-by: Amit Gupta <agupta3@marvell.com>
> > > ---
> > > v2:
> > > - rebased to v20.02
> > > - upstream comments incorporated.
> > >
> > > drivers/net/octeontx/base/meson.build | 6 +++++-
> > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/octeontx/base/meson.build
> > > b/drivers/net/octeontx/base/meson.build
> > > index a06a2c8..035aeda 100644
> > > --- a/drivers/net/octeontx/base/meson.build
> > > +++ b/drivers/net/octeontx/base/meson.build
> > > @@ -10,7 +10,11 @@ sources = [
> > > depends = ['ethdev', 'mempool_octeontx'] static_objs = [] foreach
> > > d: depends
> > > - static_objs += [get_variable('static_rte_' + d)]
> > > + test_dep_obj = '@0@'.format(get_variable('static_rte_' + d, ''))
> > > + if test_dep_obj == ''
> > > + subdir_done()
> > > + endif
> > > + static_objs += get_variable('static_rte_' + d)
> > > endforeach
> >
> > very minor nit - you can use "test_dep_obj" here rather than calling
> > get_variable twice.
> >
> test_dep_obj is being formatted as string object, so can't be used as static obj..
Apologies, you are quite right, I missed that.
One final suggestion - the "is_variable" function is probably want you want
rather than using get_variable with a fallback. It should save the use of a
temporary variable completely.
/Bruce
From: Amit Gupta <agupta3@marvell.com> Add a condition to check if octeontx drivers are disabled. octeontx drivers are built only if dependent drivers i.e. ethdev, mempool and common/octeontx are enabled. Bugzilla ID: 387 Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson") Signed-off-by: Amit Gupta <agupta3@marvell.com> --- drivers/net/octeontx/base/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build index a06a2c8..e1060fc 100644 --- a/drivers/net/octeontx/base/meson.build +++ b/drivers/net/octeontx/base/meson.build @@ -10,7 +10,10 @@ sources = [ depends = ['ethdev', 'mempool_octeontx'] static_objs = [] foreach d: depends - static_objs += [get_variable('static_rte_' + d)] + if not is_variable('shared_rte_' + d) + subdir_done() + endif + static_objs += get_variable('static_rte_' + d) endforeach c_args = cflags -- 1.8.3.1
ACK
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, March 3, 2020 4:47 PM
> To: Amit Gupta <agupta3@marvell.com>
> Cc: Harman Kalra <hkalra@marvell.com>; dev@dpdk.org; stable@dpdk.org
> Subject: Re: [EXT] Re: [dpdk-dev] [PATCH v2 1/1] net/octeontx: fix meson
> build for disabled octeontx drivers
>
> On Tue, Mar 03, 2020 at 03:10:56AM +0000, Amit Gupta wrote:
> >
> > > -----Original Message-----
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > Sent: Monday, March 2, 2020 4:23 PM
> > > To: Amit Gupta <agupta3@marvell.com>
> > > Cc: Harman Kalra <hkalra@marvell.com>; dev@dpdk.org;
> stable@dpdk.org
> > > Subject: [EXT] Re: [dpdk-dev] [PATCH v2 1/1] net/octeontx: fix meson
> > > build for disabled octeontx drivers
> > >
> > > External Email
> > >
> > > --------------------------------------------------------------------
> > > -- On Mon, Mar 02, 2020 at 12:01:55PM +0530, agupta3@marvell.com
> > > wrote:
> > > > From: Amit Gupta <agupta3@marvell.com>
> > > >
> > > > Add a additional condition to check if all required internal
> > > > dependencies are met before building octeontx drivers using meson.
> > > >
> > > > Bugzilla ID: 387
> > > >
> > > > Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with
> > > > meson")
> > > >
> > > > Signed-off-by: Amit Gupta <agupta3@marvell.com>
> > > > ---
> > > > v2:
> > > > - rebased to v20.02
> > > > - upstream comments incorporated.
> > > >
> > > > drivers/net/octeontx/base/meson.build | 6 +++++-
> > > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/net/octeontx/base/meson.build
> > > > b/drivers/net/octeontx/base/meson.build
> > > > index a06a2c8..035aeda 100644
> > > > --- a/drivers/net/octeontx/base/meson.build
> > > > +++ b/drivers/net/octeontx/base/meson.build
> > > > @@ -10,7 +10,11 @@ sources = [
> > > > depends = ['ethdev', 'mempool_octeontx'] static_objs = []
> > > > foreach
> > > > d: depends
> > > > - static_objs += [get_variable('static_rte_' + d)]
> > > > + test_dep_obj = '@0@'.format(get_variable('static_rte_' + d, ''))
> > > > + if test_dep_obj == ''
> > > > + subdir_done()
> > > > + endif
> > > > + static_objs += get_variable('static_rte_' + d)
> > > > endforeach
> > >
> > > very minor nit - you can use "test_dep_obj" here rather than calling
> > > get_variable twice.
> > >
> > test_dep_obj is being formatted as string object, so can't be used as static
> obj..
>
> Apologies, you are quite right, I missed that.
>
> One final suggestion - the "is_variable" function is probably want you want
> rather than using get_variable with a fallback. It should save the use of a
> temporary variable completely.
>
> /Bruce
On Wed, Mar 04, 2020 at 11:17:04AM +0530, agupta3@marvell.com wrote:
> From: Amit Gupta <agupta3@marvell.com>
>
> Add a condition to check if octeontx drivers are disabled.
> octeontx drivers are built only if dependent drivers i.e.
> ethdev, mempool and common/octeontx are enabled.
>
> Bugzilla ID: 387
>
> Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson")
>
> Signed-off-by: Amit Gupta <agupta3@marvell.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
On Wed, Mar 4, 2020 at 7:19 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Wed, Mar 04, 2020 at 11:17:04AM +0530, agupta3@marvell.com wrote:
> > From: Amit Gupta <agupta3@marvell.com>
> >
> > Add a condition to check if octeontx drivers are disabled.
> > octeontx drivers are built only if dependent drivers i.e.
> > ethdev, mempool and common/octeontx are enabled.
> >
> > Bugzilla ID: 387
> >
> > Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson")
> >
> > Signed-off-by: Amit Gupta <agupta3@marvell.com>
>
> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Applied to dpdk-next-net-mrvl/master. Thanks
On Mon, Feb 17, 2020 at 01:10:29PM +0530, agupta3@marvell.com wrote: > From: Amit Gupta <agupta3@marvell.com> > > Add a condition to check if octeontx drivers are disabled. > octeontx drivers are built only if dependent drivers i.e. > ethdev, mempool and common/octeontx are enabled. > > BugZilla ID # BUG 387 > > Change-Id: Idf9578fc04345e690ac48b4836faff2e25170331 > Signed-off-by: Amit Gupta <agupta3@marvell.com> Acked-by: Harman Kalra <hkalra@marvell.com> > --- > drivers/net/octeontx/base/meson.build | 32 ++++++++++++++++++++++++-------- > 1 file changed, 24 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build > index a06a2c8..50e7972 100644 > --- a/drivers/net/octeontx/base/meson.build > +++ b/drivers/net/octeontx/base/meson.build > @@ -9,17 +9,33 @@ sources = [ > > depends = ['ethdev', 'mempool_octeontx'] > static_objs = [] > -foreach d: depends > - static_objs += [get_variable('static_rte_' + d)] > + > +disabled_drivers = get_option('disable_drivers').split(',') > + > +build = true > +foreach disable_path: disabled_drivers > + if (('net/octeontx' == disable_path) or > + ('event/octeontx' == disable_path) or > + ('common/octeontx' == disable_path) or > + ('mempool/octeontx' == disable_path)) > + build = false > + endif > endforeach > > c_args = cflags > if allow_experimental_apis > - c_args += '-DALLOW_EXPERIMENTAL_API' > + c_args += '-DALLOW_EXPERIMENTAL_API' > endif > -base_lib = static_library('octeontx_base', sources, > - c_args: c_args, > - dependencies: static_objs, > -) > > -base_objs = base_lib.extract_all_objects() > +if build > + foreach d: depends > + static_objs += [get_variable('static_rte_' + d)] > + endforeach > + > + base_lib = static_library('octeontx_base', sources, > + c_args: c_args, > + dependencies: static_objs, > + ) > + > + base_objs = base_lib.extract_all_objects() > +endif > -- > 1.8.3.1 >
On Wed, Mar 04, 2020 at 11:17:04AM +0530, agupta3@marvell.com wrote: > From: Amit Gupta <agupta3@marvell.com> > > Add a condition to check if octeontx drivers are disabled. > octeontx drivers are built only if dependent drivers i.e. > ethdev, mempool and common/octeontx are enabled. > > Bugzilla ID: 387 > > Fixes: 7f615033d64f ("drivers/net: build Cavium NIC PMDs with meson") > > Signed-off-by: Amit Gupta <agupta3@marvell.com> Acked-by: Harman Kalra <hkalra@marvell.com> > --- > drivers/net/octeontx/base/meson.build | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/octeontx/base/meson.build b/drivers/net/octeontx/base/meson.build > index a06a2c8..e1060fc 100644 > --- a/drivers/net/octeontx/base/meson.build > +++ b/drivers/net/octeontx/base/meson.build > @@ -10,7 +10,10 @@ sources = [ > depends = ['ethdev', 'mempool_octeontx'] > static_objs = [] > foreach d: depends > - static_objs += [get_variable('static_rte_' + d)] > + if not is_variable('shared_rte_' + d) > + subdir_done() > + endif > + static_objs += get_variable('static_rte_' + d) > endforeach > > c_args = cflags > -- > 1.8.3.1 >