diff mbox series

[v8,13/14] build: disable libnuma in cross builds

Message ID 1604649795-27476-14-git-send-email-juraj.linkes@pantheon.tech (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series Arm build options rework | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Juraj Linkeš Nov. 6, 2020, 8:03 a.m. UTC
Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disabled NUMA in Arm cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |  1 +
 config/arm/arm64_armv8_linux_gcc     |  1 +
 config/arm/arm64_bluefield_linux_gcc |  1 +
 config/arm/arm64_dpaa_linux_gcc      |  1 +
 config/arm/arm64_graviton2_linux_gcc |  1 +
 config/arm/arm64_n1sdp_linux_gcc     |  1 +
 config/arm/arm64_octeontx2_linux_gcc |  1 +
 config/arm/arm64_stingray_linux_gcc  |  1 +
 config/arm/meson.build               |  2 --
 config/meson.build                   | 19 +++++++++++++------
 10 files changed, 21 insertions(+), 8 deletions(-)

Comments

Honnappa Nagarahalli Nov. 9, 2020, 12:24 a.m. UTC | #1
<snip>

> 
> Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
> for cross build and disabled NUMA in Arm cross files.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armada_linux_gcc    |  1 +
>  config/arm/arm64_armv8_linux_gcc     |  1 +
>  config/arm/arm64_bluefield_linux_gcc |  1 +
>  config/arm/arm64_dpaa_linux_gcc      |  1 +
>  config/arm/arm64_graviton2_linux_gcc |  1 +
>  config/arm/arm64_n1sdp_linux_gcc     |  1 +
>  config/arm/arm64_octeontx2_linux_gcc |  1 +
> config/arm/arm64_stingray_linux_gcc  |  1 +
>  config/arm/meson.build               |  2 --
>  config/meson.build                   | 19 +++++++++++++------
>  10 files changed, 21 insertions(+), 8 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index 7383f42e2..f5403f0a6 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -17,4 +17,5 @@ endian = 'little'
>  implementer_id = '0x56'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
>  disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax'] diff --git
> a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
> index 245e06e5f..77e3d6278 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -53,5 +53,6 @@ part_number = 'generic'
>  max_lcores = 256
>  max_numa_nodes = 4
> 
> +# numa = false        # set to false if the target is not a NUMA system
Nit, IMO, we can skip these comments in this file and keep it short

>  # disabled_drivers = ['bus/dpaa', 'crypto']
>      # add to the set of disabled libraries diff --git
> a/config/arm/arm64_bluefield_linux_gcc
> b/config/arm/arm64_bluefield_linux_gcc
> index 4f56790c5..6bef87fbd 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd08'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_dpaa_linux_gcc
> b/config/arm/arm64_dpaa_linux_gcc index 00101962b..3458b9d7b 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -17,3 +17,4 @@ endian = 'little'
>  implementer_id = 'dpaa'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_graviton2_linux_gcc
> b/config/arm/arm64_graviton2_linux_gcc
> index d0bfec87d..cfe239797 100644
> --- a/config/arm/arm64_graviton2_linux_gcc
> +++ b/config/arm/arm64_graviton2_linux_gcc
> @@ -17,3 +17,4 @@ implementor_id = '0x41'
>  implementor_pn = '0xd0c'
>  max_lcores = 64
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_n1sdp_linux_gcc
> b/config/arm/arm64_n1sdp_linux_gcc
> index 138ae08c3..b00f2d1ef 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd0c'
>  max_lcores = 4
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_octeontx2_linux_gcc
> b/config/arm/arm64_octeontx2_linux_gcc
> index 26cf471ad..593769709 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x43'
>  part_number = '0xb2'
>  max_lcores = 36
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_stingray_linux_gcc
> b/config/arm/arm64_stingray_linux_gcc
> index 4f56790c5..6bef87fbd 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd08'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> a39a35b6a..52274c0c5 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -45,8 +45,6 @@ part_number_config_arm = {
>  			['RTE_MACHINE', '"neoverse-n1"'],
>  			['RTE_ARM_FEATURE_ATOMICS', true],
>  			['RTE_USE_C11_MEM_MODEL', true],
> -			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -			['RTE_LIBRTE_VHOST_NUMA', false],
>  			['RTE_MAX_MEM_MB', 1048576],
>  			['RTE_CACHE_LINE_SIZE', 64],
>  			['RTE_MAX_LCORE', 64],
> diff --git a/config/meson.build b/config/meson.build index
> 41adb2303..5c190dd6e 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -141,12 +141,19 @@ endif
> 
>  # check for libraries used in multiple places in DPDK  has_libnuma = 0 -
> 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
> -	add_project_link_arguments('-lnuma', language: 'c')
> -	dpdk_extra_ldflags += '-lnuma'
> +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
> +	check_libnuma = false
               ^^^^^^^^^^^^ find_libnuma?

> +endif
> +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
> +		add_project_link_arguments('-lnuma', language: 'c')
> +		dpdk_extra_ldflags += '-lnuma'
> +	endif
>  endif
> 
>  has_libfdt = 0
> --
> 2.20.1
Juraj Linkeš Nov. 9, 2020, 11:10 a.m. UTC | #2
> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Monday, November 9, 2020 1:25 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 13/14] build: disable libnuma in cross builds
> 
> <snip>
> 
> >
> > Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
> > for cross build and disabled NUMA in Arm cross files.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/arm64_armada_linux_gcc    |  1 +
> >  config/arm/arm64_armv8_linux_gcc     |  1 +
> >  config/arm/arm64_bluefield_linux_gcc |  1 +
> >  config/arm/arm64_dpaa_linux_gcc      |  1 +
> >  config/arm/arm64_graviton2_linux_gcc |  1 +
> >  config/arm/arm64_n1sdp_linux_gcc     |  1 +
> >  config/arm/arm64_octeontx2_linux_gcc |  1 +
> > config/arm/arm64_stingray_linux_gcc  |  1 +
> >  config/arm/meson.build               |  2 --
> >  config/meson.build                   | 19 +++++++++++++------
> >  10 files changed, 21 insertions(+), 8 deletions(-)
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/arm64_armada_linux_gcc
> > index 7383f42e2..f5403f0a6 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -17,4 +17,5 @@ endian = 'little'
> >  implementer_id = '0x56'
> >  max_lcores = 16
> >  max_numa_nodes = 1
> > +numa = false
> >  disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax'] diff
> > --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > index 245e06e5f..77e3d6278 100644
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ b/config/arm/arm64_armv8_linux_gcc
> > @@ -53,5 +53,6 @@ part_number = 'generic'
> >  max_lcores = 256
> >  max_numa_nodes = 4
> >
> > +# numa = false        # set to false if the target is not a NUMA system
> Nit, IMO, we can skip these comments in this file and keep it short
> 

Looking at the original comments in this file, I arrived at the conclusion that this is the documentation about what's supported in an arm cross file. We should have this documented somewhere and this seemed like the best place. It's possible we could mention this in the docs instead. Then the removal of these explanatory comments would make sense.

> >  # disabled_drivers = ['bus/dpaa', 'crypto']
> >      # add to the set of disabled libraries diff --git
> > a/config/arm/arm64_bluefield_linux_gcc
> > b/config/arm/arm64_bluefield_linux_gcc
> > index 4f56790c5..6bef87fbd 100644
> > --- a/config/arm/arm64_bluefield_linux_gcc
> > +++ b/config/arm/arm64_bluefield_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> >  part_number = '0xd08'
> >  max_lcores = 16
> >  max_numa_nodes = 1
> > +numa = false
> > diff --git a/config/arm/arm64_dpaa_linux_gcc
> > b/config/arm/arm64_dpaa_linux_gcc index 00101962b..3458b9d7b 100644
> > --- a/config/arm/arm64_dpaa_linux_gcc
> > +++ b/config/arm/arm64_dpaa_linux_gcc
> > @@ -17,3 +17,4 @@ endian = 'little'
> >  implementer_id = 'dpaa'
> >  max_lcores = 16
> >  max_numa_nodes = 1
> > +numa = false
> > diff --git a/config/arm/arm64_graviton2_linux_gcc
> > b/config/arm/arm64_graviton2_linux_gcc
> > index d0bfec87d..cfe239797 100644
> > --- a/config/arm/arm64_graviton2_linux_gcc
> > +++ b/config/arm/arm64_graviton2_linux_gcc
> > @@ -17,3 +17,4 @@ implementor_id = '0x41'
> >  implementor_pn = '0xd0c'
> >  max_lcores = 64
> >  max_numa_nodes = 1
> > +numa = false
> > diff --git a/config/arm/arm64_n1sdp_linux_gcc
> > b/config/arm/arm64_n1sdp_linux_gcc
> > index 138ae08c3..b00f2d1ef 100644
> > --- a/config/arm/arm64_n1sdp_linux_gcc
> > +++ b/config/arm/arm64_n1sdp_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> >  part_number = '0xd0c'
> >  max_lcores = 4
> >  max_numa_nodes = 1
> > +numa = false
> > diff --git a/config/arm/arm64_octeontx2_linux_gcc
> > b/config/arm/arm64_octeontx2_linux_gcc
> > index 26cf471ad..593769709 100644
> > --- a/config/arm/arm64_octeontx2_linux_gcc
> > +++ b/config/arm/arm64_octeontx2_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x43'
> >  part_number = '0xb2'
> >  max_lcores = 36
> >  max_numa_nodes = 1
> > +numa = false
> > diff --git a/config/arm/arm64_stingray_linux_gcc
> > b/config/arm/arm64_stingray_linux_gcc
> > index 4f56790c5..6bef87fbd 100644
> > --- a/config/arm/arm64_stingray_linux_gcc
> > +++ b/config/arm/arm64_stingray_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> >  part_number = '0xd08'
> >  max_lcores = 16
> >  max_numa_nodes = 1
> > +numa = false
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > a39a35b6a..52274c0c5 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -45,8 +45,6 @@ part_number_config_arm = {
> >  			['RTE_MACHINE', '"neoverse-n1"'],
> >  			['RTE_ARM_FEATURE_ATOMICS', true],
> >  			['RTE_USE_C11_MEM_MODEL', true],
> > -			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > -			['RTE_LIBRTE_VHOST_NUMA', false],
> >  			['RTE_MAX_MEM_MB', 1048576],
> >  			['RTE_CACHE_LINE_SIZE', 64],
> >  			['RTE_MAX_LCORE', 64],
> > diff --git a/config/meson.build b/config/meson.build index
> > 41adb2303..5c190dd6e 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -141,12 +141,19 @@ endif
> >
> >  # check for libraries used in multiple places in DPDK  has_libnuma =
> > 0 - 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
> > -	add_project_link_arguments('-lnuma', language: 'c')
> > -	dpdk_extra_ldflags += '-lnuma'
> > +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
> > +	check_libnuma = false
>                ^^^^^^^^^^^^ find_libnuma?
> 

Good catch. I'll fix this.

> > +endif
> > +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
> > +		add_project_link_arguments('-lnuma', language: 'c')
> > +		dpdk_extra_ldflags += '-lnuma'
> > +	endif
> >  endif
> >
> >  has_libfdt = 0
> > --
> > 2.20.1
Honnappa Nagarahalli Nov. 9, 2020, 11:29 p.m. UTC | #3
<snip>

> >
> > >
> > > Some Arm SoCs are not NUMA systems. Add the capability to disable
> > > NUMA for cross build and disabled NUMA in Arm cross files.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/arm64_armada_linux_gcc    |  1 +
> > >  config/arm/arm64_armv8_linux_gcc     |  1 +
> > >  config/arm/arm64_bluefield_linux_gcc |  1 +
> > >  config/arm/arm64_dpaa_linux_gcc      |  1 +
> > >  config/arm/arm64_graviton2_linux_gcc |  1 +
> > >  config/arm/arm64_n1sdp_linux_gcc     |  1 +
> > >  config/arm/arm64_octeontx2_linux_gcc |  1 +
> > > config/arm/arm64_stingray_linux_gcc  |  1 +
> > >  config/arm/meson.build               |  2 --
> > >  config/meson.build                   | 19 +++++++++++++------
> > >  10 files changed, 21 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > b/config/arm/arm64_armada_linux_gcc
> > > index 7383f42e2..f5403f0a6 100644
> > > --- a/config/arm/arm64_armada_linux_gcc
> > > +++ b/config/arm/arm64_armada_linux_gcc
> > > @@ -17,4 +17,5 @@ endian = 'little'
> > >  implementer_id = '0x56'
> > >  max_lcores = 16
> > >  max_numa_nodes = 1
> > > +numa = false
> > >  disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax'] diff
> > > --git a/config/arm/arm64_armv8_linux_gcc
> > > b/config/arm/arm64_armv8_linux_gcc
> > > index 245e06e5f..77e3d6278 100644
> > > --- a/config/arm/arm64_armv8_linux_gcc
> > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > @@ -53,5 +53,6 @@ part_number = 'generic'
> > >  max_lcores = 256
> > >  max_numa_nodes = 4
> > >
> > > +# numa = false        # set to false if the target is not a NUMA system
> > Nit, IMO, we can skip these comments in this file and keep it short
> >
> 
> Looking at the original comments in this file, I arrived at the conclusion that
> this is the documentation about what's supported in an arm cross file. We
> should have this documented somewhere and this seemed like the best place.
> It's possible we could mention this in the docs instead. Then the removal of
> these explanatory comments would make sense.
Prefer to document the usage in the docs.

<snip>
diff mbox series

Patch

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 7383f42e2..f5403f0a6 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,4 +17,5 @@  endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 245e06e5f..77e3d6278 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -53,5 +53,6 @@  part_number = 'generic'
 max_lcores = 256
 max_numa_nodes = 4
 
+# numa = false        # set to false if the target is not a NUMA system
 # disabled_drivers = ['bus/dpaa', 'crypto']
     # add to the set of disabled libraries
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@  implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 00101962b..3458b9d7b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@  endian = 'little'
 implementer_id = 'dpaa'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@  implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@  implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@  implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@  implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index a39a35b6a..52274c0c5 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -45,8 +45,6 @@  part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_USE_C11_MEM_MODEL', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_CACHE_LINE_SIZE', 64],
 			['RTE_MAX_LCORE', 64],
diff --git a/config/meson.build b/config/meson.build
index 41adb2303..5c190dd6e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -141,12 +141,19 @@  endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-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
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+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
+	check_libnuma = false
+endif
+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
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0