Enable 32-bit native builds with meson
Subsystems (2)
cover Enable 32-bit native builds with meson
This patchset enables building DPDK on 32-bit systems, and has been tested using debian 32-bit on x86 i.e. doing an "i686" build in the old build system.
Additional work is still required (possibly via cross-file) to get DPDK building for 32-bit on a 64-bit system, but this is the first step in that process.
Bruce Richardson (7):
kni: disable for 32-bit meson builds
bpf: fix 32-bit build support with meson
net/sfc: disable for 32-bit builds
build: disable pointer to int conversion warnings for 32-bit
dpaa2: fix default IOVA build setting for meson builds examples/kni: fix dependency check for building with meson net/avp: fix 32-bit meson builds
config/arm/meson.build | 2 +- config/meson.build | 5 +++++ drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/sfc/meson.build | 2 +- examples/kni/meson.build | 5 ++--- lib/librte_bpf/meson.build | 2 +- lib/librte_kni/meson.build | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/7 kni: disable for 32-bit meson builds
The kni library is not supported on 32-bit so disable it for those builds using meson.
--- lib/librte_kni/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_kni/meson.build +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -if host_machine.system() != 'linux' +if host_machine.system() != 'linux' or cc.sizeof('void *') == 4 build = false endif version = 2
Signature · 1 line
2.17.1
Re: [PATCH 1/7] kni: disable for 32-bit meson builds
Quoted 4 lines · Bruce Richardson
The kni library is not supported on 32-bit so disable it for those builds using meson.
Signed-off-by Bruce Richardson <[email protected]>
PATCH 2/7 bpf: fix 32-bit build support with meson
In reply to Bruce RichardsonThe JIT is only supported on x86_64 so disable for 32-bit builds.
--- lib/librte_bpf/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_bpf/meson.build +1 -1
@@ -8,7 +8,7 @@ sources = files('bpf.c', 'bpf_pkt.c', 'bpf_validate.c') -if arch_subdir == 'x86' +if arch_subdir == 'x86' and cc.sizeof('void *') == 8 sources += files('bpf_jit_x86.c') endif
Signature · 1 line
2.17.1
Re: [PATCH 2/7] bpf: fix 32-bit build support with meson
Quoted 23 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Bruce Richardson
Sent: Friday, June 8, 2018 5:38 PM
To: [email protected]
Cc: Richardson, Bruce <[email protected]>
Subject: [dpdk-dev] [PATCH 2/7] bpf: fix 32-bit build support with mesonThe JIT is only supported on
x86_64so disable for 32-bit builds.Fixes cc752e43e079 ("bpf: add JIT compilation for x86_64 ISA")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_bpf/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/librte_bpf/meson.build +0
-0
lib/librte_bpf/meson.build sources = files('bpf.c',
Quoted 9 lines
lib/librte_bpf/meson.build +1
-2@@ -8,7 +8,7 @@ sources = files('bpf.c', 'bpf_pkt.c', 'bpf_validate.c') -if arch_subdir == 'x86' +if arch_subdir == 'x86' and cc.sizeof('void *') == 8 sources += files('bpf_jit_x86.c') endif --
Quoted 1 line
2.17.1
PATCH 3/7 net/sfc: disable for 32-bit builds
In reply to Bruce RichardsonThe sfc driver is not supported on 32-bit so disable in meson in those cases.
--- drivers/net/sfc/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/sfc/meson.build +1 -1
@@ -6,7 +6,7 @@ # This software was jointly developed between OKTET Labs (under contract # for Solarflare) and Solarflare Communications, Inc. -if arch_subdir != 'x86' +if arch_subdir != 'x86' or cc.sizeof('void *') == 4 build = false endif
Signature · 1 line
2.17.1
Re: [PATCH 3/7] net/sfc: disable for 32-bit builds
Quoted 4 lines · Bruce Richardson
The sfc driver is not supported on 32-bit so disable in meson in those cases.
Signed-off-by Bruce Richardson <[email protected]>
PATCH 4/7 build: disable pointer to int conversion warnings for 32-bit
In reply to Bruce RichardsonConverting a 32-bit pointer to a 64-bit integer is generally safe, but generates a lot of warnings when compiling 32-bit code with meson. The warnings are not flagged when using make, so just disable them for 32-bit meson builds.
--- config/meson.build | 4 ++++ 1 file changed, 4 insertions(+)
config/meson.build +4 -0
@@ -60,6 +60,10 @@ warning_flags = [ '-Wno-address-of-packed-member', '-Wno-format-truncation' ] +if cc.sizeof('void *') == 4 +# for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!! + warning_flags += '-Wno-pointer-to-int-cast' +endif foreach arg: warning_flags if cc.has_argument(arg) add_project_arguments(arg, language: 'c')
Signature · 1 line
2.17.1
PATCH 5/7 dpaa2: fix default IOVA build setting for meson builds
In reply to Bruce RichardsonBy default, the DPAA2_USE_PHYS_IOVA setting with the make build-system is "y", which is overridden to "n" in the config file specifically for the arm64-dpaa2-linuxapp-gcc builds. The lack of this setting in meson builds causes issues for 32-bit build, as the alternative code paths have compiler warnings e.g. for i686 builds. Therefore we should align the meson and make settings, setting the value to "true" by default and overriding it to "false" for dpaa2-specific builds.
--- config/arm/meson.build | 2 +- config/meson.build | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
config/arm/meson.build +1 -1
@@ -64,7 +64,7 @@ flags_dpaa2 = [ ['RTE_CACHE_LINE_SIZE', 64], ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 16], - ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', 'n']] + ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]] ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321) impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
config/meson.build +1 -0
@@ -78,6 +78,7 @@ dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id # values which have defaults which may be overridden dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) +dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) compile_time_cpuflags = [] if host_machine.cpu_family().startswith('x86')
Signature · 1 line
2.17.1
Re: [PATCH 5/7] dpaa2: fix default IOVA build setting for meson builds
Quoted 11 lines · Bruce Richardson
By default, the
DPAA2_USE_PHYS_IOVAsetting with the make build-system is "y", which is overridden to "n" in the config file specifically for the arm64-dpaa2-linuxapp-gcc builds. The lack of this setting in meson builds causes issues for 32-bit build, as the alternative code paths have compiler warnings e.g. for i686 builds. Therefore we should align the meson and make settings, setting the value to "true" by default and overriding it to "false" for dpaa2-specific builds.Fixes 6ec78c2463ac ("build: add meson support for dpaaX platforms")
PATCH 6/7 examples/kni: fix dependency check for building with meson
In reply to Bruce RichardsonRather than hard-coding the example app to be built only when a set of conditions are met, we can simplify things by having the app built when KNI library itself is available. That saves us duplicating the same set of restrictions on both library and example app.
--- examples/kni/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
examples/kni/meson.build +2 -3
@@ -6,9 +6,8 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' -if host_machine.system() != 'linux' - build = false -endif +# this app can be built if-and-only-if KNI library is buildable +build = dpdk_conf.has('LIB_LIBRTE_KNI') deps += ['kni', 'bus_pci'] sources = files( 'main.c'
Signature · 1 line
2.17.1
Re: [PATCH 6/7] examples/kni: fix dependency check for building with meson
Quoted 17 lines · Bruce Richardson
Rather than hard-coding the example app to be built only when a set of conditions are met, we can simplify things by having the app built when KNI library itself is available. That saves us duplicating the same set of restrictions on both library and example app.
Fixes 89f0711f9ddf ("examples: build some samples with meson")Signed-off-by Bruce Richardson <[email protected]>--- examples/kni/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)examples/kni/meson.build +0
-0
examples/kni/meson.build line 10
Quoted 8 lines
examples/kni/meson.build +2
-3@@ -6,9 +6,8 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' -if host_machine.system() != 'linux' - build = false -endif +# this app can be built if-and-only-if KNI library is buildable +build = dpdk_conf.has('LIB_LIBRTE_KNI')
s/LIB_LIBRTE_KNI/RTE_LIBRTE_KNI/
Same needs to be updated in drivers/net/kni/meson.build too
Quoted 4 lines
examples/kni/meson.build +0
-0deps += ['kni', 'bus_pci'] sources = files( 'main.c'
Re: [PATCH 6/7] examples/kni: fix dependency check for building with meson
Quoted 29 lines · Ferruh Yigit
Quoted 17 lines · Bruce Richardson
Rather than hard-coding the example app to be built only when a set of conditions are met, we can simplify things by having the app built when KNI library itself is available. That saves us duplicating the same set of restrictions on both library and example app.
Fixes 89f0711f9ddf ("examples: build some samples with meson")Signed-off-by Bruce Richardson <[email protected]>--- examples/kni/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)examples/kni/meson.build +0
-0examples/kni/meson.build line 10
Quoted 8 lines
examples/kni/meson.build +2
-3@@ -6,9 +6,8 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' -if host_machine.system() != 'linux' - build = false -endif +# this app can be built if-and-only-if KNI library is buildable +build = dpdk_conf.has('LIB_LIBRTE_KNI')s/LIB_LIBRTE_KNI/RTE_LIBRTE_KNI/
Quoted 2 lines
Same needs to be updated in
drivers/net/kni/meson.buildtoo
Thanks, good catch.
PATCH 7/7 net/avp: fix 32-bit meson builds
In reply to Bruce RichardsonWhen compiling with meson, extra warnings are enabled about casting from integers to different size pointers. This triggers an error in AVP as the addition of the offset to the pointer address causes the result to be a 64-bit integer which doesn't fit a 32-bit pointer. The fix here is to explicitly indicate that the offset is of type "uintptr_t" which prevents any promotion which would cause errors.
--- drivers/net/avp/avp_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/avp/avp_ethdev.c +1 -1
@@ -383,7 +383,7 @@ avp_dev_translate_address(struct rte_eth_dev *eth_dev, (host_phys_addr < (map->phys_addr + map->length))) {/* address is within this segment */ offset += (host_phys_addr - map->phys_addr); - addr =RTE_PTR_ADD (addr, offset); + addr =RTE_PTR_ADD (addr, (uintptr_t )offset);PMD_DRV_LOG (DEBUG ,"Translating host physical 0x%" PRIx64" to guest virtual 0x%p\n" , host_phys_addr, addr);
Signature · 1 line
2.17.1
Re: [PATCH 7/7] net/avp: fix 32-bit meson builds
Quoted 15 lines
-----Original Message-----
From: Bruce Richardson [mailto:[email protected]]
Sent: Friday, June 08, 2018 12:38 PM
To: [email protected]
Cc: RICHARDSON, BRUCE; Legacy, Allain
Subject: [PATCH 7/7] net/avp: fix 32-bit meson buildsWhen compiling with meson, extra warnings are enabled about casting from integers to different size pointers. This triggers an error in AVP as the addition of the offset to the pointer address causes the result to be a 64-bit integer which doesn't fit a 32-bit pointer. The fix here is to explicitly indicate that the offset is of type "
uintptr_t" which prevents any promotion which would cause errors.
Quoted 4 lines
Fixes c0ad584222b5 ("net/avp: add device initialization")Signed-off-by Bruce Richardson <[email protected]>
Quoted 17 lines · Bruce Richardson
This patchset enables building DPDK on 32-bit systems, and has been tested using debian 32-bit on x86 i.e. doing an "i686" build in the old build system.
Additional work is still required (possibly via cross-file) to get DPDK building for 32-bit on a 64-bit system, but this is the first step in that process.
Bruce Richardson (7):
kni: disable for 32-bit meson builds
bpf: fix 32-bit build support with meson
net/sfc: disable for 32-bit builds
build: disable pointer to int conversion warnings for 32-bit
dpaa2: fix default IOVA build setting for meson builds examples/kni: fix dependency check for building with meson net/avp: fix 32-bit meson builds
Quoted 9 lines
config/arm/meson.build | 2 +- config/meson.build | 5 +++++ drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/sfc/meson.build | 2 +- examples/kni/meson.build | 5 ++--- lib/librte_bpf/meson.build | 2 +- lib/librte_kni/meson.build | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-)
v2 cover Enable 32-bit native builds with meson
In reply to Bruce RichardsonThis patchset enables building DPDK on 32-bit systems, and has been tested using debian 32-bit on x86 i.e. doing an "i686" build in the old build system.
v2:
- fixed LIB_LIBRTE_KNI to RTE_LIBRTE_KNI in examples/kni patch [Ferruh]
- added patch to make same change in drivers/net/kni [Ferruh]
Bruce Richardson (8):
kni: disable for 32-bit meson builds
bpf: fix 32-bit build support with meson
net/sfc: disable for 32-bit builds
build: disable pointer to int conversion warnings for 32-bit
dpaa2: fix default IOVA build setting for meson builds examples/kni: fix dependency check for building with meson net/avp: fix 32-bit meson builds
net/kni: fix check for meson build
config/arm/meson.build | 2 +- config/meson.build | 5 +++++ drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/kni/meson.build | 2 +- drivers/net/sfc/meson.build | 2 +- examples/kni/meson.build | 5 ++--- lib/librte_bpf/meson.build | 2 +- lib/librte_kni/meson.build | 2 +- 8 files changed, 13 insertions(+), 9 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/8 kni: disable for 32-bit meson builds
The kni library is not supported on 32-bit so disable it for those builds using meson.
--- lib/librte_kni/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_kni/meson.build +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -if host_machine.system() != 'linux' +if host_machine.system() != 'linux' or cc.sizeof('void *') == 4 build = false endif version = 2
Signature · 1 line
2.17.1
PATCH v2 2/8 bpf: fix 32-bit build support with meson
In reply to Bruce RichardsonThe JIT is only supported on x86_64 so disable for 32-bit builds.
--- lib/librte_bpf/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_bpf/meson.build +1 -1
@@ -8,7 +8,7 @@ sources = files('bpf.c', 'bpf_pkt.c', 'bpf_validate.c') -if arch_subdir == 'x86' +if arch_subdir == 'x86' and cc.sizeof('void *') == 8 sources += files('bpf_jit_x86.c') endif
Signature · 1 line
2.17.1
PATCH v2 3/8 net/sfc: disable for 32-bit builds
In reply to Bruce RichardsonThe sfc driver is not supported on 32-bit so disable in meson in those cases.
--- drivers/net/sfc/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/sfc/meson.build +1 -1
@@ -6,7 +6,7 @@ # This software was jointly developed between OKTET Labs (under contract # for Solarflare) and Solarflare Communications, Inc. -if arch_subdir != 'x86' +if arch_subdir != 'x86' or cc.sizeof('void *') == 4 build = false endif
Signature · 1 line
2.17.1
PATCH v2 4/8 build: disable pointer to int conversion warnings for 32-bit
In reply to Bruce RichardsonConverting a 32-bit pointer to a 64-bit integer is generally safe, but generates a lot of warnings when compiling 32-bit code with meson. The warnings are not flagged when using make, so just disable them for 32-bit meson builds.
--- config/meson.build | 4 ++++ 1 file changed, 4 insertions(+)
config/meson.build +4 -0
@@ -60,6 +60,10 @@ warning_flags = [ '-Wno-address-of-packed-member', '-Wno-format-truncation' ] +if cc.sizeof('void *') == 4 +# for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!! + warning_flags += '-Wno-pointer-to-int-cast' +endif foreach arg: warning_flags if cc.has_argument(arg) add_project_arguments(arg, language: 'c')
Signature · 1 line
2.17.1
PATCH v2 5/8 dpaa2: fix default IOVA build setting for meson builds
In reply to Bruce RichardsonBy default, the DPAA2_USE_PHYS_IOVA setting with the make build-system is "y", which is overridden to "n" in the config file specifically for the arm64-dpaa2-linuxapp-gcc builds. The lack of this setting in meson builds causes issues for 32-bit build, as the alternative code paths have compiler warnings e.g. for i686 builds. Therefore we should align the meson and make settings, setting the value to "true" by default and overriding it to "false" for dpaa2-specific builds.
--- config/arm/meson.build | 2 +- config/meson.build | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
config/arm/meson.build +1 -1
@@ -64,7 +64,7 @@ flags_dpaa2 = [ ['RTE_CACHE_LINE_SIZE', 64], ['RTE_MAX_NUMA_NODES', 1], ['RTE_MAX_LCORE', 16], - ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', 'n']] + ['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]] ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321) impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
config/meson.build +1 -0
@@ -78,6 +78,7 @@ dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id # values which have defaults which may be overridden dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) +dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) compile_time_cpuflags = [] if host_machine.cpu_family().startswith('x86')
Signature · 1 line
2.17.1
PATCH v2 6/8 examples/kni: fix dependency check for building with meson
In reply to Bruce RichardsonRather than hard-coding the example app to be built only when a set of conditions are met, we can simplify things by having the app built when KNI library itself is available. That saves us duplicating the same set of restrictions on both library and example app.
--- examples/kni/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
examples/kni/meson.build +2 -3
@@ -6,9 +6,8 @@ # To build this example as a standalone application with an already-installed # DPDK instance, use 'make' -if host_machine.system() != 'linux' - build = false -endif +# this app can be built if-and-only-if KNI library is buildable +build = dpdk_conf.has('RTE_LIBRTE_KNI') deps += ['kni', 'bus_pci'] sources = files( 'main.c'
Signature · 1 line
2.17.1
Re: [PATCH v2 6/8] examples/kni: fix dependency check for building with meson
Quoted 9 lines · Bruce Richardson
Rather than hard-coding the example app to be built only when a set of conditions are met, we can simplify things by having the app built when KNI library itself is available. That saves us duplicating the same set of restrictions on both library and example app.
Fixes 89f0711f9ddf ("examples: build some samples with meson")Signed-off-by Bruce Richardson <[email protected]>Series-acked-by Hemant Agrawal <[email protected]>
PATCH v2 7/8 net/avp: fix 32-bit meson builds
In reply to Bruce RichardsonWhen compiling with meson, extra warnings are enabled about casting from integers to different size pointers. This triggers an error in AVP as the addition of the offset to the pointer address causes the result to be a 64-bit integer which doesn't fit a 32-bit pointer. The fix here is to explicitly indicate that the offset is of type "uintptr_t" which prevents any promotion which would cause errors.
--- drivers/net/avp/avp_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/avp/avp_ethdev.c +1 -1
@@ -383,7 +383,7 @@ avp_dev_translate_address(struct rte_eth_dev *eth_dev, (host_phys_addr < (map->phys_addr + map->length))) {/* address is within this segment */ offset += (host_phys_addr - map->phys_addr); - addr =RTE_PTR_ADD (addr, offset); + addr =RTE_PTR_ADD (addr, (uintptr_t )offset);PMD_DRV_LOG (DEBUG ,"Translating host physical 0x%" PRIx64" to guest virtual 0x%p\n" , host_phys_addr, addr);
Signature · 1 line
2.17.1
PATCH v2 8/8 net/kni: fix check for meson build
In reply to Bruce RichardsonThe configuration value indicating that KNI was build was incorrect, causing the driver to never be built.
--- drivers/net/kni/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/kni/meson.build +1 -1
@@ -2,7 +2,7 @@ # Copyright(c) 2018 Intel Corporation # this driver can be built if-and-only-if KNI library is buildable -build = dpdk_conf.has('LIB_LIBRTE_KNI') +build = dpdk_conf.has('RTE_LIBRTE_KNI') allow_experimental_apis = true sources = files('rte_eth_kni.c') deps += 'kni'
Signature · 1 line
2.17.1
Re: [PATCH v2 8/8] net/kni: fix check for meson build
Quoted 7 lines · Bruce Richardson
The configuration value indicating that KNI was build was incorrect, causing the driver to never be built.
Fixes 3479586fe636 ("net/kni: add to meson build")Signed-off-by Bruce Richardson <[email protected]>Series-acked-by Hemant Agrawal <[email protected]>
Thomas Monjalon
Applied03/07/2018 12:31, Bruce Richardson:
Quoted 8 lines
This patchset enables building DPDK on 32-bit systems, and has been tested using debian 32-bit on x86 i.e. doing an "i686" build in the old build system.
v2:
- fixedLIB_LIBRTE_KNItoRTE_LIBRTE_KNIin examples/kni patch [Ferruh]
- added patch to make same change indrivers/net/kni[Ferruh]
Quoted 9 lines
Bruce Richardson (8):
kni: disable for 32-bit meson builds
bpf: fix 32-bit build support with meson
net/sfc: disable for 32-bit builds
build: disable pointer to int conversion warnings for 32-bit
dpaa2: fix default IOVA build setting for meson builds examples/kni: fix dependency check for building with meson net/avp: fix 32-bit meson builds
net/kni: fix check for meson build
Applied, thanks