DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled
@ 2020-02-17  7:40 agupta3
  2020-04-06  9:56 ` Harman Kalra
  0 siblings, 1 reply; 5+ messages in thread
From: agupta3 @ 2020-02-17  7:40 UTC (permalink / raw)
  To: Harman Kalra; +Cc: dev, Amit Gupta

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled
  2020-02-17  7:40 [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled agupta3
@ 2020-04-06  9:56 ` Harman Kalra
  0 siblings, 0 replies; 5+ messages in thread
From: Harman Kalra @ 2020-04-06  9:56 UTC (permalink / raw)
  To: agupta3; +Cc: dev

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
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled
  2020-02-17  7:47 agupta3
  2020-02-17  9:54 ` David Marchand
@ 2020-02-17 10:48 ` Bruce Richardson
  1 sibling, 0 replies; 5+ messages in thread
From: Bruce Richardson @ 2020-02-17 10:48 UTC (permalink / raw)
  To: agupta3; +Cc: Harman Kalra, dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled
  2020-02-17  7:47 agupta3
@ 2020-02-17  9:54 ` David Marchand
  2020-02-17 10:48 ` Bruce Richardson
  1 sibling, 0 replies; 5+ messages in thread
From: David Marchand @ 2020-02-17  9:54 UTC (permalink / raw)
  To: Amit Gupta; +Cc: Harman Kalra, dev, Bruce Richardson

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled
@ 2020-02-17  7:47 agupta3
  2020-02-17  9:54 ` David Marchand
  2020-02-17 10:48 ` Bruce Richardson
  0 siblings, 2 replies; 5+ messages in thread
From: agupta3 @ 2020-02-17  7:47 UTC (permalink / raw)
  To: Harman Kalra; +Cc: dev, Amit Gupta

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-06  9:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17  7:40 [dpdk-dev] [PATCH] net/octeontx: meson build fix if octeontx drivers are disabled agupta3
2020-04-06  9:56 ` Harman Kalra
2020-02-17  7:47 agupta3
2020-02-17  9:54 ` David Marchand
2020-02-17 10:48 ` Bruce Richardson

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).