DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] build: change flag variable type to boolean
@ 2023-06-12 16:21 Bruce Richardson
  2023-06-12 16:21 ` [PATCH 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Bruce Richardson @ 2023-06-12 16:21 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The has_libnuma flag was using 0 and 1 integer values, instead of the
more appropriate boolean type. Change to use true/false instead.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/meson.build    | 2 +-
 config/meson.build        | 4 ++--
 lib/eal/linux/meson.build | 2 +-
 lib/vhost/meson.build     | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 43f6a551a2..faba5e38cf 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -592,7 +592,7 @@ if update_flags
         part_number = soc_config['part_number']
         soc_flags = soc_config.get('flags', [])
         if not soc_config.get('numa', true)
-            has_libnuma = 0
+            has_libnuma = false
         endif
 
         disable_drivers += ',' + soc_config.get('disable_drivers', '')
diff --git a/config/meson.build b/config/meson.build
index 65087ce090..8aebccbbdc 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -174,7 +174,7 @@ if link_lib != ''
 endif
 
 # check for libraries used in multiple places in DPDK
-has_libnuma = 0
+has_libnuma = false
 find_libnuma = true
 if meson.is_cross_build() and not meson.get_cross_property('numa', true)
     # don't look for libnuma if explicitly disabled in cross build
@@ -184,7 +184,7 @@ if find_libnuma
     numa_dep = cc.find_library('numa', required: false)
     if numa_dep.found() and cc.has_header('numaif.h')
         dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-        has_libnuma = 1
+        has_libnuma = true
         add_project_link_arguments('-lnuma', language: 'c')
         dpdk_extra_ldflags += '-lnuma'
     endif
diff --git a/lib/eal/linux/meson.build b/lib/eal/linux/meson.build
index 1b913acc06..e99ebed256 100644
--- a/lib/eal/linux/meson.build
+++ b/lib/eal/linux/meson.build
@@ -20,6 +20,6 @@ sources += files(
 )
 
 deps += ['kvargs', 'telemetry']
-if has_libnuma == 1
+if has_libnuma
     dpdk_conf.set10('RTE_EAL_NUMA_AWARE_HUGEPAGES', true)
 endif
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 0d1abf6283..9e39d221a1 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -5,7 +5,7 @@ if not is_linux
     build = false
     reason = 'only supported on Linux'
 endif
-if has_libnuma == 1
+if has_libnuma
     dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
 if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
-- 
2.39.2


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

* [PATCH 2/2] build: prevent accidentally building without NUMA support
  2023-06-12 16:21 [PATCH 1/2] build: change flag variable type to boolean Bruce Richardson
@ 2023-06-12 16:21 ` Bruce Richardson
  2023-06-12 17:14 ` [PATCH v2 1/2] build: change flag variable type to boolean Bruce Richardson
  2023-06-13 15:33 ` [PATCH v3 0/2] replace int flags with booleans Bruce Richardson
  2 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2023-06-12 16:21 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When libnuma development package is missing on a system, DPDK can still
be built but will be missing much-needed support for NUMA memory
management. This may later cause issues at runtime if the resulting
binary is run on a NUMA system.

We can reduce the incidence of such runtime error by ensuring that, for
native builds*, libnuma is present - unless the user actually specifies
via "max_numa_nodes" that they don't require NUMA support. Having this
as an error condition is also in keeping with what is documented in the
Linux GSG doc, where libnuma is listed as a requirement for building
DPDK [1].

* NOTE: cross-compilation builds have a different logic set, with a
  separate "numa" value indicating if numa support is necessary.

[1] https://doc.dpdk.org/guides-23.03/linux_gsg/sys_reqs.html

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index 8aebccbbdc..bffd3600c6 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -381,6 +381,12 @@ endif
 if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
     error('Number of NUMA nodes not specified.')
 endif
+if not meson.is_cross_build() and dpdk_conf.get('RTE_MAX_NUMA_NODES') > 1 and not has_libnuma
+    error('''
+No NUMA library (development package) found, yet DPDK configured for multiple NUMA nodes.
+Please install libnuma, or set 'max_numa_nodes' option to '1' to build without NUMA support.
+''')
+endif
 
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
-- 
2.39.2


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

* [PATCH v2 1/2] build: change flag variable type to boolean
  2023-06-12 16:21 [PATCH 1/2] build: change flag variable type to boolean Bruce Richardson
  2023-06-12 16:21 ` [PATCH 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
@ 2023-06-12 17:14 ` Bruce Richardson
  2023-06-12 17:14   ` [PATCH v2 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
  2023-06-13 13:43   ` [PATCH v2 1/2] build: change flag variable type to boolean David Marchand
  2023-06-13 15:33 ` [PATCH v3 0/2] replace int flags with booleans Bruce Richardson
  2 siblings, 2 replies; 13+ messages in thread
From: Bruce Richardson @ 2023-06-12 17:14 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The has_libnuma flag was using 0 and 1 integer values, instead of the
more appropriate boolean type. Change to use true/false instead.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/meson.build    | 2 +-
 config/meson.build        | 4 ++--
 lib/eal/linux/meson.build | 2 +-
 lib/vhost/meson.build     | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 43f6a551a2..faba5e38cf 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -592,7 +592,7 @@ if update_flags
         part_number = soc_config['part_number']
         soc_flags = soc_config.get('flags', [])
         if not soc_config.get('numa', true)
-            has_libnuma = 0
+            has_libnuma = false
         endif
 
         disable_drivers += ',' + soc_config.get('disable_drivers', '')
diff --git a/config/meson.build b/config/meson.build
index 65087ce090..8aebccbbdc 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -174,7 +174,7 @@ if link_lib != ''
 endif
 
 # check for libraries used in multiple places in DPDK
-has_libnuma = 0
+has_libnuma = false
 find_libnuma = true
 if meson.is_cross_build() and not meson.get_cross_property('numa', true)
     # don't look for libnuma if explicitly disabled in cross build
@@ -184,7 +184,7 @@ if find_libnuma
     numa_dep = cc.find_library('numa', required: false)
     if numa_dep.found() and cc.has_header('numaif.h')
         dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-        has_libnuma = 1
+        has_libnuma = true
         add_project_link_arguments('-lnuma', language: 'c')
         dpdk_extra_ldflags += '-lnuma'
     endif
diff --git a/lib/eal/linux/meson.build b/lib/eal/linux/meson.build
index 1b913acc06..e99ebed256 100644
--- a/lib/eal/linux/meson.build
+++ b/lib/eal/linux/meson.build
@@ -20,6 +20,6 @@ sources += files(
 )
 
 deps += ['kvargs', 'telemetry']
-if has_libnuma == 1
+if has_libnuma
     dpdk_conf.set10('RTE_EAL_NUMA_AWARE_HUGEPAGES', true)
 endif
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 0d1abf6283..9e39d221a1 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -5,7 +5,7 @@ if not is_linux
     build = false
     reason = 'only supported on Linux'
 endif
-if has_libnuma == 1
+if has_libnuma
     dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
 if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
-- 
2.39.2


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

* [PATCH v2 2/2] build: prevent accidentally building without NUMA support
  2023-06-12 17:14 ` [PATCH v2 1/2] build: change flag variable type to boolean Bruce Richardson
@ 2023-06-12 17:14   ` Bruce Richardson
  2023-06-12 17:59     ` Bruce Richardson
  2023-06-13 13:43   ` [PATCH v2 1/2] build: change flag variable type to boolean David Marchand
  1 sibling, 1 reply; 13+ messages in thread
From: Bruce Richardson @ 2023-06-12 17:14 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When libnuma development package is missing on a system, DPDK can still
be built but will be missing much-needed support for NUMA memory
management. This may later cause issues at runtime if the resulting
binary is run on a NUMA system.

We can reduce the incidence of such runtime error by ensuring that, for
native builds*, libnuma is present - unless the user actually specifies
via "max_numa_nodes" that they don't require NUMA support. Having this
as an error condition is also in keeping with what is documented in the
Linux GSG doc, where libnuma is listed as a requirement for building
DPDK [1].

* NOTE: cross-compilation builds have a different logic set, with a
  separate "numa" value indicating if numa support is necessary.

[1] https://doc.dpdk.org/guides-23.03/linux_gsg/sys_reqs.html

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

---
V2: Limit check to linux only
---
 config/meson.build | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/config/meson.build b/config/meson.build
index 8aebccbbdc..00812976ba 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -381,6 +381,15 @@ endif
 if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
     error('Number of NUMA nodes not specified.')
 endif
+if (is_linux and
+        dpdk_conf.get('RTE_MAX_NUMA_NODES') > 1 and
+        not meson.is_cross_build() and
+        not has_libnuma)
+    error('''
+No NUMA library (development package) found, yet DPDK configured for multiple NUMA nodes.
+Please install libnuma, or set 'max_numa_nodes' option to '1' to build without NUMA support.
+''')
+endif
 
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
-- 
2.39.2


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

* Re: [PATCH v2 2/2] build: prevent accidentally building without NUMA support
  2023-06-12 17:14   ` [PATCH v2 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
@ 2023-06-12 17:59     ` Bruce Richardson
  2023-06-13 13:50       ` David Marchand
  0 siblings, 1 reply; 13+ messages in thread
From: Bruce Richardson @ 2023-06-12 17:59 UTC (permalink / raw)
  To: dev

On Mon, Jun 12, 2023 at 06:14:56PM +0100, Bruce Richardson wrote:
> When libnuma development package is missing on a system, DPDK can still
> be built but will be missing much-needed support for NUMA memory
> management. This may later cause issues at runtime if the resulting
> binary is run on a NUMA system.
> 
> We can reduce the incidence of such runtime error by ensuring that, for
> native builds*, libnuma is present - unless the user actually specifies
> via "max_numa_nodes" that they don't require NUMA support. Having this
> as an error condition is also in keeping with what is documented in the
> Linux GSG doc, where libnuma is listed as a requirement for building
> DPDK [1].
> 
> * NOTE: cross-compilation builds have a different logic set, with a
>   separate "numa" value indicating if numa support is necessary.
> 
> [1] https://doc.dpdk.org/guides-23.03/linux_gsg/sys_reqs.html
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> ---
> V2: Limit check to linux only
> ---
>  config/meson.build | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
I see this patch has failures reported in the CI, due to some of the
systems not having libnuma installed. I'd view that as a false positive,
since libnuma is effectively a mandatory requirement for building DPDK to
run on most systems. [And this patch still provides a way to build without
it - that way just has to be selected deliberately, rather than it being chosen
by default, without the user being aware of the omission.]

Regards,
/Bruce

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

* Re: [PATCH v2 1/2] build: change flag variable type to boolean
  2023-06-12 17:14 ` [PATCH v2 1/2] build: change flag variable type to boolean Bruce Richardson
  2023-06-12 17:14   ` [PATCH v2 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
@ 2023-06-13 13:43   ` David Marchand
  2023-06-13 13:55     ` Bruce Richardson
  1 sibling, 1 reply; 13+ messages in thread
From: David Marchand @ 2023-06-13 13:43 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Mon, Jun 12, 2023 at 7:15 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> The has_libnuma flag was using 0 and 1 integer values, instead of the
> more appropriate boolean type. Change to use true/false instead.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

This patch lgtm (with or without the suggestion on config/arm below).
Reviewed-by: David Marchand <david.marchand@redhat.com>

[snip]

> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 43f6a551a2..faba5e38cf 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -592,7 +592,7 @@ if update_flags
>          part_number = soc_config['part_number']
>          soc_flags = soc_config.get('flags', [])
>          if not soc_config.get('numa', true)
> -            has_libnuma = 0
> +            has_libnuma = false
>          endif

Maybe has_libnuma = soc_config.get('numa', true) ?


>
>          disable_drivers += ',' + soc_config.get('disable_drivers', '')



The same cleanup could be done to has_libfdt.
Additionnally, I wonder if we could remove those "== true" or "==
false" checks here and there in meson.build files.


-- 
David Marchand


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

* Re: [PATCH v2 2/2] build: prevent accidentally building without NUMA support
  2023-06-12 17:59     ` Bruce Richardson
@ 2023-06-13 13:50       ` David Marchand
  0 siblings, 0 replies; 13+ messages in thread
From: David Marchand @ 2023-06-13 13:50 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Mon, Jun 12, 2023 at 7:59 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Mon, Jun 12, 2023 at 06:14:56PM +0100, Bruce Richardson wrote:
> > When libnuma development package is missing on a system, DPDK can still
> > be built but will be missing much-needed support for NUMA memory
> > management. This may later cause issues at runtime if the resulting
> > binary is run on a NUMA system.
> >
> > We can reduce the incidence of such runtime error by ensuring that, for
> > native builds*, libnuma is present - unless the user actually specifies
> > via "max_numa_nodes" that they don't require NUMA support. Having this
> > as an error condition is also in keeping with what is documented in the
> > Linux GSG doc, where libnuma is listed as a requirement for building
> > DPDK [1].
> >
> > * NOTE: cross-compilation builds have a different logic set, with a
> >   separate "numa" value indicating if numa support is necessary.
> >
> > [1] https://doc.dpdk.org/guides-23.03/linux_gsg/sys_reqs.html
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> > ---
> > V2: Limit check to linux only
> > ---
> >  config/meson.build | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> I see this patch has failures reported in the CI, due to some of the
> systems not having libnuma installed. I'd view that as a false positive,
> since libnuma is effectively a mandatory requirement for building DPDK to
> run on most systems. [And this patch still provides a way to build without
> it - that way just has to be selected deliberately, rather than it being chosen
> by default, without the user being aware of the omission.]

The Intel CI lab job failing seems to be an issue in their RHEL 8.7 environment.
Can you ping them to figure it out?


For the i386 job in GHA.. either we install a 32bits numa library, or
we can silence this by setting max_numa_nodes to 1.


-- 
David Marchand


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

* Re: [PATCH v2 1/2] build: change flag variable type to boolean
  2023-06-13 13:43   ` [PATCH v2 1/2] build: change flag variable type to boolean David Marchand
@ 2023-06-13 13:55     ` Bruce Richardson
  0 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2023-06-13 13:55 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Tue, Jun 13, 2023 at 03:43:34PM +0200, David Marchand wrote:
> On Mon, Jun 12, 2023 at 7:15 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > The has_libnuma flag was using 0 and 1 integer values, instead of the
> > more appropriate boolean type. Change to use true/false instead.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> This patch lgtm (with or without the suggestion on config/arm below).
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
> [snip]
> 
> > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > index 43f6a551a2..faba5e38cf 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -592,7 +592,7 @@ if update_flags
> >          part_number = soc_config['part_number']
> >          soc_flags = soc_config.get('flags', [])
> >          if not soc_config.get('numa', true)
> > -            has_libnuma = 0
> > +            has_libnuma = false
> >          endif
> 
> Maybe has_libnuma = soc_config.get('numa', true) ?
> 
> 
> >
> >          disable_drivers += ',' + soc_config.get('disable_drivers', '')
> 
> 
> 
> The same cleanup could be done to has_libfdt.
> Additionnally, I wonder if we could remove those "== true" or "==
> false" checks here and there in meson.build files.
> 
I will take a look, and I think I'll also split this patch off from the
patch 2, to add an error for libnuma, since the two aren't really linked,
and this patch should probably be the simpler merge. I'll see about doing a
set for just int to boolean cleanups if I get the chance.

/Bruce

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

* [PATCH v3 0/2] replace int flags with booleans
  2023-06-12 16:21 [PATCH 1/2] build: change flag variable type to boolean Bruce Richardson
  2023-06-12 16:21 ` [PATCH 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
  2023-06-12 17:14 ` [PATCH v2 1/2] build: change flag variable type to boolean Bruce Richardson
@ 2023-06-13 15:33 ` Bruce Richardson
  2023-06-13 15:33   ` [PATCH v3 1/2] build: change NUMA flag variable type to boolean Bruce Richardson
                     ` (2 more replies)
  2 siblings, 3 replies; 13+ messages in thread
From: Bruce Richardson @ 2023-06-13 15:33 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

in meson.build files, some flags were being treated as integers rather
than using the more logical option of booleans. Fix this.

V3: drop the patch requiring libnuma from this set, to make this only
   a simple set changing the types of the flag. The other patch will be
   submitted separately for better tracking.

Bruce Richardson (2):
  build: change NUMA flag variable type to boolean
  build: change libfdt flag variable type to boolean

 config/arm/meson.build         | 2 +-
 config/meson.build             | 8 ++++----
 drivers/net/ipn3ke/meson.build | 2 +-
 drivers/raw/ifpga/meson.build  | 2 +-
 lib/eal/linux/meson.build      | 2 +-
 lib/vhost/meson.build          | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

--
2.39.2


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

* [PATCH v3 1/2] build: change NUMA flag variable type to boolean
  2023-06-13 15:33 ` [PATCH v3 0/2] replace int flags with booleans Bruce Richardson
@ 2023-06-13 15:33   ` Bruce Richardson
  2023-06-13 15:33   ` [PATCH v3 2/2] build: change libfdt " Bruce Richardson
  2023-06-15 13:53   ` [PATCH v3 0/2] replace int flags with booleans David Marchand
  2 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2023-06-13 15:33 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, David Marchand

The has_libnuma flag was using 0 and 1 integer values, instead of the
more appropriate boolean type. Change to use true/false instead.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 config/arm/meson.build    | 2 +-
 config/meson.build        | 4 ++--
 lib/eal/linux/meson.build | 2 +-
 lib/vhost/meson.build     | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 43f6a551a2..faba5e38cf 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -592,7 +592,7 @@ if update_flags
         part_number = soc_config['part_number']
         soc_flags = soc_config.get('flags', [])
         if not soc_config.get('numa', true)
-            has_libnuma = 0
+            has_libnuma = false
         endif
 
         disable_drivers += ',' + soc_config.get('disable_drivers', '')
diff --git a/config/meson.build b/config/meson.build
index 65087ce090..8aebccbbdc 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -174,7 +174,7 @@ if link_lib != ''
 endif
 
 # check for libraries used in multiple places in DPDK
-has_libnuma = 0
+has_libnuma = false
 find_libnuma = true
 if meson.is_cross_build() and not meson.get_cross_property('numa', true)
     # don't look for libnuma if explicitly disabled in cross build
@@ -184,7 +184,7 @@ if find_libnuma
     numa_dep = cc.find_library('numa', required: false)
     if numa_dep.found() and cc.has_header('numaif.h')
         dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-        has_libnuma = 1
+        has_libnuma = true
         add_project_link_arguments('-lnuma', language: 'c')
         dpdk_extra_ldflags += '-lnuma'
     endif
diff --git a/lib/eal/linux/meson.build b/lib/eal/linux/meson.build
index 1b913acc06..e99ebed256 100644
--- a/lib/eal/linux/meson.build
+++ b/lib/eal/linux/meson.build
@@ -20,6 +20,6 @@ sources += files(
 )
 
 deps += ['kvargs', 'telemetry']
-if has_libnuma == 1
+if has_libnuma
     dpdk_conf.set10('RTE_EAL_NUMA_AWARE_HUGEPAGES', true)
 endif
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 0d1abf6283..9e39d221a1 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -5,7 +5,7 @@ if not is_linux
     build = false
     reason = 'only supported on Linux'
 endif
-if has_libnuma == 1
+if has_libnuma
     dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
 if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
-- 
2.39.2


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

* [PATCH v3 2/2] build: change libfdt flag variable type to boolean
  2023-06-13 15:33 ` [PATCH v3 0/2] replace int flags with booleans Bruce Richardson
  2023-06-13 15:33   ` [PATCH v3 1/2] build: change NUMA flag variable type to boolean Bruce Richardson
@ 2023-06-13 15:33   ` Bruce Richardson
  2023-06-14 12:42     ` David Marchand
  2023-06-15 13:53   ` [PATCH v3 0/2] replace int flags with booleans David Marchand
  2 siblings, 1 reply; 13+ messages in thread
From: Bruce Richardson @ 2023-06-13 15:33 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The has_libfdt flag was using 0 and 1 integer values, instead of the
more appropriate boolean type. Change to use true/false instead.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build             | 4 ++--
 drivers/net/ipn3ke/meson.build | 2 +-
 drivers/raw/ifpga/meson.build  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 8aebccbbdc..22d7d908b7 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -190,11 +190,11 @@ if find_libnuma
     endif
 endif
 
-has_libfdt = 0
+has_libfdt = false
 fdt_dep = cc.find_library('fdt', required: false)
 if fdt_dep.found() and cc.has_header('fdt.h')
     dpdk_conf.set10('RTE_HAS_LIBFDT', true)
-    has_libfdt = 1
+    has_libfdt = true
     add_project_link_arguments('-lfdt', language: 'c')
     dpdk_extra_ldflags += '-lfdt'
 endif
diff --git a/drivers/net/ipn3ke/meson.build b/drivers/net/ipn3ke/meson.build
index 104d2f58e5..464bdbd8b6 100644
--- a/drivers/net/ipn3ke/meson.build
+++ b/drivers/net/ipn3ke/meson.build
@@ -15,7 +15,7 @@ endif
 #  rte_eth_switch_domain_free()
 #
 
-if has_libfdt == 0
+if not has_libfdt
     build = false
     reason = 'missing dependency, "libfdt"'
     subdir_done()
diff --git a/drivers/raw/ifpga/meson.build b/drivers/raw/ifpga/meson.build
index cc30dc8be7..20dea23206 100644
--- a/drivers/raw/ifpga/meson.build
+++ b/drivers/raw/ifpga/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if has_libfdt == 0
+if not has_libfdt
     build = false
     reason = 'missing dependency, "libfdt"'
     subdir_done()
-- 
2.39.2


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

* Re: [PATCH v3 2/2] build: change libfdt flag variable type to boolean
  2023-06-13 15:33   ` [PATCH v3 2/2] build: change libfdt " Bruce Richardson
@ 2023-06-14 12:42     ` David Marchand
  0 siblings, 0 replies; 13+ messages in thread
From: David Marchand @ 2023-06-14 12:42 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, Jun 13, 2023 at 5:34 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> The has_libfdt flag was using 0 and 1 integer values, instead of the
> more appropriate boolean type. Change to use true/false instead.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


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

* Re: [PATCH v3 0/2] replace int flags with booleans
  2023-06-13 15:33 ` [PATCH v3 0/2] replace int flags with booleans Bruce Richardson
  2023-06-13 15:33   ` [PATCH v3 1/2] build: change NUMA flag variable type to boolean Bruce Richardson
  2023-06-13 15:33   ` [PATCH v3 2/2] build: change libfdt " Bruce Richardson
@ 2023-06-15 13:53   ` David Marchand
  2 siblings, 0 replies; 13+ messages in thread
From: David Marchand @ 2023-06-15 13:53 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, Jun 13, 2023 at 5:34 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> in meson.build files, some flags were being treated as integers rather
> than using the more logical option of booleans. Fix this.
>
> V3: drop the patch requiring libnuma from this set, to make this only
>    a simple set changing the types of the flag. The other patch will be
>    submitted separately for better tracking.
>
> Bruce Richardson (2):
>   build: change NUMA flag variable type to boolean
>   build: change libfdt flag variable type to boolean

Series applied, thanks Bruce.


-- 
David Marchand


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

end of thread, other threads:[~2023-06-15 13:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 16:21 [PATCH 1/2] build: change flag variable type to boolean Bruce Richardson
2023-06-12 16:21 ` [PATCH 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
2023-06-12 17:14 ` [PATCH v2 1/2] build: change flag variable type to boolean Bruce Richardson
2023-06-12 17:14   ` [PATCH v2 2/2] build: prevent accidentally building without NUMA support Bruce Richardson
2023-06-12 17:59     ` Bruce Richardson
2023-06-13 13:50       ` David Marchand
2023-06-13 13:43   ` [PATCH v2 1/2] build: change flag variable type to boolean David Marchand
2023-06-13 13:55     ` Bruce Richardson
2023-06-13 15:33 ` [PATCH v3 0/2] replace int flags with booleans Bruce Richardson
2023-06-13 15:33   ` [PATCH v3 1/2] build: change NUMA flag variable type to boolean Bruce Richardson
2023-06-13 15:33   ` [PATCH v3 2/2] build: change libfdt " Bruce Richardson
2023-06-14 12:42     ` David Marchand
2023-06-15 13:53   ` [PATCH v3 0/2] replace int flags with booleans David Marchand

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