DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [PATCH v1] build: make gpudev optional
  2021-11-17 20:33 [PATCH v1] build: make gpudev optional eagostini
@ 2021-11-17 12:36 ` Thomas Monjalon
  2021-11-17 12:56   ` Thomas Monjalon
  2021-11-17 21:39 ` [PATCH v2] " eagostini
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2021-11-17 12:36 UTC (permalink / raw)
  To: Elena Agostini; +Cc: dev, bruce.richardson

17/11/2021 21:33, eagostini@nvidia.com:
> --- a/app/test-gpudev/meson.build
> +++ b/app/test-gpudev/meson.build
> @@ -1,5 +1,12 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright (c) 2021 NVIDIA Corporation & Affiliates
>  
> -sources = files('main.c')
> -deps = ['gpudev', 'ethdev']
> +if dpdk_conf.has('RTE_LIB_GPUDEV')
> +    sources = files('main.c')
> +    deps = ['gpudev', 'ethdev']
> +else
> +    build = false
> +    reason = 'gpudev library is disabled'
> +    subdir_done()
> +endif

I would prefer the form "if not" so we can save the "else".

> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -76,6 +76,7 @@ optional_libs = [
>          'pdump',
>          'power',
>          'vhost',
> +        'gpudev',
>  ]

It should be sorted alphabetically.



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

* Re: [PATCH v1] build: make gpudev optional
  2021-11-17 12:36 ` Thomas Monjalon
@ 2021-11-17 12:56   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2021-11-17 12:56 UTC (permalink / raw)
  To: Elena Agostini; +Cc: dev, bruce.richardson

17/11/2021 13:36, Thomas Monjalon:
> 17/11/2021 21:33, eagostini@nvidia.com:
> > --- a/app/test-gpudev/meson.build
> > +++ b/app/test-gpudev/meson.build
> > @@ -1,5 +1,12 @@
> >  # SPDX-License-Identifier: BSD-3-Clause
> >  # Copyright (c) 2021 NVIDIA Corporation & Affiliates
> >  
> > -sources = files('main.c')
> > -deps = ['gpudev', 'ethdev']
> > +if dpdk_conf.has('RTE_LIB_GPUDEV')
> > +    sources = files('main.c')
> > +    deps = ['gpudev', 'ethdev']
> > +else
> > +    build = false
> > +    reason = 'gpudev library is disabled'
> > +    subdir_done()
> > +endif
> 
> I would prefer the form "if not" so we can save the "else".

Actually no need to check at all in app and driver.
If the dependency is missing the driver is disabled already
with this reason:
	reason = 'missing internal dependency, "@0@"'.format(d)
For the app, there is an automatic message:
	message('Missing dependency "@0@" for app "@1@"'.format(d, name))

> > --- a/lib/meson.build
> > +++ b/lib/meson.build
> > @@ -76,6 +76,7 @@ optional_libs = [
> >          'pdump',
> >          'power',
> >          'vhost',
> > +        'gpudev',
> >  ]
> 
> It should be sorted alphabetically.




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

* Re: [PATCH v2] build: make gpudev optional
  2021-11-17 21:39 ` [PATCH v2] " eagostini
@ 2021-11-17 14:10   ` Bruce Richardson
  2021-11-17 17:23   ` Thomas Monjalon
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2021-11-17 14:10 UTC (permalink / raw)
  To: eagostini; +Cc: dev

On Wed, Nov 17, 2021 at 09:39:01PM +0000, eagostini@nvidia.com wrote:
> From: Elena Agostini <eagostini@nvidia.com>
> 
> This library can be made optional.
> drivers/gpu and app/test-gpudev depend on this library,
> so there is a check for dependencies.
> 
> Signed-off-by: Elena Agostini <eagostini@nvidia.com>
> ---
>  app/test-gpudev/meson.build      | 1 +
>  doc/guides/prog_guide/gpudev.rst | 1 +
>  drivers/gpu/meson.build          | 1 +
>  lib/meson.build                  | 1 +
>  4 files changed, 4 insertions(+)
> 
> diff --git a/app/test-gpudev/meson.build b/app/test-gpudev/meson.build
> index 17bdef3646..02286d3a6a 100644
> --- a/app/test-gpudev/meson.build
> +++ b/app/test-gpudev/meson.build
> @@ -3,3 +3,4 @@
>  
>  sources = files('main.c')
>  deps = ['gpudev', 'ethdev']
> +

This file and "drivers/gpu/meson.build" file can be removed from the patch,
since adding a blank line is unnecessary and is not related to the actual
patch changes. When preparing a patch, I'd suggest always double checking
that all changes introduced in the patch are intentional, and relevant to
the patch itself. If these whitespace fixups are intentional needed,
they should be sent as a separate patch just to make reviewing easier and
ensure each patch has only one logical change in it.

Thanks,
/Bruce

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

* Re: [PATCH v2] build: make gpudev optional
  2021-11-17 21:39 ` [PATCH v2] " eagostini
  2021-11-17 14:10   ` Bruce Richardson
@ 2021-11-17 17:23   ` Thomas Monjalon
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2021-11-17 17:23 UTC (permalink / raw)
  To: Elena Agostini; +Cc: dev, bruce.richardson, david.marchand

17/11/2021 22:39, eagostini@nvidia.com:
> From: Elena Agostini <eagostini@nvidia.com>
> 
> This library can be made optional.
> drivers/gpu and app/test-gpudev depend on this library,
> so there is a check for dependencies.

Changed to
so they are automatically disabled if the lib is disabled.

> Signed-off-by: Elena Agostini <eagostini@nvidia.com>

Applied with blank lines fixed.



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

* [PATCH v1] build: make gpudev optional
@ 2021-11-17 20:33 eagostini
  2021-11-17 12:36 ` Thomas Monjalon
  2021-11-17 21:39 ` [PATCH v2] " eagostini
  0 siblings, 2 replies; 6+ messages in thread
From: eagostini @ 2021-11-17 20:33 UTC (permalink / raw)
  To: dev; +Cc: Elena Agostini

From: Elena Agostini <eagostini@nvidia.com>

This library can be made optional.
drivers/gpu and app/test-gpudev depend on this library,
so there is a check for dependencies.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
---
 app/test-gpudev/meson.build      | 11 +++++++++--
 doc/guides/prog_guide/gpudev.rst |  1 +
 drivers/gpu/meson.build          |  9 ++++++++-
 lib/meson.build                  |  1 +
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/app/test-gpudev/meson.build b/app/test-gpudev/meson.build
index 17bdef3646..7340fe29d6 100644
--- a/app/test-gpudev/meson.build
+++ b/app/test-gpudev/meson.build
@@ -1,5 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2021 NVIDIA Corporation & Affiliates
 
-sources = files('main.c')
-deps = ['gpudev', 'ethdev']
+if dpdk_conf.has('RTE_LIB_GPUDEV')
+    sources = files('main.c')
+    deps = ['gpudev', 'ethdev']
+else
+    build = false
+    reason = 'gpudev library is disabled'
+    subdir_done()
+endif
+
diff --git a/doc/guides/prog_guide/gpudev.rst b/doc/guides/prog_guide/gpudev.rst
index e464109d35..8970c43865 100644
--- a/doc/guides/prog_guide/gpudev.rst
+++ b/doc/guides/prog_guide/gpudev.rst
@@ -23,6 +23,7 @@ Out of scope of this library is to provide a wrapper for GPU specific libraries
 on the device or create GPU specific objects
 (e.g. CUDA Driver context or CUDA Streams in case of NVIDIA GPUs).
 
+This library is set as optional and can be disabled with ``-Ddisable_libs=gpudev``.
 
 Features
 --------
diff --git a/drivers/gpu/meson.build b/drivers/gpu/meson.build
index 601bedcd61..f04594e712 100644
--- a/drivers/gpu/meson.build
+++ b/drivers/gpu/meson.build
@@ -1,4 +1,11 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2021 NVIDIA Corporation & Affiliates
 
-drivers = [ 'cuda' ]
+if dpdk_conf.has('RTE_LIB_GPUDEV')
+    drivers = [ 'cuda' ]
+else
+    build = false
+    reason = 'gpudev library is disabled'
+    subdir_done()
+endif
+
diff --git a/lib/meson.build b/lib/meson.build
index dad9fce14d..d6e7cac178 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -76,6 +76,7 @@ optional_libs = [
         'pdump',
         'power',
         'vhost',
+        'gpudev',
 ]
 
 disabled_libs = []
-- 
2.17.1


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

* [PATCH v2] build: make gpudev optional
  2021-11-17 20:33 [PATCH v1] build: make gpudev optional eagostini
  2021-11-17 12:36 ` Thomas Monjalon
@ 2021-11-17 21:39 ` eagostini
  2021-11-17 14:10   ` Bruce Richardson
  2021-11-17 17:23   ` Thomas Monjalon
  1 sibling, 2 replies; 6+ messages in thread
From: eagostini @ 2021-11-17 21:39 UTC (permalink / raw)
  To: dev; +Cc: Elena Agostini

From: Elena Agostini <eagostini@nvidia.com>

This library can be made optional.
drivers/gpu and app/test-gpudev depend on this library,
so there is a check for dependencies.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
---
 app/test-gpudev/meson.build      | 1 +
 doc/guides/prog_guide/gpudev.rst | 1 +
 drivers/gpu/meson.build          | 1 +
 lib/meson.build                  | 1 +
 4 files changed, 4 insertions(+)

diff --git a/app/test-gpudev/meson.build b/app/test-gpudev/meson.build
index 17bdef3646..02286d3a6a 100644
--- a/app/test-gpudev/meson.build
+++ b/app/test-gpudev/meson.build
@@ -3,3 +3,4 @@
 
 sources = files('main.c')
 deps = ['gpudev', 'ethdev']
+
diff --git a/doc/guides/prog_guide/gpudev.rst b/doc/guides/prog_guide/gpudev.rst
index e464109d35..8970c43865 100644
--- a/doc/guides/prog_guide/gpudev.rst
+++ b/doc/guides/prog_guide/gpudev.rst
@@ -23,6 +23,7 @@ Out of scope of this library is to provide a wrapper for GPU specific libraries
 on the device or create GPU specific objects
 (e.g. CUDA Driver context or CUDA Streams in case of NVIDIA GPUs).
 
+This library is set as optional and can be disabled with ``-Ddisable_libs=gpudev``.
 
 Features
 --------
diff --git a/drivers/gpu/meson.build b/drivers/gpu/meson.build
index 601bedcd61..1e68a7746d 100644
--- a/drivers/gpu/meson.build
+++ b/drivers/gpu/meson.build
@@ -2,3 +2,4 @@
 # Copyright (c) 2021 NVIDIA Corporation & Affiliates
 
 drivers = [ 'cuda' ]
+
diff --git a/lib/meson.build b/lib/meson.build
index dad9fce14d..018976df17 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -67,6 +67,7 @@ libraries = [
 
 optional_libs = [
         'bitratestats',
+        'gpudev',
         'gro',
         'gso',
         'kni',
-- 
2.17.1


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

end of thread, other threads:[~2021-11-17 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 20:33 [PATCH v1] build: make gpudev optional eagostini
2021-11-17 12:36 ` Thomas Monjalon
2021-11-17 12:56   ` Thomas Monjalon
2021-11-17 21:39 ` [PATCH v2] " eagostini
2021-11-17 14:10   ` Bruce Richardson
2021-11-17 17:23   ` Thomas Monjalon

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