DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH v3 0/4] aarch64 -> arm32 cross compilation support
@ 2020-04-15  9:03 Juraj Linkeš
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson Juraj Linkeš
                   ` (4 more replies)
  0 siblings, 5 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-15  9:03 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Add support for arm32 cross build in meson and add aarch64 -> arm32 cross build to Travis.

The patchset makes use of existing options in config/defconfig_arm-armv7a-linux-gcc a ports those to the meson build system.

Tested here: https://travis-ci.com/github/jlinkes/dpdk/builds/160337737

The aarch64 -> arm32 build currently fails in l3fwd example. The failure is currently being worked on by arm devs.

Juraj Linkeš (4):
  build: port arm32 options from make to meson
  build: add arm32 meson build flags
  build: add arm32 meson cross file
  ci: add aarch64 -> arm32 cross compiling jobs

 .ci/linux-build.sh              |   7 ++-
 .travis.yml                     |  19 ++++++
 config/arm/arm_armv7a_linux_gcc |  17 +++++
 config/arm/meson.build          | 135 ++++++++++++++++++++++------------------
 drivers/net/ark/meson.build     |   6 ++
 drivers/net/avp/meson.build     |   5 ++
 drivers/net/cxgbe/meson.build   |   6 ++
 drivers/net/e1000/meson.build   |   6 ++
 drivers/net/enic/meson.build    |   6 ++
 drivers/net/fm10k/meson.build   |   6 ++
 drivers/net/hinic/meson.build   |   6 ++
 drivers/net/i40e/meson.build    |   6 ++
 drivers/net/ionic/meson.build   |   6 ++
 drivers/net/ixgbe/meson.build   |   6 ++
 drivers/net/qede/meson.build    |   6 ++
 drivers/net/vmxnet3/meson.build |   6 ++
 lib/librte_vhost/meson.build    |   2 +-
 17 files changed, 188 insertions(+), 63 deletions(-)
 create mode 100644 config/arm/arm_armv7a_linux_gcc

-- 
2.11.0


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

* [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-15  9:03 [dpdk-dev] [PATCH v3 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
@ 2020-04-15  9:03 ` Juraj Linkeš
  2020-04-15 11:45   ` Luca Boccassi
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 2/4] build: add arm32 meson build flags Juraj Linkeš
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-15  9:03 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

config/defconfig_arm-armv7a-linux-gcc contains a number of
CONFIG_RTE_LIBRTE_ options. Implement those in applicable meson.build
files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 drivers/net/ark/meson.build     | 6 ++++++
 drivers/net/avp/meson.build     | 5 +++++
 drivers/net/cxgbe/meson.build   | 6 ++++++
 drivers/net/e1000/meson.build   | 6 ++++++
 drivers/net/enic/meson.build    | 6 ++++++
 drivers/net/fm10k/meson.build   | 6 ++++++
 drivers/net/hinic/meson.build   | 6 ++++++
 drivers/net/i40e/meson.build    | 6 ++++++
 drivers/net/ionic/meson.build   | 6 ++++++
 drivers/net/ixgbe/meson.build   | 6 ++++++
 drivers/net/qede/meson.build    | 6 ++++++
 drivers/net/vmxnet3/meson.build | 6 ++++++
 lib/librte_vhost/meson.build    | 2 +-
 13 files changed, 72 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ark/meson.build b/drivers/net/ark/meson.build
index 99151bba1..8a875cc94 100644
--- a/drivers/net/ark/meson.build
+++ b/drivers/net/ark/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 sources = files('ark_ddm.c',
 	'ark_ethdev.c',
 	'ark_ethdev_rx.c',
diff --git a/drivers/net/avp/meson.build b/drivers/net/avp/meson.build
index 793bb185d..f9780ae45 100644
--- a/drivers/net/avp/meson.build
+++ b/drivers/net/avp/meson.build
@@ -4,7 +4,12 @@
 if not is_linux
 	build = false
 	reason = 'only supported on linux'
+elif dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
 endif
+
 allow_experimental_apis = true
 sources = files('avp_ethdev.c')
 install_headers('rte_avp_common.h', 'rte_avp_fifo.h')
diff --git a/drivers/net/cxgbe/meson.build b/drivers/net/cxgbe/meson.build
index 3992aba44..526a64fa2 100644
--- a/drivers/net/cxgbe/meson.build
+++ b/drivers/net/cxgbe/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 sources = files('cxgbe_ethdev.c',
 	'cxgbe_main.c',
 	'cxgbevf_ethdev.c',
diff --git a/drivers/net/e1000/meson.build b/drivers/net/e1000/meson.build
index d0901d377..90cffa7b1 100644
--- a/drivers/net/e1000/meson.build
+++ b/drivers/net/e1000/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 allow_experimental_apis = true
 
 subdir('base')
diff --git a/drivers/net/enic/meson.build b/drivers/net/enic/meson.build
index e5eeb5667..69320757d 100644
--- a/drivers/net/enic/meson.build
+++ b/drivers/net/enic/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cisco Systems, Inc.
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 # Experimental APIs used: rte_intr_ack
 cflags += ['-DALLOW_EXPERIMENTAL_API']
 sources = files(
diff --git a/drivers/net/fm10k/meson.build b/drivers/net/fm10k/meson.build
index 8f6e42392..f74778ae5 100644
--- a/drivers/net/fm10k/meson.build
+++ b/drivers/net/fm10k/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 allow_experimental_apis = true
 
 subdir('base')
diff --git a/drivers/net/hinic/meson.build b/drivers/net/hinic/meson.build
index bc7e24639..f43368793 100644
--- a/drivers/net/hinic/meson.build
+++ b/drivers/net/hinic/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Huawei Technologies Co., Ltd
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 subdir('base')
 objs = [base_objs]
 
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index b01babba1..7ace45951 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 cflags += ['-DPF_DRIVER',
 	'-DVF_DRIVER',
 	'-DINTEGRATED_VF',
diff --git a/drivers/net/ionic/meson.build b/drivers/net/ionic/meson.build
index 1c6362d27..14ba0317b 100644
--- a/drivers/net/ionic/meson.build
+++ b/drivers/net/ionic/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
 # Copyright(c) 2019 Pensando
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 sources = files(
 	'ionic_mac_api.c',
 	'ionic_rx_filter.c',
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index 06cf42a4a..0c8442b8c 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 cflags += ['-DRTE_LIBRTE_IXGBE_BYPASS']
 
 allow_experimental_apis = true
diff --git a/drivers/net/qede/meson.build b/drivers/net/qede/meson.build
index 1755719f0..a357daf50 100644
--- a/drivers/net/qede/meson.build
+++ b/drivers/net/qede/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 allow_experimental_apis = true
 
 subdir('base')
diff --git a/drivers/net/vmxnet3/meson.build b/drivers/net/vmxnet3/meson.build
index a92bd2868..f14318a69 100644
--- a/drivers/net/vmxnet3/meson.build
+++ b/drivers/net/vmxnet3/meson.build
@@ -1,6 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+if dpdk_conf.has('RTE_ARCH_ARMv7')
+	build = false
+	reason = 'Not supported on 32-bit arm'
+	subdir_done()
+endif
+
 allow_experimental_apis = true
 sources += files(
 	'vmxnet3_ethdev.c',
diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
index ef7a5bced..44d8eda53 100644
--- a/lib/librte_vhost/meson.build
+++ b/lib/librte_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 == 1 and not dpdk_conf.has('RTE_ARCH_ARMv7')
 	dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
 if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
-- 
2.11.0


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

* [dpdk-dev] [PATCH v3 2/4] build: add arm32 meson build flags
  2020-04-15  9:03 [dpdk-dev] [PATCH v3 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson Juraj Linkeš
@ 2020-04-15  9:03 ` Juraj Linkeš
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 3/4] build: add arm32 meson cross file Juraj Linkeš
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-15  9:03 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 135 +++++++++++++++++++++++++++----------------------
 1 file changed, 74 insertions(+), 61 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6e75e6d97..746113849 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -34,6 +34,11 @@ flags_generic = [
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
+flags_generic_arm32 = [
+	['RTE_MACHINE', '"armv7a"'],
+	['RTE_MAX_LCORE', 128],
+	['RTE_USE_C11_MEM_MODEL', false],
+	['RTE_CACHE_LINE_SIZE', 64]]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
@@ -63,6 +68,10 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_default_arm32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -99,6 +108,9 @@ machine_args_generic = [
 	['0xd0b', ['-mcpu=cortex-a76']],
 	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
 
+machine_args_generic_arm32 = [
+        ['default_arm32', ['-march=armv7-a', '-mtune=cortex-a9', '-mfpu=neon'], flags_default_arm32_extra]]
+
 machine_args_cavium = [
 	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -114,6 +126,7 @@ machine_args_emag = [
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
+impl_generic_arm32 = ['Generic armv7', flags_generic_arm32, machine_args_generic_arm32]
 impl_0x41 = ['Arm', flags_arm, machine_args_generic]
 impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
 impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
@@ -136,74 +149,74 @@ if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
 else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
+endif
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
-	cmd_output = cmd_generic # Set generic by default
-	machine_args = [] # Clear previous machine args
-	if arm_force_default_march and not meson.is_cross_build()
+machine = []
+machine_args = [] # Clear previous machine args
+cmd_generic = ['generic', '', '', 'default', '']
+cmd_output = cmd_generic # Set generic by default
+if arm_force_default_march and not meson.is_cross_build()
+	machine = impl_generic
+	impl_pn = 'default'
+elif not meson.is_cross_build()
+	# The script returns ['Implementer', 'Variant', 'Architecture',
+	# 'Primary Part number', 'Revision']
+	detect_vendor = find_program(join_paths(
+			meson.current_source_dir(), 'armv8_machine.py'))
+	cmd = run_command(detect_vendor.path())
+	if cmd.returncode() == 0
+		cmd_output = cmd.stdout().to_lower().strip().split(' ')
+	endif
+	# Set to generic if variable is not found
+	machine = get_variable('impl_' + cmd_output[0], ['generic'])
+	if machine[0] == 'generic'
 		machine = impl_generic
-		impl_pn = 'default'
-	elif not meson.is_cross_build()
-		# The script returns ['Implementer', 'Variant', 'Architecture',
-		# 'Primary Part number', 'Revision']
-		detect_vendor = find_program(join_paths(
-				meson.current_source_dir(), 'armv8_machine.py'))
-		cmd = run_command(detect_vendor.path())
-		if cmd.returncode() == 0
-			cmd_output = cmd.stdout().to_lower().strip().split(' ')
-		endif
-		# Set to generic if variable is not found
-		machine = get_variable('impl_' + cmd_output[0], ['generic'])
-		if machine[0] == 'generic'
-			machine = impl_generic
-			cmd_output = cmd_generic
-		endif
-		impl_pn = cmd_output[3]
-		if arm_force_native_march == true
-			impl_pn = 'native'
-		endif
-	else
-		impl_id = meson.get_cross_property('implementor_id', 'generic')
-		impl_pn = meson.get_cross_property('implementor_pn', 'default')
-		machine = get_variable('impl_' + impl_id)
+		cmd_output = cmd_generic
 	endif
-
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common_default
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
-
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
-
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_default_extra)
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
-		endif
-	endforeach
+	impl_pn = cmd_output[3]
+	if arm_force_native_march == true
+		impl_pn = 'native'
+	endif
+else
+	impl_id = meson.get_cross_property('implementor_id', 'generic')
+	impl_pn = meson.get_cross_property('implementor_pn', 'default')
+	machine = get_variable('impl_' + impl_id)
 endif
+
+# Apply Common Defaults. These settings may be overwritten by machine
+# settings later.
+foreach flag: flags_common_default
+	if flag.length() > 0
+		dpdk_conf.set(flag[0], flag[1])
+	endif
+endforeach
+
+message('Implementer : ' + machine[0])
+foreach flag: machine[1]
+	if flag.length() > 0
+		dpdk_conf.set(flag[0], flag[1])
+	endif
+endforeach
+
+foreach marg: machine[2]
+	if marg[0] == impl_pn
+		foreach flag: marg[1]
+			if cc.has_argument(flag)
+				machine_args += flag
+			endif
+		endforeach
+		# Apply any extra machine specific flags.
+		foreach flag: marg.get(2, flags_default_extra)
+			if flag.length() > 0
+				dpdk_conf.set(flag[0], flag[1])
+                                message('Setting flag: @0@: @1@'.format(flag[0], flag[1]))
+			endif
+		endforeach
+	endif
+endforeach
 message(machine_args)
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
-- 
2.11.0


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

* [dpdk-dev] [PATCH v3 3/4] build: add arm32 meson cross file
  2020-04-15  9:03 [dpdk-dev] [PATCH v3 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson Juraj Linkeš
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 2/4] build: add arm32 meson build flags Juraj Linkeš
@ 2020-04-15  9:03 ` Juraj Linkeš
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
  2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-15  9:03 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm_armv7a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm_armv7a_linux_gcc

diff --git a/config/arm/arm_armv7a_linux_gcc b/config/arm/arm_armv7a_linux_gcc
new file mode 100644
index 000000000..39566d2ea
--- /dev/null
+++ b/config/arm/arm_armv7a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'armv7-a'
+endian = 'little'
+
+[properties]
+implementor_id = 'generic_arm32'
+implementor_pn = 'default_arm32'
-- 
2.11.0


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

* [dpdk-dev] [PATCH v3 4/4] ci: add aarch64 -> arm32 cross compiling jobs
  2020-04-15  9:03 [dpdk-dev] [PATCH v3 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
                   ` (2 preceding siblings ...)
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 3/4] build: add arm32 meson cross file Juraj Linkeš
@ 2020-04-15  9:03 ` Juraj Linkeš
  2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-15  9:03 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d500c4c00..991e61d08 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$ARM" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -47,7 +52,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror -Dexamples=all $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if [ "$AARCH64" != "1" ] && [ "$ARM" != "1" ]; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index fd4f79cfc..6bf1d13da 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_packages: &arm_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _libabigail_build_packages: &libabigail_build_packages
   - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
 
@@ -124,6 +128,21 @@ jobs:
         packages:
           - *required_packages
           - *libabigail_build_packages
+  # aarch64 cross-compiling arm jobs
+  - env: DEF_LIB="shared" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
+  - env: DEF_LIB="static" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.11.0


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

* Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson Juraj Linkeš
@ 2020-04-15 11:45   ` Luca Boccassi
  2020-04-16  6:16     ` Juraj Linkeš
  0 siblings, 1 reply; 72+ messages in thread
From: Luca Boccassi @ 2020-04-15 11:45 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev

On Wed, 2020-04-15 at 11:03 +0200, Juraj Linkeš wrote:
> config/defconfig_arm-armv7a-linux-gcc contains a number of
> CONFIG_RTE_LIBRTE_ options. Implement those in applicable meson.build
> files.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  drivers/net/ark/meson.build     | 6 ++++++
>  drivers/net/avp/meson.build     | 5 +++++
>  drivers/net/cxgbe/meson.build   | 6 ++++++
>  drivers/net/e1000/meson.build   | 6 ++++++
>  drivers/net/enic/meson.build    | 6 ++++++
>  drivers/net/fm10k/meson.build   | 6 ++++++
>  drivers/net/hinic/meson.build   | 6 ++++++
>  drivers/net/i40e/meson.build    | 6 ++++++
>  drivers/net/ionic/meson.build   | 6 ++++++
>  drivers/net/ixgbe/meson.build   | 6 ++++++
>  drivers/net/qede/meson.build    | 6 ++++++
>  drivers/net/vmxnet3/meson.build | 6 ++++++
>  lib/librte_vhost/meson.build    | 2 +-
>  13 files changed, 72 insertions(+), 1 deletion(-)

This is disabling a lot of drivers that are building just fine on armv7
at the moment, and thus it is a backward-incomaptible change.

Eg:

https://packages.debian.org/sid/armhf/librte-pmd-cxgbe20.0/filelist

-- 
Luca Boccassi <bluca@debian.org>

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

* Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-15 11:45   ` Luca Boccassi
@ 2020-04-16  6:16     ` Juraj Linkeš
  2020-04-16  8:53       ` Luca Boccassi
  0 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-16  6:16 UTC (permalink / raw)
  To: Luca Boccassi, bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang; +Cc: dev

Hi Luca,

> -----Original Message-----
> From: Luca Boccassi <bluca@debian.org>
> Sent: Wednesday, April 15, 2020 1:45 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> aconole@redhat.com; maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to
> meson
> 
> On Wed, 2020-04-15 at 11:03 +0200, Juraj Linkeš wrote:
> > config/defconfig_arm-armv7a-linux-gcc contains a number of
> > CONFIG_RTE_LIBRTE_ options. Implement those in applicable meson.build
> > files.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  drivers/net/ark/meson.build     | 6 ++++++
> >  drivers/net/avp/meson.build     | 5 +++++
> >  drivers/net/cxgbe/meson.build   | 6 ++++++
> >  drivers/net/e1000/meson.build   | 6 ++++++
> >  drivers/net/enic/meson.build    | 6 ++++++
> >  drivers/net/fm10k/meson.build   | 6 ++++++
> >  drivers/net/hinic/meson.build   | 6 ++++++
> >  drivers/net/i40e/meson.build    | 6 ++++++
> >  drivers/net/ionic/meson.build   | 6 ++++++
> >  drivers/net/ixgbe/meson.build   | 6 ++++++
> >  drivers/net/qede/meson.build    | 6 ++++++
> >  drivers/net/vmxnet3/meson.build | 6 ++++++
> >  lib/librte_vhost/meson.build    | 2 +-
> >  13 files changed, 72 insertions(+), 1 deletion(-)
> 
> This is disabling a lot of drivers that are building just fine on armv7 at the
> moment, and thus it is a backward-incomaptible change.
> 
> Eg:
> 
> https://packages.debian.org/sid/armhf/librte-pmd-cxgbe20.0/filelist
> 
> --
> Luca Boccassi <bluca@debian.org>

I guess that means config/defconfig_arm-armv7a-linux-gcc is outdated? I've tried to build all of the drivers and they build except for ixgbe. Seeing as https://packages.debian.org/sid/armhf/libs/librte-pmd-ixgbe20.0 exists, would disabling ixgbe be also a backwards incompatible change?

Thanks,
Juraj

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

* Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-16  6:16     ` Juraj Linkeš
@ 2020-04-16  8:53       ` Luca Boccassi
  2020-04-16 11:25         ` Juraj Linkeš
  0 siblings, 1 reply; 72+ messages in thread
From: Luca Boccassi @ 2020-04-16  8:53 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev

On Thu, 2020-04-16 at 06:16 +0000, Juraj Linkeš wrote:
> Hi Luca,
> 
> > -----Original Message-----
> > From: Luca Boccassi <bluca@debian.org>
> > Sent: Wednesday, April 15, 2020 1:45 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> > aconole@redhat.com; maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to
> > meson
> > 
> > On Wed, 2020-04-15 at 11:03 +0200, Juraj Linkeš wrote:
> > > config/defconfig_arm-armv7a-linux-gcc contains a number of
> > > CONFIG_RTE_LIBRTE_ options. Implement those in applicable meson.build
> > > files.
> > > 
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  drivers/net/ark/meson.build     | 6 ++++++
> > >  drivers/net/avp/meson.build     | 5 +++++
> > >  drivers/net/cxgbe/meson.build   | 6 ++++++
> > >  drivers/net/e1000/meson.build   | 6 ++++++
> > >  drivers/net/enic/meson.build    | 6 ++++++
> > >  drivers/net/fm10k/meson.build   | 6 ++++++
> > >  drivers/net/hinic/meson.build   | 6 ++++++
> > >  drivers/net/i40e/meson.build    | 6 ++++++
> > >  drivers/net/ionic/meson.build   | 6 ++++++
> > >  drivers/net/ixgbe/meson.build   | 6 ++++++
> > >  drivers/net/qede/meson.build    | 6 ++++++
> > >  drivers/net/vmxnet3/meson.build | 6 ++++++
> > >  lib/librte_vhost/meson.build    | 2 +-
> > >  13 files changed, 72 insertions(+), 1 deletion(-)
> > 
> > This is disabling a lot of drivers that are building just fine on armv7 at the
> > moment, and thus it is a backward-incomaptible change.
> > 
> > Eg:
> > 
> > https://packages.debian.org/sid/armhf/librte-pmd-cxgbe20.0/filelist
> > 
> > --
> > Luca Boccassi <bluca@debian.org>
> 
> I guess that means config/defconfig_arm-armv7a-linux-gcc is outdated? I've tried to build all of the drivers and they build except for ixgbe. Seeing as https://packages.debian.org/sid/armhf/libs/librte-pmd-ixgbe20.0 exists, would disabling ixgbe be also a backwards incompatible change?
> 
> Thanks,
> Juraj

Yes. That defconfig is specific to the deprecated GNU Make build
system, which I haven't used in a long time. I do not know if anybody
keeps it updated.

What is the issue you are seeing with ixgbe?

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

* Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-16  8:53       ` Luca Boccassi
@ 2020-04-16 11:25         ` Juraj Linkeš
  2020-04-16 12:00           ` Luca Boccassi
  0 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-16 11:25 UTC (permalink / raw)
  To: Luca Boccassi, bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang; +Cc: dev



> -----Original Message-----
> From: Luca Boccassi <bluca@debian.org>
> Sent: Thursday, April 16, 2020 10:53 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> aconole@redhat.com; maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to
> meson
> 
> On Thu, 2020-04-16 at 06:16 +0000, Juraj Linkeš wrote:
> > Hi Luca,
> >
> > > -----Original Message-----
> > > From: Luca Boccassi <bluca@debian.org>
> > > Sent: Wednesday, April 15, 2020 1:45 PM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > bruce.richardson@intel.com; aconole@redhat.com;
> > > maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options
> > > from make to meson
> > >
> > > On Wed, 2020-04-15 at 11:03 +0200, Juraj Linkeš wrote:
> > > > config/defconfig_arm-armv7a-linux-gcc contains a number of
> > > > CONFIG_RTE_LIBRTE_ options. Implement those in applicable
> > > > meson.build files.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > ---
> > > >  drivers/net/ark/meson.build     | 6 ++++++
> > > >  drivers/net/avp/meson.build     | 5 +++++
> > > >  drivers/net/cxgbe/meson.build   | 6 ++++++
> > > >  drivers/net/e1000/meson.build   | 6 ++++++
> > > >  drivers/net/enic/meson.build    | 6 ++++++
> > > >  drivers/net/fm10k/meson.build   | 6 ++++++
> > > >  drivers/net/hinic/meson.build   | 6 ++++++
> > > >  drivers/net/i40e/meson.build    | 6 ++++++
> > > >  drivers/net/ionic/meson.build   | 6 ++++++
> > > >  drivers/net/ixgbe/meson.build   | 6 ++++++
> > > >  drivers/net/qede/meson.build    | 6 ++++++
> > > >  drivers/net/vmxnet3/meson.build | 6 ++++++
> > > >  lib/librte_vhost/meson.build    | 2 +-
> > > >  13 files changed, 72 insertions(+), 1 deletion(-)
> > >
> > > This is disabling a lot of drivers that are building just fine on
> > > armv7 at the moment, and thus it is a backward-incomaptible change.
> > >
> > > Eg:
> > >
> > > https://packages.debian.org/sid/armhf/librte-pmd-cxgbe20.0/filelist
> > >
> > > --
> > > Luca Boccassi <bluca@debian.org>
> >
> > I guess that means config/defconfig_arm-armv7a-linux-gcc is outdated? I've
> tried to build all of the drivers and they build except for ixgbe. Seeing as
> https://packages.debian.org/sid/armhf/libs/librte-pmd-ixgbe20.0 exists, would
> disabling ixgbe be also a backwards incompatible change?
> >
> > Thanks,
> > Juraj
> 
> Yes. That defconfig is specific to the deprecated GNU Make build system, which
> I haven't used in a long time. I do not know if anybody keeps it updated.
> 
> What is the issue you are seeing with ixgbe?

There are a lot of issues, please have a look here: https://travis-ci.com/github/jlinkes/dpdk/jobs/319965296#L1932

Juraj

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

* Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-16 11:25         ` Juraj Linkeš
@ 2020-04-16 12:00           ` Luca Boccassi
  2020-04-16 12:22             ` Juraj Linkeš
  0 siblings, 1 reply; 72+ messages in thread
From: Luca Boccassi @ 2020-04-16 12:00 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev

On Thu, 2020-04-16 at 11:25 +0000, Juraj Linkeš wrote:
> > -----Original Message-----
> > From: Luca Boccassi <bluca@debian.org>
> > Sent: Thursday, April 16, 2020 10:53 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> > aconole@redhat.com; maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to
> > meson
> > 
> > On Thu, 2020-04-16 at 06:16 +0000, Juraj Linkeš wrote:
> > > Hi Luca,
> > > 
> > > > -----Original Message-----
> > > > From: Luca Boccassi <bluca@debian.org>
> > > > Sent: Wednesday, April 15, 2020 1:45 PM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > > bruce.richardson@intel.com; aconole@redhat.com;
> > > > maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options
> > > > from make to meson
> > > > 
> > > > On Wed, 2020-04-15 at 11:03 +0200, Juraj Linkeš wrote:
> > > > > config/defconfig_arm-armv7a-linux-gcc contains a number of
> > > > > CONFIG_RTE_LIBRTE_ options. Implement those in applicable
> > > > > meson.build files.
> > > > > 
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > ---
> > > > >  drivers/net/ark/meson.build     | 6 ++++++
> > > > >  drivers/net/avp/meson.build     | 5 +++++
> > > > >  drivers/net/cxgbe/meson.build   | 6 ++++++
> > > > >  drivers/net/e1000/meson.build   | 6 ++++++
> > > > >  drivers/net/enic/meson.build    | 6 ++++++
> > > > >  drivers/net/fm10k/meson.build   | 6 ++++++
> > > > >  drivers/net/hinic/meson.build   | 6 ++++++
> > > > >  drivers/net/i40e/meson.build    | 6 ++++++
> > > > >  drivers/net/ionic/meson.build   | 6 ++++++
> > > > >  drivers/net/ixgbe/meson.build   | 6 ++++++
> > > > >  drivers/net/qede/meson.build    | 6 ++++++
> > > > >  drivers/net/vmxnet3/meson.build | 6 ++++++
> > > > >  lib/librte_vhost/meson.build    | 2 +-
> > > > >  13 files changed, 72 insertions(+), 1 deletion(-)
> > > > 
> > > > This is disabling a lot of drivers that are building just fine on
> > > > armv7 at the moment, and thus it is a backward-incomaptible change.
> > > > 
> > > > Eg:
> > > > 
> > > > https://packages.debian.org/sid/armhf/librte-pmd-cxgbe20.0/filelist
> > > > 
> > > > --
> > > > Luca Boccassi <bluca@debian.org>
> > > 
> > > I guess that means config/defconfig_arm-armv7a-linux-gcc is outdated? I've
> > tried to build all of the drivers and they build except for ixgbe. Seeing as
> > https://packages.debian.org/sid/armhf/libs/librte-pmd-ixgbe20.0 exists, would
> > disabling ixgbe be also a backwards incompatible change?
> > > Thanks,
> > > Juraj
> > 
> > Yes. That defconfig is specific to the deprecated GNU Make build system, which
> > I haven't used in a long time. I do not know if anybody keeps it updated.
> > 
> > What is the issue you are seeing with ixgbe?
> 
> There are a lot of issues, please have a look here: https://travis-ci.com/github/jlinkes/dpdk/jobs/319965296#L1932
> 
> Juraj

Given it worked fine in 19.11, I'd say they are either regressions or
issues in the travis setup itself.

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

* Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-16 12:00           ` Luca Boccassi
@ 2020-04-16 12:22             ` Juraj Linkeš
  2020-04-16 15:11               ` Ruifeng Wang
  0 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-16 12:22 UTC (permalink / raw)
  To: Luca Boccassi, bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang; +Cc: dev



> -----Original Message-----
> From: Luca Boccassi <bluca@debian.org>
> Sent: Thursday, April 16, 2020 2:01 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> aconole@redhat.com; maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to
> meson
> 
> On Thu, 2020-04-16 at 11:25 +0000, Juraj Linkeš wrote:
> > > -----Original Message-----
> > > From: Luca Boccassi <bluca@debian.org>
> > > Sent: Thursday, April 16, 2020 10:53 AM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > bruce.richardson@intel.com; aconole@redhat.com;
> > > maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options
> > > from make to meson
> > >
> > > On Thu, 2020-04-16 at 06:16 +0000, Juraj Linkeš wrote:
> > > > Hi Luca,
> > > >
> > > > > -----Original Message-----
> > > > > From: Luca Boccassi <bluca@debian.org>
> > > > > Sent: Wednesday, April 15, 2020 1:45 PM
> > > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > > > bruce.richardson@intel.com; aconole@redhat.com;
> > > > > maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > > > > Cc: dev@dpdk.org
> > > > > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options
> > > > > from make to meson
> > > > >
> > > > > On Wed, 2020-04-15 at 11:03 +0200, Juraj Linkeš wrote:
> > > > > > config/defconfig_arm-armv7a-linux-gcc contains a number of
> > > > > > CONFIG_RTE_LIBRTE_ options. Implement those in applicable
> > > > > > meson.build files.
> > > > > >
> > > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > > ---
> > > > > >  drivers/net/ark/meson.build     | 6 ++++++
> > > > > >  drivers/net/avp/meson.build     | 5 +++++
> > > > > >  drivers/net/cxgbe/meson.build   | 6 ++++++
> > > > > >  drivers/net/e1000/meson.build   | 6 ++++++
> > > > > >  drivers/net/enic/meson.build    | 6 ++++++
> > > > > >  drivers/net/fm10k/meson.build   | 6 ++++++
> > > > > >  drivers/net/hinic/meson.build   | 6 ++++++
> > > > > >  drivers/net/i40e/meson.build    | 6 ++++++
> > > > > >  drivers/net/ionic/meson.build   | 6 ++++++
> > > > > >  drivers/net/ixgbe/meson.build   | 6 ++++++
> > > > > >  drivers/net/qede/meson.build    | 6 ++++++
> > > > > >  drivers/net/vmxnet3/meson.build | 6 ++++++
> > > > > >  lib/librte_vhost/meson.build    | 2 +-
> > > > > >  13 files changed, 72 insertions(+), 1 deletion(-)
> > > > >
> > > > > This is disabling a lot of drivers that are building just fine
> > > > > on
> > > > > armv7 at the moment, and thus it is a backward-incomaptible change.
> > > > >
> > > > > Eg:
> > > > >
> > > > > https://packages.debian.org/sid/armhf/librte-pmd-cxgbe20.0/filel
> > > > > ist
> > > > >
> > > > > --
> > > > > Luca Boccassi <bluca@debian.org>
> > > >
> > > > I guess that means config/defconfig_arm-armv7a-linux-gcc is
> > > > outdated? I've
> > > tried to build all of the drivers and they build except for ixgbe.
> > > Seeing as
> > > https://packages.debian.org/sid/armhf/libs/librte-pmd-ixgbe20.0
> > > exists, would disabling ixgbe be also a backwards incompatible change?
> > > > Thanks,
> > > > Juraj
> > >
> > > Yes. That defconfig is specific to the deprecated GNU Make build
> > > system, which I haven't used in a long time. I do not know if anybody keeps it
> updated.
> > >
> > > What is the issue you are seeing with ixgbe?
> >
> > There are a lot of issues, please have a look here:
> > https://travis-ci.com/github/jlinkes/dpdk/jobs/319965296#L1932
> >
> > Juraj
> 
> Given it worked fine in 19.11, I'd say they are either regressions or issues in the
> travis setup itself.

I'd wager it's because of https://github.com/DPDK/dpdk/commit/41b059a20215284e8aa618d2ce1e2a803e64c1d0#diff-f44e12b03243963c21a46a37392568db

When I don't build with ixgbe_rxtx_vec_neon.c it builds fine, indicating real problems with the code.

Ruifeng, would you please take a look at the failures here? https://travis-ci.com/github/jlinkes/dpdk/jobs/319965296#L1932

Juraj

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

* Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson
  2020-04-16 12:22             ` Juraj Linkeš
@ 2020-04-16 15:11               ` Ruifeng Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Ruifeng Wang @ 2020-04-16 15:11 UTC (permalink / raw)
  To: Juraj Linkeš,
	Luca Boccassi, bruce.richardson, aconole, maicolgabriel
  Cc: dev, Honnappa Nagarahalli, Gavin Hu, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Thursday, April 16, 2020 8:22 PM
> To: Luca Boccassi <bluca@debian.org>; bruce.richardson@intel.com;
> aconole@redhat.com; maicolgabriel@hotmail.com; Ruifeng Wang
> <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make
> to meson
> 
> 
> 
> > -----Original Message-----
> > From: Luca Boccassi <bluca@debian.org>
> > Sent: Thursday, April 16, 2020 2:01 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > bruce.richardson@intel.com; aconole@redhat.com;
> > maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from
> > make to meson
> >
> > On Thu, 2020-04-16 at 11:25 +0000, Juraj Linkeš wrote:
> > > > -----Original Message-----
> > > > From: Luca Boccassi <bluca@debian.org>
> > > > Sent: Thursday, April 16, 2020 10:53 AM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > > bruce.richardson@intel.com; aconole@redhat.com;
> > > > maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32 options
> > > > from make to meson
> > > >
> > > > On Thu, 2020-04-16 at 06:16 +0000, Juraj Linkeš wrote:
> > > > > Hi Luca,
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Luca Boccassi <bluca@debian.org>
> > > > > > Sent: Wednesday, April 15, 2020 1:45 PM
> > > > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > > > > bruce.richardson@intel.com; aconole@redhat.com;
> > > > > > maicolgabriel@hotmail.com; Ruifeng.Wang@arm.com
> > > > > > Cc: dev@dpdk.org
> > > > > > Subject: Re: [dpdk-dev] [PATCH v3 1/4] build: port arm32
> > > > > > options from make to meson
> > > > > >
> > > > > > On Wed, 2020-04-15 at 11:03 +0200, Juraj Linkeš wrote:
> > > > > > > config/defconfig_arm-armv7a-linux-gcc contains a number of
> > > > > > > CONFIG_RTE_LIBRTE_ options. Implement those in applicable
> > > > > > > meson.build files.
> > > > > > >
> > > > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > > > ---
> > > > > > >  drivers/net/ark/meson.build     | 6 ++++++
> > > > > > >  drivers/net/avp/meson.build     | 5 +++++
> > > > > > >  drivers/net/cxgbe/meson.build   | 6 ++++++
> > > > > > >  drivers/net/e1000/meson.build   | 6 ++++++
> > > > > > >  drivers/net/enic/meson.build    | 6 ++++++
> > > > > > >  drivers/net/fm10k/meson.build   | 6 ++++++
> > > > > > >  drivers/net/hinic/meson.build   | 6 ++++++
> > > > > > >  drivers/net/i40e/meson.build    | 6 ++++++
> > > > > > >  drivers/net/ionic/meson.build   | 6 ++++++
> > > > > > >  drivers/net/ixgbe/meson.build   | 6 ++++++
> > > > > > >  drivers/net/qede/meson.build    | 6 ++++++
> > > > > > >  drivers/net/vmxnet3/meson.build | 6 ++++++
> > > > > > >  lib/librte_vhost/meson.build    | 2 +-
> > > > > > >  13 files changed, 72 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > This is disabling a lot of drivers that are building just fine
> > > > > > on
> > > > > > armv7 at the moment, and thus it is a backward-incomaptible
> change.
> > > > > >
> > > > > > Eg:
> > > > > >
> > > > > > https://packages.debian.org/sid/armhf/librte-pmd-cxgbe20.0/fil
> > > > > > el
> > > > > > ist
> > > > > >
> > > > > > --
> > > > > > Luca Boccassi <bluca@debian.org>
> > > > >
> > > > > I guess that means config/defconfig_arm-armv7a-linux-gcc is
> > > > > outdated? I've
> > > > tried to build all of the drivers and they build except for ixgbe.
> > > > Seeing as
> > > > https://packages.debian.org/sid/armhf/libs/librte-pmd-ixgbe20.0
> > > > exists, would disabling ixgbe be also a backwards incompatible change?
> > > > > Thanks,
> > > > > Juraj
> > > >
> > > > Yes. That defconfig is specific to the deprecated GNU Make build
> > > > system, which I haven't used in a long time. I do not know if
> > > > anybody keeps it
> > updated.
> > > >
> > > > What is the issue you are seeing with ixgbe?
> > >
> > > There are a lot of issues, please have a look here:
> > > https://travis-ci.com/github/jlinkes/dpdk/jobs/319965296#L1932
> > >
> > > Juraj
> >
> > Given it worked fine in 19.11, I'd say they are either regressions or
> > issues in the travis setup itself.
> 
> I'd wager it's because of
> https://github.com/DPDK/dpdk/commit/41b059a20215284e8aa618d2ce1e2a
> 803e64c1d0#diff-f44e12b03243963c21a46a37392568db
> 
> When I don't build with ixgbe_rxtx_vec_neon.c it builds fine, indicating real
> problems with the code.
> 
> Ruifeng, would you please take a look at the failures here? https://travis-
> ci.com/github/jlinkes/dpdk/jobs/319965296#L1932
> 
Yes. I see couple of problems with ixgbe_rxtx_vec_neon.c when building for AArch32. 
I will submit patches to fix these.

Thanks.
/Ruifeng
> Juraj

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

* [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support
  2020-04-15  9:03 [dpdk-dev] [PATCH v3 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
                   ` (3 preceding siblings ...)
  2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
@ 2020-04-29 10:24 ` Juraj Linkeš
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
                     ` (4 more replies)
  4 siblings, 5 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-29 10:24 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Add support for arm32 cross build in meson
and add aarch64 -> arm32 cross build to Travis.

The patchset makes use of existing options in
config/defconfig_arm-armv7a-linux-gcc a ports those to the meson build
system.

The aarch64 -> arm32 build currently fails in l3fwd example and ixgbe
driver without series 9609:
http://patches.dpdk.org/project/dpdk/list/?series=9609

Tested here after rebasing on top of series 9609:
https://travis-ci.com/github/jlinkes/dpdk/builds/162648822

v4:
Removed disabled drivers which actually build on arm32.
Also tested the patchset with series 9609 which fixes underlying
failures.

Juraj Linkeš (4):
  build: disable vhost NUMA for arm32
  build: add arm32 meson build flags
  build: add arm32 meson cross file
  ci: add aarch64 -> arm32 cross compiling jobs

 .ci/linux-build.sh              |   7 +-
 .travis.yml                     |  19 +++++
 config/arm/arm_armv7a_linux_gcc |  17 ++++
 config/arm/meson.build          | 135 +++++++++++++++++---------------
 lib/librte_vhost/meson.build    |   2 +-
 5 files changed, 117 insertions(+), 63 deletions(-)
 create mode 100644 config/arm/arm_armv7a_linux_gcc

-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 1/4] build: disable vhost NUMA for arm32
  2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
@ 2020-04-29 10:24   ` Juraj Linkeš
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 2/4] build: add arm32 meson build flags Juraj Linkeš
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-29 10:24 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

config/defconfig_arm-armv7a-linux-gcc specifies that
RTE_LIBRTE_VHOST_NUMA is not supported on arm32, so disable it in meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 lib/librte_vhost/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
index f80632848..977335c4f 100644
--- a/lib/librte_vhost/meson.build
+++ b/lib/librte_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 == 1 and not dpdk_conf.has('RTE_ARCH_ARMv7')
 	dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
 if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 2/4] build: add arm32 meson build flags
  2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
@ 2020-04-29 10:24   ` Juraj Linkeš
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 3/4] build: add arm32 meson cross file Juraj Linkeš
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-29 10:24 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Base the flags on config/defconfig_arm-armv7a-linuxapp-gcc.
Omit driver flags which can be built on arm32.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 135 ++++++++++++++++++++++-------------------
 1 file changed, 74 insertions(+), 61 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6e75e6d97..746113849 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -34,6 +34,11 @@ flags_generic = [
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
+flags_generic_arm32 = [
+	['RTE_MACHINE', '"armv7a"'],
+	['RTE_MAX_LCORE', 128],
+	['RTE_USE_C11_MEM_MODEL', false],
+	['RTE_CACHE_LINE_SIZE', 64]]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
@@ -63,6 +68,10 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_default_arm32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -99,6 +108,9 @@ machine_args_generic = [
 	['0xd0b', ['-mcpu=cortex-a76']],
 	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
 
+machine_args_generic_arm32 = [
+        ['default_arm32', ['-march=armv7-a', '-mtune=cortex-a9', '-mfpu=neon'], flags_default_arm32_extra]]
+
 machine_args_cavium = [
 	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -114,6 +126,7 @@ machine_args_emag = [
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
+impl_generic_arm32 = ['Generic armv7', flags_generic_arm32, machine_args_generic_arm32]
 impl_0x41 = ['Arm', flags_arm, machine_args_generic]
 impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
 impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
@@ -136,74 +149,74 @@ if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
 else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
+endif
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
-	cmd_output = cmd_generic # Set generic by default
-	machine_args = [] # Clear previous machine args
-	if arm_force_default_march and not meson.is_cross_build()
+machine = []
+machine_args = [] # Clear previous machine args
+cmd_generic = ['generic', '', '', 'default', '']
+cmd_output = cmd_generic # Set generic by default
+if arm_force_default_march and not meson.is_cross_build()
+	machine = impl_generic
+	impl_pn = 'default'
+elif not meson.is_cross_build()
+	# The script returns ['Implementer', 'Variant', 'Architecture',
+	# 'Primary Part number', 'Revision']
+	detect_vendor = find_program(join_paths(
+			meson.current_source_dir(), 'armv8_machine.py'))
+	cmd = run_command(detect_vendor.path())
+	if cmd.returncode() == 0
+		cmd_output = cmd.stdout().to_lower().strip().split(' ')
+	endif
+	# Set to generic if variable is not found
+	machine = get_variable('impl_' + cmd_output[0], ['generic'])
+	if machine[0] == 'generic'
 		machine = impl_generic
-		impl_pn = 'default'
-	elif not meson.is_cross_build()
-		# The script returns ['Implementer', 'Variant', 'Architecture',
-		# 'Primary Part number', 'Revision']
-		detect_vendor = find_program(join_paths(
-				meson.current_source_dir(), 'armv8_machine.py'))
-		cmd = run_command(detect_vendor.path())
-		if cmd.returncode() == 0
-			cmd_output = cmd.stdout().to_lower().strip().split(' ')
-		endif
-		# Set to generic if variable is not found
-		machine = get_variable('impl_' + cmd_output[0], ['generic'])
-		if machine[0] == 'generic'
-			machine = impl_generic
-			cmd_output = cmd_generic
-		endif
-		impl_pn = cmd_output[3]
-		if arm_force_native_march == true
-			impl_pn = 'native'
-		endif
-	else
-		impl_id = meson.get_cross_property('implementor_id', 'generic')
-		impl_pn = meson.get_cross_property('implementor_pn', 'default')
-		machine = get_variable('impl_' + impl_id)
+		cmd_output = cmd_generic
 	endif
-
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common_default
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
-
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
-
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_default_extra)
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
-		endif
-	endforeach
+	impl_pn = cmd_output[3]
+	if arm_force_native_march == true
+		impl_pn = 'native'
+	endif
+else
+	impl_id = meson.get_cross_property('implementor_id', 'generic')
+	impl_pn = meson.get_cross_property('implementor_pn', 'default')
+	machine = get_variable('impl_' + impl_id)
 endif
+
+# Apply Common Defaults. These settings may be overwritten by machine
+# settings later.
+foreach flag: flags_common_default
+	if flag.length() > 0
+		dpdk_conf.set(flag[0], flag[1])
+	endif
+endforeach
+
+message('Implementer : ' + machine[0])
+foreach flag: machine[1]
+	if flag.length() > 0
+		dpdk_conf.set(flag[0], flag[1])
+	endif
+endforeach
+
+foreach marg: machine[2]
+	if marg[0] == impl_pn
+		foreach flag: marg[1]
+			if cc.has_argument(flag)
+				machine_args += flag
+			endif
+		endforeach
+		# Apply any extra machine specific flags.
+		foreach flag: marg.get(2, flags_default_extra)
+			if flag.length() > 0
+				dpdk_conf.set(flag[0], flag[1])
+                                message('Setting flag: @0@: @1@'.format(flag[0], flag[1]))
+			endif
+		endforeach
+	endif
+endforeach
 message(machine_args)
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 3/4] build: add arm32 meson cross file
  2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 2/4] build: add arm32 meson build flags Juraj Linkeš
@ 2020-04-29 10:24   ` Juraj Linkeš
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
  2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-29 10:24 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Use arm-linux-gnueabihf- toolset which comes with standard packages on
most used systems, such as Ubuntu and CentOS.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm_armv7a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm_armv7a_linux_gcc

diff --git a/config/arm/arm_armv7a_linux_gcc b/config/arm/arm_armv7a_linux_gcc
new file mode 100644
index 000000000..39566d2ea
--- /dev/null
+++ b/config/arm/arm_armv7a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'armv7-a'
+endian = 'little'
+
+[properties]
+implementor_id = 'generic_arm32'
+implementor_pn = 'default_arm32'
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs
  2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
                     ` (2 preceding siblings ...)
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 3/4] build: add arm32 meson cross file Juraj Linkeš
@ 2020-04-29 10:24   ` Juraj Linkeš
  2020-05-05 18:56     ` Aaron Conole
  2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  4 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-04-29 10:24 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel, Ruifeng.Wang
  Cc: dev, Juraj Linkeš

Add two jobs (static and shared libs), both building on aarch64 and
producing 32 bit arm binaries. Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..3cc3d8bac 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$ARM" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if [ "$AARCH64" != "1" ] && [ "$ARM" != "1" ]; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index 2d2292ff6..63939d2c5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_packages: &arm_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _libabigail_build_packages: &libabigail_build_packages
   - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
 
@@ -124,6 +128,21 @@ jobs:
         packages:
           - *required_packages
           - *libabigail_build_packages
+  # aarch64 cross-compiling arm jobs
+  - env: DEF_LIB="shared" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
+  - env: DEF_LIB="static" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
@ 2020-05-05 18:56     ` Aaron Conole
  2020-05-11  7:05       ` Juraj Linkeš
  0 siblings, 1 reply; 72+ messages in thread
From: Aaron Conole @ 2020-05-05 18:56 UTC (permalink / raw)
  To: Juraj Linkeš; +Cc: bruce.richardson, maicolgabriel, Ruifeng.Wang, dev

Juraj Linkeš <juraj.linkes@pantheon.tech> writes:

> Add two jobs (static and shared libs), both building on aarch64 and
> producing 32 bit arm binaries. Do not run tests in these jobs.
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .ci/linux-build.sh |  7 ++++++-
>  .travis.yml        | 19 +++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
> index d079801d7..3cc3d8bac 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
>      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
>  fi
>  
> +if [ "$ARM" = "1" ]; then
> +    # convert the arch specifier
> +    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
> +fi
> +
>  if [ "$BUILD_DOCS" = "1" ]; then
>      OPTS="$OPTS -Denable_docs=true"
>  fi
> @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
>  meson build --werror $OPTS
>  ninja -C build
>  
> -if [ "$AARCH64" != "1" ]; then
> +if [ "$AARCH64" != "1" ] && [ "$ARM" != "1" ]; then

Probably we should rewrite this check so that it is affirmative on
x86_64 - since there are outstanding proposals for PPC as well (and I
forsee the check to run test-null.sh getting bigger).  WDYT?

>      devtools/test-null.sh
>  fi
>  
> diff --git a/.travis.yml b/.travis.yml
> index 2d2292ff6..63939d2c5 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
>    - *required_packages
>    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
>  
> +_arm_packages: &arm_packages
> +  - *required_packages
> +  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
> +
>  _libabigail_build_packages: &libabigail_build_packages
>    - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
>  
> @@ -124,6 +128,21 @@ jobs:
>          packages:
>            - *required_packages
>            - *libabigail_build_packages
> +  # aarch64 cross-compiling arm jobs
> +  - env: DEF_LIB="shared" ARM=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_packages
> +  - env: DEF_LIB="static" ARM=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_packages
>    # aarch64 clang jobs
>    - env: DEF_LIB="static"
>      arch: arm64


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

* Re: [dpdk-dev] [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs
  2020-05-05 18:56     ` Aaron Conole
@ 2020-05-11  7:05       ` Juraj Linkeš
  0 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-05-11  7:05 UTC (permalink / raw)
  To: Aaron Conole; +Cc: bruce.richardson, maicolgabriel, Ruifeng.Wang, dev



> -----Original Message-----
> From: Aaron Conole <aconole@redhat.com>
> Sent: Tuesday, May 5, 2020 8:56 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; maicolgabriel@hotmail.com;
> Ruifeng.Wang@arm.com; dev@dpdk.org
> Subject: Re: [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs
> 
> Juraj Linkeš <juraj.linkes@pantheon.tech> writes:
> 
> > Add two jobs (static and shared libs), both building on aarch64 and
> > producing 32 bit arm binaries. Do not run tests in these jobs.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  .ci/linux-build.sh |  7 ++++++-
> >  .travis.yml        | 19 +++++++++++++++++++
> >  2 files changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > d079801d7..3cc3d8bac 100755
> > --- a/.ci/linux-build.sh
> > +++ b/.ci/linux-build.sh
> > @@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
> >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> >  fi
> >
> > +if [ "$ARM" = "1" ]; then
> > +    # convert the arch specifier
> > +    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
> > +fi
> > +
> >  if [ "$BUILD_DOCS" = "1" ]; then
> >      OPTS="$OPTS -Denable_docs=true"
> >  fi
> > @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
> >  meson build --werror $OPTS
> >  ninja -C build
> >
> > -if [ "$AARCH64" != "1" ]; then
> > +if [ "$AARCH64" != "1" ] && [ "$ARM" != "1" ]; then
> 
> Probably we should rewrite this check so that it is affirmative on
> x86_64 - since there are outstanding proposals for PPC as well (and I forsee the
> check to run test-null.sh getting bigger).  WDYT?

Well, my patchset introduces cross compilation from aarch64 -> arm32, so if we only check for x86_64 it would try to run arm32 binaries on aarch64 when doing this cross compilation. Maybe we could do a check using something like file ${testpmd} | grep $(uname -m) in test-null.sh?

> >      devtools/test-null.sh
> >  fi
> >
> > diff --git a/.travis.yml b/.travis.yml index 2d2292ff6..63939d2c5
> > 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
> >    - *required_packages
> >    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross,
> > pkg-config-aarch64-linux-gnu]
> >
> > +_arm_packages: &arm_packages
> > +  - *required_packages
> > +  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross,
> > +pkg-config-arm-linux-gnueabihf]
> > +
> >  _libabigail_build_packages: &libabigail_build_packages
> >    - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
> >
> > @@ -124,6 +128,21 @@ jobs:
> >          packages:
> >            - *required_packages
> >            - *libabigail_build_packages
> > +  # aarch64 cross-compiling arm jobs
> > +  - env: DEF_LIB="shared" ARM=1
> > +    arch: arm64
> > +    compiler: gcc
> > +    addons:
> > +      apt:
> > +        packages:
> > +          - *arm_packages
> > +  - env: DEF_LIB="static" ARM=1
> > +    arch: arm64
> > +    compiler: gcc
> > +    addons:
> > +      apt:
> > +        packages:
> > +          - *arm_packages
> >    # aarch64 clang jobs
> >    - env: DEF_LIB="static"
> >      arch: arm64


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

* [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support
  2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
                     ` (3 preceding siblings ...)
  2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
@ 2020-07-06  8:28   ` Juraj Linkeš
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
                       ` (4 more replies)
  4 siblings, 5 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-07-06  8:28 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, Juraj Linkeš

Add support for arm32 cross build in meson
and add aarch64 -> arm32 cross build to Travis.

The patchset makes use of existing options in
config/defconfig_arm-armv7a-linux-gcc a ports those to the meson build
system.

The aarch64 -> arm32 build currently fails in l3fwd example and ixgbe
driver without series 9609:
http://patches.dpdk.org/project/dpdk/list/?series=9609

Tested here after rebasing on top of series 9609:
https://travis-ci.com/github/jlinkes/dpdk/builds/162648822

v4:
Removed disabled drivers which actually build on arm32.
Also tested the patchset with series 9609 which fixes underlying
failures.

v5:
Changed the condition for running test-null.sh in ci.
Re-uploaded after underlying fixes have been committed.

Juraj Linkeš (4):
  build: disable vhost NUMA for arm32
  build: add arm32 meson build flags
  build: add arm32 meson cross file
  ci: add aarch64 -> arm32 cross compiling jobs

 .ci/linux-build.sh              |   7 +-
 .travis.yml                     |  19 +++++
 config/arm/arm_armv7a_linux_gcc |  17 ++++
 config/arm/meson.build          | 135 +++++++++++++++++---------------
 lib/librte_vhost/meson.build    |   2 +-
 5 files changed, 117 insertions(+), 63 deletions(-)
 create mode 100644 config/arm/arm_armv7a_linux_gcc

-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 1/4] build: disable vhost NUMA for arm32
  2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
@ 2020-07-06  8:28     ` Juraj Linkeš
  2020-07-06  8:56       ` David Marchand
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags Juraj Linkeš
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-07-06  8:28 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, Juraj Linkeš

config/defconfig_arm-armv7a-linux-gcc specifies that
RTE_LIBRTE_VHOST_NUMA is not supported on arm32, so disable it in meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 lib/librte_vhost/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
index 882a0eaf4..73dc05f86 100644
--- a/lib/librte_vhost/meson.build
+++ b/lib/librte_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 == 1 and not dpdk_conf.has('RTE_ARCH_ARMv7')
 	dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
 endif
 if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
  2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
@ 2020-07-06  8:28     ` Juraj Linkeš
  2020-07-06  9:11       ` Jerin Jacob
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 3/4] build: add arm32 meson cross file Juraj Linkeš
                       ` (2 subsequent siblings)
  4 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-07-06  8:28 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, Juraj Linkeš

Base the flags on config/defconfig_arm-armv7a-linuxapp-gcc.
Omit driver flags which can be built on arm32.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 135 ++++++++++++++++++++++-------------------
 1 file changed, 74 insertions(+), 61 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8728051d5..b02fc95d9 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -34,6 +34,11 @@ flags_generic = [
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
+flags_generic_arm32 = [
+	['RTE_MACHINE', '"armv7a"'],
+	['RTE_MAX_LCORE', 128],
+	['RTE_USE_C11_MEM_MODEL', false],
+	['RTE_CACHE_LINE_SIZE', 64]]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
@@ -63,6 +68,10 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_default_arm32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -99,6 +108,9 @@ machine_args_generic = [
 	['0xd0b', ['-mcpu=cortex-a76']],
 	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
 
+machine_args_generic_arm32 = [
+        ['default_arm32', ['-march=armv7-a', '-mtune=cortex-a9', '-mfpu=neon'], flags_default_arm32_extra]]
+
 machine_args_cavium = [
 	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -114,6 +126,7 @@ machine_args_emag = [
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
+impl_generic_arm32 = ['Generic armv7', flags_generic_arm32, machine_args_generic_arm32]
 impl_0x41 = ['Arm', flags_arm, machine_args_generic]
 impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
 impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
@@ -136,74 +149,74 @@ if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
 else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
+endif
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
-	cmd_output = cmd_generic # Set generic by default
-	machine_args = [] # Clear previous machine args
-	if arm_force_default_march and not meson.is_cross_build()
+machine = []
+machine_args = [] # Clear previous machine args
+cmd_generic = ['generic', '', '', 'default', '']
+cmd_output = cmd_generic # Set generic by default
+if arm_force_default_march and not meson.is_cross_build()
+	machine = impl_generic
+	impl_pn = 'default'
+elif not meson.is_cross_build()
+	# The script returns ['Implementer', 'Variant', 'Architecture',
+	# 'Primary Part number', 'Revision']
+	detect_vendor = find_program(join_paths(
+			meson.current_source_dir(), 'armv8_machine.py'))
+	cmd = run_command(detect_vendor.path())
+	if cmd.returncode() == 0
+		cmd_output = cmd.stdout().to_lower().strip().split(' ')
+	endif
+	# Set to generic if variable is not found
+	machine = get_variable('impl_' + cmd_output[0], ['generic'])
+	if machine[0] == 'generic'
 		machine = impl_generic
-		impl_pn = 'default'
-	elif not meson.is_cross_build()
-		# The script returns ['Implementer', 'Variant', 'Architecture',
-		# 'Primary Part number', 'Revision']
-		detect_vendor = find_program(join_paths(
-				meson.current_source_dir(), 'armv8_machine.py'))
-		cmd = run_command(detect_vendor.path())
-		if cmd.returncode() == 0
-			cmd_output = cmd.stdout().to_lower().strip().split(' ')
-		endif
-		# Set to generic if variable is not found
-		machine = get_variable('impl_' + cmd_output[0], ['generic'])
-		if machine[0] == 'generic'
-			machine = impl_generic
-			cmd_output = cmd_generic
-		endif
-		impl_pn = cmd_output[3]
-		if arm_force_native_march == true
-			impl_pn = 'native'
-		endif
-	else
-		impl_id = meson.get_cross_property('implementor_id', 'generic')
-		impl_pn = meson.get_cross_property('implementor_pn', 'default')
-		machine = get_variable('impl_' + impl_id)
+		cmd_output = cmd_generic
 	endif
-
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common_default
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
-
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
-
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_default_extra)
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
-		endif
-	endforeach
+	impl_pn = cmd_output[3]
+	if arm_force_native_march == true
+		impl_pn = 'native'
+	endif
+else
+	impl_id = meson.get_cross_property('implementor_id', 'generic')
+	impl_pn = meson.get_cross_property('implementor_pn', 'default')
+	machine = get_variable('impl_' + impl_id)
 endif
+
+# Apply Common Defaults. These settings may be overwritten by machine
+# settings later.
+foreach flag: flags_common_default
+	if flag.length() > 0
+		dpdk_conf.set(flag[0], flag[1])
+	endif
+endforeach
+
+message('Implementer : ' + machine[0])
+foreach flag: machine[1]
+	if flag.length() > 0
+		dpdk_conf.set(flag[0], flag[1])
+	endif
+endforeach
+
+foreach marg: machine[2]
+	if marg[0] == impl_pn
+		foreach flag: marg[1]
+			if cc.has_argument(flag)
+				machine_args += flag
+			endif
+		endforeach
+		# Apply any extra machine specific flags.
+		foreach flag: marg.get(2, flags_default_extra)
+			if flag.length() > 0
+				dpdk_conf.set(flag[0], flag[1])
+                                message('Setting flag: @0@: @1@'.format(flag[0], flag[1]))
+			endif
+		endforeach
+	endif
+endforeach
 message(machine_args)
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 3/4] build: add arm32 meson cross file
  2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags Juraj Linkeš
@ 2020-07-06  8:28     ` Juraj Linkeš
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-07-06  8:28 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, Juraj Linkeš

Use arm-linux-gnueabihf- toolset which comes with standard packages on
most used systems, such as Ubuntu and CentOS.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm_armv7a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm_armv7a_linux_gcc

diff --git a/config/arm/arm_armv7a_linux_gcc b/config/arm/arm_armv7a_linux_gcc
new file mode 100644
index 000000000..39566d2ea
--- /dev/null
+++ b/config/arm/arm_armv7a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'arm'
+cpu = 'armv7-a'
+endian = 'little'
+
+[properties]
+implementor_id = 'generic_arm32'
+implementor_pn = 'default_arm32'
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs
  2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
                       ` (2 preceding siblings ...)
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 3/4] build: add arm32 meson cross file Juraj Linkeš
@ 2020-07-06  8:28     ` Juraj Linkeš
  2020-07-06  9:11       ` Juraj Linkeš
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  4 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-07-06  8:28 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, Juraj Linkeš

Add two jobs (static and shared libs), both building on aarch64 and
producing 32 bit arm binaries. Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..e5407fb37 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$ARM" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if [ "$(uname -m)" = "x86_64" ]; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index 14f812423..baba29539 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_packages: &arm_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _libabigail_build_packages: &libabigail_build_packages
   - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
 
@@ -124,6 +128,21 @@ jobs:
         packages:
           - *required_packages
           - *libabigail_build_packages
+  # aarch64 cross-compiling arm jobs
+  - env: DEF_LIB="shared" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
+  - env: DEF_LIB="static" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v5 1/4] build: disable vhost NUMA for arm32
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
@ 2020-07-06  8:56       ` David Marchand
  0 siblings, 0 replies; 72+ messages in thread
From: David Marchand @ 2020-07-06  8:56 UTC (permalink / raw)
  To: Juraj Linkeš, Bruce Richardson; +Cc: Aaron Conole, Michael Santana, dev

On Mon, Jul 6, 2020 at 10:29 AM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
> config/defconfig_arm-armv7a-linux-gcc specifies that
> RTE_LIBRTE_VHOST_NUMA is not supported on arm32, so disable it in meson.
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  lib/librte_vhost/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
> index 882a0eaf4..73dc05f86 100644
> --- a/lib/librte_vhost/meson.build
> +++ b/lib/librte_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 == 1 and not dpdk_conf.has('RTE_ARCH_ARMv7')

Is the libnuma detection invalid in the first place?


>         dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
>  endif
>  if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> --
> 2.20.1
>


-- 
David Marchand


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

* Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags Juraj Linkeš
@ 2020-07-06  9:11       ` Jerin Jacob
  2020-07-07 20:44         ` Honnappa Nagarahalli
  0 siblings, 1 reply; 72+ messages in thread
From: Jerin Jacob @ 2020-07-06  9:11 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Richardson, Bruce, Aaron Conole, Michael Santana, dpdk-dev

On Mon, Jul 6, 2020 at 1:59 PM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
> Base the flags on config/defconfig_arm-armv7a-linuxapp-gcc.
> Omit driver flags which can be built on arm32.
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>

Hi Juraj,

Not strictly specific to this patch. Just to understand, How armv7
support has been used?
- Is it for Running arm32 program on arm64 machines?
- Is it for Native DPDK support from arm32. If so, What kind of PMD
supports native arm32 DPDK?

Or some other use case?

I would like to understand the arm32 use case, so we can review it at
that angle.

> ---
>  config/arm/meson.build | 135 ++++++++++++++++++++++-------------------
>  1 file changed, 74 insertions(+), 61 deletions(-)
>
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 8728051d5..b02fc95d9 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -34,6 +34,11 @@ flags_generic = [
>         ['RTE_MAX_LCORE', 256],
>         ['RTE_USE_C11_MEM_MODEL', true],
>         ['RTE_CACHE_LINE_SIZE', 128]]
> +flags_generic_arm32 = [
> +       ['RTE_MACHINE', '"armv7a"'],
> +       ['RTE_MAX_LCORE', 128],
> +       ['RTE_USE_C11_MEM_MODEL', false],
> +       ['RTE_CACHE_LINE_SIZE', 64]]
>  flags_arm = [
>         ['RTE_MACHINE', '"armv8a"'],
>         ['RTE_MAX_LCORE', 16],
> @@ -63,6 +68,10 @@ flags_armada = [
>         ['RTE_MAX_LCORE', 16]]
>
>  flags_default_extra = []
> +flags_default_arm32_extra = [
> +        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
> +        ['RTE_ARCH_STRICT_ALIGN', true],
> +        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false]]
>  flags_n1sdp_extra = [
>         ['RTE_MACHINE', '"n1sdp"'],
>         ['RTE_MAX_NUMA_NODES', 1],
> @@ -99,6 +108,9 @@ machine_args_generic = [
>         ['0xd0b', ['-mcpu=cortex-a76']],
>         ['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
>
> +machine_args_generic_arm32 = [
> +        ['default_arm32', ['-march=armv7-a', '-mtune=cortex-a9', '-mfpu=neon'], flags_default_arm32_extra]]
> +
>  machine_args_cavium = [
>         ['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
>         ['native', ['-march=native']],
> @@ -114,6 +126,7 @@ machine_args_emag = [
>
>  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
>  impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
> +impl_generic_arm32 = ['Generic armv7', flags_generic_arm32, machine_args_generic_arm32]
>  impl_0x41 = ['Arm', flags_arm, machine_args_generic]
>  impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
>  impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> @@ -136,74 +149,74 @@ if not dpdk_conf.get('RTE_ARCH_64')
>         dpdk_conf.set('RTE_ARCH_ARMv7', 1)
>         # the minimum architecture supported, armv7-a, needs the following,
>         # mk/machine/armv7a/rte.vars.mk sets it too
> -       machine_args += '-mfpu=neon'
>  else
>         dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
>         dpdk_conf.set('RTE_ARCH_ARM64', 1)
> +endif
>
> -       machine = []
> -       cmd_generic = ['generic', '', '', 'default', '']
> -       cmd_output = cmd_generic # Set generic by default
> -       machine_args = [] # Clear previous machine args
> -       if arm_force_default_march and not meson.is_cross_build()
> +machine = []
> +machine_args = [] # Clear previous machine args
> +cmd_generic = ['generic', '', '', 'default', '']
> +cmd_output = cmd_generic # Set generic by default
> +if arm_force_default_march and not meson.is_cross_build()
> +       machine = impl_generic
> +       impl_pn = 'default'
> +elif not meson.is_cross_build()
> +       # The script returns ['Implementer', 'Variant', 'Architecture',
> +       # 'Primary Part number', 'Revision']
> +       detect_vendor = find_program(join_paths(
> +                       meson.current_source_dir(), 'armv8_machine.py'))
> +       cmd = run_command(detect_vendor.path())
> +       if cmd.returncode() == 0
> +               cmd_output = cmd.stdout().to_lower().strip().split(' ')
> +       endif
> +       # Set to generic if variable is not found
> +       machine = get_variable('impl_' + cmd_output[0], ['generic'])
> +       if machine[0] == 'generic'
>                 machine = impl_generic
> -               impl_pn = 'default'
> -       elif not meson.is_cross_build()
> -               # The script returns ['Implementer', 'Variant', 'Architecture',
> -               # 'Primary Part number', 'Revision']
> -               detect_vendor = find_program(join_paths(
> -                               meson.current_source_dir(), 'armv8_machine.py'))
> -               cmd = run_command(detect_vendor.path())
> -               if cmd.returncode() == 0
> -                       cmd_output = cmd.stdout().to_lower().strip().split(' ')
> -               endif
> -               # Set to generic if variable is not found
> -               machine = get_variable('impl_' + cmd_output[0], ['generic'])
> -               if machine[0] == 'generic'
> -                       machine = impl_generic
> -                       cmd_output = cmd_generic
> -               endif
> -               impl_pn = cmd_output[3]
> -               if arm_force_native_march == true
> -                       impl_pn = 'native'
> -               endif
> -       else
> -               impl_id = meson.get_cross_property('implementor_id', 'generic')
> -               impl_pn = meson.get_cross_property('implementor_pn', 'default')
> -               machine = get_variable('impl_' + impl_id)
> +               cmd_output = cmd_generic
>         endif
> -
> -       # Apply Common Defaults. These settings may be overwritten by machine
> -       # settings later.
> -       foreach flag: flags_common_default
> -               if flag.length() > 0
> -                       dpdk_conf.set(flag[0], flag[1])
> -               endif
> -       endforeach
> -
> -       message('Implementer : ' + machine[0])
> -       foreach flag: machine[1]
> -               if flag.length() > 0
> -                       dpdk_conf.set(flag[0], flag[1])
> -               endif
> -       endforeach
> -
> -       foreach marg: machine[2]
> -               if marg[0] == impl_pn
> -                       foreach flag: marg[1]
> -                               if cc.has_argument(flag)
> -                                       machine_args += flag
> -                               endif
> -                       endforeach
> -                       # Apply any extra machine specific flags.
> -                       foreach flag: marg.get(2, flags_default_extra)
> -                               if flag.length() > 0
> -                                       dpdk_conf.set(flag[0], flag[1])
> -                               endif
> -                       endforeach
> -               endif
> -       endforeach
> +       impl_pn = cmd_output[3]
> +       if arm_force_native_march == true
> +               impl_pn = 'native'
> +       endif
> +else
> +       impl_id = meson.get_cross_property('implementor_id', 'generic')
> +       impl_pn = meson.get_cross_property('implementor_pn', 'default')
> +       machine = get_variable('impl_' + impl_id)
>  endif
> +
> +# Apply Common Defaults. These settings may be overwritten by machine
> +# settings later.
> +foreach flag: flags_common_default
> +       if flag.length() > 0
> +               dpdk_conf.set(flag[0], flag[1])
> +       endif
> +endforeach
> +
> +message('Implementer : ' + machine[0])
> +foreach flag: machine[1]
> +       if flag.length() > 0
> +               dpdk_conf.set(flag[0], flag[1])
> +       endif
> +endforeach
> +
> +foreach marg: machine[2]
> +       if marg[0] == impl_pn
> +               foreach flag: marg[1]
> +                       if cc.has_argument(flag)
> +                               machine_args += flag
> +                       endif
> +               endforeach
> +               # Apply any extra machine specific flags.
> +               foreach flag: marg.get(2, flags_default_extra)
> +                       if flag.length() > 0
> +                               dpdk_conf.set(flag[0], flag[1])
> +                                message('Setting flag: @0@: @1@'.format(flag[0], flag[1]))
> +                       endif
> +               endforeach
> +       endif
> +endforeach
>  message(machine_args)
>
>  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> --
> 2.20.1
>

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

* Re: [dpdk-dev] [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
@ 2020-07-06  9:11       ` Juraj Linkeš
  0 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-07-06  9:11 UTC (permalink / raw)
  To: Juraj Linkeš, bruce.richardson, aconole, maicolgabriel; +Cc: dev



> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Monday, July 6, 2020 10:28 AM
> To: bruce.richardson@intel.com; aconole@redhat.com;
> maicolgabriel@hotmail.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs
> 
> Add two jobs (static and shared libs), both building on aarch64 and producing 32
> bit arm binaries. Do not run tests in these jobs.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .ci/linux-build.sh |  7 ++++++-
>  .travis.yml        | 19 +++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index d079801d7..e5407fb37
> 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
>      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
>  fi
> 
> +if [ "$ARM" = "1" ]; then
> +    # convert the arch specifier
> +    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
> +fi
> +
>  if [ "$BUILD_DOCS" = "1" ]; then
>      OPTS="$OPTS -Denable_docs=true"
>  fi
> @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
>  meson build --werror $OPTS
>  ninja -C build
> 
> -if [ "$AARCH64" != "1" ]; then
> +if [ "$(uname -m)" = "x86_64" ]; then
>      devtools/test-null.sh
>  fi
> 

Now that I think about this a bit more, shouldn't this check be "if this is a native build, run test-null.sh?". If so, should we do something like this?
if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname -m)"; then
    devtools/test-null.sh
fi

The sed is there because file returns x86-64 and uname returns x86_64.

What do you think?

> diff --git a/.travis.yml b/.travis.yml
> index 14f812423..baba29539 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
>    - *required_packages
>    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-
> gnu]
> 
> +_arm_packages: &arm_packages
> +  - *required_packages
> +  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross,
> +pkg-config-arm-linux-gnueabihf]
> +
>  _libabigail_build_packages: &libabigail_build_packages
>    - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
> 
> @@ -124,6 +128,21 @@ jobs:
>          packages:
>            - *required_packages
>            - *libabigail_build_packages
> +  # aarch64 cross-compiling arm jobs
> +  - env: DEF_LIB="shared" ARM=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_packages
> +  - env: DEF_LIB="static" ARM=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_packages
>    # aarch64 clang jobs
>    - env: DEF_LIB="static"
>      arch: arm64
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
  2020-07-06  9:11       ` Jerin Jacob
@ 2020-07-07 20:44         ` Honnappa Nagarahalli
  2020-07-08  8:33           ` Jerin Jacob
  0 siblings, 1 reply; 72+ messages in thread
From: Honnappa Nagarahalli @ 2020-07-07 20:44 UTC (permalink / raw)
  To: Jerin Jacob, Juraj Linkeš
  Cc: Richardson, Bruce, Aaron Conole, Michael Santana, dpdk-dev, nd,
	Honnappa Nagarahalli, Phil Yang, Ruifeng Wang, nd

<snip>

> Subject: Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
> 
> On Mon, Jul 6, 2020 at 1:59 PM Juraj Linkeš <juraj.linkes@pantheon.tech>
> wrote:
> >
> > Base the flags on config/defconfig_arm-armv7a-linuxapp-gcc.
> > Omit driver flags which can be built on arm32.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> 
> Hi Juraj,
> 
> Not strictly specific to this patch. Just to understand, How armv7 support has
> been used?
I do not know how armv7 support is being used. I have not heard of anything so far.

In this patch arm32 is actually referring to aarch32.

> - Is it for Running arm32 program on arm64 machines?
I am not sure if anyone would run armv7 binaries on arm64 machines. I would think they will at least go through a re-compilation (to aarch32) and test phase.

> - Is it for Native DPDK support from arm32. If so, What kind of PMD supports
> native arm32 DPDK?
Yes, this is for DPDK on aarch32 support. We do not have any plans to enable any PMD for aarch32. The current goal is to make sure that the code compiles for aarch32. Internally, we have validated few test cases for the libraries.

> 
> Or some other use case?
> 
> I would like to understand the arm32 use case, so we can review it at that
> angle.

I believe armv7a compilation is not supported in meson. Do you have any thoughts? Do you plan to maintain the support for armv7a?

> 
> > ---
> >  config/arm/meson.build | 135
> > ++++++++++++++++++++++-------------------
> >  1 file changed, 74 insertions(+), 61 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 8728051d5..b02fc95d9 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -34,6 +34,11 @@ flags_generic = [
> >         ['RTE_MAX_LCORE', 256],
> >         ['RTE_USE_C11_MEM_MODEL', true],
> >         ['RTE_CACHE_LINE_SIZE', 128]]
> > +flags_generic_arm32 = [
> > +       ['RTE_MACHINE', '"armv7a"'],
> > +       ['RTE_MAX_LCORE', 128],
> > +       ['RTE_USE_C11_MEM_MODEL', false],
> > +       ['RTE_CACHE_LINE_SIZE', 64]]
> >  flags_arm = [
> >         ['RTE_MACHINE', '"armv8a"'],
> >         ['RTE_MAX_LCORE', 16],
> > @@ -63,6 +68,10 @@ flags_armada = [
> >         ['RTE_MAX_LCORE', 16]]
> >
> >  flags_default_extra = []
> > +flags_default_arm32_extra = [
> > +        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
> > +        ['RTE_ARCH_STRICT_ALIGN', true],
> > +        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false]]
> >  flags_n1sdp_extra = [
> >         ['RTE_MACHINE', '"n1sdp"'],
> >         ['RTE_MAX_NUMA_NODES', 1],
> > @@ -99,6 +108,9 @@ machine_args_generic = [
> >         ['0xd0b', ['-mcpu=cortex-a76']],
> >         ['0xd0c', ['-march=armv8.2-a+crc+crypto',
> > '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
> >
> > +machine_args_generic_arm32 = [
> > +        ['default_arm32', ['-march=armv7-a', '-mtune=cortex-a9',
> > +'-mfpu=neon'], flags_default_arm32_extra]]
> > +
> >  machine_args_cavium = [
> >         ['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> >         ['native', ['-march=native']], @@ -114,6 +126,7 @@
> > machine_args_emag = [
> >
> >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > G7-5321)  impl_generic = ['Generic armv8', flags_generic,
> > machine_args_generic]
> > +impl_generic_arm32 = ['Generic armv7', flags_generic_arm32,
> > +machine_args_generic_arm32]
> >  impl_0x41 = ['Arm', flags_arm, machine_args_generic]
> >  impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
> >  impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium] @@ -136,74
> > +149,74 @@ if not dpdk_conf.get('RTE_ARCH_64')
> >         dpdk_conf.set('RTE_ARCH_ARMv7', 1)
> >         # the minimum architecture supported, armv7-a, needs the following,
> >         # mk/machine/armv7a/rte.vars.mk sets it too
> > -       machine_args += '-mfpu=neon'
> >  else
> >         dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
> >         dpdk_conf.set('RTE_ARCH_ARM64', 1)
> > +endif
> >
> > -       machine = []
> > -       cmd_generic = ['generic', '', '', 'default', '']
> > -       cmd_output = cmd_generic # Set generic by default
> > -       machine_args = [] # Clear previous machine args
> > -       if arm_force_default_march and not meson.is_cross_build()
> > +machine = []
> > +machine_args = [] # Clear previous machine args cmd_generic =
> > +['generic', '', '', 'default', ''] cmd_output = cmd_generic # Set
> > +generic by default if arm_force_default_march and not
> > +meson.is_cross_build()
> > +       machine = impl_generic
> > +       impl_pn = 'default'
> > +elif not meson.is_cross_build()
> > +       # The script returns ['Implementer', 'Variant', 'Architecture',
> > +       # 'Primary Part number', 'Revision']
> > +       detect_vendor = find_program(join_paths(
> > +                       meson.current_source_dir(), 'armv8_machine.py'))
> > +       cmd = run_command(detect_vendor.path())
> > +       if cmd.returncode() == 0
> > +               cmd_output = cmd.stdout().to_lower().strip().split(' ')
> > +       endif
> > +       # Set to generic if variable is not found
> > +       machine = get_variable('impl_' + cmd_output[0], ['generic'])
> > +       if machine[0] == 'generic'
> >                 machine = impl_generic
> > -               impl_pn = 'default'
> > -       elif not meson.is_cross_build()
> > -               # The script returns ['Implementer', 'Variant', 'Architecture',
> > -               # 'Primary Part number', 'Revision']
> > -               detect_vendor = find_program(join_paths(
> > -                               meson.current_source_dir(), 'armv8_machine.py'))
> > -               cmd = run_command(detect_vendor.path())
> > -               if cmd.returncode() == 0
> > -                       cmd_output = cmd.stdout().to_lower().strip().split(' ')
> > -               endif
> > -               # Set to generic if variable is not found
> > -               machine = get_variable('impl_' + cmd_output[0], ['generic'])
> > -               if machine[0] == 'generic'
> > -                       machine = impl_generic
> > -                       cmd_output = cmd_generic
> > -               endif
> > -               impl_pn = cmd_output[3]
> > -               if arm_force_native_march == true
> > -                       impl_pn = 'native'
> > -               endif
> > -       else
> > -               impl_id = meson.get_cross_property('implementor_id', 'generic')
> > -               impl_pn = meson.get_cross_property('implementor_pn', 'default')
> > -               machine = get_variable('impl_' + impl_id)
> > +               cmd_output = cmd_generic
> >         endif
> > -
> > -       # Apply Common Defaults. These settings may be overwritten by
> machine
> > -       # settings later.
> > -       foreach flag: flags_common_default
> > -               if flag.length() > 0
> > -                       dpdk_conf.set(flag[0], flag[1])
> > -               endif
> > -       endforeach
> > -
> > -       message('Implementer : ' + machine[0])
> > -       foreach flag: machine[1]
> > -               if flag.length() > 0
> > -                       dpdk_conf.set(flag[0], flag[1])
> > -               endif
> > -       endforeach
> > -
> > -       foreach marg: machine[2]
> > -               if marg[0] == impl_pn
> > -                       foreach flag: marg[1]
> > -                               if cc.has_argument(flag)
> > -                                       machine_args += flag
> > -                               endif
> > -                       endforeach
> > -                       # Apply any extra machine specific flags.
> > -                       foreach flag: marg.get(2, flags_default_extra)
> > -                               if flag.length() > 0
> > -                                       dpdk_conf.set(flag[0], flag[1])
> > -                               endif
> > -                       endforeach
> > -               endif
> > -       endforeach
> > +       impl_pn = cmd_output[3]
> > +       if arm_force_native_march == true
> > +               impl_pn = 'native'
> > +       endif
> > +else
> > +       impl_id = meson.get_cross_property('implementor_id', 'generic')
> > +       impl_pn = meson.get_cross_property('implementor_pn', 'default')
> > +       machine = get_variable('impl_' + impl_id)
> >  endif
> > +
> > +# Apply Common Defaults. These settings may be overwritten by machine
> > +# settings later.
> > +foreach flag: flags_common_default
> > +       if flag.length() > 0
> > +               dpdk_conf.set(flag[0], flag[1])
> > +       endif
> > +endforeach
> > +
> > +message('Implementer : ' + machine[0]) foreach flag: machine[1]
> > +       if flag.length() > 0
> > +               dpdk_conf.set(flag[0], flag[1])
> > +       endif
> > +endforeach
> > +
> > +foreach marg: machine[2]
> > +       if marg[0] == impl_pn
> > +               foreach flag: marg[1]
> > +                       if cc.has_argument(flag)
> > +                               machine_args += flag
> > +                       endif
> > +               endforeach
> > +               # Apply any extra machine specific flags.
> > +               foreach flag: marg.get(2, flags_default_extra)
> > +                       if flag.length() > 0
> > +                               dpdk_conf.set(flag[0], flag[1])
> > +                                message('Setting flag: @0@: @1@'.format(flag[0],
> flag[1]))
> > +                       endif
> > +               endforeach
> > +       endif
> > +endforeach
> >  message(machine_args)
> >
> >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > --
> > 2.20.1
> >

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

* Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
  2020-07-07 20:44         ` Honnappa Nagarahalli
@ 2020-07-08  8:33           ` Jerin Jacob
  2020-07-08 20:55             ` Honnappa Nagarahalli
  0 siblings, 1 reply; 72+ messages in thread
From: Jerin Jacob @ 2020-07-08  8:33 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	Richardson, Bruce, Aaron Conole, Michael Santana, dpdk-dev, nd,
	Phil Yang, Ruifeng Wang, Jan Viktorin

On Wed, Jul 8, 2020 at 2:14 AM Honnappa Nagarahalli
<Honnappa.Nagarahalli@arm.com> wrote:
>
> <snip>
>
> > Subject: Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
> >
> > On Mon, Jul 6, 2020 at 1:59 PM Juraj Linkeš <juraj.linkes@pantheon.tech>
> > wrote:
> > >
> > > Base the flags on config/defconfig_arm-armv7a-linuxapp-gcc.
> > > Omit driver flags which can be built on arm32.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> >
> > Hi Juraj,
> >
> > Not strictly specific to this patch. Just to understand, How armv7 support has
> > been used?
> I do not know how armv7 support is being used. I have not heard of anything so far.
>
> In this patch arm32 is actually referring to aarch32.
>
> > - Is it for Running arm32 program on arm64 machines?
> I am not sure if anyone would run armv7 binaries on arm64 machines. I would think they will at least go through a re-compilation (to aarch32) and test phase.
>
> > - Is it for Native DPDK support from arm32. If so, What kind of PMD supports
> > native arm32 DPDK?
> Yes, this is for DPDK on aarch32 support. We do not have any plans to enable any PMD for aarch32. The current goal is to make sure that the code compiles for aarch32. Internally, we have validated few test cases for the libraries.

One thing is lack of PMD support and other is lack  PCI HW support for
armv7 machines in general.


>
> >
> > Or some other use case?
> >
> > I would like to understand the arm32 use case, so we can review it at that
> > angle.
>
> I believe armv7a compilation is not supported in meson. Do you have any thoughts? Do you plan to maintain the support for armv7a?

Armv7 is maintained by:
ARM v7
M: Jan Viktorin <viktorin@rehivetech.com>
M: Ruifeng Wang <ruifeng.wang@arm.com>
F: lib/librte_eal/arm/

My only concern is if there is no REAL use case for armv7 in DPDK, May
it is not worth to add a lot of code and make it complicated for
arm64.
At a minimum, If we are planning to add armv7 support then please
split config/arm/meson.build file as two for arm64 and armv7.

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

* Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
  2020-07-08  8:33           ` Jerin Jacob
@ 2020-07-08 20:55             ` Honnappa Nagarahalli
  2020-07-09  4:49               ` Jerin Jacob
  0 siblings, 1 reply; 72+ messages in thread
From: Honnappa Nagarahalli @ 2020-07-08 20:55 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Juraj Linkeš,
	Richardson, Bruce, Aaron Conole, Michael Santana, dpdk-dev, nd,
	Phil Yang, Ruifeng Wang, Jan Viktorin, Honnappa Nagarahalli, nd

> > <snip>
> >
> > > Subject: Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build
> > > flags
> > >
> > > On Mon, Jul 6, 2020 at 1:59 PM Juraj Linkeš
> > > <juraj.linkes@pantheon.tech>
> > > wrote:
> > > >
> > > > Base the flags on config/defconfig_arm-armv7a-linuxapp-gcc.
> > > > Omit driver flags which can be built on arm32.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > >
> > > Hi Juraj,
> > >
> > > Not strictly specific to this patch. Just to understand, How armv7
> > > support has been used?
> > I do not know how armv7 support is being used. I have not heard of
> anything so far.
> >
> > In this patch arm32 is actually referring to aarch32.
> >
> > > - Is it for Running arm32 program on arm64 machines?
> > I am not sure if anyone would run armv7 binaries on arm64 machines. I
> would think they will at least go through a re-compilation (to aarch32) and
> test phase.
> >
> > > - Is it for Native DPDK support from arm32. If so, What kind of PMD
> > > supports native arm32 DPDK?
> > Yes, this is for DPDK on aarch32 support. We do not have any plans to
> enable any PMD for aarch32. The current goal is to make sure that the code
> compiles for aarch32. Internally, we have validated few test cases for the
> libraries.
> 
> One thing is lack of PMD support and other is lack  PCI HW support for
> armv7 machines in general.
> 
> 
> >
> > >
> > > Or some other use case?
> > >
> > > I would like to understand the arm32 use case, so we can review it
> > > at that angle.
> >
> > I believe armv7a compilation is not supported in meson. Do you have any
> thoughts? Do you plan to maintain the support for armv7a?
> 
> Armv7 is maintained by:
> ARM v7
> M: Jan Viktorin <viktorin@rehivetech.com>
> M: Ruifeng Wang <ruifeng.wang@arm.com>
> F: lib/librte_eal/arm/
> 
> My only concern is if there is no REAL use case for armv7 in DPDK, May it is
> not worth to add a lot of code and make it complicated for arm64.
> At a minimum, If we are planning to add armv7 support then please split
> config/arm/meson.build file as two for arm64 and armv7.
If no one objects, may be we should skip armv7.
But, we need to do aarch32 for compilation/unit tests for libraries as platforms (N1 based) exist with aarch32+PCI. We can skip the PMD support right now. Is that ok?

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

* Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags
  2020-07-08 20:55             ` Honnappa Nagarahalli
@ 2020-07-09  4:49               ` Jerin Jacob
  0 siblings, 0 replies; 72+ messages in thread
From: Jerin Jacob @ 2020-07-09  4:49 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	Richardson, Bruce, Aaron Conole, Michael Santana, dpdk-dev, nd,
	Phil Yang, Ruifeng Wang, Jan Viktorin

On Thu, Jul 9, 2020 at 2:25 AM Honnappa Nagarahalli
<Honnappa.Nagarahalli@arm.com> wrote:
>
> > > <snip>
> > >
> > > > Subject: Re: [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build
> > > > flags
> > > >
> > > > On Mon, Jul 6, 2020 at 1:59 PM Juraj Linkeš
> > > > <juraj.linkes@pantheon.tech>
> > > > wrote:
> > > > >
> > > > > Base the flags on config/defconfig_arm-armv7a-linuxapp-gcc.
> > > > > Omit driver flags which can be built on arm32.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > >
> > > > Hi Juraj,
> > > >
> > > > Not strictly specific to this patch. Just to understand, How armv7
> > > > support has been used?
> > > I do not know how armv7 support is being used. I have not heard of
> > anything so far.
> > >
> > > In this patch arm32 is actually referring to aarch32.
> > >
> > > > - Is it for Running arm32 program on arm64 machines?
> > > I am not sure if anyone would run armv7 binaries on arm64 machines. I
> > would think they will at least go through a re-compilation (to aarch32) and
> > test phase.
> > >
> > > > - Is it for Native DPDK support from arm32. If so, What kind of PMD
> > > > supports native arm32 DPDK?
> > > Yes, this is for DPDK on aarch32 support. We do not have any plans to
> > enable any PMD for aarch32. The current goal is to make sure that the code
> > compiles for aarch32. Internally, we have validated few test cases for the
> > libraries.
> >
> > One thing is lack of PMD support and other is lack  PCI HW support for
> > armv7 machines in general.
> >
> >
> > >
> > > >
> > > > Or some other use case?
> > > >
> > > > I would like to understand the arm32 use case, so we can review it
> > > > at that angle.
> > >
> > > I believe armv7a compilation is not supported in meson. Do you have any
> > thoughts? Do you plan to maintain the support for armv7a?
> >
> > Armv7 is maintained by:
> > ARM v7
> > M: Jan Viktorin <viktorin@rehivetech.com>
> > M: Ruifeng Wang <ruifeng.wang@arm.com>
> > F: lib/librte_eal/arm/
> >
> > My only concern is if there is no REAL use case for armv7 in DPDK, May it is
> > not worth to add a lot of code and make it complicated for arm64.
> > At a minimum, If we are planning to add armv7 support then please split
> > config/arm/meson.build file as two for arm64 and armv7.
> If no one objects, may be we should skip armv7.
> But, we need to do aarch32 for compilation/unit tests for libraries as platforms (N1 based) exist with aarch32+PCI. We can skip the PMD support right now. Is that ok?

aarch32 is fine as they may be some legacy 32bit application that can
run on N1. If no one objects, we should remove armv7 and it's not been
actively maintained as well.

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

* [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support
  2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
                       ` (3 preceding siblings ...)
  2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
@ 2020-08-13  9:21     ` Juraj Linkeš
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
                         ` (5 more replies)
  4 siblings, 6 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-13  9:21 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add support for aarch32 cross build in meson
and add aarch64 -> aarch32 cross build to Travis.

Aarch32 is an execution state that allows execution of 32-bit code on
armv8 machines. This execution state contains a superset of previous
armv7 32-bit instructions and features. Thus the aarch32 build is
distinct from arvm7 build.

Tested here:
[v6] https://travis-ci.com/github/jlinkes/dpdk/builds/179252628

v4:
Removed disabled drivers which actually build on arm32.
Also tested the patchset with series 9609 which fixes underlying
failures.

v5:
Changed the condition for running test-null.sh in ci.
Re-uploaded after underlying fixes have been committed.

v6:
Changed the condition for running test-null.sh again.
Reworked the patch to do aarch32 build instead of arvm7-a build.
Simplified meson build flags. Changed commit msgs.
Added 32b qualifier to .travis.yml.
Added a patch with fixes for bnxt.
Added a patch with cross compilation docs.

Juraj Linkeš (3):
  build: add aarch32 meson build flags
  build: add aarch32 to meson cross-compilation
  ci: add aarch64 -> aarch32 cross compiling jobs

Phil Yang (1):
  doc: add aarch32 build guidance

Ruifeng Wang (1):
  net/bnxt: add support for aarch32

 .ci/linux-build.sh                            |  7 ++++-
 .travis.yml                                   | 19 ++++++++++++
 config/arm/arm32_armv8a_linux_gcc             | 17 +++++++++++
 config/arm/meson.build                        | 20 +++++++++++--
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
 drivers/net/bnxt/Makefile                     |  2 +-
 drivers/net/bnxt/bnxt_rxq.h                   |  2 +-
 drivers/net/bnxt/bnxt_rxr.h                   |  2 +-
 drivers/net/bnxt/bnxt_txr.h                   |  2 +-
 9 files changed, 87 insertions(+), 14 deletions(-)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 1/5] net/bnxt: add support for aarch32
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
@ 2020-08-13  9:21       ` Juraj Linkeš
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 2/5] build: add aarch32 meson build flags Juraj Linkeš
                         ` (4 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-13  9:21 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev, Ruifeng Wang

From: Ruifeng Wang <ruifeng.wang@arm.com>

Expand vector PMD support to aarch32.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/bnxt/Makefile   | 2 +-
 drivers/net/bnxt/bnxt_rxq.h | 2 +-
 drivers/net/bnxt/bnxt_rxr.h | 2 +-
 drivers/net/bnxt/bnxt_txr.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile
index 2c4cdd1c4..db8fdf293 100644
--- a/drivers/net/bnxt/Makefile
+++ b/drivers/net/bnxt/Makefile
@@ -43,7 +43,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c
 ifeq ($(CONFIG_RTE_ARCH_X86), y)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c
 endif
-ifeq ($(CONFIG_RTE_ARCH_ARM64), y)
+ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c
 endif
 
diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index d5ce3b6d5..1c4027711 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {
 	uint16_t		nb_rx_hold; /* num held free RX desc */
 	uint16_t		rx_free_thresh; /* max free RX desc to hold */
 	uint16_t		queue_id; /* RX queue index */
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 	uint16_t		rxrearm_nb; /* number of descs to reinit. */
 	uint16_t		rxrearm_start; /* next desc index to reinit. */
 #endif
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 2bf46cd91..e2fba1647 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 			    uint16_t nb_pkts);
 int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 7715c11b8..38e5ac9df 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			      uint16_t nb_pkts);
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts);
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 2/5] build: add aarch32 meson build flags
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
@ 2020-08-13  9:21       ` Juraj Linkeš
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
                         ` (3 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-13  9:21 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add aarch32 extra build flags and aarch32 machine flags to generic
machine args.
Also modify how arm flags are updated in meson build - for 32-bit build,
update only if cross-compiling.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8728051d5..b29f27097 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -63,6 +63,11 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_aarch32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+        ['RTE_MAX_LCORE', 256]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -90,6 +95,7 @@ flags_octeontx2_extra = [
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc']],
 	['native', ['-march=native']],
+	['aarch32', ['-march=armv8-a', '-mfpu=neon'], flags_aarch32_extra],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
 	['0xd07', ['-mcpu=cortex-a57']],
@@ -129,15 +135,23 @@ impl_0x69 = ['Intel', flags_generic, machine_args_generic]
 impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
-
+update_flags = false
 if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARM', 1)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
+	if meson.is_cross_build()
+		update_flags = true
+		impl_id = meson.get_cross_property('implementor_id', 'aarch32')
+		impl_pn = meson.get_cross_property('implementor_pn', 'default')
+		machine = get_variable('impl_' + impl_id)
+	else
+		machine_args += '-mfpu=neon'
+	endif
 else
+	update_flags = true
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
@@ -172,7 +186,9 @@ else
 		impl_pn = meson.get_cross_property('implementor_pn', 'default')
 		machine = get_variable('impl_' + impl_id)
 	endif
+endif
 
+if update_flags == true
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
 	foreach flag: flags_common_default
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 3/5] build: add aarch32 to meson cross-compilation
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 2/5] build: add aarch32 meson build flags Juraj Linkeš
@ 2020-08-13  9:21       ` Juraj Linkeš
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
                         ` (2 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-13  9:21 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Create meson cross file arm32_armv8a_linux_gcc. Use arm-linux-gnueabihf-
toolset which comes with standard packages on most used systems, such as
Ubuntu and CentOS.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm32_armv8a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

diff --git a/config/arm/arm32_armv8a_linux_gcc b/config/arm/arm32_armv8a_linux_gcc
new file mode 100644
index 000000000..d3c4bce6c
--- /dev/null
+++ b/config/arm/arm32_armv8a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = '0x41'
+implementor_pn = 'aarch32'
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                         ` (2 preceding siblings ...)
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
@ 2020-08-13  9:21       ` Juraj Linkeš
  2020-08-14  2:10         ` Ruifeng Wang
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 5/5] doc: add aarch32 build guidance Juraj Linkeš
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-13  9:21 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add two jobs (static and shared libs), both building on aarch64 and
producing 32-bit arm binaries executable on armv8-a, but not armv7.
Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..c042b065c 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$AARCH32" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname -m)"; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index 14f812423..966b657a7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_32b_packages: &arm_32b_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _libabigail_build_packages: &libabigail_build_packages
   - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
 
@@ -124,6 +128,21 @@ jobs:
         packages:
           - *required_packages
           - *libabigail_build_packages
+  # aarch64 cross-compiling aarch32 jobs
+  - env: DEF_LIB="shared" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
+  - env: DEF_LIB="static" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 5/5] doc: add aarch32 build guidance
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                         ` (3 preceding siblings ...)
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
@ 2020-08-13  9:21       ` Juraj Linkeš
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-13  9:21 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev, Phil Yang

From: Phil Yang <phil.yang@arm.com>

Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
index c5875a6d5..07085e3ea 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -1,15 +1,16 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2018 ARM Corporation.
 
-Cross compile DPDK for ARM64
-============================
-This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts.
+Cross compile DPDK for aarch64 and aarch32
+==========================================
+This chapter describes how to cross compile DPDK for aarch64 from x86 build hosts and compile
+32-bit aarch32 DPDK from aarch64 build hosts.
 
 .. note::
 
-   Whilst it is recommended to natively build DPDK on ARM64 (just
-   like with x86), it is also possible to cross-build DPDK for ARM64. An
-   ARM64 cross compile GNU toolchain is used for this.
+   Whilst it is recommended to natively build DPDK on aarch64 (just
+   like with x86), it is also possible to cross-build DPDK for aarch64.
+   An aarch64 cross compile GNU toolchain is used for this.
 
 Obtain the cross tool chain
 ---------------------------
@@ -88,18 +89,33 @@ To install it in Ubuntu::
 
    sudo apt-get install pkg-config-aarch64-linux-gnu
 
+.. note::
+
+    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-bit aarch32 applications
+    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-gnueabihf`` is required
+    for aarch32 on aarch64. To install it in Ubuntu::
+
+       sudo dpkg --add-architecture armhf
+       sudo apt-get update
+       sudo apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make binutils
+
 To cross-compile DPDK on a desired target machine we can use the following
 command::
 
 	meson cross-build --cross-file <target_machine_configuration>
 	ninja -C cross-build
 
-For example if the target machine is arm64 we can use the following
+For example if the target machine is aarch64 we can use the following
 command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
+If the target machine is aarch32 we can use the following command::
+
+	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
+	ninja -C arm32-build
+
 Configure and Cross Compile DPDK using Make
 -------------------------------------------
 To configure a build, choose one of the target configurations, like arm64-dpaa-linux-gcc and arm64-thunderx-linux-gcc.
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v6 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
@ 2020-08-14  2:10         ` Ruifeng Wang
  0 siblings, 0 replies; 72+ messages in thread
From: Ruifeng Wang @ 2020-08-14  2:10 UTC (permalink / raw)
  To: Juraj Linkeš, bruce.richardson, aconole, maicolgabriel; +Cc: dev, nd


> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Juraj Linke?
> Sent: Thursday, August 13, 2020 5:21 PM
> To: bruce.richardson@intel.com; aconole@redhat.com;
> maicolgabriel@hotmail.com
> Cc: juraj.linkes@pantheon.tech; dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v6 4/5] ci: add aarch64 -> aarch32 cross compiling
> jobs
> 
> Add two jobs (static and shared libs), both building on aarch64 and producing
> 32-bit arm binaries executable on armv8-a, but not armv7.
> Do not run tests in these jobs.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .ci/linux-build.sh |  7 ++++++-
>  .travis.yml        | 19 +++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
> 
Hi Juraj,

This patch has apply issue.
Can you rebase and send a new version?

Thanks.
/Ruifeng

> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index d079801d7..c042b065c
> 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
>      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
>  fi
> 
> +if [ "$AARCH32" = "1" ]; then
> +    # convert the arch specifier
> +    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
> +fi
> +
>  if [ "$BUILD_DOCS" = "1" ]; then
>      OPTS="$OPTS -Denable_docs=true"
>  fi
> @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
>  meson build --werror $OPTS
>  ninja -C build
> 
> -if [ "$AARCH64" != "1" ]; then
> +if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname -m)";
> +then
>      devtools/test-null.sh
>  fi
> 
> diff --git a/.travis.yml b/.travis.yml
> index 14f812423..966b657a7 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
>    - *required_packages
>    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-
> gnu]
> 
> +_arm_32b_packages: &arm_32b_packages
> +  - *required_packages
> +  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross,
> +pkg-config-arm-linux-gnueabihf]
> +
>  _libabigail_build_packages: &libabigail_build_packages
>    - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
> 
> @@ -124,6 +128,21 @@ jobs:
>          packages:
>            - *required_packages
>            - *libabigail_build_packages
> +  # aarch64 cross-compiling aarch32 jobs
> +  - env: DEF_LIB="shared" AARCH32=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_32b_packages
> +  - env: DEF_LIB="static" AARCH32=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_32b_packages
>    # aarch64 clang jobs
>    - env: DEF_LIB="static"
>      arch: arm64
> --
> 2.20.1


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

* [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support
  2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                         ` (4 preceding siblings ...)
  2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 5/5] doc: add aarch32 build guidance Juraj Linkeš
@ 2020-08-14 10:31       ` Juraj Linkeš
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
                           ` (5 more replies)
  5 siblings, 6 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-14 10:31 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add support for aarch32 cross build in meson
and add aarch64 -> aarch32 cross build to Travis.

Aarch32 is an execution state that allows execution of 32-bit code on
armv8 machines. This execution state contains a superset of previous
armv7 32-bit instructions and features. Thus the aarch32 build is
distinct from arvm7 build.

Tested here:
[v6] https://travis-ci.com/github/jlinkes/dpdk/builds/179252628
[v7] https://travis-ci.com/github/jlinkes/dpdk/builds/179723067

v4:
Removed disabled drivers which actually build on arm32.
Also tested the patchset with series 9609 which fixes underlying
failures.

v5:
Changed the condition for running test-null.sh in ci.
Re-uploaded after underlying fixes have been committed.

v6:
Changed the condition for running test-null.sh again.
Reworked the patch to do aarch32 build instead of arvm7-a build.
Simplified meson build flags. Changed commit msgs.
Added 32b qualifier to .travis.yml.
Added a patch with fixes for bnxt.
Added a patch with cross compilation docs.

v7:
Rebased the patchset.

Juraj Linkeš (3):
  build: add aarch32 meson build flags
  build: add aarch32 to meson cross-compilation
  ci: add aarch64 -> aarch32 cross compiling jobs

Phil Yang (1):
  doc: add aarch32 build guidance

Ruifeng Wang (1):
  net/bnxt: add support for aarch32

 .ci/linux-build.sh                            |  7 ++++-
 .travis.yml                                   | 19 ++++++++++++
 config/arm/arm32_armv8a_linux_gcc             | 17 +++++++++++
 config/arm/meson.build                        | 20 +++++++++++--
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
 drivers/net/bnxt/Makefile                     |  2 +-
 drivers/net/bnxt/bnxt_rxq.h                   |  2 +-
 drivers/net/bnxt/bnxt_rxr.h                   |  2 +-
 drivers/net/bnxt/bnxt_txr.h                   |  2 +-
 9 files changed, 87 insertions(+), 14 deletions(-)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
@ 2020-08-14 10:31         ` Juraj Linkeš
  2020-08-19 17:45           ` Ajit Khaparde
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 2/5] build: add aarch32 meson build flags Juraj Linkeš
                           ` (4 subsequent siblings)
  5 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-14 10:31 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev, Ruifeng Wang

From: Ruifeng Wang <ruifeng.wang@arm.com>

Expand vector PMD support to aarch32.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/bnxt/Makefile   | 2 +-
 drivers/net/bnxt/bnxt_rxq.h | 2 +-
 drivers/net/bnxt/bnxt_rxr.h | 2 +-
 drivers/net/bnxt/bnxt_txr.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile
index 0c5b74918..06a47dc49 100644
--- a/drivers/net/bnxt/Makefile
+++ b/drivers/net/bnxt/Makefile
@@ -43,7 +43,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c
 ifeq ($(CONFIG_RTE_ARCH_X86), y)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c
 endif
-ifeq ($(CONFIG_RTE_ARCH_ARM64), y)
+ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c
 endif
 
diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index d5ce3b6d5..1c4027711 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {
 	uint16_t		nb_rx_hold; /* num held free RX desc */
 	uint16_t		rx_free_thresh; /* max free RX desc to hold */
 	uint16_t		queue_id; /* RX queue index */
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 	uint16_t		rxrearm_nb; /* number of descs to reinit. */
 	uint16_t		rxrearm_start; /* next desc index to reinit. */
 #endif
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 2bf46cd91..e2fba1647 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 			    uint16_t nb_pkts);
 int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 7715c11b8..38e5ac9df 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			      uint16_t nb_pkts);
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts);
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 2/5] build: add aarch32 meson build flags
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
@ 2020-08-14 10:31         ` Juraj Linkeš
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
                           ` (3 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-14 10:31 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add aarch32 extra build flags and aarch32 machine flags to generic
machine args.
Also modify how arm flags are updated in meson build - for 32-bit build,
update only if cross-compiling.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8728051d5..b29f27097 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -63,6 +63,11 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_aarch32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+        ['RTE_MAX_LCORE', 256]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -90,6 +95,7 @@ flags_octeontx2_extra = [
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc']],
 	['native', ['-march=native']],
+	['aarch32', ['-march=armv8-a', '-mfpu=neon'], flags_aarch32_extra],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
 	['0xd07', ['-mcpu=cortex-a57']],
@@ -129,15 +135,23 @@ impl_0x69 = ['Intel', flags_generic, machine_args_generic]
 impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
-
+update_flags = false
 if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARM', 1)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
+	if meson.is_cross_build()
+		update_flags = true
+		impl_id = meson.get_cross_property('implementor_id', 'aarch32')
+		impl_pn = meson.get_cross_property('implementor_pn', 'default')
+		machine = get_variable('impl_' + impl_id)
+	else
+		machine_args += '-mfpu=neon'
+	endif
 else
+	update_flags = true
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
@@ -172,7 +186,9 @@ else
 		impl_pn = meson.get_cross_property('implementor_pn', 'default')
 		machine = get_variable('impl_' + impl_id)
 	endif
+endif
 
+if update_flags == true
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
 	foreach flag: flags_common_default
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 3/5] build: add aarch32 to meson cross-compilation
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 2/5] build: add aarch32 meson build flags Juraj Linkeš
@ 2020-08-14 10:31         ` Juraj Linkeš
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
                           ` (2 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-14 10:31 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Create meson cross file arm32_armv8a_linux_gcc. Use arm-linux-gnueabihf-
toolset which comes with standard packages on most used systems, such as
Ubuntu and CentOS.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm32_armv8a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

diff --git a/config/arm/arm32_armv8a_linux_gcc b/config/arm/arm32_armv8a_linux_gcc
new file mode 100644
index 000000000..d3c4bce6c
--- /dev/null
+++ b/config/arm/arm32_armv8a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = '0x41'
+implementor_pn = 'aarch32'
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                           ` (2 preceding siblings ...)
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
@ 2020-08-14 10:31         ` Juraj Linkeš
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 5/5] doc: add aarch32 build guidance Juraj Linkeš
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-14 10:31 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add two jobs (static and shared libs), both building on aarch64 and
producing 32-bit arm binaries executable on armv8-a, but not armv7.
Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..c042b065c 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$AARCH32" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname -m)"; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index d6eeab371..850faaac1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_32b_packages: &arm_32b_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _build_32b_packages: &build_32b_packages
   - *required_packages
   - [gcc-multilib]
@@ -98,6 +102,21 @@ jobs:
         packages:
           - *required_packages
           - *doc_packages
+  # aarch64 cross-compiling aarch32 jobs
+  - env: DEF_LIB="shared" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
+  - env: DEF_LIB="static" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 5/5] doc: add aarch32 build guidance
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                           ` (3 preceding siblings ...)
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
@ 2020-08-14 10:31         ` Juraj Linkeš
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-14 10:31 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev, Phil Yang

From: Phil Yang <phil.yang@arm.com>

Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
index c5875a6d5..07085e3ea 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -1,15 +1,16 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2018 ARM Corporation.
 
-Cross compile DPDK for ARM64
-============================
-This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts.
+Cross compile DPDK for aarch64 and aarch32
+==========================================
+This chapter describes how to cross compile DPDK for aarch64 from x86 build hosts and compile
+32-bit aarch32 DPDK from aarch64 build hosts.
 
 .. note::
 
-   Whilst it is recommended to natively build DPDK on ARM64 (just
-   like with x86), it is also possible to cross-build DPDK for ARM64. An
-   ARM64 cross compile GNU toolchain is used for this.
+   Whilst it is recommended to natively build DPDK on aarch64 (just
+   like with x86), it is also possible to cross-build DPDK for aarch64.
+   An aarch64 cross compile GNU toolchain is used for this.
 
 Obtain the cross tool chain
 ---------------------------
@@ -88,18 +89,33 @@ To install it in Ubuntu::
 
    sudo apt-get install pkg-config-aarch64-linux-gnu
 
+.. note::
+
+    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-bit aarch32 applications
+    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-gnueabihf`` is required
+    for aarch32 on aarch64. To install it in Ubuntu::
+
+       sudo dpkg --add-architecture armhf
+       sudo apt-get update
+       sudo apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make binutils
+
 To cross-compile DPDK on a desired target machine we can use the following
 command::
 
 	meson cross-build --cross-file <target_machine_configuration>
 	ninja -C cross-build
 
-For example if the target machine is arm64 we can use the following
+For example if the target machine is aarch64 we can use the following
 command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
+If the target machine is aarch32 we can use the following command::
+
+	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
+	ninja -C arm32-build
+
 Configure and Cross Compile DPDK using Make
 -------------------------------------------
 To configure a build, choose one of the target configurations, like arm64-dpaa-linux-gcc and arm64-thunderx-linux-gcc.
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
@ 2020-08-19 17:45           ` Ajit Khaparde
  2020-08-20  3:00             ` Ruifeng Wang
  0 siblings, 1 reply; 72+ messages in thread
From: Ajit Khaparde @ 2020-08-19 17:45 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Bruce Richardson, Aaron Conole, maicolgabriel, dpdk-dev, Ruifeng Wang

On Fri, Aug 14, 2020 at 3:32 AM Juraj Linkeš <juraj.linkes@pantheon.tech>
wrote:

> From: Ruifeng Wang <ruifeng.wang@arm.com>
>
> Expand vector PMD support to aarch32.
>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>  drivers/net/bnxt/Makefile   | 2 +-
>  drivers/net/bnxt/bnxt_rxq.h | 2 +-
>  drivers/net/bnxt/bnxt_rxr.h | 2 +-
>  drivers/net/bnxt/bnxt_txr.h | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile
> index 0c5b74918..06a47dc49 100644
> --- a/drivers/net/bnxt/Makefile
> +++ b/drivers/net/bnxt/Makefile
> @@ -43,7 +43,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c
>  ifeq ($(CONFIG_RTE_ARCH_X86), y)
>  SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c
>  endif
> -ifeq ($(CONFIG_RTE_ARCH_ARM64), y)
> +ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),)
>  SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c
>  endif
>
Thanks for the changes.
With makefiles being deprecated, I don't think this will be required.
That said, I don't see drivers/net/bnxt/meson.build being modified.
Is that not required?


> diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
> index d5ce3b6d5..1c4027711 100644
> --- a/drivers/net/bnxt/bnxt_rxq.h
> +++ b/drivers/net/bnxt/bnxt_rxq.h
> @@ -22,7 +22,7 @@ struct bnxt_rx_queue {
>         uint16_t                nb_rx_hold; /* num held free RX desc */
>         uint16_t                rx_free_thresh; /* max free RX desc to
> hold */
>         uint16_t                queue_id; /* RX queue index */
> -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
> +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) ||
> defined(RTE_ARCH_ARM)
>         uint16_t                rxrearm_nb; /* number of descs to reinit.
> */
>         uint16_t                rxrearm_start; /* next desc index to
> reinit. */
>  #endif
> diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
> index 2bf46cd91..e2fba1647 100644
> --- a/drivers/net/bnxt/bnxt_rxr.h
> +++ b/drivers/net/bnxt/bnxt_rxr.h
> @@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
>  int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
>  int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
>
> -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
> +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) ||
> defined(RTE_ARCH_ARM)
>  uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>                             uint16_t nb_pkts);
>  int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
> diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
> index 7715c11b8..38e5ac9df 100644
> --- a/drivers/net/bnxt/bnxt_txr.h
> +++ b/drivers/net/bnxt/bnxt_txr.h
> @@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf
> **tx_pkts,
>                                uint16_t nb_pkts);
>  uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
>                               uint16_t nb_pkts);
> -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
> +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) ||
> defined(RTE_ARCH_ARM)
>  uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
>                             uint16_t nb_pkts);
>  #endif
> --
> 2.20.1
>
>

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

* Re: [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32
  2020-08-19 17:45           ` Ajit Khaparde
@ 2020-08-20  3:00             ` Ruifeng Wang
  2020-08-20  9:13               ` Juraj Linkeš
  0 siblings, 1 reply; 72+ messages in thread
From: Ruifeng Wang @ 2020-08-20  3:00 UTC (permalink / raw)
  To: Ajit Khaparde (ajit.khaparde, Juraj Linkeš
  Cc: Bruce Richardson, Aaron Conole, maicolgabriel, dpdk-dev, nd

From: Ajit Khaparde <ajit.khaparde@broadcom.com>
Sent: Thursday, August 20, 2020 1:46 AM
To: Juraj Linkeš <juraj.linkes@pantheon.tech>
Cc: Bruce Richardson <bruce.richardson@intel.com>; Aaron Conole <aconole@redhat.com>; maicolgabriel@hotmail.com; dpdk-dev <dev@dpdk.org>; Ruifeng Wang <Ruifeng.Wang@arm.com>
Subject: Re: [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32



On Fri, Aug 14, 2020 at 3:32 AM Juraj Linkeš <juraj.linkes@pantheon.tech<mailto:juraj.linkes@pantheon.tech>> wrote:
From: Ruifeng Wang <ruifeng.wang@arm.com<mailto:ruifeng.wang@arm.com>>

Expand vector PMD support to aarch32.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com<mailto:ruifeng.wang@arm.com>>
---
 drivers/net/bnxt/Makefile   | 2 +-
 drivers/net/bnxt/bnxt_rxq.h | 2 +-
 drivers/net/bnxt/bnxt_rxr.h | 2 +-
 drivers/net/bnxt/bnxt_txr.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile
index 0c5b74918..06a47dc49 100644
--- a/drivers/net/bnxt/Makefile
+++ b/drivers/net/bnxt/Makefile
@@ -43,7 +43,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c
 ifeq ($(CONFIG_RTE_ARCH_X86), y)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c
 endif
-ifeq ($(CONFIG_RTE_ARCH_ARM64), y)
+ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c
 endif
Thanks for the changes.
With makefiles being deprecated, I don't think this will be required.
That said, I don't see drivers/net/bnxt/meson.build being modified.
Is that not required?

[Ruifeng] No, the meson.build doesn’t require to be modified.
It uses different method to flag inclusion of bnxt_rxtx_vec_neon.c and is compatible with aarch32 build.


diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index d5ce3b6d5..1c4027711 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {
        uint16_t                nb_rx_hold; /* num held free RX desc */
        uint16_t                rx_free_thresh; /* max free RX desc to hold */
        uint16_t                queue_id; /* RX queue index */
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
        uint16_t                rxrearm_nb; /* number of descs to reinit. */
        uint16_t                rxrearm_start; /* next desc index to reinit. */
 #endif
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 2bf46cd91..e2fba1647 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);

-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
                            uint16_t nb_pkts);
 int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 7715c11b8..38e5ac9df 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                               uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                              uint16_t nb_pkts);
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
                            uint16_t nb_pkts);
 #endif
--
2.20.1

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

* Re: [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32
  2020-08-20  3:00             ` Ruifeng Wang
@ 2020-08-20  9:13               ` Juraj Linkeš
  0 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-20  9:13 UTC (permalink / raw)
  To: Ruifeng Wang, Ajit Khaparde (ajit.khaparde
  Cc: Bruce Richardson, Aaron Conole, maicolgabriel, dpdk-dev, nd



From: Ruifeng Wang <Ruifeng.Wang@arm.com>
Sent: Thursday, August 20, 2020 5:00 AM
To: Ajit Khaparde (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>; Juraj Linkeš <juraj.linkes@pantheon.tech>
Cc: Bruce Richardson <bruce.richardson@intel.com>; Aaron Conole <aconole@redhat.com>; maicolgabriel@hotmail.com; dpdk-dev <dev@dpdk.org>; nd <nd@arm.com>
Subject: RE: [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32

From: Ajit Khaparde <ajit.khaparde@broadcom.com<mailto:ajit.khaparde@broadcom.com>>
Sent: Thursday, August 20, 2020 1:46 AM
To: Juraj Linkeš <juraj.linkes@pantheon.tech<mailto:juraj.linkes@pantheon.tech>>
Cc: Bruce Richardson <bruce.richardson@intel.com<mailto:bruce.richardson@intel.com>>; Aaron Conole <aconole@redhat.com<mailto:aconole@redhat.com>>; maicolgabriel@hotmail.com<mailto:maicolgabriel@hotmail.com>; dpdk-dev <dev@dpdk.org<mailto:dev@dpdk.org>>; Ruifeng Wang <Ruifeng.Wang@arm.com<mailto:Ruifeng.Wang@arm.com>>
Subject: Re: [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32



On Fri, Aug 14, 2020 at 3:32 AM Juraj Linkeš <juraj.linkes@pantheon.tech<mailto:juraj.linkes@pantheon.tech>> wrote:
From: Ruifeng Wang <ruifeng.wang@arm.com<mailto:ruifeng.wang@arm.com>>

Expand vector PMD support to aarch32.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com<mailto:ruifeng.wang@arm.com>>
---
 drivers/net/bnxt/Makefile   | 2 +-
 drivers/net/bnxt/bnxt_rxq.h | 2 +-
 drivers/net/bnxt/bnxt_rxr.h | 2 +-
 drivers/net/bnxt/bnxt_txr.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile
index 0c5b74918..06a47dc49 100644
--- a/drivers/net/bnxt/Makefile
+++ b/drivers/net/bnxt/Makefile
@@ -43,7 +43,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c
 ifeq ($(CONFIG_RTE_ARCH_X86), y)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c
 endif
-ifeq ($(CONFIG_RTE_ARCH_ARM64), y)
+ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),)
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_neon.c
 endif
Thanks for the changes.
With makefiles being deprecated, I don't think this will be required.
That said, I don't see drivers/net/bnxt/meson.build being modified.
Is that not required?

[Ruifeng] No, the meson.build doesn’t require to be modified.
It uses different method to flag inclusion of bnxt_rxtx_vec_neon.c and is compatible with aarch32 build.

[Juraj] Since the makefile changes are not needed, I'll remove them in the next version.


diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index d5ce3b6d5..1c4027711 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {
        uint16_t                nb_rx_hold; /* num held free RX desc */
        uint16_t                rx_free_thresh; /* max free RX desc to hold */
        uint16_t                queue_id; /* RX queue index */
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
        uint16_t                rxrearm_nb; /* number of descs to reinit. */
        uint16_t                rxrearm_start; /* next desc index to reinit. */
 #endif
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 2bf46cd91..e2fba1647 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);

-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
                            uint16_t nb_pkts);
 int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 7715c11b8..38e5ac9df 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                               uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
                              uint16_t nb_pkts);
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
                            uint16_t nb_pkts);
 #endif
--
2.20.1

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

* [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support
  2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                           ` (4 preceding siblings ...)
  2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 5/5] doc: add aarch32 build guidance Juraj Linkeš
@ 2020-08-25 13:04         ` Juraj Linkeš
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
                             ` (5 more replies)
  5 siblings, 6 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-25 13:04 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Add support for aarch32 cross build in meson
and add aarch64 -> aarch32 cross build to Travis.

Aarch32 is an execution state that allows execution of 32-bit code on
armv8 machines. This execution state contains a superset of previous
armv7 32-bit instructions and features. Thus the aarch32 build is
distinct from arvm7 build.

Tested here:
[v6] https://travis-ci.com/github/jlinkes/dpdk/builds/179252628
[v7] https://travis-ci.com/github/jlinkes/dpdk/builds/179723067
[v8] https://travis-ci.com/github/jlinkes/dpdk/builds/181307330

v4:
Removed disabled drivers which actually build on arm32.
Also tested the patchset with series 9609 which fixes underlying
failures.

v5:
Changed the condition for running test-null.sh in ci.
Re-uploaded after underlying fixes have been committed.

v6:
Changed the condition for running test-null.sh again.
Reworked the patch to do aarch32 build instead of arvm7-a build.
Simplified meson build flags. Changed commit msgs.
Added 32b qualifier to .travis.yml.
Added a patch with fixes for bnxt.
Added a patch with cross compilation docs.

v7:
Rebased the patchset.

v8:
Removed Makefile additions from net/bnxt patch.

Juraj Linkeš (3):
  build: add aarch32 meson build flags
  build: add aarch32 to meson cross-compilation
  ci: add aarch64 -> aarch32 cross compiling jobs

Phil Yang (1):
  doc: add aarch32 build guidance

Ruifeng Wang (1):
  net/bnxt: add support for aarch32

 .ci/linux-build.sh                            |  7 ++++-
 .travis.yml                                   | 19 ++++++++++++
 config/arm/arm32_armv8a_linux_gcc             | 17 +++++++++++
 config/arm/meson.build                        | 20 +++++++++++--
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
 drivers/net/bnxt/bnxt_rxq.h                   |  2 +-
 drivers/net/bnxt/bnxt_rxr.h                   |  2 +-
 drivers/net/bnxt/bnxt_txr.h                   |  2 +-
 8 files changed, 86 insertions(+), 13 deletions(-)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 1/5] net/bnxt: add support for aarch32
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
@ 2020-08-25 13:04           ` Juraj Linkeš
  2020-08-25 19:05             ` Ajit Khaparde
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 2/5] build: add aarch32 meson build flags Juraj Linkeš
                             ` (4 subsequent siblings)
  5 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-25 13:04 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, juraj.linkes, Ruifeng Wang

From: Ruifeng Wang <ruifeng.wang@arm.com>

Expand vector PMD support to aarch32.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/net/bnxt/bnxt_rxq.h | 2 +-
 drivers/net/bnxt/bnxt_rxr.h | 2 +-
 drivers/net/bnxt/bnxt_txr.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index d5ce3b6d5..1c4027711 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {
 	uint16_t		nb_rx_hold; /* num held free RX desc */
 	uint16_t		rx_free_thresh; /* max free RX desc to hold */
 	uint16_t		queue_id; /* RX queue index */
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 	uint16_t		rxrearm_nb; /* number of descs to reinit. */
 	uint16_t		rxrearm_start; /* next desc index to reinit. */
 #endif
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 2bf46cd91..e2fba1647 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 			    uint16_t nb_pkts);
 int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 7715c11b8..38e5ac9df 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			      uint16_t nb_pkts);
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts);
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 2/5] build: add aarch32 meson build flags
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
@ 2020-08-25 13:04           ` Juraj Linkeš
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
                             ` (3 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-25 13:04 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Add aarch32 extra build flags and aarch32 machine flags to generic
machine args.
Also modify how arm flags are updated in meson build - for 32-bit build,
update only if cross-compiling.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8728051d5..b29f27097 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -63,6 +63,11 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_aarch32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+        ['RTE_MAX_LCORE', 256]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -90,6 +95,7 @@ flags_octeontx2_extra = [
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc']],
 	['native', ['-march=native']],
+	['aarch32', ['-march=armv8-a', '-mfpu=neon'], flags_aarch32_extra],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
 	['0xd07', ['-mcpu=cortex-a57']],
@@ -129,15 +135,23 @@ impl_0x69 = ['Intel', flags_generic, machine_args_generic]
 impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
-
+update_flags = false
 if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARM', 1)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
+	if meson.is_cross_build()
+		update_flags = true
+		impl_id = meson.get_cross_property('implementor_id', 'aarch32')
+		impl_pn = meson.get_cross_property('implementor_pn', 'default')
+		machine = get_variable('impl_' + impl_id)
+	else
+		machine_args += '-mfpu=neon'
+	endif
 else
+	update_flags = true
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
@@ -172,7 +186,9 @@ else
 		impl_pn = meson.get_cross_property('implementor_pn', 'default')
 		machine = get_variable('impl_' + impl_id)
 	endif
+endif
 
+if update_flags == true
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
 	foreach flag: flags_common_default
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 3/5] build: add aarch32 to meson cross-compilation
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 2/5] build: add aarch32 meson build flags Juraj Linkeš
@ 2020-08-25 13:04           ` Juraj Linkeš
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
                             ` (2 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-25 13:04 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Create meson cross file arm32_armv8a_linux_gcc. Use arm-linux-gnueabihf-
toolset which comes with standard packages on most used systems, such as
Ubuntu and CentOS.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm32_armv8a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

diff --git a/config/arm/arm32_armv8a_linux_gcc b/config/arm/arm32_armv8a_linux_gcc
new file mode 100644
index 000000000..d3c4bce6c
--- /dev/null
+++ b/config/arm/arm32_armv8a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = '0x41'
+implementor_pn = 'aarch32'
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                             ` (2 preceding siblings ...)
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
@ 2020-08-25 13:04           ` Juraj Linkeš
  2020-08-25 14:16             ` Aaron Conole
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 5/5] doc: add aarch32 build guidance Juraj Linkeš
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-25 13:04 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Add two jobs (static and shared libs), both building on aarch64 and
producing 32-bit arm binaries executable on armv8-a, but not armv7.
Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..c042b065c 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$AARCH32" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname -m)"; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index d6eeab371..850faaac1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_32b_packages: &arm_32b_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _build_32b_packages: &build_32b_packages
   - *required_packages
   - [gcc-multilib]
@@ -98,6 +102,21 @@ jobs:
         packages:
           - *required_packages
           - *doc_packages
+  # aarch64 cross-compiling aarch32 jobs
+  - env: DEF_LIB="shared" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
+  - env: DEF_LIB="static" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 5/5] doc: add aarch32 build guidance
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                             ` (3 preceding siblings ...)
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
@ 2020-08-25 13:04           ` Juraj Linkeš
  2020-08-25 14:03             ` Aaron Conole
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-25 13:04 UTC (permalink / raw)
  To: bruce.richardson, aconole, maicolgabriel; +Cc: dev, juraj.linkes, Phil Yang

From: Phil Yang <phil.yang@arm.com>

Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
index c5875a6d5..07085e3ea 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -1,15 +1,16 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2018 ARM Corporation.
 
-Cross compile DPDK for ARM64
-============================
-This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts.
+Cross compile DPDK for aarch64 and aarch32
+==========================================
+This chapter describes how to cross compile DPDK for aarch64 from x86 build hosts and compile
+32-bit aarch32 DPDK from aarch64 build hosts.
 
 .. note::
 
-   Whilst it is recommended to natively build DPDK on ARM64 (just
-   like with x86), it is also possible to cross-build DPDK for ARM64. An
-   ARM64 cross compile GNU toolchain is used for this.
+   Whilst it is recommended to natively build DPDK on aarch64 (just
+   like with x86), it is also possible to cross-build DPDK for aarch64.
+   An aarch64 cross compile GNU toolchain is used for this.
 
 Obtain the cross tool chain
 ---------------------------
@@ -88,18 +89,33 @@ To install it in Ubuntu::
 
    sudo apt-get install pkg-config-aarch64-linux-gnu
 
+.. note::
+
+    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-bit aarch32 applications
+    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-gnueabihf`` is required
+    for aarch32 on aarch64. To install it in Ubuntu::
+
+       sudo dpkg --add-architecture armhf
+       sudo apt-get update
+       sudo apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make binutils
+
 To cross-compile DPDK on a desired target machine we can use the following
 command::
 
 	meson cross-build --cross-file <target_machine_configuration>
 	ninja -C cross-build
 
-For example if the target machine is arm64 we can use the following
+For example if the target machine is aarch64 we can use the following
 command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
+If the target machine is aarch32 we can use the following command::
+
+	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
+	ninja -C arm32-build
+
 Configure and Cross Compile DPDK using Make
 -------------------------------------------
 To configure a build, choose one of the target configurations, like arm64-dpaa-linux-gcc and arm64-thunderx-linux-gcc.
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v8 5/5] doc: add aarch32 build guidance
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 5/5] doc: add aarch32 build guidance Juraj Linkeš
@ 2020-08-25 14:03             ` Aaron Conole
  2020-08-26  3:12               ` Phil Yang
  0 siblings, 1 reply; 72+ messages in thread
From: Aaron Conole @ 2020-08-25 14:03 UTC (permalink / raw)
  To: Juraj Linkeš; +Cc: bruce.richardson, maicolgabriel, dev, Phil Yang

Juraj Linkeš <juraj.linkes@pantheon.tech> writes:

> From: Phil Yang <phil.yang@arm.com>
>
> Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.
>
> Signed-off-by: Phil Yang <phil.yang@arm.com>
> ---
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
>  1 file changed, 23 insertions(+), 7 deletions(-)
>
> diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> index c5875a6d5..07085e3ea 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -1,15 +1,16 @@
>  ..  SPDX-License-Identifier: BSD-3-Clause
>      Copyright(c) 2018 ARM Corporation.
>  
> -Cross compile DPDK for ARM64
> -============================
> -This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts.
> +Cross compile DPDK for aarch64 and aarch32
> +==========================================
> +This chapter describes how to cross compile DPDK for aarch64 from x86 build hosts and compile
> +32-bit aarch32 DPDK from aarch64 build hosts.
>  
>  .. note::
>  
> -   Whilst it is recommended to natively build DPDK on ARM64 (just
> -   like with x86), it is also possible to cross-build DPDK for ARM64. An
> -   ARM64 cross compile GNU toolchain is used for this.
> +   Whilst it is recommended to natively build DPDK on aarch64 (just
> +   like with x86), it is also possible to cross-build DPDK for aarch64.
> +   An aarch64 cross compile GNU toolchain is used for this.
>  
>  Obtain the cross tool chain
>  ---------------------------
> @@ -88,18 +89,33 @@ To install it in Ubuntu::
>  
>     sudo apt-get install pkg-config-aarch64-linux-gnu
>  
> +.. note::
> +
> +    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-bit aarch32 applications
> +    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-gnueabihf`` is required
> +    for aarch32 on aarch64. To install it in Ubuntu::
> +
> +       sudo dpkg --add-architecture armhf
> +       sudo apt-get update
> +       sudo apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make binutils
> +

Is 'make' still needed?  I don't run Ubuntu, so I'm not sure.

>  To cross-compile DPDK on a desired target machine we can use the following
>  command::
>  
>  	meson cross-build --cross-file <target_machine_configuration>
>  	ninja -C cross-build
>  
> -For example if the target machine is arm64 we can use the following
> +For example if the target machine is aarch64 we can use the following
>  command::
>  
>  	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
>  	ninja -C arm64-build
>  
> +If the target machine is aarch32 we can use the following command::
> +
> +	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
> +	ninja -C arm32-build
> +
>  Configure and Cross Compile DPDK using Make
>  -------------------------------------------
>  To configure a build, choose one of the target configurations, like arm64-dpaa-linux-gcc and arm64-thunderx-linux-gcc.


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

* Re: [dpdk-dev] [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
@ 2020-08-25 14:16             ` Aaron Conole
  2020-08-26  6:21               ` Juraj Linkeš
  0 siblings, 1 reply; 72+ messages in thread
From: Aaron Conole @ 2020-08-25 14:16 UTC (permalink / raw)
  To: Juraj Linkeš; +Cc: bruce.richardson, maicolgabriel, dev

Juraj Linkeš <juraj.linkes@pantheon.tech> writes:

> Add two jobs (static and shared libs), both building on aarch64 and
> producing 32-bit arm binaries executable on armv8-a, but not armv7.
> Do not run tests in these jobs.
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .ci/linux-build.sh |  7 ++++++-
>  .travis.yml        | 19 +++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
>
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
> index d079801d7..c042b065c 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
>      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
>  fi
>  
> +if [ "$AARCH32" = "1" ]; then
> +    # convert the arch specifier
> +    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
> +fi
> +
>  if [ "$BUILD_DOCS" = "1" ]; then
>      OPTS="$OPTS -Denable_docs=true"
>  fi
> @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
>  meson build --werror $OPTS
>  ninja -C build
>  
> -if [ "$AARCH64" != "1" ]; then
> +if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname -m)"; then

I'm not sure about this.  This will degrade the 32-bit x86 build, since it
will no longer execute the test-null.sh script.

Maybe we should re-use that flag for this series.  BUILD_32BIT ??

>      devtools/test-null.sh
>  fi
>  
> diff --git a/.travis.yml b/.travis.yml
> index d6eeab371..850faaac1 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
>    - *required_packages
>    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
>  
> +_arm_32b_packages: &arm_32b_packages
> +  - *required_packages
> +  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
> +
>  _build_32b_packages: &build_32b_packages
>    - *required_packages
>    - [gcc-multilib]
> @@ -98,6 +102,21 @@ jobs:
>          packages:
>            - *required_packages
>            - *doc_packages
> +  # aarch64 cross-compiling aarch32 jobs
> +  - env: DEF_LIB="shared" AARCH32=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_32b_packages
> +  - env: DEF_LIB="static" AARCH32=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_32b_packages
>    # aarch64 clang jobs
>    - env: DEF_LIB="static"
>      arch: arm64


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

* Re: [dpdk-dev] [PATCH v8 1/5] net/bnxt: add support for aarch32
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
@ 2020-08-25 19:05             ` Ajit Khaparde
  0 siblings, 0 replies; 72+ messages in thread
From: Ajit Khaparde @ 2020-08-25 19:05 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Bruce Richardson, Aaron Conole, maicolgabriel, dpdk-dev, Ruifeng Wang

On Tue, Aug 25, 2020 at 6:04 AM Juraj Linkeš <juraj.linkes@pantheon.tech>
wrote:

> From: Ruifeng Wang <ruifeng.wang@arm.com>
>
> Expand vector PMD support to aarch32.
>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
>

Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

> ---
>  drivers/net/bnxt/bnxt_rxq.h | 2 +-
>  drivers/net/bnxt/bnxt_rxr.h | 2 +-
>  drivers/net/bnxt/bnxt_txr.h | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
> index d5ce3b6d5..1c4027711 100644
> --- a/drivers/net/bnxt/bnxt_rxq.h
> +++ b/drivers/net/bnxt/bnxt_rxq.h
> @@ -22,7 +22,7 @@ struct bnxt_rx_queue {
>         uint16_t                nb_rx_hold; /* num held free RX desc */
>         uint16_t                rx_free_thresh; /* max free RX desc to
> hold */
>         uint16_t                queue_id; /* RX queue index */
> -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
> +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) ||
> defined(RTE_ARCH_ARM)
>         uint16_t                rxrearm_nb; /* number of descs to reinit.
> */
>         uint16_t                rxrearm_start; /* next desc index to
> reinit. */
>  #endif
> diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
> index 2bf46cd91..e2fba1647 100644
> --- a/drivers/net/bnxt/bnxt_rxr.h
> +++ b/drivers/net/bnxt/bnxt_rxr.h
> @@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
>  int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
>  int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
>
> -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
> +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) ||
> defined(RTE_ARCH_ARM)
>  uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
>                             uint16_t nb_pkts);
>  int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
> diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
> index 7715c11b8..38e5ac9df 100644
> --- a/drivers/net/bnxt/bnxt_txr.h
> +++ b/drivers/net/bnxt/bnxt_txr.h
> @@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf
> **tx_pkts,
>                                uint16_t nb_pkts);
>  uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
>                               uint16_t nb_pkts);
> -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
> +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) ||
> defined(RTE_ARCH_ARM)
>  uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
>                             uint16_t nb_pkts);
>  #endif
> --
> 2.20.1
>
>

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

* Re: [dpdk-dev] [PATCH v8 5/5] doc: add aarch32 build guidance
  2020-08-25 14:03             ` Aaron Conole
@ 2020-08-26  3:12               ` Phil Yang
  0 siblings, 0 replies; 72+ messages in thread
From: Phil Yang @ 2020-08-26  3:12 UTC (permalink / raw)
  To: Aaron Conole, Juraj Linkeš
  Cc: bruce.richardson, maicolgabriel, dev, nd, jerinj, nd

Aaron Conole <aconole@redhat.com> writes:

> Subject: Re: [PATCH v8 5/5] doc: add aarch32 build guidance
> 
> Juraj Linkeš <juraj.linkes@pantheon.tech> writes:
> 
> > From: Phil Yang <phil.yang@arm.com>
> >
> > Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.
> >
> > Signed-off-by: Phil Yang <phil.yang@arm.com>
> > ---
> >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 30 ++++++++++++++-----
> >  1 file changed, 23 insertions(+), 7 deletions(-)
> >
> > diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > index c5875a6d5..07085e3ea 100644
> > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > @@ -1,15 +1,16 @@
> >  ..  SPDX-License-Identifier: BSD-3-Clause
> >      Copyright(c) 2018 ARM Corporation.
> >
> > -Cross compile DPDK for ARM64
> > -============================
> > -This chapter describes how to cross compile DPDK for ARM64 from x86
> build hosts.
> > +Cross compile DPDK for aarch64 and aarch32
> > +==========================================
> > +This chapter describes how to cross compile DPDK for aarch64 from x86
> build hosts and compile
> > +32-bit aarch32 DPDK from aarch64 build hosts.
> >
> >  .. note::
> >
> > -   Whilst it is recommended to natively build DPDK on ARM64 (just
> > -   like with x86), it is also possible to cross-build DPDK for ARM64. An
> > -   ARM64 cross compile GNU toolchain is used for this.
> > +   Whilst it is recommended to natively build DPDK on aarch64 (just
> > +   like with x86), it is also possible to cross-build DPDK for aarch64.
> > +   An aarch64 cross compile GNU toolchain is used for this.
> >
> >  Obtain the cross tool chain
> >  ---------------------------
> > @@ -88,18 +89,33 @@ To install it in Ubuntu::
> >
> >     sudo apt-get install pkg-config-aarch64-linux-gnu
> >
> > +.. note::
> > +
> > +    Some aarch64 platforms support EL0 aarch32 mode, which means the
> 32-bit aarch32 applications
> > +    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-
> gnueabihf`` is required
> > +    for aarch32 on aarch64. To install it in Ubuntu::
> > +
> > +       sudo dpkg --add-architecture armhf
> > +       sudo apt-get update
> > +       sudo apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make
> binutils
> > +
> 
> Is 'make' still needed?  I don't run Ubuntu, so I'm not sure.


No, both 'GCC' and 'make' are not mandatory in this case.
Will update it in the next version.


> 
> >  To cross-compile DPDK on a desired target machine we can use the
> following
> >  command::
> >
> >  	meson cross-build --cross-file <target_machine_configuration>
> >  	ninja -C cross-build
> >
> > -For example if the target machine is arm64 we can use the following
                                                                                      ^^^ Will use 'users' instead               


> > +For example if the target machine is aarch64 we can use the following
                                                                                         ^^^ Will use 'users' instead

> >  command::
> >
> >  	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
> >  	ninja -C arm64-build
> >
> > +If the target machine is aarch32 we can use the following command::
                                                                   ^^^ Will use 'users' instead

> > +
> > +	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
> > +	ninja -C arm32-build
> > +
> >  Configure and Cross Compile DPDK using Make
> >  -------------------------------------------
> >  To configure a build, choose one of the target configurations, like arm64-
> dpaa-linux-gcc and arm64-thunderx-linux-gcc.


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

* Re: [dpdk-dev] [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-08-25 14:16             ` Aaron Conole
@ 2020-08-26  6:21               ` Juraj Linkeš
  0 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-26  6:21 UTC (permalink / raw)
  To: Aaron Conole; +Cc: bruce.richardson, maicolgabriel, dev



> -----Original Message-----
> From: Aaron Conole <aconole@redhat.com>
> Sent: Tuesday, August 25, 2020 4:16 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; maicolgabriel@hotmail.com; dev@dpdk.org
> Subject: Re: [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
> 
> Juraj Linkeš <juraj.linkes@pantheon.tech> writes:
> 
> > Add two jobs (static and shared libs), both building on aarch64 and
> > producing 32-bit arm binaries executable on armv8-a, but not armv7.
> > Do not run tests in these jobs.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  .ci/linux-build.sh |  7 ++++++-
> >  .travis.yml        | 19 +++++++++++++++++++
> >  2 files changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > d079801d7..c042b065c 100755
> > --- a/.ci/linux-build.sh
> > +++ b/.ci/linux-build.sh
> > @@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
> >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> >  fi
> >
> > +if [ "$AARCH32" = "1" ]; then
> > +    # convert the arch specifier
> > +    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
> > +fi
> > +
> >  if [ "$BUILD_DOCS" = "1" ]; then
> >      OPTS="$OPTS -Denable_docs=true"
> >  fi
> > @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
> >  meson build --werror $OPTS
> >  ninja -C build
> >
> > -if [ "$AARCH64" != "1" ]; then
> > +if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname
> > +-m)"; then
> 
> I'm not sure about this.  This will degrade the 32-bit x86 build, since it will no
> longer execute the test-null.sh script.
> 
> Maybe we should re-use that flag for this series.  BUILD_32BIT ??
> 

So this omits running test-null.sh with 32-bit builds on 64bit systems and we want to run that? Then it's probably the easiest to just disable the check for x86_64 -> aarch64 and x86_64 -> aarch32 builds. I wanted something more elegant here but it's a bit more complicated.

> >      devtools/test-null.sh
> >  fi
> >
> > diff --git a/.travis.yml b/.travis.yml index d6eeab371..850faaac1
> > 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
> >    - *required_packages
> >    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross,
> > pkg-config-aarch64-linux-gnu]
> >
> > +_arm_32b_packages: &arm_32b_packages
> > +  - *required_packages
> > +  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross,
> > +pkg-config-arm-linux-gnueabihf]
> > +
> >  _build_32b_packages: &build_32b_packages
> >    - *required_packages
> >    - [gcc-multilib]
> > @@ -98,6 +102,21 @@ jobs:
> >          packages:
> >            - *required_packages
> >            - *doc_packages
> > +  # aarch64 cross-compiling aarch32 jobs
> > +  - env: DEF_LIB="shared" AARCH32=1
> > +    arch: arm64
> > +    compiler: gcc
> > +    addons:
> > +      apt:
> > +        packages:
> > +          - *arm_32b_packages
> > +  - env: DEF_LIB="static" AARCH32=1
> > +    arch: arm64
> > +    compiler: gcc
> > +    addons:
> > +      apt:
> > +        packages:
> > +          - *arm_32b_packages
> >    # aarch64 clang jobs
> >    - env: DEF_LIB="static"
> >      arch: arm64
> 


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

* [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support
  2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                             ` (4 preceding siblings ...)
  2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 5/5] doc: add aarch32 build guidance Juraj Linkeš
@ 2020-08-28 11:38           ` Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
                               ` (5 more replies)
  5 siblings, 6 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-28 11:38 UTC (permalink / raw)
  To: thomas, david.marchand, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Add support for aarch32 cross build in meson
and add aarch64 -> aarch32 cross build to Travis.

Aarch32 is an execution state that allows execution of 32-bit code on
armv8 machines. This execution state contains a superset of previous
armv7 32-bit instructions and features. Thus the aarch32 build is
distinct from arvm7 build.

Tested here:
[v6] https://travis-ci.com/github/jlinkes/dpdk/builds/179252628
[v7] https://travis-ci.com/github/jlinkes/dpdk/builds/179723067
[v8] https://travis-ci.com/github/jlinkes/dpdk/builds/181307330
[v9] https://travis-ci.com/github/jlinkes/dpdk/builds/181781602

v4:
Removed disabled drivers which actually build on arm32.
Also tested the patchset with series 9609 which fixes underlying
failures.

v5:
Changed the condition for running test-null.sh in ci.
Re-uploaded after underlying fixes have been committed.

v6:
Changed the condition for running test-null.sh again.
Reworked the patch to do aarch32 build instead of arvm7-a build.
Simplified meson build flags. Changed commit msgs.
Added 32b qualifier to .travis.yml.
Added a patch with fixes for bnxt.
Added a patch with cross compilation docs.

v7:
Rebased the patchset.

v8:
Removed Makefile additions from net/bnxt patch.

v9:
Changed ci test-null.sh condition, only run it if not
cross-compiling aarch64 nor aarch32.
Cleaned up docs.

Juraj Linkeš (3):
  build: add aarch32 meson build flags
  build: add aarch32 to meson cross-compilation
  ci: add aarch64 -> aarch32 cross compiling jobs

Phil Yang (1):
  doc: add aarch32 build guidance

Ruifeng Wang (1):
  net/bnxt: add support for aarch32

 .ci/linux-build.sh                            |  7 +++-
 .travis.yml                                   | 19 +++++++++++
 config/arm/arm32_armv8a_linux_gcc             | 17 ++++++++++
 config/arm/meson.build                        | 20 +++++++++--
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++++++++------
 drivers/net/bnxt/bnxt_rxq.h                   |  2 +-
 drivers/net/bnxt/bnxt_rxr.h                   |  2 +-
 drivers/net/bnxt/bnxt_txr.h                   |  2 +-
 8 files changed, 87 insertions(+), 16 deletions(-)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 1/5] net/bnxt: add support for aarch32
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
@ 2020-08-28 11:38             ` Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 2/5] build: add aarch32 meson build flags Juraj Linkeš
                               ` (4 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-28 11:38 UTC (permalink / raw)
  To: thomas, david.marchand, aconole, maicolgabriel
  Cc: dev, juraj.linkes, Ruifeng Wang

From: Ruifeng Wang <ruifeng.wang@arm.com>

Expand vector PMD support to aarch32.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxq.h | 2 +-
 drivers/net/bnxt/bnxt_rxr.h | 2 +-
 drivers/net/bnxt/bnxt_txr.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index d5ce3b6d5..1c4027711 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {
 	uint16_t		nb_rx_hold; /* num held free RX desc */
 	uint16_t		rx_free_thresh; /* max free RX desc to hold */
 	uint16_t		queue_id; /* RX queue index */
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 	uint16_t		rxrearm_nb; /* number of descs to reinit. */
 	uint16_t		rxrearm_start; /* next desc index to reinit. */
 #endif
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 2bf46cd91..e2fba1647 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 			    uint16_t nb_pkts);
 int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 7715c11b8..38e5ac9df 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			      uint16_t nb_pkts);
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts);
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 2/5] build: add aarch32 meson build flags
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
@ 2020-08-28 11:38             ` Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
                               ` (3 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-28 11:38 UTC (permalink / raw)
  To: thomas, david.marchand, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Add aarch32 extra build flags and aarch32 machine flags to generic
machine args.
Also modify how arm flags are updated in meson build - for 32-bit build,
update only if cross-compiling.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8728051d5..b29f27097 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -63,6 +63,11 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_aarch32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+        ['RTE_MAX_LCORE', 256]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -90,6 +95,7 @@ flags_octeontx2_extra = [
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc']],
 	['native', ['-march=native']],
+	['aarch32', ['-march=armv8-a', '-mfpu=neon'], flags_aarch32_extra],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
 	['0xd07', ['-mcpu=cortex-a57']],
@@ -129,15 +135,23 @@ impl_0x69 = ['Intel', flags_generic, machine_args_generic]
 impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
-
+update_flags = false
 if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARM', 1)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
+	if meson.is_cross_build()
+		update_flags = true
+		impl_id = meson.get_cross_property('implementor_id', 'aarch32')
+		impl_pn = meson.get_cross_property('implementor_pn', 'default')
+		machine = get_variable('impl_' + impl_id)
+	else
+		machine_args += '-mfpu=neon'
+	endif
 else
+	update_flags = true
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
@@ -172,7 +186,9 @@ else
 		impl_pn = meson.get_cross_property('implementor_pn', 'default')
 		machine = get_variable('impl_' + impl_id)
 	endif
+endif
 
+if update_flags == true
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
 	foreach flag: flags_common_default
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 3/5] build: add aarch32 to meson cross-compilation
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 2/5] build: add aarch32 meson build flags Juraj Linkeš
@ 2020-08-28 11:38             ` Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
                               ` (2 subsequent siblings)
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-28 11:38 UTC (permalink / raw)
  To: thomas, david.marchand, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Create meson cross file arm32_armv8a_linux_gcc. Use arm-linux-gnueabihf-
toolset which comes with standard packages on most used systems, such as
Ubuntu and CentOS.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm32_armv8a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

diff --git a/config/arm/arm32_armv8a_linux_gcc b/config/arm/arm32_armv8a_linux_gcc
new file mode 100644
index 000000000..d3c4bce6c
--- /dev/null
+++ b/config/arm/arm32_armv8a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = '0x41'
+implementor_pn = 'aarch32'
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                               ` (2 preceding siblings ...)
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
@ 2020-08-28 11:38             ` Juraj Linkeš
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 5/5] doc: add aarch32 build guidance Juraj Linkeš
  2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-28 11:38 UTC (permalink / raw)
  To: thomas, david.marchand, aconole, maicolgabriel; +Cc: dev, juraj.linkes

Add two jobs (static and shared libs), both building on aarch64 and
producing 32-bit arm binaries executable on armv8-a, but not armv7.
Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..dd32392a9 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$AARCH32" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if [ "$AARCH64" != "1" ] and [ "$AARCH32" != "1" ]; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index d6eeab371..850faaac1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_32b_packages: &arm_32b_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _build_32b_packages: &build_32b_packages
   - *required_packages
   - [gcc-multilib]
@@ -98,6 +102,21 @@ jobs:
         packages:
           - *required_packages
           - *doc_packages
+  # aarch64 cross-compiling aarch32 jobs
+  - env: DEF_LIB="shared" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
+  - env: DEF_LIB="static" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 5/5] doc: add aarch32 build guidance
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                               ` (3 preceding siblings ...)
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
@ 2020-08-28 11:38             ` Juraj Linkeš
  2020-09-11 13:20               ` Aaron Conole
  2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  5 siblings, 1 reply; 72+ messages in thread
From: Juraj Linkeš @ 2020-08-28 11:38 UTC (permalink / raw)
  To: thomas, david.marchand, aconole, maicolgabriel
  Cc: dev, juraj.linkes, Phil Yang

From: Phil Yang <phil.yang@arm.com>

Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.

Change-Id: Ib4281defa37ed4d08e1c3210c94fb7ce73b36449
Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++++++++------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
index c5875a6d5..fd0405d6d 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -1,15 +1,16 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2018 ARM Corporation.
 
-Cross compile DPDK for ARM64
-============================
-This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts.
+Cross compile DPDK for aarch64 and aarch32
+==========================================
+This chapter describes how to cross compile DPDK for aarch64 from x86 build hosts and compile
+32-bit aarch32 DPDK from aarch64 build hosts.
 
 .. note::
 
-   Whilst it is recommended to natively build DPDK on ARM64 (just
-   like with x86), it is also possible to cross-build DPDK for ARM64. An
-   ARM64 cross compile GNU toolchain is used for this.
+   Whilst it is recommended to natively build DPDK on aarch64 (just
+   like with x86), it is also possible to cross-build DPDK for aarch64.
+   An aarch64 cross compile GNU toolchain is used for this.
 
 Obtain the cross tool chain
 ---------------------------
@@ -88,18 +89,31 @@ To install it in Ubuntu::
 
    sudo apt-get install pkg-config-aarch64-linux-gnu
 
-To cross-compile DPDK on a desired target machine we can use the following
-command::
+.. note::
+
+    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-bit aarch32 applications
+    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-gnueabihf`` is required
+    for aarch32 on aarch64. To install it in Ubuntu::
+
+       sudo dpkg --add-architecture armhf
+       sudo apt-get update
+       sudo apt-get install -y gcc-arm-linux-gnueabihf libc6:armhf binutils
+
+To cross-compile DPDK on a desired target machine use the following command::
 
 	meson cross-build --cross-file <target_machine_configuration>
 	ninja -C cross-build
 
-For example if the target machine is arm64 we can use the following
-command::
+For example if the target machine is aarch64 use the following command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
+If the target machine is aarch32 use the following command::
+
+	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
+	ninja -C arm32-build
+
 Configure and Cross Compile DPDK using Make
 -------------------------------------------
 To configure a build, choose one of the target configurations, like arm64-dpaa-linux-gcc and arm64-thunderx-linux-gcc.
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v9 5/5] doc: add aarch32 build guidance
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 5/5] doc: add aarch32 build guidance Juraj Linkeš
@ 2020-09-11 13:20               ` Aaron Conole
  2020-09-16  8:04                 ` Juraj Linkeš
  0 siblings, 1 reply; 72+ messages in thread
From: Aaron Conole @ 2020-09-11 13:20 UTC (permalink / raw)
  To: Juraj Linkeš; +Cc: thomas, david.marchand, maicolgabriel, dev, Phil Yang

Juraj Linkeš <juraj.linkes@pantheon.tech> writes:

> From: Phil Yang <phil.yang@arm.com>
>
> Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.
>
> Change-Id: Ib4281defa37ed4d08e1c3210c94fb7ce73b36449
> Signed-off-by: Phil Yang <phil.yang@arm.com>
> ---

I think Change-Id is not a tag that is used in DPDK.  Otherwise, this
looks good to me.

Consider the series ACK with 'Change-Id' removed.

>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++++++++------
>  1 file changed, 24 insertions(+), 10 deletions(-)
>
> diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> index c5875a6d5..fd0405d6d 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -1,15 +1,16 @@
>  ..  SPDX-License-Identifier: BSD-3-Clause
>      Copyright(c) 2018 ARM Corporation.
>  
> -Cross compile DPDK for ARM64
> -============================
> -This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts.
> +Cross compile DPDK for aarch64 and aarch32
> +==========================================
> +This chapter describes how to cross compile DPDK for aarch64 from x86 build hosts and compile
> +32-bit aarch32 DPDK from aarch64 build hosts.
>  
>  .. note::
>  
> -   Whilst it is recommended to natively build DPDK on ARM64 (just
> -   like with x86), it is also possible to cross-build DPDK for ARM64. An
> -   ARM64 cross compile GNU toolchain is used for this.
> +   Whilst it is recommended to natively build DPDK on aarch64 (just
> +   like with x86), it is also possible to cross-build DPDK for aarch64.
> +   An aarch64 cross compile GNU toolchain is used for this.
>  
>  Obtain the cross tool chain
>  ---------------------------
> @@ -88,18 +89,31 @@ To install it in Ubuntu::
>  
>     sudo apt-get install pkg-config-aarch64-linux-gnu
>  
> -To cross-compile DPDK on a desired target machine we can use the following
> -command::
> +.. note::
> +
> +    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-bit aarch32 applications
> +    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-gnueabihf`` is required
> +    for aarch32 on aarch64. To install it in Ubuntu::
> +
> +       sudo dpkg --add-architecture armhf
> +       sudo apt-get update
> +       sudo apt-get install -y gcc-arm-linux-gnueabihf libc6:armhf binutils
> +
> +To cross-compile DPDK on a desired target machine use the following command::
>  
>  	meson cross-build --cross-file <target_machine_configuration>
>  	ninja -C cross-build
>  
> -For example if the target machine is arm64 we can use the following
> -command::
> +For example if the target machine is aarch64 use the following command::
>  
>  	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
>  	ninja -C arm64-build
>  
> +If the target machine is aarch32 use the following command::
> +
> +	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
> +	ninja -C arm32-build
> +
>  Configure and Cross Compile DPDK using Make
>  -------------------------------------------
>  To configure a build, choose one of the target configurations, like arm64-dpaa-linux-gcc and arm64-thunderx-linux-gcc.


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

* Re: [dpdk-dev] [PATCH v9 5/5] doc: add aarch32 build guidance
  2020-09-11 13:20               ` Aaron Conole
@ 2020-09-16  8:04                 ` Juraj Linkeš
  0 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-09-16  8:04 UTC (permalink / raw)
  To: Aaron Conole; +Cc: thomas, david.marchand, maicolgabriel, dev, Phil Yang



> -----Original Message-----
> From: Aaron Conole <aconole@redhat.com>
> Sent: Friday, September 11, 2020 3:20 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> maicolgabriel@hotmail.com; dev@dpdk.org; Phil Yang <phil.yang@arm.com>
> Subject: Re: [PATCH v9 5/5] doc: add aarch32 build guidance
> 
> Juraj Linkeš <juraj.linkes@pantheon.tech> writes:
> 
> > From: Phil Yang <phil.yang@arm.com>
> >
> > Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.
> >
> > Change-Id: Ib4281defa37ed4d08e1c3210c94fb7ce73b36449
> > Signed-off-by: Phil Yang <phil.yang@arm.com>
> > ---
> 
> I think Change-Id is not a tag that is used in DPDK.  Otherwise, this looks good to
> me.
> 
> Consider the series ACK with 'Change-Id' removed.
> 

Great, I'll resubmit.

> >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34
> > +++++++++++++------
> >  1 file changed, 24 insertions(+), 10 deletions(-)
> >
> > diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > index c5875a6d5..fd0405d6d 100644
> > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > @@ -1,15 +1,16 @@
> >  ..  SPDX-License-Identifier: BSD-3-Clause
> >      Copyright(c) 2018 ARM Corporation.
> >
> > -Cross compile DPDK for ARM64
> > -============================
> > -This chapter describes how to cross compile DPDK for ARM64 from x86 build
> hosts.
> > +Cross compile DPDK for aarch64 and aarch32
> > +==========================================
> > +This chapter describes how to cross compile DPDK for aarch64 from x86
> > +build hosts and compile 32-bit aarch32 DPDK from aarch64 build hosts.
> >
> >  .. note::
> >
> > -   Whilst it is recommended to natively build DPDK on ARM64 (just
> > -   like with x86), it is also possible to cross-build DPDK for ARM64. An
> > -   ARM64 cross compile GNU toolchain is used for this.
> > +   Whilst it is recommended to natively build DPDK on aarch64 (just
> > +   like with x86), it is also possible to cross-build DPDK for aarch64.
> > +   An aarch64 cross compile GNU toolchain is used for this.
> >
> >  Obtain the cross tool chain
> >  ---------------------------
> > @@ -88,18 +89,31 @@ To install it in Ubuntu::
> >
> >     sudo apt-get install pkg-config-aarch64-linux-gnu
> >
> > -To cross-compile DPDK on a desired target machine we can use the
> > following
> > -command::
> > +.. note::
> > +
> > +    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-
> bit aarch32 applications
> > +    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-
> gnueabihf`` is required
> > +    for aarch32 on aarch64. To install it in Ubuntu::
> > +
> > +       sudo dpkg --add-architecture armhf
> > +       sudo apt-get update
> > +       sudo apt-get install -y gcc-arm-linux-gnueabihf libc6:armhf
> > + binutils
> > +
> > +To cross-compile DPDK on a desired target machine use the following
> command::
> >
> >  	meson cross-build --cross-file <target_machine_configuration>
> >  	ninja -C cross-build
> >
> > -For example if the target machine is arm64 we can use the following
> > -command::
> > +For example if the target machine is aarch64 use the following command::
> >
> >  	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
> >  	ninja -C arm64-build
> >
> > +If the target machine is aarch32 use the following command::
> > +
> > +	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
> > +	ninja -C arm32-build
> > +
> >  Configure and Cross Compile DPDK using Make
> >  -------------------------------------------
> >  To configure a build, choose one of the target configurations, like arm64-
> dpaa-linux-gcc and arm64-thunderx-linux-gcc.
> 


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

* [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support
  2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                               ` (4 preceding siblings ...)
  2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 5/5] doc: add aarch32 build guidance Juraj Linkeš
@ 2020-09-16  8:21             ` Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
                                 ` (4 more replies)
  5 siblings, 5 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-09-16  8:21 UTC (permalink / raw)
  To: thomas, bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add support for aarch32 cross build in meson
and add aarch64 -> aarch32 cross build to Travis.

Aarch32 is an execution state that allows execution of 32-bit code on
armv8 machines. This execution state contains a superset of previous
armv7 32-bit instructions and features. Thus the aarch32 build is
distinct from arvm7 build.

v4:
Removed disabled drivers which actually build on arm32.
Also tested the patchset with series 9609 which fixes underlying
failures.

v5:
Changed the condition for running test-null.sh in ci.
Re-uploaded after underlying fixes have been committed.

v6:
Changed the condition for running test-null.sh again.
Reworked the patch to do aarch32 build instead of arvm7-a build.
Simplified meson build flags. Changed commit msgs.
Added 32b qualifier to .travis.yml.
Added a patch with fixes for bnxt.
Added a patch with cross compilation docs.

v7:
Rebased the patchset.

v8:
Removed Makefile additions from net/bnxt patch.

v9:
Changed ci test-null.sh condition, only run it if not
cross-compiling aarch64 nor aarch32.
Cleaned up docs.

v10:
Fixed doc: add aarch32 build guidance commit message.

Juraj Linkeš (3):
  build: add aarch32 meson build flags
  build: add aarch32 to meson cross-compilation
  ci: add aarch64 -> aarch32 cross compiling jobs

Phil Yang (1):
  doc: add aarch32 build guidance

Ruifeng Wang (1):
  net/bnxt: add support for aarch32

 .ci/linux-build.sh                            |  7 +++-
 .travis.yml                                   | 19 +++++++++++
 config/arm/arm32_armv8a_linux_gcc             | 17 ++++++++++
 config/arm/meson.build                        | 20 +++++++++--
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++++++++------
 drivers/net/bnxt/bnxt_rxq.h                   |  2 +-
 drivers/net/bnxt/bnxt_rxr.h                   |  2 +-
 drivers/net/bnxt/bnxt_txr.h                   |  2 +-
 8 files changed, 87 insertions(+), 16 deletions(-)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 1/5] net/bnxt: add support for aarch32
  2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
@ 2020-09-16  8:21               ` Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 2/5] build: add aarch32 meson build flags Juraj Linkeš
                                 ` (3 subsequent siblings)
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-09-16  8:21 UTC (permalink / raw)
  To: thomas, bruce.richardson, aconole, maicolgabriel
  Cc: juraj.linkes, dev, Ruifeng Wang

From: Ruifeng Wang <ruifeng.wang@arm.com>

Expand vector PMD support to aarch32.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxq.h | 2 +-
 drivers/net/bnxt/bnxt_rxr.h | 2 +-
 drivers/net/bnxt/bnxt_txr.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index d5ce3b6d5..1c4027711 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -22,7 +22,7 @@ struct bnxt_rx_queue {
 	uint16_t		nb_rx_hold; /* num held free RX desc */
 	uint16_t		rx_free_thresh; /* max free RX desc to hold */
 	uint16_t		queue_id; /* RX queue index */
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 	uint16_t		rxrearm_nb; /* number of descs to reinit. */
 	uint16_t		rxrearm_start; /* next desc index to reinit. */
 #endif
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 2bf46cd91..e2fba1647 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -221,7 +221,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 			    uint16_t nb_pkts);
 int bnxt_rxq_vec_setup(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h
index 7715c11b8..38e5ac9df 100644
--- a/drivers/net/bnxt/bnxt_txr.h
+++ b/drivers/net/bnxt/bnxt_txr.h
@@ -59,7 +59,7 @@ uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			       uint16_t nb_pkts);
 uint16_t bnxt_dummy_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			      uint16_t nb_pkts);
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_ARCH_ARM)
 uint16_t bnxt_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 			    uint16_t nb_pkts);
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 2/5] build: add aarch32 meson build flags
  2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
@ 2020-09-16  8:21               ` Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
                                 ` (2 subsequent siblings)
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-09-16  8:21 UTC (permalink / raw)
  To: thomas, bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add aarch32 extra build flags and aarch32 machine flags to generic
machine args.
Also modify how arm flags are updated in meson build - for 32-bit build,
update only if cross-compiling.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8728051d5..b29f27097 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -63,6 +63,11 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_aarch32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+        ['RTE_MAX_LCORE', 256]]
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -90,6 +95,7 @@ flags_octeontx2_extra = [
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc']],
 	['native', ['-march=native']],
+	['aarch32', ['-march=armv8-a', '-mfpu=neon'], flags_aarch32_extra],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
 	['0xd07', ['-mcpu=cortex-a57']],
@@ -129,15 +135,23 @@ impl_0x69 = ['Intel', flags_generic, machine_args_generic]
 impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
-
+update_flags = false
 if not dpdk_conf.get('RTE_ARCH_64')
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARM', 1)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
+	if meson.is_cross_build()
+		update_flags = true
+		impl_id = meson.get_cross_property('implementor_id', 'aarch32')
+		impl_pn = meson.get_cross_property('implementor_pn', 'default')
+		machine = get_variable('impl_' + impl_id)
+	else
+		machine_args += '-mfpu=neon'
+	endif
 else
+	update_flags = true
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
@@ -172,7 +186,9 @@ else
 		impl_pn = meson.get_cross_property('implementor_pn', 'default')
 		machine = get_variable('impl_' + impl_id)
 	endif
+endif
 
+if update_flags == true
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
 	foreach flag: flags_common_default
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 3/5] build: add aarch32 to meson cross-compilation
  2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 2/5] build: add aarch32 meson build flags Juraj Linkeš
@ 2020-09-16  8:21               ` Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 5/5] doc: add aarch32 build guidance Juraj Linkeš
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-09-16  8:21 UTC (permalink / raw)
  To: thomas, bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Create meson cross file arm32_armv8a_linux_gcc. Use arm-linux-gnueabihf-
toolset which comes with standard packages on most used systems, such as
Ubuntu and CentOS.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm32_armv8a_linux_gcc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 config/arm/arm32_armv8a_linux_gcc

diff --git a/config/arm/arm32_armv8a_linux_gcc b/config/arm/arm32_armv8a_linux_gcc
new file mode 100644
index 000000000..d3c4bce6c
--- /dev/null
+++ b/config/arm/arm32_armv8a_linux_gcc
@@ -0,0 +1,17 @@
+[binaries]
+c = 'arm-linux-gnueabihf-gcc'
+cpp = 'arm-linux-gnueabihf-cpp'
+ar = 'arm-linux-gnueabihf-gcc-ar'
+strip = 'arm-linux-gnueabihf-strip'
+pkgconfig = 'arm-linux-gnueabihf-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = '0x41'
+implementor_pn = 'aarch32'
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 4/5] ci: add aarch64 -> aarch32 cross compiling jobs
  2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                                 ` (2 preceding siblings ...)
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
@ 2020-09-16  8:21               ` Juraj Linkeš
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 5/5] doc: add aarch32 build guidance Juraj Linkeš
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-09-16  8:21 UTC (permalink / raw)
  To: thomas, bruce.richardson, aconole, maicolgabriel; +Cc: juraj.linkes, dev

Add two jobs (static and shared libs), both building on aarch64 and
producing 32-bit arm binaries executable on armv8-a, but not armv7.
Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..cdb371565 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$AARCH32" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm32_armv8a_linux_gcc"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if [ "$AARCH64" != "1" ] && [ "$AARCH32" != "1" ]; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index d6eeab371..850faaac1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_32b_packages: &arm_32b_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _build_32b_packages: &build_32b_packages
   - *required_packages
   - [gcc-multilib]
@@ -98,6 +102,21 @@ jobs:
         packages:
           - *required_packages
           - *doc_packages
+  # aarch64 cross-compiling aarch32 jobs
+  - env: DEF_LIB="shared" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
+  - env: DEF_LIB="static" AARCH32=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_32b_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 5/5] doc: add aarch32 build guidance
  2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
                                 ` (3 preceding siblings ...)
  2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
@ 2020-09-16  8:21               ` Juraj Linkeš
  4 siblings, 0 replies; 72+ messages in thread
From: Juraj Linkeš @ 2020-09-16  8:21 UTC (permalink / raw)
  To: thomas, bruce.richardson, aconole, maicolgabriel
  Cc: juraj.linkes, dev, Phil Yang

From: Phil Yang <phil.yang@arm.com>

Add cross-compiling guidance for 32-bit aarch32 DPDK on aarch64 host.

Signed-off-by: Phil Yang <phil.yang@arm.com>
---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++++++++------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
index 8a1d0e88b..1f2ff751d 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -1,15 +1,16 @@
 ..  SPDX-License-Identifier: BSD-3-Clause
     Copyright(c) 2018 ARM Corporation.
 
-Cross compile DPDK for ARM64
-============================
-This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts.
+Cross compile DPDK for aarch64 and aarch32
+==========================================
+This chapter describes how to cross compile DPDK for aarch64 from x86 build hosts and compile
+32-bit aarch32 DPDK from aarch64 build hosts.
 
 .. note::
 
-   Whilst it is recommended to natively build DPDK on ARM64 (just
-   like with x86), it is also possible to cross-build DPDK for ARM64. An
-   ARM64 cross compile GNU toolchain is used for this.
+   Whilst it is recommended to natively build DPDK on aarch64 (just
+   like with x86), it is also possible to cross-build DPDK for aarch64.
+   An aarch64 cross compile GNU toolchain is used for this.
 
 Obtain the cross tool chain
 ---------------------------
@@ -88,14 +89,27 @@ To install it in Ubuntu::
 
    sudo apt-get install pkg-config-aarch64-linux-gnu
 
-To cross-compile DPDK on a desired target machine we can use the following
-command::
+.. note::
+
+    Some aarch64 platforms support EL0 aarch32 mode, which means the 32-bit aarch32 applications
+    can run on aarch64. The armhf architecture toolchain ``gcc-arm-linux-gnueabihf`` is required
+    for aarch32 on aarch64. To install it in Ubuntu::
+
+       sudo dpkg --add-architecture armhf
+       sudo apt-get update
+       sudo apt-get install -y gcc-arm-linux-gnueabihf libc6:armhf binutils
+
+To cross-compile DPDK on a desired target machine use the following command::
 
 	meson cross-build --cross-file <target_machine_configuration>
 	ninja -C cross-build
 
-For example if the target machine is arm64 we can use the following
-command::
+For example if the target machine is aarch64 use the following command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+If the target machine is aarch32 use the following command::
+
+	meson arm32-build --cross-file config/arm/arm32_armv8a_linux_gcc
+	ninja -C arm32-build
-- 
2.20.1


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

end of thread, back to index

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15  9:03 [dpdk-dev] [PATCH v3 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 1/4] build: port arm32 options from make to meson Juraj Linkeš
2020-04-15 11:45   ` Luca Boccassi
2020-04-16  6:16     ` Juraj Linkeš
2020-04-16  8:53       ` Luca Boccassi
2020-04-16 11:25         ` Juraj Linkeš
2020-04-16 12:00           ` Luca Boccassi
2020-04-16 12:22             ` Juraj Linkeš
2020-04-16 15:11               ` Ruifeng Wang
2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 2/4] build: add arm32 meson build flags Juraj Linkeš
2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 3/4] build: add arm32 meson cross file Juraj Linkeš
2020-04-15  9:03 ` [dpdk-dev] [PATCH v3 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
2020-04-29 10:24 ` [dpdk-dev] [PATCH v4 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 2/4] build: add arm32 meson build flags Juraj Linkeš
2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 3/4] build: add arm32 meson cross file Juraj Linkeš
2020-04-29 10:24   ` [dpdk-dev] [PATCH v4 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
2020-05-05 18:56     ` Aaron Conole
2020-05-11  7:05       ` Juraj Linkeš
2020-07-06  8:28   ` [dpdk-dev] [PATCH v5 0/4] aarch64 -> arm32 cross compilation support Juraj Linkeš
2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 1/4] build: disable vhost NUMA for arm32 Juraj Linkeš
2020-07-06  8:56       ` David Marchand
2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 2/4] build: add arm32 meson build flags Juraj Linkeš
2020-07-06  9:11       ` Jerin Jacob
2020-07-07 20:44         ` Honnappa Nagarahalli
2020-07-08  8:33           ` Jerin Jacob
2020-07-08 20:55             ` Honnappa Nagarahalli
2020-07-09  4:49               ` Jerin Jacob
2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 3/4] build: add arm32 meson cross file Juraj Linkeš
2020-07-06  8:28     ` [dpdk-dev] [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs Juraj Linkeš
2020-07-06  9:11       ` Juraj Linkeš
2020-08-13  9:21     ` [dpdk-dev] [PATCH v6 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 2/5] build: add aarch32 meson build flags Juraj Linkeš
2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
2020-08-14  2:10         ` Ruifeng Wang
2020-08-13  9:21       ` [dpdk-dev] [PATCH v6 5/5] doc: add aarch32 build guidance Juraj Linkeš
2020-08-14 10:31       ` [dpdk-dev] [PATCH v7 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
2020-08-19 17:45           ` Ajit Khaparde
2020-08-20  3:00             ` Ruifeng Wang
2020-08-20  9:13               ` Juraj Linkeš
2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 2/5] build: add aarch32 meson build flags Juraj Linkeš
2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
2020-08-14 10:31         ` [dpdk-dev] [PATCH v7 5/5] doc: add aarch32 build guidance Juraj Linkeš
2020-08-25 13:04         ` [dpdk-dev] [PATCH v8 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
2020-08-25 19:05             ` Ajit Khaparde
2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 2/5] build: add aarch32 meson build flags Juraj Linkeš
2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
2020-08-25 14:16             ` Aaron Conole
2020-08-26  6:21               ` Juraj Linkeš
2020-08-25 13:04           ` [dpdk-dev] [PATCH v8 5/5] doc: add aarch32 build guidance Juraj Linkeš
2020-08-25 14:03             ` Aaron Conole
2020-08-26  3:12               ` Phil Yang
2020-08-28 11:38           ` [dpdk-dev] [PATCH v9 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 2/5] build: add aarch32 meson build flags Juraj Linkeš
2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
2020-08-28 11:38             ` [dpdk-dev] [PATCH v9 5/5] doc: add aarch32 build guidance Juraj Linkeš
2020-09-11 13:20               ` Aaron Conole
2020-09-16  8:04                 ` Juraj Linkeš
2020-09-16  8:21             ` [dpdk-dev] [PATCH v10 0/5] aarch64 -> aarch32 cross compilation support Juraj Linkeš
2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 1/5] net/bnxt: add support for aarch32 Juraj Linkeš
2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 2/5] build: add aarch32 meson build flags Juraj Linkeš
2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 3/5] build: add aarch32 to meson cross-compilation Juraj Linkeš
2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 4/5] ci: add aarch64 -> aarch32 cross compiling jobs Juraj Linkeš
2020-09-16  8:21               ` [dpdk-dev] [PATCH v10 5/5] doc: add aarch32 build guidance Juraj Linkeš

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox