DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC PATCH 0/2] Arm build options rework
@ 2020-09-23 13:19 Juraj Linkeš
  2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options Juraj Linkeš
                   ` (3 more replies)
  0 siblings, 4 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-09-23 13:19 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information.

Instead use user input - the machine meson option to specify the SoC, e.g.:
meson soc_test -Dmachine=thunderx
meson soc_test --cross-file config/arm/thunderx/arm64_thunderx_linux_gcc

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
differs in capabilities or libraries.

Juraj Linkeš (2):
  build: rework Arm build options
  build: disable drivers from file

 config/arm/arm64_armv8_linux_gcc              |  28 ----
 .../arm/{ => armada}/arm64_armada_linux_gcc   |   2 +-
 config/arm/armada/meson.build                 |  31 ++++
 config/arm/default/arm64_armv8_linux_gcc      |  23 +++
 config/arm/default/meson.build                |   8 +
 config/arm/meson.build                        | 139 +++++++++++-------
 .../{ => thunderx}/arm64_thunderx_linux_gcc   |   2 +-
 config/arm/thunderx/meson.build               |  18 +++
 .../thunderxt88/arm64_thunderxt88_linux_gcc   |  16 ++
 config/arm/thunderxt88/meson.build            |  18 +++
 config/meson.build                            |   9 +-
 drivers/meson.build                           |  13 +-
 12 files changed, 218 insertions(+), 89 deletions(-)
 delete mode 100644 config/arm/arm64_armv8_linux_gcc
 rename config/arm/{ => armada}/arm64_armada_linux_gcc (93%)
 create mode 100644 config/arm/armada/meson.build
 create mode 100644 config/arm/default/arm64_armv8_linux_gcc
 create mode 100644 config/arm/default/meson.build
 rename config/arm/{ => thunderx}/arm64_thunderx_linux_gcc (92%)
 create mode 100644 config/arm/thunderx/meson.build
 create mode 100644 config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
 create mode 100644 config/arm/thunderxt88/meson.build

-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options
  2020-09-23 13:19 [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Juraj Linkeš
@ 2020-09-23 13:19 ` Juraj Linkeš
  2020-09-24  4:19   ` Honnappa Nagarahalli
  2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 2/2] build: disable drivers from file Juraj Linkeš
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-09-23 13:19 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current system can identify only the implementer and part number
of the arm device we're targeting, which is enough to identify the
target CPU. However, even the full MIDR information is not enough to
identify the SoC we're targeting.

Expand the "machine" meson variable to allow specifying the target arm
SoC. The SoC identification implies the CPU, so drop the current MIDR
based CPU identification in favor of user input, which is the only way
to identify the target SoC. This implies that native builds are not
possible. Instead do a default (non-optimized, but executable on any
aarch64 device) build.

Also use the machine custom property in cross files for cross builds.

An example of where the current system is insufficient is the cortex-a72
CPU. These cores are used in a variety of SoC from Broadcomm, NXP,
Huawei and others. The MIDR information would only identify the core,
but there's not way to identify the SoC to fine tune the build to it.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armv8_linux_gcc              |  28 ----
 config/arm/default/arm64_armv8_linux_gcc      |  23 +++
 config/arm/default/meson.build                |   8 +
 config/arm/meson.build                        | 139 +++++++++++-------
 .../{ => thunderx}/arm64_thunderx_linux_gcc   |   2 +-
 config/arm/thunderx/meson.build               |  18 +++
 .../thunderxt88/arm64_thunderxt88_linux_gcc   |  16 ++
 config/arm/thunderxt88/meson.build            |  18 +++
 config/meson.build                            |   9 +-
 9 files changed, 177 insertions(+), 84 deletions(-)
 delete mode 100644 config/arm/arm64_armv8_linux_gcc
 create mode 100644 config/arm/default/arm64_armv8_linux_gcc
 create mode 100644 config/arm/default/meson.build
 rename config/arm/{ => thunderx}/arm64_thunderx_linux_gcc (92%)
 create mode 100644 config/arm/thunderx/meson.build
 create mode 100644 config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
 create mode 100644 config/arm/thunderxt88/meson.build

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
deleted file mode 100644
index 88f0ff9da..000000000
--- a/config/arm/arm64_armv8_linux_gcc
+++ /dev/null
@@ -1,28 +0,0 @@
-[binaries]
-c = 'aarch64-linux-gnu-gcc'
-cpp = 'aarch64-linux-gnu-cpp'
-ar = 'aarch64-linux-gnu-gcc-ar'
-strip = 'aarch64-linux-gnu-strip'
-pkgconfig = 'aarch64-linux-gnu-pkg-config'
-pcap-config = ''
-
-[host_machine]
-system = 'linux'
-cpu_family = 'aarch64'
-cpu = 'armv8-a'
-endian = 'little'
-
-[properties]
-implementor_id = 'generic'
-
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
-implementor_pn = 'default'
diff --git a/config/arm/default/arm64_armv8_linux_gcc b/config/arm/default/arm64_armv8_linux_gcc
new file mode 100644
index 000000000..56efd7a05
--- /dev/null
+++ b/config/arm/default/arm64_armv8_linux_gcc
@@ -0,0 +1,23 @@
+[binaries]
+c = 'aarch64-linux-gnu-gcc'
+cpp = 'aarch64-linux-gnu-cpp'
+ar = 'aarch64-linux-gnu-gcc-ar'
+strip = 'aarch64-linux-gnu-strip'
+pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+# Valid values for the machine property are the soc names identified by
+# directories in config/arm
+# Possible suffixes for socs:
+# -mn-kc
+# where m is the number of numa nodes and k is the number of lcores
+# e.g. for thunderx soc the possible values are "thunderx" or "thunderx-1n-48c"
+# the suffixes themselves need to be supported in config/arm/<soc_dir>/meson.build
+machine = 'default'
diff --git a/config/arm/default/meson.build b/config/arm/default/meson.build
new file mode 100644
index 000000000..5714d0084
--- /dev/null
+++ b/config/arm/default/meson.build
@@ -0,0 +1,8 @@
+flags = [
+	['RTE_MACHINE', '"armv8a"'],
+	['RTE_MAX_LCORE', 256],
+	['RTE_USE_C11_MEM_MODEL', true],
+	['RTE_CACHE_LINE_SIZE', 128]
+]
+
+machine_args = ['-march=armv8-a+crc']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8728051d5..05b790f40 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,11 +2,11 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
-arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+if machine == 'native'
+	# arm doesn't support a native build - user input of soc is required
+	# default to the portable build instead of native
+	machine = 'default'
+endif
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -131,6 +131,7 @@ impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if not dpdk_conf.get('RTE_ARCH_64')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARM', 1)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
@@ -138,41 +139,9 @@ if not dpdk_conf.get('RTE_ARCH_64')
 	# mk/machine/armv7a/rte.vars.mk sets it too
 	machine_args += '-mfpu=neon'
 else
+	# aarch64 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
-
-	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 = 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)
-	endif
-
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
 	foreach flag: flags_common_default
@@ -181,30 +150,89 @@ else
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	soc = machine.split('-')[0]
+	# TODO make sure the subdir exists
+	subdir(soc)
+
+	if soc != 'default'
+		# combine common and soc specific flags
+		# TODO check that soc is in the dict
+		flags = flags['common'] + flags[soc]
+	endif
+
+	foreach flag: flags
 		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
+	verified_machine_args = []
+
+	foreach flag: machine_args
+		if cc.has_argument(flag)
+			verified_machine_args += flag
+		else
+			message('Unsupported machine flag "@0@", ignoring'.format(flag))
 		endif
 	endforeach
+	machine_args = verified_machine_args
+
+#	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 = 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)
+#	endif
+#
+#	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
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
@@ -225,3 +253,6 @@ if cc.get_define('__ARM_FEATURE_CRYPTO', args: machine_args) != ''
 	compile_time_cpuflags += ['RTE_CPUFLAG_AES', 'RTE_CPUFLAG_PMULL',
 	'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2']
 endif
+
+message('dpdk conf options after arm stuff: @0@'.format(dpdk_conf))
+
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/thunderx/arm64_thunderx_linux_gcc
similarity index 92%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/thunderx/arm64_thunderx_linux_gcc
index 6572ab615..e53a86e8f 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/thunderx/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+machine = 'thunderx'
diff --git a/config/arm/thunderx/meson.build b/config/arm/thunderx/meson.build
new file mode 100644
index 000000000..873d79a64
--- /dev/null
+++ b/config/arm/thunderx/meson.build
@@ -0,0 +1,18 @@
+flags = {
+	'common': [
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_MACHINE', '"thunderx"'],
+		['RTE_USE_C11_MEM_MODEL', false]
+	],
+	'thunderx': [
+		['RTE_MAX_NUMA_NODES', 2],
+		['RTE_MAX_LCORE', 96]
+	],
+	'thunderx-1n-48c': [
+		['RTE_MAX_NUMA_NODES', 1],
+		['RTE_MAX_LCORE', 48]
+	]
+}
+
+machine_args = ['-march=armv8-a+crc+crypto','-mcpu=thunderx']
diff --git a/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
new file mode 100644
index 000000000..9a622786c
--- /dev/null
+++ b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
@@ -0,0 +1,16 @@
+[binaries]
+c = 'aarch64-linux-gnu-gcc'
+cpp = 'aarch64-linux-gnu-cpp'
+ar = 'aarch64-linux-gnu-gcc-ar'
+strip = 'aarch64-linux-gnu-strip'
+pkgconfig = 'aarch64-linux-gnu-pkg-config'
+pcap-config = ''
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+machine = 'thunderxt88'
diff --git a/config/arm/thunderxt88/meson.build b/config/arm/thunderxt88/meson.build
new file mode 100644
index 000000000..2aa5d2cdd
--- /dev/null
+++ b/config/arm/thunderxt88/meson.build
@@ -0,0 +1,18 @@
+flags = {
+	'common': [
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_MACHINE', '"thunderx"'],
+		['RTE_USE_C11_MEM_MODEL', false]
+	],
+	'thunderxt88': [
+		['RTE_MAX_NUMA_NODES', 2],
+		['RTE_MAX_LCORE', 96]
+	],
+	'thunderxt88-1n-48c': [
+		['RTE_MAX_NUMA_NODES', 1],
+		['RTE_MAX_LCORE', 48]
+	]
+}
+
+machine_args = ['-mcpu=thunderxt88']
diff --git a/config/meson.build b/config/meson.build
index 69f2aeb60..177cbd49c 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -63,7 +63,14 @@ meson.add_install_script('../buildtools/symlink-drivers-solibs.sh',
 
 # set the machine type and cflags for it
 if meson.is_cross_build()
-	machine = host_machine.cpu()
+	if not host_machine.cpu_family().startswith('aarch')
+		# don't change the machine config for aarch32/64 builds
+		# that config is set in the cross file to identify the soc
+		# we're building for
+		machine = host_machine.cpu()
+	else
+		machine = meson.get_cross_property('machine', 'default')
+	endif
 else
 	machine = get_option('machine')
 endif
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH 2/2] build: disable drivers from file
  2020-09-23 13:19 [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Juraj Linkeš
  2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options Juraj Linkeš
@ 2020-09-23 13:19 ` Juraj Linkeš
  2020-09-23 13:58   ` Bruce Richardson
  2020-09-24  3:03 ` [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Honnappa Nagarahalli
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
  3 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-09-23 13:19 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Add the capability to specify which drivers will NOT be build in a file.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .../arm/{ => armada}/arm64_armada_linux_gcc   |  2 +-
 config/arm/armada/meson.build                 | 31 +++++++++++++++++++
 drivers/meson.build                           | 13 +++++---
 3 files changed, 41 insertions(+), 5 deletions(-)
 rename config/arm/{ => armada}/arm64_armada_linux_gcc (93%)
 create mode 100644 config/arm/armada/meson.build

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/armada/arm64_armada_linux_gcc
similarity index 93%
rename from config/arm/arm64_armada_linux_gcc
rename to config/arm/armada/arm64_armada_linux_gcc
index fa40c0398..8b4b5c8ad 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/armada/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+machine = 'armada'
diff --git a/config/arm/armada/meson.build b/config/arm/armada/meson.build
new file mode 100644
index 000000000..22fdce5fe
--- /dev/null
+++ b/config/arm/armada/meson.build
@@ -0,0 +1,31 @@
+flags = {
+	'common': [
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MACHINE', '"armv8a"'],
+		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
+		['CONFIG_RTE_LIBRTE_COMMON_DPAAX=n', false],
+		['CONFIG_RTE_LIBRTE_FSLMC_BUS=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA2_PMD=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n', false],
+		['CONFIG_RTE_LIBRTE_DPAA_PMD=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_CAAM_JR=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=n', false],
+		['CONFIG_RTE_LIBRTE_PFE_PMD=n', false],
+		['CONFIG_RTE_LIBRTE_ENETC_PMD=n', false],
+		['CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n', false],
+		['CONFIG_RTE_LIBRTE_VHOST_NUMA=n', false]
+	],
+	'armada': [
+		['RTE_MAX_NUMA_NODES', 1],
+		['RTE_MAX_LCORE', 16]
+	]
+}
+
+machine_args = ['-march=armv8-a+crc']
diff --git a/drivers/meson.build b/drivers/meson.build
index 5f9526557..c5deb6136 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -76,9 +76,17 @@ foreach subpath:subdirs
 		ext_deps = []
 		pkgconfig_extra_libs = []
 
+		if fmt_name == ''
+			fmt_name = name
+		endif
+		conf_flag = config_flag_fmt.format(fmt_name.to_upper())
+
 		if disabled_drivers.contains(drv_path)
 			build = false
 			reason = 'Explicitly disabled via build config'
+		elif dpdk_conf.has(conf_flag) and not dpdk_conf.get(conf_flag)
+			build = false
+			reason = 'Disabled via configuration file'
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
@@ -113,10 +121,7 @@ foreach subpath:subdirs
 		else
 			enabled_drivers += name
 
-			if fmt_name == ''
-				fmt_name = name
-			endif
-			dpdk_conf.set(config_flag_fmt.format(fmt_name.to_upper()),1)
+			dpdk_conf.set(conf_flag, 1)
 			lib_name = driver_name_fmt.format(fmt_name)
 
 			dpdk_extra_ldflags += pkgconfig_extra_libs
-- 
2.20.1


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

* Re: [dpdk-dev] [RFC PATCH 2/2] build: disable drivers from file
  2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 2/2] build: disable drivers from file Juraj Linkeš
@ 2020-09-23 13:58   ` Bruce Richardson
  2020-09-24  8:31     ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-09-23 13:58 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Sep 23, 2020 at 03:19:21PM +0200, Juraj Linkeš wrote:
> Add the capability to specify which drivers will NOT be build in a file.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .../arm/{ => armada}/arm64_armada_linux_gcc   |  2 +-
>  config/arm/armada/meson.build                 | 31 +++++++++++++++++++
>  drivers/meson.build                           | 13 +++++---
>  3 files changed, 41 insertions(+), 5 deletions(-)
>  rename config/arm/{ => armada}/arm64_armada_linux_gcc (93%)
>  create mode 100644 config/arm/armada/meson.build
> 
> diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/armada/arm64_armada_linux_gcc
> similarity index 93%
> rename from config/arm/arm64_armada_linux_gcc
> rename to config/arm/armada/arm64_armada_linux_gcc
> index fa40c0398..8b4b5c8ad 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/armada/arm64_armada_linux_gcc
> @@ -14,4 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
>  
>  [properties]
> -implementor_id = '0x56'
> +machine = 'armada'
> diff --git a/config/arm/armada/meson.build b/config/arm/armada/meson.build
> new file mode 100644
> index 000000000..22fdce5fe
> --- /dev/null
> +++ b/config/arm/armada/meson.build
> @@ -0,0 +1,31 @@
> +flags = {
> +	'common': [
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MACHINE', '"armv8a"'],
> +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> +		['CONFIG_RTE_LIBRTE_COMMON_DPAAX=n', false],
> +		['CONFIG_RTE_LIBRTE_FSLMC_BUS=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA2_PMD=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n', false],
> +		['CONFIG_RTE_LIBRTE_DPAA_PMD=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_CAAM_JR=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=n', false],
> +		['CONFIG_RTE_LIBRTE_PFE_PMD=n', false],
> +		['CONFIG_RTE_LIBRTE_ENETC_PMD=n', false],
> +		['CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n', false],
> +		['CONFIG_RTE_LIBRTE_VHOST_NUMA=n', false]
> +	],

Rather than setting a list of flags like this make-style, why not have a
disabled-drivers setting, and add that to any user-provided ones? It would
save making any changes to the drivers/meson.build file, and therefore be
a lot cleaner. It would also allow using wildcards etc. to disable whole
classes of drivers


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

* Re: [dpdk-dev] [RFC PATCH 0/2] Arm build options rework
  2020-09-23 13:19 [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Juraj Linkeš
  2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options Juraj Linkeš
  2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 2/2] build: disable drivers from file Juraj Linkeš
@ 2020-09-24  3:03 ` Honnappa Nagarahalli
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
  3 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-09-24  3:03 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Saidi, Ali, nd, nd

Adding Ali

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, September 23, 2020 8:19 AM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [RFC PATCH 0/2] Arm build options rework
> 
> The current way of specifying Arm configuration options is insufficient since
> we can't identify the SoC we're building for from the MIDR information.
> 
> Instead use user input - the machine meson option to specify the SoC, e.g.:
> meson soc_test -Dmachine=thunderx
> meson soc_test --cross-file
> config/arm/thunderx/arm64_thunderx_linux_gcc
> 
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary without
> the user having to check which libraries they have installed 2. a cross build on
> a fast aarch64 machine but with target SoC which differs in capabilities or
> libraries.
> 
> Juraj Linkeš (2):
>   build: rework Arm build options
>   build: disable drivers from file
> 
>  config/arm/arm64_armv8_linux_gcc              |  28 ----
>  .../arm/{ => armada}/arm64_armada_linux_gcc   |   2 +-
>  config/arm/armada/meson.build                 |  31 ++++
>  config/arm/default/arm64_armv8_linux_gcc      |  23 +++
>  config/arm/default/meson.build                |   8 +
>  config/arm/meson.build                        | 139 +++++++++++-------
>  .../{ => thunderx}/arm64_thunderx_linux_gcc   |   2 +-
>  config/arm/thunderx/meson.build               |  18 +++
>  .../thunderxt88/arm64_thunderxt88_linux_gcc   |  16 ++
>  config/arm/thunderxt88/meson.build            |  18 +++
>  config/meson.build                            |   9 +-
>  drivers/meson.build                           |  13 +-
>  12 files changed, 218 insertions(+), 89 deletions(-)  delete mode 100644
> config/arm/arm64_armv8_linux_gcc  rename config/arm/{ =>
> armada}/arm64_armada_linux_gcc (93%)  create mode 100644
> config/arm/armada/meson.build  create mode 100644
> config/arm/default/arm64_armv8_linux_gcc
>  create mode 100644 config/arm/default/meson.build  rename
> config/arm/{ => thunderx}/arm64_thunderx_linux_gcc (92%)  create mode
> 100644 config/arm/thunderx/meson.build  create mode 100644
> config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
>  create mode 100644 config/arm/thunderxt88/meson.build
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options
  2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options Juraj Linkeš
@ 2020-09-24  4:19   ` Honnappa Nagarahalli
  2020-09-24 11:08     ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-09-24  4:19 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

Thanks Juraj for the quick RFC. Few comments inline.

<snip>

> 
> The current system can identify only the implementer and part number of
> the arm device we're targeting, which is enough to identify the target CPU.
> However, even the full MIDR information is not enough to identify the SoC
> we're targeting.
> 
> Expand the "machine" meson variable to allow specifying the target arm SoC.
> The SoC identification implies the CPU, so drop the current MIDR based CPU
> identification in favor of user input, which is the only way to identify the
> target SoC. This implies that native builds are not possible. Instead do a
> default (non-optimized, but executable on any
> aarch64 device) build.
> 
> Also use the machine custom property in cross files for cross builds.
> 
> An example of where the current system is insufficient is the cortex-a72 CPU.
> These cores are used in a variety of SoC from Broadcomm, NXP, Huawei and
> others. The MIDR information would only identify the core, but there's not
> way to identify the SoC to fine tune the build to it.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armv8_linux_gcc              |  28 ----
>  config/arm/default/arm64_armv8_linux_gcc      |  23 +++
>  config/arm/default/meson.build                |   8 +
>  config/arm/meson.build                        | 139 +++++++++++-------
>  .../{ => thunderx}/arm64_thunderx_linux_gcc   |   2 +-
>  config/arm/thunderx/meson.build               |  18 +++
>  .../thunderxt88/arm64_thunderxt88_linux_gcc   |  16 ++
>  config/arm/thunderxt88/meson.build            |  18 +++
>  config/meson.build                            |   9 +-
>  9 files changed, 177 insertions(+), 84 deletions(-)  delete mode 100644
> config/arm/arm64_armv8_linux_gcc  create mode 100644
> config/arm/default/arm64_armv8_linux_gcc
>  create mode 100644 config/arm/default/meson.build  rename
> config/arm/{ => thunderx}/arm64_thunderx_linux_gcc (92%)  create mode
> 100644 config/arm/thunderx/meson.build  create mode 100644
> config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
>  create mode 100644 config/arm/thunderxt88/meson.build
> 
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> deleted file mode 100644
> index 88f0ff9da..000000000
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -[binaries]
> -c = 'aarch64-linux-gnu-gcc'
> -cpp = 'aarch64-linux-gnu-cpp'
> -ar = 'aarch64-linux-gnu-gcc-ar'
> -strip = 'aarch64-linux-gnu-strip'
> -pkgconfig = 'aarch64-linux-gnu-pkg-config'
> -pcap-config = ''
> -
> -[host_machine]
> -system = 'linux'
> -cpu_family = 'aarch64'
> -cpu = 'armv8-a'
> -endian = 'little'
> -
> -[properties]
> -implementor_id = 'generic'
> -
> -# Valid options for Arm's implementor_pn:
> -# 'default': valid for all armv8-a architectures (default value)
> -# '0xd03':   cortex-a53
> -# '0xd04':   cortex-a35
> -# '0xd05':   cortex-a55
> -# '0xd07':   cortex-a57
> -# '0xd08':   cortex-a72
> -# '0xd09':   cortex-a73
> -# '0xd0a':   cortex-a75
> -# '0xd0b':   cortex-a76
> -implementor_pn = 'default'
> diff --git a/config/arm/default/arm64_armv8_linux_gcc
> b/config/arm/default/arm64_armv8_linux_gcc
> new file mode 100644
> index 000000000..56efd7a05
> --- /dev/null
> +++ b/config/arm/default/arm64_armv8_linux_gcc
> @@ -0,0 +1,23 @@
> +[binaries]
> +c = 'aarch64-linux-gnu-gcc'
> +cpp = 'aarch64-linux-gnu-cpp'
> +ar = 'aarch64-linux-gnu-gcc-ar'
> +strip = 'aarch64-linux-gnu-strip'
> +pkgconfig = 'aarch64-linux-gnu-pkg-config'
> +pcap-config = ''
> +
> +[host_machine]
> +system = 'linux'
> +cpu_family = 'aarch64'
> +cpu = 'armv8-a'
> +endian = 'little'
> +
> +[properties]
> +# Valid values for the machine property are the soc names identified by
> +# directories in config/arm # Possible suffixes for socs:
> +# -mn-kc
> +# where m is the number of numa nodes and k is the number of lcores #
> +e.g. for thunderx soc the possible values are "thunderx" or "thunderx-1n-
> 48c"
Is it required to talk about the suffixes? I think the statement "Valid values for the machine property are the soc names identified by directories in config/arm" should be sufficient.

> +# the suffixes themselves need to be supported in
> +config/arm/<soc_dir>/meson.build machine = 'default'
IMO, "default" does not convey much information. Is it possible to change it without a deprecation notice? "generic" or "armv8" conveys more information.
Any opinions from others?

> diff --git a/config/arm/default/meson.build
> b/config/arm/default/meson.build new file mode 100644 index
> 000000000..5714d0084
> --- /dev/null
> +++ b/config/arm/default/meson.build
> @@ -0,0 +1,8 @@
> +flags = [
> +	['RTE_MACHINE', '"armv8a"'],
> +	['RTE_MAX_LCORE', 256],
> +	['RTE_USE_C11_MEM_MODEL', true],
> +	['RTE_CACHE_LINE_SIZE', 128]
> +]
> +
> +machine_args = ['-march=armv8-a+crc']
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 8728051d5..05b790f40 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -2,11 +2,11 @@
>  # Copyright(c) 2017 Intel Corporation.
>  # Copyright(c) 2017 Cavium, Inc
> 
> -# for checking defines we need to use the correct compiler flags -march_opt
> = '-march=@0@'.format(machine)
> -
> -arm_force_native_march = false
> -arm_force_default_march = (machine == 'default')
> +if machine == 'native'
> +	# arm doesn't support a native build - user input of soc is required
> +	# default to the portable build instead of native
> +	machine = 'default'
Do we need a message here to the user?

> +endif
> 
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -131,6 +131,7 @@ impl_dpaa = ['NXP DPAA',
> flags_dpaa, machine_args_generic]  dpdk_conf.set('RTE_FORCE_INTRINSICS',
> 1)
> 
>  if not dpdk_conf.get('RTE_ARCH_64')
> +	# armv7 build
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
>  	dpdk_conf.set('RTE_ARCH_ARM', 1)
>  	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
> @@ -138,41 +139,9 @@ if not dpdk_conf.get('RTE_ARCH_64')
>  	# mk/machine/armv7a/rte.vars.mk sets it too
>  	machine_args += '-mfpu=neon'
>  else
> +	# aarch64 build
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
>  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> -
> -	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 = 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)
> -	endif
> -
>  	# Apply Common Defaults. These settings may be overwritten by
> machine
>  	# settings later.
>  	foreach flag: flags_common_default
> @@ -181,30 +150,89 @@ else
>  		endif
>  	endforeach
> 
> -	message('Implementer : ' + machine[0])
> -	foreach flag: machine[1]
> +	soc = machine.split('-')[0]
> +	# TODO make sure the subdir exists
> +	subdir(soc)
> +
> +	if soc != 'default'
> +		# combine common and soc specific flags
> +		# TODO check that soc is in the dict
> +		flags = flags['common'] + flags[soc]
> +	endif
> +
> +	foreach flag: flags
>  		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
> +	verified_machine_args = []
> +
> +	foreach flag: machine_args
> +		if cc.has_argument(flag)
> +			verified_machine_args += flag
> +		else
> +			message('Unsupported machine flag "@0@",
> ignoring'.format(flag))
>  		endif
>  	endforeach
> +	machine_args = verified_machine_args
> +
> +#	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 = impl_generic
> +#		impl_pn = 'default'
> +#	elif not meson.is_cross_build()
Isn't this for native build? Do we still need this?

> +#		# 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)
> +#	endif
> +#
> +#	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
>  endif
> -message(machine_args)
> +message('Using machine args: @0@'.format(machine_args))
> 
>  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
>      cc.get_define('__aarch64__', args: machine_args) != '') @@ -225,3 +253,6
> @@ if cc.get_define('__ARM_FEATURE_CRYPTO', args: machine_args) != ''
>  	compile_time_cpuflags += ['RTE_CPUFLAG_AES',
> 'RTE_CPUFLAG_PMULL',
>  	'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2']  endif
> +
> +message('dpdk conf options after arm stuff: @0@'.format(dpdk_conf))
> +
> diff --git a/config/arm/arm64_thunderx_linux_gcc
> b/config/arm/thunderx/arm64_thunderx_linux_gcc
> similarity index 92%
> rename from config/arm/arm64_thunderx_linux_gcc
> rename to config/arm/thunderx/arm64_thunderx_linux_gcc
> index 6572ab615..e53a86e8f 100644
> --- a/config/arm/arm64_thunderx_linux_gcc
> +++ b/config/arm/thunderx/arm64_thunderx_linux_gcc
> @@ -13,4 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x43'
> +machine = 'thunderx'
> diff --git a/config/arm/thunderx/meson.build
> b/config/arm/thunderx/meson.build new file mode 100644 index
> 000000000..873d79a64
> --- /dev/null
> +++ b/config/arm/thunderx/meson.build
> @@ -0,0 +1,18 @@
> +flags = {
> +	'common': [
> +		['RTE_CACHE_LINE_SIZE', 128],
> +		['RTE_MAX_VFIO_GROUPS', 128],
> +		['RTE_MACHINE', '"thunderx"'],
> +		['RTE_USE_C11_MEM_MODEL', false]
> +	],
> +	'thunderx': [
> +		['RTE_MAX_NUMA_NODES', 2],
> +		['RTE_MAX_LCORE', 96]
> +	],
> +	'thunderx-1n-48c': [
> +		['RTE_MAX_NUMA_NODES', 1],
> +		['RTE_MAX_LCORE', 48]
> +	]
> +}
> +
> +machine_args = ['-march=armv8-a+crc+crypto','-mcpu=thunderx']
> diff --git a/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> new file mode 100644
> index 000000000..9a622786c
> --- /dev/null
> +++ b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> @@ -0,0 +1,16 @@
> +[binaries]
> +c = 'aarch64-linux-gnu-gcc'
> +cpp = 'aarch64-linux-gnu-cpp'
> +ar = 'aarch64-linux-gnu-gcc-ar'
> +strip = 'aarch64-linux-gnu-strip'
> +pkgconfig = 'aarch64-linux-gnu-pkg-config'
> +pcap-config = ''
> +
> +[host_machine]
> +system = 'linux'
> +cpu_family = 'aarch64'
> +cpu = 'armv8-a'
> +endian = 'little'
> +
> +[properties]
> +machine = 'thunderxt88'
> diff --git a/config/arm/thunderxt88/meson.build
> b/config/arm/thunderxt88/meson.build
> new file mode 100644
> index 000000000..2aa5d2cdd
> --- /dev/null
> +++ b/config/arm/thunderxt88/meson.build
> @@ -0,0 +1,18 @@
> +flags = {
> +	'common': [
> +		['RTE_CACHE_LINE_SIZE', 128],
> +		['RTE_MAX_VFIO_GROUPS', 128],
> +		['RTE_MACHINE', '"thunderx"'],
> +		['RTE_USE_C11_MEM_MODEL', false]
> +	],
> +	'thunderxt88': [
> +		['RTE_MAX_NUMA_NODES', 2],
> +		['RTE_MAX_LCORE', 96]
> +	],
> +	'thunderxt88-1n-48c': [
> +		['RTE_MAX_NUMA_NODES', 1],
> +		['RTE_MAX_LCORE', 48]
> +	]
> +}
> +
> +machine_args = ['-mcpu=thunderxt88']
> diff --git a/config/meson.build b/config/meson.build index
> 69f2aeb60..177cbd49c 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -63,7 +63,14 @@ meson.add_install_script('../buildtools/symlink-
> drivers-solibs.sh',
> 
>  # set the machine type and cflags for it  if meson.is_cross_build()
> -	machine = host_machine.cpu()
> +	if not host_machine.cpu_family().startswith('aarch')
> +		# don't change the machine config for aarch32/64 builds
> +		# that config is set in the cross file to identify the soc
> +		# we're building for
> +		machine = host_machine.cpu()
> +	else
> +		machine = meson.get_cross_property('machine', 'default')
> +	endif
>  else
>  	machine = get_option('machine')
>  endif
> --
> 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH 2/2] build: disable drivers from file
  2020-09-23 13:58   ` Bruce Richardson
@ 2020-09-24  8:31     ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-09-24  8:31 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, September 23, 2020 3:59 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [RFC PATCH 2/2] build: disable drivers from file
> 
> On Wed, Sep 23, 2020 at 03:19:21PM +0200, Juraj Linkeš wrote:
> > Add the capability to specify which drivers will NOT be build in a file.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  .../arm/{ => armada}/arm64_armada_linux_gcc   |  2 +-
> >  config/arm/armada/meson.build                 | 31 +++++++++++++++++++
> >  drivers/meson.build                           | 13 +++++---
> >  3 files changed, 41 insertions(+), 5 deletions(-)  rename
> > config/arm/{ => armada}/arm64_armada_linux_gcc (93%)  create mode
> > 100644 config/arm/armada/meson.build
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/armada/arm64_armada_linux_gcc
> > similarity index 93%
> > rename from config/arm/arm64_armada_linux_gcc rename to
> > config/arm/armada/arm64_armada_linux_gcc
> > index fa40c0398..8b4b5c8ad 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/armada/arm64_armada_linux_gcc
> > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x56'
> > +machine = 'armada'
> > diff --git a/config/arm/armada/meson.build
> > b/config/arm/armada/meson.build new file mode 100644 index
> > 000000000..22fdce5fe
> > --- /dev/null
> > +++ b/config/arm/armada/meson.build
> > @@ -0,0 +1,31 @@
> > +flags = {
> > +	'common': [
> > +		['RTE_CACHE_LINE_SIZE', 64],
> > +		['RTE_MACHINE', '"armv8a"'],
> > +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> > +		['CONFIG_RTE_LIBRTE_COMMON_DPAAX=n', false],
> > +		['CONFIG_RTE_LIBRTE_FSLMC_BUS=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA2_MEMPOOL=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA2_PMD=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA_BUS=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n', false],
> > +		['CONFIG_RTE_LIBRTE_DPAA_PMD=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_CAAM_JR=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n', false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV=n',
> false],
> > +		['CONFIG_RTE_LIBRTE_PMD_DPAA2_QDMA_RAWDEV=n',
> false],
> > +		['CONFIG_RTE_LIBRTE_PFE_PMD=n', false],
> > +		['CONFIG_RTE_LIBRTE_ENETC_PMD=n', false],
> > +		['CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n', false],
> > +		['CONFIG_RTE_LIBRTE_VHOST_NUMA=n', false]
> > +	],
> 
> Rather than setting a list of flags like this make-style, why not have a disabled-
> drivers setting, and add that to any user-provided ones? It would save making
> any changes to the drivers/meson.build file, and therefore be a lot cleaner. It
> would also allow using wildcards etc. to disable whole classes of drivers
> 

I didn't think of this, thanks for the suggestion, that's much better.

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

* Re: [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options
  2020-09-24  4:19   ` Honnappa Nagarahalli
@ 2020-09-24 11:08     ` Juraj Linkeš
  2020-09-24 19:17       ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-09-24 11:08 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Thursday, September 24, 2020 6:19 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [RFC PATCH 1/2] build: rework Arm build options
> 
> Thanks Juraj for the quick RFC. Few comments inline.
> 
> <snip>
> 
> >
> > The current system can identify only the implementer and part number
> > of the arm device we're targeting, which is enough to identify the target CPU.
> > However, even the full MIDR information is not enough to identify the
> > SoC we're targeting.
> >
> > Expand the "machine" meson variable to allow specifying the target arm SoC.
> > The SoC identification implies the CPU, so drop the current MIDR based
> > CPU identification in favor of user input, which is the only way to
> > identify the target SoC. This implies that native builds are not
> > possible. Instead do a default (non-optimized, but executable on any
> > aarch64 device) build.
> >
> > Also use the machine custom property in cross files for cross builds.
> >
> > An example of where the current system is insufficient is the cortex-a72 CPU.
> > These cores are used in a variety of SoC from Broadcomm, NXP, Huawei
> > and others. The MIDR information would only identify the core, but
> > there's not way to identify the SoC to fine tune the build to it.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/arm64_armv8_linux_gcc              |  28 ----
> >  config/arm/default/arm64_armv8_linux_gcc      |  23 +++
> >  config/arm/default/meson.build                |   8 +
> >  config/arm/meson.build                        | 139 +++++++++++-------
> >  .../{ => thunderx}/arm64_thunderx_linux_gcc   |   2 +-
> >  config/arm/thunderx/meson.build               |  18 +++
> >  .../thunderxt88/arm64_thunderxt88_linux_gcc   |  16 ++
> >  config/arm/thunderxt88/meson.build            |  18 +++
> >  config/meson.build                            |   9 +-
> >  9 files changed, 177 insertions(+), 84 deletions(-)  delete mode
> > 100644 config/arm/arm64_armv8_linux_gcc  create mode 100644
> > config/arm/default/arm64_armv8_linux_gcc
> >  create mode 100644 config/arm/default/meson.build  rename
> > config/arm/{ => thunderx}/arm64_thunderx_linux_gcc (92%)  create mode
> > 100644 config/arm/thunderx/meson.build  create mode 100644
> > config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> >  create mode 100644 config/arm/thunderxt88/meson.build
> >
> > diff --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > deleted file mode 100644
> > index 88f0ff9da..000000000
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ /dev/null
> > @@ -1,28 +0,0 @@
> > -[binaries]
> > -c = 'aarch64-linux-gnu-gcc'
> > -cpp = 'aarch64-linux-gnu-cpp'
> > -ar = 'aarch64-linux-gnu-gcc-ar'
> > -strip = 'aarch64-linux-gnu-strip'
> > -pkgconfig = 'aarch64-linux-gnu-pkg-config'
> > -pcap-config = ''
> > -
> > -[host_machine]
> > -system = 'linux'
> > -cpu_family = 'aarch64'
> > -cpu = 'armv8-a'
> > -endian = 'little'
> > -
> > -[properties]
> > -implementor_id = 'generic'
> > -
> > -# Valid options for Arm's implementor_pn:
> > -# 'default': valid for all armv8-a architectures (default value)
> > -# '0xd03':   cortex-a53
> > -# '0xd04':   cortex-a35
> > -# '0xd05':   cortex-a55
> > -# '0xd07':   cortex-a57
> > -# '0xd08':   cortex-a72
> > -# '0xd09':   cortex-a73
> > -# '0xd0a':   cortex-a75
> > -# '0xd0b':   cortex-a76
> > -implementor_pn = 'default'
> > diff --git a/config/arm/default/arm64_armv8_linux_gcc
> > b/config/arm/default/arm64_armv8_linux_gcc
> > new file mode 100644
> > index 000000000..56efd7a05
> > --- /dev/null
> > +++ b/config/arm/default/arm64_armv8_linux_gcc
> > @@ -0,0 +1,23 @@
> > +[binaries]
> > +c = 'aarch64-linux-gnu-gcc'
> > +cpp = 'aarch64-linux-gnu-cpp'
> > +ar = 'aarch64-linux-gnu-gcc-ar'
> > +strip = 'aarch64-linux-gnu-strip'
> > +pkgconfig = 'aarch64-linux-gnu-pkg-config'
> > +pcap-config = ''
> > +
> > +[host_machine]
> > +system = 'linux'
> > +cpu_family = 'aarch64'
> > +cpu = 'armv8-a'
> > +endian = 'little'
> > +
> > +[properties]
> > +# Valid values for the machine property are the soc names identified
> > +by # directories in config/arm # Possible suffixes for socs:
> > +# -mn-kc
> > +# where m is the number of numa nodes and k is the number of lcores #
> > +e.g. for thunderx soc the possible values are "thunderx" or
> > +"thunderx-1n-
> > 48c"
> Is it required to talk about the suffixes? I think the statement "Valid values for
> the machine property are the soc names identified by directories in config/arm"
> should be sufficient.
> 

Yes, this is not the right place for this, so a shorted explanation is enough.

> > +# the suffixes themselves need to be supported in
> > +config/arm/<soc_dir>/meson.build machine = 'default'
> IMO, "default" does not convey much information. Is it possible to change it
> without a deprecation notice? "generic" or "armv8" conveys more information.
> Any opinions from others?
> 

Maybe we can have multiple labels mean the same thing - default, generic, armv8 or even generic-armv8 (that's the most descriptive name IMO) could all mean the generic arm build executable on all aarch64 SoCs. That many names is probably confusing, but sticking to two (default and one more) seems feasible.

What does everyone else think?

> > diff --git a/config/arm/default/meson.build
> > b/config/arm/default/meson.build new file mode 100644 index
> > 000000000..5714d0084
> > --- /dev/null
> > +++ b/config/arm/default/meson.build
> > @@ -0,0 +1,8 @@
> > +flags = [
> > +	['RTE_MACHINE', '"armv8a"'],
> > +	['RTE_MAX_LCORE', 256],
> > +	['RTE_USE_C11_MEM_MODEL', true],
> > +	['RTE_CACHE_LINE_SIZE', 128]
> > +]
> > +
> > +machine_args = ['-march=armv8-a+crc']
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 8728051d5..05b790f40 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -2,11 +2,11 @@
> >  # Copyright(c) 2017 Intel Corporation.
> >  # Copyright(c) 2017 Cavium, Inc
> >
> > -# for checking defines we need to use the correct compiler flags
> > -march_opt = '-march=@0@'.format(machine)
> > -
> > -arm_force_native_march = false
> > -arm_force_default_march = (machine == 'default')
> > +if machine == 'native'
> > +	# arm doesn't support a native build - user input of soc is required
> > +	# default to the portable build instead of native
> > +	machine = 'default'
> Do we need a message here to the user?
> 

Better to have one, good catch.

> > +endif
> >
> >  flags_common_default = [
> >  	# Accelarate rte_memcpy. Be sure to run unit test
> > (memcpy_perf_autotest) @@ -131,6 +131,7 @@ impl_dpaa = ['NXP DPAA',
> > flags_dpaa, machine_args_generic]
> > dpdk_conf.set('RTE_FORCE_INTRINSICS',
> > 1)
> >
> >  if not dpdk_conf.get('RTE_ARCH_64')
> > +	# armv7 build
> >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
> >  	dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
> > @@ -138,41 +139,9 @@ if not dpdk_conf.get('RTE_ARCH_64')
> >  	# mk/machine/armv7a/rte.vars.mk sets it too
> >  	machine_args += '-mfpu=neon'
> >  else
> > +	# aarch64 build
> >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
> >  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> > -
> > -	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 = 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)
> > -	endif
> > -
> >  	# Apply Common Defaults. These settings may be overwritten by
> > machine
> >  	# settings later.
> >  	foreach flag: flags_common_default
> > @@ -181,30 +150,89 @@ else
> >  		endif
> >  	endforeach
> >
> > -	message('Implementer : ' + machine[0])
> > -	foreach flag: machine[1]
> > +	soc = machine.split('-')[0]
> > +	# TODO make sure the subdir exists
> > +	subdir(soc)
> > +
> > +	if soc != 'default'
> > +		# combine common and soc specific flags
> > +		# TODO check that soc is in the dict
> > +		flags = flags['common'] + flags[soc]
> > +	endif
> > +
> > +	foreach flag: flags
> >  		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
> > +	verified_machine_args = []
> > +
> > +	foreach flag: machine_args
> > +		if cc.has_argument(flag)
> > +			verified_machine_args += flag
> > +		else
> > +			message('Unsupported machine flag "@0@",
> > ignoring'.format(flag))
> >  		endif
> >  	endforeach
> > +	machine_args = verified_machine_args
> > +
> > +#	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 = impl_generic
> > +#		impl_pn = 'default'
> > +#	elif not meson.is_cross_build()
> Isn't this for native build? Do we still need this?
> 

Yes, I should've removed this instead of commenting it out.

> > +#		# 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)
> > +#	endif
> > +#
> > +#	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
> >  endif
> > -message(machine_args)
> > +message('Using machine args: @0@'.format(machine_args))
> >
> >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> >      cc.get_define('__aarch64__', args: machine_args) != '') @@ -225,3
> > +253,6 @@ if cc.get_define('__ARM_FEATURE_CRYPTO', args: machine_args)
> != ''
> >  	compile_time_cpuflags += ['RTE_CPUFLAG_AES',
> 'RTE_CPUFLAG_PMULL',
> >  	'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2']  endif
> > +
> > +message('dpdk conf options after arm stuff: @0@'.format(dpdk_conf))
> > +
> > diff --git a/config/arm/arm64_thunderx_linux_gcc
> > b/config/arm/thunderx/arm64_thunderx_linux_gcc
> > similarity index 92%
> > rename from config/arm/arm64_thunderx_linux_gcc
> > rename to config/arm/thunderx/arm64_thunderx_linux_gcc
> > index 6572ab615..e53a86e8f 100644
> > --- a/config/arm/arm64_thunderx_linux_gcc
> > +++ b/config/arm/thunderx/arm64_thunderx_linux_gcc
> > @@ -13,4 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x43'
> > +machine = 'thunderx'
> > diff --git a/config/arm/thunderx/meson.build
> > b/config/arm/thunderx/meson.build new file mode 100644 index
> > 000000000..873d79a64
> > --- /dev/null
> > +++ b/config/arm/thunderx/meson.build
> > @@ -0,0 +1,18 @@
> > +flags = {
> > +	'common': [
> > +		['RTE_CACHE_LINE_SIZE', 128],
> > +		['RTE_MAX_VFIO_GROUPS', 128],
> > +		['RTE_MACHINE', '"thunderx"'],
> > +		['RTE_USE_C11_MEM_MODEL', false]
> > +	],
> > +	'thunderx': [
> > +		['RTE_MAX_NUMA_NODES', 2],
> > +		['RTE_MAX_LCORE', 96]
> > +	],
> > +	'thunderx-1n-48c': [
> > +		['RTE_MAX_NUMA_NODES', 1],
> > +		['RTE_MAX_LCORE', 48]
> > +	]
> > +}
> > +
> > +machine_args = ['-march=armv8-a+crc+crypto','-mcpu=thunderx']
> > diff --git a/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> > b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> > new file mode 100644
> > index 000000000..9a622786c
> > --- /dev/null
> > +++ b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> > @@ -0,0 +1,16 @@
> > +[binaries]
> > +c = 'aarch64-linux-gnu-gcc'
> > +cpp = 'aarch64-linux-gnu-cpp'
> > +ar = 'aarch64-linux-gnu-gcc-ar'
> > +strip = 'aarch64-linux-gnu-strip'
> > +pkgconfig = 'aarch64-linux-gnu-pkg-config'
> > +pcap-config = ''
> > +
> > +[host_machine]
> > +system = 'linux'
> > +cpu_family = 'aarch64'
> > +cpu = 'armv8-a'
> > +endian = 'little'
> > +
> > +[properties]
> > +machine = 'thunderxt88'
> > diff --git a/config/arm/thunderxt88/meson.build
> > b/config/arm/thunderxt88/meson.build
> > new file mode 100644
> > index 000000000..2aa5d2cdd
> > --- /dev/null
> > +++ b/config/arm/thunderxt88/meson.build
> > @@ -0,0 +1,18 @@
> > +flags = {
> > +	'common': [
> > +		['RTE_CACHE_LINE_SIZE', 128],
> > +		['RTE_MAX_VFIO_GROUPS', 128],
> > +		['RTE_MACHINE', '"thunderx"'],
> > +		['RTE_USE_C11_MEM_MODEL', false]
> > +	],
> > +	'thunderxt88': [
> > +		['RTE_MAX_NUMA_NODES', 2],
> > +		['RTE_MAX_LCORE', 96]
> > +	],
> > +	'thunderxt88-1n-48c': [
> > +		['RTE_MAX_NUMA_NODES', 1],
> > +		['RTE_MAX_LCORE', 48]
> > +	]
> > +}
> > +
> > +machine_args = ['-mcpu=thunderxt88']
> > diff --git a/config/meson.build b/config/meson.build index
> > 69f2aeb60..177cbd49c 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -63,7 +63,14 @@ meson.add_install_script('../buildtools/symlink-
> > drivers-solibs.sh',
> >
> >  # set the machine type and cflags for it  if meson.is_cross_build()
> > -	machine = host_machine.cpu()
> > +	if not host_machine.cpu_family().startswith('aarch')
> > +		# don't change the machine config for aarch32/64 builds
> > +		# that config is set in the cross file to identify the soc
> > +		# we're building for
> > +		machine = host_machine.cpu()
> > +	else
> > +		machine = meson.get_cross_property('machine', 'default')
> > +	endif
> >  else
> >  	machine = get_option('machine')
> >  endif
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options
  2020-09-24 11:08     ` Juraj Linkeš
@ 2020-09-24 19:17       ` Honnappa Nagarahalli
  2020-09-24 22:08         ` Ali Saidi
       [not found]         ` <20200924220710.19937-1-alisaidi@amazon.com>
  0 siblings, 2 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-09-24 19:17 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > >
> > > The current system can identify only the implementer and part number
> > > of the arm device we're targeting, which is enough to identify the target
> CPU.
> > > However, even the full MIDR information is not enough to identify
> > > the SoC we're targeting.
> > >
> > > Expand the "machine" meson variable to allow specifying the target arm
> SoC.
> > > The SoC identification implies the CPU, so drop the current MIDR
> > > based CPU identification in favor of user input, which is the only
> > > way to identify the target SoC. This implies that native builds are
> > > not possible. Instead do a default (non-optimized, but executable on
> > > any
> > > aarch64 device) build.
> > >
> > > Also use the machine custom property in cross files for cross builds.
> > >
> > > An example of where the current system is insufficient is the cortex-a72
> CPU.
> > > These cores are used in a variety of SoC from Broadcomm, NXP, Huawei
> > > and others. The MIDR information would only identify the core, but
> > > there's not way to identify the SoC to fine tune the build to it.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/arm64_armv8_linux_gcc              |  28 ----
> > >  config/arm/default/arm64_armv8_linux_gcc      |  23 +++
> > >  config/arm/default/meson.build                |   8 +
> > >  config/arm/meson.build                        | 139 +++++++++++-------
> > >  .../{ => thunderx}/arm64_thunderx_linux_gcc   |   2 +-
> > >  config/arm/thunderx/meson.build               |  18 +++
> > >  .../thunderxt88/arm64_thunderxt88_linux_gcc   |  16 ++
> > >  config/arm/thunderxt88/meson.build            |  18 +++
> > >  config/meson.build                            |   9 +-
> > >  9 files changed, 177 insertions(+), 84 deletions(-)  delete mode
> > > 100644 config/arm/arm64_armv8_linux_gcc  create mode 100644
> > > config/arm/default/arm64_armv8_linux_gcc
> > >  create mode 100644 config/arm/default/meson.build  rename
> > > config/arm/{ => thunderx}/arm64_thunderx_linux_gcc (92%)  create
> > > mode
> > > 100644 config/arm/thunderx/meson.build  create mode 100644
> > > config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> > >  create mode 100644 config/arm/thunderxt88/meson.build
> > >
> > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > b/config/arm/arm64_armv8_linux_gcc
> > > deleted file mode 100644
> > > index 88f0ff9da..000000000
> > > --- a/config/arm/arm64_armv8_linux_gcc
> > > +++ /dev/null
> > > @@ -1,28 +0,0 @@
> > > -[binaries]
> > > -c = 'aarch64-linux-gnu-gcc'
> > > -cpp = 'aarch64-linux-gnu-cpp'
> > > -ar = 'aarch64-linux-gnu-gcc-ar'
> > > -strip = 'aarch64-linux-gnu-strip'
> > > -pkgconfig = 'aarch64-linux-gnu-pkg-config'
> > > -pcap-config = ''
> > > -
> > > -[host_machine]
> > > -system = 'linux'
> > > -cpu_family = 'aarch64'
> > > -cpu = 'armv8-a'
> > > -endian = 'little'
> > > -
> > > -[properties]
> > > -implementor_id = 'generic'
> > > -
> > > -# Valid options for Arm's implementor_pn:
> > > -# 'default': valid for all armv8-a architectures (default value)
> > > -# '0xd03':   cortex-a53
> > > -# '0xd04':   cortex-a35
> > > -# '0xd05':   cortex-a55
> > > -# '0xd07':   cortex-a57
> > > -# '0xd08':   cortex-a72
> > > -# '0xd09':   cortex-a73
> > > -# '0xd0a':   cortex-a75
> > > -# '0xd0b':   cortex-a76
> > > -implementor_pn = 'default'
> > > diff --git a/config/arm/default/arm64_armv8_linux_gcc
> > > b/config/arm/default/arm64_armv8_linux_gcc
> > > new file mode 100644
> > > index 000000000..56efd7a05
> > > --- /dev/null
> > > +++ b/config/arm/default/arm64_armv8_linux_gcc
> > > @@ -0,0 +1,23 @@
> > > +[binaries]
> > > +c = 'aarch64-linux-gnu-gcc'
> > > +cpp = 'aarch64-linux-gnu-cpp'
> > > +ar = 'aarch64-linux-gnu-gcc-ar'
> > > +strip = 'aarch64-linux-gnu-strip'
> > > +pkgconfig = 'aarch64-linux-gnu-pkg-config'
> > > +pcap-config = ''
> > > +
> > > +[host_machine]
> > > +system = 'linux'
> > > +cpu_family = 'aarch64'
> > > +cpu = 'armv8-a'
> > > +endian = 'little'
> > > +
> > > +[properties]
> > > +# Valid values for the machine property are the soc names
> > > +identified by # directories in config/arm # Possible suffixes for socs:
> > > +# -mn-kc
> > > +# where m is the number of numa nodes and k is the number of lcores
> > > +# e.g. for thunderx soc the possible values are "thunderx" or
> > > +"thunderx-1n-
> > > 48c"
> > Is it required to talk about the suffixes? I think the statement
> > "Valid values for the machine property are the soc names identified by
> directories in config/arm"
> > should be sufficient.
> >
> 
> Yes, this is not the right place for this, so a shorted explanation is enough.
> 
> > > +# the suffixes themselves need to be supported in
> > > +config/arm/<soc_dir>/meson.build machine = 'default'
> > IMO, "default" does not convey much information. Is it possible to
> > change it without a deprecation notice? "generic" or "armv8" conveys more
> information.
> > Any opinions from others?
> >
> 
> Maybe we can have multiple labels mean the same thing - default, generic,
> armv8 or even generic-armv8 (that's the most descriptive name IMO) could
> all mean the generic arm build executable on all aarch64 SoCs. That many
> names is probably confusing, but sticking to two (default and one more)
> seems feasible.
> 
> What does everyone else think?
'armv8' makes lot more sense to me and it conveys what the build does. We can keep 'default' to be backward compatible, we can skip others.

> 
> > > diff --git a/config/arm/default/meson.build
> > > b/config/arm/default/meson.build new file mode 100644 index
> > > 000000000..5714d0084
> > > --- /dev/null
> > > +++ b/config/arm/default/meson.build
> > > @@ -0,0 +1,8 @@
> > > +flags = [
> > > +	['RTE_MACHINE', '"armv8a"'],
> > > +	['RTE_MAX_LCORE', 256],
> > > +	['RTE_USE_C11_MEM_MODEL', true],
> > > +	['RTE_CACHE_LINE_SIZE', 128]
> > > +]
> > > +
> > > +machine_args = ['-march=armv8-a+crc']
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 8728051d5..05b790f40 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -2,11 +2,11 @@
> > >  # Copyright(c) 2017 Intel Corporation.
> > >  # Copyright(c) 2017 Cavium, Inc
> > >
> > > -# for checking defines we need to use the correct compiler flags
> > > -march_opt = '-march=@0@'.format(machine)
> > > -
> > > -arm_force_native_march = false
> > > -arm_force_default_march = (machine == 'default')
> > > +if machine == 'native'
> > > +	# arm doesn't support a native build - user input of soc is required
> > > +	# default to the portable build instead of native
> > > +	machine = 'default'
> > Do we need a message here to the user?
> >
> 
> Better to have one, good catch.
> 
> > > +endif
> > >
> > >  flags_common_default = [
> > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > (memcpy_perf_autotest) @@ -131,6 +131,7 @@ impl_dpaa = ['NXP
> DPAA',
> > > flags_dpaa, machine_args_generic]
> > > dpdk_conf.set('RTE_FORCE_INTRINSICS',
> > > 1)
> > >
> > >  if not dpdk_conf.get('RTE_ARCH_64')
> > > +	# armv7 build
> > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
> > >  	dpdk_conf.set('RTE_ARCH_ARM', 1)
> > >  	dpdk_conf.set('RTE_ARCH_ARMv7', 1) @@ -138,41 +139,9 @@ if not
> > > dpdk_conf.get('RTE_ARCH_64')
> > >  	# mk/machine/armv7a/rte.vars.mk sets it too
> > >  	machine_args += '-mfpu=neon'
> > >  else
> > > +	# aarch64 build
> > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
> > >  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> > > -
> > > -	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 = 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)
> > > -	endif
> > > -
> > >  	# Apply Common Defaults. These settings may be overwritten by
> > > machine
> > >  	# settings later.
> > >  	foreach flag: flags_common_default @@ -181,30 +150,89 @@ else
> > >  		endif
> > >  	endforeach
> > >
> > > -	message('Implementer : ' + machine[0])
> > > -	foreach flag: machine[1]
> > > +	soc = machine.split('-')[0]
> > > +	# TODO make sure the subdir exists
> > > +	subdir(soc)
> > > +
> > > +	if soc != 'default'
> > > +		# combine common and soc specific flags
> > > +		# TODO check that soc is in the dict
> > > +		flags = flags['common'] + flags[soc]
> > > +	endif
> > > +
> > > +	foreach flag: flags
> > >  		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
> > > +	verified_machine_args = []
> > > +
> > > +	foreach flag: machine_args
> > > +		if cc.has_argument(flag)
> > > +			verified_machine_args += flag
> > > +		else
> > > +			message('Unsupported machine flag "@0@",
> > > ignoring'.format(flag))
> > >  		endif
> > >  	endforeach
> > > +	machine_args = verified_machine_args
> > > +
> > > +#	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 = impl_generic
> > > +#		impl_pn = 'default'
> > > +#	elif not meson.is_cross_build()
> > Isn't this for native build? Do we still need this?
> >
> 
> Yes, I should've removed this instead of commenting it out.
> 
> > > +#		# 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)
> > > +#	endif
> > > +#
> > > +#	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
> > >  endif
> > > -message(machine_args)
> > > +message('Using machine args: @0@'.format(machine_args))
> > >
> > >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > >      cc.get_define('__aarch64__', args: machine_args) != '') @@
> > > -225,3
> > > +253,6 @@ if cc.get_define('__ARM_FEATURE_CRYPTO', args:
> > > +machine_args)
> > != ''
> > >  	compile_time_cpuflags += ['RTE_CPUFLAG_AES',
> > 'RTE_CPUFLAG_PMULL',
> > >  	'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2']  endif
> > > +
> > > +message('dpdk conf options after arm stuff: @0@'.format(dpdk_conf))
> > > +
> > > diff --git a/config/arm/arm64_thunderx_linux_gcc
> > > b/config/arm/thunderx/arm64_thunderx_linux_gcc
> > > similarity index 92%
> > > rename from config/arm/arm64_thunderx_linux_gcc
> > > rename to config/arm/thunderx/arm64_thunderx_linux_gcc
> > > index 6572ab615..e53a86e8f 100644
> > > --- a/config/arm/arm64_thunderx_linux_gcc
> > > +++ b/config/arm/thunderx/arm64_thunderx_linux_gcc
> > > @@ -13,4 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x43'
> > > +machine = 'thunderx'
> > > diff --git a/config/arm/thunderx/meson.build
> > > b/config/arm/thunderx/meson.build new file mode 100644 index
> > > 000000000..873d79a64
> > > --- /dev/null
> > > +++ b/config/arm/thunderx/meson.build
> > > @@ -0,0 +1,18 @@
> > > +flags = {
> > > +	'common': [
> > > +		['RTE_CACHE_LINE_SIZE', 128],
> > > +		['RTE_MAX_VFIO_GROUPS', 128],
> > > +		['RTE_MACHINE', '"thunderx"'],
> > > +		['RTE_USE_C11_MEM_MODEL', false]
> > > +	],
> > > +	'thunderx': [
> > > +		['RTE_MAX_NUMA_NODES', 2],
> > > +		['RTE_MAX_LCORE', 96]
> > > +	],
> > > +	'thunderx-1n-48c': [
> > > +		['RTE_MAX_NUMA_NODES', 1],
> > > +		['RTE_MAX_LCORE', 48]
> > > +	]
> > > +}
> > > +
> > > +machine_args = ['-march=armv8-a+crc+crypto','-mcpu=thunderx']
> > > diff --git a/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> > > b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> > > new file mode 100644
> > > index 000000000..9a622786c
> > > --- /dev/null
> > > +++ b/config/arm/thunderxt88/arm64_thunderxt88_linux_gcc
> > > @@ -0,0 +1,16 @@
> > > +[binaries]
> > > +c = 'aarch64-linux-gnu-gcc'
> > > +cpp = 'aarch64-linux-gnu-cpp'
> > > +ar = 'aarch64-linux-gnu-gcc-ar'
> > > +strip = 'aarch64-linux-gnu-strip'
> > > +pkgconfig = 'aarch64-linux-gnu-pkg-config'
> > > +pcap-config = ''
> > > +
> > > +[host_machine]
> > > +system = 'linux'
> > > +cpu_family = 'aarch64'
> > > +cpu = 'armv8-a'
> > > +endian = 'little'
> > > +
> > > +[properties]
> > > +machine = 'thunderxt88'
> > > diff --git a/config/arm/thunderxt88/meson.build
> > > b/config/arm/thunderxt88/meson.build
> > > new file mode 100644
> > > index 000000000..2aa5d2cdd
> > > --- /dev/null
> > > +++ b/config/arm/thunderxt88/meson.build
> > > @@ -0,0 +1,18 @@
> > > +flags = {
> > > +	'common': [
> > > +		['RTE_CACHE_LINE_SIZE', 128],
> > > +		['RTE_MAX_VFIO_GROUPS', 128],
> > > +		['RTE_MACHINE', '"thunderx"'],
> > > +		['RTE_USE_C11_MEM_MODEL', false]
> > > +	],
> > > +	'thunderxt88': [
> > > +		['RTE_MAX_NUMA_NODES', 2],
> > > +		['RTE_MAX_LCORE', 96]
> > > +	],
> > > +	'thunderxt88-1n-48c': [
> > > +		['RTE_MAX_NUMA_NODES', 1],
> > > +		['RTE_MAX_LCORE', 48]
> > > +	]
> > > +}
> > > +
> > > +machine_args = ['-mcpu=thunderxt88']
> > > diff --git a/config/meson.build b/config/meson.build index
> > > 69f2aeb60..177cbd49c 100644
> > > --- a/config/meson.build
> > > +++ b/config/meson.build
> > > @@ -63,7 +63,14 @@ meson.add_install_script('../buildtools/symlink-
> > > drivers-solibs.sh',
> > >
> > >  # set the machine type and cflags for it  if meson.is_cross_build()
> > > -	machine = host_machine.cpu()
> > > +	if not host_machine.cpu_family().startswith('aarch')
> > > +		# don't change the machine config for aarch32/64 builds
> > > +		# that config is set in the cross file to identify the soc
> > > +		# we're building for
> > > +		machine = host_machine.cpu()
> > > +	else
> > > +		machine = meson.get_cross_property('machine', 'default')
> > > +	endif
> > >  else
> > >  	machine = get_option('machine')
> > >  endif
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options
  2020-09-24 19:17       ` Honnappa Nagarahalli
@ 2020-09-24 22:08         ` Ali Saidi
       [not found]         ` <20200924220710.19937-1-alisaidi@amazon.com>
  1 sibling, 0 replies; 465+ messages in thread
From: Ali Saidi @ 2020-09-24 22:08 UTC (permalink / raw)
  To: honnappa.nagarahalli
  Cc: Dharmik.Thakkar, Phil.Yang, Ruifeng.Wang, bruce.richardson, dev,
	hemant.agrawal, jerinjacobk, juraj.linkes, nd, vcchunga

<snip>

> > > >
> > > > The current system can identify only the implementer and part number
> > > > of the arm device we're targeting, which is enough to identify the target
> > CPU.
> > > > However, even the full MIDR information is not enough to identify
> > > > the SoC we're targeting.
> > > >
> > > > Expand the "machine" meson variable to allow specifying the target arm
> > SoC.
> > > > The SoC identification implies the CPU, so drop the current MIDR
> > > > based CPU identification in favor of user input, which is the only
> > > > way to identify the target SoC. This implies that native builds are
> > > > not possible. Instead do a default (non-optimized, but executable on
> > > > any
> > > > aarch64 device) build.
I don't think this is really what we want. The MIDR identifies the architecture
features that are supported and we should continue to use that for native
builds.
 
The difference between SoCs really comes down to the RAM and core count, which
are also detectable or could be specified seperately and defaulted to the
detected values. 
 
<snip>
 
> > 
> > Maybe we can have multiple labels mean the same thing - default, generic,
> > armv8 or even generic-armv8 (that's the most descriptive name IMO) could
> > all mean the generic arm build executable on all aarch64 SoCs. That many
> > names is probably confusing, but sticking to two (default and one more)
> > seems feasible.
> > 
> > What does everyone else think?
> 'armv8' makes lot more sense to me and it conveys what the build does. We can keep 'default' to be backward compatible, we can skip others.

native build below should just be that. Detect the MIDR, use that for the feature
flags and use the existing number of CPUs (or a user-specified number). I like 
generic-armv8 personally beacuse specifies a generic build that won't be 
optimized. 


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

* Re: [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options
       [not found]         ` <20200924220710.19937-1-alisaidi@amazon.com>
@ 2020-09-28 19:39           ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-09-28 19:39 UTC (permalink / raw)
  To: Ali Saidi
  Cc: Dharmik Thakkar, Phil Yang, Ruifeng Wang, bruce.richardson, dev,
	hemant.agrawal, jerinjacobk, juraj.linkes, nd, vcchunga,
	Honnappa Nagarahalli, nd

<snip>
> 
> > > > >
> > > > > The current system can identify only the implementer and part
> > > > > number of the arm device we're targeting, which is enough to
> > > > > identify the target
> > > CPU.
> > > > > However, even the full MIDR information is not enough to
> > > > > identify the SoC we're targeting.
> > > > >
> > > > > Expand the "machine" meson variable to allow specifying the
> > > > > target arm
> > > SoC.
> > > > > The SoC identification implies the CPU, so drop the current MIDR
> > > > > based CPU identification in favor of user input, which is the
> > > > > only way to identify the target SoC. This implies that native
> > > > > builds are not possible. Instead do a default (non-optimized,
> > > > > but executable on any
> > > > > aarch64 device) build.
> I don't think this is really what we want. The MIDR identifies the architecture
> features that are supported and we should continue to use that for native
> builds.
> 
> The difference between SoCs really comes down to the RAM and core count,
> which are also detectable or could be specified seperately and defaulted to
> the detected values.
Hi Ali, thank you for the feedback. The differences between SoCs can be more than RAM/core count (ex: NUMA details) and addresses the need to compile only some modules of DPDK.
But, having said that we will keep the native build also. It will continue to function the way it does today. 

> 
> <snip>
> 
> > >
> > > Maybe we can have multiple labels mean the same thing - default,
> > > generic,
> > > armv8 or even generic-armv8 (that's the most descriptive name IMO)
> > > could all mean the generic arm build executable on all aarch64 SoCs.
> > > That many names is probably confusing, but sticking to two (default
> > > and one more) seems feasible.
> > >
> > > What does everyone else think?
> > 'armv8' makes lot more sense to me and it conveys what the build does.
> We can keep 'default' to be backward compatible, we can skip others.
> 
> native build below should just be that. Detect the MIDR, use that for the
> feature flags and use the existing number of CPUs (or a user-specified
> number). I like
> generic-armv8 personally beacuse specifies a generic build that won't be
> optimized.

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

* [dpdk-dev] [RFC PATCH v2 0/6] Arm build options rework
  2020-09-23 13:19 [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Juraj Linkeš
                   ` (2 preceding siblings ...)
  2020-09-24  3:03 ` [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Honnappa Nagarahalli
@ 2020-10-13 14:54 ` Juraj Linkeš
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
                     ` (6 more replies)
  3 siblings, 7 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-13 14:54 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information.

Add a way to discover cpu count a numa node count and use that instead
of statically defined values. This augments the current native builds.
A bonus is that users may now use -Dmax_lcores and -Dmax_numa_nodes to
configure those from command line, which didn't work before for Arm
builds.

For cross builds, the cpu count and numa node count are specified in
cross files.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in cross files. Only libnuma
can be now disabled.

v2:
Major rework of the whole series.

Juraj Linkeš (6):
  build: rename default Arm build to generic-armv8
  build: refactor Arm build
  build: automatic NUMA and cpu counts detection
  build: move core and NUMA counts to cross files
  build: disable Arm drivers
  build: update Arm builds with makefile flags

 buildtools/get_cpu_count.py          |   7 +
 buildtools/get_numa_count.py         |  17 ++
 buildtools/meson.build               |   2 +
 config/arm/arm64_armada_linux_gcc    |   6 +-
 config/arm/arm64_armv8_linux_gcc     |  17 +-
 config/arm/arm64_bluefield_linux_gcc |   6 +-
 config/arm/arm64_dpaa_linux_gcc      |   5 +-
 config/arm/arm64_emag_linux_gcc      |   4 +-
 config/arm/arm64_n1sdp_linux_gcc     |   7 +-
 config/arm/arm64_octeontx2_linux_gcc |   7 +-
 config/arm/arm64_stingray_linux_gcc  |   6 +-
 config/arm/arm64_thunderx2_linux_gcc |   6 +-
 config/arm/arm64_thunderx_linux_gcc  |   4 +-
 config/arm/meson.build               | 293 +++++++++++++++------------
 config/meson.build                   |  23 ++-
 drivers/meson.build                  |   6 +-
 meson.build                          |   1 +
 meson_options.txt                    |   8 +-
 18 files changed, 267 insertions(+), 158 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v2 1/6] build: rename default Arm build to generic-armv8
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
@ 2020-10-13 14:54   ` Juraj Linkeš
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 2/6] build: refactor Arm build Juraj Linkeš
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-13 14:54 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic-armv8'. Leave machine='default' for backwards
compatibility.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42c0c34a5..c371f983e 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'default' or machine == 'generic-armv8')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -87,7 +88,7 @@ flags_octeontx2_extra = [
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
 
-machine_args_generic = [
+machine_args_default = [
 	['default', ['-march=armv8-a+crc']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
@@ -113,20 +114,20 @@ machine_args_emag = [
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
+impl_generic = ['Generic armv8', flags_generic, machine_args_default]
+impl_0x41 = ['Arm', flags_arm, machine_args_default]
+impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
 impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
+impl_0x44 = ['DEC', flags_generic, machine_args_default]
+impl_0x49 = ['Infineon', flags_generic, machine_args_default]
+impl_0x4d = ['Motorola', flags_generic, machine_args_default]
+impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
 impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
+impl_0x53 = ['Samsung', flags_generic, machine_args_default]
+impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
+impl_0x69 = ['Intel', flags_generic, machine_args_default]
+impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
 
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -145,7 +146,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 9fb903c9b..4bd65d98e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -80,9 +80,6 @@ if machine == 'default'
 		machine = 'corei7'
 	elif host_machine.cpu_family().startswith('arm')
 		machine = 'armv7-a'
-	elif host_machine.cpu_family().startswith('aarch')
-		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v2 2/6] build: refactor Arm build
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
@ 2020-10-13 14:54   ` Juraj Linkeš
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-13 14:54 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

* Rename variables to have names that better describe what the variables
store
* Remove unused or superfluous variables
* Change a list to dictionary where key lookup is needed
* Add informatory comments in the code
* Minor code restructure and reformatting

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 246 +++++++++++++++------------
 11 files changed, 153 insertions(+), 129 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index c371f983e..646438f09 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,12 +3,12 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
+# set arm_force_native_march if you want to use machine args below
+# instead of discovered values; only works when doing an actual native build
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'default' or machine == 'generic-armv8')
+native_machine_args = ['-march=native', '-mtune=native']
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
@@ -16,8 +16,9 @@ flags_common_default = [
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -28,110 +29,124 @@ flags_common_default = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_ARCH_ARM64', true]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128]
+]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 flags_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_VFIO_GROUPS', 128]
+]
 flags_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]
+]
 flags_emag = [
 	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 flags_armada = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 
-flags_default_extra = []
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false]
+]
 flags_thunderx_extra = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_thunderx2_extra = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_USE_C11_MEM_MODEL', true]
+]
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
-
-machine_args_default = [
-	['default', ['-march=armv8-a+crc']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
-
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['RTE_USE_C11_MEM_MODEL', true]
+]
+# arm config (implementer 0x41) is the default config
+pn_config_default = {
+	'generic': [['-march=armv8-a+crc']],
+	'0xd03': [['-mcpu=cortex-a53']],
+	'0xd04': [['-mcpu=cortex-a35']],
+	'0xd07': [['-mcpu=cortex-a57']],
+	'0xd08': [['-mcpu=cortex-a72']],
+	'0xd09': [['-mcpu=cortex-a73']],
+	'0xd0a': [['-mcpu=cortex-a75']],
+	'0xd0b': [['-mcpu=cortex-a76']],
+	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]
+}
+pn_config_cavium = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
+	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
+	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
+	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
+	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
+	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra],
+}
+pn_config_emag = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']]
+}
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_default]
-impl_0x41 = ['Arm', flags_arm, machine_args_default]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_default]
-impl_0x49 = ['Infineon', flags_generic, machine_args_default]
-impl_0x4d = ['Motorola', flags_generic, machine_args_default]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
-impl_0x53 = ['Samsung', flags_generic, machine_args_default]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
-impl_0x69 = ['Intel', flags_generic, machine_args_default]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
+impl_generic = ['Generic armv8', flags_generic, pn_config_default]
+impl_0x41 = ['Arm', flags_arm, pn_config_default]
+impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
+impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
+impl_0x44 = ['DEC', flags_generic, pn_config_default]
+impl_0x49 = ['Infineon', flags_generic, pn_config_default]
+impl_0x4d = ['Motorola', flags_generic, pn_config_default]
+impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
+impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
+impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
+impl_0x53 = ['Samsung', flags_generic, pn_config_default]
+impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
+impl_0x69 = ['Intel', flags_generic, pn_config_default]
+impl_dpaa = ['NXP DPAA', flags_dpaa, pn_config_default]
 
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if not dpdk_conf.get('RTE_ARCH_64')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARM', 1)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
@@ -139,73 +154,82 @@ if not dpdk_conf.get('RTE_ARCH_64')
 	# 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)
+	# aarch64 build
+	if not meson.is_cross_build()
+		if machine == 'default' or machine == 'generic-arvm8'
+			# default build
+			impl_config = impl_generic
+			part_number = 'generic'
+		else
+			# native 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
+			if arm_force_native_march == true
+				part_number = 'native'
+			else
+				part_number = cmd_output[3]
+			endif
+			# Set to generic implementer if implementer is not found
+			impl_config = get_variable('impl_' + cmd_output[0], 'impl_generic')
+		endif
+	else
+		# cross build
+		impl_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		impl_config = get_variable('impl_' + impl_id)
+	endif
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
-	cmd_output = cmd_generic # Set generic by default
-	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+	message('Arm implementer: ' + impl_config[0])
+	message('Arm part number: ' + part_number)
+
+	implementer_flags = impl_config[1]
+	part_number_config = impl_config[2]
+
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif part_number == 'native'
+		# use native machine args
+		part_number_config = [[native_machine_args]]
 	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
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
 	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)
+		# cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
 	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])
+	dpdk_flags = flags_common_default + implementer_flags
+
+	if part_number_config.length() > 1
+		dpdk_flags += part_number_config[1]
+	endif
+
+	machine_args = [] # Clear previous machine args
+	foreach flag: part_number_config[0]
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	foreach flag: dpdk_flags
 		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
+
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 2/6] build: refactor Arm build Juraj Linkeš
@ 2020-10-13 14:54   ` Juraj Linkeš
  2020-10-13 15:47     ` Bruce Richardson
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 4/6] build: move core and NUMA counts to cross files Juraj Linkeš
                     ` (3 subsequent siblings)
  6 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-13 14:54 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The build machine's number of cpus and numa nodes vary, resulting in
mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for many
builds. Automatically discover the host's numa and cpu counts to remove
this mismatch for native builds. Use current defaults for cross builds.
Leave users the option to override both if the specify a non-zero
amount on the command line.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 buildtools/get_cpu_count.py  |  7 +++++++
 buildtools/get_numa_count.py | 17 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 20 ++++++++++++++++++--
 meson_options.txt            |  8 ++++----
 5 files changed, 48 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..386f85f8b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..f2ad35532
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,17 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+
+if os.name == 'posix':
+    print(len(glob.glob('/sys/devices/system/node/node*')))
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index 4bd65d98e..84c31c8e7 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -226,8 +226,24 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
+max_lcores = get_option('max_lcores')
+if max_lcores == 0
+	if meson.is_cross_build()
+		max_lcores = 4
+	else
+		max_lcores = run_command(get_cpu_count_cmd).stdout()
+	endif
+endif
+dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+max_numa_nodes = get_option('max_numa_nodes')
+if max_numa_nodes == 0
+	if meson.is_cross_build()
+		max_numa_nodes = 128
+	else
+		max_numa_nodes = run_command(get_numa_count_cmd).stdout()
+	endif
+endif
+dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..60a949fca 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Value 0 means the number of cpus on the host will be used')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Value 0 means the number of numa nodes on the host will be used')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v2 4/6] build: move core and NUMA counts to cross files
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
                     ` (2 preceding siblings ...)
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-13 14:54   ` Juraj Linkeš
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 5/6] build: disable Arm drivers Juraj Linkeš
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-13 14:54 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The values of RTE_MAX_NUMA_NODES and RTE_MAX_LCORE are going to vary for
different build machines, even for the same Implementer ID and Part
Number combinations. Move the fixed values to cross files and use
automatic discovery/values from cmdline options for native build. Use
predefined values for generic-armv8 build, since that build is not tied
to the build machine.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |  2 ++
 config/arm/arm64_armv8_linux_gcc     |  5 ++++
 config/arm/arm64_bluefield_linux_gcc |  1 +
 config/arm/arm64_dpaa_linux_gcc      |  2 ++
 config/arm/arm64_emag_linux_gcc      |  2 ++
 config/arm/arm64_n1sdp_linux_gcc     |  2 ++
 config/arm/arm64_octeontx2_linux_gcc |  2 ++
 config/arm/arm64_stingray_linux_gcc  |  1 +
 config/arm/arm64_thunderx2_linux_gcc |  2 ++
 config/arm/arm64_thunderx_linux_gcc  |  2 ++
 config/arm/meson.build               | 36 +++++++++++++++-------------
 11 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..dca2b911e 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_numa_nodes = 1
+max_lcore = 16
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..ac12fa62d 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -26,3 +26,8 @@ implementer_id = 'generic'
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
 part_number = 'generic'
+
+# Supported extra configuration
+# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+# max_lcore = n       # will set RTE_MAX_LCORE
+max_lcore = 256
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..40265ac34 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcore = 16
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..c5f738006 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_numa_nodes = 1
+max_lcore = 16
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..a2c10133f 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+max_numa_nodes = 1
+max_lcore = 32
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..05fad95e8 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_numa_nodes = 1
+max_lcore = 4
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..2ed9fd03d 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_numa_nodes = 1
+max_lcore = 36
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..40265ac34 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcore = 16
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..d538a59e1 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_numa_nodes = 2
+max_lcore = 256
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 670764437..656d103e3 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+max_numa_nodes = 1
+max_lcore = 96
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 646438f09..f525403f6 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -33,44 +33,40 @@ flags_common_default = [
 	['RTE_ARCH_ARM64', true]
 ]
 
+# add these to defaults when machine='generic-armv8'
+flags_force_generic = [
+	['RTE_MAX_NUMA_NODES', 4],
+	['RTE_MAX_LCORE', 256]
+]
+
 # implementer specific aarch64 flags, with middle priority
 # (will overwrite common flags)
 flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]
 ]
 flags_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
-	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]
 ]
 flags_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]
 ]
 flags_emag = [
 	['RTE_MACHINE', '"emag"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32],
 	['RTE_CACHE_LINE_SIZE', 64]
 ]
 flags_armada = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16],
 	['RTE_CACHE_LINE_SIZE', 64]
 ]
 
@@ -78,8 +74,6 @@ flags_armada = [
 # (will overwrite both common and implementer specific flags)
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]
 ]
@@ -90,15 +84,11 @@ flags_thunderx_extra = [
 flags_thunderx2_extra = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
-	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]
 ]
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]
@@ -160,6 +150,7 @@ else
 			# default build
 			impl_config = impl_generic
 			part_number = 'generic'
+			flags_common_default += flags_force_generic
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -214,6 +205,19 @@ else
 		dpdk_flags += part_number_config[1]
 	endif
 
+	# apply cross-specific options
+	if meson.is_cross_build()
+		# configure RTE_MAX_NUMA_NODES and RTE_MAX_LCORE from cross file
+		# RFC: do we want defaults for these two? or should we require
+		# that all cross file define them?
+		dpdk_flags += [
+			['RTE_MAX_NUMA_NODES', meson.get_cross_property('max_numa_nodes', 1)]
+		]
+		dpdk_flags += [
+			['RTE_MAX_LCORE', meson.get_cross_property('max_lcore', 16)]
+		]
+	endif
+
 	machine_args = [] # Clear previous machine args
 	foreach flag: part_number_config[0]
 		if cc.has_argument(flag)
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v2 5/6] build: disable Arm drivers
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
                     ` (3 preceding siblings ...)
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 4/6] build: move core and NUMA counts to cross files Juraj Linkeš
@ 2020-10-13 14:54   ` Juraj Linkeš
  2020-10-13 15:49     ` Bruce Richardson
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 6/6] build: update Arm builds with makefile flags Juraj Linkeš
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
  6 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-13 14:54 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 9 +++++----
 drivers/meson.build    | 2 +-
 meson.build            | 1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index f525403f6..3a1e13f64 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,6 +8,11 @@
 arm_force_native_march = false
 native_machine_args = ['-march=native', '-mtune=native']
 
+# RFC: do we want these drivers to be disabled by default on arm?
+# The previous way to disable these drivers never worked
+# RTE_LIBRTE_AVP_PMD and the rest would be overwritten to true if the necessary deps were found
+disabled_drivers += ['net/avp', 'net/fm10k', 'net/sfc']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -23,10 +28,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_LIBRTE_FM10K_PMD', false],
-	['RTE_LIBRTE_SFC_EFX_PMD', false],
-	['RTE_LIBRTE_AVP_PMD', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_CACHE_LINE_SIZE', 128],
diff --git a/drivers/meson.build b/drivers/meson.build
index 5f9526557..f9250f3bb 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -17,7 +17,7 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
 default_cflags = machine_args
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v2 6/6] build: update Arm builds with makefile flags
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
                     ` (4 preceding siblings ...)
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 5/6] build: disable Arm drivers Juraj Linkeš
@ 2020-10-13 14:54   ` Juraj Linkeš
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-13 14:54 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Not all flags were moved properly from the old Makefile build system.
Disable corresponding drivers and libnuma in cross files and remove
deprecated config.

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

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index dca2b911e..8fa856fed 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,5 @@ endian = 'little'
 implementer_id = '0x56'
 max_numa_nodes = 1
 max_lcore = 16
+has_libnuma = 0
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index ac12fa62d..797152b9e 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -28,6 +28,10 @@ implementer_id = 'generic'
 part_number = 'generic'
 
 # Supported extra configuration
-# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-# max_lcore = n       # will set RTE_MAX_LCORE
+# max_numa_nodes = n   # will set RTE_MAX_NUMA_NODES
+# max_lcore = n        # will set RTE_MAX_LCORE
 max_lcore = 256
+
+# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
+# disabled_drivers += ['bus/dpaa', 'crypto']
+    # add to the set of disabled libraries
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 40265ac34..e25067b7e 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -16,3 +16,4 @@ endian = 'little'
 implementer_id = '0x41'
 part_number = '0xd08'
 max_lcore = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index c5f738006..120e90ed9 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = 'dpaa'
 max_numa_nodes = 1
 max_lcore = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 05fad95e8..0d249dffa 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_numa_nodes = 1
 max_lcore = 4
+has_libnuma = 0
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 2ed9fd03d..56495d655 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_numa_nodes = 1
 max_lcore = 36
+has_libnuma = 0
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 40265ac34..e25067b7e 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -16,3 +16,4 @@ endian = 'little'
 implementer_id = '0x41'
 part_number = '0xd08'
 max_lcore = 16
+has_libnuma = 0
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 3a1e13f64..c1067dbb5 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -91,7 +91,6 @@ flags_thunderx2_extra = [
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]
 ]
 # arm config (implementer 0x41) is the default config
@@ -217,6 +216,10 @@ else
 		dpdk_flags += [
 			['RTE_MAX_LCORE', meson.get_cross_property('max_lcore', 16)]
 		]
+		cross_has_libnuma = meson.get_cross_property('has_libnuma', '')
+		if cross_has_libnuma != ''
+			has_libnuma = cross_has_libnuma
+		endif
 	endif
 
 	machine_args = [] # Clear previous machine args
diff --git a/drivers/meson.build b/drivers/meson.build
index f9250f3bb..b14d62fe4 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -20,6 +20,10 @@ subdirs = [
 disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
-- 
2.20.1


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

* Re: [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-13 15:47     ` Bruce Richardson
  2020-10-14  6:04       ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-13 15:47 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Tue, Oct 13, 2020 at 04:54:39PM +0200, Juraj Linkeš wrote:
> The build machine's number of cpus and numa nodes vary, resulting in
> mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for many
> builds. Automatically discover the host's numa and cpu counts to remove
> this mismatch for native builds. Use current defaults for cross builds.
> Leave users the option to override both if the specify a non-zero
> amount on the command line.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  buildtools/get_cpu_count.py  |  7 +++++++
>  buildtools/get_numa_count.py | 17 +++++++++++++++++
>  buildtools/meson.build       |  2 ++
>  config/meson.build           | 20 ++++++++++++++++++--
>  meson_options.txt            |  8 ++++----
>  5 files changed, 48 insertions(+), 6 deletions(-)
>  create mode 100644 buildtools/get_cpu_count.py
>  create mode 100644 buildtools/get_numa_count.py
> 
> diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> new file mode 100644
> index 000000000..386f85f8b
> --- /dev/null
> +++ b/buildtools/get_cpu_count.py
> @@ -0,0 +1,7 @@
> +#!/usr/bin/python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import os
> +
> +print(os.cpu_count())
> diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
> new file mode 100644
> index 000000000..f2ad35532
> --- /dev/null
> +++ b/buildtools/get_numa_count.py
> @@ -0,0 +1,17 @@
> +#!/usr/bin/python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import ctypes
> +import glob
> +import os
> +
> +if os.name == 'posix':
> +    print(len(glob.glob('/sys/devices/system/node/node*')))

FreeBSD also reports it's os.name as posix, but doesn't have a /sys/devices
path to query.

> +elif os.name == 'nt':
> +    libkernel32 = ctypes.windll.kernel32
> +
> +    count = ctypes.c_ulong()
> +
> +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> +    print(count.value + 1)
> diff --git a/buildtools/meson.build b/buildtools/meson.build
> index 04808dabc..925e733b1 100644
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> @@ -17,3 +17,5 @@ else
>  endif
>  map_to_win_cmd = py3 + files('map_to_win.py')
>  sphinx_wrapper = py3 + files('call-sphinx-build.py')
> +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> +get_numa_count_cmd = py3 + files('get_numa_count.py')
> diff --git a/config/meson.build b/config/meson.build
> index 4bd65d98e..84c31c8e7 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -226,8 +226,24 @@ foreach arg: warning_flags
>  endforeach
>  
>  # set other values pulled from the build options
> -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> +max_lcores = get_option('max_lcores')
> +if max_lcores == 0
> +	if meson.is_cross_build()
> +		max_lcores = 4

This seems a rather low number to default to. I would suspect in this case
you might be better just to error out, i.e. require that the max_lcores
value is given when cross-compiling.

> +	else
> +		max_lcores = run_command(get_cpu_count_cmd).stdout()
> +	endif
> +endif
> +dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> +max_numa_nodes = get_option('max_numa_nodes')
> +if max_numa_nodes == 0
> +	if meson.is_cross_build()
> +		max_numa_nodes = 128

Same here, I think it's better to force the user to specify a value.
BTW: did you unintentionally switch the max cores and max numa nodes values
in this patch?

> +	else
> +		max_numa_nodes = run_command(get_numa_count_cmd).stdout()
> +	endif
> +endif
> +dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
>  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
>  dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
>  dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
> diff --git a/meson_options.txt b/meson_options.txt
> index 9bf18ab6b..60a949fca 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
>  	description: 'set the target machine type')
>  option('max_ethports', type: 'integer', value: 32,
>  	description: 'maximum number of Ethernet devices')
> -option('max_lcores', type: 'integer', value: 128,
> -	description: 'maximum number of cores/threads supported by EAL')
> -option('max_numa_nodes', type: 'integer', value: 4,
> -	description: 'maximum number of NUMA nodes supported by EAL')
> +option('max_lcores', type: 'integer', value: 0,
> +	description: 'maximum number of cores/threads supported by EAL. Value 0 means the number of cpus on the host will be used')
> +option('max_numa_nodes', type: 'integer', value: 0,
> +	description: 'maximum number of NUMA nodes supported by EAL. Value 0 means the number of numa nodes on the host will be used')
>  option('enable_trace_fp', type: 'boolean', value: false,
>  	description: 'enable fast path trace points.')
>  option('tests', type: 'boolean', value: true,
> -- 
> 2.20.1
> 

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

* Re: [dpdk-dev] [RFC PATCH v2 5/6] build: disable Arm drivers
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 5/6] build: disable Arm drivers Juraj Linkeš
@ 2020-10-13 15:49     ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-10-13 15:49 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Tue, Oct 13, 2020 at 04:54:41PM +0200, Juraj Linkeš wrote:
> A few options that disabled drivers in the old makefiles were improperly
> ported to the meson build system. Fix this by adding a to the list of
> disabled drivers, similarly how the command line option works.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 9 +++++----
>  drivers/meson.build    | 2 +-
>  meson.build            | 1 +
>  3 files changed, 7 insertions(+), 5 deletions(-)
> 
This seems a better approach to disabling the drivers.

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

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

* Re: [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection
  2020-10-13 15:47     ` Bruce Richardson
@ 2020-10-14  6:04       ` Juraj Linkeš
  2020-10-14  8:16         ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-14  6:04 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, October 13, 2020 5:48 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts
> detection
> 
> On Tue, Oct 13, 2020 at 04:54:39PM +0200, Juraj Linkeš wrote:
> > The build machine's number of cpus and numa nodes vary, resulting in
> > mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for
> many
> > builds. Automatically discover the host's numa and cpu counts to
> > remove this mismatch for native builds. Use current defaults for cross builds.
> > Leave users the option to override both if the specify a non-zero
> > amount on the command line.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  buildtools/get_cpu_count.py  |  7 +++++++
> > buildtools/get_numa_count.py | 17 +++++++++++++++++
> >  buildtools/meson.build       |  2 ++
> >  config/meson.build           | 20 ++++++++++++++++++--
> >  meson_options.txt            |  8 ++++----
> >  5 files changed, 48 insertions(+), 6 deletions(-)  create mode 100644
> > buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py
> >
> > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > new file mode 100644 index 000000000..386f85f8b
> > --- /dev/null
> > +++ b/buildtools/get_cpu_count.py
> > @@ -0,0 +1,7 @@
> > +#!/usr/bin/python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import os
> > +
> > +print(os.cpu_count())
> > diff --git a/buildtools/get_numa_count.py
> > b/buildtools/get_numa_count.py new file mode 100644 index
> > 000000000..f2ad35532
> > --- /dev/null
> > +++ b/buildtools/get_numa_count.py
> > @@ -0,0 +1,17 @@
> > +#!/usr/bin/python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import ctypes
> > +import glob
> > +import os
> > +
> > +if os.name == 'posix':
> > +    print(len(glob.glob('/sys/devices/system/node/node*')))
> 
> FreeBSD also reports it's os.name as posix, but doesn't have a /sys/devices path
> to query.
> 

Do you know how do I get numa count on FreeBDS? I don't want to use the numa library if we can to avoid unneccesary dependencies. Do we need to cover some other cases other than FreeBDS, other Linux and Windows?

> > +elif os.name == 'nt':
> > +    libkernel32 = ctypes.windll.kernel32
> > +
> > +    count = ctypes.c_ulong()
> > +
> > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > +    print(count.value + 1)
> > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > 04808dabc..925e733b1 100644
> > --- a/buildtools/meson.build
> > +++ b/buildtools/meson.build
> > @@ -17,3 +17,5 @@ else
> >  endif
> >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> > files('call-sphinx-build.py')
> > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > diff --git a/config/meson.build b/config/meson.build index
> > 4bd65d98e..84c31c8e7 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -226,8 +226,24 @@ foreach arg: warning_flags  endforeach
> >
> >  # set other values pulled from the build options
> > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > +max_lcores = get_option('max_lcores') if max_lcores == 0
> > +	if meson.is_cross_build()
> > +		max_lcores = 4
> 
> This seems a rather low number to default to. I would suspect in this case you
> might be better just to error out, i.e. require that the max_lcores value is given
> when cross-compiling.
> 
> > +	else
> > +		max_lcores = run_command(get_cpu_count_cmd).stdout()
> > +	endif
> > +endif
> > +dpdk_conf.set('RTE_MAX_LCORE', max_lcores) max_numa_nodes =
> > +get_option('max_numa_nodes') if max_numa_nodes == 0
> > +	if meson.is_cross_build()
> > +		max_numa_nodes = 128
> 
> Same here, I think it's better to force the user to specify a value.
> BTW: did you unintentionally switch the max cores and max numa nodes values
> in this patch?
> 

Yes, the values are switched. Forcing the user to specify these might be tricky - we want to specify cpu and numa counts in cross files and this check happens before the values from cross files are used (in another patch I'm asking about having defaults in config/arm/meson.build and if we don't have defaults we won't want them there as well. The remaning question would be what get priority - command line options or cross file options. I'm leaning towards command line options). I'll think about switching the order.

> > +	else
> > +		max_numa_nodes =
> run_command(get_numa_count_cmd).stdout()
> > +	endif
> > +endif
> > +dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
> > diff --git a/meson_options.txt b/meson_options.txt index
> > 9bf18ab6b..60a949fca 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> >  	description: 'set the target machine type')  option('max_ethports',
> > type: 'integer', value: 32,
> >  	description: 'maximum number of Ethernet devices')
> > -option('max_lcores', type: 'integer', value: 128,
> > -	description: 'maximum number of cores/threads supported by EAL')
> > -option('max_numa_nodes', type: 'integer', value: 4,
> > -	description: 'maximum number of NUMA nodes supported by EAL')
> > +option('max_lcores', type: 'integer', value: 0,
> > +	description: 'maximum number of cores/threads supported by EAL.
> > +Value 0 means the number of cpus on the host will be used')
> option('max_numa_nodes', type: 'integer', value: 0,
> > +	description: 'maximum number of NUMA nodes supported by EAL. Value
> 0
> > +means the number of numa nodes on the host will be used')
> >  option('enable_trace_fp', type: 'boolean', value: false,
> >  	description: 'enable fast path trace points.')  option('tests',
> > type: 'boolean', value: true,
> > --
> > 2.20.1
> >


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

* Re: [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection
  2020-10-14  6:04       ` Juraj Linkeš
@ 2020-10-14  8:16         ` Bruce Richardson
  2020-10-14  8:52           ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-14  8:16 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 14, 2020 at 06:04:52AM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Tuesday, October 13, 2020 5:48 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > Subject: Re: [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts
> > detection
> > 
> > On Tue, Oct 13, 2020 at 04:54:39PM +0200, Juraj Linkeš wrote:
> > > The build machine's number of cpus and numa nodes vary, resulting in
> > > mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for
> > many
> > > builds. Automatically discover the host's numa and cpu counts to
> > > remove this mismatch for native builds. Use current defaults for cross builds.
> > > Leave users the option to override both if the specify a non-zero
> > > amount on the command line.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  buildtools/get_cpu_count.py  |  7 +++++++
> > > buildtools/get_numa_count.py | 17 +++++++++++++++++
> > >  buildtools/meson.build       |  2 ++
> > >  config/meson.build           | 20 ++++++++++++++++++--
> > >  meson_options.txt            |  8 ++++----
> > >  5 files changed, 48 insertions(+), 6 deletions(-)  create mode 100644
> > > buildtools/get_cpu_count.py  create mode 100644
> > > buildtools/get_numa_count.py
> > >
> > > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > > new file mode 100644 index 000000000..386f85f8b
> > > --- /dev/null
> > > +++ b/buildtools/get_cpu_count.py
> > > @@ -0,0 +1,7 @@
> > > +#!/usr/bin/python3
> > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > +PANTHEON.tech s.r.o.
> > > +
> > > +import os
> > > +
> > > +print(os.cpu_count())
> > > diff --git a/buildtools/get_numa_count.py
> > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > 000000000..f2ad35532
> > > --- /dev/null
> > > +++ b/buildtools/get_numa_count.py
> > > @@ -0,0 +1,17 @@
> > > +#!/usr/bin/python3
> > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > +PANTHEON.tech s.r.o.
> > > +
> > > +import ctypes
> > > +import glob
> > > +import os
> > > +
> > > +if os.name == 'posix':
> > > +    print(len(glob.glob('/sys/devices/system/node/node*')))
> > 
> > FreeBSD also reports it's os.name as posix, but doesn't have a /sys/devices path
> > to query.
> > 
> 
> Do you know how do I get numa count on FreeBDS? I don't want to use the numa library if we can to avoid unneccesary dependencies. Do we need to cover some other cases other than FreeBDS, other Linux and Windows?
> 

To get numa count on freebsd, you can query it using "sysctl vm.ndomains"
command. However, the bigger issue here is that you need something
different other than os.name to distinguish between linux and freebsd.

Regards,
/Bruce

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

* Re: [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection
  2020-10-14  8:16         ` Bruce Richardson
@ 2020-10-14  8:52           ` Juraj Linkeš
  2020-10-14  9:22             ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-14  8:52 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, October 14, 2020 10:16 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts
> detection
> 
> On Wed, Oct 14, 2020 at 06:04:52AM +0000, Juraj Linkeš wrote:
> >
> >
> > > -----Original Message-----
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > Sent: Tuesday, October 13, 2020 5:48 PM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > > Subject: Re: [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts
> > > detection
> > >
> > > On Tue, Oct 13, 2020 at 04:54:39PM +0200, Juraj Linkeš wrote:
> > > > The build machine's number of cpus and numa nodes vary, resulting
> > > > in mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES
> for
> > > many
> > > > builds. Automatically discover the host's numa and cpu counts to
> > > > remove this mismatch for native builds. Use current defaults for cross
> builds.
> > > > Leave users the option to override both if the specify a non-zero
> > > > amount on the command line.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > ---
> > > >  buildtools/get_cpu_count.py  |  7 +++++++
> > > > buildtools/get_numa_count.py | 17 +++++++++++++++++
> > > >  buildtools/meson.build       |  2 ++
> > > >  config/meson.build           | 20 ++++++++++++++++++--
> > > >  meson_options.txt            |  8 ++++----
> > > >  5 files changed, 48 insertions(+), 6 deletions(-)  create mode
> > > > 100644 buildtools/get_cpu_count.py  create mode 100644
> > > > buildtools/get_numa_count.py
> > > >
> > > > diff --git a/buildtools/get_cpu_count.py
> > > > b/buildtools/get_cpu_count.py new file mode 100644 index
> > > > 000000000..386f85f8b
> > > > --- /dev/null
> > > > +++ b/buildtools/get_cpu_count.py
> > > > @@ -0,0 +1,7 @@
> > > > +#!/usr/bin/python3
> > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > +PANTHEON.tech s.r.o.
> > > > +
> > > > +import os
> > > > +
> > > > +print(os.cpu_count())
> > > > diff --git a/buildtools/get_numa_count.py
> > > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > > 000000000..f2ad35532
> > > > --- /dev/null
> > > > +++ b/buildtools/get_numa_count.py
> > > > @@ -0,0 +1,17 @@
> > > > +#!/usr/bin/python3
> > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > +PANTHEON.tech s.r.o.
> > > > +
> > > > +import ctypes
> > > > +import glob
> > > > +import os
> > > > +
> > > > +if os.name == 'posix':
> > > > +    print(len(glob.glob('/sys/devices/system/node/node*')))
> > >
> > > FreeBSD also reports it's os.name as posix, but doesn't have a
> > > /sys/devices path to query.
> > >
> >
> > Do you know how do I get numa count on FreeBDS? I don't want to use the
> numa library if we can to avoid unneccesary dependencies. Do we need to cover
> some other cases other than FreeBDS, other Linux and Windows?
> >
> 
> To get numa count on freebsd, you can query it using "sysctl vm.ndomains"
> command. However, the bigger issue here is that you need something different
> other than os.name to distinguish between linux and freebsd.
> 

That should only be a matter of finding the right Python api - https://docs.python.org/3/library/sys.html?highlight=platform#sys.platform should be it.

> Regards,
> /Bruce


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

* Re: [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection
  2020-10-14  8:52           ` Juraj Linkeš
@ 2020-10-14  9:22             ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-10-14  9:22 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 14, 2020 at 08:52:12AM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Wednesday, October 14, 2020 10:16 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > Subject: Re: [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts
> > detection
> > 
> > On Wed, Oct 14, 2020 at 06:04:52AM +0000, Juraj Linkeš wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > Sent: Tuesday, October 13, 2020 5:48 PM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > > > Subject: Re: [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts
> > > > detection
> > > >
> > > > On Tue, Oct 13, 2020 at 04:54:39PM +0200, Juraj Linkeš wrote:
> > > > > The build machine's number of cpus and numa nodes vary, resulting
> > > > > in mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES
> > for
> > > > many
> > > > > builds. Automatically discover the host's numa and cpu counts to
> > > > > remove this mismatch for native builds. Use current defaults for cross
> > builds.
> > > > > Leave users the option to override both if the specify a non-zero
> > > > > amount on the command line.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > ---
> > > > >  buildtools/get_cpu_count.py  |  7 +++++++
> > > > > buildtools/get_numa_count.py | 17 +++++++++++++++++
> > > > >  buildtools/meson.build       |  2 ++
> > > > >  config/meson.build           | 20 ++++++++++++++++++--
> > > > >  meson_options.txt            |  8 ++++----
> > > > >  5 files changed, 48 insertions(+), 6 deletions(-)  create mode
> > > > > 100644 buildtools/get_cpu_count.py  create mode 100644
> > > > > buildtools/get_numa_count.py
> > > > >
> > > > > diff --git a/buildtools/get_cpu_count.py
> > > > > b/buildtools/get_cpu_count.py new file mode 100644 index
> > > > > 000000000..386f85f8b
> > > > > --- /dev/null
> > > > > +++ b/buildtools/get_cpu_count.py
> > > > > @@ -0,0 +1,7 @@
> > > > > +#!/usr/bin/python3
> > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > +PANTHEON.tech s.r.o.
> > > > > +
> > > > > +import os
> > > > > +
> > > > > +print(os.cpu_count())
> > > > > diff --git a/buildtools/get_numa_count.py
> > > > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > > > 000000000..f2ad35532
> > > > > --- /dev/null
> > > > > +++ b/buildtools/get_numa_count.py
> > > > > @@ -0,0 +1,17 @@
> > > > > +#!/usr/bin/python3
> > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > +PANTHEON.tech s.r.o.
> > > > > +
> > > > > +import ctypes
> > > > > +import glob
> > > > > +import os
> > > > > +
> > > > > +if os.name == 'posix':
> > > > > +    print(len(glob.glob('/sys/devices/system/node/node*')))
> > > >
> > > > FreeBSD also reports it's os.name as posix, but doesn't have a
> > > > /sys/devices path to query.
> > > >
> > >
> > > Do you know how do I get numa count on FreeBDS? I don't want to use the
> > numa library if we can to avoid unneccesary dependencies. Do we need to cover
> > some other cases other than FreeBDS, other Linux and Windows?
> > >
> > 
> > To get numa count on freebsd, you can query it using "sysctl vm.ndomains"
> > command. However, the bigger issue here is that you need something different
> > other than os.name to distinguish between linux and freebsd.
> > 
> 
> That should only be a matter of finding the right Python api - https://docs.python.org/3/library/sys.html?highlight=platform#sys.platform should be it.
>
Yep. Though thinking about it afterwards too, checking between bsd and
linux could also be as simple as using the /sys path if it exists, and
trying to use sysctl otherwise.

/Bruce 

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

* [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework
  2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
                     ` (5 preceding siblings ...)
  2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 6/6] build: update Arm builds with makefile flags Juraj Linkeš
@ 2020-10-21 11:37   ` Juraj Linkeš
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
                       ` (6 more replies)
  6 siblings, 7 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information.


Add a way to discover cpu count a numa node count and use that instead
of statically defined values. This augments the current native builds.
A bonus is that users may now use -Dmax_lcores and -Dmax_numa_nodes to
configure those from command line, which didn't work before for Arm
builds.

For cross builds, the cpu count and numa node count are specified in
cross files.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in cross files. Only libnuma
can be now disabled.

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

Juraj Linkeš (6):
  build: rename default Arm build to generic-armv8
  build: refactor Arm build
  build: automatic NUMA and cpu counts detection
  build: move core and NUMA counts to cross files
  build: disable Arm drivers
  build: update Arm builds with makefile flags

 buildtools/get_cpu_count.py          |   7 +
 buildtools/get_numa_count.py         |  22 ++
 buildtools/meson.build               |   2 +
 config/arm/arm64_armada_linux_gcc    |   6 +-
 config/arm/arm64_armv8_linux_gcc     |  18 +-
 config/arm/arm64_bluefield_linux_gcc |   7 +-
 config/arm/arm64_dpaa_linux_gcc      |   5 +-
 config/arm/arm64_emag_linux_gcc      |   4 +-
 config/arm/arm64_n1sdp_linux_gcc     |   7 +-
 config/arm/arm64_octeontx2_linux_gcc |   7 +-
 config/arm/arm64_stingray_linux_gcc  |   7 +-
 config/arm/arm64_thunderx2_linux_gcc |   6 +-
 config/arm/arm64_thunderx_linux_gcc  |   4 +-
 config/arm/meson.build               | 297 +++++++++++++++------------
 config/meson.build                   |  45 +++-
 drivers/meson.build                  |   6 +-
 meson.build                          |   1 +
 meson_options.txt                    |   8 +-
 18 files changed, 302 insertions(+), 157 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
@ 2020-10-21 11:37     ` Juraj Linkeš
  2020-10-21 11:52       ` Bruce Richardson
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 2/6] build: refactor Arm build Juraj Linkeš
                       ` (5 subsequent siblings)
  6 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic-armv8'. Leave machine='default' for backwards
compatibility.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index b49203fa8..c88e34a2b 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'default' or machine == 'generic-armv8')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -87,7 +88,7 @@ flags_octeontx2_extra = [
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
 
-machine_args_generic = [
+machine_args_default = [
 	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
@@ -113,20 +114,20 @@ machine_args_emag = [
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
+impl_generic = ['Generic armv8', flags_generic, machine_args_default]
+impl_0x41 = ['Arm', flags_arm, machine_args_default]
+impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
 impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
+impl_0x44 = ['DEC', flags_generic, machine_args_default]
+impl_0x49 = ['Infineon', flags_generic, machine_args_default]
+impl_0x4d = ['Motorola', flags_generic, machine_args_default]
+impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
 impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
+impl_0x53 = ['Samsung', flags_generic, machine_args_default]
+impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
+impl_0x69 = ['Intel', flags_generic, machine_args_default]
+impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -145,7 +146,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..a57c8ae9e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -80,9 +80,6 @@ if machine == 'default'
 		machine = 'corei7'
 	elif host_machine.cpu_family().startswith('arm')
 		machine = 'armv7-a'
-	elif host_machine.cpu_family().startswith('aarch')
-		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v3 2/6] build: refactor Arm build
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
@ 2020-10-21 11:37     ` Juraj Linkeš
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
                       ` (4 subsequent siblings)
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

* Rename variables to have names that better describe what the variables
store
* Remove unused or superfluous variables
* Change a list to dictionary where key lookup is needed
* Add informatory comments in the code
* Minor code restructure and reformatting

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 247 +++++++++++++++------------
 11 files changed, 153 insertions(+), 130 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index c88e34a2b..66b08bfb5 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,12 +3,12 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
+# set arm_force_native_march if you want to use machine args below
+# instead of discovered values; only works when doing an actual native build
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'default' or machine == 'generic-armv8')
+native_machine_args = ['-march=native', '-mtune=native']
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
@@ -16,8 +16,9 @@ flags_common_default = [
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -28,184 +29,206 @@ flags_common_default = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_ARCH_ARM64', true]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128]
+]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 flags_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_VFIO_GROUPS', 128]
+]
 flags_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]
+]
 flags_emag = [
 	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 flags_armada = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 
-flags_default_extra = []
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false]
+]
 flags_thunderx_extra = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_thunderx2_extra = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_USE_C11_MEM_MODEL', true]
+]
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
-
-machine_args_default = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
-
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['RTE_USE_C11_MEM_MODEL', true]
+]
+# arm config (implementer 0x41) is the default config
+pn_config_default = {
+	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
+	'0xd03': [['-mcpu=cortex-a53']],
+	'0xd04': [['-mcpu=cortex-a35']],
+	'0xd07': [['-mcpu=cortex-a57']],
+	'0xd08': [['-mcpu=cortex-a72']],
+	'0xd09': [['-mcpu=cortex-a73']],
+	'0xd0a': [['-mcpu=cortex-a75']],
+	'0xd0b': [['-mcpu=cortex-a76']],
+	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]
+}
+pn_config_cavium = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
+	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
+	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
+	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
+	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
+	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra],
+}
+pn_config_emag = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']]
+}
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_default]
-impl_0x41 = ['Arm', flags_arm, machine_args_default]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_default]
-impl_0x49 = ['Infineon', flags_generic, machine_args_default]
-impl_0x4d = ['Motorola', flags_generic, machine_args_default]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
-impl_0x53 = ['Samsung', flags_generic, machine_args_default]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
-impl_0x69 = ['Intel', flags_generic, machine_args_default]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
+impl_generic = ['Generic armv8', flags_generic, pn_config_default]
+impl_0x41 = ['Arm', flags_arm, pn_config_default]
+impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
+impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
+impl_0x44 = ['DEC', flags_generic, pn_config_default]
+impl_0x49 = ['Infineon', flags_generic, pn_config_default]
+impl_0x4d = ['Motorola', flags_generic, pn_config_default]
+impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
+impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
+impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
+impl_0x53 = ['Samsung', flags_generic, pn_config_default]
+impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
+impl_0x69 = ['Intel', flags_generic, pn_config_default]
+impl_dpaa = ['NXP DPAA', flags_dpaa, pn_config_default]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
+	# aarch64 build
+	if not meson.is_cross_build()
+		if machine == 'default' or machine == 'generic-armv8'
+			# default build
+			impl_config = impl_generic
+			part_number = 'generic'
+		else
+			# native 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
+			if arm_force_native_march == true
+				part_number = 'native'
+			else
+				part_number = cmd_output[3]
+			endif
+			# Set to generic implementer if implementer is not found
+			impl_config = get_variable('impl_' + cmd_output[0], 'impl_generic')
+		endif
+	else
+		# cross build
+		impl_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		impl_config = get_variable('impl_' + impl_id)
+	endif
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
-	cmd_output = cmd_generic # Set generic by default
-	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+	message('Arm implementer: ' + impl_config[0])
+	message('Arm part number: ' + part_number)
+
+	implementer_flags = impl_config[1]
+	part_number_config = impl_config[2]
+
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif part_number == 'native'
+		# use native machine args
+		part_number_config = [[native_machine_args]]
 	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
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
 	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)
+		# cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
 	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])
+	dpdk_flags = flags_common_default + implementer_flags
+
+	if part_number_config.length() > 1
+		dpdk_flags += part_number_config[1]
+	endif
+
+	machine_args = [] # Clear previous machine args
+	foreach flag: part_number_config[0]
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	foreach flag: dpdk_flags
 		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
 endif
-message(machine_args)
+
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 2/6] build: refactor Arm build Juraj Linkeš
@ 2020-10-21 11:37     ` Juraj Linkeš
  2020-10-21 12:02       ` Bruce Richardson
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 4/6] build: move core and NUMA counts to cross files Juraj Linkeš
                       ` (3 subsequent siblings)
  6 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The build machine's number of cpus and numa nodes vary, resulting in
mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for many
builds. Automatically discover the host's numa and cpu counts to remove
this mismatch for native builds. Use current defaults for default builds.
Force the users to specify the counts for cross build in cross files or
on the command line.
Give users the option to override the discovery or values from cross
files by specifying them on the command line with -Dmax_lcores and
-Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 42 ++++++++++++++++++++++++++++++++++--
 meson_options.txt            |  8 +++----
 5 files changed, 75 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..386f85f8b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..f0c49973a
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        print(subprocess.run(['sysctl', 'vm.ndomains'], capture_output=True).stdout)
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index a57c8ae9e..c4477f977 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -74,7 +74,11 @@ endif
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
+max_lcores = get_option('max_lcores')
+max_numa_nodes = get_option('max_numa_nodes')
 if machine == 'default'
+	max_numa_nodes = 4
+	max_lcores = 128
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -83,6 +87,22 @@ if machine == 'default'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
+elif not meson.is_cross_build()
+	# find host core count and numa node count for native builds
+	if max_lcores == 0
+		max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+		min_lcores = 2
+		if max_lcores < min_lcores
+			message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+			max_lcores = min_lcores
+		else
+			message('Found @0@ cores'.format(max_lcores))
+		endif
+	endif
+	if max_numa_nodes == 0
+		max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+		message('Found @0@ numa nodes'.format(max_numa_nodes))
+	endif
 endif
 
 dpdk_conf.set('RTE_MACHINE', machine)
@@ -227,8 +247,10 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
+if not meson.is_cross_build()
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -247,6 +269,22 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# check that cpu and numa count is set in cross builds
+if meson.is_cross_build()
+    	if max_lcores > 0
+		# specified on the cmdline
+		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+	elif not dpdk_conf.has('RTE_MAX_LCORE')
+		error('Number of cores for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
+	endif
+	if max_numa_nodes > 0
+		# specified on the cmdline
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+		error('Number of numa nodes for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
+	endif
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..01b0c45c3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Value 0 means the number of cpus on the host will be used. For cross build, set to non-zero to overwrite the cross-file value.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Value 0 means the number of numa nodes on the host will be used. For cross build, set to non-zero to overwrite the cross-file value.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v3 4/6] build: move core and NUMA counts to cross files
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
                       ` (2 preceding siblings ...)
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-21 11:37     ` Juraj Linkeš
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 5/6] build: disable Arm drivers Juraj Linkeš
                       ` (2 subsequent siblings)
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The values of RTE_MAX_NUMA_NODES and RTE_MAX_LCORE are going to vary for
different build machines, even for the same Implementer ID and Part
Number combinations. Move the fixed values to cross files and use
automatic discovery/values from cmdline options for native build. Use
predefined values for generic-armv8 build, since that build is not tied
to the build machine.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |  2 ++
 config/arm/arm64_armv8_linux_gcc     |  6 ++++
 config/arm/arm64_bluefield_linux_gcc |  2 ++
 config/arm/arm64_dpaa_linux_gcc      |  2 ++
 config/arm/arm64_emag_linux_gcc      |  2 ++
 config/arm/arm64_n1sdp_linux_gcc     |  2 ++
 config/arm/arm64_octeontx2_linux_gcc |  2 ++
 config/arm/arm64_stingray_linux_gcc  |  2 ++
 config/arm/arm64_thunderx2_linux_gcc |  2 ++
 config/arm/arm64_thunderx_linux_gcc  |  2 ++
 config/arm/meson.build               | 43 +++++++++++++++++-----------
 11 files changed, 51 insertions(+), 16 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..36100c594 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..779333199 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -26,3 +26,9 @@ implementer_id = 'generic'
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
 part_number = 'generic'
+
+# Supported extra configuration
+# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+# max_lcores = n      # will set RTE_MAX_LCORE
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..adae86f57 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..3cccca901 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+max_numa_nodes = 1
+max_lcores = 32
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..3a8b46812 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_numa_nodes = 1
+max_lcores = 4
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..2baf95a2a 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_numa_nodes = 1
+max_lcores = 36
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..07440fe5f 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_numa_nodes = 2
+max_lcores = 256
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 670764437..16ba78fd6 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+max_numa_nodes = 1
+max_lcores = 96
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 66b08bfb5..5605e807b 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -33,44 +33,40 @@ flags_common_default = [
 	['RTE_ARCH_ARM64', true]
 ]
 
+# add these to defaults when machine='generic-armv8'
+flags_force_generic = [
+	['RTE_MAX_NUMA_NODES', 4],
+	['RTE_MAX_LCORE', 256]
+]
+
 # implementer specific aarch64 flags, with middle priority
 # (will overwrite common flags)
 flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]
 ]
 flags_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
-	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]
 ]
 flags_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]
 ]
 flags_emag = [
 	['RTE_MACHINE', '"emag"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32],
 	['RTE_CACHE_LINE_SIZE', 64]
 ]
 flags_armada = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16],
 	['RTE_CACHE_LINE_SIZE', 64]
 ]
 
@@ -78,8 +74,6 @@ flags_armada = [
 # (will overwrite both common and implementer specific flags)
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]
 ]
@@ -90,15 +84,11 @@ flags_thunderx_extra = [
 flags_thunderx2_extra = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
-	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]
 ]
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]
@@ -160,6 +150,7 @@ else
 			# default build
 			impl_config = impl_generic
 			part_number = 'generic'
+			flags_common_default += flags_force_generic
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -214,6 +205,26 @@ else
 		dpdk_flags += part_number_config[1]
 	endif
 
+	# apply cross-specific options
+	if meson.is_cross_build()
+		# configure RTE_MAX_NUMA_NODES and RTE_MAX_LCORE from cross file
+		# RFC: do we want defaults for these two? or should we require
+		# that all cross file define them?
+		cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+		if cross_max_numa_nodes != 0
+			dpdk_flags += [
+				['RTE_MAX_NUMA_NODES', cross_max_numa_nodes]
+			]
+		endif
+		cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+		if cross_max_lcores != 0
+			message('Setting RTE_MAX_LCORE from cross file')
+			dpdk_flags += [
+				['RTE_MAX_LCORE', cross_max_lcores]
+			]
+		endif
+	endif
+
 	machine_args = [] # Clear previous machine args
 	foreach flag: part_number_config[0]
 		if cc.has_argument(flag)
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v3 5/6] build: disable Arm drivers
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
                       ` (3 preceding siblings ...)
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 4/6] build: move core and NUMA counts to cross files Juraj Linkeš
@ 2020-10-21 11:37     ` Juraj Linkeš
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 6/6] build: update Arm builds with makefile flags Juraj Linkeš
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/meson.build | 9 +++++----
 drivers/meson.build    | 2 +-
 meson.build            | 1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 5605e807b..87a208c97 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,6 +8,11 @@
 arm_force_native_march = false
 native_machine_args = ['-march=native', '-mtune=native']
 
+# RFC: do we want these drivers to be disabled by default on arm?
+# The previous way to disable these drivers never worked
+# RTE_NET_AVP and the rest would be overwritten to true if the necessary deps were found
+disabled_drivers += ['net/avp', 'net/fm10k', 'net/sfc']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -23,10 +28,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_SFC_EFX', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_CACHE_LINE_SIZE', 128],
diff --git a/drivers/meson.build b/drivers/meson.build
index a5a6fed06..a41ff909e 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,7 +18,7 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
 default_cflags = machine_args
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [RFC PATCH v3 6/6] build: update Arm builds with makefile flags
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
                       ` (4 preceding siblings ...)
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 5/6] build: disable Arm drivers Juraj Linkeš
@ 2020-10-21 11:37     ` Juraj Linkeš
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Not all flags were moved properly from the old Makefile build system.
Disable corresponding drivers and libnuma in cross files and remove
deprecated config.

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

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 36100c594..e33f1e742 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,5 @@ endian = 'little'
 implementer_id = '0x56'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 779333199..c6010e303 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -28,7 +28,11 @@ implementer_id = 'generic'
 part_number = 'generic'
 
 # Supported extra configuration
-# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-# max_lcores = n      # will set RTE_MAX_LCORE
+# max_numa_nodes = n   # will set RTE_MAX_NUMA_NODES
+# max_lcores = n        # will set RTE_MAX_LCORE
 max_lcores = 256
 max_numa_nodes = 4
+
+# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
+# disabled_drivers += ['bus/dpaa', 'crypto']
+    # add to the set of disabled libraries
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index adae86f57..78883a2ec 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = 'dpaa'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 3a8b46812..4493227f3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_numa_nodes = 1
 max_lcores = 4
+has_libnuma = 0
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 2baf95a2a..ff9e5c403 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_numa_nodes = 1
 max_lcores = 36
+has_libnuma = 0
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 87a208c97..0eae3c3b7 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -91,7 +91,6 @@ flags_thunderx2_extra = [
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]
 ]
 # arm config (implementer 0x41) is the default config
@@ -224,6 +223,10 @@ else
 				['RTE_MAX_LCORE', cross_max_lcores]
 			]
 		endif
+		cross_has_libnuma = meson.get_cross_property('has_libnuma', '')
+		if cross_has_libnuma != ''
+			has_libnuma = cross_has_libnuma
+		endif
 	endif
 
 	machine_args = [] # Clear previous machine args
diff --git a/drivers/meson.build b/drivers/meson.build
index a41ff909e..4bdc3d5c9 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -21,6 +21,10 @@ subdirs = [
 disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
-- 
2.20.1


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

* Re: [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
@ 2020-10-21 11:52       ` Bruce Richardson
  2020-10-21 12:17         ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-21 11:52 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 21, 2020 at 01:37:36PM +0200, Juraj Linkeš wrote:
> The current machine='default' build name is not descriptive. The actual
> default build is machine='native'. Add an alternative string which does
> the same build and better describes what we're building:
> machine='generic-armv8'. Leave machine='default' for backwards
> compatibility.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech> ---
> config/arm/meson.build | 31 ++++++++++++++++---------------
> config/meson.build     |  3 --- 2 files changed, 16 insertions(+), 18
> deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> b49203fa8..c88e34a2b 100644 --- a/config/arm/meson.build +++
> b/config/arm/meson.build @@ -1,12 +1,13 @@ # SPDX-License-Identifier:
> BSD-3-Clause # Copyright(c) 2017 Intel Corporation.  # Copyright(c) 2017
> Cavium, Inc +# Copyright(c) 2020 PANTHEON.tech s.r.o.
>  
>  # for checking defines we need to use the correct compiler flags
>  march_opt = '-march=@0@'.format(machine)
>  
>  arm_force_native_march = false -arm_force_default_march = (machine ==
>  'default') +arm_force_generic_march = (machine == 'default' or machine
>  == 'generic-armv8')
>  

Rather than having this just for arm, how about adding "generic" as a
synonym for "default" at the top level, since it probably better describes
what "default" does for all architectures.

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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-21 12:02       ` Bruce Richardson
  2020-10-21 13:01         ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-21 12:02 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> The build machine's number of cpus and numa nodes vary, resulting in
> mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for many
> builds. Automatically discover the host's numa and cpu counts to remove
> this mismatch for native builds. Use current defaults for default builds.
> Force the users to specify the counts for cross build in cross files or
> on the command line.
> Give users the option to override the discovery or values from cross
> files by specifying them on the command line with -Dmax_lcores and
> -Dmax_numa_nodes.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  buildtools/get_cpu_count.py  |  7 ++++++
>  buildtools/get_numa_count.py | 22 +++++++++++++++++++
>  buildtools/meson.build       |  2 ++
>  config/meson.build           | 42 ++++++++++++++++++++++++++++++++++--
>  meson_options.txt            |  8 +++----
>  5 files changed, 75 insertions(+), 6 deletions(-)
>  create mode 100644 buildtools/get_cpu_count.py
>  create mode 100644 buildtools/get_numa_count.py
> 
> diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> new file mode 100644
> index 000000000..386f85f8b
> --- /dev/null
> +++ b/buildtools/get_cpu_count.py
> @@ -0,0 +1,7 @@
> +#!/usr/bin/python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import os
> +
> +print(os.cpu_count())
> diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
> new file mode 100644
> index 000000000..f0c49973a
> --- /dev/null
> +++ b/buildtools/get_numa_count.py
> @@ -0,0 +1,22 @@
> +#!/usr/bin/python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import ctypes
> +import glob
> +import os
> +import subprocess
> +
> +if os.name == 'posix':
> +    if os.path.isdir('/sys/devices/system/node'):
> +        print(len(glob.glob('/sys/devices/system/node/node*')))
> +    else:
> +        print(subprocess.run(['sysctl', 'vm.ndomains'], capture_output=True).stdout)
> +
> +elif os.name == 'nt':
> +    libkernel32 = ctypes.windll.kernel32
> +
> +    count = ctypes.c_ulong()
> +
> +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> +    print(count.value + 1)
> diff --git a/buildtools/meson.build b/buildtools/meson.build
> index 04808dabc..925e733b1 100644
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> @@ -17,3 +17,5 @@ else
>  endif
>  map_to_win_cmd = py3 + files('map_to_win.py')
>  sphinx_wrapper = py3 + files('call-sphinx-build.py')
> +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> +get_numa_count_cmd = py3 + files('get_numa_count.py')
> diff --git a/config/meson.build b/config/meson.build
> index a57c8ae9e..c4477f977 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -74,7 +74,11 @@ endif
>  # still being able to support the CPU features required for DPDK.
>  # This can be bumped up by the DPDK project, but it can never be an
>  # invariant like 'native'
> +max_lcores = get_option('max_lcores')
> +max_numa_nodes = get_option('max_numa_nodes')
>  if machine == 'default'
> +	max_numa_nodes = 4
> +	max_lcores = 128

This doesn't seem right, since you are overriding the user-specified values
with hard-coded ones.

>  	if host_machine.cpu_family().startswith('x86')
>  		# matches the old pre-meson build systems default
>  		machine = 'corei7'
> @@ -83,6 +87,22 @@ if machine == 'default'
>  	elif host_machine.cpu_family().startswith('ppc')
>  		machine = 'power8'
>  	endif
> +elif not meson.is_cross_build()
> +	# find host core count and numa node count for native builds
> +	if max_lcores == 0
> +		max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
> +		min_lcores = 2
> +		if max_lcores < min_lcores
> +			message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
> +			max_lcores = min_lcores
> +		else
> +			message('Found @0@ cores'.format(max_lcores))
> +		endif
> +	endif
> +	if max_numa_nodes == 0
> +		max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
> +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> +	endif
>  endif
>  
>  dpdk_conf.set('RTE_MACHINE', machine)
> @@ -227,8 +247,10 @@ foreach arg: warning_flags
>  endforeach
>  
>  # set other values pulled from the build options
> -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> +if not meson.is_cross_build()
> +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> +endif

Rather than conditionally setting the value here, you should move the
checks below up above this to simplify things.

>  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
>  dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
>  dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
> @@ -247,6 +269,22 @@ compile_time_cpuflags = []
>  subdir(arch_subdir)
>  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
>  
> +# check that cpu and numa count is set in cross builds
> +if meson.is_cross_build()
> +    	if max_lcores > 0
> +		# specified on the cmdline
> +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> +		error('Number of cores for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> +	endif
> +	if max_numa_nodes > 0
> +		# specified on the cmdline
> +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> +		error('Number of numa nodes for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> +	endif
> +endif
> +
>  # set the install path for the drivers
>  dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
>  
> diff --git a/meson_options.txt b/meson_options.txt
> index 9bf18ab6b..01b0c45c3 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
>  	description: 'set the target machine type')
>  option('max_ethports', type: 'integer', value: 32,
>  	description: 'maximum number of Ethernet devices')
> -option('max_lcores', type: 'integer', value: 128,
> -	description: 'maximum number of cores/threads supported by EAL')
> -option('max_numa_nodes', type: 'integer', value: 4,
> -	description: 'maximum number of NUMA nodes supported by EAL')
> +option('max_lcores', type: 'integer', value: 0,
> +	description: 'maximum number of cores/threads supported by EAL. Value 0 means the number of cpus on the host will be used. For cross build, set to non-zero to overwrite the cross-file value.')
> +option('max_numa_nodes', type: 'integer', value: 0,
> +	description: 'maximum number of NUMA nodes supported by EAL. Value 0 means the number of numa nodes on the host will be used. For cross build, set to non-zero to overwrite the cross-file value.')

I don't like this change, because it very much assumes for
non-cross-compiles that people will be running DPDK on the system they
build it on. That's a very, very big assumption! I'm ok with having zero as
a "detect" option, and having the values overridden from cross-files, but
not with detection as the default out-of-the-box option! Lots of users may
pull builds from a CI based on VMs with just a few cores, for instance.

>  option('enable_trace_fp', type: 'boolean', value: false,
>  	description: 'enable fast path trace points.')
>  option('tests', type: 'boolean', value: true,
> -- 
> 2.20.1
> 

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

* Re: [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8
  2020-10-21 11:52       ` Bruce Richardson
@ 2020-10-21 12:17         ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 12:17 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, October 21, 2020 1:53 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [RFC PATCH v3 1/6] build: rename default Arm build to generic-
> armv8
> 
> On Wed, Oct 21, 2020 at 01:37:36PM +0200, Juraj Linkeš wrote:
> > The current machine='default' build name is not descriptive. The
> > actual default build is machine='native'. Add an alternative string
> > which does the same build and better describes what we're building:
> > machine='generic-armv8'. Leave machine='default' for backwards
> > compatibility.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech> ---
> > config/arm/meson.build | 31 ++++++++++++++++---------------
> > config/meson.build     |  3 --- 2 files changed, 16 insertions(+), 18
> > deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > b49203fa8..c88e34a2b 100644 --- a/config/arm/meson.build +++
> > b/config/arm/meson.build @@ -1,12 +1,13 @@ # SPDX-License-Identifier:
> > BSD-3-Clause # Copyright(c) 2017 Intel Corporation.  # Copyright(c)
> > 2017 Cavium, Inc +# Copyright(c) 2020 PANTHEON.tech s.r.o.
> >
> >  # for checking defines we need to use the correct compiler flags
> > march_opt = '-march=@0@'.format(machine)
> >
> >  arm_force_native_march = false -arm_force_default_march = (machine ==
> >  'default') +arm_force_generic_march = (machine == 'default' or
> > machine  == 'generic-armv8')
> >
> 
> Rather than having this just for arm, how about adding "generic" as a synonym
> for "default" at the top level, since it probably better describes what "default"
> does for all architectures.

Okay, makes sense. I'll do that in the next version.

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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-21 12:02       ` Bruce Richardson
@ 2020-10-21 13:01         ` Juraj Linkeš
  2020-10-21 14:13           ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-21 13:01 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, October 21, 2020 2:02 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts
> detection
> 
> On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> > The build machine's number of cpus and numa nodes vary, resulting in
> > mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for
> many
> > builds. Automatically discover the host's numa and cpu counts to
> > remove this mismatch for native builds. Use current defaults for default builds.
> > Force the users to specify the counts for cross build in cross files
> > or on the command line.
> > Give users the option to override the discovery or values from cross
> > files by specifying them on the command line with -Dmax_lcores and
> > -Dmax_numa_nodes.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  buildtools/get_cpu_count.py  |  7 ++++++
> > buildtools/get_numa_count.py | 22 +++++++++++++++++++
> >  buildtools/meson.build       |  2 ++
> >  config/meson.build           | 42 ++++++++++++++++++++++++++++++++++--
> >  meson_options.txt            |  8 +++----
> >  5 files changed, 75 insertions(+), 6 deletions(-)  create mode 100644
> > buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py
> >
> > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > new file mode 100644 index 000000000..386f85f8b
> > --- /dev/null
> > +++ b/buildtools/get_cpu_count.py
> > @@ -0,0 +1,7 @@
> > +#!/usr/bin/python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import os
> > +
> > +print(os.cpu_count())
> > diff --git a/buildtools/get_numa_count.py
> > b/buildtools/get_numa_count.py new file mode 100644 index
> > 000000000..f0c49973a
> > --- /dev/null
> > +++ b/buildtools/get_numa_count.py
> > @@ -0,0 +1,22 @@
> > +#!/usr/bin/python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import ctypes
> > +import glob
> > +import os
> > +import subprocess
> > +
> > +if os.name == 'posix':
> > +    if os.path.isdir('/sys/devices/system/node'):
> > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > +    else:
> > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > +capture_output=True).stdout)
> > +
> > +elif os.name == 'nt':
> > +    libkernel32 = ctypes.windll.kernel32
> > +
> > +    count = ctypes.c_ulong()
> > +
> > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > +    print(count.value + 1)
> > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > 04808dabc..925e733b1 100644
> > --- a/buildtools/meson.build
> > +++ b/buildtools/meson.build
> > @@ -17,3 +17,5 @@ else
> >  endif
> >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> > files('call-sphinx-build.py')
> > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > diff --git a/config/meson.build b/config/meson.build index
> > a57c8ae9e..c4477f977 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -74,7 +74,11 @@ endif
> >  # still being able to support the CPU features required for DPDK.
> >  # This can be bumped up by the DPDK project, but it can never be an
> > # invariant like 'native'
> > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > +get_option('max_numa_nodes')
> >  if machine == 'default'
> > +	max_numa_nodes = 4
> > +	max_lcores = 128
> 
> This doesn't seem right, since you are overriding the user-specified values with
> hard-coded ones.
> 

I understand we're using the default build/generic to build portalbe dpdk distro packages, meaning the settings for those packages should always be the same, no? If not, what should the default/generic build be? And when would someone do a default/generic build with their values? It wouldn't be a default/generic anymore, right?

> >  	if host_machine.cpu_family().startswith('x86')
> >  		# matches the old pre-meson build systems default
> >  		machine = 'corei7'
> > @@ -83,6 +87,22 @@ if machine == 'default'
> >  	elif host_machine.cpu_family().startswith('ppc')
> >  		machine = 'power8'
> >  	endif
> > +elif not meson.is_cross_build()
> > +	# find host core count and numa node count for native builds
> > +	if max_lcores == 0
> > +		max_lcores =
> run_command(get_cpu_count_cmd).stdout().to_int()
> > +		min_lcores = 2
> > +		if max_lcores < min_lcores
> > +			message('Found less than @0@ cores, building for
> @0@ cores'.format(min_lcores))
> > +			max_lcores = min_lcores
> > +		else
> > +			message('Found @0@ cores'.format(max_lcores))
> > +		endif
> > +	endif
> > +	if max_numa_nodes == 0
> > +		max_numa_nodes =
> run_command(get_numa_count_cmd).stdout().to_int()
> > +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> > +	endif
> >  endif
> >
> >  dpdk_conf.set('RTE_MACHINE', machine) @@ -227,8 +247,10 @@ foreach
> > arg: warning_flags  endforeach
> >
> >  # set other values pulled from the build options
> > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > +if not meson.is_cross_build()
> > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) endif
> 
> Rather than conditionally setting the value here, you should move the checks
> below up above this to simplify things.
> 

Do you mean the cross build checks? Those have to be after subdir(arch_subdir) so that we can override the values from cross files (as the commit message says). 

> >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@
> > -247,6 +269,22 @@ compile_time_cpuflags = []
> >  subdir(arch_subdir)
> >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > ','.join(compile_time_cpuflags))
> >
> > +# check that cpu and numa count is set in cross builds if
> > +meson.is_cross_build()
> > +    	if max_lcores > 0
> > +		# specified on the cmdline
> > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> > +		error('Number of cores for cross build not specified in @0@
> subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > +	endif
> > +	if max_numa_nodes > 0
> > +		# specified on the cmdline
> > +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> > +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > +		error('Number of numa nodes for cross build not specified in
> @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > +	endif
> > +endif
> > +
> >  # set the install path for the drivers
> > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> >
> > diff --git a/meson_options.txt b/meson_options.txt index
> > 9bf18ab6b..01b0c45c3 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> >  	description: 'set the target machine type')  option('max_ethports',
> > type: 'integer', value: 32,
> >  	description: 'maximum number of Ethernet devices')
> > -option('max_lcores', type: 'integer', value: 128,
> > -	description: 'maximum number of cores/threads supported by EAL')
> > -option('max_numa_nodes', type: 'integer', value: 4,
> > -	description: 'maximum number of NUMA nodes supported by EAL')
> > +option('max_lcores', type: 'integer', value: 0,
> > +	description: 'maximum number of cores/threads supported by EAL.
> > +Value 0 means the number of cpus on the host will be used. For cross build,
> set to non-zero to overwrite the cross-file value.') option('max_numa_nodes',
> type: 'integer', value: 0,
> > +	description: 'maximum number of NUMA nodes supported by EAL. Value
> 0
> > +means the number of numa nodes on the host will be used. For cross
> > +build, set to non-zero to overwrite the cross-file value.')
> 
> I don't like this change, because it very much assumes for non-cross-compiles
> that people will be running DPDK on the system they build it on. That's a very,
> very big assumption!

I'll be using definitions from https://mesonbuild.com/Cross-compilation.html.
I understand cross compilation to be building for a diffent host machine than the build machine (which is aligned with pretty much every definition I found). I understand this to be true not only for builds between architectures, but also within an architecture (e.g. x86_64 build machine building for x86_64 host machine).
So yes, when someone does a native build, it stands to reason they want to use it on the build machine. If they wanted to use it elsewhere, they would cross compile.
Another thing is the current build philosophy is to detect as much as possible (not having statically defined configuration, as you mentioned in the past). Detecting the number of cores and numa nodes fits this perfectly.
And yet another thing is that the assumption seems to be already present in the build system - it already detects a lot things, some of which may not be satisfied on machines other than the build machine. I may be wrong about this.

> I'm ok with having zero as a "detect" option, and having
> the values overridden from cross-files, but not with detection as the default out-
> of-the-box option! Lots of users may pull builds from a CI based on VMs with
> just a few cores, for instance.

If not having the automatic detection is a concern because of users using CI builds, then we (if it's from our CI) can change what we're building in CI - the default/generic build seems like a good fit because it's supposed to work on a variety of systems. Expecting that native build from random VMs would work anywhere doesn't seen very realistic - it's been build for that VM environment (because it's a native build).

Here's my understanding on which the current version is based:
1. Since we want to get away from having statically defined configuration, numa and core count discovery is exactly what we should have in the build system. Since discorery is currently the default for lib/drivers, it stands to reason it should be default for everything else, if possible.
2. Native build should produce binaries matching the build machine as well as possible.
3. Default/generic build should produce binaries executable on a range of systems (ideally all systems of a given architecture).
4. Other builds, that is non-native builds, are cross-compilation, since we're building for host machine other that the build machine.

What I haven't taken into account is users using CI builds. That could be remedied by modifying the CI a bit while being consistent with what native/default/generic/cross builds are (or should be). And in any case, if we're not interested in testing the exact CI environment (which we aren't, since we don't want to use 2 cores with 1 numa), we really shouldn't be doing native builds there.

I'm interested in hearing where my thinking deviates from yours.

> 
> >  option('enable_trace_fp', type: 'boolean', value: false,
> >  	description: 'enable fast path trace points.')  option('tests',
> > type: 'boolean', value: true,
> > --
> > 2.20.1
> >


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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-21 13:01         ` Juraj Linkeš
@ 2020-10-21 14:13           ` Bruce Richardson
  2020-10-21 14:27             ` Bruce Richardson
  2020-10-29  4:31             ` Honnappa Nagarahalli
  0 siblings, 2 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-10-21 14:13 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 21, 2020 at 01:01:41PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Wednesday, October 21, 2020 2:02 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > Subject: Re: [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts
> > detection
> > 
> > On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> > > The build machine's number of cpus and numa nodes vary, resulting in
> > > mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for
> > many
> > > builds. Automatically discover the host's numa and cpu counts to
> > > remove this mismatch for native builds. Use current defaults for default builds.
> > > Force the users to specify the counts for cross build in cross files
> > > or on the command line.
> > > Give users the option to override the discovery or values from cross
> > > files by specifying them on the command line with -Dmax_lcores and
> > > -Dmax_numa_nodes.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  buildtools/get_cpu_count.py  |  7 ++++++
> > > buildtools/get_numa_count.py | 22 +++++++++++++++++++
> > >  buildtools/meson.build       |  2 ++
> > >  config/meson.build           | 42 ++++++++++++++++++++++++++++++++++--
> > >  meson_options.txt            |  8 +++----
> > >  5 files changed, 75 insertions(+), 6 deletions(-)  create mode 100644
> > > buildtools/get_cpu_count.py  create mode 100644
> > > buildtools/get_numa_count.py
> > >
> > > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > > new file mode 100644 index 000000000..386f85f8b
> > > --- /dev/null
> > > +++ b/buildtools/get_cpu_count.py
> > > @@ -0,0 +1,7 @@
> > > +#!/usr/bin/python3
> > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > +PANTHEON.tech s.r.o.
> > > +
> > > +import os
> > > +
> > > +print(os.cpu_count())
> > > diff --git a/buildtools/get_numa_count.py
> > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > 000000000..f0c49973a
> > > --- /dev/null
> > > +++ b/buildtools/get_numa_count.py
> > > @@ -0,0 +1,22 @@
> > > +#!/usr/bin/python3
> > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > +PANTHEON.tech s.r.o.
> > > +
> > > +import ctypes
> > > +import glob
> > > +import os
> > > +import subprocess
> > > +
> > > +if os.name == 'posix':
> > > +    if os.path.isdir('/sys/devices/system/node'):
> > > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > > +    else:
> > > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > > +capture_output=True).stdout)
> > > +
> > > +elif os.name == 'nt':
> > > +    libkernel32 = ctypes.windll.kernel32
> > > +
> > > +    count = ctypes.c_ulong()
> > > +
> > > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > > +    print(count.value + 1)
> > > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > > 04808dabc..925e733b1 100644
> > > --- a/buildtools/meson.build
> > > +++ b/buildtools/meson.build
> > > @@ -17,3 +17,5 @@ else
> > >  endif
> > >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> > > files('call-sphinx-build.py')
> > > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > > diff --git a/config/meson.build b/config/meson.build index
> > > a57c8ae9e..c4477f977 100644
> > > --- a/config/meson.build
> > > +++ b/config/meson.build
> > > @@ -74,7 +74,11 @@ endif
> > >  # still being able to support the CPU features required for DPDK.
> > >  # This can be bumped up by the DPDK project, but it can never be an
> > > # invariant like 'native'
> > > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > > +get_option('max_numa_nodes')
> > >  if machine == 'default'
> > > +	max_numa_nodes = 4
> > > +	max_lcores = 128
> > 
> > This doesn't seem right, since you are overriding the user-specified values with
> > hard-coded ones.
> > 
> 
> I understand we're using the default build/generic to build portalbe dpdk distro packages, meaning the settings for those packages should always be the same, no? If not, what should the default/generic build be? And when would someone do a default/generic build with their values? It wouldn't be a default/generic anymore, right?
> 
> > >  	if host_machine.cpu_family().startswith('x86')
> > >  		# matches the old pre-meson build systems default
> > >  		machine = 'corei7'
> > > @@ -83,6 +87,22 @@ if machine == 'default'
> > >  	elif host_machine.cpu_family().startswith('ppc')
> > >  		machine = 'power8'
> > >  	endif
> > > +elif not meson.is_cross_build()
> > > +	# find host core count and numa node count for native builds
> > > +	if max_lcores == 0
> > > +		max_lcores =
> > run_command(get_cpu_count_cmd).stdout().to_int()
> > > +		min_lcores = 2
> > > +		if max_lcores < min_lcores
> > > +			message('Found less than @0@ cores, building for
> > @0@ cores'.format(min_lcores))
> > > +			max_lcores = min_lcores
> > > +		else
> > > +			message('Found @0@ cores'.format(max_lcores))
> > > +		endif
> > > +	endif
> > > +	if max_numa_nodes == 0
> > > +		max_numa_nodes =
> > run_command(get_numa_count_cmd).stdout().to_int()
> > > +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> > > +	endif
> > >  endif
> > >
> > >  dpdk_conf.set('RTE_MACHINE', machine) @@ -227,8 +247,10 @@ foreach
> > > arg: warning_flags  endforeach
> > >
> > >  # set other values pulled from the build options
> > > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > > -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > > +if not meson.is_cross_build()
> > > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) endif
> > 
> > Rather than conditionally setting the value here, you should move the checks
> > below up above this to simplify things.
> > 
> 
> Do you mean the cross build checks? Those have to be after subdir(arch_subdir) so that we can override the values from cross files (as the commit message says). 
> 
> > >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > > dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@
> > > -247,6 +269,22 @@ compile_time_cpuflags = []
> > >  subdir(arch_subdir)
> > >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > > ','.join(compile_time_cpuflags))
> > >
> > > +# check that cpu and numa count is set in cross builds if
> > > +meson.is_cross_build()
> > > +    	if max_lcores > 0
> > > +		# specified on the cmdline
> > > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> > > +		error('Number of cores for cross build not specified in @0@
> > subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > > +	endif
> > > +	if max_numa_nodes > 0
> > > +		# specified on the cmdline
> > > +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> > > +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > > +		error('Number of numa nodes for cross build not specified in
> > @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > > +	endif
> > > +endif
> > > +
> > >  # set the install path for the drivers
> > > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> > >
> > > diff --git a/meson_options.txt b/meson_options.txt index
> > > 9bf18ab6b..01b0c45c3 100644
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> > >  	description: 'set the target machine type')  option('max_ethports',
> > > type: 'integer', value: 32,
> > >  	description: 'maximum number of Ethernet devices')
> > > -option('max_lcores', type: 'integer', value: 128,
> > > -	description: 'maximum number of cores/threads supported by EAL')
> > > -option('max_numa_nodes', type: 'integer', value: 4,
> > > -	description: 'maximum number of NUMA nodes supported by EAL')
> > > +option('max_lcores', type: 'integer', value: 0,
> > > +	description: 'maximum number of cores/threads supported by EAL.
> > > +Value 0 means the number of cpus on the host will be used. For cross build,
> > set to non-zero to overwrite the cross-file value.') option('max_numa_nodes',
> > type: 'integer', value: 0,
> > > +	description: 'maximum number of NUMA nodes supported by EAL. Value
> > 0
> > > +means the number of numa nodes on the host will be used. For cross
> > > +build, set to non-zero to overwrite the cross-file value.')
> > 
> > I don't like this change, because it very much assumes for non-cross-compiles
> > that people will be running DPDK on the system they build it on. That's a very,
> > very big assumption!
> 
> I'll be using definitions from https://mesonbuild.com/Cross-compilation.html.
> I understand cross compilation to be building for a diffent host machine than the build machine (which is aligned with pretty much every definition I found). I understand this to be true not only for builds between architectures, but also within an architecture (e.g. x86_64 build machine building for x86_64 host machine).
> So yes, when someone does a native build, it stands to reason they want to use it on the build machine. If they wanted to use it elsewhere, they would cross compile.
> Another thing is the current build philosophy is to detect as much as possible (not having statically defined configuration, as you mentioned in the past). Detecting the number of cores and numa nodes fits this perfectly.
> And yet another thing is that the assumption seems to be already present in the build system - it already detects a lot things, some of which may not be satisfied on machines other than the build machine. I may be wrong about this.
> 
> > I'm ok with having zero as a "detect" option, and having
> > the values overridden from cross-files, but not with detection as the default out-
> > of-the-box option! Lots of users may pull builds from a CI based on VMs with
> > just a few cores, for instance.
> 
> If not having the automatic detection is a concern because of users using CI builds, then we (if it's from our CI) can change what we're building in CI - the default/generic build seems like a good fit because it's supposed to work on a variety of systems. Expecting that native build from random VMs would work anywhere doesn't seen very realistic - it's been build for that VM environment (because it's a native build).
> 
> Here's my understanding on which the current version is based:
> 1. Since we want to get away from having statically defined configuration, numa and core count discovery is exactly what we should have in the build system. Since discorery is currently the default for lib/drivers, it stands to reason it should be default for everything else, if possible.
> 2. Native build should produce binaries matching the build machine as well as possible.
> 3. Default/generic build should produce binaries executable on a range of systems (ideally all systems of a given architecture).
> 4. Other builds, that is non-native builds, are cross-compilation, since we're building for host machine other that the build machine.
> 
> What I haven't taken into account is users using CI builds. That could be remedied by modifying the CI a bit while being consistent with what native/default/generic/cross builds are (or should be). And in any case, if we're not interested in testing the exact CI environment (which we aren't, since we don't want to use 2 cores with 1 numa), we really shouldn't be doing native builds there.
> 
> I'm interested in hearing where my thinking deviates from yours.
> 

There are a number of points in which we differ, I think.

Firstly, the use of "native" and "default/generic" for the "machine"
parameter refers only to the instruction-set level from the compiler, and
should not affect any other settings, since all settings are independent.
Therefore, setting "machine" to "native" does not mean that we should
detect cores and numa nodes, and similarly setting it to "default" does not
mean that we should ignore the settings for these values and pick our own
chosen default values.

Secondly, the use of cross-compilation only applies when you are compiling
for a different architecture or environment (e.g. OS) to what you are
building on. Building on a 4-core x86 machine to run on a dual-socket,
32-core x86 machine is not cross-compiling, but still needs to work by
default. Something like building a 32-bit binary on a 64-bit OS is in most
cases not done by cross-compilation either, but is rather outside the scope
of the discussion, except as a reference point to show the scope of
differences which can be accomodated as "native builds".

In terms of dynamic configuration for things like cores and numa nodes, the
ideal end state here is not to have them detected at build time on the host
system, but instead to have them detected at runtime and sized dynamically.
In the absense of that, these values should be set to reasonable defaults
so that when a user compiles up a binary without settings these explicitly
it should run on 95%+ of systems of that type.

This is my understanding of the issues, anyway. :-)

Regards,
/Bruce

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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-21 14:13           ` Bruce Richardson
@ 2020-10-21 14:27             ` Bruce Richardson
  2020-10-23 10:07               ` Juraj Linkeš
  2020-10-29  4:31             ` Honnappa Nagarahalli
  1 sibling, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-21 14:27 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 21, 2020 at 03:13:19PM +0100, Bruce Richardson wrote:
> On Wed, Oct 21, 2020 at 01:01:41PM +0000, Juraj Linkeš wrote:
> > 
> > 
> > > -----Original Message-----
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > Sent: Wednesday, October 21, 2020 2:02 PM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > > Subject: Re: [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts
> > > detection
> > > 
> > > On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> > > > The build machine's number of cpus and numa nodes vary, resulting in
> > > > mismatched counts of RTE_MAX_LCORE and RTE_MAX_NUMA_NODES for
> > > many
> > > > builds. Automatically discover the host's numa and cpu counts to
> > > > remove this mismatch for native builds. Use current defaults for default builds.
> > > > Force the users to specify the counts for cross build in cross files
> > > > or on the command line.
> > > > Give users the option to override the discovery or values from cross
> > > > files by specifying them on the command line with -Dmax_lcores and
> > > > -Dmax_numa_nodes.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > ---
> > > >  buildtools/get_cpu_count.py  |  7 ++++++
> > > > buildtools/get_numa_count.py | 22 +++++++++++++++++++
> > > >  buildtools/meson.build       |  2 ++
> > > >  config/meson.build           | 42 ++++++++++++++++++++++++++++++++++--
> > > >  meson_options.txt            |  8 +++----
> > > >  5 files changed, 75 insertions(+), 6 deletions(-)  create mode 100644
> > > > buildtools/get_cpu_count.py  create mode 100644
> > > > buildtools/get_numa_count.py
> > > >
> > > > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > > > new file mode 100644 index 000000000..386f85f8b
> > > > --- /dev/null
> > > > +++ b/buildtools/get_cpu_count.py
> > > > @@ -0,0 +1,7 @@
> > > > +#!/usr/bin/python3
> > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > +PANTHEON.tech s.r.o.
> > > > +
> > > > +import os
> > > > +
> > > > +print(os.cpu_count())
> > > > diff --git a/buildtools/get_numa_count.py
> > > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > > 000000000..f0c49973a
> > > > --- /dev/null
> > > > +++ b/buildtools/get_numa_count.py
> > > > @@ -0,0 +1,22 @@
> > > > +#!/usr/bin/python3
> > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > +PANTHEON.tech s.r.o.
> > > > +
> > > > +import ctypes
> > > > +import glob
> > > > +import os
> > > > +import subprocess
> > > > +
> > > > +if os.name == 'posix':
> > > > +    if os.path.isdir('/sys/devices/system/node'):
> > > > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > > > +    else:
> > > > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > > > +capture_output=True).stdout)
> > > > +
> > > > +elif os.name == 'nt':
> > > > +    libkernel32 = ctypes.windll.kernel32
> > > > +
> > > > +    count = ctypes.c_ulong()
> > > > +
> > > > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > > > +    print(count.value + 1)
> > > > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > > > 04808dabc..925e733b1 100644
> > > > --- a/buildtools/meson.build
> > > > +++ b/buildtools/meson.build
> > > > @@ -17,3 +17,5 @@ else
> > > >  endif
> > > >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> > > > files('call-sphinx-build.py')
> > > > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > > > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > > > diff --git a/config/meson.build b/config/meson.build index
> > > > a57c8ae9e..c4477f977 100644
> > > > --- a/config/meson.build
> > > > +++ b/config/meson.build
> > > > @@ -74,7 +74,11 @@ endif
> > > >  # still being able to support the CPU features required for DPDK.
> > > >  # This can be bumped up by the DPDK project, but it can never be an
> > > > # invariant like 'native'
> > > > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > > > +get_option('max_numa_nodes')
> > > >  if machine == 'default'
> > > > +	max_numa_nodes = 4
> > > > +	max_lcores = 128
> > > 
> > > This doesn't seem right, since you are overriding the user-specified values with
> > > hard-coded ones.
> > > 
> > 
> > I understand we're using the default build/generic to build portalbe dpdk distro packages, meaning the settings for those packages should always be the same, no? If not, what should the default/generic build be? And when would someone do a default/generic build with their values? It wouldn't be a default/generic anymore, right?
> > 
> > > >  	if host_machine.cpu_family().startswith('x86')
> > > >  		# matches the old pre-meson build systems default
> > > >  		machine = 'corei7'
> > > > @@ -83,6 +87,22 @@ if machine == 'default'
> > > >  	elif host_machine.cpu_family().startswith('ppc')
> > > >  		machine = 'power8'
> > > >  	endif
> > > > +elif not meson.is_cross_build()
> > > > +	# find host core count and numa node count for native builds
> > > > +	if max_lcores == 0
> > > > +		max_lcores =
> > > run_command(get_cpu_count_cmd).stdout().to_int()
> > > > +		min_lcores = 2
> > > > +		if max_lcores < min_lcores
> > > > +			message('Found less than @0@ cores, building for
> > > @0@ cores'.format(min_lcores))
> > > > +			max_lcores = min_lcores
> > > > +		else
> > > > +			message('Found @0@ cores'.format(max_lcores))
> > > > +		endif
> > > > +	endif
> > > > +	if max_numa_nodes == 0
> > > > +		max_numa_nodes =
> > > run_command(get_numa_count_cmd).stdout().to_int()
> > > > +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> > > > +	endif
> > > >  endif
> > > >
> > > >  dpdk_conf.set('RTE_MACHINE', machine) @@ -227,8 +247,10 @@ foreach
> > > > arg: warning_flags  endforeach
> > > >
> > > >  # set other values pulled from the build options
> > > > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > > > -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > > > +if not meson.is_cross_build()
> > > > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) endif
> > > 
> > > Rather than conditionally setting the value here, you should move the checks
> > > below up above this to simplify things.
> > > 
> > 
> > Do you mean the cross build checks? Those have to be after subdir(arch_subdir) so that we can override the values from cross files (as the commit message says). 
> > 
> > > >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > > > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > > > dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@
> > > > -247,6 +269,22 @@ compile_time_cpuflags = []
> > > >  subdir(arch_subdir)
> > > >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > > > ','.join(compile_time_cpuflags))
> > > >
> > > > +# check that cpu and numa count is set in cross builds if
> > > > +meson.is_cross_build()
> > > > +    	if max_lcores > 0
> > > > +		# specified on the cmdline
> > > > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> > > > +		error('Number of cores for cross build not specified in @0@
> > > subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > > > +	endif
> > > > +	if max_numa_nodes > 0
> > > > +		# specified on the cmdline
> > > > +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> > > > +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > > > +		error('Number of numa nodes for cross build not specified in
> > > @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > > > +	endif
> > > > +endif
> > > > +
> > > >  # set the install path for the drivers
> > > > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> > > >
> > > > diff --git a/meson_options.txt b/meson_options.txt index
> > > > 9bf18ab6b..01b0c45c3 100644
> > > > --- a/meson_options.txt
> > > > +++ b/meson_options.txt
> > > > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> > > >  	description: 'set the target machine type')  option('max_ethports',
> > > > type: 'integer', value: 32,
> > > >  	description: 'maximum number of Ethernet devices')
> > > > -option('max_lcores', type: 'integer', value: 128,
> > > > -	description: 'maximum number of cores/threads supported by EAL')
> > > > -option('max_numa_nodes', type: 'integer', value: 4,
> > > > -	description: 'maximum number of NUMA nodes supported by EAL')
> > > > +option('max_lcores', type: 'integer', value: 0,
> > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > +Value 0 means the number of cpus on the host will be used. For cross build,
> > > set to non-zero to overwrite the cross-file value.') option('max_numa_nodes',
> > > type: 'integer', value: 0,
> > > > +	description: 'maximum number of NUMA nodes supported by EAL. Value
> > > 0
> > > > +means the number of numa nodes on the host will be used. For cross
> > > > +build, set to non-zero to overwrite the cross-file value.')
> > > 
> > > I don't like this change, because it very much assumes for non-cross-compiles
> > > that people will be running DPDK on the system they build it on. That's a very,
> > > very big assumption!
> > 
> > I'll be using definitions from https://mesonbuild.com/Cross-compilation.html.
> > I understand cross compilation to be building for a diffent host machine than the build machine (which is aligned with pretty much every definition I found). I understand this to be true not only for builds between architectures, but also within an architecture (e.g. x86_64 build machine building for x86_64 host machine).
> > So yes, when someone does a native build, it stands to reason they want to use it on the build machine. If they wanted to use it elsewhere, they would cross compile.
> > Another thing is the current build philosophy is to detect as much as possible (not having statically defined configuration, as you mentioned in the past). Detecting the number of cores and numa nodes fits this perfectly.
> > And yet another thing is that the assumption seems to be already present in the build system - it already detects a lot things, some of which may not be satisfied on machines other than the build machine. I may be wrong about this.
> > 
> > > I'm ok with having zero as a "detect" option, and having
> > > the values overridden from cross-files, but not with detection as the default out-
> > > of-the-box option! Lots of users may pull builds from a CI based on VMs with
> > > just a few cores, for instance.
> > 
> > If not having the automatic detection is a concern because of users using CI builds, then we (if it's from our CI) can change what we're building in CI - the default/generic build seems like a good fit because it's supposed to work on a variety of systems. Expecting that native build from random VMs would work anywhere doesn't seen very realistic - it's been build for that VM environment (because it's a native build).
> > 
> > Here's my understanding on which the current version is based:
> > 1. Since we want to get away from having statically defined configuration, numa and core count discovery is exactly what we should have in the build system. Since discorery is currently the default for lib/drivers, it stands to reason it should be default for everything else, if possible.
> > 2. Native build should produce binaries matching the build machine as well as possible.
> > 3. Default/generic build should produce binaries executable on a range of systems (ideally all systems of a given architecture).
> > 4. Other builds, that is non-native builds, are cross-compilation, since we're building for host machine other that the build machine.
> > 
> > What I haven't taken into account is users using CI builds. That could be remedied by modifying the CI a bit while being consistent with what native/default/generic/cross builds are (or should be). And in any case, if we're not interested in testing the exact CI environment (which we aren't, since we don't want to use 2 cores with 1 numa), we really shouldn't be doing native builds there.
> > 
> > I'm interested in hearing where my thinking deviates from yours.
> > 
> 
> There are a number of points in which we differ, I think.
> 
> Firstly, the use of "native" and "default/generic" for the "machine"
> parameter refers only to the instruction-set level from the compiler, and
> should not affect any other settings, since all settings are independent.
> Therefore, setting "machine" to "native" does not mean that we should
> detect cores and numa nodes, and similarly setting it to "default" does not
> mean that we should ignore the settings for these values and pick our own
> chosen default values.
> 
> Secondly, the use of cross-compilation only applies when you are compiling
> for a different architecture or environment (e.g. OS) to what you are
> building on. Building on a 4-core x86 machine to run on a dual-socket,
> 32-core x86 machine is not cross-compiling, but still needs to work by
> default. Something like building a 32-bit binary on a 64-bit OS is in most
> cases not done by cross-compilation either, but is rather outside the scope
> of the discussion, except as a reference point to show the scope of
> differences which can be accomodated as "native builds".
> 
> In terms of dynamic configuration for things like cores and numa nodes, the
> ideal end state here is not to have them detected at build time on the host
> system, but instead to have them detected at runtime and sized dynamically.
> In the absense of that, these values should be set to reasonable defaults
> so that when a user compiles up a binary without settings these explicitly
> it should run on 95%+ of systems of that type.
> 
> This is my understanding of the issues, anyway. :-)
> 
What could possibly work is to set the defaults for these to "0" as done in
your patch, but thereafter have the resulting defaults set
per-architecture, rather than globally. That would allow x86 to tune things
more for native-style builds, while in all cases allowing user to override.

/Bruce

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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-21 14:27             ` Bruce Richardson
@ 2020-10-23 10:07               ` Juraj Linkeš
  2020-10-27 10:30                 ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 10:07 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, October 21, 2020 4:28 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu
> counts detection
> 
> On Wed, Oct 21, 2020 at 03:13:19PM +0100, Bruce Richardson wrote:
> > On Wed, Oct 21, 2020 at 01:01:41PM +0000, Juraj Linkeš wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > Sent: Wednesday, October 21, 2020 2:02 PM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > > Phil.Yang@arm.com; vcchunga@amazon.com;
> Dharmik.Thakkar@arm.com;
> > > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > > > Subject: Re: [RFC PATCH v3 3/6] build: automatic NUMA and cpu
> > > > counts detection
> > > >
> > > > On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> > > > > The build machine's number of cpus and numa nodes vary,
> > > > > resulting in mismatched counts of RTE_MAX_LCORE and
> > > > > RTE_MAX_NUMA_NODES for
> > > > many
> > > > > builds. Automatically discover the host's numa and cpu counts to
> > > > > remove this mismatch for native builds. Use current defaults for default
> builds.
> > > > > Force the users to specify the counts for cross build in cross
> > > > > files or on the command line.
> > > > > Give users the option to override the discovery or values from
> > > > > cross files by specifying them on the command line with
> > > > > -Dmax_lcores and -Dmax_numa_nodes.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > ---
> > > > >  buildtools/get_cpu_count.py  |  7 ++++++
> > > > > buildtools/get_numa_count.py | 22 +++++++++++++++++++
> > > > >  buildtools/meson.build       |  2 ++
> > > > >  config/meson.build           | 42 ++++++++++++++++++++++++++++++++++-
> -
> > > > >  meson_options.txt            |  8 +++----
> > > > >  5 files changed, 75 insertions(+), 6 deletions(-)  create mode
> > > > > 100644 buildtools/get_cpu_count.py  create mode 100644
> > > > > buildtools/get_numa_count.py
> > > > >
> > > > > diff --git a/buildtools/get_cpu_count.py
> > > > > b/buildtools/get_cpu_count.py new file mode 100644 index
> > > > > 000000000..386f85f8b
> > > > > --- /dev/null
> > > > > +++ b/buildtools/get_cpu_count.py
> > > > > @@ -0,0 +1,7 @@
> > > > > +#!/usr/bin/python3
> > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > +PANTHEON.tech s.r.o.
> > > > > +
> > > > > +import os
> > > > > +
> > > > > +print(os.cpu_count())
> > > > > diff --git a/buildtools/get_numa_count.py
> > > > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > > > 000000000..f0c49973a
> > > > > --- /dev/null
> > > > > +++ b/buildtools/get_numa_count.py
> > > > > @@ -0,0 +1,22 @@
> > > > > +#!/usr/bin/python3
> > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > +PANTHEON.tech s.r.o.
> > > > > +
> > > > > +import ctypes
> > > > > +import glob
> > > > > +import os
> > > > > +import subprocess
> > > > > +
> > > > > +if os.name == 'posix':
> > > > > +    if os.path.isdir('/sys/devices/system/node'):
> > > > > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > > > > +    else:
> > > > > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > > > > +capture_output=True).stdout)
> > > > > +
> > > > > +elif os.name == 'nt':
> > > > > +    libkernel32 = ctypes.windll.kernel32
> > > > > +
> > > > > +    count = ctypes.c_ulong()
> > > > > +
> > > > > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > > > > +    print(count.value + 1)
> > > > > diff --git a/buildtools/meson.build b/buildtools/meson.build
> > > > > index
> > > > > 04808dabc..925e733b1 100644
> > > > > --- a/buildtools/meson.build
> > > > > +++ b/buildtools/meson.build
> > > > > @@ -17,3 +17,5 @@ else
> > > > >  endif
> > > > >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper =
> > > > > py3 +
> > > > > files('call-sphinx-build.py')
> > > > > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > > > > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > > > > diff --git a/config/meson.build b/config/meson.build index
> > > > > a57c8ae9e..c4477f977 100644
> > > > > --- a/config/meson.build
> > > > > +++ b/config/meson.build
> > > > > @@ -74,7 +74,11 @@ endif
> > > > >  # still being able to support the CPU features required for DPDK.
> > > > >  # This can be bumped up by the DPDK project, but it can never
> > > > > be an # invariant like 'native'
> > > > > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > > > > +get_option('max_numa_nodes')
> > > > >  if machine == 'default'
> > > > > +	max_numa_nodes = 4
> > > > > +	max_lcores = 128
> > > >
> > > > This doesn't seem right, since you are overriding the
> > > > user-specified values with hard-coded ones.
> > > >
> > >
> > > I understand we're using the default build/generic to build portalbe dpdk
> distro packages, meaning the settings for those packages should always be the
> same, no? If not, what should the default/generic build be? And when would
> someone do a default/generic build with their values? It wouldn't be a
> default/generic anymore, right?
> > >
> > > > >  	if host_machine.cpu_family().startswith('x86')
> > > > >  		# matches the old pre-meson build systems default
> > > > >  		machine = 'corei7'
> > > > > @@ -83,6 +87,22 @@ if machine == 'default'
> > > > >  	elif host_machine.cpu_family().startswith('ppc')
> > > > >  		machine = 'power8'
> > > > >  	endif
> > > > > +elif not meson.is_cross_build()
> > > > > +	# find host core count and numa node count for native builds
> > > > > +	if max_lcores == 0
> > > > > +		max_lcores =
> > > > run_command(get_cpu_count_cmd).stdout().to_int()
> > > > > +		min_lcores = 2
> > > > > +		if max_lcores < min_lcores
> > > > > +			message('Found less than @0@ cores, building
> for
> > > > @0@ cores'.format(min_lcores))
> > > > > +			max_lcores = min_lcores
> > > > > +		else
> > > > > +			message('Found @0@
> cores'.format(max_lcores))
> > > > > +		endif
> > > > > +	endif
> > > > > +	if max_numa_nodes == 0
> > > > > +		max_numa_nodes =
> > > > run_command(get_numa_count_cmd).stdout().to_int()
> > > > > +		message('Found @0@ numa
> nodes'.format(max_numa_nodes))
> > > > > +	endif
> > > > >  endif
> > > > >
> > > > >  dpdk_conf.set('RTE_MACHINE', machine) @@ -227,8 +247,10 @@
> > > > > foreach
> > > > > arg: warning_flags  endforeach
> > > > >
> > > > >  # set other values pulled from the build options
> > > > > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > > > > -dpdk_conf.set('RTE_MAX_NUMA_NODES',
> > > > > get_option('max_numa_nodes'))
> > > > > +if not meson.is_cross_build()
> > > > > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> endif
> > > >
> > > > Rather than conditionally setting the value here, you should move
> > > > the checks below up above this to simplify things.
> > > >
> > >
> > > Do you mean the cross build checks? Those have to be after
> subdir(arch_subdir) so that we can override the values from cross files (as the
> commit message says).
> > >
> > > > >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > > > > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > > > > dpdk_conf.set('RTE_ENABLE_TRACE_FP',
> > > > > get_option('enable_trace_fp')) @@
> > > > > -247,6 +269,22 @@ compile_time_cpuflags = []
> > > > >  subdir(arch_subdir)
> > > > >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > > > > ','.join(compile_time_cpuflags))
> > > > >
> > > > > +# check that cpu and numa count is set in cross builds if
> > > > > +meson.is_cross_build()
> > > > > +    	if max_lcores > 0
> > > > > +		# specified on the cmdline
> > > > > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > > +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> > > > > +		error('Number of cores for cross build not specified in
> @0@
> > > > subdir (e.g. in a cross-file) nor on the
> > > > cmdline'.format(arch_subdir))
> > > > > +	endif
> > > > > +	if max_numa_nodes > 0
> > > > > +		# specified on the cmdline
> > > > > +		dpdk_conf.set('RTE_MAX_NUMA_NODES',
> max_numa_nodes)
> > > > > +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > > > > +		error('Number of numa nodes for cross build not
> specified in
> > > > @0@ subdir (e.g. in a cross-file) nor on the
> > > > cmdline'.format(arch_subdir))
> > > > > +	endif
> > > > > +endif
> > > > > +
> > > > >  # set the install path for the drivers
> > > > > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> > > > >
> > > > > diff --git a/meson_options.txt b/meson_options.txt index
> > > > > 9bf18ab6b..01b0c45c3 100644
> > > > > --- a/meson_options.txt
> > > > > +++ b/meson_options.txt
> > > > > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> > > > >  	description: 'set the target machine type')
> > > > > option('max_ethports',
> > > > > type: 'integer', value: 32,
> > > > >  	description: 'maximum number of Ethernet devices')
> > > > > -option('max_lcores', type: 'integer', value: 128,
> > > > > -	description: 'maximum number of cores/threads supported by
> EAL')
> > > > > -option('max_numa_nodes', type: 'integer', value: 4,
> > > > > -	description: 'maximum number of NUMA nodes supported by
> EAL')
> > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > +	description: 'maximum number of cores/threads supported by
> EAL.
> > > > > +Value 0 means the number of cpus on the host will be used. For
> > > > > +cross build,
> > > > set to non-zero to overwrite the cross-file value.')
> > > > option('max_numa_nodes',
> > > > type: 'integer', value: 0,
> > > > > +	description: 'maximum number of NUMA nodes supported by
> EAL.
> > > > > +Value
> > > > 0
> > > > > +means the number of numa nodes on the host will be used. For
> > > > > +cross build, set to non-zero to overwrite the cross-file
> > > > > +value.')
> > > >
> > > > I don't like this change, because it very much assumes for
> > > > non-cross-compiles that people will be running DPDK on the system
> > > > they build it on. That's a very, very big assumption!
> > >
> > > I'll be using definitions from https://mesonbuild.com/Cross-
> compilation.html.
> > > I understand cross compilation to be building for a diffent host machine than
> the build machine (which is aligned with pretty much every definition I found). I
> understand this to be true not only for builds between architectures, but also
> within an architecture (e.g. x86_64 build machine building for x86_64 host
> machine).
> > > So yes, when someone does a native build, it stands to reason they want to
> use it on the build machine. If they wanted to use it elsewhere, they would cross
> compile.
> > > Another thing is the current build philosophy is to detect as much as possible
> (not having statically defined configuration, as you mentioned in the past).
> Detecting the number of cores and numa nodes fits this perfectly.
> > > And yet another thing is that the assumption seems to be already present in
> the build system - it already detects a lot things, some of which may not be
> satisfied on machines other than the build machine. I may be wrong about this.
> > >
> > > > I'm ok with having zero as a "detect" option, and having the
> > > > values overridden from cross-files, but not with detection as the
> > > > default out- of-the-box option! Lots of users may pull builds from
> > > > a CI based on VMs with just a few cores, for instance.
> > >
> > > If not having the automatic detection is a concern because of users using CI
> builds, then we (if it's from our CI) can change what we're building in CI - the
> default/generic build seems like a good fit because it's supposed to work on a
> variety of systems. Expecting that native build from random VMs would work
> anywhere doesn't seen very realistic - it's been build for that VM environment
> (because it's a native build).
> > >
> > > Here's my understanding on which the current version is based:
> > > 1. Since we want to get away from having statically defined configuration,
> numa and core count discovery is exactly what we should have in the build
> system. Since discorery is currently the default for lib/drivers, it stands to reason
> it should be default for everything else, if possible.
> > > 2. Native build should produce binaries matching the build machine as well as
> possible.
> > > 3. Default/generic build should produce binaries executable on a range of
> systems (ideally all systems of a given architecture).
> > > 4. Other builds, that is non-native builds, are cross-compilation, since we're
> building for host machine other that the build machine.
> > >
> > > What I haven't taken into account is users using CI builds. That could be
> remedied by modifying the CI a bit while being consistent with what
> native/default/generic/cross builds are (or should be). And in any case, if we're
> not interested in testing the exact CI environment (which we aren't, since we
> don't want to use 2 cores with 1 numa), we really shouldn't be doing native
> builds there.
> > >
> > > I'm interested in hearing where my thinking deviates from yours.
> > >
> >
> > There are a number of points in which we differ, I think.
> >
> > Firstly, the use of "native" and "default/generic" for the "machine"
> > parameter refers only to the instruction-set level from the compiler,
> > and should not affect any other settings, since all settings are independent.

It seems that what you're saying may be true from the x86 point of view, but is not true from arm point of view and thus not true in general.
It's not true that all setting are independent for arm build. When building with machine=native we're discovering what machine we're building on and setting some settings (other than numa and core count) are based on that. For machine=generic we also have a set of values that build the generic binaries you describe below. More on this in that section.

> > Therefore, setting "machine" to "native" does not mean that we should
> > detect cores and numa nodes, and similarly setting it to "default"
> > does not mean that we should ignore the settings for these values and
> > pick our own chosen default values.
> >

I don't think this follows (if all settings are independent, then setting machine to native or anything else implies nothing for other settings). But I think it does follow from the what you write next.

However, since machine="default/generic" does not specify a type of build, but rather just one configuration option (or a small subset for arm builds), removing the ability to overwrite the default values when machine="default/generic" is not warranted.

> > Secondly, the use of cross-compilation only applies when you are
> > compiling for a different architecture or environment (e.g. OS) to
> > what you are building on. Building on a 4-core x86 machine to run on a
> > dual-socket, 32-core x86 machine is not cross-compiling, but still
> > needs to work by default.

We (the arm community, or at least a part of it) frequently refer to aarch64 -> aarch64 cross-compilation when we're building for a specific SoC (usually small/slow) on a fast server grade aarch64 machine. This is probably be because we're conflating what most people consider cross-compilation to be (building for a different arch or OS) with what meson cross compilation is (using a cross-file). Arm SoCs vary greatly and we want to capture that variation in cross files and use the cross files even on the same architecture (or rather, we want users to be able to). From now on when talking about cross compilation I'll mean meson cross compilation (i.e. using a cross file).

> > Something like building a 32-bit binary on a
> > 64-bit OS is in most cases not done by cross-compilation either, but
> > is rather outside the scope of the discussion, except as a reference
> > point to show the scope of differences which can be accomodated as "native
> builds".
> >
> > In terms of dynamic configuration for things like cores and numa
> > nodes, the ideal end state here is not to have them detected at build
> > time on the host system, but instead to have them detected at runtime and
> sized dynamically.

This would simplify everything, from building to users not having to worry about one more thing - would this be hard/time consuming to implement?

> > In the absense of that, these values should be set to reasonable
> > defaults so that when a user compiles up a binary without settings
> > these explicitly it should run on 95%+ of systems of that type.
> >

This, coupled with the paragraph about cross-compilation imply that we shouldn't default to discovering the values and I think that's reasonable. Having the ability to specify these on the command line, using an optional discovery mechanism and specifying these in a cross file should cover our (arm) needs.

> > This is my understanding of the issues, anyway. :-)
> >
> What could possibly work is to set the defaults for these to "0" as done in your
> patch, but thereafter have the resulting defaults set per-architecture, rather
> than globally. That would allow x86 to tune things more for native-style builds,
> while in all cases allowing user to override.
> 
> /Bruce

I'll change it so that per-arch (and for arm, per processor type) defaults are the defaults that will be used (when set to 0). I'd like to give users the option to use the discovery mechanism - I think we'll have to use another value with specific meaning and we can't use positive integers so I guess the best we can do is use -1 for this.

Juraj

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

* [dpdk-dev] [PATCH v4 0/6] Arm build options rework
  2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
                       ` (5 preceding siblings ...)
  2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 6/6] build: update Arm builds with makefile flags Juraj Linkeš
@ 2020-10-23 14:48     ` Juraj Linkeš
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic Juraj Linkeš
                         ` (7 more replies)
  6 siblings, 8 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 14:48 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in cross files.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

Juraj Linkeš (6):
  build: alias default build as generic
  build: refactor Arm build
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: update Arm builds with makefile flags

 buildtools/get_cpu_count.py          |   7 +
 buildtools/get_numa_count.py         |  22 +++
 buildtools/meson.build               |   2 +
 config/arm/arm64_armada_linux_gcc    |   6 +-
 config/arm/arm64_armv8_linux_gcc     |  18 +-
 config/arm/arm64_bluefield_linux_gcc |   7 +-
 config/arm/arm64_dpaa_linux_gcc      |   5 +-
 config/arm/arm64_emag_linux_gcc      |   4 +-
 config/arm/arm64_n1sdp_linux_gcc     |   7 +-
 config/arm/arm64_octeontx2_linux_gcc |   7 +-
 config/arm/arm64_stingray_linux_gcc  |   7 +-
 config/arm/arm64_thunderx2_linux_gcc |   6 +-
 config/arm/arm64_thunderx_linux_gcc  |   4 +-
 config/arm/meson.build               | 278 ++++++++++++++++-----------
 config/meson.build                   |  54 +++++-
 drivers/meson.build                  |   6 +-
 meson.build                          |   1 +
 meson_options.txt                    |   8 +-
 18 files changed, 306 insertions(+), 143 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
@ 2020-10-23 14:48       ` Juraj Linkeš
  2020-10-27  3:53         ` Honnappa Nagarahalli
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build Juraj Linkeš
                         ` (6 subsequent siblings)
  7 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 14:48 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index b49203fa8..491842cad 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -87,7 +88,7 @@ flags_octeontx2_extra = [
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
 
-machine_args_generic = [
+machine_args_default = [
 	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
@@ -113,20 +114,20 @@ machine_args_emag = [
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
+impl_generic = ['Generic armv8', flags_generic, machine_args_default]
+impl_0x41 = ['Arm', flags_arm, machine_args_default]
+impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
 impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
+impl_0x44 = ['DEC', flags_generic, machine_args_default]
+impl_0x49 = ['Infineon', flags_generic, machine_args_default]
+impl_0x4d = ['Motorola', flags_generic, machine_args_default]
+impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
 impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
+impl_0x53 = ['Samsung', flags_generic, machine_args_default]
+impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
+impl_0x69 = ['Intel', flags_generic, machine_args_default]
+impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -145,7 +146,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..918ca2dfb 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,13 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
+# machine type 'generic' is special, it defaults to the per arch agreed common
 # minimal baseline needed for DPDK.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +82,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic Juraj Linkeš
@ 2020-10-23 14:48       ` Juraj Linkeš
  2020-10-27  4:56         ` Honnappa Nagarahalli
  2020-10-28 16:59         ` Honnappa Nagarahalli
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection Juraj Linkeš
                         ` (5 subsequent siblings)
  7 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 14:48 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

* Rename variables to have names that better describe what the variables
store
* Remove unused or superfluous variables
* Change a list to dictionary where key lookup is needed
* Add informatory comments in the code
* Minor code restructure and reformatting

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 247 +++++++++++++++------------
 11 files changed, 153 insertions(+), 130 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 491842cad..6c31ab167 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,12 +3,12 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
+# set arm_force_native_march if you want to use machine args below
+# instead of discovered values; only works when doing an actual native build
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
+native_machine_args = ['-march=native', '-mtune=native']
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
@@ -16,8 +16,9 @@ flags_common_default = [
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -28,184 +29,206 @@ flags_common_default = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_ARCH_ARM64', true]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128]
+]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 flags_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_VFIO_GROUPS', 128]
+]
 flags_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]
+]
 flags_emag = [
 	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 flags_armada = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 
-flags_default_extra = []
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false]
+]
 flags_thunderx_extra = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_thunderx2_extra = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_USE_C11_MEM_MODEL', true]
+]
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
-
-machine_args_default = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
-
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['RTE_USE_C11_MEM_MODEL', true]
+]
+# arm config (implementer 0x41) is the default config
+pn_config_default = {
+	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
+	'0xd03': [['-mcpu=cortex-a53']],
+	'0xd04': [['-mcpu=cortex-a35']],
+	'0xd07': [['-mcpu=cortex-a57']],
+	'0xd08': [['-mcpu=cortex-a72']],
+	'0xd09': [['-mcpu=cortex-a73']],
+	'0xd0a': [['-mcpu=cortex-a75']],
+	'0xd0b': [['-mcpu=cortex-a76']],
+	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]
+}
+pn_config_cavium = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
+	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
+	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
+	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
+	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
+	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra],
+}
+pn_config_emag = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']]
+}
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_default]
-impl_0x41 = ['Arm', flags_arm, machine_args_default]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_default]
-impl_0x49 = ['Infineon', flags_generic, machine_args_default]
-impl_0x4d = ['Motorola', flags_generic, machine_args_default]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
-impl_0x53 = ['Samsung', flags_generic, machine_args_default]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
-impl_0x69 = ['Intel', flags_generic, machine_args_default]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
+impl_generic = ['Generic armv8', flags_generic, pn_config_default]
+impl_0x41 = ['Arm', flags_arm, pn_config_default]
+impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
+impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
+impl_0x44 = ['DEC', flags_generic, pn_config_default]
+impl_0x49 = ['Infineon', flags_generic, pn_config_default]
+impl_0x4d = ['Motorola', flags_generic, pn_config_default]
+impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
+impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
+impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
+impl_0x53 = ['Samsung', flags_generic, pn_config_default]
+impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
+impl_0x69 = ['Intel', flags_generic, pn_config_default]
+impl_dpaa = ['NXP DPAA', flags_dpaa, pn_config_default]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
+	# aarch64 build
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# default build
+			impl_config = impl_generic
+			part_number = 'generic'
+		else
+			# native 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
+			if arm_force_native_march == true
+				part_number = 'native'
+			else
+				part_number = cmd_output[3]
+			endif
+			# Set to generic implementer if implementer is not found
+			impl_config = get_variable('impl_' + cmd_output[0], 'impl_generic')
+		endif
+	else
+		# cross build
+		impl_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		impl_config = get_variable('impl_' + impl_id)
+	endif
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
-	cmd_output = cmd_generic # Set generic by default
-	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+	message('Arm implementer: ' + impl_config[0])
+	message('Arm part number: ' + part_number)
+
+	implementer_flags = impl_config[1]
+	part_number_config = impl_config[2]
+
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif part_number == 'native'
+		# use native machine args
+		part_number_config = [[native_machine_args]]
 	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
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
 	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)
+		# cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
 	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])
+	dpdk_flags = flags_common_default + implementer_flags
+
+	if part_number_config.length() > 1
+		dpdk_flags += part_number_config[1]
+	endif
+
+	machine_args = [] # Clear previous machine args
+	foreach flag: part_number_config[0]
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	foreach flag: dpdk_flags
 		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
 endif
-message(machine_args)
+
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic Juraj Linkeš
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build Juraj Linkeš
@ 2020-10-23 14:48       ` Juraj Linkeš
  2020-10-27 11:20         ` Bruce Richardson
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 4/6] build: add core and NUMA counts to cross files Juraj Linkeš
                         ` (4 subsequent siblings)
  7 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 14:48 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 48 ++++++++++++++++++++++++++++++++++--
 meson_options.txt            |  8 +++---
 5 files changed, 81 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..386f85f8b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..f0c49973a
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        print(subprocess.run(['sysctl', 'vm.ndomains'], capture_output=True).stdout)
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index 918ca2dfb..5c6fdcc7d 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -230,8 +230,14 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
+if not meson.is_cross_build()
+	# set default values
+	# these defaults may be overwritten by meson.build in an arch subdir
+	# or later overwritten if a user specifies a value on the command line
+	# or the user chooses to use values discovered from the build machine
+	dpdk_conf.set('RTE_MAX_LCORE', 128)
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
+endif
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -250,6 +256,44 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+max_numa_nodes = get_option('max_numa_nodes')
+if max_lcores > 0
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	if not meson.is_cross_build()
+		max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+		min_lcores = 2
+		if max_lcores < min_lcores
+			message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+			max_lcores = min_lcores
+		else
+			message('Found @0@ cores'.format(max_lcores))
+		endif
+		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+	endif
+endif
+
+if max_numa_nodes > 0
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	if not meson.is_cross_build()
+		max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+		message('Found @0@ numa nodes'.format(max_numa_nodes))
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+	endif
+endif
+
+# check that cpu and numa count is set in cross builds
+if meson.is_cross_build()
+	if not dpdk_conf.has('RTE_MAX_LCORE')
+		error('Number of cores for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
+	endif
+	if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+		error('Number of numa nodes for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
+	endif
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..a78c21b0d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 4/6] build: add core and NUMA counts to cross files
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
                         ` (2 preceding siblings ...)
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-23 14:48       ` Juraj Linkeš
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 5/6] build: disable Arm drivers Juraj Linkeš
                         ` (3 subsequent siblings)
  7 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 14:48 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |  2 ++
 config/arm/arm64_armv8_linux_gcc     |  6 ++++++
 config/arm/arm64_bluefield_linux_gcc |  2 ++
 config/arm/arm64_dpaa_linux_gcc      |  2 ++
 config/arm/arm64_emag_linux_gcc      |  2 ++
 config/arm/arm64_n1sdp_linux_gcc     |  2 ++
 config/arm/arm64_octeontx2_linux_gcc |  2 ++
 config/arm/arm64_stingray_linux_gcc  |  2 ++
 config/arm/arm64_thunderx2_linux_gcc |  2 ++
 config/arm/arm64_thunderx_linux_gcc  |  2 ++
 config/arm/meson.build               | 20 ++++++++++++++++++++
 11 files changed, 44 insertions(+)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..36100c594 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..779333199 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -26,3 +26,9 @@ implementer_id = 'generic'
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
 part_number = 'generic'
+
+# Supported extra configuration
+# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+# max_lcores = n      # will set RTE_MAX_LCORE
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..adae86f57 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..3cccca901 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+max_numa_nodes = 1
+max_lcores = 32
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..3a8b46812 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_numa_nodes = 1
+max_lcores = 4
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..2baf95a2a 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_numa_nodes = 1
+max_lcores = 36
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..07440fe5f 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_numa_nodes = 2
+max_lcores = 256
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 670764437..16ba78fd6 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+max_numa_nodes = 1
+max_lcores = 96
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6c31ab167..b5a62f89d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -38,12 +38,14 @@ flags_common_default = [
 flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
+	['RTE_MAX_NUMA_NODES', 4],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]
 ]
@@ -214,6 +216,24 @@ else
 		dpdk_flags += part_number_config[1]
 	endif
 
+	# apply cross-specific options
+	if meson.is_cross_build()
+		# configure RTE_MAX_NUMA_NODES and RTE_MAX_LCORE from cross file
+		cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+		if cross_max_numa_nodes != 0
+			dpdk_flags += [
+				['RTE_MAX_NUMA_NODES', cross_max_numa_nodes]
+			]
+		endif
+		cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+		if cross_max_lcores != 0
+			message('Setting RTE_MAX_LCORE from cross file')
+			dpdk_flags += [
+				['RTE_MAX_LCORE', cross_max_lcores]
+			]
+		endif
+	endif
+
 	machine_args = [] # Clear previous machine args
 	foreach flag: part_number_config[0]
 		if cc.has_argument(flag)
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 5/6] build: disable Arm drivers
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
                         ` (3 preceding siblings ...)
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 4/6] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-10-23 14:48       ` Juraj Linkeš
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 6/6] build: update Arm builds with makefile flags Juraj Linkeš
                         ` (2 subsequent siblings)
  7 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 14:48 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/meson.build | 9 +++++----
 drivers/meson.build    | 2 +-
 meson.build            | 1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index b5a62f89d..5def9e744 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,6 +8,11 @@
 arm_force_native_march = false
 native_machine_args = ['-march=native', '-mtune=native']
 
+# RFC: do we want these drivers to be disabled by default on arm?
+# The previous way to disable these drivers never worked
+# RTE_NET_AVP and the rest would be overwritten to true if the necessary deps were found
+disabled_drivers += ['net/avp', 'net/fm10k', 'net/sfc']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -23,10 +28,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_SFC_EFX', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_CACHE_LINE_SIZE', 128],
diff --git a/drivers/meson.build b/drivers/meson.build
index a5a6fed06..a41ff909e 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,7 +18,7 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
 default_cflags = machine_args
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v4 6/6] build: update Arm builds with makefile flags
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
                         ` (4 preceding siblings ...)
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 5/6] build: disable Arm drivers Juraj Linkeš
@ 2020-10-23 14:48       ` Juraj Linkeš
  2020-10-27  3:53       ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Honnappa Nagarahalli
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
  7 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-23 14:48 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Not all flags were moved properly from the old Makefile build system.
Disable corresponding drivers and libnuma in cross files and remove
deprecated config.

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

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 36100c594..e33f1e742 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,5 @@ endian = 'little'
 implementer_id = '0x56'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 779333199..c6010e303 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -28,7 +28,11 @@ implementer_id = 'generic'
 part_number = 'generic'
 
 # Supported extra configuration
-# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-# max_lcores = n      # will set RTE_MAX_LCORE
+# max_numa_nodes = n   # will set RTE_MAX_NUMA_NODES
+# max_lcores = n        # will set RTE_MAX_LCORE
 max_lcores = 256
 max_numa_nodes = 4
+
+# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
+# disabled_drivers += ['bus/dpaa', 'crypto']
+    # add to the set of disabled libraries
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index adae86f57..78883a2ec 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = 'dpaa'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 3a8b46812..4493227f3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_numa_nodes = 1
 max_lcores = 4
+has_libnuma = 0
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 2baf95a2a..ff9e5c403 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_numa_nodes = 1
 max_lcores = 36
+has_libnuma = 0
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 5def9e744..fc6fdf3ba 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -103,7 +103,6 @@ flags_octeontx2_extra = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]
 ]
 # arm config (implementer 0x41) is the default config
@@ -233,6 +232,10 @@ else
 				['RTE_MAX_LCORE', cross_max_lcores]
 			]
 		endif
+		cross_has_libnuma = meson.get_cross_property('has_libnuma', '')
+		if cross_has_libnuma != ''
+			has_libnuma = cross_has_libnuma
+		endif
 	endif
 
 	machine_args = [] # Clear previous machine args
diff --git a/drivers/meson.build b/drivers/meson.build
index a41ff909e..4bdc3d5c9 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -21,6 +21,10 @@ subdirs = [
 disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic Juraj Linkeš
@ 2020-10-27  3:53         ` Honnappa Nagarahalli
  2020-10-27  7:46           ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-27  3:53 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> The current machine='default' build name is not descriptive. The actual
> default build is machine='native'. Add an alternative string which does the
> same build and better describes what we're building:
> machine='generic'. Leave machine='default' for backwards compatibility.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 31 ++++++++++++++++---------------
>  config/meson.build     |  6 +++---
>  2 files changed, 19 insertions(+), 18 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> b49203fa8..491842cad 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -1,12 +1,13 @@
>  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2017 Intel
> Corporation.
>  # Copyright(c) 2017 Cavium, Inc
> +# Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
>  # for checking defines we need to use the correct compiler flags  march_opt
> = '-march=@0@'.format(machine)
> 
>  arm_force_native_march = false
> -arm_force_default_march = (machine == 'default')
> +arm_force_generic_march = (machine == 'generic')
> 
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -87,7 +88,7 @@ flags_octeontx2_extra = [
>  	['RTE_EAL_IGB_UIO', false],
>  	['RTE_USE_C11_MEM_MODEL', true]]
> 
> -machine_args_generic = [
> +machine_args_default = [
Is this change required? 'machine_args_generic' aligns much better with 'machine == generic' (change in the file config/meson.build below)

>  	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
>  	['native', ['-march=native']],
>  	['0xd03', ['-mcpu=cortex-a53']],
> @@ -113,20 +114,20 @@ machine_args_emag = [
>  	['native', ['-march=native']]]
> 
>  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
> -impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
> -impl_0x41 = ['Arm', flags_arm, machine_args_generic]
> -impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
> +impl_generic = ['Generic armv8', flags_generic, machine_args_default]
> +impl_0x41 = ['Arm', flags_arm, machine_args_default]
> +impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
>  impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> -impl_0x44 = ['DEC', flags_generic, machine_args_generic]
> -impl_0x49 = ['Infineon', flags_generic, machine_args_generic] -impl_0x4d =
> ['Motorola', flags_generic, machine_args_generic] -impl_0x4e = ['NVIDIA',
> flags_generic, machine_args_generic]
> +impl_0x44 = ['DEC', flags_generic, machine_args_default]
> +impl_0x49 = ['Infineon', flags_generic, machine_args_default] impl_0x4d
> += ['Motorola', flags_generic, machine_args_default] impl_0x4e =
> +['NVIDIA', flags_generic, machine_args_default]
>  impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> -impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
> -impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
> -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
> -impl_0x69 = ['Intel', flags_generic, machine_args_generic] -impl_dpaa =
> ['NXP DPAA', flags_dpaa, machine_args_generic]
> +impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> +impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> +impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> +impl_0x69 = ['Intel', flags_generic, machine_args_default] impl_dpaa =
> +['NXP DPAA', flags_dpaa, machine_args_default]
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -145,7 +146,7 @@ else
>  	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()
> +	if arm_force_generic_march and not meson.is_cross_build()
>  		machine = impl_generic
>  		impl_pn = 'default'
>  	elif not meson.is_cross_build()
> diff --git a/config/meson.build b/config/meson.build index
> 258b01d06..918ca2dfb 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -68,13 +68,13 @@ else
>  	machine = get_option('machine')
>  endif
> 
> -# machine type 'default' is special, it defaults to the per arch agreed
> common
> +# machine type 'generic' is special, it defaults to the per arch agreed
> +common
>  # minimal baseline needed for DPDK.
>  # That might not be the most optimized, but the most portable version while
> # still being able to support the CPU features required for DPDK.
>  # This can be bumped up by the DPDK project, but it can never be an  #
> invariant like 'native'
Nit, may be it is worth mentioning that 'default' is allowed for backward compatibility?

> -if machine == 'default'
> +if machine == 'default' or machine == 'generic'
>  	if host_machine.cpu_family().startswith('x86')
>  		# matches the old pre-meson build systems default
>  		machine = 'corei7'
> @@ -82,7 +82,7 @@ if machine == 'default'
>  		machine = 'armv7-a'
>  	elif host_machine.cpu_family().startswith('aarch')
>  		# arm64 manages defaults in config/arm/meson.build
> -		machine = 'default'
> +		machine = 'generic'
>  	elif host_machine.cpu_family().startswith('ppc')
>  		machine = 'power8'
>  	endif
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 0/6] Arm build options rework
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
                         ` (5 preceding siblings ...)
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 6/6] build: update Arm builds with makefile flags Juraj Linkeš
@ 2020-10-27  3:53       ` Honnappa Nagarahalli
  2020-10-27  7:50         ` Juraj Linkeš
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
  7 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-27  3:53 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> The current way of specifying Arm configuration options is insufficient since
> we can't identify the SoC we're building for from the MIDR information. For
> example, we can't distinguish between N1SDP, Graviton2 or Ampere Altra.
> 
> Add a way to specify the cpu count and numa node count for cross builds.
> 
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed 2. a
> cross build on a fast aarch64 machine but with target SoC which
I assume cross building on x86 for a Arm target SoC does not need any additional changes.

>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in cross files.
> 
> Among libraries, only libnuma can be now disabled.
> 
> Also add an optional way to discover cpu count a numa node count. Fix -
> Dmax_lcores and -Dmax_numa_nodes for arm builds.
> 
> v2:
> Major rework of the whole series.
> 
> v3:
> Added numa and core count defaults for x86 default build.
> Removed numa and core count defaults. Now requiring defaults to be
> specified in a cross file or on the cmdline.
> Added FreeBDS support for numa count discovery.
> 
> v4:
> Make automatic numa and cpu counts discovery optional.
> 
> Juraj Linkeš (6):
>   build: alias default build as generic
>   build: refactor Arm build
>   build: optional NUMA and cpu counts detection
>   build: add core and NUMA counts to cross files
>   build: disable Arm drivers
>   build: update Arm builds with makefile flags
> 
>  buildtools/get_cpu_count.py          |   7 +
>  buildtools/get_numa_count.py         |  22 +++
>  buildtools/meson.build               |   2 +
>  config/arm/arm64_armada_linux_gcc    |   6 +-
>  config/arm/arm64_armv8_linux_gcc     |  18 +-
>  config/arm/arm64_bluefield_linux_gcc |   7 +-
>  config/arm/arm64_dpaa_linux_gcc      |   5 +-
>  config/arm/arm64_emag_linux_gcc      |   4 +-
>  config/arm/arm64_n1sdp_linux_gcc     |   7 +-
>  config/arm/arm64_octeontx2_linux_gcc |   7 +-
>  config/arm/arm64_stingray_linux_gcc  |   7 +-
>  config/arm/arm64_thunderx2_linux_gcc |   6 +-
>  config/arm/arm64_thunderx_linux_gcc  |   4 +-
>  config/arm/meson.build               | 278 ++++++++++++++++-----------
>  config/meson.build                   |  54 +++++-
>  drivers/meson.build                  |   6 +-
>  meson.build                          |   1 +
>  meson_options.txt                    |   8 +-
>  18 files changed, 306 insertions(+), 143 deletions(-)  create mode 100644
> buildtools/get_cpu_count.py  create mode 100644
> buildtools/get_numa_count.py
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build Juraj Linkeš
@ 2020-10-27  4:56         ` Honnappa Nagarahalli
  2020-10-27  8:10           ` Juraj Linkeš
  2020-10-28 16:59         ` Honnappa Nagarahalli
  1 sibling, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-27  4:56 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>
I think we need to split this further. Few suggestions below.

> 
> * Rename variables to have names that better describe what the variables
> store
This should be a separate commit.

> * Remove unused or superfluous variables
Same here

> * Change a list to dictionary where key lookup is needed
Same here

> * Add informatory comments in the code

> * Minor code restructure and reformatting
Same for this

> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armada_linux_gcc    |   2 +-
>  config/arm/arm64_armv8_linux_gcc     |   8 +-
>  config/arm/arm64_bluefield_linux_gcc |   4 +-
>  config/arm/arm64_dpaa_linux_gcc      |   2 +-
>  config/arm/arm64_emag_linux_gcc      |   2 +-
>  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
>  config/arm/arm64_octeontx2_linux_gcc |   4 +-
>  config/arm/arm64_stingray_linux_gcc  |   4 +-
>  config/arm/arm64_thunderx2_linux_gcc |   4 +-
>  config/arm/arm64_thunderx_linux_gcc  |   2 +-
>  config/arm/meson.build               | 247 +++++++++++++++------------
>  11 files changed, 153 insertions(+), 130 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index fa40c0398..52c5f4476 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -14,4 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x56'
> +implementer_id = '0x56'
Implementor and implementer mean the same. Looked at Arm specs, they use 'implementer'. So, I am fine.

> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 88f0ff9da..13ee8b223 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -13,10 +13,10 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = 'generic'
> +implementer_id = 'generic'
> 
> -# Valid options for Arm's implementor_pn:
> -# 'default': valid for all armv8-a architectures (default value)
> +# Valid options for Arm's part_number:
> +# 'generic': valid for all armv8-a architectures (default value)
>  # '0xd03':   cortex-a53
>  # '0xd04':   cortex-a35
>  # '0xd05':   cortex-a55
> @@ -25,4 +25,4 @@ implementor_id = 'generic'
>  # '0xd09':   cortex-a73
>  # '0xd0a':   cortex-a75
>  # '0xd0b':   cortex-a76
> -implementor_pn = 'default'
> +part_number = 'generic'
Same here, Arm specs refer to this as 'PartNumber'. So, this should be fine.
I like 'generic' for part_number here.

> diff --git a/config/arm/arm64_bluefield_linux_gcc
> b/config/arm/arm64_bluefield_linux_gcc
> index 86797d23c..b79389d85 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd08'
> +implementer_id = '0x41'
> +part_number = '0xd08'
> diff --git a/config/arm/arm64_dpaa_linux_gcc
> b/config/arm/arm64_dpaa_linux_gcc index 1a4682154..573ae7e42 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -14,4 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = 'dpaa'
> +implementer_id = 'dpaa'
> diff --git a/config/arm/arm64_emag_linux_gcc
> b/config/arm/arm64_emag_linux_gcc index 8edcd3e97..24f3d533e 100644
> --- a/config/arm/arm64_emag_linux_gcc
> +++ b/config/arm/arm64_emag_linux_gcc
> @@ -13,4 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x50'
> +implementer_id = '0x50'
> diff --git a/config/arm/arm64_n1sdp_linux_gcc
> b/config/arm/arm64_n1sdp_linux_gcc
> index 022e06303..6fb3f02ea 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd0c'
> +implementer_id = '0x41'
> +part_number = '0xd0c'
> diff --git a/config/arm/arm64_octeontx2_linux_gcc
> b/config/arm/arm64_octeontx2_linux_gcc
> index 365bd7cbd..ac1042806 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x43'
> -implementor_pn = '0xb2'
> +implementer_id = '0x43'
> +part_number = '0xb2'
> diff --git a/config/arm/arm64_stingray_linux_gcc
> b/config/arm/arm64_stingray_linux_gcc
> index 86797d23c..b79389d85 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd08'
> +implementer_id = '0x41'
> +part_number = '0xd08'
> diff --git a/config/arm/arm64_thunderx2_linux_gcc
> b/config/arm/arm64_thunderx2_linux_gcc
> index 2b41acc61..dd257745e 100644
> --- a/config/arm/arm64_thunderx2_linux_gcc
> +++ b/config/arm/arm64_thunderx2_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x43'
> -implementor_pn = '0xaf'
> +implementer_id = '0x43'
> +part_number = '0xaf'
> diff --git a/config/arm/arm64_thunderx_linux_gcc
> b/config/arm/arm64_thunderx_linux_gcc
> index 6572ab615..670764437 100644
> --- a/config/arm/arm64_thunderx_linux_gcc
> +++ b/config/arm/arm64_thunderx_linux_gcc
> @@ -13,4 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x43'
> +implementer_id = '0x43'
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 491842cad..6c31ab167 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -3,12 +3,12 @@
>  # Copyright(c) 2017 Cavium, Inc
>  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
> -# for checking defines we need to use the correct compiler flags -march_opt
> = '-march=@0@'.format(machine)
> -
> +# set arm_force_native_march if you want to use machine args below #
> +instead of discovered values; only works when doing an actual native
> +build
>  arm_force_native_march = false
> -arm_force_generic_march = (machine == 'generic')
> +native_machine_args = ['-march=native', '-mtune=native']
> 
> +# common flags to all aarch64 builds, with lowest priority
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest)
>  	# to determine the best threshold in code. Refer to notes in source
> file @@ -16,8 +16,9 @@ flags_common_default = [
>  	['RTE_ARCH_ARM64_MEMCPY', false],
>  	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
>  	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
> -	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> unless there're
> -	# strong reasons.
> +
> +	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> +	# unless there are strong reasons.
>  	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> @@ -28,184 +29,206 @@ flags_common_default = [
> 
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
> +	['RTE_CACHE_LINE_SIZE', 128],
> +	['RTE_ARCH_ARM64', true]
>  ]
> 
> +# implementer specific aarch64 flags, with middle priority # (will
> +overwrite common flags)
>  flags_generic = [
>  	['RTE_MACHINE', '"armv8a"'],
>  	['RTE_MAX_LCORE', 256],
>  	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 128]]
> +	['RTE_CACHE_LINE_SIZE', 128]
> +]
Any particular reason for this change? (and similar changes below)

>  flags_arm = [
>  	['RTE_MACHINE', '"armv8a"'],
>  	['RTE_MAX_LCORE', 16],
>  	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64]]
> +	['RTE_CACHE_LINE_SIZE', 64]
> +]
>  flags_cavium = [
>  	['RTE_CACHE_LINE_SIZE', 128],
>  	['RTE_MAX_NUMA_NODES', 2],
>  	['RTE_MAX_LCORE', 96],
> -	['RTE_MAX_VFIO_GROUPS', 128]]
> +	['RTE_MAX_VFIO_GROUPS', 128]
> +]
>  flags_dpaa = [
>  	['RTE_MACHINE', '"dpaa"'],
>  	['RTE_USE_C11_MEM_MODEL', true],
>  	['RTE_CACHE_LINE_SIZE', 64],
>  	['RTE_MAX_NUMA_NODES', 1],
>  	['RTE_MAX_LCORE', 16],
> -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
> +	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false] ]
This is not needed

>  flags_emag = [
>  	['RTE_MACHINE', '"emag"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
>  	['RTE_MAX_NUMA_NODES', 1],
> -	['RTE_MAX_LCORE', 32]]
> +	['RTE_MAX_LCORE', 32],
> +	['RTE_CACHE_LINE_SIZE', 64]
> +]
>  flags_armada = [
>  	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
>  	['RTE_MAX_NUMA_NODES', 1],
> -	['RTE_MAX_LCORE', 16]]
> +	['RTE_MAX_LCORE', 16],
> +	['RTE_CACHE_LINE_SIZE', 64]
> +]
Any reason for this change?

> 
> -flags_default_extra = []
> +# part number specific aarch64 flags, with highest priority # (will
> +overwrite both common and implementer specific flags)
>  flags_n1sdp_extra = [
>  	['RTE_MACHINE', '"n1sdp"'],
>  	['RTE_MAX_NUMA_NODES', 1],
>  	['RTE_MAX_LCORE', 4],
>  	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false]]
> +	['RTE_LIBRTE_VHOST_NUMA', false]
> +]
>  flags_thunderx_extra = [
>  	['RTE_MACHINE', '"thunderx"'],
> -	['RTE_USE_C11_MEM_MODEL', false]]
> +	['RTE_USE_C11_MEM_MODEL', false]
> +]
>  flags_thunderx2_extra = [
>  	['RTE_MACHINE', '"thunderx2"'],
>  	['RTE_CACHE_LINE_SIZE', 64],
>  	['RTE_MAX_NUMA_NODES', 2],
>  	['RTE_MAX_LCORE', 256],
>  	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true]]
> +	['RTE_USE_C11_MEM_MODEL', true]
> +]
>  flags_octeontx2_extra = [
>  	['RTE_MACHINE', '"octeontx2"'],
>  	['RTE_MAX_NUMA_NODES', 1],
>  	['RTE_MAX_LCORE', 36],
>  	['RTE_ARM_FEATURE_ATOMICS', true],
>  	['RTE_EAL_IGB_UIO', false],
> -	['RTE_USE_C11_MEM_MODEL', true]]
> -
> -machine_args_default = [
> -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> -	['native', ['-march=native']],
> -	['0xd03', ['-mcpu=cortex-a53']],
> -	['0xd04', ['-mcpu=cortex-a35']],
> -	['0xd07', ['-mcpu=cortex-a57']],
> -	['0xd08', ['-mcpu=cortex-a72']],
> -	['0xd09', ['-mcpu=cortex-a73']],
> -	['0xd0a', ['-mcpu=cortex-a75']],
> -	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> flags_n1sdp_extra]]
> -
> -machine_args_cavium = [
> -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> -	['native', ['-march=native']],
> -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_thunderx2_extra],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_octeontx2_extra]]
> -
> -machine_args_emag = [
> -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]]
> +	['RTE_USE_C11_MEM_MODEL', true]
> +]
> +# arm config (implementer 0x41) is the default config pn_config_default
'pn' here for 'part_number' is not consistent.

> += {
> +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> +	'0xd03': [['-mcpu=cortex-a53']],
> +	'0xd04': [['-mcpu=cortex-a35']],
> +	'0xd07': [['-mcpu=cortex-a57']],
> +	'0xd08': [['-mcpu=cortex-a72']],
> +	'0xd09': [['-mcpu=cortex-a73']],
> +	'0xd0a': [['-mcpu=cortex-a75']],
> +	'0xd0b': [['-mcpu=cortex-a76']],
> +	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> +flags_n1sdp_extra] } pn_config_cavium = {
> +	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
> +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> +	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_thunderx2_extra],
> +	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> +flags_octeontx2_extra], } pn_config_emag = {
> +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> 
>  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
> -impl_generic = ['Generic armv8', flags_generic, machine_args_default]
> -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> -impl_0x49 = ['Infineon', flags_generic, machine_args_default] -impl_0x4d =
> ['Motorola', flags_generic, machine_args_default] -impl_0x4e = ['NVIDIA',
> flags_generic, machine_args_default]
> -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> -impl_0x69 = ['Intel', flags_generic, machine_args_default] -impl_dpaa =
> ['NXP DPAA', flags_dpaa, machine_args_default]
> +impl_generic = ['Generic armv8', flags_generic, pn_config_default]
> +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> +impl_0x49 = ['Infineon', flags_generic, pn_config_default] impl_0x4d =
> +['Motorola', flags_generic, pn_config_default] impl_0x4e = ['NVIDIA',
> +flags_generic, pn_config_default]
> +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> +impl_0x69 = ['Intel', flags_generic, pn_config_default] impl_dpaa =
> +['NXP DPAA', flags_dpaa, pn_config_default]
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> 
>  if dpdk_conf.get('RTE_ARCH_32')
> +	# armv7 build
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> +	# aarch64 build
> +	if not meson.is_cross_build()
> +		if machine == 'generic'
> +			# default build
> +			impl_config = impl_generic
> +			part_number = 'generic'
> +		else
> +			# native 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
> +			if arm_force_native_march == true
> +				part_number = 'native'
> +			else
> +				part_number = cmd_output[3]
> +			endif
> +			# Set to generic implementer if implementer is not
> found
> +			impl_config = get_variable('impl_' + cmd_output[0],
> 'impl_generic')
> +		endif
> +	else
> +		# cross build
> +		impl_id = meson.get_cross_property('implementer_id',
> 'generic')
> +		part_number = meson.get_cross_property('part_number',
> 'generic')
> +		impl_config = get_variable('impl_' + impl_id)
> +	endif
> 
> -	machine = []
> -	cmd_generic = ['generic', '', '', 'default', '']
> -	cmd_output = cmd_generic # Set generic by default
> -	machine_args = [] # Clear previous machine args
> -	if arm_force_generic_march and not meson.is_cross_build()
> -		machine = impl_generic
> -		impl_pn = 'default'
> +	message('Arm implementer: ' + impl_config[0])
> +	message('Arm part number: ' + part_number)
> +
> +	implementer_flags = impl_config[1]
> +	part_number_config = impl_config[2]
> +
> +	if part_number_config.has_key(part_number)
> +		# use the specified part_number machine args if found
> +		part_number_config = part_number_config[part_number]
> +	elif part_number == 'native'
> +		# use native machine args
> +		part_number_config = [[native_machine_args]]
>  	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
> +		# default to generic machine args if part_number is not found
> +		# and not forcing native machine args
> +		# but don't default in cross-builds; if part_number is specified
> +		# incorrectly in a cross-file, it needs to be fixed there
> +		part_number_config = part_number_config['generic']
>  	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)
> +		# cross build and part number is not in part_number_config
> +		error('Cross build part number 0@0 not
> found.'.format(part_number))
>  	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])
> +	dpdk_flags = flags_common_default + implementer_flags
> +
> +	if part_number_config.length() > 1
> +		dpdk_flags += part_number_config[1]
> +	endif
> +
> +	machine_args = [] # Clear previous machine args
> +	foreach flag: part_number_config[0]
> +		if cc.has_argument(flag)
> +			machine_args += flag
>  		endif
>  	endforeach
> 
> -	message('Implementer : ' + machine[0])
> -	foreach flag: machine[1]
> +	foreach flag: dpdk_flags
>  		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
>  endif
> -message(machine_args)
> +
> +message('Using machine args: @0@'.format(machine_args))
> 
>  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
>      cc.get_define('__aarch64__', args: machine_args) != '')
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic
  2020-10-27  3:53         ` Honnappa Nagarahalli
@ 2020-10-27  7:46           ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-27  7:46 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, October 27, 2020 4:54 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v4 1/6] build: alias default build as generic
> 
> <snip>
> 
> >
> > The current machine='default' build name is not descriptive. The
> > actual default build is machine='native'. Add an alternative string
> > which does the same build and better describes what we're building:
> > machine='generic'. Leave machine='default' for backwards compatibility.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/meson.build | 31 ++++++++++++++++---------------
> >  config/meson.build     |  6 +++---
> >  2 files changed, 19 insertions(+), 18 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > b49203fa8..491842cad 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -1,12 +1,13 @@
> >  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2017 Intel
> > Corporation.
> >  # Copyright(c) 2017 Cavium, Inc
> > +# Copyright(c) 2020 PANTHEON.tech s.r.o.
> >
> >  # for checking defines we need to use the correct compiler flags
> > march_opt = '-march=@0@'.format(machine)
> >
> >  arm_force_native_march = false
> > -arm_force_default_march = (machine == 'default')
> > +arm_force_generic_march = (machine == 'generic')
> >
> >  flags_common_default = [
> >  	# Accelarate rte_memcpy. Be sure to run unit test
> > (memcpy_perf_autotest) @@ -87,7 +88,7 @@ flags_octeontx2_extra = [
> >  	['RTE_EAL_IGB_UIO', false],
> >  	['RTE_USE_C11_MEM_MODEL', true]]
> >
> > -machine_args_generic = [
> > +machine_args_default = [
> Is this change required? 'machine_args_generic' aligns much better with
> 'machine == generic' (change in the file config/meson.build below)
> 

I thought a lot about the naming and I went back and forth on this before eventually settling on default instead of generic. My reasons are because machine_args_default doesn't just hold information about the build we're doing when machine='generic', but also non-generic information (and thus generic doesn't that well) and it is also used like you would use a default configuration - for implementers which don't have specific configuration.

In a later patch I renamed the "default" configuration of these machine_args to "generic" which is where the actual generic part of the configuration lies. Maybe I could've done that in this patch. Or maybe move this change to that patch - this seems better, since this change is not really needed for this patch and is more of a refactor.

> >  	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> >  	['native', ['-march=native']],
> >  	['0xd03', ['-mcpu=cortex-a53']],
> > @@ -113,20 +114,20 @@ machine_args_emag = [
> >  	['native', ['-march=native']]]
> >
> >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > G7-5321) -impl_generic = ['Generic armv8', flags_generic,
> > machine_args_generic]
> > -impl_0x41 = ['Arm', flags_arm, machine_args_generic]
> > -impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
> > +impl_generic = ['Generic armv8', flags_generic, machine_args_default]
> > +impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > +impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> >  impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > -impl_0x44 = ['DEC', flags_generic, machine_args_generic]
> > -impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
> > -impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
> > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
> > +impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > +impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > +impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > +impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> >  impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
> > -impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
> > -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
> > -impl_0x69 = ['Intel', flags_generic, machine_args_generic] -impl_dpaa
> > = ['NXP DPAA', flags_dpaa, machine_args_generic]
> > +impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > +impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > +impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> > +impl_0x69 = ['Intel', flags_generic, machine_args_default] impl_dpaa
> > += ['NXP DPAA', flags_dpaa, machine_args_default]
> >
> >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -145,7 +146,7 @@ else
> >  	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()
> > +	if arm_force_generic_march and not meson.is_cross_build()
> >  		machine = impl_generic
> >  		impl_pn = 'default'
> >  	elif not meson.is_cross_build()
> > diff --git a/config/meson.build b/config/meson.build index
> > 258b01d06..918ca2dfb 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -68,13 +68,13 @@ else
> >  	machine = get_option('machine')
> >  endif
> >
> > -# machine type 'default' is special, it defaults to the per arch
> > agreed common
> > +# machine type 'generic' is special, it defaults to the per arch
> > +agreed common
> >  # minimal baseline needed for DPDK.
> >  # That might not be the most optimized, but the most portable version
> > while # still being able to support the CPU features required for DPDK.
> >  # This can be bumped up by the DPDK project, but it can never be an
> > # invariant like 'native'
> Nit, may be it is worth mentioning that 'default' is allowed for backward
> compatibility?
> 

Ok, I'll add that.

> > -if machine == 'default'
> > +if machine == 'default' or machine == 'generic'
> >  	if host_machine.cpu_family().startswith('x86')
> >  		# matches the old pre-meson build systems default
> >  		machine = 'corei7'
> > @@ -82,7 +82,7 @@ if machine == 'default'
> >  		machine = 'armv7-a'
> >  	elif host_machine.cpu_family().startswith('aarch')
> >  		# arm64 manages defaults in config/arm/meson.build
> > -		machine = 'default'
> > +		machine = 'generic'
> >  	elif host_machine.cpu_family().startswith('ppc')
> >  		machine = 'power8'
> >  	endif
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 0/6] Arm build options rework
  2020-10-27  3:53       ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Honnappa Nagarahalli
@ 2020-10-27  7:50         ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-27  7:50 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, October 27, 2020 4:54 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v4 0/6] Arm build options rework
> 
> <snip>
> 
> >
> > The current way of specifying Arm configuration options is
> > insufficient since we can't identify the SoC we're building for from
> > the MIDR information. For example, we can't distinguish between N1SDP,
> Graviton2 or Ampere Altra.
> >
> > Add a way to specify the cpu count and numa node count for cross builds.
> >
> > We also want to be able to disable which drivers (and possibly
> > libraries) are built without user input. This is useful when building:
> > 1. on an SoC that is slow and we want to build only what is necessary
> >   without the user having to check which libraries they have installed
> > 2. a cross build on a fast aarch64 machine but with target SoC which
> I assume cross building on x86 for a Arm target SoC does not need any
> additional changes.
> 

Here I mean cross build to mean using a cross-file, so in this respect the cross build would be the same on x86 and Arm.

> >   differs in capabilities or libraries.
> > This is achieved by specifying the drivers in cross files.
> >
> > Among libraries, only libnuma can be now disabled.
> >
> > Also add an optional way to discover cpu count a numa node count. Fix
> > - Dmax_lcores and -Dmax_numa_nodes for arm builds.
> >
> > v2:
> > Major rework of the whole series.
> >
> > v3:
> > Added numa and core count defaults for x86 default build.
> > Removed numa and core count defaults. Now requiring defaults to be
> > specified in a cross file or on the cmdline.
> > Added FreeBDS support for numa count discovery.
> >
> > v4:
> > Make automatic numa and cpu counts discovery optional.
> >
> > Juraj Linkeš (6):
> >   build: alias default build as generic
> >   build: refactor Arm build
> >   build: optional NUMA and cpu counts detection
> >   build: add core and NUMA counts to cross files
> >   build: disable Arm drivers
> >   build: update Arm builds with makefile flags
> >
> >  buildtools/get_cpu_count.py          |   7 +
> >  buildtools/get_numa_count.py         |  22 +++
> >  buildtools/meson.build               |   2 +
> >  config/arm/arm64_armada_linux_gcc    |   6 +-
> >  config/arm/arm64_armv8_linux_gcc     |  18 +-
> >  config/arm/arm64_bluefield_linux_gcc |   7 +-
> >  config/arm/arm64_dpaa_linux_gcc      |   5 +-
> >  config/arm/arm64_emag_linux_gcc      |   4 +-
> >  config/arm/arm64_n1sdp_linux_gcc     |   7 +-
> >  config/arm/arm64_octeontx2_linux_gcc |   7 +-
> >  config/arm/arm64_stingray_linux_gcc  |   7 +-
> >  config/arm/arm64_thunderx2_linux_gcc |   6 +-
> >  config/arm/arm64_thunderx_linux_gcc  |   4 +-
> >  config/arm/meson.build               | 278 ++++++++++++++++-----------
> >  config/meson.build                   |  54 +++++-
> >  drivers/meson.build                  |   6 +-
> >  meson.build                          |   1 +
> >  meson_options.txt                    |   8 +-
> >  18 files changed, 306 insertions(+), 143 deletions(-)  create mode
> > 100644 buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py
> >
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-27  4:56         ` Honnappa Nagarahalli
@ 2020-10-27  8:10           ` Juraj Linkeš
  2020-10-27  9:12             ` Juraj Linkeš
  2020-10-27 23:12             ` Honnappa Nagarahalli
  0 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-27  8:10 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, October 27, 2020 5:56 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v4 2/6] build: refactor Arm build
> 
> <snip>
> I think we need to split this further. Few suggestions below.
> 
> >
> > * Rename variables to have names that better describe what the
> > variables store
> This should be a separate commit.
> 
> > * Remove unused or superfluous variables
> Same here
> 
> > * Change a list to dictionary where key lookup is needed
> Same here
> 
> > * Add informatory comments in the code
> 
> > * Minor code restructure and reformatting
> Same for this
> 

Ok, hopefully I'll be able to separate these cleanly.

> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/arm64_armada_linux_gcc    |   2 +-
> >  config/arm/arm64_armv8_linux_gcc     |   8 +-
> >  config/arm/arm64_bluefield_linux_gcc |   4 +-
> >  config/arm/arm64_dpaa_linux_gcc      |   2 +-
> >  config/arm/arm64_emag_linux_gcc      |   2 +-
> >  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
> >  config/arm/arm64_octeontx2_linux_gcc |   4 +-
> >  config/arm/arm64_stingray_linux_gcc  |   4 +-
> >  config/arm/arm64_thunderx2_linux_gcc |   4 +-
> >  config/arm/arm64_thunderx_linux_gcc  |   2 +-
> >  config/arm/meson.build               | 247 +++++++++++++++------------
> >  11 files changed, 153 insertions(+), 130 deletions(-)
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/arm64_armada_linux_gcc
> > index fa40c0398..52c5f4476 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x56'
> > +implementer_id = '0x56'
> Implementor and implementer mean the same. Looked at Arm specs, they use
> 'implementer'. So, I am fine.
> 

That's where I got this and some of the other variable name changes from.

> > diff --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > index 88f0ff9da..13ee8b223 100644
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ b/config/arm/arm64_armv8_linux_gcc
> > @@ -13,10 +13,10 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = 'generic'
> > +implementer_id = 'generic'
> >
> > -# Valid options for Arm's implementor_pn:
> > -# 'default': valid for all armv8-a architectures (default value)
> > +# Valid options for Arm's part_number:
> > +# 'generic': valid for all armv8-a architectures (default value)
> >  # '0xd03':   cortex-a53
> >  # '0xd04':   cortex-a35
> >  # '0xd05':   cortex-a55
> > @@ -25,4 +25,4 @@ implementor_id = 'generic'
> >  # '0xd09':   cortex-a73
> >  # '0xd0a':   cortex-a75
> >  # '0xd0b':   cortex-a76
> > -implementor_pn = 'default'
> > +part_number = 'generic'
> Same here, Arm specs refer to this as 'PartNumber'. So, this should be fine.
> I like 'generic' for part_number here.
> 
> > diff --git a/config/arm/arm64_bluefield_linux_gcc
> > b/config/arm/arm64_bluefield_linux_gcc
> > index 86797d23c..b79389d85 100644
> > --- a/config/arm/arm64_bluefield_linux_gcc
> > +++ b/config/arm/arm64_bluefield_linux_gcc
> > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x41'
> > -implementor_pn = '0xd08'
> > +implementer_id = '0x41'
> > +part_number = '0xd08'
> > diff --git a/config/arm/arm64_dpaa_linux_gcc
> > b/config/arm/arm64_dpaa_linux_gcc index 1a4682154..573ae7e42 100644
> > --- a/config/arm/arm64_dpaa_linux_gcc
> > +++ b/config/arm/arm64_dpaa_linux_gcc
> > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = 'dpaa'
> > +implementer_id = 'dpaa'
> > diff --git a/config/arm/arm64_emag_linux_gcc
> > b/config/arm/arm64_emag_linux_gcc index 8edcd3e97..24f3d533e 100644
> > --- a/config/arm/arm64_emag_linux_gcc
> > +++ b/config/arm/arm64_emag_linux_gcc
> > @@ -13,4 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x50'
> > +implementer_id = '0x50'
> > diff --git a/config/arm/arm64_n1sdp_linux_gcc
> > b/config/arm/arm64_n1sdp_linux_gcc
> > index 022e06303..6fb3f02ea 100644
> > --- a/config/arm/arm64_n1sdp_linux_gcc
> > +++ b/config/arm/arm64_n1sdp_linux_gcc
> > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x41'
> > -implementor_pn = '0xd0c'
> > +implementer_id = '0x41'
> > +part_number = '0xd0c'
> > diff --git a/config/arm/arm64_octeontx2_linux_gcc
> > b/config/arm/arm64_octeontx2_linux_gcc
> > index 365bd7cbd..ac1042806 100644
> > --- a/config/arm/arm64_octeontx2_linux_gcc
> > +++ b/config/arm/arm64_octeontx2_linux_gcc
> > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x43'
> > -implementor_pn = '0xb2'
> > +implementer_id = '0x43'
> > +part_number = '0xb2'
> > diff --git a/config/arm/arm64_stingray_linux_gcc
> > b/config/arm/arm64_stingray_linux_gcc
> > index 86797d23c..b79389d85 100644
> > --- a/config/arm/arm64_stingray_linux_gcc
> > +++ b/config/arm/arm64_stingray_linux_gcc
> > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x41'
> > -implementor_pn = '0xd08'
> > +implementer_id = '0x41'
> > +part_number = '0xd08'
> > diff --git a/config/arm/arm64_thunderx2_linux_gcc
> > b/config/arm/arm64_thunderx2_linux_gcc
> > index 2b41acc61..dd257745e 100644
> > --- a/config/arm/arm64_thunderx2_linux_gcc
> > +++ b/config/arm/arm64_thunderx2_linux_gcc
> > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x43'
> > -implementor_pn = '0xaf'
> > +implementer_id = '0x43'
> > +part_number = '0xaf'
> > diff --git a/config/arm/arm64_thunderx_linux_gcc
> > b/config/arm/arm64_thunderx_linux_gcc
> > index 6572ab615..670764437 100644
> > --- a/config/arm/arm64_thunderx_linux_gcc
> > +++ b/config/arm/arm64_thunderx_linux_gcc
> > @@ -13,4 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x43'
> > +implementer_id = '0x43'
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 491842cad..6c31ab167 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -3,12 +3,12 @@
> >  # Copyright(c) 2017 Cavium, Inc
> >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> >
> > -# for checking defines we need to use the correct compiler flags
> > -march_opt = '-march=@0@'.format(machine)
> > -
> > +# set arm_force_native_march if you want to use machine args below #
> > +instead of discovered values; only works when doing an actual native
> > +build
> >  arm_force_native_march = false
> > -arm_force_generic_march = (machine == 'generic')
> > +native_machine_args = ['-march=native', '-mtune=native']
> >
> > +# common flags to all aarch64 builds, with lowest priority
> >  flags_common_default = [
> >  	# Accelarate rte_memcpy. Be sure to run unit test
> > (memcpy_perf_autotest)
> >  	# to determine the best threshold in code. Refer to notes in source
> > file @@ -16,8 +16,9 @@ flags_common_default = [
> >  	['RTE_ARCH_ARM64_MEMCPY', false],
> >  	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
> >  	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
> > -	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> > unless there're
> > -	# strong reasons.
> > +
> > +	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> > +	# unless there are strong reasons.
> >  	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
> >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > @@ -28,184 +29,206 @@ flags_common_default = [
> >
> >  	['RTE_SCHED_VECTOR', false],
> >  	['RTE_ARM_USE_WFE', false],
> > +	['RTE_CACHE_LINE_SIZE', 128],
> > +	['RTE_ARCH_ARM64', true]
> >  ]
> >
> > +# implementer specific aarch64 flags, with middle priority # (will
> > +overwrite common flags)
> >  flags_generic = [
> >  	['RTE_MACHINE', '"armv8a"'],
> >  	['RTE_MAX_LCORE', 256],
> >  	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 128]]
> > +	['RTE_CACHE_LINE_SIZE', 128]
> > +]
> Any particular reason for this change? (and similar changes below)
> 

The first bracket is split from the second bracket so I did the same for the last two brackets. It makes it more apparent which brackets are paired, it's more consistent and also in line with how flags_common_default is formatted.

> >  flags_arm = [
> >  	['RTE_MACHINE', '"armv8a"'],
> >  	['RTE_MAX_LCORE', 16],
> >  	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 64]]
> > +	['RTE_CACHE_LINE_SIZE', 64]
> > +]
> >  flags_cavium = [
> >  	['RTE_CACHE_LINE_SIZE', 128],
> >  	['RTE_MAX_NUMA_NODES', 2],
> >  	['RTE_MAX_LCORE', 96],
> > -	['RTE_MAX_VFIO_GROUPS', 128]]
> > +	['RTE_MAX_VFIO_GROUPS', 128]
> > +]
> >  flags_dpaa = [
> >  	['RTE_MACHINE', '"dpaa"'],
> >  	['RTE_USE_C11_MEM_MODEL', true],
> >  	['RTE_CACHE_LINE_SIZE', 64],
> >  	['RTE_MAX_NUMA_NODES', 1],
> >  	['RTE_MAX_LCORE', 16],
> > -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
> > +	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false] ]
> This is not needed
> 

Do you mean the space? It should be a line break. I'll check the exact characters, but I see this as adding a space in my local patch. Or do you mean the config option? It's set to true by default in config/meson.build and according to [1] it should be disabled.

[1] http://git.dpdk.org/dpdk/tree/config/defconfig_arm64-dpaa-linuxapp-gcc?h=v20.08

> >  flags_emag = [
> >  	['RTE_MACHINE', '"emag"'],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> >  	['RTE_MAX_NUMA_NODES', 1],
> > -	['RTE_MAX_LCORE', 32]]
> > +	['RTE_MAX_LCORE', 32],
> > +	['RTE_CACHE_LINE_SIZE', 64]
> > +]
> >  flags_armada = [
> >  	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> >  	['RTE_MAX_NUMA_NODES', 1],
> > -	['RTE_MAX_LCORE', 16]]
> > +	['RTE_MAX_LCORE', 16],
> > +	['RTE_CACHE_LINE_SIZE', 64]
> > +]
> Any reason for this change?
> 

The default (from flags_common_default) is 128 and I found here [0] that it should be set to 64 so I added it here. Should this also be in a separate patch (apart from those 4 already mention above)?

[0] http://git.dpdk.org/dpdk/tree/config/defconfig_arm64-armada-linuxapp-gcc?h=v20.08

> >
> > -flags_default_extra = []
> > +# part number specific aarch64 flags, with highest priority # (will
> > +overwrite both common and implementer specific flags)
> >  flags_n1sdp_extra = [
> >  	['RTE_MACHINE', '"n1sdp"'],
> >  	['RTE_MAX_NUMA_NODES', 1],
> >  	['RTE_MAX_LCORE', 4],
> >  	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > -	['RTE_LIBRTE_VHOST_NUMA', false]]
> > +	['RTE_LIBRTE_VHOST_NUMA', false]
> > +]
> >  flags_thunderx_extra = [
> >  	['RTE_MACHINE', '"thunderx"'],
> > -	['RTE_USE_C11_MEM_MODEL', false]]
> > +	['RTE_USE_C11_MEM_MODEL', false]
> > +]
> >  flags_thunderx2_extra = [
> >  	['RTE_MACHINE', '"thunderx2"'],
> >  	['RTE_CACHE_LINE_SIZE', 64],
> >  	['RTE_MAX_NUMA_NODES', 2],
> >  	['RTE_MAX_LCORE', 256],
> >  	['RTE_ARM_FEATURE_ATOMICS', true],
> > -	['RTE_USE_C11_MEM_MODEL', true]]
> > +	['RTE_USE_C11_MEM_MODEL', true]
> > +]
> >  flags_octeontx2_extra = [
> >  	['RTE_MACHINE', '"octeontx2"'],
> >  	['RTE_MAX_NUMA_NODES', 1],
> >  	['RTE_MAX_LCORE', 36],
> >  	['RTE_ARM_FEATURE_ATOMICS', true],
> >  	['RTE_EAL_IGB_UIO', false],
> > -	['RTE_USE_C11_MEM_MODEL', true]]
> > -
> > -machine_args_default = [
> > -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> > -	['native', ['-march=native']],
> > -	['0xd03', ['-mcpu=cortex-a53']],
> > -	['0xd04', ['-mcpu=cortex-a35']],
> > -	['0xd07', ['-mcpu=cortex-a57']],
> > -	['0xd08', ['-mcpu=cortex-a72']],
> > -	['0xd09', ['-mcpu=cortex-a73']],
> > -	['0xd0a', ['-mcpu=cortex-a75']],
> > -	['0xd0b', ['-mcpu=cortex-a76']],
> > -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > flags_n1sdp_extra]]
> > -
> > -machine_args_cavium = [
> > -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > -	['native', ['-march=native']],
> > -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> > -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> > -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > flags_thunderx2_extra],
> > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > flags_octeontx2_extra]]
> > -
> > -machine_args_emag = [
> > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > -	['native', ['-march=native']]]
> > +	['RTE_USE_C11_MEM_MODEL', true]
> > +]
> > +# arm config (implementer 0x41) is the default config
> > +pn_config_default
> 'pn' here for 'part_number' is not consistent.
> 

Ok, I can rename it to part_number_config_default. Same for the other two pn variables.

> > += {
> > +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> > +	'0xd03': [['-mcpu=cortex-a53']],
> > +	'0xd04': [['-mcpu=cortex-a35']],
> > +	'0xd07': [['-mcpu=cortex-a57']],
> > +	'0xd08': [['-mcpu=cortex-a72']],
> > +	'0xd09': [['-mcpu=cortex-a73']],
> > +	'0xd0a': [['-mcpu=cortex-a75']],
> > +	'0xd0b': [['-mcpu=cortex-a76']],
> > +	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > +flags_n1sdp_extra] } pn_config_cavium = {
> > +	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
> > +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> > +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> > +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> > +	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > flags_thunderx2_extra],
> > +	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > +flags_octeontx2_extra], } pn_config_emag = {
> > +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> >
> >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > G7-5321) -impl_generic = ['Generic armv8', flags_generic,
> > machine_args_default]
> > -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > -impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > -impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> > -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> > -impl_0x69 = ['Intel', flags_generic, machine_args_default] -impl_dpaa
> > = ['NXP DPAA', flags_dpaa, machine_args_default]
> > +impl_generic = ['Generic armv8', flags_generic, pn_config_default]
> > +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> > +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> > +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> > +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> > +impl_0x49 = ['Infineon', flags_generic, pn_config_default] impl_0x4d
> > += ['Motorola', flags_generic, pn_config_default] impl_0x4e =
> > +['NVIDIA', flags_generic, pn_config_default]
> > +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> > +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> > +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> > +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> > +impl_0x69 = ['Intel', flags_generic, pn_config_default] impl_dpaa =
> > +['NXP DPAA', flags_dpaa, pn_config_default]
> >
> >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> >
> >  if dpdk_conf.get('RTE_ARCH_32')
> > +	# armv7 build
> >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > +	# aarch64 build
> > +	if not meson.is_cross_build()
> > +		if machine == 'generic'
> > +			# default build
> > +			impl_config = impl_generic
> > +			part_number = 'generic'
> > +		else
> > +			# native 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
> > +			if arm_force_native_march == true
> > +				part_number = 'native'
> > +			else
> > +				part_number = cmd_output[3]
> > +			endif
> > +			# Set to generic implementer if implementer is not
> > found
> > +			impl_config = get_variable('impl_' + cmd_output[0],
> > 'impl_generic')
> > +		endif
> > +	else
> > +		# cross build
> > +		impl_id = meson.get_cross_property('implementer_id',
> > 'generic')
> > +		part_number = meson.get_cross_property('part_number',
> > 'generic')
> > +		impl_config = get_variable('impl_' + impl_id)
> > +	endif
> >
> > -	machine = []
> > -	cmd_generic = ['generic', '', '', 'default', '']
> > -	cmd_output = cmd_generic # Set generic by default
> > -	machine_args = [] # Clear previous machine args
> > -	if arm_force_generic_march and not meson.is_cross_build()
> > -		machine = impl_generic
> > -		impl_pn = 'default'
> > +	message('Arm implementer: ' + impl_config[0])
> > +	message('Arm part number: ' + part_number)
> > +
> > +	implementer_flags = impl_config[1]
> > +	part_number_config = impl_config[2]
> > +
> > +	if part_number_config.has_key(part_number)
> > +		# use the specified part_number machine args if found
> > +		part_number_config = part_number_config[part_number]
> > +	elif part_number == 'native'
> > +		# use native machine args
> > +		part_number_config = [[native_machine_args]]
> >  	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
> > +		# default to generic machine args if part_number is not found
> > +		# and not forcing native machine args
> > +		# but don't default in cross-builds; if part_number is specified
> > +		# incorrectly in a cross-file, it needs to be fixed there
> > +		part_number_config = part_number_config['generic']
> >  	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)
> > +		# cross build and part number is not in part_number_config
> > +		error('Cross build part number 0@0 not
> > found.'.format(part_number))
> >  	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])
> > +	dpdk_flags = flags_common_default + implementer_flags
> > +
> > +	if part_number_config.length() > 1
> > +		dpdk_flags += part_number_config[1]
> > +	endif
> > +
> > +	machine_args = [] # Clear previous machine args
> > +	foreach flag: part_number_config[0]
> > +		if cc.has_argument(flag)
> > +			machine_args += flag
> >  		endif
> >  	endforeach
> >
> > -	message('Implementer : ' + machine[0])
> > -	foreach flag: machine[1]
> > +	foreach flag: dpdk_flags
> >  		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
> >  endif
> > -message(machine_args)
> > +
> > +message('Using machine args: @0@'.format(machine_args))
> >
> >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> >      cc.get_define('__aarch64__', args: machine_args) != '')
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-27  8:10           ` Juraj Linkeš
@ 2020-10-27  9:12             ` Juraj Linkeš
  2020-10-27 23:17               ` Honnappa Nagarahalli
  2020-10-27 23:12             ` Honnappa Nagarahalli
  1 sibling, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-27  9:12 UTC (permalink / raw)
  To: Juraj Linkeš,
	Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Juraj Linkeš
> Sent: Tuesday, October 27, 2020 9:11 AM
> To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil
> Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
> 
> 
> 
> > -----Original Message-----
> > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Sent: Tuesday, October 27, 2020 5:56 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil
> > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com
> > Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > Subject: RE: [PATCH v4 2/6] build: refactor Arm build
> >
> > <snip>
> > I think we need to split this further. Few suggestions below.
> >
> > >
> > > * Rename variables to have names that better describe what the
> > > variables store
> > This should be a separate commit.
> >
> > > * Remove unused or superfluous variables
> > Same here
> >
> > > * Change a list to dictionary where key lookup is needed
> > Same here
> >
> > > * Add informatory comments in the code
> >
> > > * Minor code restructure and reformatting
> > Same for this
> >
> 
> Ok, hopefully I'll be able to separate these cleanly.
> 
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/arm64_armada_linux_gcc    |   2 +-
> > >  config/arm/arm64_armv8_linux_gcc     |   8 +-
> > >  config/arm/arm64_bluefield_linux_gcc |   4 +-
> > >  config/arm/arm64_dpaa_linux_gcc      |   2 +-
> > >  config/arm/arm64_emag_linux_gcc      |   2 +-
> > >  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
> > >  config/arm/arm64_octeontx2_linux_gcc |   4 +-
> > >  config/arm/arm64_stingray_linux_gcc  |   4 +-
> > >  config/arm/arm64_thunderx2_linux_gcc |   4 +-
> > >  config/arm/arm64_thunderx_linux_gcc  |   2 +-
> > >  config/arm/meson.build               | 247 +++++++++++++++------------
> > >  11 files changed, 153 insertions(+), 130 deletions(-)
> > >
> > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > b/config/arm/arm64_armada_linux_gcc
> > > index fa40c0398..52c5f4476 100644
> > > --- a/config/arm/arm64_armada_linux_gcc
> > > +++ b/config/arm/arm64_armada_linux_gcc
> > > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x56'
> > > +implementer_id = '0x56'
> > Implementor and implementer mean the same. Looked at Arm specs, they
> > use 'implementer'. So, I am fine.
> >
> 
> That's where I got this and some of the other variable name changes from.
> 
> > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > b/config/arm/arm64_armv8_linux_gcc
> > > index 88f0ff9da..13ee8b223 100644
> > > --- a/config/arm/arm64_armv8_linux_gcc
> > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > @@ -13,10 +13,10 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = 'generic'
> > > +implementer_id = 'generic'
> > >
> > > -# Valid options for Arm's implementor_pn:
> > > -# 'default': valid for all armv8-a architectures (default value)
> > > +# Valid options for Arm's part_number:
> > > +# 'generic': valid for all armv8-a architectures (default value)
> > >  # '0xd03':   cortex-a53
> > >  # '0xd04':   cortex-a35
> > >  # '0xd05':   cortex-a55
> > > @@ -25,4 +25,4 @@ implementor_id = 'generic'
> > >  # '0xd09':   cortex-a73
> > >  # '0xd0a':   cortex-a75
> > >  # '0xd0b':   cortex-a76
> > > -implementor_pn = 'default'
> > > +part_number = 'generic'
> > Same here, Arm specs refer to this as 'PartNumber'. So, this should be fine.
> > I like 'generic' for part_number here.
> >
> > > diff --git a/config/arm/arm64_bluefield_linux_gcc
> > > b/config/arm/arm64_bluefield_linux_gcc
> > > index 86797d23c..b79389d85 100644
> > > --- a/config/arm/arm64_bluefield_linux_gcc
> > > +++ b/config/arm/arm64_bluefield_linux_gcc
> > > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x41'
> > > -implementor_pn = '0xd08'
> > > +implementer_id = '0x41'
> > > +part_number = '0xd08'
> > > diff --git a/config/arm/arm64_dpaa_linux_gcc
> > > b/config/arm/arm64_dpaa_linux_gcc index 1a4682154..573ae7e42 100644
> > > --- a/config/arm/arm64_dpaa_linux_gcc
> > > +++ b/config/arm/arm64_dpaa_linux_gcc
> > > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = 'dpaa'
> > > +implementer_id = 'dpaa'
> > > diff --git a/config/arm/arm64_emag_linux_gcc
> > > b/config/arm/arm64_emag_linux_gcc index 8edcd3e97..24f3d533e 100644
> > > --- a/config/arm/arm64_emag_linux_gcc
> > > +++ b/config/arm/arm64_emag_linux_gcc
> > > @@ -13,4 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x50'
> > > +implementer_id = '0x50'
> > > diff --git a/config/arm/arm64_n1sdp_linux_gcc
> > > b/config/arm/arm64_n1sdp_linux_gcc
> > > index 022e06303..6fb3f02ea 100644
> > > --- a/config/arm/arm64_n1sdp_linux_gcc
> > > +++ b/config/arm/arm64_n1sdp_linux_gcc
> > > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x41'
> > > -implementor_pn = '0xd0c'
> > > +implementer_id = '0x41'
> > > +part_number = '0xd0c'
> > > diff --git a/config/arm/arm64_octeontx2_linux_gcc
> > > b/config/arm/arm64_octeontx2_linux_gcc
> > > index 365bd7cbd..ac1042806 100644
> > > --- a/config/arm/arm64_octeontx2_linux_gcc
> > > +++ b/config/arm/arm64_octeontx2_linux_gcc
> > > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x43'
> > > -implementor_pn = '0xb2'
> > > +implementer_id = '0x43'
> > > +part_number = '0xb2'
> > > diff --git a/config/arm/arm64_stingray_linux_gcc
> > > b/config/arm/arm64_stingray_linux_gcc
> > > index 86797d23c..b79389d85 100644
> > > --- a/config/arm/arm64_stingray_linux_gcc
> > > +++ b/config/arm/arm64_stingray_linux_gcc
> > > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x41'
> > > -implementor_pn = '0xd08'
> > > +implementer_id = '0x41'
> > > +part_number = '0xd08'
> > > diff --git a/config/arm/arm64_thunderx2_linux_gcc
> > > b/config/arm/arm64_thunderx2_linux_gcc
> > > index 2b41acc61..dd257745e 100644
> > > --- a/config/arm/arm64_thunderx2_linux_gcc
> > > +++ b/config/arm/arm64_thunderx2_linux_gcc
> > > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x43'
> > > -implementor_pn = '0xaf'
> > > +implementer_id = '0x43'
> > > +part_number = '0xaf'
> > > diff --git a/config/arm/arm64_thunderx_linux_gcc
> > > b/config/arm/arm64_thunderx_linux_gcc
> > > index 6572ab615..670764437 100644
> > > --- a/config/arm/arm64_thunderx_linux_gcc
> > > +++ b/config/arm/arm64_thunderx_linux_gcc
> > > @@ -13,4 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x43'
> > > +implementer_id = '0x43'
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 491842cad..6c31ab167 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -3,12 +3,12 @@
> > >  # Copyright(c) 2017 Cavium, Inc
> > >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> > >
> > > -# for checking defines we need to use the correct compiler flags
> > > -march_opt = '-march=@0@'.format(machine)
> > > -
> > > +# set arm_force_native_march if you want to use machine args below
> > > +# instead of discovered values; only works when doing an actual
> > > +native build
> > >  arm_force_native_march = false
> > > -arm_force_generic_march = (machine == 'generic')
> > > +native_machine_args = ['-march=native', '-mtune=native']
> > >
> > > +# common flags to all aarch64 builds, with lowest priority
> > >  flags_common_default = [
> > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > (memcpy_perf_autotest)
> > >  	# to determine the best threshold in code. Refer to notes in
> > > source file @@ -16,8 +16,9 @@ flags_common_default = [
> > >  	['RTE_ARCH_ARM64_MEMCPY', false],
> > >  	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
> > >  	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
> > > -	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> > > unless there're
> > > -	# strong reasons.
> > > +
> > > +	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> > > +	# unless there are strong reasons.
> > >  	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
> > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > @@ -28,184 +29,206 @@ flags_common_default = [
> > >
> > >  	['RTE_SCHED_VECTOR', false],
> > >  	['RTE_ARM_USE_WFE', false],
> > > +	['RTE_CACHE_LINE_SIZE', 128],
> > > +	['RTE_ARCH_ARM64', true]
> > >  ]
> > >
> > > +# implementer specific aarch64 flags, with middle priority # (will
> > > +overwrite common flags)
> > >  flags_generic = [
> > >  	['RTE_MACHINE', '"armv8a"'],
> > >  	['RTE_MAX_LCORE', 256],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 128]]
> > > +	['RTE_CACHE_LINE_SIZE', 128]
> > > +]
> > Any particular reason for this change? (and similar changes below)
> >
> 
> The first bracket is split from the second bracket so I did the same for the last
> two brackets. It makes it more apparent which brackets are paired, it's more
> consistent and also in line with how flags_common_default is formatted.
> 
> > >  flags_arm = [
> > >  	['RTE_MACHINE', '"armv8a"'],
> > >  	['RTE_MAX_LCORE', 16],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 64]]
> > > +	['RTE_CACHE_LINE_SIZE', 64]
> > > +]
> > >  flags_cavium = [
> > >  	['RTE_CACHE_LINE_SIZE', 128],
> > >  	['RTE_MAX_NUMA_NODES', 2],
> > >  	['RTE_MAX_LCORE', 96],
> > > -	['RTE_MAX_VFIO_GROUPS', 128]]
> > > +	['RTE_MAX_VFIO_GROUPS', 128]
> > > +]
> > >  flags_dpaa = [
> > >  	['RTE_MACHINE', '"dpaa"'],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > >  	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > >  	['RTE_MAX_LCORE', 16],
> > > -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
> > > +	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false] ]
> > This is not needed
> >
> 
> Do you mean the space? It should be a line break. I'll check the exact characters,
> but I see this as adding a space in my local patch. Or do you mean the config
> option? It's set to true by default in config/meson.build and according to [1] it
> should be disabled.
> 
> [1] http://git.dpdk.org/dpdk/tree/config/defconfig_arm64-dpaa-linuxapp-
> gcc?h=v20.08
> 
> > >  flags_emag = [
> > >  	['RTE_MACHINE', '"emag"'],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > > -	['RTE_MAX_LCORE', 32]]
> > > +	['RTE_MAX_LCORE', 32],
> > > +	['RTE_CACHE_LINE_SIZE', 64]
> > > +]
> > >  flags_armada = [
> > >  	['RTE_MACHINE', '"armv8a"'],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > > -	['RTE_MAX_LCORE', 16]]
> > > +	['RTE_MAX_LCORE', 16],
> > > +	['RTE_CACHE_LINE_SIZE', 64]
> > > +]
> > Any reason for this change?
> >
> 
> The default (from flags_common_default) is 128 and I found here [0] that it
> should be set to 64 so I added it here. Should this also be in a separate patch
> (apart from those 4 already mention above)?
> 
> [0] http://git.dpdk.org/dpdk/tree/config/defconfig_arm64-armada-linuxapp-
> gcc?h=v20.08
> 

Sorry, I overlooked that I just moved the config around. I don't remember why. I could see that I wanted to make the order consistent across the different flag group, but that is not the case even with these changes. I'll make it consistent when I split the patch.

> > >
> > > -flags_default_extra = []
> > > +# part number specific aarch64 flags, with highest priority # (will
> > > +overwrite both common and implementer specific flags)
> > >  flags_n1sdp_extra = [
> > >  	['RTE_MACHINE', '"n1sdp"'],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > >  	['RTE_MAX_LCORE', 4],
> > >  	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > > -	['RTE_LIBRTE_VHOST_NUMA', false]]
> > > +	['RTE_LIBRTE_VHOST_NUMA', false]
> > > +]
> > >  flags_thunderx_extra = [
> > >  	['RTE_MACHINE', '"thunderx"'],
> > > -	['RTE_USE_C11_MEM_MODEL', false]]
> > > +	['RTE_USE_C11_MEM_MODEL', false]
> > > +]
> > >  flags_thunderx2_extra = [
> > >  	['RTE_MACHINE', '"thunderx2"'],
> > >  	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_MAX_NUMA_NODES', 2],
> > >  	['RTE_MAX_LCORE', 256],
> > >  	['RTE_ARM_FEATURE_ATOMICS', true],
> > > -	['RTE_USE_C11_MEM_MODEL', true]]
> > > +	['RTE_USE_C11_MEM_MODEL', true]
> > > +]
> > >  flags_octeontx2_extra = [
> > >  	['RTE_MACHINE', '"octeontx2"'],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > >  	['RTE_MAX_LCORE', 36],
> > >  	['RTE_ARM_FEATURE_ATOMICS', true],
> > >  	['RTE_EAL_IGB_UIO', false],
> > > -	['RTE_USE_C11_MEM_MODEL', true]]
> > > -
> > > -machine_args_default = [
> > > -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> > > -	['native', ['-march=native']],
> > > -	['0xd03', ['-mcpu=cortex-a53']],
> > > -	['0xd04', ['-mcpu=cortex-a35']],
> > > -	['0xd07', ['-mcpu=cortex-a57']],
> > > -	['0xd08', ['-mcpu=cortex-a72']],
> > > -	['0xd09', ['-mcpu=cortex-a73']],
> > > -	['0xd0a', ['-mcpu=cortex-a75']],
> > > -	['0xd0b', ['-mcpu=cortex-a76']],
> > > -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > > flags_n1sdp_extra]]
> > > -
> > > -machine_args_cavium = [
> > > -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > > -	['native', ['-march=native']],
> > > -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > flags_thunderx2_extra],
> > > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > flags_octeontx2_extra]]
> > > -
> > > -machine_args_emag = [
> > > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > -	['native', ['-march=native']]]
> > > +	['RTE_USE_C11_MEM_MODEL', true]
> > > +]
> > > +# arm config (implementer 0x41) is the default config
> > > +pn_config_default
> > 'pn' here for 'part_number' is not consistent.
> >
> 
> Ok, I can rename it to part_number_config_default. Same for the other two pn
> variables.
> 
> > > += {
> > > +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> > > +	'0xd03': [['-mcpu=cortex-a53']],
> > > +	'0xd04': [['-mcpu=cortex-a35']],
> > > +	'0xd07': [['-mcpu=cortex-a57']],
> > > +	'0xd08': [['-mcpu=cortex-a72']],
> > > +	'0xd09': [['-mcpu=cortex-a73']],
> > > +	'0xd0a': [['-mcpu=cortex-a75']],
> > > +	'0xd0b': [['-mcpu=cortex-a76']],
> > > +	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > > +flags_n1sdp_extra] } pn_config_cavium = {
> > > +	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
> > > +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > +	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > flags_thunderx2_extra],
> > > +	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > +flags_octeontx2_extra], } pn_config_emag = {
> > > +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> > >
> > >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > > G7-5321) -impl_generic = ['Generic armv8', flags_generic,
> > > machine_args_default]
> > > -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > > -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> > > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > > -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > > -impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > > -impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> > > -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> > > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > > -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > > -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> > > -impl_0x69 = ['Intel', flags_generic, machine_args_default]
> > > -impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
> > > +impl_generic = ['Generic armv8', flags_generic, pn_config_default]
> > > +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> > > +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> > > +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> > > +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> > > +impl_0x49 = ['Infineon', flags_generic, pn_config_default]
> > > +impl_0x4d = ['Motorola', flags_generic, pn_config_default]
> > > +impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
> > > +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> > > +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> > > +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> > > +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> > > +impl_0x69 = ['Intel', flags_generic, pn_config_default] impl_dpaa =
> > > +['NXP DPAA', flags_dpaa, pn_config_default]
> > >
> > >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> > >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> > >
> > >  if dpdk_conf.get('RTE_ARCH_32')
> > > +	# armv7 build
> > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > > +	# aarch64 build
> > > +	if not meson.is_cross_build()
> > > +		if machine == 'generic'
> > > +			# default build
> > > +			impl_config = impl_generic
> > > +			part_number = 'generic'
> > > +		else
> > > +			# native 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
> > > +			if arm_force_native_march == true
> > > +				part_number = 'native'
> > > +			else
> > > +				part_number = cmd_output[3]
> > > +			endif
> > > +			# Set to generic implementer if implementer is not
> > > found
> > > +			impl_config = get_variable('impl_' + cmd_output[0],
> > > 'impl_generic')
> > > +		endif
> > > +	else
> > > +		# cross build
> > > +		impl_id = meson.get_cross_property('implementer_id',
> > > 'generic')
> > > +		part_number = meson.get_cross_property('part_number',
> > > 'generic')
> > > +		impl_config = get_variable('impl_' + impl_id)
> > > +	endif
> > >
> > > -	machine = []
> > > -	cmd_generic = ['generic', '', '', 'default', '']
> > > -	cmd_output = cmd_generic # Set generic by default
> > > -	machine_args = [] # Clear previous machine args
> > > -	if arm_force_generic_march and not meson.is_cross_build()
> > > -		machine = impl_generic
> > > -		impl_pn = 'default'
> > > +	message('Arm implementer: ' + impl_config[0])
> > > +	message('Arm part number: ' + part_number)
> > > +
> > > +	implementer_flags = impl_config[1]
> > > +	part_number_config = impl_config[2]
> > > +
> > > +	if part_number_config.has_key(part_number)
> > > +		# use the specified part_number machine args if found
> > > +		part_number_config = part_number_config[part_number]
> > > +	elif part_number == 'native'
> > > +		# use native machine args
> > > +		part_number_config = [[native_machine_args]]
> > >  	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
> > > +		# default to generic machine args if part_number is not found
> > > +		# and not forcing native machine args
> > > +		# but don't default in cross-builds; if part_number is specified
> > > +		# incorrectly in a cross-file, it needs to be fixed there
> > > +		part_number_config = part_number_config['generic']
> > >  	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)
> > > +		# cross build and part number is not in part_number_config
> > > +		error('Cross build part number 0@0 not
> > > found.'.format(part_number))
> > >  	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])
> > > +	dpdk_flags = flags_common_default + implementer_flags
> > > +
> > > +	if part_number_config.length() > 1
> > > +		dpdk_flags += part_number_config[1]
> > > +	endif
> > > +
> > > +	machine_args = [] # Clear previous machine args
> > > +	foreach flag: part_number_config[0]
> > > +		if cc.has_argument(flag)
> > > +			machine_args += flag
> > >  		endif
> > >  	endforeach
> > >
> > > -	message('Implementer : ' + machine[0])
> > > -	foreach flag: machine[1]
> > > +	foreach flag: dpdk_flags
> > >  		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
> > >  endif
> > > -message(machine_args)
> > > +
> > > +message('Using machine args: @0@'.format(machine_args))
> > >
> > >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > >      cc.get_define('__aarch64__', args: machine_args) != '')
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-23 10:07               ` Juraj Linkeš
@ 2020-10-27 10:30                 ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-10-27 10:30 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Fri, Oct 23, 2020 at 10:07:17AM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Wednesday, October 21, 2020 4:28 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu
> > counts detection
> > 
<snip>
> > What could possibly work is to set the defaults for these to "0" as done in your
> > patch, but thereafter have the resulting defaults set per-architecture, rather
> > than globally. That would allow x86 to tune things more for native-style builds,
> > while in all cases allowing user to override.
> > 
> > /Bruce
> 
> I'll change it so that per-arch (and for arm, per processor type) defaults are the defaults that will be used (when set to 0). I'd like to give users the option to use the discovery mechanism - I think we'll have to use another value with specific meaning and we can't use positive integers so I guess the best we can do is use -1 for this.
> 
Well, if you want, if the defaults are set per-architecture, is you could
use detection for the default values for the ARM builds if the build-type
is set to "native" and the max_cores etc. are set to zero. For x86 that is
almost certainly not what we want, so we'd use hard-coded values for those
but no reason other architectures all need to do the same.

/Bruce

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

* Re: [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-27 11:20         ` Bruce Richardson
  2020-10-27 15:50           ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-27 11:20 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Fri, Oct 23, 2020 at 04:48:05PM +0200, Juraj Linkeš wrote:
> Add an option to automatically discover the host's numa and cpu counts
> and use those values for a non cross-build.
> Give users the option to override the per-arch default values or values
> from cross files by specifying them on the command line with -Dmax_lcores
> and -Dmax_numa_nodes.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  buildtools/get_cpu_count.py  |  7 ++++++
>  buildtools/get_numa_count.py | 22 +++++++++++++++++
>  buildtools/meson.build       |  2 ++
>  config/meson.build           | 48 ++++++++++++++++++++++++++++++++++--
>  meson_options.txt            |  8 +++---
>  5 files changed, 81 insertions(+), 6 deletions(-)
>  create mode 100644 buildtools/get_cpu_count.py
>  create mode 100644 buildtools/get_numa_count.py
> 
> diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> new file mode 100644
> index 000000000..386f85f8b
> --- /dev/null
> +++ b/buildtools/get_cpu_count.py
> @@ -0,0 +1,7 @@
> +#!/usr/bin/python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import os
> +
> +print(os.cpu_count())
> diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
> new file mode 100644
> index 000000000..f0c49973a
> --- /dev/null
> +++ b/buildtools/get_numa_count.py
> @@ -0,0 +1,22 @@
> +#!/usr/bin/python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import ctypes
> +import glob
> +import os
> +import subprocess
> +
> +if os.name == 'posix':
> +    if os.path.isdir('/sys/devices/system/node'):
> +        print(len(glob.glob('/sys/devices/system/node/node*')))
> +    else:
> +        print(subprocess.run(['sysctl', 'vm.ndomains'], capture_output=True).stdout)

I think you can shorten this, by just calling subprocess.run and not
capturing anything, in which case the stdout will be printed as normal.

	subprocess.run(['sysctl', 'vm.ndomains'])

> +
> +elif os.name == 'nt':
> +    libkernel32 = ctypes.windll.kernel32
> +
> +    count = ctypes.c_ulong()
> +
> +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> +    print(count.value + 1)
> diff --git a/buildtools/meson.build b/buildtools/meson.build
> index 04808dabc..925e733b1 100644
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> @@ -17,3 +17,5 @@ else
>  endif
>  map_to_win_cmd = py3 + files('map_to_win.py')
>  sphinx_wrapper = py3 + files('call-sphinx-build.py')
> +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> +get_numa_count_cmd = py3 + files('get_numa_count.py')
> diff --git a/config/meson.build b/config/meson.build
> index 918ca2dfb..5c6fdcc7d 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -230,8 +230,14 @@ foreach arg: warning_flags
>  endforeach
>  
>  # set other values pulled from the build options
> -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> +if not meson.is_cross_build()
> +	# set default values
> +	# these defaults may be overwritten by meson.build in an arch subdir
> +	# or later overwritten if a user specifies a value on the command line
> +	# or the user chooses to use values discovered from the build machine
> +	dpdk_conf.set('RTE_MAX_LCORE', 128)
> +	dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
> +endif

I think it might be better to remove this block, and instead set the values
below where you do the additional checks. It's confusing having these
settings managed in multiple places.

>  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
>  dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
>  dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
> @@ -250,6 +256,44 @@ compile_time_cpuflags = []
>  subdir(arch_subdir)
>  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
>  
> +max_lcores = get_option('max_lcores')
> +max_numa_nodes = get_option('max_numa_nodes')
> +if max_lcores > 0
> +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> +elif max_lcores == -1
> +	if not meson.is_cross_build()
> +		max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
> +		min_lcores = 2
> +		if max_lcores < min_lcores
> +			message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
> +			max_lcores = min_lcores
> +		else
> +			message('Found @0@ cores'.format(max_lcores))
> +		endif
> +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> +	endif
> +endif
> +
> +if max_numa_nodes > 0
> +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> +elif max_numa_nodes == -1
> +	if not meson.is_cross_build()
> +		max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
> +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> +	endif
> +endif
> +
> +# check that cpu and numa count is set in cross builds
> +if meson.is_cross_build()
> +	if not dpdk_conf.has('RTE_MAX_LCORE')
> +		error('Number of cores for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> +	endif
> +	if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> +		error('Number of numa nodes for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> +	endif
> +endif
> +

I think we need some comments explaining all the logic here, and probably
some documentation updates.

>  # set the install path for the drivers
>  dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
>  
> diff --git a/meson_options.txt b/meson_options.txt
> index 9bf18ab6b..a78c21b0d 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
>  	description: 'set the target machine type')
>  option('max_ethports', type: 'integer', value: 32,
>  	description: 'maximum number of Ethernet devices')
> -option('max_lcores', type: 'integer', value: 128,
> -	description: 'maximum number of cores/threads supported by EAL')
> -option('max_numa_nodes', type: 'integer', value: 4,
> -	description: 'maximum number of NUMA nodes supported by EAL')
> +option('max_lcores', type: 'integer', value: 0,
> +	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of cores on the build machine.')
> +option('max_numa_nodes', type: 'integer', value: 0,
> +	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of numa nodes on the build machine.')
>  option('enable_trace_fp', type: 'boolean', value: false,
>  	description: 'enable fast path trace points.')
>  option('tests', type: 'boolean', value: true,
> -- 
> 2.20.1
> 

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

* Re: [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection
  2020-10-27 11:20         ` Bruce Richardson
@ 2020-10-27 15:50           ` Juraj Linkeš
  2020-10-27 16:04             ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-27 15:50 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, October 27, 2020 12:21 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [PATCH v4 3/6] build: optional NUMA and cpu counts detection
> 
> On Fri, Oct 23, 2020 at 04:48:05PM +0200, Juraj Linkeš wrote:
> > Add an option to automatically discover the host's numa and cpu counts
> > and use those values for a non cross-build.
> > Give users the option to override the per-arch default values or
> > values from cross files by specifying them on the command line with
> > -Dmax_lcores and -Dmax_numa_nodes.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  buildtools/get_cpu_count.py  |  7 ++++++
> > buildtools/get_numa_count.py | 22 +++++++++++++++++
> >  buildtools/meson.build       |  2 ++
> >  config/meson.build           | 48 ++++++++++++++++++++++++++++++++++--
> >  meson_options.txt            |  8 +++---
> >  5 files changed, 81 insertions(+), 6 deletions(-)  create mode 100644
> > buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py
> >
> > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > new file mode 100644 index 000000000..386f85f8b
> > --- /dev/null
> > +++ b/buildtools/get_cpu_count.py
> > @@ -0,0 +1,7 @@
> > +#!/usr/bin/python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import os
> > +
> > +print(os.cpu_count())
> > diff --git a/buildtools/get_numa_count.py
> > b/buildtools/get_numa_count.py new file mode 100644 index
> > 000000000..f0c49973a
> > --- /dev/null
> > +++ b/buildtools/get_numa_count.py
> > @@ -0,0 +1,22 @@
> > +#!/usr/bin/python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import ctypes
> > +import glob
> > +import os
> > +import subprocess
> > +
> > +if os.name == 'posix':
> > +    if os.path.isdir('/sys/devices/system/node'):
> > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > +    else:
> > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > +capture_output=True).stdout)
> 
> I think you can shorten this, by just calling subprocess.run and not capturing
> anything, in which case the stdout will be printed as normal.
> 
> 	subprocess.run(['sysctl', 'vm.ndomains'])
> 

This will also print out the resulting object (e.g. CompletedProcess(args=['ls', '-ls', '/sys/devices/system/node'], returncode=0)), but an assignment will take care of that. I'll make the change.

> > +
> > +elif os.name == 'nt':
> > +    libkernel32 = ctypes.windll.kernel32
> > +
> > +    count = ctypes.c_ulong()
> > +
> > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > +    print(count.value + 1)
> > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > 04808dabc..925e733b1 100644
> > --- a/buildtools/meson.build
> > +++ b/buildtools/meson.build
> > @@ -17,3 +17,5 @@ else
> >  endif
> >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> > files('call-sphinx-build.py')
> > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > diff --git a/config/meson.build b/config/meson.build index
> > 918ca2dfb..5c6fdcc7d 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -230,8 +230,14 @@ foreach arg: warning_flags  endforeach
> >
> >  # set other values pulled from the build options
> > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > +if not meson.is_cross_build()
> > +	# set default values
> > +	# these defaults may be overwritten by meson.build in an arch subdir
> > +	# or later overwritten if a user specifies a value on the command line
> > +	# or the user chooses to use values discovered from the build machine
> > +	dpdk_conf.set('RTE_MAX_LCORE', 128)
> > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', 4) endif
> 
> I think it might be better to remove this block, and instead set the values below
> where you do the additional checks. It's confusing having these settings
> managed in multiple places.
> 

It needs to be set before subdir(arch_subdir) which is why it's here.

The order goes like this:
Global defaults (or x86 defaults)
arch_subdir defaults overwrite those (or non-x86 defaults)
cmdline options or optional discovery overwrite those

What about I move these to config/x86/meson.build? It looks like the place where per-arch defaults should be. Then we'd only have the second part after arch_subdir.

> >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@
> > -250,6 +256,44 @@ compile_time_cpuflags = []
> >  subdir(arch_subdir)
> >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > ','.join(compile_time_cpuflags))
> >
> > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > +get_option('max_numa_nodes') if max_lcores > 0
> > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores) elif max_lcores == -1
> > +	if not meson.is_cross_build()
> > +		max_lcores =
> run_command(get_cpu_count_cmd).stdout().to_int()
> > +		min_lcores = 2
> > +		if max_lcores < min_lcores
> > +			message('Found less than @0@ cores, building for
> @0@ cores'.format(min_lcores))
> > +			max_lcores = min_lcores
> > +		else
> > +			message('Found @0@ cores'.format(max_lcores))
> > +		endif
> > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > +	endif
> > +endif
> > +
> > +if max_numa_nodes > 0
> > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) elif
> > +max_numa_nodes == -1
> > +	if not meson.is_cross_build()
> > +		max_numa_nodes =
> run_command(get_numa_count_cmd).stdout().to_int()
> > +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> > +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> > +	endif
> > +endif
> > +
> > +# check that cpu and numa count is set in cross builds if
> > +meson.is_cross_build()
> > +	if not dpdk_conf.has('RTE_MAX_LCORE')
> > +		error('Number of cores for cross build not specified in @0@
> subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > +	endif
> > +	if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > +		error('Number of numa nodes for cross build not specified in
> @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > +	endif
> > +endif
> > +
> 
> I think we need some comments explaining all the logic here, and probably some
> documentation updates.
> 

Will add comments. Where is this documented?

> >  # set the install path for the drivers
> > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> >
> > diff --git a/meson_options.txt b/meson_options.txt index
> > 9bf18ab6b..a78c21b0d 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> >  	description: 'set the target machine type')  option('max_ethports',
> > type: 'integer', value: 32,
> >  	description: 'maximum number of Ethernet devices')
> > -option('max_lcores', type: 'integer', value: 128,
> > -	description: 'maximum number of cores/threads supported by EAL')
> > -option('max_numa_nodes', type: 'integer', value: 4,
> > -	description: 'maximum number of NUMA nodes supported by EAL')
> > +option('max_lcores', type: 'integer', value: 0,
> > +	description: 'maximum number of cores/threads supported by EAL. Set
> > +to positive integer to overwrite per-arch or cross-compilation defaults. Set to
> -1 to use number of cores on the build machine.') option('max_numa_nodes',
> type: 'integer', value: 0,
> > +	description: 'maximum number of NUMA nodes supported by EAL. Set to
> > +positive integer to overwrite per-arch or cross-compilation defaults.
> > +Set to -1 to use number of numa nodes on the build machine.')
> >  option('enable_trace_fp', type: 'boolean', value: false,
> >  	description: 'enable fast path trace points.')  option('tests',
> > type: 'boolean', value: true,
> > --
> > 2.20.1
> >


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

* Re: [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection
  2020-10-27 15:50           ` Juraj Linkeš
@ 2020-10-27 16:04             ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-10-27 16:04 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Tue, Oct 27, 2020 at 03:50:46PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Tuesday, October 27, 2020 12:21 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > Subject: Re: [PATCH v4 3/6] build: optional NUMA and cpu counts detection
> > 
> > On Fri, Oct 23, 2020 at 04:48:05PM +0200, Juraj Linkeš wrote:
> > > Add an option to automatically discover the host's numa and cpu counts
> > > and use those values for a non cross-build.
> > > Give users the option to override the per-arch default values or
> > > values from cross files by specifying them on the command line with
> > > -Dmax_lcores and -Dmax_numa_nodes.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  buildtools/get_cpu_count.py  |  7 ++++++
> > > buildtools/get_numa_count.py | 22 +++++++++++++++++
> > >  buildtools/meson.build       |  2 ++
> > >  config/meson.build           | 48 ++++++++++++++++++++++++++++++++++--
> > >  meson_options.txt            |  8 +++---
> > >  5 files changed, 81 insertions(+), 6 deletions(-)  create mode 100644
> > > buildtools/get_cpu_count.py  create mode 100644
> > > buildtools/get_numa_count.py
> > >
> > > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > > new file mode 100644 index 000000000..386f85f8b
> > > --- /dev/null
> > > +++ b/buildtools/get_cpu_count.py
> > > @@ -0,0 +1,7 @@
> > > +#!/usr/bin/python3
> > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > +PANTHEON.tech s.r.o.
> > > +
> > > +import os
> > > +
> > > +print(os.cpu_count())
> > > diff --git a/buildtools/get_numa_count.py
> > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > 000000000..f0c49973a
> > > --- /dev/null
> > > +++ b/buildtools/get_numa_count.py
> > > @@ -0,0 +1,22 @@
> > > +#!/usr/bin/python3
> > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > +PANTHEON.tech s.r.o.
> > > +
> > > +import ctypes
> > > +import glob
> > > +import os
> > > +import subprocess
> > > +
> > > +if os.name == 'posix':
> > > +    if os.path.isdir('/sys/devices/system/node'):
> > > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > > +    else:
> > > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > > +capture_output=True).stdout)
> > 
> > I think you can shorten this, by just calling subprocess.run and not capturing
> > anything, in which case the stdout will be printed as normal.
> > 
> > 	subprocess.run(['sysctl', 'vm.ndomains'])
> > 
> 
> This will also print out the resulting object (e.g. CompletedProcess(args=['ls', '-ls', '/sys/devices/system/node'], returncode=0)), but an assignment will take care of that. I'll make the change.
> 

Not unless you are running interactively in the python3 REPL.
For example:

$ cat test_meminfo.py
#! /usr/bin/env python3

from subprocess import run
run(['cat', '/proc/meminfo'])

$ python3 test_meminfo.py | tail -n 5
Hugepagesize:       2048 kB
Hugetlb:        17825792 kB
DirectMap4k:     1056788 kB
DirectMap2M:     9758720 kB
DirectMap1G:    88080384 kB

$

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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-27  8:10           ` Juraj Linkeš
  2020-10-27  9:12             ` Juraj Linkeš
@ 2020-10-27 23:12             ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-27 23:12 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> > I think we need to split this further. Few suggestions below.
> >
> > >
> > > * Rename variables to have names that better describe what the
> > > variables store
> > This should be a separate commit.
> >
> > > * Remove unused or superfluous variables
> > Same here
> >
> > > * Change a list to dictionary where key lookup is needed
> > Same here
> >
> > > * Add informatory comments in the code
> >
> > > * Minor code restructure and reformatting
> > Same for this
> >
> 
> Ok, hopefully I'll be able to separate these cleanly.
> 
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/arm64_armada_linux_gcc    |   2 +-
> > >  config/arm/arm64_armv8_linux_gcc     |   8 +-
> > >  config/arm/arm64_bluefield_linux_gcc |   4 +-
> > >  config/arm/arm64_dpaa_linux_gcc      |   2 +-
> > >  config/arm/arm64_emag_linux_gcc      |   2 +-
> > >  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
> > >  config/arm/arm64_octeontx2_linux_gcc |   4 +-
> > >  config/arm/arm64_stingray_linux_gcc  |   4 +-
> > >  config/arm/arm64_thunderx2_linux_gcc |   4 +-
> > >  config/arm/arm64_thunderx_linux_gcc  |   2 +-
> > >  config/arm/meson.build               | 247 +++++++++++++++------------
> > >  11 files changed, 153 insertions(+), 130 deletions(-)
> > >
> > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > b/config/arm/arm64_armada_linux_gcc
> > > index fa40c0398..52c5f4476 100644
> > > --- a/config/arm/arm64_armada_linux_gcc
> > > +++ b/config/arm/arm64_armada_linux_gcc
> > > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x56'
> > > +implementer_id = '0x56'
> > Implementor and implementer mean the same. Looked at Arm specs, they
> > use 'implementer'. So, I am fine.
> >
> 
> That's where I got this and some of the other variable name changes from.
> 
> > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > b/config/arm/arm64_armv8_linux_gcc
> > > index 88f0ff9da..13ee8b223 100644
> > > --- a/config/arm/arm64_armv8_linux_gcc
> > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > @@ -13,10 +13,10 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = 'generic'
> > > +implementer_id = 'generic'
> > >
> > > -# Valid options for Arm's implementor_pn:
> > > -# 'default': valid for all armv8-a architectures (default value)
> > > +# Valid options for Arm's part_number:
> > > +# 'generic': valid for all armv8-a architectures (default value)
> > >  # '0xd03':   cortex-a53
> > >  # '0xd04':   cortex-a35
> > >  # '0xd05':   cortex-a55
> > > @@ -25,4 +25,4 @@ implementor_id = 'generic'
> > >  # '0xd09':   cortex-a73
> > >  # '0xd0a':   cortex-a75
> > >  # '0xd0b':   cortex-a76
> > > -implementor_pn = 'default'
> > > +part_number = 'generic'
> > Same here, Arm specs refer to this as 'PartNumber'. So, this should be fine.
> > I like 'generic' for part_number here.
> >
> > > diff --git a/config/arm/arm64_bluefield_linux_gcc
> > > b/config/arm/arm64_bluefield_linux_gcc
> > > index 86797d23c..b79389d85 100644
> > > --- a/config/arm/arm64_bluefield_linux_gcc
> > > +++ b/config/arm/arm64_bluefield_linux_gcc
> > > @@ -13,5 +13,5 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >

[...]

> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 491842cad..6c31ab167 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -3,12 +3,12 @@
> > >  # Copyright(c) 2017 Cavium, Inc
> > >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> > >
> > > -# for checking defines we need to use the correct compiler flags
> > > -march_opt = '-march=@0@'.format(machine)
> > > -

[...]

> > >
> > > +# implementer specific aarch64 flags, with middle priority # (will
> > > +overwrite common flags)
> > >  flags_generic = [
> > >  	['RTE_MACHINE', '"armv8a"'],
> > >  	['RTE_MAX_LCORE', 256],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 128]]
> > > +	['RTE_CACHE_LINE_SIZE', 128]
> > > +]
> > Any particular reason for this change? (and similar changes below)
> >
> 
> The first bracket is split from the second bracket so I did the same for the last
> two brackets. It makes it more apparent which brackets are paired, it's more
> consistent and also in line with how flags_common_default is formatted.
Ok

> 

[...]

> > >  flags_dpaa = [
> > >  	['RTE_MACHINE', '"dpaa"'],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > >  	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > >  	['RTE_MAX_LCORE', 16],
> > > -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
> > > +	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false] ]
> > This is not needed
> >
> 
> Do you mean the space? It should be a line break. I'll check the exact
I meant the space. I guess it needs to be on the next line.

> characters, but I see this as adding a space in my local patch. Or do you mean
> the config option? It's set to true by default in config/meson.build and
> according to [1] it should be disabled.
> 
> [1] http://git.dpdk.org/dpdk/tree/config/defconfig_arm64-dpaa-linuxapp-
> gcc?h=v20.08
> 
> > >  flags_emag = [
> > >  	['RTE_MACHINE', '"emag"'],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > > -	['RTE_MAX_LCORE', 32]]
> > > +	['RTE_MAX_LCORE', 32],
> > > +	['RTE_CACHE_LINE_SIZE', 64]
> > > +]
> > >  flags_armada = [
> > >  	['RTE_MACHINE', '"armv8a"'],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > > -	['RTE_MAX_LCORE', 16]]
> > > +	['RTE_MAX_LCORE', 16],
> > > +	['RTE_CACHE_LINE_SIZE', 64]
> > > +]
> > Any reason for this change?
> >
> 
> The default (from flags_common_default) is 128 and I found here [0] that it
> should be set to 64 so I added it here. Should this also be in a separate patch
> (apart from those 4 already mention above)?
The RTE_CACHE_LINE_SIZE is already set to 64 for 'flags_armada'. It looks like you have moved the line down.

> 
> [0] http://git.dpdk.org/dpdk/tree/config/defconfig_arm64-armada-
> linuxapp-gcc?h=v20.08
> 
> > >
> > > -flags_default_extra = []
> > > +# part number specific aarch64 flags, with highest priority # (will
> > > +overwrite both common and implementer specific flags)
> > >  flags_n1sdp_extra = [
> > >  	['RTE_MACHINE', '"n1sdp"'],
> > >  	['RTE_MAX_NUMA_NODES', 1],
> > >  	['RTE_MAX_LCORE', 4],
> > >  	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > > -	['RTE_LIBRTE_VHOST_NUMA', false]]
> > > +	['RTE_LIBRTE_VHOST_NUMA', false]
> > > +]

<snip>

> > > -
> > > -machine_args_emag = [
> > > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > -	['native', ['-march=native']]]
> > > +	['RTE_USE_C11_MEM_MODEL', true]
> > > +]
> > > +# arm config (implementer 0x41) is the default config
> > > +pn_config_default
> > 'pn' here for 'part_number' is not consistent.
> >
> 
> Ok, I can rename it to part_number_config_default. Same for the other two
> pn variables.
Ok
> 

<snip>

> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-27  9:12             ` Juraj Linkeš
@ 2020-10-27 23:17               ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-27 23:17 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > > >  flags_emag = [
> > > >  	['RTE_MACHINE', '"emag"'],
> > > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > >  	['RTE_MAX_NUMA_NODES', 1],
> > > > -	['RTE_MAX_LCORE', 32]]
> > > > +	['RTE_MAX_LCORE', 32],
> > > > +	['RTE_CACHE_LINE_SIZE', 64]
> > > > +]
> > > >  flags_armada = [
> > > >  	['RTE_MACHINE', '"armv8a"'],
> > > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > >  	['RTE_MAX_NUMA_NODES', 1],
> > > > -	['RTE_MAX_LCORE', 16]]
> > > > +	['RTE_MAX_LCORE', 16],
> > > > +	['RTE_CACHE_LINE_SIZE', 64]
> > > > +]
> > > Any reason for this change?
> > >
> >
> > The default (from flags_common_default) is 128 and I found here [0]
> > that it should be set to 64 so I added it here. Should this also be in
> > a separate patch (apart from those 4 already mention above)?
> >
> > [0]
> > http://git.dpdk.org/dpdk/tree/config/defconfig_arm64-armada-linuxapp-
> > gcc?h=v20.08
> >
> 
> Sorry, I overlooked that I just moved the config around. I don't remember
> why. I could see that I wanted to make the order consistent across the
> different flag group, but that is not the case even with these changes. I'll
> make it consistent when I split the patch.
Ok

<snip>

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

* [dpdk-dev] [PATCH v5 00/11] Arm build options rework
  2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
                         ` (6 preceding siblings ...)
  2020-10-27  3:53       ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Honnappa Nagarahalli
@ 2020-10-28 14:03       ` Juraj Linkeš
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 01/11] build: alias default build as generic Juraj Linkeš
                           ` (11 more replies)
  7 siblings, 12 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in cross files.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs must be done using
  cross-files
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

Juraj Linkeš (11):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: Arm reformat, comments, move config
  build: simplify how Arm flags are processed
  build: use dict in Arm part number config
  build: Arm generic and native build setup
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: update Arm builds with makefile flags

 buildtools/get_cpu_count.py          |   7 +
 buildtools/get_numa_count.py         |  22 ++
 buildtools/meson.build               |   2 +
 config/arm/arm64_armada_linux_gcc    |   6 +-
 config/arm/arm64_armv8_linux_gcc     |  18 +-
 config/arm/arm64_bluefield_linux_gcc |   7 +-
 config/arm/arm64_dpaa_linux_gcc      |   5 +-
 config/arm/arm64_emag_linux_gcc      |   4 +-
 config/arm/arm64_n1sdp_linux_gcc     |   7 +-
 config/arm/arm64_octeontx2_linux_gcc |   7 +-
 config/arm/arm64_stingray_linux_gcc  |   7 +-
 config/arm/arm64_thunderx2_linux_gcc |   6 +-
 config/arm/arm64_thunderx_linux_gcc  |   4 +-
 config/arm/meson.build               | 302 ++++++++++++++++-----------
 config/meson.build                   |  57 ++++-
 config/x86/meson.build               |   2 +
 drivers/meson.build                  |   6 +-
 meson.build                          |   1 +
 meson_options.txt                    |   8 +-
 19 files changed, 324 insertions(+), 154 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 01/11] build: alias default build as generic
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
@ 2020-10-28 14:03         ` Juraj Linkeš
  2020-10-28 14:43           ` Bruce Richardson
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 02/11] build: rename Arm build variables Juraj Linkeš
                           ` (10 subsequent siblings)
  11 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build | 5 +++--
 config/meson.build     | 9 +++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index b49203fa8..4fd32f0ca 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -145,7 +146,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..c7f7aa6e2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +83,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 02/11] build: rename Arm build variables
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 01/11] build: alias default build as generic Juraj Linkeš
@ 2020-10-28 14:03         ` Juraj Linkeš
  2020-11-02  6:50           ` Ruifeng Wang
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 03/11] build: remove unused or superfluous variables Juraj Linkeš
                           ` (9 subsequent siblings)
  11 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_default since the
variable contains more than just the generic machine args and is
referenced multiple times with the intended use as a default value.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |  2 +-
 config/arm/arm64_armv8_linux_gcc     |  8 ++--
 config/arm/arm64_bluefield_linux_gcc |  4 +-
 config/arm/arm64_dpaa_linux_gcc      |  2 +-
 config/arm/arm64_emag_linux_gcc      |  2 +-
 config/arm/arm64_n1sdp_linux_gcc     |  4 +-
 config/arm/arm64_octeontx2_linux_gcc |  4 +-
 config/arm/arm64_stingray_linux_gcc  |  4 +-
 config/arm/arm64_thunderx2_linux_gcc |  4 +-
 config/arm/arm64_thunderx_linux_gcc  |  2 +-
 config/arm/meson.build               | 72 ++++++++++++++--------------
 11 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4fd32f0ca..dacbb947b 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -88,8 +88,8 @@ flags_octeontx2_extra = [
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_default = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -100,8 +100,8 @@ machine_args_generic = [
 	['0xd0b', ['-mcpu=cortex-a76']],
 	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
 	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
 	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
@@ -109,25 +109,25 @@ machine_args_cavium = [
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
 	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
 
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_generic, part_number_config_default]
+implementer_0x41 = ['Arm', flags_arm, part_number_config_default]
+implementer_0x42 = ['Broadcom', flags_generic, part_number_config_default]
+implementer_0x43 = ['Cavium', flags_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_generic, part_number_config_default]
+implementer_0x49 = ['Infineon', flags_generic, part_number_config_default]
+implementer_0x4d = ['Motorola', flags_generic, part_number_config_default]
+implementer_0x4e = ['NVIDIA', flags_generic, part_number_config_default]
+implementer_0x50 = ['Ampere Computing', flags_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_generic, part_number_config_default]
+implementer_0x53 = ['Samsung', flags_generic, part_number_config_default]
+implementer_0x56 = ['Marvell ARMADA', flags_armada, part_number_config_default]
+implementer_0x69 = ['Intel', flags_generic, part_number_config_default]
+implementer_dpaa = ['NXP DPAA', flags_dpaa, part_number_config_default]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -142,13 +142,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -159,19 +159,19 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
@@ -182,15 +182,15 @@ else
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			foreach flag: marg[1]
 				if cc.has_argument(flag)
 					machine_args += flag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 03/11] build: remove unused or superfluous variables
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 01/11] build: alias default build as generic Juraj Linkeš
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 02/11] build: rename Arm build variables Juraj Linkeš
@ 2020-10-28 14:03         ` Juraj Linkeš
  2020-11-02  7:31           ` Ruifeng Wang
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 04/11] build: Arm reformat, comments, move config Juraj Linkeš
                           ` (8 subsequent siblings)
  11 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index dacbb947b..bd2acfc21 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -63,7 +59,6 @@ flags_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -142,11 +137,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -157,14 +150,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -197,7 +191,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_default_extra)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 04/11] build: Arm reformat, comments, move config
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (2 preceding siblings ...)
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 03/11] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-10-28 14:03         ` Juraj Linkeš
  2020-11-02  8:29           ` Ruifeng Wang
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 05/11] build: simplify how Arm flags are processed Juraj Linkeš
                           ` (7 subsequent siblings)
  11 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index bd2acfc21..c970c8803 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,6 +5,7 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
@@ -12,8 +13,8 @@ flags_common_default = [
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -24,65 +25,82 @@ flags_common_default = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific generic aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_n1sdp_extra = [
 	['RTE_MACHINE', '"n1sdp"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_LCORE', 4],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_thunderx_extra = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_thunderx2_extra = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_default = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -93,8 +111,8 @@ part_number_config_default = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
-
+	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -102,11 +120,12 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
 	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_generic, part_number_config_default]
@@ -128,15 +147,14 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
@@ -199,7 +217,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 05/11] build: simplify how Arm flags are processed
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (3 preceding siblings ...)
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 04/11] build: Arm reformat, comments, move config Juraj Linkeš
@ 2020-10-28 14:03         ` Juraj Linkeš
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 06/11] build: use dict in Arm part number config Juraj Linkeš
                           ` (6 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index c970c8803..133a0d7fd 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -186,34 +186,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_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('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common_default + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 06/11] build: use dict in Arm part number config
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (4 preceding siblings ...)
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 05/11] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-10-28 14:04         ` Juraj Linkeš
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 07/11] build: Arm generic and native build setup Juraj Linkeš
                           ` (5 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:04 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of iterating over all elements in the
list. Fallback to generic part number if the discovered part number is
unknown.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 133a0d7fd..2f89cb2a8 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -101,31 +101,31 @@ flags_octeontx2_extra = [
 ]
 
 # arm config (implementer 0x41) is the default config
-part_number_config_default = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+part_number_config_default = {
+	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
+	'native': [['-march=native']],
+	'0xd03': [['-mcpu=cortex-a53']],
+	'0xd04': [['-mcpu=cortex-a35']],
+	'0xd07': [['-mcpu=cortex-a57']],
+	'0xd08': [['-mcpu=cortex-a72']],
+	'0xd09': [['-mcpu=cortex-a73']],
+	'0xd0a': [['-mcpu=cortex-a75']],
+	'0xd0b': [['-mcpu=cortex-a76']],
+	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]
+}
+part_number_config_cavium = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
+	'native': [['-march=native']],
+	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
+	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
+	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
+	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
+	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra],
+}
+part_number_config_emag = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	'native': [['-march=native']]
+}
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_generic, part_number_config_default]
@@ -189,22 +189,33 @@ else
 	message('Arm implementer: ' + implementer_config[0])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config[2]
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
 	dpdk_flags = flags_common_default + implementer_config[1]
+	if part_number_config.length() > 1
+		# add extra flags from the part number
+		dpdk_flags += part_number_config[1]
+	endif
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config[0]
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 07/11] build: Arm generic and native build setup
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (5 preceding siblings ...)
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 06/11] build: use dict in Arm part number config Juraj Linkeš
@ 2020-10-28 14:04         ` Juraj Linkeš
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
                           ` (4 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:04 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Simplify the code. Define native machine args in one place since they're
the same regardless of which Arm environment we're building on.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 2f89cb2a8..1866ad961 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,7 +3,10 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# set arm_force_native_march if you want to use machine args below
+# instead of discovered values in native builds
 arm_force_native_march = false
+native_machine_args = ['-march=native', '-mtune=native']
 
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
@@ -103,7 +106,6 @@ flags_octeontx2_extra = [
 # arm config (implementer 0x41) is the default config
 part_number_config_default = {
 	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
-	'native': [['-march=native']],
 	'0xd03': [['-mcpu=cortex-a53']],
 	'0xd04': [['-mcpu=cortex-a35']],
 	'0xd07': [['-mcpu=cortex-a57']],
@@ -115,7 +117,6 @@ part_number_config_default = {
 }
 part_number_config_cavium = {
 	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
-	'native': [['-march=native']],
 	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
 	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
 	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
@@ -123,8 +124,7 @@ part_number_config_cavium = {
 	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra],
 }
 part_number_config_emag = {
-	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	'native': [['-march=native']]
+	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']]
 }
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
@@ -155,32 +155,35 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if machine == 'generic' and not meson.is_cross_build()
-		implementer_config = implementer_generic
-		part_number = 'generic'
-	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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic native build
 			implementer_config = implementer_generic
 			part_number = 'generic'
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+		else
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				implementer_id = 'generic'
+				part_number = 'generic'
+			endif
+			# Set to generic if implementer is not found
+			implementer_config = get_variable('implementer_' + implementer_id, implementer_generic)
+			if arm_force_native_march == true
+				part_number = 'native'
+			endif
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -193,6 +196,9 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
+	elif part_number == 'native'
+		# use native machine args
+		part_number_config = [[native_machine_args]]
 	elif not meson.is_cross_build()
 		# default to generic machine args if part_number is not found
 		# and not forcing native machine args
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 08/11] build: optional NUMA and cpu counts detection
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (6 preceding siblings ...)
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 07/11] build: Arm generic and native build setup Juraj Linkeš
@ 2020-10-28 14:04         ` Juraj Linkeš
  2020-10-28 15:04           ` Bruce Richardson
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 09/11] build: add core and NUMA counts to cross files Juraj Linkeš
                           ` (3 subsequent siblings)
  11 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:04 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 48 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 83 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..386f85f8b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..e7f3de6b0
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index c7f7aa6e2..a51000ab2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,8 +231,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -251,6 +249,52 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+max_numa_nodes = get_option('max_numa_nodes')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if not meson.is_cross_build()
+		# Discovery makes sense only for non-cross builds
+		max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+		min_lcores = 2
+		# DPDK must be build for at least 2 cores
+		if max_lcores < min_lcores
+			message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+			max_lcores = min_lcores
+		else
+			message('Found @0@ cores'.format(max_lcores))
+		endif
+		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+	endif
+endif
+
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if not meson.is_cross_build()
+		# Discovery makes sense only for non-cross builds
+		max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+		message('Found @0@ numa nodes'.format(max_numa_nodes))
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+	endif
+endif
+
+# check that cpu and numa count is set in cross builds
+# and error out if it's not set
+if meson.is_cross_build()
+	if not dpdk_conf.has('RTE_MAX_LCORE')
+		error('Number of cores for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
+	endif
+	if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+		error('Number of numa nodes for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
+	endif
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..a78c21b0d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 09/11] build: add core and NUMA counts to cross files
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (7 preceding siblings ...)
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-28 14:04         ` Juraj Linkeš
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 10/11] build: disable Arm drivers Juraj Linkeš
                           ` (2 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:04 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |  2 ++
 config/arm/arm64_armv8_linux_gcc     |  6 ++++++
 config/arm/arm64_bluefield_linux_gcc |  2 ++
 config/arm/arm64_dpaa_linux_gcc      |  2 ++
 config/arm/arm64_emag_linux_gcc      |  2 ++
 config/arm/arm64_n1sdp_linux_gcc     |  2 ++
 config/arm/arm64_octeontx2_linux_gcc |  2 ++
 config/arm/arm64_stingray_linux_gcc  |  2 ++
 config/arm/arm64_thunderx2_linux_gcc |  2 ++
 config/arm/arm64_thunderx_linux_gcc  |  2 ++
 config/arm/meson.build               | 24 ++++++++++++++++++++++--
 11 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..36100c594 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..779333199 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -26,3 +26,9 @@ implementer_id = 'generic'
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
 part_number = 'generic'
+
+# Supported extra configuration
+# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+# max_lcores = n      # will set RTE_MAX_LCORE
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..adae86f57 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..3cccca901 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+max_numa_nodes = 1
+max_lcores = 32
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..3a8b46812 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_numa_nodes = 1
+max_lcores = 4
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..2baf95a2a 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_numa_nodes = 1
+max_lcores = 36
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..07440fe5f 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_numa_nodes = 2
+max_lcores = 256
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 670764437..16ba78fd6 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -14,3 +14,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+max_numa_nodes = 1
+max_lcores = 96
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 1866ad961..7a4d85e9f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -38,13 +38,15 @@ flags_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
+	['RTE_MAX_LCORE', 256],
+	['RTE_MAX_NUMA_NODES', 4]
 ]
 flags_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
 ]
 flags_cavium = [
 	['RTE_MAX_VFIO_GROUPS', 128],
@@ -217,6 +219,24 @@ else
 		dpdk_flags += part_number_config[1]
 	endif
 
+	# apply cross-specific options
+	if meson.is_cross_build()
+		# configure RTE_MAX_NUMA_NODES and RTE_MAX_LCORE from cross file
+		cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+		if cross_max_numa_nodes != 0
+			dpdk_flags += [
+				['RTE_MAX_NUMA_NODES', cross_max_numa_nodes]
+			]
+		endif
+		cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+		if cross_max_lcores != 0
+			message('Setting RTE_MAX_LCORE from cross file')
+			dpdk_flags += [
+				['RTE_MAX_LCORE', cross_max_lcores]
+			]
+		endif
+	endif
+
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
 	foreach flag: part_number_config[0]
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 10/11] build: disable Arm drivers
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (8 preceding siblings ...)
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 09/11] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-10-28 14:04         ` Juraj Linkeš
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags Juraj Linkeš
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:04 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/meson.build | 9 +++++----
 drivers/meson.build    | 2 +-
 meson.build            | 1 +
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7a4d85e9f..21deb2dd9 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,6 +8,11 @@
 arm_force_native_march = false
 native_machine_args = ['-march=native', '-mtune=native']
 
+# RFC: do we want these drivers to be disabled by default on arm?
+# The previous way to disable these drivers never worked
+# RTE_NET_AVP and the rest would be overwritten to true if the necessary deps were found
+disabled_drivers += ['net/avp', 'net/fm10k', 'net/sfc']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -22,10 +27,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_SFC_EFX', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..4c4866866 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,7 +18,7 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
 default_cflags = machine_args
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (9 preceding siblings ...)
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 10/11] build: disable Arm drivers Juraj Linkeš
@ 2020-10-28 14:04         ` Juraj Linkeš
  2020-10-28 15:08           ` Bruce Richardson
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
  11 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-28 14:04 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Not all flags were moved properly from the old Makefile build system.
Disable corresponding drivers and libnuma in cross files and remove
deprecated config.

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

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 36100c594..e33f1e742 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,5 @@ endian = 'little'
 implementer_id = '0x56'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 779333199..c6010e303 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -28,7 +28,11 @@ implementer_id = 'generic'
 part_number = 'generic'
 
 # Supported extra configuration
-# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-# max_lcores = n      # will set RTE_MAX_LCORE
+# max_numa_nodes = n   # will set RTE_MAX_NUMA_NODES
+# max_lcores = n        # will set RTE_MAX_LCORE
 max_lcores = 256
 max_numa_nodes = 4
+
+# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
+# disabled_drivers += ['bus/dpaa', 'crypto']
+    # add to the set of disabled libraries
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index adae86f57..78883a2ec 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = 'dpaa'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 3a8b46812..4493227f3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_numa_nodes = 1
 max_lcores = 4
+has_libnuma = 0
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 2baf95a2a..ff9e5c403 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_numa_nodes = 1
 max_lcores = 36
+has_libnuma = 0
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 21deb2dd9..a023abb17 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -101,7 +101,6 @@ flags_octeontx2_extra = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
 	['RTE_MAX_LCORE', 36],
 	['RTE_MAX_NUMA_NODES', 1]
 ]
@@ -236,6 +235,10 @@ else
 				['RTE_MAX_LCORE', cross_max_lcores]
 			]
 		endif
+		cross_has_libnuma = meson.get_cross_property('has_libnuma', '')
+		if cross_has_libnuma != ''
+			has_libnuma = cross_has_libnuma
+		endif
 	endif
 
 	# apply supported machine args
diff --git a/drivers/meson.build b/drivers/meson.build
index 4c4866866..a997387ad 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -21,6 +21,10 @@ subdirs = [
 disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v5 01/11] build: alias default build as generic
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 01/11] build: alias default build as generic Juraj Linkeš
@ 2020-10-28 14:43           ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-10-28 14:43 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 28, 2020 at 03:03:55PM +0100, Juraj Linkeš wrote:
> The current machine='default' build name is not descriptive. The actual
> default build is machine='native'. Add an alternative string which does
> the same build and better describes what we're building:
> machine='generic'. Leave machine='default' for backwards compatibility.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---

Looks good generally. Only suggestion is that the comment for the "machine"
value in meson_options.txt needs to be expanded and should describe
"generic" and "native" options.

Did you check for any documentation updates that may be needed for this?

>  config/arm/meson.build | 5 +++--
>  config/meson.build     | 9 +++++----
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index b49203fa8..4fd32f0ca 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -1,12 +1,13 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2017 Intel Corporation.
>  # Copyright(c) 2017 Cavium, Inc
> +# Copyright(c) 2020 PANTHEON.tech s.r.o.
>  
>  # for checking defines we need to use the correct compiler flags
>  march_opt = '-march=@0@'.format(machine)
>  
>  arm_force_native_march = false
> -arm_force_default_march = (machine == 'default')
> +arm_force_generic_march = (machine == 'generic')
>  
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
> @@ -145,7 +146,7 @@ else
>  	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()
> +	if arm_force_generic_march and not meson.is_cross_build()
>  		machine = impl_generic
>  		impl_pn = 'default'
>  	elif not meson.is_cross_build()
> diff --git a/config/meson.build b/config/meson.build
> index 258b01d06..c7f7aa6e2 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -68,13 +68,14 @@ else
>  	machine = get_option('machine')
>  endif
>  
> -# machine type 'default' is special, it defaults to the per arch agreed common
> -# minimal baseline needed for DPDK.
> +# machine type 'generic' is special, it defaults to the per arch agreed common
> +# minimal baseline needed for DPDK. Machine type 'default' is also supported
> +# with the same meaning for backwards compatibility.
>  # That might not be the most optimized, but the most portable version while
>  # still being able to support the CPU features required for DPDK.
>  # This can be bumped up by the DPDK project, but it can never be an
>  # invariant like 'native'
> -if machine == 'default'
> +if machine == 'default' or machine == 'generic'
>  	if host_machine.cpu_family().startswith('x86')
>  		# matches the old pre-meson build systems default
>  		machine = 'corei7'
> @@ -82,7 +83,7 @@ if machine == 'default'
>  		machine = 'armv7-a'
>  	elif host_machine.cpu_family().startswith('aarch')
>  		# arm64 manages defaults in config/arm/meson.build
> -		machine = 'default'
> +		machine = 'generic'
>  	elif host_machine.cpu_family().startswith('ppc')
>  		machine = 'power8'
>  	endif
> -- 
> 2.20.1
> 

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

* Re: [dpdk-dev] [PATCH v5 08/11] build: optional NUMA and cpu counts detection
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-10-28 15:04           ` Bruce Richardson
  2020-10-30 11:04             ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-28 15:04 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 28, 2020 at 03:04:02PM +0100, Juraj Linkeš wrote:
> Add an option to automatically discover the host's numa and cpu counts
> and use those values for a non cross-build.
> Give users the option to override the per-arch default values or values
> from cross files by specifying them on the command line with -Dmax_lcores
> and -Dmax_numa_nodes.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  buildtools/get_cpu_count.py  |  7 ++++++
>  buildtools/get_numa_count.py | 22 +++++++++++++++++
>  buildtools/meson.build       |  2 ++
>  config/meson.build           | 48 ++++++++++++++++++++++++++++++++++--
>  config/x86/meson.build       |  2 ++
>  meson_options.txt            |  8 +++---
>  6 files changed, 83 insertions(+), 6 deletions(-)
>  create mode 100644 buildtools/get_cpu_count.py
>  create mode 100644 buildtools/get_numa_count.py
> 
> diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> new file mode 100644
> index 000000000..386f85f8b
> --- /dev/null
> +++ b/buildtools/get_cpu_count.py
> @@ -0,0 +1,7 @@
> +#!/usr/bin/python3

I think for DPDK python scripts we standardized on "/usr/bin/env python3"
[Someone please correct me if I'm wrong here!]

> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import os
> +
> +print(os.cpu_count())
> diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
> new file mode 100644
> index 000000000..e7f3de6b0
> --- /dev/null
> +++ b/buildtools/get_numa_count.py
> @@ -0,0 +1,22 @@
> +#!/usr/bin/python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2020 PANTHEON.tech s.r.o.
> +
> +import ctypes
> +import glob
> +import os
> +import subprocess
> +
> +if os.name == 'posix':
> +    if os.path.isdir('/sys/devices/system/node'):
> +        print(len(glob.glob('/sys/devices/system/node/node*')))
> +    else:
> +        subprocess.run(['sysctl', 'vm.ndomains'])
> +

I just realised that by default sysctl outputs the name of the element as
well as the value, which is not what we want. Using "-n" flag suppresses
the name, so please add that to the command. [Sorry for not spotting this
in previous versions].

> +elif os.name == 'nt':
> +    libkernel32 = ctypes.windll.kernel32
> +
> +    count = ctypes.c_ulong()
> +
> +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> +    print(count.value + 1)
> diff --git a/buildtools/meson.build b/buildtools/meson.build
> index 04808dabc..925e733b1 100644
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> @@ -17,3 +17,5 @@ else
>  endif
>  map_to_win_cmd = py3 + files('map_to_win.py')
>  sphinx_wrapper = py3 + files('call-sphinx-build.py')
> +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> +get_numa_count_cmd = py3 + files('get_numa_count.py')
> diff --git a/config/meson.build b/config/meson.build
> index c7f7aa6e2..a51000ab2 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -231,8 +231,6 @@ foreach arg: warning_flags
>  endforeach
>  
>  # set other values pulled from the build options
> -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
>  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
>  dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
>  dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
> @@ -251,6 +249,52 @@ compile_time_cpuflags = []
>  subdir(arch_subdir)
>  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
>  
> +max_lcores = get_option('max_lcores')
> +max_numa_nodes = get_option('max_numa_nodes')
> +if max_lcores > 0
> +	# Overwrite the default value from arch_subdir with user input
> +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> +elif max_lcores == -1
> +	# Overwrite the default value with discovered values
> +	if not meson.is_cross_build()

I'd suggest changing this to the inverse and erroring out, since I assume
that having -1 for cross-compilation should be an error?

	if meson.is_cross_build()
		error('....')
	endif

Thereafter you save a level of indentation for the rest of the block.

> +		# Discovery makes sense only for non-cross builds
> +		max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
> +		min_lcores = 2
> +		# DPDK must be build for at least 2 cores

Even 2 seems rather low. I'd personally look to set the minimum at 4.

> +		if max_lcores < min_lcores
> +			message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
> +			max_lcores = min_lcores
> +		else
> +			message('Found @0@ cores'.format(max_lcores))
> +		endif
> +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> +	endif
> +endif
> +
> +if max_numa_nodes > 0
> +	# Overwrite the default value from arch_subdir with user input
> +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> +elif max_numa_nodes == -1
> +	# Overwrite the default value with discovered values
> +	if not meson.is_cross_build()
> +		# Discovery makes sense only for non-cross builds
> +		max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
> +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> +	endif
> +endif
> +
> +# check that cpu and numa count is set in cross builds
> +# and error out if it's not set
> +if meson.is_cross_build()
> +	if not dpdk_conf.has('RTE_MAX_LCORE')
> +		error('Number of cores for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> +	endif
> +	if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> +		error('Number of numa nodes for cross build not specified in @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> +	endif
> +endif
> +

Not sure you need the is_cross_build bit, since if we don't have
RTE_MAX_LCORES set at all, then it's an error too. It just so happens that
the code paths to this point prevent that from ever happening.

Is the intention here that the subdir meson.build files will just literally
take the value from the cross-file, or are you doing other processing in
the ARM case, e.g. to compute it based on other info. If it's just the
former where it's always read from the cross-files, I'd have the reading
done in this file (above the other assignment work), since it would be
architecture agnostic.

>  # set the install path for the drivers
>  dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
>  
<snip>

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

* Re: [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags Juraj Linkeš
@ 2020-10-28 15:08           ` Bruce Richardson
  2020-10-30 11:28             ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-10-28 15:08 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Wed, Oct 28, 2020 at 03:04:05PM +0100, Juraj Linkeš wrote:
> Not all flags were moved properly from the old Makefile build system.
> Disable corresponding drivers and libnuma in cross files and remove
> deprecated config.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armada_linux_gcc    | 2 ++
>  config/arm/arm64_armv8_linux_gcc     | 8 ++++++--
>  config/arm/arm64_bluefield_linux_gcc | 1 +
>  config/arm/arm64_dpaa_linux_gcc      | 1 +
>  config/arm/arm64_n1sdp_linux_gcc     | 1 +
>  config/arm/arm64_octeontx2_linux_gcc | 1 +
>  config/arm/arm64_stingray_linux_gcc  | 1 +
>  config/arm/meson.build               | 5 ++++-
>  drivers/meson.build                  | 4 ++++
>  9 files changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
> index 36100c594..e33f1e742 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -17,3 +17,5 @@ endian = 'little'
>  implementer_id = '0x56'
>  max_numa_nodes = 1
>  max_lcores = 16
> +has_libnuma = 0
> +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']

Changes to disabled drivers should be merged in the previous patch.

> diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
> index 779333199..c6010e303 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -28,7 +28,11 @@ implementer_id = 'generic'
>  part_number = 'generic'
>  
>  # Supported extra configuration
> -# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
> -# max_lcores = n      # will set RTE_MAX_LCORE
> +# max_numa_nodes = n   # will set RTE_MAX_NUMA_NODES
> +# max_lcores = n        # will set RTE_MAX_LCORE
>  max_lcores = 256
>  max_numa_nodes = 4
> +
> +# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
> +# disabled_drivers += ['bus/dpaa', 'crypto']
> +    # add to the set of disabled libraries
> diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
> index 7ff6fd309..e154ac4fd 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd08'
>  max_numa_nodes = 1
>  max_lcores = 16
> +has_libnuma = 0
> diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
> index adae86f57..78883a2ec 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -17,3 +17,4 @@ endian = 'little'
>  implementer_id = 'dpaa'
>  max_numa_nodes = 1
>  max_lcores = 16
> +has_libnuma = 0
> diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
> index 3a8b46812..4493227f3 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd0c'
>  max_numa_nodes = 1
>  max_lcores = 4
> +has_libnuma = 0
> diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
> index 2baf95a2a..ff9e5c403 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x43'
>  part_number = '0xb2'
>  max_numa_nodes = 1
>  max_lcores = 36
> +has_libnuma = 0
> diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
> index 7ff6fd309..e154ac4fd 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd08'
>  max_numa_nodes = 1
>  max_lcores = 16
> +has_libnuma = 0
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 21deb2dd9..a023abb17 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -101,7 +101,6 @@ flags_octeontx2_extra = [
>  	['RTE_MACHINE', '"octeontx2"'],
>  	['RTE_ARM_FEATURE_ATOMICS', true],
>  	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_IGB_UIO', false],
>  	['RTE_MAX_LCORE', 36],
>  	['RTE_MAX_NUMA_NODES', 1]
>  ]
> @@ -236,6 +235,10 @@ else
>  				['RTE_MAX_LCORE', cross_max_lcores]
>  			]
>  		endif
> +		cross_has_libnuma = meson.get_cross_property('has_libnuma', '')
> +		if cross_has_libnuma != ''
> +			has_libnuma = cross_has_libnuma
> +		endif
>  	endif
>  
>  	# apply supported machine args
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 4c4866866..a997387ad 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -21,6 +21,10 @@ subdirs = [
>  disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
>  		).stdout().split()
>  
> +if meson.is_cross_build()
> +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> +endif
> +

This change also belongs in the previous patch. However, because of the way
it's done here, I think the change to the disabled_drivers assignment in
the previous patch can be dropped, since assigning using "=" rather than
"+=" is fine when the cross-file addition is done later.

>  default_cflags = machine_args
>  default_cflags += ['-DALLOW_EXPERIMENTAL_API']
>  default_cflags += ['-DALLOW_INTERNAL_API']
> -- 
> 2.20.1
> 

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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build Juraj Linkeš
  2020-10-27  4:56         ` Honnappa Nagarahalli
@ 2020-10-28 16:59         ` Honnappa Nagarahalli
  2020-10-29  9:12           ` Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-28 16:59 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> * Rename variables to have names that better describe what the variables
> store
> * Remove unused or superfluous variables
> * Change a list to dictionary where key lookup is needed
> * Add informatory comments in the code
> * Minor code restructure and reformatting
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armada_linux_gcc    |   2 +-
>  config/arm/arm64_armv8_linux_gcc     |   8 +-
>  config/arm/arm64_bluefield_linux_gcc |   4 +-
>  config/arm/arm64_dpaa_linux_gcc      |   2 +-
>  config/arm/arm64_emag_linux_gcc      |   2 +-
>  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
>  config/arm/arm64_octeontx2_linux_gcc |   4 +-
>  config/arm/arm64_stingray_linux_gcc  |   4 +-
>  config/arm/arm64_thunderx2_linux_gcc |   4 +-
>  config/arm/arm64_thunderx_linux_gcc  |   2 +-
>  config/arm/meson.build               | 247 +++++++++++++++------------
>  11 files changed, 153 insertions(+), 130 deletions(-)
> 

<snip>

> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 491842cad..6c31ab167 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -3,12 +3,12 @@
>  # Copyright(c) 2017 Cavium, Inc
>  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
> -# for checking defines we need to use the correct compiler flags -march_opt
> = '-march=@0@'.format(machine)
> -
> +# set arm_force_native_march if you want to use machine args below #
> +instead of discovered values; only works when doing an actual native
> +build
>  arm_force_native_march = false
> -arm_force_generic_march = (machine == 'generic')
> +native_machine_args = ['-march=native', '-mtune=native']
> 

[...]

> -
> -machine_args_default = [
> -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> -	['native', ['-march=native']],
> -	['0xd03', ['-mcpu=cortex-a53']],
> -	['0xd04', ['-mcpu=cortex-a35']],
> -	['0xd07', ['-mcpu=cortex-a57']],
> -	['0xd08', ['-mcpu=cortex-a72']],
> -	['0xd09', ['-mcpu=cortex-a73']],
> -	['0xd0a', ['-mcpu=cortex-a75']],
> -	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> flags_n1sdp_extra]]
> -
> -machine_args_cavium = [
> -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> -	['native', ['-march=native']],
> -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_thunderx2_extra],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_octeontx2_extra]]
> -
> -machine_args_emag = [
> -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]]
> +	['RTE_USE_C11_MEM_MODEL', true]
> +]
> +# arm config (implementer 0x41) is the default config pn_config_default
What does it mean by 'default' here? I am somewhat confused between 'default' and 'generic'. We should look to remove 'default' as much as possible and stick with 'generic'.

> += {
> +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
I like that we have taken out 'native' from this list. Would it be possible to take out 'generic' from this and others below. This is because the binary built with 'generic' build should run on any Arm platform. There is no dependency on any underlying platform.

> +	'0xd03': [['-mcpu=cortex-a53']],
> +	'0xd04': [['-mcpu=cortex-a35']],
> +	'0xd07': [['-mcpu=cortex-a57']],
> +	'0xd08': [['-mcpu=cortex-a72']],
> +	'0xd09': [['-mcpu=cortex-a73']],
> +	'0xd0a': [['-mcpu=cortex-a75']],
> +	'0xd0b': [['-mcpu=cortex-a76']],
> +	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> +flags_n1sdp_extra]
'flags_n1sdp_extra' does not fit here. For the part number '0xd0c' there could be multiple SoCs (N1SDP is one of them). So, if the SoC is not known, but if we know that the CPU is N1, then we should build a N1-Generic build.
So, from my perspective, there are 3 kinds of binaries:
1) generic - best portability -  (possibly) least optimized for a given platform
2) Core-Generic (for ex: N1-generic) - Portable on all N1 based SoCs only - Optimized for N1 cores
3) SoC specific - (possibly) Not portable - Most optimized for the SoC

 } pn_config_cavium = {
> +	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
'generic' does not make sense here.

> +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> +	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_thunderx2_extra],
> +	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> +flags_octeontx2_extra], } pn_config_emag = {
> +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
Same here.
I understand that this is coming from the existing code. But, I think we should try to set it right.

> 
>  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
Nit, Would be good to remove the reference to the doc

> -impl_generic = ['Generic armv8', flags_generic, machine_args_default]
> -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> -impl_0x49 = ['Infineon', flags_generic, machine_args_default] -impl_0x4d =
> ['Motorola', flags_generic, machine_args_default] -impl_0x4e = ['NVIDIA',
> flags_generic, machine_args_default]
> -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> -impl_0x69 = ['Intel', flags_generic, machine_args_default] -impl_dpaa =
> ['NXP DPAA', flags_dpaa, machine_args_default]
> +impl_generic = ['Generic armv8', flags_generic, pn_config_default]
> +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> +impl_0x49 = ['Infineon', flags_generic, pn_config_default] impl_0x4d =
> +['Motorola', flags_generic, pn_config_default] impl_0x4e = ['NVIDIA',
> +flags_generic, pn_config_default]
> +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> +impl_0x69 = ['Intel', flags_generic, pn_config_default] impl_dpaa =
> +['NXP DPAA', flags_dpaa, pn_config_default]
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> 
>  if dpdk_conf.get('RTE_ARCH_32')
> +	# armv7 build
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> +	# aarch64 build
> +	if not meson.is_cross_build()
> +		if machine == 'generic'
> +			# default build
                                              ^^^^^^^^^^^ Generic build?

> +			impl_config = impl_generic
> +			part_number = 'generic'
> +		else
> +			# native 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
> +			if arm_force_native_march == true
> +				part_number = 'native'
> +			else
> +				part_number = cmd_output[3]
> +			endif
> +			# Set to generic implementer if implementer is not
> found
> +			impl_config = get_variable('impl_' + cmd_output[0],
> 'impl_generic')
> +		endif
> +	else
> +		# cross build
> +		impl_id = meson.get_cross_property('implementer_id',
> 'generic')
> +		part_number = meson.get_cross_property('part_number',
> 'generic')
> +		impl_config = get_variable('impl_' + impl_id)
> +	endif
> 
> -	machine = []
> -	cmd_generic = ['generic', '', '', 'default', '']
> -	cmd_output = cmd_generic # Set generic by default
> -	machine_args = [] # Clear previous machine args
> -	if arm_force_generic_march and not meson.is_cross_build()
> -		machine = impl_generic
> -		impl_pn = 'default'
> +	message('Arm implementer: ' + impl_config[0])
> +	message('Arm part number: ' + part_number)
> +
> +	implementer_flags = impl_config[1]
> +	part_number_config = impl_config[2]
> +
> +	if part_number_config.has_key(part_number)
> +		# use the specified part_number machine args if found
> +		part_number_config = part_number_config[part_number]
> +	elif part_number == 'native'
> +		# use native machine args
> +		part_number_config = [[native_machine_args]]
>  	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
> +		# default to generic machine args if part_number is not found
> +		# and not forcing native machine args
> +		# but don't default in cross-builds; if part_number is specified
> +		# incorrectly in a cross-file, it needs to be fixed there
> +		part_number_config = part_number_config['generic']
>  	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)
> +		# cross build and part number is not in part_number_config
> +		error('Cross build part number 0@0 not
> found.'.format(part_number))
>  	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])
> +	dpdk_flags = flags_common_default + implementer_flags
> +
> +	if part_number_config.length() > 1
> +		dpdk_flags += part_number_config[1]
> +	endif
> +
> +	machine_args = [] # Clear previous machine args
> +	foreach flag: part_number_config[0]
> +		if cc.has_argument(flag)
> +			machine_args += flag
>  		endif
>  	endforeach
> 
> -	message('Implementer : ' + machine[0])
> -	foreach flag: machine[1]
> +	foreach flag: dpdk_flags
>  		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
>  endif
> -message(machine_args)
> +
> +message('Using machine args: @0@'.format(machine_args))
> 
>  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
>      cc.get_define('__aarch64__', args: machine_args) != '')
> --
> 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-21 14:13           ` Bruce Richardson
  2020-10-21 14:27             ` Bruce Richardson
@ 2020-10-29  4:31             ` Honnappa Nagarahalli
  2020-11-02 13:55               ` Bruce Richardson
  1 sibling, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-29  4:31 UTC (permalink / raw)
  To: Bruce Richardson, Juraj Linkeš
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, dev, nd, Honnappa Nagarahalli, nd

<snip>

> > >
> > > On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> > > > The build machine's number of cpus and numa nodes vary, resulting
> > > > in mismatched counts of RTE_MAX_LCORE and
> RTE_MAX_NUMA_NODES for
> > > many
> > > > builds. Automatically discover the host's numa and cpu counts to
> > > > remove this mismatch for native builds. Use current defaults for default
> builds.
> > > > Force the users to specify the counts for cross build in cross
> > > > files or on the command line.
> > > > Give users the option to override the discovery or values from
> > > > cross files by specifying them on the command line with
> > > > -Dmax_lcores and -Dmax_numa_nodes.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > ---
> > > >  buildtools/get_cpu_count.py  |  7 ++++++
> > > > buildtools/get_numa_count.py | 22 +++++++++++++++++++
> > > >  buildtools/meson.build       |  2 ++
> > > >  config/meson.build           | 42
> ++++++++++++++++++++++++++++++++++--
> > > >  meson_options.txt            |  8 +++----
> > > >  5 files changed, 75 insertions(+), 6 deletions(-)  create mode
> > > > 100644 buildtools/get_cpu_count.py  create mode 100644
> > > > buildtools/get_numa_count.py
> > > >
> > > > diff --git a/buildtools/get_cpu_count.py
> > > > b/buildtools/get_cpu_count.py new file mode 100644 index
> > > > 000000000..386f85f8b
> > > > --- /dev/null
> > > > +++ b/buildtools/get_cpu_count.py
> > > > @@ -0,0 +1,7 @@
> > > > +#!/usr/bin/python3
> > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > +PANTHEON.tech s.r.o.
> > > > +
> > > > +import os
> > > > +
> > > > +print(os.cpu_count())
> > > > diff --git a/buildtools/get_numa_count.py
> > > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > > 000000000..f0c49973a
> > > > --- /dev/null
> > > > +++ b/buildtools/get_numa_count.py
> > > > @@ -0,0 +1,22 @@
> > > > +#!/usr/bin/python3
> > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > +PANTHEON.tech s.r.o.
> > > > +
> > > > +import ctypes
> > > > +import glob
> > > > +import os
> > > > +import subprocess
> > > > +
> > > > +if os.name == 'posix':
> > > > +    if os.path.isdir('/sys/devices/system/node'):
> > > > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > > > +    else:
> > > > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > > > +capture_output=True).stdout)
> > > > +
> > > > +elif os.name == 'nt':
> > > > +    libkernel32 = ctypes.windll.kernel32
> > > > +
> > > > +    count = ctypes.c_ulong()
> > > > +
> > > > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > > > +    print(count.value + 1)
> > > > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > > > 04808dabc..925e733b1 100644
> > > > --- a/buildtools/meson.build
> > > > +++ b/buildtools/meson.build
> > > > @@ -17,3 +17,5 @@ else
> > > >  endif
> > > >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper =
> > > > py3 +
> > > > files('call-sphinx-build.py')
> > > > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > > > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > > > diff --git a/config/meson.build b/config/meson.build index
> > > > a57c8ae9e..c4477f977 100644
> > > > --- a/config/meson.build
> > > > +++ b/config/meson.build
> > > > @@ -74,7 +74,11 @@ endif
> > > >  # still being able to support the CPU features required for DPDK.
> > > >  # This can be bumped up by the DPDK project, but it can never be
> > > > an # invariant like 'native'
> > > > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > > > +get_option('max_numa_nodes')
> > > >  if machine == 'default'
> > > > +	max_numa_nodes = 4
> > > > +	max_lcores = 128
> > >
> > > This doesn't seem right, since you are overriding the user-specified
> > > values with hard-coded ones.
> > >
> >
> > I understand we're using the default build/generic to build portalbe dpdk
> distro packages, meaning the settings for those packages should always be
> the same, no? If not, what should the default/generic build be? And when
> would someone do a default/generic build with their values? It wouldn't be a
> default/generic anymore, right?
> >
> > > >  	if host_machine.cpu_family().startswith('x86')
> > > >  		# matches the old pre-meson build systems default
> > > >  		machine = 'corei7'
> > > > @@ -83,6 +87,22 @@ if machine == 'default'
> > > >  	elif host_machine.cpu_family().startswith('ppc')
> > > >  		machine = 'power8'
> > > >  	endif
> > > > +elif not meson.is_cross_build()
> > > > +	# find host core count and numa node count for native builds
> > > > +	if max_lcores == 0
> > > > +		max_lcores =
> > > run_command(get_cpu_count_cmd).stdout().to_int()
> > > > +		min_lcores = 2
> > > > +		if max_lcores < min_lcores
> > > > +			message('Found less than @0@ cores, building for
> > > @0@ cores'.format(min_lcores))
> > > > +			max_lcores = min_lcores
> > > > +		else
> > > > +			message('Found @0@ cores'.format(max_lcores))
> > > > +		endif
> > > > +	endif
> > > > +	if max_numa_nodes == 0
> > > > +		max_numa_nodes =
> > > run_command(get_numa_count_cmd).stdout().to_int()
> > > > +		message('Found @0@ numa
> nodes'.format(max_numa_nodes))
> > > > +	endif
> > > >  endif
> > > >
> > > >  dpdk_conf.set('RTE_MACHINE', machine) @@ -227,8 +247,10 @@
> > > > foreach
> > > > arg: warning_flags  endforeach
> > > >
> > > >  # set other values pulled from the build options
> > > > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > > > -dpdk_conf.set('RTE_MAX_NUMA_NODES',
> get_option('max_numa_nodes'))
> > > > +if not meson.is_cross_build()
> > > > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> endif
> > >
> > > Rather than conditionally setting the value here, you should move
> > > the checks below up above this to simplify things.
> > >
> >
> > Do you mean the cross build checks? Those have to be after
> subdir(arch_subdir) so that we can override the values from cross files (as
> the commit message says).
> >
> > > >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > > > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > > > dpdk_conf.set('RTE_ENABLE_TRACE_FP',
> > > > get_option('enable_trace_fp')) @@
> > > > -247,6 +269,22 @@ compile_time_cpuflags = []
> > > >  subdir(arch_subdir)
> > > >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > > > ','.join(compile_time_cpuflags))
> > > >
> > > > +# check that cpu and numa count is set in cross builds if
> > > > +meson.is_cross_build()
> > > > +    	if max_lcores > 0
> > > > +		# specified on the cmdline
> > > > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> > > > +		error('Number of cores for cross build not specified in @0@
> > > subdir (e.g. in a cross-file) nor on the
> > > cmdline'.format(arch_subdir))
> > > > +	endif
> > > > +	if max_numa_nodes > 0
> > > > +		# specified on the cmdline
> > > > +		dpdk_conf.set('RTE_MAX_NUMA_NODES',
> max_numa_nodes)
> > > > +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > > > +		error('Number of numa nodes for cross build not specified in
> > > @0@ subdir (e.g. in a cross-file) nor on the
> > > cmdline'.format(arch_subdir))
> > > > +	endif
> > > > +endif
> > > > +
> > > >  # set the install path for the drivers
> > > > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> > > >
> > > > diff --git a/meson_options.txt b/meson_options.txt index
> > > > 9bf18ab6b..01b0c45c3 100644
> > > > --- a/meson_options.txt
> > > > +++ b/meson_options.txt
> > > > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> > > >  	description: 'set the target machine type')
> > > > option('max_ethports',
> > > > type: 'integer', value: 32,
> > > >  	description: 'maximum number of Ethernet devices')
> > > > -option('max_lcores', type: 'integer', value: 128,
> > > > -	description: 'maximum number of cores/threads supported by EAL')
> > > > -option('max_numa_nodes', type: 'integer', value: 4,
> > > > -	description: 'maximum number of NUMA nodes supported by EAL')
> > > > +option('max_lcores', type: 'integer', value: 0,
> > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > +Value 0 means the number of cpus on the host will be used. For
> > > > +cross build,
> > > set to non-zero to overwrite the cross-file value.')
> > > option('max_numa_nodes',
> > > type: 'integer', value: 0,
> > > > +	description: 'maximum number of NUMA nodes supported by EAL.
> > > > +Value
> > > 0
> > > > +means the number of numa nodes on the host will be used. For
> > > > +cross build, set to non-zero to overwrite the cross-file value.')
> > >
> > > I don't like this change, because it very much assumes for
> > > non-cross-compiles that people will be running DPDK on the system
> > > they build it on. That's a very, very big assumption!
> >
> > I'll be using definitions from https://mesonbuild.com/Cross-
> compilation.html.
> > I understand cross compilation to be building for a diffent host machine
> than the build machine (which is aligned with pretty much every definition I
> found). I understand this to be true not only for builds between
> architectures, but also within an architecture (e.g. x86_64 build machine
> building for x86_64 host machine).
> > So yes, when someone does a native build, it stands to reason they want to
> use it on the build machine. If they wanted to use it elsewhere, they would
> cross compile.
> > Another thing is the current build philosophy is to detect as much as
> possible (not having statically defined configuration, as you mentioned in the
> past). Detecting the number of cores and numa nodes fits this perfectly.
> > And yet another thing is that the assumption seems to be already present
> in the build system - it already detects a lot things, some of which may not be
> satisfied on machines other than the build machine. I may be wrong about
> this.
> >
> > > I'm ok with having zero as a "detect" option, and having the values
> > > overridden from cross-files, but not with detection as the default
> > > out- of-the-box option! Lots of users may pull builds from a CI
> > > based on VMs with just a few cores, for instance.
> >
> > If not having the automatic detection is a concern because of users using CI
> builds, then we (if it's from our CI) can change what we're building in CI - the
> default/generic build seems like a good fit because it's supposed to work on
> a variety of systems. Expecting that native build from random VMs would
> work anywhere doesn't seen very realistic - it's been build for that VM
> environment (because it's a native build).
> >
> > Here's my understanding on which the current version is based:
> > 1. Since we want to get away from having statically defined configuration,
> numa and core count discovery is exactly what we should have in the build
> system. Since discorery is currently the default for lib/drivers, it stands to
> reason it should be default for everything else, if possible.
> > 2. Native build should produce binaries matching the build machine as well
> as possible.
> > 3. Default/generic build should produce binaries executable on a range of
> systems (ideally all systems of a given architecture).
> > 4. Other builds, that is non-native builds, are cross-compilation, since we're
> building for host machine other that the build machine.
> >
> > What I haven't taken into account is users using CI builds. That could be
> remedied by modifying the CI a bit while being consistent with what
> native/default/generic/cross builds are (or should be). And in any case, if
> we're not interested in testing the exact CI environment (which we aren't,
> since we don't want to use 2 cores with 1 numa), we really shouldn't be doing
> native builds there.
> >
> > I'm interested in hearing where my thinking deviates from yours.
> >
> 
> There are a number of points in which we differ, I think.
> 
> Firstly, the use of "native" and "default/generic" for the "machine"
> parameter refers only to the instruction-set level from the compiler, and
> should not affect any other settings, since all settings are independent.
> Therefore, setting "machine" to "native" does not mean that we should
> detect cores and numa nodes, and similarly setting it to "default" does not
> mean that we should ignore the settings for these values and pick our own
> chosen default values.
Apologies to go to an older discussion.
I am trying to understand the definitions/expectations for 'native' and 'generic' builds.
As you say, instruction-set level is definitely one parameter. But, I think other DPDK specific parameters should also be considered.
For ex: RTE_MAX_LCORE should have a particular value for 'generic' build in all the supported architectures. The value could be different for each architecture, but it is fixed for the 'generic' build for a given architecture. Otherwise, the 'generic' build might not run on all the machines of that architecture.

Similarly, for 'native' build, is there any reason not to include other DPDK parameters as part of the definition? IMO, 'native' should refer to the entire build machine, not just the ISA. i.e. build on the target machine.

> 
> Secondly, the use of cross-compilation only applies when you are compiling
> for a different architecture or environment (e.g. OS) to what you are building
> on. Building on a 4-core x86 machine to run on a dual-socket, 32-core x86
> machine is not cross-compiling, but still needs to work by default. Something
> like building a 32-bit binary on a 64-bit OS is in most cases not done by cross-
> compilation either, but is rather outside the scope of the discussion, except
> as a reference point to show the scope of differences which can be
> accomodated as "native builds".
> 
> In terms of dynamic configuration for things like cores and numa nodes, the
> ideal end state here is not to have them detected at build time on the host
> system, but instead to have them detected at runtime and sized dynamically.
> In the absense of that, these values should be set to reasonable defaults so
> that when a user compiles up a binary without settings these explicitly it
> should run on 95%+ of systems of that type.
For the 'generic' build (which I also read it as DPDK binaries packaged with distros), this should be 100%.

> 
> This is my understanding of the issues, anyway. :-)
> 
> Regards,
> /Bruce

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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-28 16:59         ` Honnappa Nagarahalli
@ 2020-10-29  9:12           ` Juraj Linkeš
  2020-10-29 20:54             ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-29  9:12 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Wednesday, October 28, 2020 5:59 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v4 2/6] build: refactor Arm build
> 
> <snip>
> 
> >
> > * Rename variables to have names that better describe what the
> > variables store
> > * Remove unused or superfluous variables
> > * Change a list to dictionary where key lookup is needed
> > * Add informatory comments in the code
> > * Minor code restructure and reformatting
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/arm64_armada_linux_gcc    |   2 +-
> >  config/arm/arm64_armv8_linux_gcc     |   8 +-
> >  config/arm/arm64_bluefield_linux_gcc |   4 +-
> >  config/arm/arm64_dpaa_linux_gcc      |   2 +-
> >  config/arm/arm64_emag_linux_gcc      |   2 +-
> >  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
> >  config/arm/arm64_octeontx2_linux_gcc |   4 +-
> >  config/arm/arm64_stingray_linux_gcc  |   4 +-
> >  config/arm/arm64_thunderx2_linux_gcc |   4 +-
> >  config/arm/arm64_thunderx_linux_gcc  |   2 +-
> >  config/arm/meson.build               | 247 +++++++++++++++------------
> >  11 files changed, 153 insertions(+), 130 deletions(-)
> >
> 
> <snip>
> 
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 491842cad..6c31ab167 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -3,12 +3,12 @@
> >  # Copyright(c) 2017 Cavium, Inc
> >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> >
> > -# for checking defines we need to use the correct compiler flags
> > -march_opt = '-march=@0@'.format(machine)
> > -
> > +# set arm_force_native_march if you want to use machine args below #
> > +instead of discovered values; only works when doing an actual native
> > +build
> >  arm_force_native_march = false
> > -arm_force_generic_march = (machine == 'generic')
> > +native_machine_args = ['-march=native', '-mtune=native']
> >
> 
> [...]
> 
> > -
> > -machine_args_default = [
> > -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> > -	['native', ['-march=native']],
> > -	['0xd03', ['-mcpu=cortex-a53']],
> > -	['0xd04', ['-mcpu=cortex-a35']],
> > -	['0xd07', ['-mcpu=cortex-a57']],
> > -	['0xd08', ['-mcpu=cortex-a72']],
> > -	['0xd09', ['-mcpu=cortex-a73']],
> > -	['0xd0a', ['-mcpu=cortex-a75']],
> > -	['0xd0b', ['-mcpu=cortex-a76']],
> > -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > flags_n1sdp_extra]]
> > -
> > -machine_args_cavium = [
> > -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > -	['native', ['-march=native']],
> > -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> > -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> > -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > flags_thunderx2_extra],
> > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > flags_octeontx2_extra]]
> > -
> > -machine_args_emag = [
> > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > -	['native', ['-march=native']]]
> > +	['RTE_USE_C11_MEM_MODEL', true]
> > +]
> > +# arm config (implementer 0x41) is the default config
> > +pn_config_default
> What does it mean by 'default' here? I am somewhat confused between 'default'
> and 'generic'. We should look to remove 'default' as much as possible and stick
> with 'generic'.
> 

This default means what default means, no special meaning, that is if there isn't a more specific configuration, default to this one. It's possible that generic is better, but now that I think about it, using something else than default or generic might be the best to avoid confusion. Possibly just part_number_arm, which will make it in line with the other var names.

> > += {
> > +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> I like that we have taken out 'native' from this list. Would it be possible to take
> out 'generic' from this and others below. This is because the binary built with
> 'generic' build should run on any Arm platform. There is no dependency on any
> underlying platform.
> 

This actually means generic part for the implementer, not generic for everything. I understand this is here to produce binaries that would run on everything from that impelemeter (in line of what you mention below, this would be implementer-generic configuration, a fourth category). In my patchset, it's also a fallback when building for an unknown part number from the implementer.

Since this is not generic for everything, only for the implementer, we're lacking the true common default machine args for everything.

> > +	'0xd03': [['-mcpu=cortex-a53']],
> > +	'0xd04': [['-mcpu=cortex-a35']],
> > +	'0xd07': [['-mcpu=cortex-a57']],
> > +	'0xd08': [['-mcpu=cortex-a72']],
> > +	'0xd09': [['-mcpu=cortex-a73']],
> > +	'0xd0a': [['-mcpu=cortex-a75']],
> > +	'0xd0b': [['-mcpu=cortex-a76']],
> > +	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > +flags_n1sdp_extra]
> 'flags_n1sdp_extra' does not fit here. For the part number '0xd0c' there could be
> multiple SoCs (N1SDP is one of them). So, if the SoC is not known, but if we
> know that the CPU is N1, then we should build a N1-Generic build.

This should be core-generic configuration, I can rename it to flags_n1generic_extra.

> So, from my perspective, there are 3 kinds of binaries:
> 1) generic - best portability -  (possibly) least optimized for a given platform
> 2) Core-Generic (for ex: N1-generic) - Portable on all N1 based SoCs only -
> Optimized for N1 cores
> 3) SoC specific - (possibly) Not portable - Most optimized for the SoC
> 

The fourth category I mentioned above, implementer-generic, is used in how the arm configuration is currently processed:
1) default configuration
Added to/overwritten by
2) implementer configuration (one of which is the configuration for generic build)
Added to/overwritten by
3) part number (or core-generic) configuration
Added to/overwritten by
4) SoC configuration (what we're adding now)

It's not organized as cleanly - the machine args contain both 2) and 3). Depending on what we want to do with the 'generic' part number I'll adjust the config organization.

>  } pn_config_cavium = {
> > +	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
> 'generic' does not make sense here.
> 
> > +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> > +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> > +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> > +	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > flags_thunderx2_extra],
> > +	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > +flags_octeontx2_extra], } pn_config_emag = {
> > +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> Same here.
> I understand that this is coming from the existing code. But, I think we should try
> to set it right.
> 

The generic config for these makes sense if a fourth category, implementer-generic makes sense.
For example, for part_number_config_emag this means: for implementer _0x50 (Ampere Computing) use the generic machine args if there's nothing more specific (which there isn't - no other part number).

> >
> >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > G7-5321)
> Nit, Would be good to remove the reference to the doc
> 

Is that because the docs mentioned here may not be the most recent? It was useful to me in understanding where the implementer/part number values come from.

> > -impl_generic = ['Generic armv8', flags_generic, machine_args_default]
> > -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > -impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > -impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> > -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> > -impl_0x69 = ['Intel', flags_generic, machine_args_default] -impl_dpaa
> > = ['NXP DPAA', flags_dpaa, machine_args_default]
> > +impl_generic = ['Generic armv8', flags_generic, pn_config_default]
> > +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> > +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> > +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> > +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> > +impl_0x49 = ['Infineon', flags_generic, pn_config_default] impl_0x4d
> > += ['Motorola', flags_generic, pn_config_default] impl_0x4e =
> > +['NVIDIA', flags_generic, pn_config_default]
> > +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> > +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> > +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> > +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> > +impl_0x69 = ['Intel', flags_generic, pn_config_default] impl_dpaa =
> > +['NXP DPAA', flags_dpaa, pn_config_default]
> >
> >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> >
> >  if dpdk_conf.get('RTE_ARCH_32')
> > +	# armv7 build
> >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > +	# aarch64 build
> > +	if not meson.is_cross_build()
> > +		if machine == 'generic'
> > +			# default build
>                                               ^^^^^^^^^^^ Generic build?
> 

Already addressed in the next version.

> > +			impl_config = impl_generic
> > +			part_number = 'generic'
> > +		else
> > +			# native 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
> > +			if arm_force_native_march == true
> > +				part_number = 'native'
> > +			else
> > +				part_number = cmd_output[3]
> > +			endif
> > +			# Set to generic implementer if implementer is not
> > found
> > +			impl_config = get_variable('impl_' + cmd_output[0],
> > 'impl_generic')
> > +		endif
> > +	else
> > +		# cross build
> > +		impl_id = meson.get_cross_property('implementer_id',
> > 'generic')
> > +		part_number = meson.get_cross_property('part_number',
> > 'generic')
> > +		impl_config = get_variable('impl_' + impl_id)
> > +	endif
> >
> > -	machine = []
> > -	cmd_generic = ['generic', '', '', 'default', '']
> > -	cmd_output = cmd_generic # Set generic by default
> > -	machine_args = [] # Clear previous machine args
> > -	if arm_force_generic_march and not meson.is_cross_build()
> > -		machine = impl_generic
> > -		impl_pn = 'default'
> > +	message('Arm implementer: ' + impl_config[0])
> > +	message('Arm part number: ' + part_number)
> > +
> > +	implementer_flags = impl_config[1]
> > +	part_number_config = impl_config[2]
> > +
> > +	if part_number_config.has_key(part_number)
> > +		# use the specified part_number machine args if found
> > +		part_number_config = part_number_config[part_number]
> > +	elif part_number == 'native'
> > +		# use native machine args
> > +		part_number_config = [[native_machine_args]]
> >  	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
> > +		# default to generic machine args if part_number is not found
> > +		# and not forcing native machine args
> > +		# but don't default in cross-builds; if part_number is specified
> > +		# incorrectly in a cross-file, it needs to be fixed there
> > +		part_number_config = part_number_config['generic']
> >  	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)
> > +		# cross build and part number is not in part_number_config
> > +		error('Cross build part number 0@0 not
> > found.'.format(part_number))
> >  	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])
> > +	dpdk_flags = flags_common_default + implementer_flags
> > +
> > +	if part_number_config.length() > 1
> > +		dpdk_flags += part_number_config[1]
> > +	endif
> > +
> > +	machine_args = [] # Clear previous machine args
> > +	foreach flag: part_number_config[0]
> > +		if cc.has_argument(flag)
> > +			machine_args += flag
> >  		endif
> >  	endforeach
> >
> > -	message('Implementer : ' + machine[0])
> > -	foreach flag: machine[1]
> > +	foreach flag: dpdk_flags
> >  		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
> >  endif
> > -message(machine_args)
> > +
> > +message('Using machine args: @0@'.format(machine_args))
> >
> >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> >      cc.get_define('__aarch64__', args: machine_args) != '')
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-29  9:12           ` Juraj Linkeš
@ 2020-10-29 20:54             ` Honnappa Nagarahalli
  2020-10-30 10:45               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-10-29 20:54 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

> > <snip>
> >
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 491842cad..6c31ab167 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -3,12 +3,12 @@
> > >  # Copyright(c) 2017 Cavium, Inc
> > >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> > >
> > > -# for checking defines we need to use the correct compiler flags
> > > -march_opt = '-march=@0@'.format(machine)
> > > -
> > > +# set arm_force_native_march if you want to use machine args below
> > > +# instead of discovered values; only works when doing an actual
> > > +native build
> > >  arm_force_native_march = false
> > > -arm_force_generic_march = (machine == 'generic')
> > > +native_machine_args = ['-march=native', '-mtune=native']
> > >
> >
> > [...]
> >
> > > -
> > > -machine_args_default = [
> > > -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> > > -	['native', ['-march=native']],
> > > -	['0xd03', ['-mcpu=cortex-a53']],
> > > -	['0xd04', ['-mcpu=cortex-a35']],
> > > -	['0xd07', ['-mcpu=cortex-a57']],
> > > -	['0xd08', ['-mcpu=cortex-a72']],
> > > -	['0xd09', ['-mcpu=cortex-a73']],
> > > -	['0xd0a', ['-mcpu=cortex-a75']],
> > > -	['0xd0b', ['-mcpu=cortex-a76']],
> > > -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > > flags_n1sdp_extra]]
> > > -
> > > -machine_args_cavium = [
> > > -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > > -	['native', ['-march=native']],
> > > -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > flags_thunderx2_extra],
> > > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > flags_octeontx2_extra]]
> > > -
> > > -machine_args_emag = [
> > > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > -	['native', ['-march=native']]]
> > > +	['RTE_USE_C11_MEM_MODEL', true]
> > > +]
> > > +# arm config (implementer 0x41) is the default config
> > > +pn_config_default
> > What does it mean by 'default' here? I am somewhat confused between
> 'default'
> > and 'generic'. We should look to remove 'default' as much as possible
> > and stick with 'generic'.
> >
> 
> This default means what default means, no special meaning, that is if there isn't
> a more specific configuration, default to this one. It's possible that generic is
> better, but now that I think about it, using something else than default or
> generic might be the best to avoid confusion. Possibly just part_number_arm,
> which will make it in line with the other var names.
Agree, better to call it 'part_number_arm'.

> 
> > > += {
> > > +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> > I like that we have taken out 'native' from this list. Would it be
> > possible to take out 'generic' from this and others below. This is
> > because the binary built with 'generic' build should run on any Arm
> > platform. There is no dependency on any underlying platform.
> >
> 
> This actually means generic part for the implementer, not generic for
> everything. I understand this is here to produce binaries that would run on
> everything from that impelemeter (in line of what you mention below, this
> would be implementer-generic configuration, a fourth category). In my
> patchset, it's also a fallback when building for an unknown part number from
> the implementer.
We do not need implementer-generic binaries/build. However, we will have some parameters that are common across all the part numbers from that implementer (probably we should not call it as 'implementer-generic' to avoid confusion. May be 'implementer-common-flags' or 'implementer-flags-extra'). Those parameters can be used for every part number.

If we know the implementer, we will have the part number as well (this is part of the Arm architecture definition). Unknown part number should result in an error message.

> 
> Since this is not generic for everything, only for the implementer, we're lacking
> the true common default machine args for everything.
> 
> > > +	'0xd03': [['-mcpu=cortex-a53']],
> > > +	'0xd04': [['-mcpu=cortex-a35']],
> > > +	'0xd07': [['-mcpu=cortex-a57']],
> > > +	'0xd08': [['-mcpu=cortex-a72']],
> > > +	'0xd09': [['-mcpu=cortex-a73']],
> > > +	'0xd0a': [['-mcpu=cortex-a75']],
> > > +	'0xd0b': [['-mcpu=cortex-a76']],
> > > +	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > > +flags_n1sdp_extra]
> > 'flags_n1sdp_extra' does not fit here. For the part number '0xd0c'
> > there could be multiple SoCs (N1SDP is one of them). So, if the SoC is
> > not known, but if we know that the CPU is N1, then we should build a N1-
> Generic build.
> 
> This should be core-generic configuration, I can rename it to
> flags_n1generic_extra.
Agree.

> 
> > So, from my perspective, there are 3 kinds of binaries:
> > 1) generic - best portability -  (possibly) least optimized for a
> > given platform
> > 2) Core-Generic (for ex: N1-generic) - Portable on all N1 based SoCs
> > only - Optimized for N1 cores
> > 3) SoC specific - (possibly) Not portable - Most optimized for the SoC
> >
> 
> The fourth category I mentioned above, implementer-generic, is used in how
We should not have this category.

> the arm configuration is currently processed:
> 1) default configuration
> Added to/overwritten by
> 2) implementer configuration (one of which is the configuration for generic
> build) Added to/overwritten by
This should be just parameters that are common across all the part numbers of that implementer (for ex: RTE_CACHE_LINE_SIZE = 128), not a build.

> 3) part number (or core-generic) configuration Added to/overwritten by
> 4) SoC configuration (what we're adding now)
> 
> It's not organized as cleanly - the machine args contain both 2) and 3).
> Depending on what we want to do with the 'generic' part number I'll adjust the
> config organization.
> 
> >  } pn_config_cavium = {
> > > +	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
> > 'generic' does not make sense here.
> >
> > > +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > +	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > flags_thunderx2_extra],
> > > +	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > +flags_octeontx2_extra], } pn_config_emag = {
> > > +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> > Same here.
> > I understand that this is coming from the existing code. But, I think
> > we should try to set it right.
> >
> 
> The generic config for these makes sense if a fourth category, implementer-
> generic makes sense.
> For example, for part_number_config_emag this means: for implementer
> _0x50 (Ampere Computing) use the generic machine args if there's nothing
> more specific (which there isn't - no other part number).
There should be a part number for this. Not sure why it is not present here. I will find out the info.

> 
> > >
> > >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > > G7-5321)
> > Nit, Would be good to remove the reference to the doc
> >
> 
> Is that because the docs mentioned here may not be the most recent? It was
> useful to me in understanding where the implementer/part number values
> come from.
Yes, mainly because the spec gets updated. Instead you could say "Refer to MIDR in Arm Architecture Reference Manual")

> 
> > > -impl_generic = ['Generic armv8', flags_generic,
> > > machine_args_default]
> > > -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > > -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> > > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > > -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > > -impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > > -impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> > > -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> > > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > > -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > > -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_default]
> > > -impl_0x69 = ['Intel', flags_generic, machine_args_default]
> > > -impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
> > > +impl_generic = ['Generic armv8', flags_generic, pn_config_default]
> > > +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> > > +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> > > +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> > > +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> > > +impl_0x49 = ['Infineon', flags_generic, pn_config_default]
> > > +impl_0x4d = ['Motorola', flags_generic, pn_config_default]
> > > +impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
> > > +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> > > +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> > > +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> > > +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> > > +impl_0x69 = ['Intel', flags_generic, pn_config_default] impl_dpaa =
> > > +['NXP DPAA', flags_dpaa, pn_config_default]
> > >
> > >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> > >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> > >
> > >  if dpdk_conf.get('RTE_ARCH_32')
> > > +	# armv7 build
> > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > > +	# aarch64 build
> > > +	if not meson.is_cross_build()
> > > +		if machine == 'generic'
> > > +			# default build
> >                                               ^^^^^^^^^^^ Generic build?
> >
> 
> Already addressed in the next version.
> 
> > > +			impl_config = impl_generic
> > > +			part_number = 'generic'
> > > +		else
> > > +			# native 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
> > > +			if arm_force_native_march == true
> > > +				part_number = 'native'
> > > +			else
> > > +				part_number = cmd_output[3]
> > > +			endif
> > > +			# Set to generic implementer if implementer is not
> > > found
> > > +			impl_config = get_variable('impl_' + cmd_output[0],
> > > 'impl_generic')
> > > +		endif
> > > +	else
> > > +		# cross build
> > > +		impl_id = meson.get_cross_property('implementer_id',
> > > 'generic')
> > > +		part_number = meson.get_cross_property('part_number',
> > > 'generic')
> > > +		impl_config = get_variable('impl_' + impl_id)
> > > +	endif
> > >
> > > -	machine = []
> > > -	cmd_generic = ['generic', '', '', 'default', '']
> > > -	cmd_output = cmd_generic # Set generic by default
> > > -	machine_args = [] # Clear previous machine args
> > > -	if arm_force_generic_march and not meson.is_cross_build()
> > > -		machine = impl_generic
> > > -		impl_pn = 'default'
> > > +	message('Arm implementer: ' + impl_config[0])
> > > +	message('Arm part number: ' + part_number)
> > > +
> > > +	implementer_flags = impl_config[1]
> > > +	part_number_config = impl_config[2]
> > > +
> > > +	if part_number_config.has_key(part_number)
> > > +		# use the specified part_number machine args if found
> > > +		part_number_config = part_number_config[part_number]
> > > +	elif part_number == 'native'
> > > +		# use native machine args
> > > +		part_number_config = [[native_machine_args]]
> > >  	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
> > > +		# default to generic machine args if part_number is not found
> > > +		# and not forcing native machine args
> > > +		# but don't default in cross-builds; if part_number is specified
> > > +		# incorrectly in a cross-file, it needs to be fixed there
> > > +		part_number_config = part_number_config['generic']
> > >  	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)
> > > +		# cross build and part number is not in part_number_config
> > > +		error('Cross build part number 0@0 not
> > > found.'.format(part_number))
> > >  	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])
> > > +	dpdk_flags = flags_common_default + implementer_flags
> > > +
> > > +	if part_number_config.length() > 1
> > > +		dpdk_flags += part_number_config[1]
> > > +	endif
> > > +
> > > +	machine_args = [] # Clear previous machine args
> > > +	foreach flag: part_number_config[0]
> > > +		if cc.has_argument(flag)
> > > +			machine_args += flag
> > >  		endif
> > >  	endforeach
> > >
> > > -	message('Implementer : ' + machine[0])
> > > -	foreach flag: machine[1]
> > > +	foreach flag: dpdk_flags
> > >  		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
> > >  endif
> > > -message(machine_args)
> > > +
> > > +message('Using machine args: @0@'.format(machine_args))
> > >
> > >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > >      cc.get_define('__aarch64__', args: machine_args) != '')
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-29 20:54             ` Honnappa Nagarahalli
@ 2020-10-30 10:45               ` Juraj Linkeš
  2020-11-02 19:32                 ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-30 10:45 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Thursday, October 29, 2020 9:54 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v4 2/6] build: refactor Arm build
> 
> > > <snip>
> > >
> > > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > > 491842cad..6c31ab167 100644
> > > > --- a/config/arm/meson.build
> > > > +++ b/config/arm/meson.build
> > > > @@ -3,12 +3,12 @@
> > > >  # Copyright(c) 2017 Cavium, Inc
> > > >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> > > >
> > > > -# for checking defines we need to use the correct compiler flags
> > > > -march_opt = '-march=@0@'.format(machine)
> > > > -
> > > > +# set arm_force_native_march if you want to use machine args
> > > > +below # instead of discovered values; only works when doing an
> > > > +actual native build
> > > >  arm_force_native_march = false
> > > > -arm_force_generic_march = (machine == 'generic')
> > > > +native_machine_args = ['-march=native', '-mtune=native']
> > > >
> > >
> > > [...]
> > >
> > > > -
> > > > -machine_args_default = [
> > > > -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> > > > -	['native', ['-march=native']],
> > > > -	['0xd03', ['-mcpu=cortex-a53']],
> > > > -	['0xd04', ['-mcpu=cortex-a35']],
> > > > -	['0xd07', ['-mcpu=cortex-a57']],
> > > > -	['0xd08', ['-mcpu=cortex-a72']],
> > > > -	['0xd09', ['-mcpu=cortex-a73']],
> > > > -	['0xd0a', ['-mcpu=cortex-a75']],
> > > > -	['0xd0b', ['-mcpu=cortex-a76']],
> > > > -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > > > flags_n1sdp_extra]]
> > > > -
> > > > -machine_args_cavium = [
> > > > -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > > > -	['native', ['-march=native']],
> > > > -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > > -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > > -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > > flags_thunderx2_extra],
> > > > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > > flags_octeontx2_extra]]
> > > > -
> > > > -machine_args_emag = [
> > > > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > > -	['native', ['-march=native']]]
> > > > +	['RTE_USE_C11_MEM_MODEL', true]
> > > > +]
> > > > +# arm config (implementer 0x41) is the default config
> > > > +pn_config_default
> > > What does it mean by 'default' here? I am somewhat confused between
> > 'default'
> > > and 'generic'. We should look to remove 'default' as much as
> > > possible and stick with 'generic'.
> > >
> >
> > This default means what default means, no special meaning, that is if
> > there isn't a more specific configuration, default to this one. It's
> > possible that generic is better, but now that I think about it, using
> > something else than default or generic might be the best to avoid
> > confusion. Possibly just part_number_arm, which will make it in line with the
> other var names.
> Agree, better to call it 'part_number_arm'.
> 
> >
> > > > += {
> > > > +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> > > I like that we have taken out 'native' from this list. Would it be
> > > possible to take out 'generic' from this and others below. This is
> > > because the binary built with 'generic' build should run on any Arm
> > > platform. There is no dependency on any underlying platform.
> > >
> >
> > This actually means generic part for the implementer, not generic for
> > everything. I understand this is here to produce binaries that would
> > run on everything from that impelemeter (in line of what you mention
> > below, this would be implementer-generic configuration, a fourth
> > category). In my patchset, it's also a fallback when building for an
> > unknown part number from the implementer.
> We do not need implementer-generic binaries/build. However, we will have
> some parameters that are common across all the part numbers from that
> implementer (probably we should not call it as 'implementer-generic' to avoid
> confusion. May be 'implementer-common-flags' or 'implementer-flags-extra').
> Those parameters can be used for every part number.

These are currently named flags_<implementer> such as flags_arm and flags_cavium. We could rename them to implementer_flags_<implementer>.

> 
> If we know the implementer, we will have the part number as well (this is part of
> the Arm architecture definition). Unknown part number should result in an error
> message.
> 

Yes, we'll always have both. But there are still a couple of corner cases with native builds, which should always work:
1. We don't support the implementer (i.e. there's no variable with name implementer_<implementer_id>). In this case, what do default to? The generic build, which is the current behavior?
2. We support the implementer, but we don't support the part number. In this case, we can just use native machine args (-march=native) and use only implementer specific flags.

For generic, soc-specifc and cross builds it makes sense to error with uknown implementer/part number, since we wouldn't know what to build otherwise.

> >
> > Since this is not generic for everything, only for the implementer,
> > we're lacking the true common default machine args for everything.
> >
> > > > +	'0xd03': [['-mcpu=cortex-a53']],
> > > > +	'0xd04': [['-mcpu=cortex-a35']],
> > > > +	'0xd07': [['-mcpu=cortex-a57']],
> > > > +	'0xd08': [['-mcpu=cortex-a72']],
> > > > +	'0xd09': [['-mcpu=cortex-a73']],
> > > > +	'0xd0a': [['-mcpu=cortex-a75']],
> > > > +	'0xd0b': [['-mcpu=cortex-a76']],
> > > > +	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> > > > +flags_n1sdp_extra]
> > > 'flags_n1sdp_extra' does not fit here. For the part number '0xd0c'
> > > there could be multiple SoCs (N1SDP is one of them). So, if the SoC
> > > is not known, but if we know that the CPU is N1, then we should
> > > build a N1-
> > Generic build.
> >
> > This should be core-generic configuration, I can rename it to
> > flags_n1generic_extra.
> Agree.
> 
> >
> > > So, from my perspective, there are 3 kinds of binaries:
> > > 1) generic - best portability -  (possibly) least optimized for a
> > > given platform
> > > 2) Core-Generic (for ex: N1-generic) - Portable on all N1 based SoCs
> > > only - Optimized for N1 cores
> > > 3) SoC specific - (possibly) Not portable - Most optimized for the
> > > SoC
> > >
> >
> > The fourth category I mentioned above, implementer-generic, is used in
> > how
> We should not have this category.
> 
> > the arm configuration is currently processed:
> > 1) default configuration
> > Added to/overwritten by
> > 2) implementer configuration (one of which is the configuration for
> > generic
> > build) Added to/overwritten by
> This should be just parameters that are common across all the part numbers of
> that implementer (for ex: RTE_CACHE_LINE_SIZE = 128), not a build.
> 

It's not a build, just how the configation is organized and processed, as in we apply the common default flags, then implementer flags, then part number flags and then soc flags, overwriting flags in all of the steps.

> > 3) part number (or core-generic) configuration Added to/overwritten by
> > 4) SoC configuration (what we're adding now)
> >
> > It's not organized as cleanly - the machine args contain both 2) and 3).
> > Depending on what we want to do with the 'generic' part number I'll
> > adjust the config organization.
> >
> > >  } pn_config_cavium = {
> > > > +	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
> > > 'generic' does not make sense here.
> > >
> > > > +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > > +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > > +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > > +	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > > flags_thunderx2_extra],
> > > > +	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > > +flags_octeontx2_extra], } pn_config_emag = {
> > > > +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> > > Same here.
> > > I understand that this is coming from the existing code. But, I
> > > think we should try to set it right.
> > >
> >
> > The generic config for these makes sense if a fourth category,
> > implementer- generic makes sense.
> > For example, for part_number_config_emag this means: for implementer
> > _0x50 (Ampere Computing) use the generic machine args if there's
> > nothing more specific (which there isn't - no other part number).
> There should be a part number for this. Not sure why it is not present here. I will
> find out the info.
> 
> >
> > > >
> > > >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > > > G7-5321)
> > > Nit, Would be good to remove the reference to the doc
> > >
> >
> > Is that because the docs mentioned here may not be the most recent? It
> > was useful to me in understanding where the implementer/part number
> > values come from.
> Yes, mainly because the spec gets updated. Instead you could say "Refer to
> MIDR in Arm Architecture Reference Manual")
> 

Ok, I'll make this change.

> >
> > > > -impl_generic = ['Generic armv8', flags_generic,
> > > > machine_args_default]
> > > > -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > > > -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> > > > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > > > -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > > > -impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > > > -impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > > > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> > > > -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> > > > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > > > -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > > > -impl_0x56 = ['Marvell ARMADA', flags_armada,
> > > > machine_args_default]
> > > > -impl_0x69 = ['Intel', flags_generic, machine_args_default]
> > > > -impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
> > > > +impl_generic = ['Generic armv8', flags_generic,
> > > > +pn_config_default]
> > > > +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> > > > +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> > > > +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> > > > +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> > > > +impl_0x49 = ['Infineon', flags_generic, pn_config_default]
> > > > +impl_0x4d = ['Motorola', flags_generic, pn_config_default]
> > > > +impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
> > > > +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> > > > +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> > > > +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> > > > +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> > > > +impl_0x69 = ['Intel', flags_generic, pn_config_default] impl_dpaa
> > > > += ['NXP DPAA', flags_dpaa, pn_config_default]
> > > >
> > > >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> > > >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> > > >
> > > >  if dpdk_conf.get('RTE_ARCH_32')
> > > > +	# armv7 build
> > > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > > > +	# aarch64 build
> > > > +	if not meson.is_cross_build()
> > > > +		if machine == 'generic'
> > > > +			# default build
> > >                                               ^^^^^^^^^^^ Generic build?
> > >
> >
> > Already addressed in the next version.
> >
> > > > +			impl_config = impl_generic
> > > > +			part_number = 'generic'
> > > > +		else
> > > > +			# native 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
> > > > +			if arm_force_native_march == true
> > > > +				part_number = 'native'
> > > > +			else
> > > > +				part_number = cmd_output[3]
> > > > +			endif
> > > > +			# Set to generic implementer if implementer is not
> > > > found
> > > > +			impl_config = get_variable('impl_' + cmd_output[0],
> > > > 'impl_generic')
> > > > +		endif
> > > > +	else
> > > > +		# cross build
> > > > +		impl_id = meson.get_cross_property('implementer_id',
> > > > 'generic')
> > > > +		part_number = meson.get_cross_property('part_number',
> > > > 'generic')
> > > > +		impl_config = get_variable('impl_' + impl_id)
> > > > +	endif
> > > >
> > > > -	machine = []
> > > > -	cmd_generic = ['generic', '', '', 'default', '']
> > > > -	cmd_output = cmd_generic # Set generic by default
> > > > -	machine_args = [] # Clear previous machine args
> > > > -	if arm_force_generic_march and not meson.is_cross_build()
> > > > -		machine = impl_generic
> > > > -		impl_pn = 'default'
> > > > +	message('Arm implementer: ' + impl_config[0])
> > > > +	message('Arm part number: ' + part_number)
> > > > +
> > > > +	implementer_flags = impl_config[1]
> > > > +	part_number_config = impl_config[2]
> > > > +
> > > > +	if part_number_config.has_key(part_number)
> > > > +		# use the specified part_number machine args if found
> > > > +		part_number_config = part_number_config[part_number]
> > > > +	elif part_number == 'native'
> > > > +		# use native machine args
> > > > +		part_number_config = [[native_machine_args]]
> > > >  	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
> > > > +		# default to generic machine args if part_number is not found
> > > > +		# and not forcing native machine args
> > > > +		# but don't default in cross-builds; if part_number is specified
> > > > +		# incorrectly in a cross-file, it needs to be fixed there
> > > > +		part_number_config = part_number_config['generic']
> > > >  	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)
> > > > +		# cross build and part number is not in part_number_config
> > > > +		error('Cross build part number 0@0 not
> > > > found.'.format(part_number))
> > > >  	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])
> > > > +	dpdk_flags = flags_common_default + implementer_flags
> > > > +
> > > > +	if part_number_config.length() > 1
> > > > +		dpdk_flags += part_number_config[1]
> > > > +	endif
> > > > +
> > > > +	machine_args = [] # Clear previous machine args
> > > > +	foreach flag: part_number_config[0]
> > > > +		if cc.has_argument(flag)
> > > > +			machine_args += flag
> > > >  		endif
> > > >  	endforeach
> > > >
> > > > -	message('Implementer : ' + machine[0])
> > > > -	foreach flag: machine[1]
> > > > +	foreach flag: dpdk_flags
> > > >  		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
> > > >  endif
> > > > -message(machine_args)
> > > > +
> > > > +message('Using machine args: @0@'.format(machine_args))
> > > >
> > > >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > > >      cc.get_define('__aarch64__', args: machine_args) != '')
> > > > --
> > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v5 08/11] build: optional NUMA and cpu counts detection
  2020-10-28 15:04           ` Bruce Richardson
@ 2020-10-30 11:04             ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-30 11:04 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, October 28, 2020 4:04 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [PATCH v5 08/11] build: optional NUMA and cpu counts detection
> 
> On Wed, Oct 28, 2020 at 03:04:02PM +0100, Juraj Linkeš wrote:
> > Add an option to automatically discover the host's numa and cpu counts
> > and use those values for a non cross-build.
> > Give users the option to override the per-arch default values or
> > values from cross files by specifying them on the command line with
> > -Dmax_lcores and -Dmax_numa_nodes.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  buildtools/get_cpu_count.py  |  7 ++++++
> > buildtools/get_numa_count.py | 22 +++++++++++++++++
> >  buildtools/meson.build       |  2 ++
> >  config/meson.build           | 48 ++++++++++++++++++++++++++++++++++--
> >  config/x86/meson.build       |  2 ++
> >  meson_options.txt            |  8 +++---
> >  6 files changed, 83 insertions(+), 6 deletions(-)  create mode 100644
> > buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py
> >
> > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > new file mode 100644 index 000000000..386f85f8b
> > --- /dev/null
> > +++ b/buildtools/get_cpu_count.py
> > @@ -0,0 +1,7 @@
> > +#!/usr/bin/python3
> 
> I think for DPDK python scripts we standardized on "/usr/bin/env python3"
> [Someone please correct me if I'm wrong here!]
> 

The other scripts are using it, so I'll change it.

> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import os
> > +
> > +print(os.cpu_count())
> > diff --git a/buildtools/get_numa_count.py
> > b/buildtools/get_numa_count.py new file mode 100644 index
> > 000000000..e7f3de6b0
> > --- /dev/null
> > +++ b/buildtools/get_numa_count.py
> > @@ -0,0 +1,22 @@
> > +#!/usr/bin/python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import ctypes
> > +import glob
> > +import os
> > +import subprocess
> > +
> > +if os.name == 'posix':
> > +    if os.path.isdir('/sys/devices/system/node'):
> > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > +    else:
> > +        subprocess.run(['sysctl', 'vm.ndomains'])
> > +
> 
> I just realised that by default sysctl outputs the name of the element as well as
> the value, which is not what we want. Using "-n" flag suppresses the name, so
> please add that to the command. [Sorry for not spotting this in previous
> versions].
> 

Ok, I'll add this. I verified how the output looks and we shouldn't need to change anything after this.

> > +elif os.name == 'nt':
> > +    libkernel32 = ctypes.windll.kernel32
> > +
> > +    count = ctypes.c_ulong()
> > +
> > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > +    print(count.value + 1)
> > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > 04808dabc..925e733b1 100644
> > --- a/buildtools/meson.build
> > +++ b/buildtools/meson.build
> > @@ -17,3 +17,5 @@ else
> >  endif
> >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> > files('call-sphinx-build.py')
> > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > diff --git a/config/meson.build b/config/meson.build index
> > c7f7aa6e2..a51000ab2 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -231,8 +231,6 @@ foreach arg: warning_flags  endforeach
> >
> >  # set other values pulled from the build options
> > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > -dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@
> > -251,6 +249,52 @@ compile_time_cpuflags = []
> >  subdir(arch_subdir)
> >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > ','.join(compile_time_cpuflags))
> >
> > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > +get_option('max_numa_nodes') if max_lcores > 0
> > +	# Overwrite the default value from arch_subdir with user input
> > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores) elif max_lcores == -1
> > +	# Overwrite the default value with discovered values
> > +	if not meson.is_cross_build()
> 
> I'd suggest changing this to the inverse and erroring out, since I assume that
> having -1 for cross-compilation should be an error?
> 
> 	if meson.is_cross_build()
> 		error('....')
> 	endif
> 
> Thereafter you save a level of indentation for the rest of the block.
> 

I thought of this in terms of cross-compilation taking precedence over discovered values, but erroring out makes sense.

> > +		# Discovery makes sense only for non-cross builds
> > +		max_lcores =
> run_command(get_cpu_count_cmd).stdout().to_int()
> > +		min_lcores = 2
> > +		# DPDK must be build for at least 2 cores
> 
> Even 2 seems rather low. I'd personally look to set the minimum at 4.
> 

This was informed by Honnappa's series: http://patches.dpdk.org/project/dpdk/list/?series=13041.
I believed he fixed the build so it works even with 2 cores. Setting it to lowest working number seems like the way to go to me.

> > +		if max_lcores < min_lcores
> > +			message('Found less than @0@ cores, building for
> @0@ cores'.format(min_lcores))
> > +			max_lcores = min_lcores
> > +		else
> > +			message('Found @0@ cores'.format(max_lcores))
> > +		endif
> > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > +	endif
> > +endif
> > +
> > +if max_numa_nodes > 0
> > +	# Overwrite the default value from arch_subdir with user input
> > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) elif
> > +max_numa_nodes == -1
> > +	# Overwrite the default value with discovered values
> > +	if not meson.is_cross_build()
> > +		# Discovery makes sense only for non-cross builds
> > +		max_numa_nodes =
> run_command(get_numa_count_cmd).stdout().to_int()
> > +		message('Found @0@ numa nodes'.format(max_numa_nodes))
> > +		dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> > +	endif
> > +endif
> > +
> > +# check that cpu and numa count is set in cross builds # and error
> > +out if it's not set if meson.is_cross_build()
> > +	if not dpdk_conf.has('RTE_MAX_LCORE')
> > +		error('Number of cores for cross build not specified in @0@
> subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > +	endif
> > +	if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > +		error('Number of numa nodes for cross build not specified in
> @0@ subdir (e.g. in a cross-file) nor on the cmdline'.format(arch_subdir))
> > +	endif
> > +endif
> > +
> 
> Not sure you need the is_cross_build bit, since if we don't have
> RTE_MAX_LCORES set at all, then it's an error too. It just so happens that the
> code paths to this point prevent that from ever happening.
> 

Ok, makes sense to do a generic check here.

> Is the intention here that the subdir meson.build files will just literally take the
> value from the cross-file, or are you doing other processing in the ARM case,
> e.g. to compute it based on other info. If it's just the former where it's always
> read from the cross-files, I'd have the reading done in this file (above the other
> assignment work), since it would be architecture agnostic.
> 

Good point, we're not doing anything special, so all configuration from cross files should be processed this way.

> >  # set the install path for the drivers
> > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> >
> <snip>


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

* Re: [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags
  2020-10-28 15:08           ` Bruce Richardson
@ 2020-10-30 11:28             ` Juraj Linkeš
  2020-10-30 13:38               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-30 11:28 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, October 28, 2020 4:08 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [PATCH v5 11/11] build: update Arm builds with makefile flags
> 
> On Wed, Oct 28, 2020 at 03:04:05PM +0100, Juraj Linkeš wrote:
> > Not all flags were moved properly from the old Makefile build system.
> > Disable corresponding drivers and libnuma in cross files and remove
> > deprecated config.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/arm64_armada_linux_gcc    | 2 ++
> >  config/arm/arm64_armv8_linux_gcc     | 8 ++++++--
> >  config/arm/arm64_bluefield_linux_gcc | 1 +
> >  config/arm/arm64_dpaa_linux_gcc      | 1 +
> >  config/arm/arm64_n1sdp_linux_gcc     | 1 +
> >  config/arm/arm64_octeontx2_linux_gcc | 1 +
> > config/arm/arm64_stingray_linux_gcc  | 1 +
> >  config/arm/meson.build               | 5 ++++-
> >  drivers/meson.build                  | 4 ++++
> >  9 files changed, 21 insertions(+), 3 deletions(-)
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/arm64_armada_linux_gcc
> > index 36100c594..e33f1e742 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -17,3 +17,5 @@ endian = 'little'
> >  implementer_id = '0x56'
> >  max_numa_nodes = 1
> >  max_lcores = 16
> > +has_libnuma = 0
> > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> 
> Changes to disabled drivers should be merged in the previous patch.
> 

These are not changes, but additions based on the old makefile flags, which is why I added them in a separate patch.
However, do you think we could just merge both of these patches? Both are either fixing existing config or fixing config that previously worked (defined in the old makefiles). What do you think? If not, what's the best way to split these two (fixing existing config and fixing/adding config from makefiles)?

> > diff --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > index 779333199..c6010e303 100644
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ b/config/arm/arm64_armv8_linux_gcc
> > @@ -28,7 +28,11 @@ implementer_id = 'generic'
> >  part_number = 'generic'
> >
> >  # Supported extra configuration
> > -# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
> > -# max_lcores = n      # will set RTE_MAX_LCORE
> > +# max_numa_nodes = n   # will set RTE_MAX_NUMA_NODES
> > +# max_lcores = n        # will set RTE_MAX_LCORE
> >  max_lcores = 256
> >  max_numa_nodes = 4
> > +
> > +# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
> > +# disabled_drivers += ['bus/dpaa', 'crypto']
> > +    # add to the set of disabled libraries
> > diff --git a/config/arm/arm64_bluefield_linux_gcc
> > b/config/arm/arm64_bluefield_linux_gcc
> > index 7ff6fd309..e154ac4fd 100644
> > --- a/config/arm/arm64_bluefield_linux_gcc
> > +++ b/config/arm/arm64_bluefield_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> >  part_number = '0xd08'
> >  max_numa_nodes = 1
> >  max_lcores = 16
> > +has_libnuma = 0
> > diff --git a/config/arm/arm64_dpaa_linux_gcc
> > b/config/arm/arm64_dpaa_linux_gcc index adae86f57..78883a2ec 100644
> > --- a/config/arm/arm64_dpaa_linux_gcc
> > +++ b/config/arm/arm64_dpaa_linux_gcc
> > @@ -17,3 +17,4 @@ endian = 'little'
> >  implementer_id = 'dpaa'
> >  max_numa_nodes = 1
> >  max_lcores = 16
> > +has_libnuma = 0
> > diff --git a/config/arm/arm64_n1sdp_linux_gcc
> > b/config/arm/arm64_n1sdp_linux_gcc
> > index 3a8b46812..4493227f3 100644
> > --- a/config/arm/arm64_n1sdp_linux_gcc
> > +++ b/config/arm/arm64_n1sdp_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> >  part_number = '0xd0c'
> >  max_numa_nodes = 1
> >  max_lcores = 4
> > +has_libnuma = 0
> > diff --git a/config/arm/arm64_octeontx2_linux_gcc
> > b/config/arm/arm64_octeontx2_linux_gcc
> > index 2baf95a2a..ff9e5c403 100644
> > --- a/config/arm/arm64_octeontx2_linux_gcc
> > +++ b/config/arm/arm64_octeontx2_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x43'
> >  part_number = '0xb2'
> >  max_numa_nodes = 1
> >  max_lcores = 36
> > +has_libnuma = 0
> > diff --git a/config/arm/arm64_stingray_linux_gcc
> > b/config/arm/arm64_stingray_linux_gcc
> > index 7ff6fd309..e154ac4fd 100644
> > --- a/config/arm/arm64_stingray_linux_gcc
> > +++ b/config/arm/arm64_stingray_linux_gcc
> > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> >  part_number = '0xd08'
> >  max_numa_nodes = 1
> >  max_lcores = 16
> > +has_libnuma = 0
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 21deb2dd9..a023abb17 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -101,7 +101,6 @@ flags_octeontx2_extra = [
> >  	['RTE_MACHINE', '"octeontx2"'],
> >  	['RTE_ARM_FEATURE_ATOMICS', true],
> >  	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_EAL_IGB_UIO', false],
> >  	['RTE_MAX_LCORE', 36],
> >  	['RTE_MAX_NUMA_NODES', 1]
> >  ]
> > @@ -236,6 +235,10 @@ else
> >  				['RTE_MAX_LCORE', cross_max_lcores]
> >  			]
> >  		endif
> > +		cross_has_libnuma = meson.get_cross_property('has_libnuma',
> '')
> > +		if cross_has_libnuma != ''
> > +			has_libnuma = cross_has_libnuma
> > +		endif
> >  	endif
> >
> >  	# apply supported machine args
> > diff --git a/drivers/meson.build b/drivers/meson.build index
> > 4c4866866..a997387ad 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -21,6 +21,10 @@ subdirs = [
> >  disabled_drivers += run_command(list_dir_globs,
> get_option('disable_drivers'),
> >  		).stdout().split()
> >
> > +if meson.is_cross_build()
> > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > +endif
> > +
> 
> This change also belongs in the previous patch. However, because of the way it's
> done here, I think the change to the disabled_drivers assignment in the previous
> patch can be dropped, since assigning using "=" rather than "+=" is fine when the
> cross-file addition is done later.
> 

Moving this to the other patch makes sense. If you mean the assignment change in drivers/meson.build that has to be there, so we don't overwrite disabled drivers configured in config/arm/meson.build.

> >  default_cflags = machine_args
> >  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags +=
> > ['-DALLOW_INTERNAL_API']
> > --
> > 2.20.1
> >


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

* Re: [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags
  2020-10-30 11:28             ` Juraj Linkeš
@ 2020-10-30 13:38               ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-10-30 13:38 UTC (permalink / raw)
  To: Juraj Linkeš, Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Juraj Linkeš
> Sent: Friday, October 30, 2020 12:29 PM
> To: Bruce Richardson <bruce.richardson@intel.com>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile
> flags
> 
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Wednesday, October 28, 2020 4:08 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org
> > Subject: Re: [PATCH v5 11/11] build: update Arm builds with makefile
> > flags
> >
> > On Wed, Oct 28, 2020 at 03:04:05PM +0100, Juraj Linkeš wrote:
> > > Not all flags were moved properly from the old Makefile build system.
> > > Disable corresponding drivers and libnuma in cross files and remove
> > > deprecated config.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/arm64_armada_linux_gcc    | 2 ++
> > >  config/arm/arm64_armv8_linux_gcc     | 8 ++++++--
> > >  config/arm/arm64_bluefield_linux_gcc | 1 +
> > >  config/arm/arm64_dpaa_linux_gcc      | 1 +
> > >  config/arm/arm64_n1sdp_linux_gcc     | 1 +
> > >  config/arm/arm64_octeontx2_linux_gcc | 1 +
> > > config/arm/arm64_stingray_linux_gcc  | 1 +
> > >  config/arm/meson.build               | 5 ++++-
> > >  drivers/meson.build                  | 4 ++++
> > >  9 files changed, 21 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > b/config/arm/arm64_armada_linux_gcc
> > > index 36100c594..e33f1e742 100644
> > > --- a/config/arm/arm64_armada_linux_gcc
> > > +++ b/config/arm/arm64_armada_linux_gcc
> > > @@ -17,3 +17,5 @@ endian = 'little'
> > >  implementer_id = '0x56'
> > >  max_numa_nodes = 1
> > >  max_lcores = 16
> > > +has_libnuma = 0
> > > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> >
> > Changes to disabled drivers should be merged in the previous patch.
> >
> 
> These are not changes, but additions based on the old makefile flags, which is
> why I added them in a separate patch.
> However, do you think we could just merge both of these patches? Both are
> either fixing existing config or fixing config that previously worked (defined in
> the old makefiles). What do you think? If not, what's the best way to split these
> two (fixing existing config and fixing/adding config from makefiles)?
> 

I've decided to redo the last three patches a bit - add the capability to specify numa and cpu counts into the first, disable drivers into the second and disable numa into the last one.

> > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > b/config/arm/arm64_armv8_linux_gcc
> > > index 779333199..c6010e303 100644
> > > --- a/config/arm/arm64_armv8_linux_gcc
> > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > @@ -28,7 +28,11 @@ implementer_id = 'generic'
> > >  part_number = 'generic'
> > >
> > >  # Supported extra configuration
> > > -# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
> > > -# max_lcores = n      # will set RTE_MAX_LCORE
> > > +# max_numa_nodes = n   # will set RTE_MAX_NUMA_NODES
> > > +# max_lcores = n        # will set RTE_MAX_LCORE
> > >  max_lcores = 256
> > >  max_numa_nodes = 4
> > > +
> > > +# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
> > > +# disabled_drivers += ['bus/dpaa', 'crypto']
> > > +    # add to the set of disabled libraries
> > > diff --git a/config/arm/arm64_bluefield_linux_gcc
> > > b/config/arm/arm64_bluefield_linux_gcc
> > > index 7ff6fd309..e154ac4fd 100644
> > > --- a/config/arm/arm64_bluefield_linux_gcc
> > > +++ b/config/arm/arm64_bluefield_linux_gcc
> > > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> > >  part_number = '0xd08'
> > >  max_numa_nodes = 1
> > >  max_lcores = 16
> > > +has_libnuma = 0
> > > diff --git a/config/arm/arm64_dpaa_linux_gcc
> > > b/config/arm/arm64_dpaa_linux_gcc index adae86f57..78883a2ec 100644
> > > --- a/config/arm/arm64_dpaa_linux_gcc
> > > +++ b/config/arm/arm64_dpaa_linux_gcc
> > > @@ -17,3 +17,4 @@ endian = 'little'
> > >  implementer_id = 'dpaa'
> > >  max_numa_nodes = 1
> > >  max_lcores = 16
> > > +has_libnuma = 0
> > > diff --git a/config/arm/arm64_n1sdp_linux_gcc
> > > b/config/arm/arm64_n1sdp_linux_gcc
> > > index 3a8b46812..4493227f3 100644
> > > --- a/config/arm/arm64_n1sdp_linux_gcc
> > > +++ b/config/arm/arm64_n1sdp_linux_gcc
> > > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> > >  part_number = '0xd0c'
> > >  max_numa_nodes = 1
> > >  max_lcores = 4
> > > +has_libnuma = 0
> > > diff --git a/config/arm/arm64_octeontx2_linux_gcc
> > > b/config/arm/arm64_octeontx2_linux_gcc
> > > index 2baf95a2a..ff9e5c403 100644
> > > --- a/config/arm/arm64_octeontx2_linux_gcc
> > > +++ b/config/arm/arm64_octeontx2_linux_gcc
> > > @@ -17,3 +17,4 @@ implementer_id = '0x43'
> > >  part_number = '0xb2'
> > >  max_numa_nodes = 1
> > >  max_lcores = 36
> > > +has_libnuma = 0
> > > diff --git a/config/arm/arm64_stingray_linux_gcc
> > > b/config/arm/arm64_stingray_linux_gcc
> > > index 7ff6fd309..e154ac4fd 100644
> > > --- a/config/arm/arm64_stingray_linux_gcc
> > > +++ b/config/arm/arm64_stingray_linux_gcc
> > > @@ -17,3 +17,4 @@ implementer_id = '0x41'
> > >  part_number = '0xd08'
> > >  max_numa_nodes = 1
> > >  max_lcores = 16
> > > +has_libnuma = 0
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 21deb2dd9..a023abb17 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -101,7 +101,6 @@ flags_octeontx2_extra = [
> > >  	['RTE_MACHINE', '"octeontx2"'],
> > >  	['RTE_ARM_FEATURE_ATOMICS', true],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_EAL_IGB_UIO', false],
> > >  	['RTE_MAX_LCORE', 36],
> > >  	['RTE_MAX_NUMA_NODES', 1]
> > >  ]
> > > @@ -236,6 +235,10 @@ else
> > >  				['RTE_MAX_LCORE', cross_max_lcores]
> > >  			]
> > >  		endif
> > > +		cross_has_libnuma = meson.get_cross_property('has_libnuma',
> > '')
> > > +		if cross_has_libnuma != ''
> > > +			has_libnuma = cross_has_libnuma
> > > +		endif
> > >  	endif
> > >
> > >  	# apply supported machine args
> > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > 4c4866866..a997387ad 100644
> > > --- a/drivers/meson.build
> > > +++ b/drivers/meson.build
> > > @@ -21,6 +21,10 @@ subdirs = [
> > >  disabled_drivers += run_command(list_dir_globs,
> > get_option('disable_drivers'),
> > >  		).stdout().split()
> > >
> > > +if meson.is_cross_build()
> > > +	disabled_drivers += meson.get_cross_property('disabled_drivers',
> > > +[]) endif
> > > +
> >
> > This change also belongs in the previous patch. However, because of
> > the way it's done here, I think the change to the disabled_drivers
> > assignment in the previous patch can be dropped, since assigning using
> > "=" rather than "+=" is fine when the cross-file addition is done later.
> >
> 
> Moving this to the other patch makes sense. If you mean the assignment change
> in drivers/meson.build that has to be there, so we don't overwrite disabled
> drivers configured in config/arm/meson.build.
> 
> > >  default_cflags = machine_args
> > >  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags +=
> > > ['-DALLOW_INTERNAL_API']
> > > --
> > > 2.20.1
> > >


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

* Re: [dpdk-dev] [PATCH v5 02/11] build: rename Arm build variables
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 02/11] build: rename Arm build variables Juraj Linkeš
@ 2020-11-02  6:50           ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2020-11-02  6:50 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, October 28, 2020 10:04 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v5 02/11] build: rename Arm build variables
> 
> Rename Arm build variables and values so that they better conform to Arm
> specifications. Also rename generically sounding variable to names that
> better capture what the variables hold.
> 
> Rename machine_args_generic to part_number_config_default since the
> variable contains more than just the generic machine args and is referenced
> multiple times with the intended use as a default value.
> Rename the default machine args to generic machine args to reflect that.
> The rest of the variables are self-explanatory.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armada_linux_gcc    |  2 +-
>  config/arm/arm64_armv8_linux_gcc     |  8 ++--
>  config/arm/arm64_bluefield_linux_gcc |  4 +-
>  config/arm/arm64_dpaa_linux_gcc      |  2 +-
>  config/arm/arm64_emag_linux_gcc      |  2 +-
>  config/arm/arm64_n1sdp_linux_gcc     |  4 +-
>  config/arm/arm64_octeontx2_linux_gcc |  4 +-
> config/arm/arm64_stingray_linux_gcc  |  4 +-
> config/arm/arm64_thunderx2_linux_gcc |  4 +-
> config/arm/arm64_thunderx_linux_gcc  |  2 +-
>  config/arm/meson.build               | 72 ++++++++++++++--------------
>  11 files changed, 54 insertions(+), 54 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index fa40c0398..52c5f4476 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -14,4 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x56'
> +implementer_id = '0x56'
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 88f0ff9da..13ee8b223 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -13,10 +13,10 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = 'generic'
> +implementer_id = 'generic'
> 
> -# Valid options for Arm's implementor_pn:
> -# 'default': valid for all armv8-a architectures (default value)
> +# Valid options for Arm's part_number:
> +# 'generic': valid for all armv8-a architectures (default value)
>  # '0xd03':   cortex-a53
>  # '0xd04':   cortex-a35
>  # '0xd05':   cortex-a55
> @@ -25,4 +25,4 @@ implementor_id = 'generic'
>  # '0xd09':   cortex-a73
>  # '0xd0a':   cortex-a75
>  # '0xd0b':   cortex-a76
> -implementor_pn = 'default'
> +part_number = 'generic'
> diff --git a/config/arm/arm64_bluefield_linux_gcc
> b/config/arm/arm64_bluefield_linux_gcc
> index 86797d23c..b79389d85 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd08'
> +implementer_id = '0x41'
> +part_number = '0xd08'
> diff --git a/config/arm/arm64_dpaa_linux_gcc
> b/config/arm/arm64_dpaa_linux_gcc index 1a4682154..573ae7e42 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -14,4 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = 'dpaa'
> +implementer_id = 'dpaa'
> diff --git a/config/arm/arm64_emag_linux_gcc
> b/config/arm/arm64_emag_linux_gcc index 8edcd3e97..24f3d533e 100644
> --- a/config/arm/arm64_emag_linux_gcc
> +++ b/config/arm/arm64_emag_linux_gcc
> @@ -13,4 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x50'
> +implementer_id = '0x50'
> diff --git a/config/arm/arm64_n1sdp_linux_gcc
> b/config/arm/arm64_n1sdp_linux_gcc
> index 022e06303..6fb3f02ea 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd0c'
> +implementer_id = '0x41'
> +part_number = '0xd0c'
> diff --git a/config/arm/arm64_octeontx2_linux_gcc
> b/config/arm/arm64_octeontx2_linux_gcc
> index 365bd7cbd..ac1042806 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x43'
> -implementor_pn = '0xb2'
> +implementer_id = '0x43'
> +part_number = '0xb2'
> diff --git a/config/arm/arm64_stingray_linux_gcc
> b/config/arm/arm64_stingray_linux_gcc
> index 86797d23c..b79389d85 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd08'
> +implementer_id = '0x41'
> +part_number = '0xd08'
> diff --git a/config/arm/arm64_thunderx2_linux_gcc
> b/config/arm/arm64_thunderx2_linux_gcc
> index 2b41acc61..dd257745e 100644
> --- a/config/arm/arm64_thunderx2_linux_gcc
> +++ b/config/arm/arm64_thunderx2_linux_gcc
> @@ -13,5 +13,5 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x43'
> -implementor_pn = '0xaf'
> +implementer_id = '0x43'
> +part_number = '0xaf'
> diff --git a/config/arm/arm64_thunderx_linux_gcc
> b/config/arm/arm64_thunderx_linux_gcc
> index 6572ab615..670764437 100644
> --- a/config/arm/arm64_thunderx_linux_gcc
> +++ b/config/arm/arm64_thunderx_linux_gcc
> @@ -13,4 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x43'
> +implementer_id = '0x43'
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 4fd32f0ca..dacbb947b 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -88,8 +88,8 @@ flags_octeontx2_extra = [
>  	['RTE_EAL_IGB_UIO', false],
>  	['RTE_USE_C11_MEM_MODEL', true]]
> 
> -machine_args_generic = [
> -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> +part_number_config_default = [
> +	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
>  	['native', ['-march=native']],
>  	['0xd03', ['-mcpu=cortex-a53']],
>  	['0xd04', ['-mcpu=cortex-a35']],
> @@ -100,8 +100,8 @@ machine_args_generic = [
>  	['0xd0b', ['-mcpu=cortex-a76']],
>  	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
> flags_n1sdp_extra]]
> 
> -machine_args_cavium = [
> -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> +part_number_config_cavium = [
> +	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
>  	['native', ['-march=native']],
>  	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
>  	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra], @@ -109,25
> +109,25 @@ machine_args_cavium = [
>  	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_thunderx2_extra],
>  	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_octeontx2_extra]]
> 
> -machine_args_emag = [
> -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> +part_number_config_emag = [
> +	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
>  	['native', ['-march=native']]]
> 
>  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
> -impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
> -impl_0x41 = ['Arm', flags_arm, machine_args_generic]
> -impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
> -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> -impl_0x44 = ['DEC', flags_generic, machine_args_generic]
> -impl_0x49 = ['Infineon', flags_generic, machine_args_generic] -impl_0x4d =
> ['Motorola', flags_generic, machine_args_generic] -impl_0x4e = ['NVIDIA',
> flags_generic, machine_args_generic]
> -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> -impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
> -impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
> -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
> -impl_0x69 = ['Intel', flags_generic, machine_args_generic] -impl_dpaa =
> ['NXP DPAA', flags_dpaa, machine_args_generic]
> +implementer_generic = ['Generic armv8', flags_generic,
> +part_number_config_default]
> +implementer_0x41 = ['Arm', flags_arm, part_number_config_default]
> +implementer_0x42 = ['Broadcom', flags_generic,
> +part_number_config_default]
> +implementer_0x43 = ['Cavium', flags_cavium, part_number_config_cavium]
> +implementer_0x44 = ['DEC', flags_generic, part_number_config_default]
> +implementer_0x49 = ['Infineon', flags_generic,
> +part_number_config_default] implementer_0x4d = ['Motorola',
> +flags_generic, part_number_config_default] implementer_0x4e =
> +['NVIDIA', flags_generic, part_number_config_default]
> +implementer_0x50 = ['Ampere Computing', flags_emag,
> +part_number_config_emag]
> +implementer_0x51 = ['Qualcomm', flags_generic,
> +part_number_config_default]
> +implementer_0x53 = ['Samsung', flags_generic,
> +part_number_config_default]
> +implementer_0x56 = ['Marvell ARMADA', flags_armada,
> +part_number_config_default]
> +implementer_0x69 = ['Intel', flags_generic, part_number_config_default]
> +implementer_dpaa = ['NXP DPAA', flags_dpaa,
> part_number_config_default]
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -142,13 +142,13 @@ else
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
>  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> 
> -	machine = []
> -	cmd_generic = ['generic', '', '', 'default', '']
> +	implementer_config = []
> +	cmd_generic = ['generic', '', '', 'generic', '']
>  	cmd_output = cmd_generic # Set generic by default
>  	machine_args = [] # Clear previous machine args
>  	if arm_force_generic_march and not meson.is_cross_build()
> -		machine = impl_generic
> -		impl_pn = 'default'
> +		implementer_config = implementer_generic
> +		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# The script returns ['Implementer', 'Variant', 'Architecture',
>  		# 'Primary Part number', 'Revision']
> @@ -159,19 +159,19 @@ else
>  			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
> +		implementer_config = get_variable('implementer_' +
> cmd_output[0], ['generic'])
> +		if implementer_config[0] == 'generic'
> +			implementer_config = implementer_generic
>  			cmd_output = cmd_generic
>  		endif
> -		impl_pn = cmd_output[3]
> +		part_number = cmd_output[3]
>  		if arm_force_native_march == true
> -			impl_pn = 'native'
> +			part_number = '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)
> +		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
> +		part_number = meson.get_cross_property('part_number',
> 'generic')
> +		implementer_config = get_variable('implementer_' +
> implementer_id)
>  	endif
> 
>  	# Apply Common Defaults. These settings may be overwritten by
> machine @@ -182,15 +182,15 @@ else
>  		endif
>  	endforeach
> 
> -	message('Implementer : ' + machine[0])
> -	foreach flag: machine[1]
> +	message('Implementer : ' + implementer_config[0])
> +	foreach flag: implementer_config[1]
>  		if flag.length() > 0
>  			dpdk_conf.set(flag[0], flag[1])
>  		endif
>  	endforeach
> 
> -	foreach marg: machine[2]
> -		if marg[0] == impl_pn
> +	foreach marg: implementer_config[2]
> +		if marg[0] == part_number
>  			foreach flag: marg[1]
>  				if cc.has_argument(flag)
>  					machine_args += flag
> --
> 2.20.1

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v5 03/11] build: remove unused or superfluous variables
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 03/11] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-02  7:31           ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2020-11-02  7:31 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, October 28, 2020 10:04 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v5 03/11] build: remove unused or superfluous variables
> 
> Remove variables that were either not used, referenced just once or not
> needed.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 20 +++++++-------------
>  1 file changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> dacbb947b..bd2acfc21 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -3,11 +3,7 @@
>  # Copyright(c) 2017 Cavium, Inc
>  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
> -# for checking defines we need to use the correct compiler flags -march_opt
> = '-march=@0@'.format(machine)
> -
>  arm_force_native_march = false
> -arm_force_generic_march = (machine == 'generic')
> 
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -63,7 +59,6 @@ flags_armada = [
>  	['RTE_MAX_NUMA_NODES', 1],
>  	['RTE_MAX_LCORE', 16]]
> 
> -flags_default_extra = []
>  flags_n1sdp_extra = [
>  	['RTE_MACHINE', '"n1sdp"'],
>  	['RTE_MAX_NUMA_NODES', 1],
> @@ -142,11 +137,9 @@ else
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
>  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> 
> -	implementer_config = []
> -	cmd_generic = ['generic', '', '', 'generic', '']
> -	cmd_output = cmd_generic # Set generic by default
> +	implementer_id = 'generic'
>  	machine_args = [] # Clear previous machine args
> -	if arm_force_generic_march and not meson.is_cross_build()
> +	if machine == 'generic' and not meson.is_cross_build()
>  		implementer_config = implementer_generic
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
> @@ -157,14 +150,15 @@ else
>  		cmd = run_command(detect_vendor.path())
>  		if cmd.returncode() == 0
>  			cmd_output = cmd.stdout().to_lower().strip().split(' ')
> +			implementer_id = cmd_output[0]
> +			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> cmd_output[0], ['generic'])
> +		implementer_config = get_variable('implementer_' +
> implementer_id,
> +['generic'])
>  		if implementer_config[0] == 'generic'
>  			implementer_config = implementer_generic
> -			cmd_output = cmd_generic
> +			part_number = 'generic'
>  		endif
> -		part_number = cmd_output[3]
>  		if arm_force_native_march == true
>  			part_number = 'native'
>  		endif
> @@ -197,7 +191,7 @@ else
>  				endif
>  			endforeach
>  			# Apply any extra machine specific flags.
> -			foreach flag: marg.get(2, flags_default_extra)
> +			foreach flag: marg.get(2, [])
>  				if flag.length() > 0
>  					dpdk_conf.set(flag[0], flag[1])
>  				endif
> --
> 2.20.1
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v5 04/11] build: Arm reformat, comments, move config
  2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 04/11] build: Arm reformat, comments, move config Juraj Linkeš
@ 2020-11-02  8:29           ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2020-11-02  8:29 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, October 28, 2020 10:04 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v5 04/11] build: Arm reformat, comments, move config
> 
> Change formatting so that it's more consistent and readable, add/modify
> comments/stdout messages, move configuration options to more
> appropriate places and make the order consistent according to these rules:
> 1. First list generic configuration options, then list options that may
>    be overwritten. List SoC-specific options last.
> 2. For SoC-specific options, list number of cores before the number of
>    NUMA nodes, to make it consistent with config/meson.build.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 84 +++++++++++++++++++++++++-----------------
>  1 file changed, 51 insertions(+), 33 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> bd2acfc21..c970c8803 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -5,6 +5,7 @@
> 


<snip>

>  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
> implementer_generic = ['Generic armv8', flags_generic,
> part_number_config_default] @@ -128,15 +147,14 @@
> dpdk_conf.set('RTE_ARCH_ARM', 1)
> dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> 
>  if dpdk_conf.get('RTE_ARCH_32')
> +	# armv7 build
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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

The reference to makefile can be removed.

>  	machine_args += '-mfpu=neon'
>  else
> -	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
> -	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> -
> +	# aarch64 build
>  	implementer_id = 'generic'
>  	machine_args = [] # Clear previous machine args
>  	if machine == 'generic' and not meson.is_cross_build() @@ -199,7
> +217,7 @@ else
>  		endif
>  	endforeach
>  endif
> -message(machine_args)
> +message('Using machine args: @0@'.format(machine_args))
> 
>  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
>      cc.get_define('__aarch64__', args: machine_args) != '')
> --
> 2.20.1


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

* [dpdk-dev] [PATCH v6 00/11] Arm build options rework
  2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
                           ` (10 preceding siblings ...)
  2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags Juraj Linkeš
@ 2020-11-02 13:21         ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 01/11] build: alias default build as generic Juraj Linkeš
                             ` (11 more replies)
  11 siblings, 12 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in cross files.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs must be done using
  cross-files
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

Juraj Linkeš (11):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: use dict in Arm part number config
  build: streamline Arm build setup and machine args
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: disable libnuma in cross builds

 buildtools/get_cpu_count.py               |   7 +
 buildtools/get_numa_count.py              |  22 ++
 buildtools/meson.build                    |   2 +
 config/arm/arm64_armada_linux_gcc         |   7 +-
 config/arm/arm64_armv8_linux_gcc          |  18 +-
 config/arm/arm64_bluefield_linux_gcc      |   7 +-
 config/arm/arm64_dpaa_linux_gcc           |   6 +-
 config/arm/arm64_emag_linux_gcc           |   5 +-
 config/arm/arm64_n1sdp_linux_gcc          |   7 +-
 config/arm/arm64_octeontx2_linux_gcc      |   7 +-
 config/arm/arm64_stingray_linux_gcc       |   7 +-
 config/arm/arm64_thunderx2_linux_gcc      |   6 +-
 config/arm/arm64_thunderx_linux_gcc       |   5 +-
 config/arm/meson.build                    | 296 +++++++++++-----------
 config/meson.build                        |  75 +++++-
 config/x86/meson.build                    |   2 +
 doc/guides/prog_guide/build-sdk-meson.rst |   4 +-
 drivers/meson.build                       |   6 +-
 meson.build                               |   1 +
 meson_options.txt                         |  10 +-
 20 files changed, 327 insertions(+), 173 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 01/11] build: alias default build as generic
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 02/11] build: rename Arm build variables Juraj Linkeš
                             ` (10 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build                    | 5 +++--
 config/meson.build                        | 9 +++++----
 doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
 meson_options.txt                         | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index b49203fa8..4fd32f0ca 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -145,7 +146,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..c7f7aa6e2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +83,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 3429e2647..c7e12eedf 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
 
 	meson -Denable_docs=true fullbuild  # build and install docs
 
-	meson -Dmachine=default  # use builder-independent baseline -march
+	meson -Dmachine=generic  # use builder-independent baseline -march
 
 	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
 					# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
         re-scan from meson.
 
 .. note::
-        machine=default uses a config that works on all supported architectures
+        machine=generic uses a config that works on all supported architectures
         regardless of the capabilities of the machine where the build is happening.
 
 As well as those settings taken from ``meson configure``, other options
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..ce23289e3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
 option('lib_musdk_dir', type: 'string', value: '',
 	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
-	description: 'set the target machine type')
+	description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
 option('max_lcores', type: 'integer', value: 128,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 02/11] build: rename Arm build variables
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 01/11] build: alias default build as generic Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 03/11] build: remove unused or superfluous variables Juraj Linkeš
                             ` (9 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 110 +++++++++++++--------------
 11 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4fd32f0ca..b84d122a0 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -30,57 +30,57 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_n1sdp_extra = [
+flags_part_number_default = []
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
-flags_thunderx_extra = [
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
@@ -88,8 +88,8 @@ flags_octeontx2_extra = [
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -98,36 +98,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_n1sdp_extra]]
+	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -142,13 +142,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -159,19 +159,19 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
@@ -182,22 +182,22 @@ else
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 03/11] build: remove unused or superfluous variables
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 01/11] build: alias default build as generic Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 02/11] build: rename Arm build variables Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 04/11] build: reformat and move Arm config and comments Juraj Linkeš
                             ` (8 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index b84d122a0..2347908ed 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -63,7 +59,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"n1sdp"'],
 	['RTE_MAX_NUMA_NODES', 1],
@@ -142,11 +137,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -157,14 +150,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -197,7 +191,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 04/11] build: reformat and move Arm config and comments
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (2 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 03/11] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 05/11] build: simplify how Arm flags are processed Juraj Linkeš
                             ` (7 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 2347908ed..91e4ea222 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,6 +5,7 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
@@ -12,8 +13,8 @@ flags_common_default = [
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -24,65 +25,82 @@ flags_common_default = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"n1sdp"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 4],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_LCORE', 4],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -93,8 +111,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -102,13 +120,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
@@ -128,15 +147,13 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
@@ -199,7 +216,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 05/11] build: simplify how Arm flags are processed
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (3 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 04/11] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 06/11] build: use dict in Arm part number config Juraj Linkeš
                             ` (6 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 91e4ea222..6d9236a7f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -155,7 +155,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
@@ -185,34 +184,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_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('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common_default + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 06/11] build: use dict in Arm part number config
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (4 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 05/11] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 07/11] build: streamline Arm build setup and machine args Juraj Linkeš
                             ` (5 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of iterating over all elements in the
list. Fallback to generic part number if the discovered part number is
unknown.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6d9236a7f..8dc946761 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -101,31 +101,31 @@ flags_part_number_octeontx2 = [
 ]
 
 # arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+part_number_config_arm = {
+	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
+	'native': [['-march=native']],
+	'0xd03': [['-mcpu=cortex-a53']],
+	'0xd04': [['-mcpu=cortex-a35']],
+	'0xd07': [['-mcpu=cortex-a57']],
+	'0xd08': [['-mcpu=cortex-a72']],
+	'0xd09': [['-mcpu=cortex-a73']],
+	'0xd0a': [['-mcpu=cortex-a75']],
+	'0xd0b': [['-mcpu=cortex-a76']],
+	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+}
+part_number_config_cavium = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
+	'native': [['-march=native']],
+	'0xa1': [['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	'0xa2': [['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	'0xa3': [['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+}
+part_number_config_emag = {
+	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	'native': [['-march=native']]
+}
 
 ## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
@@ -187,22 +187,33 @@ else
 	message('Arm implementer: ' + implementer_config[0])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config[2]
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
 	dpdk_flags = flags_common_default + implementer_config[1]
+	if part_number_config.length() > 1
+		# add extra flags from the part number
+		dpdk_flags += part_number_config[1]
+	endif
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config[0]
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 07/11] build: streamline Arm build setup and machine args
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (5 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 06/11] build: use dict in Arm part number config Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
                             ` (4 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Modify the Arm build system so it satisfies the following:
* Use predefined configuration values and predefined machine args the
  generic portable build.
* Use configuration values based on MIDR and native machine args for
  native builds.
* Use configuration values and machine args based on MIDR implementer ID
  and part number specified in cross files for cross builds. Require
  these to be specified.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc   |   1 +
 config/arm/arm64_dpaa_linux_gcc     |   1 +
 config/arm/arm64_emag_linux_gcc     |   1 +
 config/arm/arm64_thunderx_linux_gcc |   1 +
 config/arm/meson.build              | 158 +++++++++++++---------------
 5 files changed, 80 insertions(+), 82 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..52214f2d8 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+part_number = 'generic'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..29f1581de 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+part_number = 'generic'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..14ecf9a12 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = 'generic'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 670764437..6fa29886d 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 8dc946761..4cb5274b1 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,8 +3,6 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -28,6 +26,8 @@ flags_common_default = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+generic_machine_args = ['-march=armv8-a+crc', '-moutline-atomics']
+native_machine_args = ['-march=native', '-mtune=native']
 
 # implementer specific aarch64 flags, with middle priority
 # (will overwrite common flags)
@@ -101,47 +101,46 @@ flags_part_number_octeontx2 = [
 ]
 
 # arm config (implementer 0x41) is the default config
-part_number_config_arm = {
-	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
-	'native': [['-march=native']],
-	'0xd03': [['-mcpu=cortex-a53']],
-	'0xd04': [['-mcpu=cortex-a35']],
-	'0xd07': [['-mcpu=cortex-a57']],
-	'0xd08': [['-mcpu=cortex-a72']],
-	'0xd09': [['-mcpu=cortex-a73']],
-	'0xd0a': [['-mcpu=cortex-a75']],
-	'0xd0b': [['-mcpu=cortex-a76']],
-	'0xd0c': [['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-}
-part_number_config_cavium = {
-	'generic': [['-march=armv8-a+crc+crypto', '-mcpu=thunderx']],
-	'native': [['-march=native']],
-	'0xa1': [['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	'0xa2': [['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	'0xa3': [['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	'0xaf': [['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	'0xb2': [['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+part_number_machine_args = {
+	'0xd03': ['-mcpu=cortex-a53'],
+	'0xd04': ['-mcpu=cortex-a35'],
+	'0xd07': ['-mcpu=cortex-a57'],
+	'0xd08': ['-mcpu=cortex-a72'],
+	'0xd09': ['-mcpu=cortex-a73'],
+	'0xd0a': ['-mcpu=cortex-a75'],
+	'0xd0b': ['-mcpu=cortex-a76'],
+	'0xd0c': ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-n1'],
+	'0xa1': ['-mcpu=thunderxt88'],
+	'0xa2': ['-mcpu=thunderxt81'],
+	'0xa3': ['-mcpu=thunderxt83'],
+	'0xaf': ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
+	'0xb2': ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2']
 }
-part_number_config_emag = {
-	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	'native': [['-march=native']]
+
+part_number_flags = {
+	'0xd0c': flags_part_number_n1generic,
+	'0xa1': flags_part_number_thunderx,
+	'0xa2': flags_part_number_thunderx,
+	'0xa3': flags_part_number_thunderx,
+	'0xaf': flags_part_number_thunderx2,
+	'0xb2': flags_part_number_octeontx2
 }
 
 ## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+implementer_generic = ['Generic armv8', flags_implementer_generic]
+implementer_0x41 = ['Arm', flags_implementer_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic]
+implementer_0x43 = ['Cavium', flags_implementer_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic]
+implementer_0x49 = ['Infineon', flags_implementer_generic]
+implementer_0x4d = ['Motorola', flags_implementer_generic]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic]
+implementer_0x53 = ['Samsung', flags_implementer_generic]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada]
+implementer_0x69 = ['Intel', flags_implementer_generic]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -154,69 +153,64 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
-	if machine == 'generic' and not meson.is_cross_build()
-		implementer_config = implementer_generic
-		part_number = 'generic'
-	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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic native build
 			implementer_config = implementer_generic
 			part_number = 'generic'
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			target_machine_args = generic_machine_args
+		else
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Failed to get Arm MIDR information.')
+			endif
+			# Set to generic if implementer is not found
+			implementer_config = get_variable('implementer_' + implementer_id, implementer_generic)
+			target_machine_args = native_machine_args
 		endif
 	else
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
+		# cross build
+		implementer_id = meson.get_cross_property('implementer_id', '')
+		if implementer_id == ''
+			error('Arm implementer ID must be specified in the cross file.')
+		endif
 		implementer_config = get_variable('implementer_' + implementer_id)
+		part_number = meson.get_cross_property('part_number', '')
+		if part_number == ''
+			error('Arm part number must be specified in the cross file.')
+		elif part_number == 'generic'
+			target_machine_args = generic_machine_args
+		else
+			target_machine_args = part_number_machine_args[part_number]
+		endif
 	endif
 
 	message('Arm implementer: ' + implementer_config[0])
 	message('Arm part number: ' + part_number)
 
-	part_number_config = implementer_config[2]
-	if part_number_config.has_key(part_number)
-		# use the specified part_number machine args if found
-		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
-	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
-	endif
-
-	# use default flags with implementer flags
 	dpdk_flags = flags_common_default + implementer_config[1]
-	if part_number_config.length() > 1
-		# add extra flags from the part number
-		dpdk_flags += part_number_config[1]
+	if part_number_flags.has_key(part_number)
+		dpdk_flags += part_number_flags[part_number]
 	endif
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config[0]
+	foreach flag: target_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
 	endforeach
 
+	# use default flags with implementer flags and part number flags
 	# apply flags
 	foreach flag: dpdk_flags
 		if flag.length() > 0
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 08/11] build: optional NUMA and cpu counts detection
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (6 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 07/11] build: streamline Arm build setup and machine args Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 14:44             ` Bruce Richardson
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 09/11] build: add core and NUMA counts to cross files Juraj Linkeš
                             ` (3 subsequent siblings)
  11 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..b269d557b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..be73c5c3f
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index c7f7aa6e2..700e32b00 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,8 +231,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -251,6 +249,51 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+max_numa_nodes = get_option('max_numa_nodes')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovered values (user setting -1) are not supported be used when cross-compiling.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+	min_lcores = 2
+	# DPDK must be build for at least 2 cores
+	if max_lcores < min_lcores
+		message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+		max_lcores = min_lcores
+	else
+		message('Found @0@ cores'.format(max_lcores))
+	endif
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+endif
+
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovered values (user setting -1) are not supported be used when cross-compiling.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+	message('Found @0@ numa nodes'.format(max_numa_nodes))
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
+
+# check that cpu and numa count is set and error out if it's not set
+if not dpdk_conf.has('RTE_MAX_LCORE')
+	error('Number of cores not specified.')
+endif
+if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+	error('Number of numa nodes not specified.')
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index ce23289e3..e1059fb16 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 09/11] build: add core and NUMA counts to cross files
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (7 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 10/11] build: disable Arm drivers Juraj Linkeš
                             ` (2 subsequent siblings)
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc    |  2 ++
 config/arm/arm64_armv8_linux_gcc     |  6 ++++++
 config/arm/arm64_bluefield_linux_gcc |  2 ++
 config/arm/arm64_dpaa_linux_gcc      |  2 ++
 config/arm/arm64_emag_linux_gcc      |  2 ++
 config/arm/arm64_n1sdp_linux_gcc     |  2 ++
 config/arm/arm64_octeontx2_linux_gcc |  2 ++
 config/arm/arm64_stingray_linux_gcc  |  2 ++
 config/arm/arm64_thunderx2_linux_gcc |  2 ++
 config/arm/arm64_thunderx_linux_gcc  |  2 ++
 config/arm/meson.build               |  6 ++++--
 config/meson.build                   | 15 +++++++++++++++
 12 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52214f2d8..381971cc5 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x56'
 part_number = 'generic'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..779333199 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -26,3 +26,9 @@ implementer_id = 'generic'
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
 part_number = 'generic'
+
+# Supported extra configuration
+# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+# max_lcores = n      # will set RTE_MAX_LCORE
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 29f1581de..79e1ddb95 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = 'dpaa'
 part_number = 'generic'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 14ecf9a12..23a4a7971 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = 'generic'
+max_numa_nodes = 1
+max_lcores = 32
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..3a8b46812 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_numa_nodes = 1
+max_lcores = 4
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..2baf95a2a 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_numa_nodes = 1
+max_lcores = 36
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..7ff6fd309 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_numa_nodes = 1
+max_lcores = 16
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..07440fe5f 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_numa_nodes = 2
+max_lcores = 256
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6fa29886d..b9c55d60f 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = 'generic'
+max_numa_nodes = 1
+max_lcores = 96
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4cb5274b1..e65d06e5d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -35,13 +35,15 @@ flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
+	['RTE_MAX_LCORE', 256],
+	['RTE_MAX_NUMA_NODES', 4]
 ]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
 ]
 flags_implementer_cavium = [
 	['RTE_MAX_VFIO_GROUPS', 128],
diff --git a/config/meson.build b/config/meson.build
index 700e32b00..7b822890a 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -249,6 +249,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_NUMA_NODES and RTE_MAX_LCORE from cross file
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+endif
+
 max_lcores = get_option('max_lcores')
 max_numa_nodes = get_option('max_numa_nodes')
 if max_lcores > 0
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 10/11] build: disable Arm drivers
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (8 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 09/11] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 11/11] build: disable libnuma in cross builds Juraj Linkeš
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works. Remove
unneeded driver options ported from the old makefile system.
Add support for removing drivers for cross builds.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/arm64_armada_linux_gcc | 1 +
 config/arm/arm64_armv8_linux_gcc  | 3 +++
 config/arm/meson.build            | 8 +++-----
 drivers/meson.build               | 6 +++++-
 meson.build                       | 1 +
 5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 381971cc5..5adf27cd7 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = '0x56'
 part_number = 'generic'
 max_numa_nodes = 1
 max_lcores = 16
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 779333199..72cb4cd5d 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -32,3 +32,6 @@ part_number = 'generic'
 # max_lcores = n      # will set RTE_MAX_LCORE
 max_lcores = 256
 max_numa_nodes = 4
+
+# disabled_drivers = ['bus/dpaa', 'crypto']
+    # add to the set of disabled libraries
diff --git a/config/arm/meson.build b/config/arm/meson.build
index e65d06e5d..30088ee68 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,6 +3,9 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k', 'net/sfc']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -17,10 +20,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_SFC_EFX', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -97,7 +96,6 @@ flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
 	['RTE_MAX_LCORE', 36],
 	['RTE_MAX_NUMA_NODES', 1]
 ]
diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..a997387ad 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v6 11/11] build: disable libnuma in cross builds
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (9 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 10/11] build: disable Arm drivers Juraj Linkeš
@ 2020-11-02 13:21           ` Juraj Linkeš
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
  11 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-02 13:21 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disabled NUMA in Arm cross files.

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

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 5adf27cd7..90d9eed75 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,4 +18,5 @@ implementer_id = '0x56'
 part_number = 'generic'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 72cb4cd5d..844685c10 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -33,5 +33,6 @@ part_number = 'generic'
 max_lcores = 256
 max_numa_nodes = 4
 
+# has_libnuma = 0      # set to 0 if the SoC is not a NUMA system
 # disabled_drivers = ['bus/dpaa', 'crypto']
     # add to the set of disabled libraries
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 79e1ddb95..5e28da16b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = 'dpaa'
 part_number = 'generic'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 3a8b46812..4493227f3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_numa_nodes = 1
 max_lcores = 4
+has_libnuma = 0
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 2baf95a2a..ff9e5c403 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_numa_nodes = 1
 max_lcores = 36
+has_libnuma = 0
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 7ff6fd309..e154ac4fd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_numa_nodes = 1
 max_lcores = 16
+has_libnuma = 0
diff --git a/config/meson.build b/config/meson.build
index 7b822890a..c1b9f7667 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -262,6 +262,10 @@ if meson.is_cross_build()
 		message('Setting RTE_MAX_LCORE from cross file')
 		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
 	endif
+	cross_has_libnuma = meson.get_cross_property('has_libnuma', '')
+	if cross_has_libnuma != ''
+		has_libnuma = cross_has_libnuma
+	endif
 endif
 
 max_lcores = get_option('max_lcores')
-- 
2.20.1


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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-10-29  4:31             ` Honnappa Nagarahalli
@ 2020-11-02 13:55               ` Bruce Richardson
  2020-11-02 19:01                 ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-02 13:55 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, dev, nd

On Thu, Oct 29, 2020 at 04:31:33AM +0000, Honnappa Nagarahalli wrote:
> <snip>
> 
> > > >
> > > > On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> > > > > The build machine's number of cpus and numa nodes vary, resulting
> > > > > in mismatched counts of RTE_MAX_LCORE and
> > RTE_MAX_NUMA_NODES for
> > > > many
> > > > > builds. Automatically discover the host's numa and cpu counts to
> > > > > remove this mismatch for native builds. Use current defaults for default
> > builds.
> > > > > Force the users to specify the counts for cross build in cross
> > > > > files or on the command line.
> > > > > Give users the option to override the discovery or values from
> > > > > cross files by specifying them on the command line with
> > > > > -Dmax_lcores and -Dmax_numa_nodes.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > ---
> > > > >  buildtools/get_cpu_count.py  |  7 ++++++
> > > > > buildtools/get_numa_count.py | 22 +++++++++++++++++++
> > > > >  buildtools/meson.build       |  2 ++
> > > > >  config/meson.build           | 42
> > ++++++++++++++++++++++++++++++++++--
> > > > >  meson_options.txt            |  8 +++----
> > > > >  5 files changed, 75 insertions(+), 6 deletions(-)  create mode
> > > > > 100644 buildtools/get_cpu_count.py  create mode 100644
> > > > > buildtools/get_numa_count.py
> > > > >
> > > > > diff --git a/buildtools/get_cpu_count.py
> > > > > b/buildtools/get_cpu_count.py new file mode 100644 index
> > > > > 000000000..386f85f8b
> > > > > --- /dev/null
> > > > > +++ b/buildtools/get_cpu_count.py
> > > > > @@ -0,0 +1,7 @@
> > > > > +#!/usr/bin/python3
> > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > +PANTHEON.tech s.r.o.
> > > > > +
> > > > > +import os
> > > > > +
> > > > > +print(os.cpu_count())
> > > > > diff --git a/buildtools/get_numa_count.py
> > > > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > > > 000000000..f0c49973a
> > > > > --- /dev/null
> > > > > +++ b/buildtools/get_numa_count.py
> > > > > @@ -0,0 +1,22 @@
> > > > > +#!/usr/bin/python3
> > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > +PANTHEON.tech s.r.o.
> > > > > +
> > > > > +import ctypes
> > > > > +import glob
> > > > > +import os
> > > > > +import subprocess
> > > > > +
> > > > > +if os.name == 'posix':
> > > > > +    if os.path.isdir('/sys/devices/system/node'):
> > > > > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > > > > +    else:
> > > > > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > > > > +capture_output=True).stdout)
> > > > > +
> > > > > +elif os.name == 'nt':
> > > > > +    libkernel32 = ctypes.windll.kernel32
> > > > > +
> > > > > +    count = ctypes.c_ulong()
> > > > > +
> > > > > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > > > > +    print(count.value + 1)
> > > > > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > > > > 04808dabc..925e733b1 100644
> > > > > --- a/buildtools/meson.build
> > > > > +++ b/buildtools/meson.build
> > > > > @@ -17,3 +17,5 @@ else
> > > > >  endif
> > > > >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper =
> > > > > py3 +
> > > > > files('call-sphinx-build.py')
> > > > > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > > > > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > > > > diff --git a/config/meson.build b/config/meson.build index
> > > > > a57c8ae9e..c4477f977 100644
> > > > > --- a/config/meson.build
> > > > > +++ b/config/meson.build
> > > > > @@ -74,7 +74,11 @@ endif
> > > > >  # still being able to support the CPU features required for DPDK.
> > > > >  # This can be bumped up by the DPDK project, but it can never be
> > > > > an # invariant like 'native'
> > > > > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > > > > +get_option('max_numa_nodes')
> > > > >  if machine == 'default'
> > > > > +	max_numa_nodes = 4
> > > > > +	max_lcores = 128
> > > >
> > > > This doesn't seem right, since you are overriding the user-specified
> > > > values with hard-coded ones.
> > > >
> > >
> > > I understand we're using the default build/generic to build portalbe dpdk
> > distro packages, meaning the settings for those packages should always be
> > the same, no? If not, what should the default/generic build be? And when
> > would someone do a default/generic build with their values? It wouldn't be a
> > default/generic anymore, right?
> > >
> > > > >  	if host_machine.cpu_family().startswith('x86')
> > > > >  		# matches the old pre-meson build systems default
> > > > >  		machine = 'corei7'
> > > > > @@ -83,6 +87,22 @@ if machine == 'default'
> > > > >  	elif host_machine.cpu_family().startswith('ppc')
> > > > >  		machine = 'power8'
> > > > >  	endif
> > > > > +elif not meson.is_cross_build()
> > > > > +	# find host core count and numa node count for native builds
> > > > > +	if max_lcores == 0
> > > > > +		max_lcores =
> > > > run_command(get_cpu_count_cmd).stdout().to_int()
> > > > > +		min_lcores = 2
> > > > > +		if max_lcores < min_lcores
> > > > > +			message('Found less than @0@ cores, building for
> > > > @0@ cores'.format(min_lcores))
> > > > > +			max_lcores = min_lcores
> > > > > +		else
> > > > > +			message('Found @0@ cores'.format(max_lcores))
> > > > > +		endif
> > > > > +	endif
> > > > > +	if max_numa_nodes == 0
> > > > > +		max_numa_nodes =
> > > > run_command(get_numa_count_cmd).stdout().to_int()
> > > > > +		message('Found @0@ numa
> > nodes'.format(max_numa_nodes))
> > > > > +	endif
> > > > >  endif
> > > > >
> > > > >  dpdk_conf.set('RTE_MACHINE', machine) @@ -227,8 +247,10 @@
> > > > > foreach
> > > > > arg: warning_flags  endforeach
> > > > >
> > > > >  # set other values pulled from the build options
> > > > > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > > > > -dpdk_conf.set('RTE_MAX_NUMA_NODES',
> > get_option('max_numa_nodes'))
> > > > > +if not meson.is_cross_build()
> > > > > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
> > endif
> > > >
> > > > Rather than conditionally setting the value here, you should move
> > > > the checks below up above this to simplify things.
> > > >
> > >
> > > Do you mean the cross build checks? Those have to be after
> > subdir(arch_subdir) so that we can override the values from cross files (as
> > the commit message says).
> > >
> > > > >  dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > > > > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > > > > dpdk_conf.set('RTE_ENABLE_TRACE_FP',
> > > > > get_option('enable_trace_fp')) @@
> > > > > -247,6 +269,22 @@ compile_time_cpuflags = []
> > > > >  subdir(arch_subdir)
> > > > >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > > > > ','.join(compile_time_cpuflags))
> > > > >
> > > > > +# check that cpu and numa count is set in cross builds if
> > > > > +meson.is_cross_build()
> > > > > +    	if max_lcores > 0
> > > > > +		# specified on the cmdline
> > > > > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > > +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> > > > > +		error('Number of cores for cross build not specified in @0@
> > > > subdir (e.g. in a cross-file) nor on the
> > > > cmdline'.format(arch_subdir))
> > > > > +	endif
> > > > > +	if max_numa_nodes > 0
> > > > > +		# specified on the cmdline
> > > > > +		dpdk_conf.set('RTE_MAX_NUMA_NODES',
> > max_numa_nodes)
> > > > > +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > > > > +		error('Number of numa nodes for cross build not specified in
> > > > @0@ subdir (e.g. in a cross-file) nor on the
> > > > cmdline'.format(arch_subdir))
> > > > > +	endif
> > > > > +endif
> > > > > +
> > > > >  # set the install path for the drivers
> > > > > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> > > > >
> > > > > diff --git a/meson_options.txt b/meson_options.txt index
> > > > > 9bf18ab6b..01b0c45c3 100644
> > > > > --- a/meson_options.txt
> > > > > +++ b/meson_options.txt
> > > > > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> > > > >  	description: 'set the target machine type')
> > > > > option('max_ethports',
> > > > > type: 'integer', value: 32,
> > > > >  	description: 'maximum number of Ethernet devices')
> > > > > -option('max_lcores', type: 'integer', value: 128,
> > > > > -	description: 'maximum number of cores/threads supported by EAL')
> > > > > -option('max_numa_nodes', type: 'integer', value: 4,
> > > > > -	description: 'maximum number of NUMA nodes supported by EAL')
> > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > > +Value 0 means the number of cpus on the host will be used. For
> > > > > +cross build,
> > > > set to non-zero to overwrite the cross-file value.')
> > > > option('max_numa_nodes',
> > > > type: 'integer', value: 0,
> > > > > +	description: 'maximum number of NUMA nodes supported by EAL.
> > > > > +Value
> > > > 0
> > > > > +means the number of numa nodes on the host will be used. For
> > > > > +cross build, set to non-zero to overwrite the cross-file value.')
> > > >
> > > > I don't like this change, because it very much assumes for
> > > > non-cross-compiles that people will be running DPDK on the system
> > > > they build it on. That's a very, very big assumption!
> > >
> > > I'll be using definitions from https://mesonbuild.com/Cross-
> > compilation.html.
> > > I understand cross compilation to be building for a diffent host machine
> > than the build machine (which is aligned with pretty much every definition I
> > found). I understand this to be true not only for builds between
> > architectures, but also within an architecture (e.g. x86_64 build machine
> > building for x86_64 host machine).
> > > So yes, when someone does a native build, it stands to reason they want to
> > use it on the build machine. If they wanted to use it elsewhere, they would
> > cross compile.
> > > Another thing is the current build philosophy is to detect as much as
> > possible (not having statically defined configuration, as you mentioned in the
> > past). Detecting the number of cores and numa nodes fits this perfectly.
> > > And yet another thing is that the assumption seems to be already present
> > in the build system - it already detects a lot things, some of which may not be
> > satisfied on machines other than the build machine. I may be wrong about
> > this.
> > >
> > > > I'm ok with having zero as a "detect" option, and having the values
> > > > overridden from cross-files, but not with detection as the default
> > > > out- of-the-box option! Lots of users may pull builds from a CI
> > > > based on VMs with just a few cores, for instance.
> > >
> > > If not having the automatic detection is a concern because of users using CI
> > builds, then we (if it's from our CI) can change what we're building in CI - the
> > default/generic build seems like a good fit because it's supposed to work on
> > a variety of systems. Expecting that native build from random VMs would
> > work anywhere doesn't seen very realistic - it's been build for that VM
> > environment (because it's a native build).
> > >
> > > Here's my understanding on which the current version is based:
> > > 1. Since we want to get away from having statically defined configuration,
> > numa and core count discovery is exactly what we should have in the build
> > system. Since discorery is currently the default for lib/drivers, it stands to
> > reason it should be default for everything else, if possible.
> > > 2. Native build should produce binaries matching the build machine as well
> > as possible.
> > > 3. Default/generic build should produce binaries executable on a range of
> > systems (ideally all systems of a given architecture).
> > > 4. Other builds, that is non-native builds, are cross-compilation, since we're
> > building for host machine other that the build machine.
> > >
> > > What I haven't taken into account is users using CI builds. That could be
> > remedied by modifying the CI a bit while being consistent with what
> > native/default/generic/cross builds are (or should be). And in any case, if
> > we're not interested in testing the exact CI environment (which we aren't,
> > since we don't want to use 2 cores with 1 numa), we really shouldn't be doing
> > native builds there.
> > >
> > > I'm interested in hearing where my thinking deviates from yours.
> > >
> > 
> > There are a number of points in which we differ, I think.
> > 
> > Firstly, the use of "native" and "default/generic" for the "machine"
> > parameter refers only to the instruction-set level from the compiler, and
> > should not affect any other settings, since all settings are independent.
> > Therefore, setting "machine" to "native" does not mean that we should
> > detect cores and numa nodes, and similarly setting it to "default" does not
> > mean that we should ignore the settings for these values and pick our own
> > chosen default values.
> Apologies to go to an older discussion.
> I am trying to understand the definitions/expectations for 'native' and 'generic' builds.
> As you say, instruction-set level is definitely one parameter.

Part of the confusion arises from the fact that originally that was the
only parameter set by this - and on x86 it still is. Perhaps this parameter
needs to be renamed to "isa-level" or "architecture-flag" or similar to
reflect its meaning. This would then allow a new "machine" setting, which
can be considered separately. The question then is how much that helps with
the main issue under discussion, that of cores and numa node values.

> But, I think other DPDK specific parameters should also be considered.
> For ex: RTE_MAX_LCORE should have a particular value for 'generic' build in all the supported architectures. The value could be different for each architecture, but it is fixed for the 'generic' build for a given architecture. Otherwise, the 'generic' build might not run on all the machines of that architecture.
> 
> Similarly, for 'native' build, is there any reason not to include other DPDK parameters as part of the definition? IMO, 'native' should refer to the entire build machine, not just the ISA. i.e. build on the target machine.
> 

While I understand the idea here, it is somewhat complicated by the fact
that the meson options given in "meson_options.txt" cannot be set by meson
code, which means that when we change the machine flag to "native" we can
only use or ignore the user-provided lcores and numa nodes setting - we
have no way to change them and reflect those changes back to the user. :-(
This leads to the situation in the discussion in this thread, where we
start needing all sorts of magic values to indicate use of machine-type
defaults or detected defaults.

Regards,
/Bruce

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

* Re: [dpdk-dev] [PATCH v6 08/11] build: optional NUMA and cpu counts detection
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-02 14:44             ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-02 14:44 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, dev

On Mon, Nov 02, 2020 at 02:21:15PM +0100, Juraj Linkeš wrote:
> Add an option to automatically discover the host's numa and cpu counts
> and use those values for a non cross-build.
> Give users the option to override the per-arch default values or values
> from cross files by specifying them on the command line with -Dmax_lcores
> and -Dmax_numa_nodes.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  buildtools/get_cpu_count.py  |  7 ++++++
>  buildtools/get_numa_count.py | 22 +++++++++++++++++
>  buildtools/meson.build       |  2 ++
>  config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
>  config/x86/meson.build       |  2 ++
>  meson_options.txt            |  8 +++---
>  6 files changed, 82 insertions(+), 6 deletions(-)
>  create mode 100644 buildtools/get_cpu_count.py
>  create mode 100644 buildtools/get_numa_count.py
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-11-02 13:55               ` Bruce Richardson
@ 2020-11-02 19:01                 ` Honnappa Nagarahalli
  2020-11-03  9:44                   ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-02 19:01 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > > > >
> > > > > On Wed, Oct 21, 2020 at 01:37:38PM +0200, Juraj Linkeš wrote:
> > > > > > The build machine's number of cpus and numa nodes vary,
> > > > > > resulting in mismatched counts of RTE_MAX_LCORE and
> > > RTE_MAX_NUMA_NODES for
> > > > > many
> > > > > > builds. Automatically discover the host's numa and cpu counts
> > > > > > to remove this mismatch for native builds. Use current
> > > > > > defaults for default
> > > builds.
> > > > > > Force the users to specify the counts for cross build in cross
> > > > > > files or on the command line.
> > > > > > Give users the option to override the discovery or values from
> > > > > > cross files by specifying them on the command line with
> > > > > > -Dmax_lcores and -Dmax_numa_nodes.
> > > > > >
> > > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > > ---
> > > > > >  buildtools/get_cpu_count.py  |  7 ++++++
> > > > > > buildtools/get_numa_count.py | 22 +++++++++++++++++++
> > > > > >  buildtools/meson.build       |  2 ++
> > > > > >  config/meson.build           | 42
> > > ++++++++++++++++++++++++++++++++++--
> > > > > >  meson_options.txt            |  8 +++----
> > > > > >  5 files changed, 75 insertions(+), 6 deletions(-)  create
> > > > > > mode
> > > > > > 100644 buildtools/get_cpu_count.py  create mode 100644
> > > > > > buildtools/get_numa_count.py
> > > > > >
> > > > > > diff --git a/buildtools/get_cpu_count.py
> > > > > > b/buildtools/get_cpu_count.py new file mode 100644 index
> > > > > > 000000000..386f85f8b
> > > > > > --- /dev/null
> > > > > > +++ b/buildtools/get_cpu_count.py
> > > > > > @@ -0,0 +1,7 @@
> > > > > > +#!/usr/bin/python3
> > > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > > +PANTHEON.tech s.r.o.
> > > > > > +
> > > > > > +import os
> > > > > > +
> > > > > > +print(os.cpu_count())
> > > > > > diff --git a/buildtools/get_numa_count.py
> > > > > > b/buildtools/get_numa_count.py new file mode 100644 index
> > > > > > 000000000..f0c49973a
> > > > > > --- /dev/null
> > > > > > +++ b/buildtools/get_numa_count.py
> > > > > > @@ -0,0 +1,22 @@
> > > > > > +#!/usr/bin/python3
> > > > > > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > > > > > +PANTHEON.tech s.r.o.
> > > > > > +
> > > > > > +import ctypes
> > > > > > +import glob
> > > > > > +import os
> > > > > > +import subprocess
> > > > > > +
> > > > > > +if os.name == 'posix':
> > > > > > +    if os.path.isdir('/sys/devices/system/node'):
> > > > > > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > > > > > +    else:
> > > > > > +        print(subprocess.run(['sysctl', 'vm.ndomains'],
> > > > > > +capture_output=True).stdout)
> > > > > > +
> > > > > > +elif os.name == 'nt':
> > > > > > +    libkernel32 = ctypes.windll.kernel32
> > > > > > +
> > > > > > +    count = ctypes.c_ulong()
> > > > > > +
> > > > > > +
> libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > > > > > +    print(count.value + 1)
> > > > > > diff --git a/buildtools/meson.build b/buildtools/meson.build
> > > > > > index
> > > > > > 04808dabc..925e733b1 100644
> > > > > > --- a/buildtools/meson.build
> > > > > > +++ b/buildtools/meson.build
> > > > > > @@ -17,3 +17,5 @@ else
> > > > > >  endif
> > > > > >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper
> > > > > > =
> > > > > > py3 +
> > > > > > files('call-sphinx-build.py')
> > > > > > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > > > > > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > > > > > diff --git a/config/meson.build b/config/meson.build index
> > > > > > a57c8ae9e..c4477f977 100644
> > > > > > --- a/config/meson.build
> > > > > > +++ b/config/meson.build
> > > > > > @@ -74,7 +74,11 @@ endif
> > > > > >  # still being able to support the CPU features required for DPDK.
> > > > > >  # This can be bumped up by the DPDK project, but it can never
> > > > > > be an # invariant like 'native'
> > > > > > +max_lcores = get_option('max_lcores') max_numa_nodes =
> > > > > > +get_option('max_numa_nodes')
> > > > > >  if machine == 'default'
> > > > > > +	max_numa_nodes = 4
> > > > > > +	max_lcores = 128
> > > > >
> > > > > This doesn't seem right, since you are overriding the
> > > > > user-specified values with hard-coded ones.
> > > > >
> > > >
> > > > I understand we're using the default build/generic to build
> > > > portalbe dpdk
> > > distro packages, meaning the settings for those packages should
> > > always be the same, no? If not, what should the default/generic
> > > build be? And when would someone do a default/generic build with
> > > their values? It wouldn't be a default/generic anymore, right?
> > > >
> > > > > >  	if host_machine.cpu_family().startswith('x86')
> > > > > >  		# matches the old pre-meson build systems default
> > > > > >  		machine = 'corei7'
> > > > > > @@ -83,6 +87,22 @@ if machine == 'default'
> > > > > >  	elif host_machine.cpu_family().startswith('ppc')
> > > > > >  		machine = 'power8'
> > > > > >  	endif
> > > > > > +elif not meson.is_cross_build()
> > > > > > +	# find host core count and numa node count for native builds
> > > > > > +	if max_lcores == 0
> > > > > > +		max_lcores =
> > > > > run_command(get_cpu_count_cmd).stdout().to_int()
> > > > > > +		min_lcores = 2
> > > > > > +		if max_lcores < min_lcores
> > > > > > +			message('Found less than @0@ cores,
> building for
> > > > > @0@ cores'.format(min_lcores))
> > > > > > +			max_lcores = min_lcores
> > > > > > +		else
> > > > > > +			message('Found @0@
> cores'.format(max_lcores))
> > > > > > +		endif
> > > > > > +	endif
> > > > > > +	if max_numa_nodes == 0
> > > > > > +		max_numa_nodes =
> > > > > run_command(get_numa_count_cmd).stdout().to_int()
> > > > > > +		message('Found @0@ numa
> > > nodes'.format(max_numa_nodes))
> > > > > > +	endif
> > > > > >  endif
> > > > > >
> > > > > >  dpdk_conf.set('RTE_MACHINE', machine) @@ -227,8 +247,10 @@
> > > > > > foreach
> > > > > > arg: warning_flags  endforeach
> > > > > >
> > > > > >  # set other values pulled from the build options
> > > > > > -dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
> > > > > > -dpdk_conf.set('RTE_MAX_NUMA_NODES',
> > > get_option('max_numa_nodes'))
> > > > > > +if not meson.is_cross_build()
> > > > > > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > > > +	dpdk_conf.set('RTE_MAX_NUMA_NODES',
> max_numa_nodes)
> > > endif
> > > > >
> > > > > Rather than conditionally setting the value here, you should
> > > > > move the checks below up above this to simplify things.
> > > > >
> > > >
> > > > Do you mean the cross build checks? Those have to be after
> > > subdir(arch_subdir) so that we can override the values from cross
> > > files (as the commit message says).
> > > >
> > > > > >  dpdk_conf.set('RTE_MAX_ETHPORTS',
> get_option('max_ethports'))
> > > > > > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > > > > > dpdk_conf.set('RTE_ENABLE_TRACE_FP',
> > > > > > get_option('enable_trace_fp')) @@
> > > > > > -247,6 +269,22 @@ compile_time_cpuflags = []
> > > > > >  subdir(arch_subdir)
> > > > > >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > > > > > ','.join(compile_time_cpuflags))
> > > > > >
> > > > > > +# check that cpu and numa count is set in cross builds if
> > > > > > +meson.is_cross_build()
> > > > > > +    	if max_lcores > 0
> > > > > > +		# specified on the cmdline
> > > > > > +		dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
> > > > > > +	elif not dpdk_conf.has('RTE_MAX_LCORE')
> > > > > > +		error('Number of cores for cross build not specified in
> @0@
> > > > > subdir (e.g. in a cross-file) nor on the
> > > > > cmdline'.format(arch_subdir))
> > > > > > +	endif
> > > > > > +	if max_numa_nodes > 0
> > > > > > +		# specified on the cmdline
> > > > > > +		dpdk_conf.set('RTE_MAX_NUMA_NODES',
> > > max_numa_nodes)
> > > > > > +	elif not dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > > > > > +		error('Number of numa nodes for cross build not
> specified
> > > > > > +in
> > > > > @0@ subdir (e.g. in a cross-file) nor on the
> > > > > cmdline'.format(arch_subdir))
> > > > > > +	endif
> > > > > > +endif
> > > > > > +
> > > > > >  # set the install path for the drivers
> > > > > > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> > > > > >
> > > > > > diff --git a/meson_options.txt b/meson_options.txt index
> > > > > > 9bf18ab6b..01b0c45c3 100644
> > > > > > --- a/meson_options.txt
> > > > > > +++ b/meson_options.txt
> > > > > > @@ -26,10 +26,10 @@ option('machine', type: 'string', value:
> 'native',
> > > > > >  	description: 'set the target machine type')
> > > > > > option('max_ethports',
> > > > > > type: 'integer', value: 32,
> > > > > >  	description: 'maximum number of Ethernet devices')
> > > > > > -option('max_lcores', type: 'integer', value: 128,
> > > > > > -	description: 'maximum number of cores/threads supported
> by EAL')
> > > > > > -option('max_numa_nodes', type: 'integer', value: 4,
> > > > > > -	description: 'maximum number of NUMA nodes supported
> by EAL')
> > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > +	description: 'maximum number of cores/threads supported
> by EAL.
> > > > > > +Value 0 means the number of cpus on the host will be used.
> > > > > > +For cross build,
> > > > > set to non-zero to overwrite the cross-file value.')
> > > > > option('max_numa_nodes',
> > > > > type: 'integer', value: 0,
> > > > > > +	description: 'maximum number of NUMA nodes supported
> by EAL.
> > > > > > +Value
> > > > > 0
> > > > > > +means the number of numa nodes on the host will be used. For
> > > > > > +cross build, set to non-zero to overwrite the cross-file
> > > > > > +value.')
> > > > >
> > > > > I don't like this change, because it very much assumes for
> > > > > non-cross-compiles that people will be running DPDK on the
> > > > > system they build it on. That's a very, very big assumption!
> > > >
> > > > I'll be using definitions from https://mesonbuild.com/Cross-
> > > compilation.html.
> > > > I understand cross compilation to be building for a diffent host
> > > > machine
> > > than the build machine (which is aligned with pretty much every
> > > definition I found). I understand this to be true not only for
> > > builds between architectures, but also within an architecture (e.g.
> > > x86_64 build machine building for x86_64 host machine).
> > > > So yes, when someone does a native build, it stands to reason they
> > > > want to
> > > use it on the build machine. If they wanted to use it elsewhere,
> > > they would cross compile.
> > > > Another thing is the current build philosophy is to detect as much
> > > > as
> > > possible (not having statically defined configuration, as you
> > > mentioned in the past). Detecting the number of cores and numa nodes
> fits this perfectly.
> > > > And yet another thing is that the assumption seems to be already
> > > > present
> > > in the build system - it already detects a lot things, some of which
> > > may not be satisfied on machines other than the build machine. I may
> > > be wrong about this.
> > > >
> > > > > I'm ok with having zero as a "detect" option, and having the
> > > > > values overridden from cross-files, but not with detection as
> > > > > the default
> > > > > out- of-the-box option! Lots of users may pull builds from a CI
> > > > > based on VMs with just a few cores, for instance.
> > > >
> > > > If not having the automatic detection is a concern because of
> > > > users using CI
> > > builds, then we (if it's from our CI) can change what we're building
> > > in CI - the default/generic build seems like a good fit because it's
> > > supposed to work on a variety of systems. Expecting that native
> > > build from random VMs would work anywhere doesn't seen very
> > > realistic - it's been build for that VM environment (because it's a native
> build).
> > > >
> > > > Here's my understanding on which the current version is based:
> > > > 1. Since we want to get away from having statically defined
> > > > configuration,
> > > numa and core count discovery is exactly what we should have in the
> > > build system. Since discorery is currently the default for
> > > lib/drivers, it stands to reason it should be default for everything else, if
> possible.
> > > > 2. Native build should produce binaries matching the build machine
> > > > as well
> > > as possible.
> > > > 3. Default/generic build should produce binaries executable on a
> > > > range of
> > > systems (ideally all systems of a given architecture).
> > > > 4. Other builds, that is non-native builds, are cross-compilation,
> > > > since we're
> > > building for host machine other that the build machine.
> > > >
> > > > What I haven't taken into account is users using CI builds. That
> > > > could be
> > > remedied by modifying the CI a bit while being consistent with what
> > > native/default/generic/cross builds are (or should be). And in any
> > > case, if we're not interested in testing the exact CI environment
> > > (which we aren't, since we don't want to use 2 cores with 1 numa),
> > > we really shouldn't be doing native builds there.
> > > >
> > > > I'm interested in hearing where my thinking deviates from yours.
> > > >
> > >
> > > There are a number of points in which we differ, I think.
> > >
> > > Firstly, the use of "native" and "default/generic" for the "machine"
> > > parameter refers only to the instruction-set level from the
> > > compiler, and should not affect any other settings, since all settings are
> independent.
> > > Therefore, setting "machine" to "native" does not mean that we
> > > should detect cores and numa nodes, and similarly setting it to
> > > "default" does not mean that we should ignore the settings for these
> > > values and pick our own chosen default values.
> > Apologies to go to an older discussion.
> > I am trying to understand the definitions/expectations for 'native' and
> 'generic' builds.
> > As you say, instruction-set level is definitely one parameter.
> 
> Part of the confusion arises from the fact that originally that was the only
> parameter set by this - and on x86 it still is. Perhaps this parameter needs to
Just wondering, for x86, what does it mean if we set the max_num_cores and max_numa_nodes based on dynamic detection for 'native' build?
ISA still remains the same as before. But, the build might not work on machines with higher number of cores and numa nodes.
At the same time, the build also might not work on a machine with a different ISA. The users need to be aware that the target machine has the same ISA and same number of cores/numa nodes as the target machine.

> be renamed to "isa-level" or "architecture-flag" or similar to reflect its
> meaning. This would then allow a new "machine" setting, which can be
> considered separately. The question then is how much that helps with the
> main issue under discussion, that of cores and numa node values.
If we rename it, we will have backward compatibility issue (i.e. 'native' build on x86 will have different meaning and whoever wants the original meaning, have to change to using this new name). Not sure about the complexity in meson scripts.


> 
> > But, I think other DPDK specific parameters should also be considered.
> > For ex: RTE_MAX_LCORE should have a particular value for 'generic' build in
> all the supported architectures. The value could be different for each
> architecture, but it is fixed for the 'generic' build for a given architecture.
> Otherwise, the 'generic' build might not run on all the machines of that
> architecture.
> >
> > Similarly, for 'native' build, is there any reason not to include other DPDK
> parameters as part of the definition? IMO, 'native' should refer to the entire
> build machine, not just the ISA. i.e. build on the target machine.
> >
> 
> While I understand the idea here, it is somewhat complicated by the fact that
> the meson options given in "meson_options.txt" cannot be set by meson
> code, which means that when we change the machine flag to "native" we
> can only use or ignore the user-provided lcores and numa nodes setting - we
> have no way to change them and reflect those changes back to the user. :-(
> This leads to the situation in the discussion in this thread, where we start
> needing all sorts of magic values to indicate use of machine-type defaults or
> detected defaults.
I am wondering why we need to take the max_num_cores and max_numa_nodes from the user? This option was not provided in the make build system. I ask this question because for 'generic' this has to be a static/known configuration. For cross builds, this info can come (or derived) from the cross build file.
Was it supposed to be used in conjunction with 'native' build?

> 
> Regards,
> /Bruce

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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-10-30 10:45               ` Juraj Linkeš
@ 2020-11-02 19:32                 ` Honnappa Nagarahalli
  2020-11-03 10:54                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-02 19:32 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> > > >
> > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > > > > index
> > > > > 491842cad..6c31ab167 100644
> > > > > --- a/config/arm/meson.build
> > > > > +++ b/config/arm/meson.build
> > > > > @@ -3,12 +3,12 @@
> > > > >  # Copyright(c) 2017 Cavium, Inc  # Copyright(c) 2020
> > > > > PANTHEON.tech s.r.o.
> > > > >
> > > > > -# for checking defines we need to use the correct compiler
> > > > > flags -march_opt = '-march=@0@'.format(machine)
> > > > > -
> > > > > +# set arm_force_native_march if you want to use machine args
> > > > > +below # instead of discovered values; only works when doing an
> > > > > +actual native build
> > > > >  arm_force_native_march = false
> > > > > -arm_force_generic_march = (machine == 'generic')
> > > > > +native_machine_args = ['-march=native', '-mtune=native']
> > > > >
> > > >
> > > > [...]
> > > >
> > > > > -
> > > > > -machine_args_default = [
> > > > > -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> > > > > -	['native', ['-march=native']],
> > > > > -	['0xd03', ['-mcpu=cortex-a53']],
> > > > > -	['0xd04', ['-mcpu=cortex-a35']],
> > > > > -	['0xd07', ['-mcpu=cortex-a57']],
> > > > > -	['0xd08', ['-mcpu=cortex-a72']],
> > > > > -	['0xd09', ['-mcpu=cortex-a73']],
> > > > > -	['0xd0a', ['-mcpu=cortex-a75']],
> > > > > -	['0xd0b', ['-mcpu=cortex-a76']],
> > > > > -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-
> n1'],
> > > > > flags_n1sdp_extra]]
> > > > > -
> > > > > -machine_args_cavium = [
> > > > > -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > > > > -	['native', ['-march=native']],
> > > > > -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > > > -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > > > -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > > > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-
> mcpu=thunderx2t99'],
> > > > > flags_thunderx2_extra],
> > > > > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-
> mcpu=octeontx2'],
> > > > > flags_octeontx2_extra]]
> > > > > -
> > > > > -machine_args_emag = [
> > > > > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > > > -	['native', ['-march=native']]]
> > > > > +	['RTE_USE_C11_MEM_MODEL', true] ] # arm config
> (implementer
> > > > > +0x41) is the default config pn_config_default
> > > > What does it mean by 'default' here? I am somewhat confused
> > > > between
> > > 'default'
> > > > and 'generic'. We should look to remove 'default' as much as
> > > > possible and stick with 'generic'.
> > > >
> > >
> > > This default means what default means, no special meaning, that is
> > > if there isn't a more specific configuration, default to this one.
> > > It's possible that generic is better, but now that I think about it,
> > > using something else than default or generic might be the best to
> > > avoid confusion. Possibly just part_number_arm, which will make it
> > > in line with the
> > other var names.
> > Agree, better to call it 'part_number_arm'.
> >
> > >
> > > > > += {
> > > > > +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> > > > I like that we have taken out 'native' from this list. Would it be
> > > > possible to take out 'generic' from this and others below. This is
> > > > because the binary built with 'generic' build should run on any
> > > > Arm platform. There is no dependency on any underlying platform.
> > > >
> > >
> > > This actually means generic part for the implementer, not generic
> > > for everything. I understand this is here to produce binaries that
> > > would run on everything from that impelemeter (in line of what you
> > > mention below, this would be implementer-generic configuration, a
> > > fourth category). In my patchset, it's also a fallback when building
> > > for an unknown part number from the implementer.
> > We do not need implementer-generic binaries/build. However, we will
> > have some parameters that are common across all the part numbers from
> > that implementer (probably we should not call it as
> > 'implementer-generic' to avoid confusion. May be 'implementer-common-
> flags' or 'implementer-flags-extra').
> > Those parameters can be used for every part number.
> 
> These are currently named flags_<implementer> such as flags_arm and
> flags_cavium. We could rename them to
> implementer_flags_<implementer>.
Ok

> 
> >
> > If we know the implementer, we will have the part number as well (this
> > is part of the Arm architecture definition). Unknown part number
> > should result in an error message.
> >
> 
> Yes, we'll always have both. But there are still a couple of corner cases with
> native builds, which should always work:
I do not think these are corner cases. These are basically cases where the support is not added yet in the build system. We do not need to handle these specifically.
I also do not think the notion that the 'native' build should always work is correct (at least on Arm platforms). The reason I say that is because 'native', IMO, not only defines the ISA, but other parameters as well in DPDK.

> 1. We don't support the implementer (i.e. there's no variable with name
> implementer_<implementer_id>). In this case, what do default to? The
> generic build, which is the current behavior?
This should result in an error. The implementer should add support in meson.build

> 2. We support the implementer, but we don't support the part number. In
> this case, we can just use native machine args (-march=native) and use only
> implementer specific flags.
Same thing, should result in error. The implementer should add support in meson.build.

> 
> For generic, soc-specifc and cross builds it makes sense to error with uknown
> implementer/part number, since we wouldn't know what to build otherwise.
> 
> > >
> > > Since this is not generic for everything, only for the implementer,
> > > we're lacking the true common default machine args for everything.
> > >
> > > > > +	'0xd03': [['-mcpu=cortex-a53']],
> > > > > +	'0xd04': [['-mcpu=cortex-a35']],
> > > > > +	'0xd07': [['-mcpu=cortex-a57']],
> > > > > +	'0xd08': [['-mcpu=cortex-a72']],
> > > > > +	'0xd09': [['-mcpu=cortex-a73']],
> > > > > +	'0xd0a': [['-mcpu=cortex-a75']],
> > > > > +	'0xd0b': [['-mcpu=cortex-a76']],
> > > > > +	'0xd0c': [['-march=armv8.2-a+crc+crypto',
> > > > > +'-mcpu=neoverse-n1'], flags_n1sdp_extra]
> > > > 'flags_n1sdp_extra' does not fit here. For the part number '0xd0c'
> > > > there could be multiple SoCs (N1SDP is one of them). So, if the
> > > > SoC is not known, but if we know that the CPU is N1, then we
> > > > should build a N1-
> > > Generic build.
> > >
> > > This should be core-generic configuration, I can rename it to
> > > flags_n1generic_extra.
> > Agree.
> >
> > >
> > > > So, from my perspective, there are 3 kinds of binaries:
> > > > 1) generic - best portability -  (possibly) least optimized for a
> > > > given platform
> > > > 2) Core-Generic (for ex: N1-generic) - Portable on all N1 based
> > > > SoCs only - Optimized for N1 cores
> > > > 3) SoC specific - (possibly) Not portable - Most optimized for the
> > > > SoC
> > > >
> > >
> > > The fourth category I mentioned above, implementer-generic, is used
> > > in how
> > We should not have this category.
> >
> > > the arm configuration is currently processed:
> > > 1) default configuration
> > > Added to/overwritten by
> > > 2) implementer configuration (one of which is the configuration for
> > > generic
> > > build) Added to/overwritten by
> > This should be just parameters that are common across all the part
> > numbers of that implementer (for ex: RTE_CACHE_LINE_SIZE = 128), not a
> build.
> >
> 
> It's not a build, just how the configation is organized and processed, as in we
> apply the common default flags, then implementer flags, then part number
> flags and then soc flags, overwriting flags in all of the steps.
Ok

> 
> > > 3) part number (or core-generic) configuration Added to/overwritten
> > > by
> > > 4) SoC configuration (what we're adding now)
> > >
> > > It's not organized as cleanly - the machine args contain both 2) and 3).
> > > Depending on what we want to do with the 'generic' part number I'll
> > > adjust the config organization.
> > >
> > > >  } pn_config_cavium = {
> > > > > +	'generic': [['-march=armv8-a+crc+crypto', '-
> mcpu=thunderx']],
> > > > 'generic' does not make sense here.
> > > >
> > > > > +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > > > +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > > > +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > > > +	'0xaf': [['-march=armv8.1-a+crc+crypto','-
> mcpu=thunderx2t99'],
> > > > > flags_thunderx2_extra],
> > > > > +	'0xb2':
> > > > > +[['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > > > +flags_octeontx2_extra], } pn_config_emag = {
> > > > > +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> > > > Same here.
> > > > I understand that this is coming from the existing code. But, I
> > > > think we should try to set it right.
> > > >
> > >
> > > The generic config for these makes sense if a fourth category,
> > > implementer- generic makes sense.
> > > For example, for part_number_config_emag this means: for
> implementer
> > > _0x50 (Ampere Computing) use the generic machine args if there's
> > > nothing more specific (which there isn't - no other part number).
> > There should be a part number for this. Not sure why it is not present
> > here. I will find out the info.
> >
> > >
> > > > >
> > > > >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > > > > G7-5321)
> > > > Nit, Would be good to remove the reference to the doc
> > > >
> > >
> > > Is that because the docs mentioned here may not be the most recent?
> > > It was useful to me in understanding where the implementer/part
> > > number values come from.
> > Yes, mainly because the spec gets updated. Instead you could say
> > "Refer to MIDR in Arm Architecture Reference Manual")
> >
> 
> Ok, I'll make this change.
> 
> > >
> > > > > -impl_generic = ['Generic armv8', flags_generic,
> > > > > machine_args_default]
> > > > > -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > > > > -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> > > > > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > > > > -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > > > > -impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > > > > -impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > > > > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> > > > > -impl_0x50 = ['Ampere Computing', flags_emag,
> machine_args_emag]
> > > > > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > > > > -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > > > > -impl_0x56 = ['Marvell ARMADA', flags_armada,
> > > > > machine_args_default]
> > > > > -impl_0x69 = ['Intel', flags_generic, machine_args_default]
> > > > > -impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
> > > > > +impl_generic = ['Generic armv8', flags_generic,
> > > > > +pn_config_default]
> > > > > +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> > > > > +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> > > > > +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> > > > > +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> > > > > +impl_0x49 = ['Infineon', flags_generic, pn_config_default]
> > > > > +impl_0x4d = ['Motorola', flags_generic, pn_config_default]
> > > > > +impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
> > > > > +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> > > > > +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> > > > > +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> > > > > +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> > > > > +impl_0x69 = ['Intel', flags_generic, pn_config_default]
> > > > > +impl_dpaa = ['NXP DPAA', flags_dpaa, pn_config_default]
> > > > >
> > > > >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> > > > > dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> > > > >
> > > > >  if dpdk_conf.get('RTE_ARCH_32')
> > > > > +	# armv7 build
> > > > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > > > > +	# aarch64 build
> > > > > +	if not meson.is_cross_build()
> > > > > +		if machine == 'generic'
> > > > > +			# default build
> > > >                                               ^^^^^^^^^^^ Generic build?
> > > >
> > >
> > > Already addressed in the next version.
> > >
> > > > > +			impl_config = impl_generic
> > > > > +			part_number = 'generic'
> > > > > +		else
> > > > > +			# native 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
> > > > > +			if arm_force_native_march == true
> > > > > +				part_number = 'native'
> > > > > +			else
> > > > > +				part_number = cmd_output[3]
> > > > > +			endif
> > > > > +			# Set to generic implementer if implementer
> is not
> > > > > found
> > > > > +			impl_config = get_variable('impl_' +
> cmd_output[0],
> > > > > 'impl_generic')
> > > > > +		endif
> > > > > +	else
> > > > > +		# cross build
> > > > > +		impl_id =
> meson.get_cross_property('implementer_id',
> > > > > 'generic')
> > > > > +		part_number =
> meson.get_cross_property('part_number',
> > > > > 'generic')
> > > > > +		impl_config = get_variable('impl_' + impl_id)
> > > > > +	endif
> > > > >
> > > > > -	machine = []
> > > > > -	cmd_generic = ['generic', '', '', 'default', '']
> > > > > -	cmd_output = cmd_generic # Set generic by default
> > > > > -	machine_args = [] # Clear previous machine args
> > > > > -	if arm_force_generic_march and not meson.is_cross_build()
> > > > > -		machine = impl_generic
> > > > > -		impl_pn = 'default'
> > > > > +	message('Arm implementer: ' + impl_config[0])
> > > > > +	message('Arm part number: ' + part_number)
> > > > > +
> > > > > +	implementer_flags = impl_config[1]
> > > > > +	part_number_config = impl_config[2]
> > > > > +
> > > > > +	if part_number_config.has_key(part_number)
> > > > > +		# use the specified part_number machine args if
> found
> > > > > +		part_number_config =
> part_number_config[part_number]
> > > > > +	elif part_number == 'native'
> > > > > +		# use native machine args
> > > > > +		part_number_config = [[native_machine_args]]
> > > > >  	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
> > > > > +		# default to generic machine args if part_number is
> not found
> > > > > +		# and not forcing native machine args
> > > > > +		# but don't default in cross-builds; if part_number is
> specified
> > > > > +		# incorrectly in a cross-file, it needs to be fixed there
> > > > > +		part_number_config =
> part_number_config['generic']
> > > > >  	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)
> > > > > +		# cross build and part number is not in
> part_number_config
> > > > > +		error('Cross build part number 0@0 not
> > > > > found.'.format(part_number))
> > > > >  	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])
> > > > > +	dpdk_flags = flags_common_default + implementer_flags
> > > > > +
> > > > > +	if part_number_config.length() > 1
> > > > > +		dpdk_flags += part_number_config[1]
> > > > > +	endif
> > > > > +
> > > > > +	machine_args = [] # Clear previous machine args
> > > > > +	foreach flag: part_number_config[0]
> > > > > +		if cc.has_argument(flag)
> > > > > +			machine_args += flag
> > > > >  		endif
> > > > >  	endforeach
> > > > >
> > > > > -	message('Implementer : ' + machine[0])
> > > > > -	foreach flag: machine[1]
> > > > > +	foreach flag: dpdk_flags
> > > > >  		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
> > > > >  endif
> > > > > -message(machine_args)
> > > > > +
> > > > > +message('Using machine args: @0@'.format(machine_args))
> > > > >
> > > > >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > > > >      cc.get_define('__aarch64__', args: machine_args) != '')
> > > > > --
> > > > > 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-11-02 19:01                 ` Honnappa Nagarahalli
@ 2020-11-03  9:44                   ` Bruce Richardson
  2020-11-05  9:23                     ` Juraj Linkeš
  2020-11-06 23:40                     ` Honnappa Nagarahalli
  0 siblings, 2 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-03  9:44 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, dev, nd

On Mon, Nov 02, 2020 at 07:01:44PM +0000, Honnappa Nagarahalli wrote:
> <snip>
> 
> > >
> > Part of the confusion arises from the fact that originally that was the only
> > parameter set by this - and on x86 it still is. Perhaps this parameter needs to
> Just wondering, for x86, what does it mean if we set the max_num_cores and max_numa_nodes based on dynamic detection for 'native' build?
> ISA still remains the same as before. But, the build might not work on machines with higher number of cores and numa nodes.
> At the same time, the build also might not work on a machine with a different ISA. The users need to be aware that the target machine has the same ISA and same number of cores/numa nodes as the target machine.
> 
Yes, that is a fair summary.

> > be renamed to "isa-level" or "architecture-flag" or similar to reflect its
> > meaning. This would then allow a new "machine" setting, which can be
> > considered separately. The question then is how much that helps with the
> > main issue under discussion, that of cores and numa node values.
> If we rename it, we will have backward compatibility issue (i.e. 'native' build on x86 will have different meaning and whoever wants the original meaning, have to change to using this new name). Not sure about the complexity in meson scripts.
> 

Yep, it was just a thought to see if it could help in this situation.

> 
> > 
> > > But, I think other DPDK specific parameters should also be considered.
> > > For ex: RTE_MAX_LCORE should have a particular value for 'generic' build in
> > all the supported architectures. The value could be different for each
> > architecture, but it is fixed for the 'generic' build for a given architecture.
> > Otherwise, the 'generic' build might not run on all the machines of that
> > architecture.
> > >
> > > Similarly, for 'native' build, is there any reason not to include other DPDK
> > parameters as part of the definition? IMO, 'native' should refer to the entire
> > build machine, not just the ISA. i.e. build on the target machine.
> > >
> > 
> > While I understand the idea here, it is somewhat complicated by the fact that
> > the meson options given in "meson_options.txt" cannot be set by meson
> > code, which means that when we change the machine flag to "native" we
> > can only use or ignore the user-provided lcores and numa nodes setting - we
> > have no way to change them and reflect those changes back to the user. :-(
> > This leads to the situation in the discussion in this thread, where we start
> > needing all sorts of magic values to indicate use of machine-type defaults or
> > detected defaults.
> I am wondering why we need to take the max_num_cores and max_numa_nodes from the user? This option was not provided in the make build system. I ask this question because for 'generic' this has to be a static/known configuration. For cross builds, this info can come (or derived) from the cross build file.
> Was it supposed to be used in conjunction with 'native' build?
> 

Well, it was configurable in the build config files same as all other DPDK
build settings with make. When working first on meson, I felt it was a
setting the user might be likely to want to tune, which is why I put it
into the meson_options.txt and nobody suggested otherwise on review [which
is the reason why many of the current options are the way they are :-)].

From my side, I have a couple of unknowns:
1. How big a difference in terms of memory use etc. of DPDK does it make by
   having really big values for these core/numa counts? If there is not much
   difference, then there is indeed little value in having them configurable
   at all, and we should just use big defaults and be done with it.
2. If there is a noticable difference in these settings, how many users are
   going to want to actually go to the trouble of tweaking these?
3. How big an effort is it to switch to having these settings made entirely
   dynamic at runtime? Doing so would naturally make the need for these
   settings completely go away.

With all that said, I'd be ok with a number of solutions. I'm ok to have
these dropped as meson options and just have them specified in other ways,
e.g. cross-file, or from meson.build files. [For x86, I'd tend towards
having them defined in rte_config.h inside x86-specific ifdefs].
Alternatively, I'm also happy enough with the proposed scheme here of
allowing user override, with platform defaults using "0"-value and
detection using "-1".

Regards,
/Bruce

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

* Re: [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build
  2020-11-02 19:32                 ` Honnappa Nagarahalli
@ 2020-11-03 10:54                   ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-03 10:54 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Monday, November 2, 2020 8:32 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v4 2/6] build: refactor Arm build
> 
> <snip>
> 
> > > > >
> > > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > > > > > index
> > > > > > 491842cad..6c31ab167 100644
> > > > > > --- a/config/arm/meson.build
> > > > > > +++ b/config/arm/meson.build
> > > > > > @@ -3,12 +3,12 @@
> > > > > >  # Copyright(c) 2017 Cavium, Inc  # Copyright(c) 2020
> > > > > > PANTHEON.tech s.r.o.
> > > > > >
> > > > > > -# for checking defines we need to use the correct compiler
> > > > > > flags -march_opt = '-march=@0@'.format(machine)
> > > > > > -
> > > > > > +# set arm_force_native_march if you want to use machine args
> > > > > > +below # instead of discovered values; only works when doing
> > > > > > +an actual native build
> > > > > >  arm_force_native_march = false -arm_force_generic_march =
> > > > > > (machine == 'generic')
> > > > > > +native_machine_args = ['-march=native', '-mtune=native']
> > > > > >
> > > > >
> > > > > [...]
> > > > >
> > > > > > -
> > > > > > -machine_args_default = [
> > > > > > -	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
> > > > > > -	['native', ['-march=native']],
> > > > > > -	['0xd03', ['-mcpu=cortex-a53']],
> > > > > > -	['0xd04', ['-mcpu=cortex-a35']],
> > > > > > -	['0xd07', ['-mcpu=cortex-a57']],
> > > > > > -	['0xd08', ['-mcpu=cortex-a72']],
> > > > > > -	['0xd09', ['-mcpu=cortex-a73']],
> > > > > > -	['0xd0a', ['-mcpu=cortex-a75']],
> > > > > > -	['0xd0b', ['-mcpu=cortex-a76']],
> > > > > > -	['0xd0c', ['-march=armv8.2-a+crc+crypto', '-mcpu=neoverse-
> > n1'],
> > > > > > flags_n1sdp_extra]]
> > > > > > -
> > > > > > -machine_args_cavium = [
> > > > > > -	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > > > > > -	['native', ['-march=native']],
> > > > > > -	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > > > > -	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > > > > -	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > > > > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-
> > mcpu=thunderx2t99'],
> > > > > > flags_thunderx2_extra],
> > > > > > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-
> > mcpu=octeontx2'],
> > > > > > flags_octeontx2_extra]]
> > > > > > -
> > > > > > -machine_args_emag = [
> > > > > > -	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > > > > -	['native', ['-march=native']]]
> > > > > > +	['RTE_USE_C11_MEM_MODEL', true] ] # arm config
> > (implementer
> > > > > > +0x41) is the default config pn_config_default
> > > > > What does it mean by 'default' here? I am somewhat confused
> > > > > between
> > > > 'default'
> > > > > and 'generic'. We should look to remove 'default' as much as
> > > > > possible and stick with 'generic'.
> > > > >
> > > >
> > > > This default means what default means, no special meaning, that is
> > > > if there isn't a more specific configuration, default to this one.
> > > > It's possible that generic is better, but now that I think about
> > > > it, using something else than default or generic might be the best
> > > > to avoid confusion. Possibly just part_number_arm, which will make
> > > > it in line with the
> > > other var names.
> > > Agree, better to call it 'part_number_arm'.
> > >
> > > >
> > > > > > += {
> > > > > > +	'generic': [['-march=armv8-a+crc', '-moutline-atomics']],
> > > > > I like that we have taken out 'native' from this list. Would it
> > > > > be possible to take out 'generic' from this and others below.
> > > > > This is because the binary built with 'generic' build should run
> > > > > on any Arm platform. There is no dependency on any underlying
> platform.
> > > > >
> > > >
> > > > This actually means generic part for the implementer, not generic
> > > > for everything. I understand this is here to produce binaries that
> > > > would run on everything from that impelemeter (in line of what you
> > > > mention below, this would be implementer-generic configuration, a
> > > > fourth category). In my patchset, it's also a fallback when
> > > > building for an unknown part number from the implementer.
> > > We do not need implementer-generic binaries/build. However, we will
> > > have some parameters that are common across all the part numbers
> > > from that implementer (probably we should not call it as
> > > 'implementer-generic' to avoid confusion. May be
> > > 'implementer-common-
> > flags' or 'implementer-flags-extra').
> > > Those parameters can be used for every part number.
> >
> > These are currently named flags_<implementer> such as flags_arm and
> > flags_cavium. We could rename them to implementer_flags_<implementer>.
> Ok
> 
> >
> > >
> > > If we know the implementer, we will have the part number as well (this
> > > is part of the Arm architecture definition). Unknown part number
> > > should result in an error message.
> > >
> >
> > Yes, we'll always have both. But there are still a couple of corner cases with
> > native builds, which should always work:
> I do not think these are corner cases. These are basically cases where the
> support is not added yet in the build system. We do not need to handle these
> specifically.
> I also do not think the notion that the 'native' build should always work is correct
> (at least on Arm platforms). The reason I say that is because 'native', IMO, not
> only defines the ISA, but other parameters as well in DPDK.
> 

So our stance would basically be the native build doesn't work for unsupported implementers/part numbers and then direct the user to generic build. That seems reasonable.

> > 1. We don't support the implementer (i.e. there's no variable with name
> > implementer_<implementer_id>). In this case, what do default to? The
> > generic build, which is the current behavior?
> This should result in an error. The implementer should add support in
> meson.build
> 

Ok, then we need to change the current configuration. The implementers were added in bulk with the same configuration, so that can't really be considered supporting them in this way. I think we should keep implementers which have specific implementer flags or machine configuration defined for them and remove the rest. That would leave us with:
implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]

And we would remove these (everything with the same flags/part number config as the generic build):
implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]

> > 2. We support the implementer, but we don't support the part number. In
> > this case, we can just use native machine args (-march=native) and use only
> > implementer specific flags.
> Same thing, should result in error. The implementer should add support in
> meson.build.
> 

There are two different scenarios, native and soc-specific/cross builds.
For native builds, we could just use the implementer flags with native machine args. This could be still viewed as implementer intending to support it for native build - by omitting it, they'd basically be saying there aren't any extra flags for the part number. There are hidden assumptions here and it results in data that's not clear, so It's probably best to enforce even for native builds, as that we remove any ambiguity.
For soc-specific/cross builds, we don't know which machine args to use, so that's an error.

I'll make the changes so that an unknown implementer/part number results in an error for all builds.

> >
> > For generic, soc-specifc and cross builds it makes sense to error with uknown
> > implementer/part number, since we wouldn't know what to build otherwise.
> >
> > > >
> > > > Since this is not generic for everything, only for the implementer,
> > > > we're lacking the true common default machine args for everything.
> > > >
> > > > > > +	'0xd03': [['-mcpu=cortex-a53']],
> > > > > > +	'0xd04': [['-mcpu=cortex-a35']],
> > > > > > +	'0xd07': [['-mcpu=cortex-a57']],
> > > > > > +	'0xd08': [['-mcpu=cortex-a72']],
> > > > > > +	'0xd09': [['-mcpu=cortex-a73']],
> > > > > > +	'0xd0a': [['-mcpu=cortex-a75']],
> > > > > > +	'0xd0b': [['-mcpu=cortex-a76']],
> > > > > > +	'0xd0c': [['-march=armv8.2-a+crc+crypto',
> > > > > > +'-mcpu=neoverse-n1'], flags_n1sdp_extra]
> > > > > 'flags_n1sdp_extra' does not fit here. For the part number '0xd0c'
> > > > > there could be multiple SoCs (N1SDP is one of them). So, if the
> > > > > SoC is not known, but if we know that the CPU is N1, then we
> > > > > should build a N1-
> > > > Generic build.
> > > >
> > > > This should be core-generic configuration, I can rename it to
> > > > flags_n1generic_extra.
> > > Agree.
> > >
> > > >
> > > > > So, from my perspective, there are 3 kinds of binaries:
> > > > > 1) generic - best portability -  (possibly) least optimized for a
> > > > > given platform
> > > > > 2) Core-Generic (for ex: N1-generic) - Portable on all N1 based
> > > > > SoCs only - Optimized for N1 cores
> > > > > 3) SoC specific - (possibly) Not portable - Most optimized for the
> > > > > SoC
> > > > >
> > > >
> > > > The fourth category I mentioned above, implementer-generic, is used
> > > > in how
> > > We should not have this category.
> > >
> > > > the arm configuration is currently processed:
> > > > 1) default configuration
> > > > Added to/overwritten by
> > > > 2) implementer configuration (one of which is the configuration for
> > > > generic
> > > > build) Added to/overwritten by
> > > This should be just parameters that are common across all the part
> > > numbers of that implementer (for ex: RTE_CACHE_LINE_SIZE = 128), not a
> > build.
> > >
> >
> > It's not a build, just how the configation is organized and processed, as in we
> > apply the common default flags, then implementer flags, then part number
> > flags and then soc flags, overwriting flags in all of the steps.
> Ok
> 
> >
> > > > 3) part number (or core-generic) configuration Added to/overwritten
> > > > by
> > > > 4) SoC configuration (what we're adding now)
> > > >
> > > > It's not organized as cleanly - the machine args contain both 2) and 3).
> > > > Depending on what we want to do with the 'generic' part number I'll
> > > > adjust the config organization.
> > > >
> > > > >  } pn_config_cavium = {
> > > > > > +	'generic': [['-march=armv8-a+crc+crypto', '-
> > mcpu=thunderx']],
> > > > > 'generic' does not make sense here.
> > > > >
> > > > > > +	'0xa1': [['-mcpu=thunderxt88'], flags_thunderx_extra],
> > > > > > +	'0xa2': [['-mcpu=thunderxt81'], flags_thunderx_extra],
> > > > > > +	'0xa3': [['-mcpu=thunderxt83'], flags_thunderx_extra],
> > > > > > +	'0xaf': [['-march=armv8.1-a+crc+crypto','-
> > mcpu=thunderx2t99'],
> > > > > > flags_thunderx2_extra],
> > > > > > +	'0xb2':
> > > > > > +[['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > > > > +flags_octeontx2_extra], } pn_config_emag = {
> > > > > > +	'generic': [['-march=armv8-a+crc+crypto', '-mtune=emag']] }
> > > > > Same here.
> > > > > I understand that this is coming from the existing code. But, I
> > > > > think we should try to set it right.
> > > > >
> > > >
> > > > The generic config for these makes sense if a fourth category,
> > > > implementer- generic makes sense.
> > > > For example, for part_number_config_emag this means: for
> > implementer
> > > > _0x50 (Ampere Computing) use the generic machine args if there's
> > > > nothing more specific (which there isn't - no other part number).
> > > There should be a part number for this. Not sure why it is not present
> > > here. I will find out the info.
> > >
> > > >
> > > > > >
> > > > > >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > > > > > G7-5321)
> > > > > Nit, Would be good to remove the reference to the doc
> > > > >
> > > >
> > > > Is that because the docs mentioned here may not be the most recent?
> > > > It was useful to me in understanding where the implementer/part
> > > > number values come from.
> > > Yes, mainly because the spec gets updated. Instead you could say
> > > "Refer to MIDR in Arm Architecture Reference Manual")
> > >
> >
> > Ok, I'll make this change.
> >
> > > >
> > > > > > -impl_generic = ['Generic armv8', flags_generic,
> > > > > > machine_args_default]
> > > > > > -impl_0x41 = ['Arm', flags_arm, machine_args_default]
> > > > > > -impl_0x42 = ['Broadcom', flags_generic, machine_args_default]
> > > > > > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > > > > > -impl_0x44 = ['DEC', flags_generic, machine_args_default]
> > > > > > -impl_0x49 = ['Infineon', flags_generic, machine_args_default]
> > > > > > -impl_0x4d = ['Motorola', flags_generic, machine_args_default]
> > > > > > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_default]
> > > > > > -impl_0x50 = ['Ampere Computing', flags_emag,
> > machine_args_emag]
> > > > > > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_default]
> > > > > > -impl_0x53 = ['Samsung', flags_generic, machine_args_default]
> > > > > > -impl_0x56 = ['Marvell ARMADA', flags_armada,
> > > > > > machine_args_default]
> > > > > > -impl_0x69 = ['Intel', flags_generic, machine_args_default]
> > > > > > -impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_default]
> > > > > > +impl_generic = ['Generic armv8', flags_generic,
> > > > > > +pn_config_default]
> > > > > > +impl_0x41 = ['Arm', flags_arm, pn_config_default]
> > > > > > +impl_0x42 = ['Broadcom', flags_generic, pn_config_default]
> > > > > > +impl_0x43 = ['Cavium', flags_cavium, pn_config_cavium]
> > > > > > +impl_0x44 = ['DEC', flags_generic, pn_config_default]
> > > > > > +impl_0x49 = ['Infineon', flags_generic, pn_config_default]
> > > > > > +impl_0x4d = ['Motorola', flags_generic, pn_config_default]
> > > > > > +impl_0x4e = ['NVIDIA', flags_generic, pn_config_default]
> > > > > > +impl_0x50 = ['Ampere Computing', flags_emag, pn_config_emag]
> > > > > > +impl_0x51 = ['Qualcomm', flags_generic, pn_config_default]
> > > > > > +impl_0x53 = ['Samsung', flags_generic, pn_config_default]
> > > > > > +impl_0x56 = ['Marvell ARMADA', flags_armada, pn_config_default]
> > > > > > +impl_0x69 = ['Intel', flags_generic, pn_config_default]
> > > > > > +impl_dpaa = ['NXP DPAA', flags_dpaa, pn_config_default]
> > > > > >
> > > > > >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> > > > > > dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> > > > > >
> > > > > >  if dpdk_conf.get('RTE_ARCH_32')
> > > > > > +	# armv7 build
> > > > > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > > > > > +	# aarch64 build
> > > > > > +	if not meson.is_cross_build()
> > > > > > +		if machine == 'generic'
> > > > > > +			# default build
> > > > >                                               ^^^^^^^^^^^ Generic build?
> > > > >
> > > >
> > > > Already addressed in the next version.
> > > >
> > > > > > +			impl_config = impl_generic
> > > > > > +			part_number = 'generic'
> > > > > > +		else
> > > > > > +			# native 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
> > > > > > +			if arm_force_native_march == true
> > > > > > +				part_number = 'native'
> > > > > > +			else
> > > > > > +				part_number = cmd_output[3]
> > > > > > +			endif
> > > > > > +			# Set to generic implementer if implementer
> > is not
> > > > > > found
> > > > > > +			impl_config = get_variable('impl_' +
> > cmd_output[0],
> > > > > > 'impl_generic')
> > > > > > +		endif
> > > > > > +	else
> > > > > > +		# cross build
> > > > > > +		impl_id =
> > meson.get_cross_property('implementer_id',
> > > > > > 'generic')
> > > > > > +		part_number =
> > meson.get_cross_property('part_number',
> > > > > > 'generic')
> > > > > > +		impl_config = get_variable('impl_' + impl_id)
> > > > > > +	endif
> > > > > >
> > > > > > -	machine = []
> > > > > > -	cmd_generic = ['generic', '', '', 'default', '']
> > > > > > -	cmd_output = cmd_generic # Set generic by default
> > > > > > -	machine_args = [] # Clear previous machine args
> > > > > > -	if arm_force_generic_march and not meson.is_cross_build()
> > > > > > -		machine = impl_generic
> > > > > > -		impl_pn = 'default'
> > > > > > +	message('Arm implementer: ' + impl_config[0])
> > > > > > +	message('Arm part number: ' + part_number)
> > > > > > +
> > > > > > +	implementer_flags = impl_config[1]
> > > > > > +	part_number_config = impl_config[2]
> > > > > > +
> > > > > > +	if part_number_config.has_key(part_number)
> > > > > > +		# use the specified part_number machine args if
> > found
> > > > > > +		part_number_config =
> > part_number_config[part_number]
> > > > > > +	elif part_number == 'native'
> > > > > > +		# use native machine args
> > > > > > +		part_number_config = [[native_machine_args]]
> > > > > >  	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
> > > > > > +		# default to generic machine args if part_number is
> > not found
> > > > > > +		# and not forcing native machine args
> > > > > > +		# but don't default in cross-builds; if part_number is
> > specified
> > > > > > +		# incorrectly in a cross-file, it needs to be fixed there
> > > > > > +		part_number_config =
> > part_number_config['generic']
> > > > > >  	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)
> > > > > > +		# cross build and part number is not in
> > part_number_config
> > > > > > +		error('Cross build part number 0@0 not
> > > > > > found.'.format(part_number))
> > > > > >  	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])
> > > > > > +	dpdk_flags = flags_common_default + implementer_flags
> > > > > > +
> > > > > > +	if part_number_config.length() > 1
> > > > > > +		dpdk_flags += part_number_config[1]
> > > > > > +	endif
> > > > > > +
> > > > > > +	machine_args = [] # Clear previous machine args
> > > > > > +	foreach flag: part_number_config[0]
> > > > > > +		if cc.has_argument(flag)
> > > > > > +			machine_args += flag
> > > > > >  		endif
> > > > > >  	endforeach
> > > > > >
> > > > > > -	message('Implementer : ' + machine[0])
> > > > > > -	foreach flag: machine[1]
> > > > > > +	foreach flag: dpdk_flags
> > > > > >  		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
> > > > > >  endif
> > > > > > -message(machine_args)
> > > > > > +
> > > > > > +message('Using machine args: @0@'.format(machine_args))
> > > > > >
> > > > > >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > > > > >      cc.get_define('__aarch64__', args: machine_args) != '')
> > > > > > --
> > > > > > 2.20.1


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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-11-03  9:44                   ` Bruce Richardson
@ 2020-11-05  9:23                     ` Juraj Linkeš
  2020-11-06 23:40                     ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05  9:23 UTC (permalink / raw)
  To: Bruce Richardson, Honnappa Nagarahalli
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, dev, nd



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, November 3, 2020 10:45 AM
> To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Cc: Juraj Linkeš <juraj.linkes@pantheon.tech>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; dev@dpdk.org; nd
> <nd@arm.com>
> Subject: Re: [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts
> detection
> 
> On Mon, Nov 02, 2020 at 07:01:44PM +0000, Honnappa Nagarahalli wrote:
> > <snip>
> >
> > > >
> > > Part of the confusion arises from the fact that originally that was
> > > the only parameter set by this - and on x86 it still is. Perhaps
> > > this parameter needs to
> > Just wondering, for x86, what does it mean if we set the max_num_cores and
> max_numa_nodes based on dynamic detection for 'native' build?
> > ISA still remains the same as before. But, the build might not work on
> machines with higher number of cores and numa nodes.
> > At the same time, the build also might not work on a machine with a different
> ISA. The users need to be aware that the target machine has the same ISA and
> same number of cores/numa nodes as the target machine.
> >
> Yes, that is a fair summary.
> 

There's also additional confusion in what the build should produce with no user input. You mentioned that builds from CI are used outside of CI and when a user compiles up a binary without settings these [cpu and numa counts] explicitly it should run on 95%+ of systems of that type (why not 100%?). These requirements/expectations suggest that generic settings should be the default (machine=generic so that CI builds are usable on machines with different ISA and then using generic defaults for other settings (we're talking mainly about cpu and numa counts, but it should apply to everything - there are more settings that need generic defaults for Arm)).
If we change the default to generic, then setting machine=native would only set the machine args and not change the behavior of other vars (i.e. use defaults for the build machine).

> > > be renamed to "isa-level" or "architecture-flag" or similar to
> > > reflect its meaning. This would then allow a new "machine" setting,
> > > which can be considered separately. The question then is how much
> > > that helps with the main issue under discussion, that of cores and numa node
> values.
> > If we rename it, we will have backward compatibility issue (i.e. 'native' build on
> x86 will have different meaning and whoever wants the original meaning, have
> to change to using this new name). Not sure about the complexity in meson
> scripts.
> >
> 
> Yep, it was just a thought to see if it could help in this situation.
> 

I also don't think renaming or repurposing the machine meson option is the way to go, not only because of backwards compatibility but also because the option sets RTE_MACHINE and machine args, which lines up with the name nicely. As a side note, I grepped RTE_MACHINE and I don't see it being used anywhere - do we need that config?
But this doesn't work for Arm, since setting just machine args doesn't make sense - setting that also necessitates setting of some other dpdk config as well.

What could help is new meson option. I'm working on adding an option where the user could specify the set of target configuration, or soc configuration. I could add the configuration for generic build as one of the available sets and then we'd be able to use that variable instead of machine for Arm builds.

> >
> > >
> > > > But, I think other DPDK specific parameters should also be considered.
> > > > For ex: RTE_MAX_LCORE should have a particular value for 'generic'
> > > > build in
> > > all the supported architectures. The value could be different for
> > > each architecture, but it is fixed for the 'generic' build for a given
> architecture.
> > > Otherwise, the 'generic' build might not run on all the machines of
> > > that architecture.
> > > >
> > > > Similarly, for 'native' build, is there any reason not to include
> > > > other DPDK
> > > parameters as part of the definition? IMO, 'native' should refer to
> > > the entire build machine, not just the ISA. i.e. build on the target machine.
> > > >
> > >
> > > While I understand the idea here, it is somewhat complicated by the
> > > fact that the meson options given in "meson_options.txt" cannot be
> > > set by meson code, which means that when we change the machine flag
> > > to "native" we can only use or ignore the user-provided lcores and
> > > numa nodes setting - we have no way to change them and reflect those
> > > changes back to the user. :-( This leads to the situation in the
> > > discussion in this thread, where we start needing all sorts of magic
> > > values to indicate use of machine-type defaults or detected defaults.
> > I am wondering why we need to take the max_num_cores and
> max_numa_nodes from the user? This option was not provided in the make build
> system. I ask this question because for 'generic' this has to be a static/known
> configuration. For cross builds, this info can come (or derived) from the cross
> build file.
> > Was it supposed to be used in conjunction with 'native' build?
> >
> 
> Well, it was configurable in the build config files same as all other DPDK build
> settings with make. When working first on meson, I felt it was a setting the user
> might be likely to want to tune, which is why I put it into the meson_options.txt
> and nobody suggested otherwise on review [which is the reason why many of
> the current options are the way they are :-)].
> 
> From my side, I have a couple of unknowns:
> 1. How big a difference in terms of memory use etc. of DPDK does it make by
>    having really big values for these core/numa counts? If there is not much
>    difference, then there is indeed little value in having them configurable
>    at all, and we should just use big defaults and be done with it.
> 2. If there is a noticable difference in these settings, how many users are
>    going to want to actually go to the trouble of tweaking these?
> 3. How big an effort is it to switch to having these settings made entirely
>    dynamic at runtime? Doing so would naturally make the need for these
>    settings completely go away.
> 
> With all that said, I'd be ok with a number of solutions. I'm ok to have these
> dropped as meson options and just have them specified in other ways, e.g.
> cross-file, or from meson.build files. [For x86, I'd tend towards having them
> defined in rte_config.h inside x86-specific ifdefs].
> Alternatively, I'm also happy enough with the proposed scheme here of allowing
> user override, with platform defaults using "0"-value and detection using "-1".
> 
> Regards,
> /Bruce



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

* [dpdk-dev] [PATCH v7 00/14] Arm build options rework
  2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
                             ` (10 preceding siblings ...)
  2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 11/11] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-05 13:59           ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 01/14] build: alias default build as generic Juraj Linkeš
                               ` (14 more replies)
  11 siblings, 15 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in cross files.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs must be done using
  cross-files
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

Juraj Linkeš (14):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for generic build
  build: use native machine args in Arm native build
  ci: switch to generic Arm builds
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: disable libnuma in cross builds
  build: add Arm SoC meson option

 .ci/linux-build.sh                            |   4 +
 buildtools/get_cpu_count.py                   |   7 +
 buildtools/get_numa_count.py                  |  22 +
 buildtools/meson.build                        |   2 +
 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  26 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 495 ++++++++++++------
 config/meson.build                            |  90 +++-
 config/x86/meson.build                        |   2 +
 doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |  12 +-
 22 files changed, 483 insertions(+), 214 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 01/14] build: alias default build as generic
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 02/14] build: rename Arm build variables Juraj Linkeš
                               ` (13 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build                    | 5 +++--
 config/meson.build                        | 9 +++++----
 doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
 meson_options.txt                         | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 073b4afc0..7537d52fd 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -149,7 +150,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..c7f7aa6e2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +83,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 3429e2647..c7e12eedf 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
 
 	meson -Denable_docs=true fullbuild  # build and install docs
 
-	meson -Dmachine=default  # use builder-independent baseline -march
+	meson -Dmachine=generic  # use builder-independent baseline -march
 
 	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
 					# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
         re-scan from meson.
 
 .. note::
-        machine=default uses a config that works on all supported architectures
+        machine=generic uses a config that works on all supported architectures
         regardless of the capabilities of the machine where the build is happening.
 
 As well as those settings taken from ``meson configure``, other options
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..ce23289e3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
 option('lib_musdk_dir', type: 'string', value: '',
 	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
-	description: 'set the target machine type')
+	description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
 option('max_lcores', type: 'integer', value: 128,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 02/14] build: rename Arm build variables
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 01/14] build: alias default build as generic Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 03/14] build: remove unused or superfluous variables Juraj Linkeš
                               ` (12 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 110 +++++++++++++--------------
 11 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7537d52fd..897bfb9fa 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -30,58 +30,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -92,8 +92,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -102,36 +102,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -146,13 +146,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -163,19 +163,19 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
@@ -186,22 +186,22 @@ else
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 03/14] build: remove unused or superfluous variables
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 01/14] build: alias default build as generic Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 02/14] build: rename Arm build variables Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 04/14] build: reformat and move Arm config and comments Juraj Linkeš
                               ` (11 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 897bfb9fa..45d1d1d79 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -63,7 +59,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -120,17 +115,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -146,11 +133,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -161,14 +146,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -201,7 +187,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 04/14] build: reformat and move Arm config and comments
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (2 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 03/14] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 05/14] build: simplify how Arm flags are processed Juraj Linkeš
                               ` (10 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armv8_linux_gcc | 21 ++++++-
 config/arm/meson.build           | 94 +++++++++++++++++++-------------
 2 files changed, 77 insertions(+), 38 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..04cd82ba9 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,9 +13,16 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Supported implementers:
+# 'generic': Generic armv8
+# '0x41':    Arm
+# '0x43':    Cavium
+# '0x50':    Ampere Computing
+# '0x56':    Marvell ARMADA
+# 'dpaa':    NXP DPAA
 implementer_id = 'generic'
 
-# Valid options for Arm's part_number:
+# Supported part_numbers for generic, 0x41, 0x56, dpaa:
 # 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
@@ -25,4 +32,16 @@ implementer_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
+# '0xd0c':   neoverse-n1
 part_number = 'generic'
+
+# Supported part_numbers for 0x43:
+# 'generic': valid for all Cavium builds
+# '0xa1':    thunderxt88
+# '0xa2':    thunderxt81
+# '0xa3':    thunderxt83
+# '0xaf':    thunderx2t99
+# '0xb2':    octeontx2
+
+# Supported part_numbers for 0x50:
+# 'generic': valid for all Ampere builds
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 45d1d1d79..05cc9e4f4 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,6 +5,7 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
@@ -12,8 +13,8 @@ flags_common_default = [
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -24,69 +25,86 @@ flags_common_default = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -97,8 +115,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -106,13 +124,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -124,21 +143,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
+		# generic build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -159,6 +178,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -195,7 +215,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 05/14] build: simplify how Arm flags are processed
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (3 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 04/14] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 06/14] build: organize Arm config into dict Juraj Linkeš
                               ` (9 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 05cc9e4f4..2908eba5e 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -151,7 +151,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
 		implementer_config = implementer_generic
@@ -184,34 +183,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_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('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common_default + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 06/14] build: organize Arm config into dict
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (4 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 05/14] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 14:09               ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 07/14] build: isolate configuration for generic build Juraj Linkeš
                               ` (8 subsequent siblings)
  14 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 2908eba5e..3e692057a 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -29,115 +29,146 @@ flags_common_default = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementers = {
+	'generic': {
+		'description': 'Generic armv8',
+		'flags': [
+			['RTE_MACHINE', '"armv8a"'],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_CACHE_LINE_SIZE', 128],
+			['RTE_MAX_LCORE', 256]
+		],
+		'part_number_config': part_number_config_arm
+	},
+	'0x41': {
+		'description': 'Arm',
+		'flags': [
+			['RTE_MACHINE', '"armv8a"'],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 16]
+		],
+		'part_number_config': part_number_config_arm
+	},
+	'0x43': {
+		'description': 'Cavium',
+		'flags': [
+			['RTE_MAX_VFIO_GROUPS', 128],
+			['RTE_CACHE_LINE_SIZE', 128],
+			['RTE_MAX_LCORE', 96],
+			['RTE_MAX_NUMA_NODES', 2]
+		],
+		'part_number_config': {
+			'generic': {'machine_args': ['-march=armv8-a+crc+crypto', '-mcpu=thunderx']},
+			'native': {'machine_args': ['-march=native']},
+			'0xa1': {
+				'machine_args': ['-mcpu=thunderxt88'],
+				'flags': flags_part_number_thunderx
+			},
+			'0xa2': {
+				'machine_args': ['-mcpu=thunderxt81'],
+				'flags': flags_part_number_thunderx
+			},
+			'0xa3': {
+				'machine_args': ['-mcpu=thunderxt83'],
+				'flags': flags_part_number_thunderx
+			},
+			'0xaf': {
+				'machine_args': ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
+				'flags': [
+					['RTE_MACHINE', '"thunderx2"'],
+					['RTE_ARM_FEATURE_ATOMICS', true],
+					['RTE_USE_C11_MEM_MODEL', true],
+					['RTE_CACHE_LINE_SIZE', 64],
+					['RTE_MAX_LCORE', 256],
+					['RTE_MAX_NUMA_NODES', 2]
+				]
+			},
+			'0xb2': {
+				'machine_args': ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
+				'flags': [
+					['RTE_MACHINE', '"octeontx2"'],
+					['RTE_ARM_FEATURE_ATOMICS', true],
+					['RTE_USE_C11_MEM_MODEL', true],
+					['RTE_EAL_IGB_UIO', false],
+					['RTE_MAX_LCORE', 36],
+					['RTE_MAX_NUMA_NODES', 1]
+				]
+			}
+		}
+	},
+	'0x50': {
+		'description': 'Ampere Computing',
+		'flags': [
+			['RTE_MACHINE', '"emag"'],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 32],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'part_number_config': {
+			'generic': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
+			'native': {'machine_args':  ['-march=native']}
+		}
+	},
+	'0x56': {
+		'description': 'Marvell ARMADA',
+		'flags': [
+			['RTE_MACHINE', '"armv8a"'],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'part_number_config': part_number_config_arm
+	},
+	'dpaa': {
+		'description': 'NXP DPAA',
+		'flags': [
+			['RTE_MACHINE', '"dpaa"'],
+			['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'part_number_config': part_number_config_arm
+	}
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -153,7 +184,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -168,9 +199,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -180,28 +211,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common_default + implementer_config[1]
+	dpdk_flags = flags_common_default + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 07/14] build: isolate configuration for generic build
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (5 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 06/14] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 14:09               ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 08/14] build: use native machine args in Arm native build Juraj Linkeš
                               ` (7 subsequent siblings)
  14 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armv8_linux_gcc              | 11 ++---
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 4 files changed, 30 insertions(+), 28 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 04cd82ba9..818953e0f 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -22,8 +22,11 @@ endian = 'little'
 # 'dpaa':    NXP DPAA
 implementer_id = 'generic'
 
-# Supported part_numbers for generic, 0x41, 0x56, dpaa:
-# 'generic': valid for all armv8-a architectures (default value)
+# Supported part_numbers for generic:
+# 'generic': valid for all armv8-a architectures (unoptimized portable build)
+part_number = 'generic'
+
+# Supported part_numbers for 0x41, 0x56, dpaa:
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -33,10 +36,8 @@ implementer_id = 'generic'
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
 # '0xd0c':   neoverse-n1
-part_number = 'generic'
 
 # Supported part_numbers for 0x43:
-# 'generic': valid for all Cavium builds
 # '0xa1':    thunderxt88
 # '0xa2':    thunderxt81
 # '0xa3':    thunderxt83
@@ -44,4 +45,4 @@ part_number = 'generic'
 # '0xb2':    octeontx2
 
 # Supported part_numbers for 0x50:
-# 'generic': valid for all Ampere builds
+# '0x0':     emag
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 3e692057a..92572f670 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -34,7 +34,6 @@ flags_part_number_thunderx = [
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -74,7 +73,9 @@ implementers = {
 			['RTE_CACHE_LINE_SIZE', 128],
 			['RTE_MAX_LCORE', 256]
 		],
-		'part_number_config': part_number_config_arm
+		'part_number_config': {
+			'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']}
+		}
 	},
 	'0x41': {
 		'description': 'Arm',
@@ -95,7 +96,6 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 2]
 		],
 		'part_number_config': {
-			'generic': {'machine_args': ['-march=armv8-a+crc+crypto', '-mcpu=thunderx']},
 			'native': {'machine_args': ['-march=native']},
 			'0xa1': {
 				'machine_args': ['-mcpu=thunderxt88'],
@@ -142,7 +142,7 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 1]
 		],
 		'part_number_config': {
-			'generic': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
+			'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
 			'native': {'machine_args':  ['-march=native']}
 		}
 	},
@@ -181,10 +181,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -197,21 +196,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -221,15 +223,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 08/14] build: use native machine args in Arm native build
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (6 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 07/14] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 09/14] ci: switch to generic Arm builds Juraj Linkeš
                               ` (6 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 92572f670..a3e5ff9df 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,8 +3,6 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -28,13 +26,13 @@ flags_common_default = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-march=native', '-mtune=native']
 
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -96,7 +94,6 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 2]
 		],
 		'part_number_config': {
-			'native': {'machine_args': ['-march=native']},
 			'0xa1': {
 				'machine_args': ['-mcpu=thunderxt88'],
 				'flags': flags_part_number_thunderx
@@ -142,8 +139,7 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 1]
 		],
 		'part_number_config': {
-			'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
-			'native': {'machine_args':  ['-march=native']}
+			'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']}
 		}
 	},
 	'0x56': {
@@ -181,26 +177,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'generic' and not meson.is_cross_build()
-		# generic build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -236,7 +233,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 09/14] ci: switch to generic Arm builds
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (7 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 08/14] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 10/14] build: optional NUMA and cpu counts detection Juraj Linkeš
                               ` (5 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Switch to generic build on arm Travis machines to avoid differences in
build configuration caused by different Arm hardware.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..7fe0fcfd8 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$(uname -m)" = "aarch64" ]; then
+    OPTS="$OPTS -Dmachine=generic"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 10/14] build: optional NUMA and cpu counts detection
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (8 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 09/14] ci: switch to generic Arm builds Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 11/14] build: add core and NUMA counts to cross files Juraj Linkeš
                               ` (4 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..b269d557b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..be73c5c3f
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index c7f7aa6e2..2974f7f6f 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,8 +231,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -251,6 +249,51 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovered values (user setting -1) are not supported be used when cross-compiling.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+	min_lcores = 2
+	# DPDK must be build for at least 2 cores
+	if max_lcores < min_lcores
+		message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+		max_lcores = min_lcores
+	else
+		message('Found @0@ cores'.format(max_lcores))
+	endif
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+endif
+
+max_numa_nodes = get_option('max_numa_nodes')
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovered values (user setting -1) are not supported be used when cross-compiling.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+	message('Found @0@ numa nodes'.format(max_numa_nodes))
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
+
+# check that cpu and numa count is set and error out if it's not set
+if not dpdk_conf.has('RTE_MAX_LCORE')
+	error('Number of cores not specified.')
+endif
+if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+	error('Number of numa nodes not specified.')
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index ce23289e3..e1059fb16 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 11/14] build: add core and NUMA counts to cross files
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (9 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 10/14] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 12/14] build: disable Arm drivers Juraj Linkeš
                               ` (3 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc      |  2 ++
 config/arm/arm64_armv8_linux_gcc       |  6 ++++++
 config/arm/arm64_bluefield_linux_gcc   |  2 ++
 config/arm/arm64_dpaa_linux_gcc        |  2 ++
 config/arm/arm64_emag_linux_gcc        |  2 ++
 config/arm/arm64_graviton2_linux_gcc   |  2 ++
 config/arm/arm64_n1sdp_linux_gcc       |  2 ++
 config/arm/arm64_octeontx2_linux_gcc   |  2 ++
 config/arm/arm64_stingray_linux_gcc    |  2 ++
 config/arm/arm64_thunderx2_linux_gcc   |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc |  2 ++
 config/arm/meson.build                 |  6 ++++--
 config/meson.build                     | 15 +++++++++++++++
 13 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..73945fbb4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 818953e0f..fb24be5fc 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -46,3 +46,9 @@ part_number = 'generic'
 
 # Supported part_numbers for 0x50:
 # '0x0':     emag
+
+# Supported extra configuration
+# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+# max_lcores = n      # will set RTE_MAX_LCORE
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..00101962b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index a3e5ff9df..b781c1d85 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -69,7 +69,8 @@ implementers = {
 			['RTE_MACHINE', '"armv8a"'],
 			['RTE_USE_C11_MEM_MODEL', true],
 			['RTE_CACHE_LINE_SIZE', 128],
-			['RTE_MAX_LCORE', 256]
+			['RTE_MAX_LCORE', 256],
+			['RTE_MAX_NUMA_NODES', 4]
 		],
 		'part_number_config': {
 			'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']}
@@ -81,7 +82,8 @@ implementers = {
 			['RTE_MACHINE', '"armv8a"'],
 			['RTE_USE_C11_MEM_MODEL', true],
 			['RTE_CACHE_LINE_SIZE', 64],
-			['RTE_MAX_LCORE', 16]
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
 		],
 		'part_number_config': part_number_config_arm
 	},
diff --git a/config/meson.build b/config/meson.build
index 2974f7f6f..41adb2303 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -249,6 +249,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 max_lcores = get_option('max_lcores')
 if max_lcores > 0
 	# Overwrite the default value from arch_subdir with user input
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 12/14] build: disable Arm drivers
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (10 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 11/14] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 13/14] build: disable libnuma in cross builds Juraj Linkeš
                               ` (2 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works. Remove
unneeded driver options ported from the old makefile system.
Add support for removing drivers for cross builds.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/arm64_armada_linux_gcc | 1 +
 config/arm/arm64_armv8_linux_gcc  | 3 +++
 config/arm/meson.build            | 8 +++-----
 drivers/meson.build               | 6 +++++-
 meson.build                       | 1 +
 5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 73945fbb4..7383f42e2 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index fb24be5fc..245e06e5f 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -52,3 +52,6 @@ part_number = 'generic'
 # max_lcores = n      # will set RTE_MAX_LCORE
 max_lcores = 256
 max_numa_nodes = 4
+
+# disabled_drivers = ['bus/dpaa', 'crypto']
+    # add to the set of disabled libraries
diff --git a/config/arm/meson.build b/config/arm/meson.build
index b781c1d85..210364173 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,6 +3,9 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k', 'net/sfc']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -17,10 +20,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_SFC_EFX', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -125,7 +124,6 @@ implementers = {
 					['RTE_MACHINE', '"octeontx2"'],
 					['RTE_ARM_FEATURE_ATOMICS', true],
 					['RTE_USE_C11_MEM_MODEL', true],
-					['RTE_EAL_IGB_UIO', false],
 					['RTE_MAX_LCORE', 36],
 					['RTE_MAX_NUMA_NODES', 1]
 				]
diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..a997387ad 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v7 13/14] build: disable libnuma in cross builds
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (11 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 12/14] build: disable Arm drivers Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 14/14] build: add Arm SoC meson option Juraj Linkeš
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disabled NUMA in Arm cross files.

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

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


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

* [dpdk-dev] [PATCH v7 14/14] build: add Arm SoC meson option
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (12 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 13/14] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-05 13:59             ` Juraj Linkeš
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 13:59 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc      |   6 +-
 config/arm/arm64_armv8_linux_gcc       |  58 +++--------
 config/arm/arm64_bluefield_linux_gcc   |   6 +-
 config/arm/arm64_dpaa_linux_gcc        |   5 +-
 config/arm/arm64_emag_linux_gcc        |   5 +-
 config/arm/arm64_graviton2_linux_gcc   |   6 +-
 config/arm/arm64_n1sdp_linux_gcc       |   6 +-
 config/arm/arm64_octeontx2_linux_gcc   |   6 +-
 config/arm/arm64_stingray_linux_gcc    |   6 +-
 config/arm/arm64_thunderx2_linux_gcc   |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc |   5 +-
 config/arm/meson.build                 | 132 ++++++++++++++++++++++++-
 meson_options.txt                      |   2 +
 13 files changed, 154 insertions(+), 94 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index f5403f0a6..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 77e3d6278..d4cb6b5bf 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,46 +13,18 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-# Supported implementers:
-# 'generic': Generic armv8
-# '0x41':    Arm
-# '0x43':    Cavium
-# '0x50':    Ampere Computing
-# '0x56':    Marvell ARMADA
-# 'dpaa':    NXP DPAA
-implementer_id = 'generic'
-
-# Supported part_numbers for generic:
-# 'generic': valid for all armv8-a architectures (unoptimized portable build)
-part_number = 'generic'
-
-# Supported part_numbers for 0x41, 0x56, dpaa:
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
-# '0xd0c':   neoverse-n1
-
-# Supported part_numbers for 0x43:
-# '0xa1':    thunderxt88
-# '0xa2':    thunderxt81
-# '0xa3':    thunderxt83
-# '0xaf':    thunderx2t99
-# '0xb2':    octeontx2
-
-# Supported part_numbers for 0x50:
-# '0x0':     emag
-
-# Supported extra configuration
-# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-# max_lcores = n      # will set RTE_MAX_LCORE
-max_lcores = 256
-max_numa_nodes = 4
-
-# numa = false        # set to false if the target is not a NUMA system
-# disabled_drivers = ['bus/dpaa', 'crypto']
-    # add to the set of disabled libraries
+# Supported SoCs:
+# generic
+# armada
+# bluefield
+# dpaa
+# emag
+# graviton2
+# n1sdp
+# octeontx2
+# stingray
+# thunderx2
+# thunderxt88
+# thunderx2t99
+
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 3458b9d7b..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,7 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 9c7dd4e6b..d88e720cd 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -57,7 +57,7 @@ part_number_config_arm = {
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementers = {
 	'generic': {
@@ -164,6 +164,102 @@ implementers = {
 	}
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+socs = {
+	'generic': {
+		'implementer': 'generic',
+		'part_number': 'generic',
+		'flags': []
+	},
+	'armada': {
+		'implementer': '0x56',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false,
+		'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+	},
+	'bluefield': {
+		'implementer': '0x41',
+		'part_number': '0xd08',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'dpaa': {
+		'implementer': 'dpaa',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'emag': {
+		'implementer': '0x50',
+		'part_number': '0x0',
+		'flags': [
+			['RTE_MAX_LCORE', 32],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	},
+	'graviton2': {
+		'implementer': '0x41',
+		'part_number': '0xd0c',
+		'flags': [
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'n1sdp': {
+		'implementer': '0x41',
+		'part_number': '0xd0c',
+		'flags': [
+			['RTE_MAX_LCORE', 4],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'octeontx2': {
+		'implementer': '0x43',
+		'part_number': '0xb2',
+		'flags': [
+			['RTE_MAX_LCORE', 32],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'stingray': {
+		'implementer': '0x41',
+		'part_number': '0xd08',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'thunderx2': {
+		'implementer': '0x43',
+		'part_number': '0xaf',
+		'flags': [
+			['RTE_MAX_LCORE', 256],
+			['RTE_MAX_NUMA_NODES', 2]
+		]
+	},
+	'thunderxt88': {
+		'implementer': '0x43',
+		'part_number': '0xa1',
+		'flags': [
+			['RTE_MAX_LCORE', 96],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -176,11 +272,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -199,8 +302,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config['flags']
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -226,8 +348,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common_default + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common_default + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
diff --git a/meson_options.txt b/meson_options.txt
index e1059fb16..33b8b236c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular Arm SoC when building on an aarch64 machine.')
 option('armv8_crypto_dir', type: 'string', value: '',
 	description: 'path to the armv8_crypto library installation directory')
 option('disable_drivers', type: 'string', value: '',
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v7 06/14] build: organize Arm config into dict
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 06/14] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-05 14:09               ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 14:09 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev



> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Thursday, November 5, 2020 2:59 PM
> To: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v7 06/14] build: organize Arm config into dict
> 
> Use dictionary lookup instead of checking for existing variables, iterating over all
> elements in the list or checking lists for optional configuration. Move variable
> contents into the dictionary for variables that would be referenced only once.
> Fallback to generic part number if the discovered part number is unknown.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 282 +++++++++++++++++++++++------------------
>  1 file changed, 160 insertions(+), 122 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 2908eba5e..3e692057a 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -29,115 +29,146 @@ flags_common_default = [
>  	['RTE_CACHE_LINE_SIZE', 128]
>  ]
> 
> -# implementer specific aarch64 flags, with middle priority -# (will overwrite
> common flags) -flags_implementer_generic = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 256]
> -]
> -flags_implementer_arm = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16]
> -]
> -flags_implementer_cavium = [
> -	['RTE_MAX_VFIO_GROUPS', 128],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 96],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_implementer_dpaa = [
> -	['RTE_MACHINE', '"dpaa"'],
> -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_emag = [
> -	['RTE_MACHINE', '"emag"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 32],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_armada = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -
> -# part number specific aarch64 flags, with highest priority -# (will overwrite
> both common and implementer specific flags)  flags_part_number_thunderx = [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]
>  ]
> -flags_part_number_thunderx2 = [
> -	['RTE_MACHINE', '"thunderx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 256],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_part_number_octeontx2 = [
> -	['RTE_MACHINE', '"octeontx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_IGB_UIO', false],
> -	['RTE_MAX_LCORE', 36],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_part_number_n1generic = [
> -	['RTE_MACHINE', '"neoverse-n1"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false],
> -	['RTE_MAX_MEM_MB', 1048576],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 64],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -
> -# arm config (implementer 0x41) is the default config -
> part_number_config_arm = [
> -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> -	['native', ['-march=native']],
> -	['0xd03', ['-mcpu=cortex-a53']],
> -	['0xd04', ['-mcpu=cortex-a35']],
> -	['0xd07', ['-mcpu=cortex-a57']],
> -	['0xd08', ['-mcpu=cortex-a72']],
> -	['0xd09', ['-mcpu=cortex-a73']],
> -	['0xd0a', ['-mcpu=cortex-a75']],
> -	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> flags_part_number_n1generic]
> -]
> -part_number_config_cavium = [
> -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> -	['native', ['-march=native']],
> -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_part_number_thunderx2],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_part_number_octeontx2]
> -]
> -part_number_config_emag = [
> -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]
> -]
> +part_number_config_arm = {
> +	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-
> atomics']},
> +	'native': {'machine_args':  ['-march=native']},
> +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> +	'0xd0c': {
> +		'machine_args':  ['-march=armv8.2-a+crypto', '-mcpu=neoverse-
> n1'],
> +		'flags': [
> +			['RTE_MACHINE', '"neoverse-n1"'],
> +			['RTE_ARM_FEATURE_ATOMICS', true],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> +			['RTE_LIBRTE_VHOST_NUMA', false],
> +			['RTE_MAX_MEM_MB', 1048576],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 64],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		]
> +	}
> +}
> 
> -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> implementer_generic = ['Generic armv8', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
> -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium]
> -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> part_number_config_emag]
> -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> flags_implementer_dpaa, part_number_config_arm]
> +## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
> +## Part numbers are specific to Arm implementers # implementer specific
> +aarch64 flags have middle priority
> +#     (will overwrite common flags)
> +# part number specific aarch64 flags have the highest priority
> +#     (will overwrite both common and implementer specific flags)
> +implementers = {
> +	'generic': {
> +		'description': 'Generic armv8',
> +		'flags': [
> +			['RTE_MACHINE', '"armv8a"'],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_CACHE_LINE_SIZE', 128],
> +			['RTE_MAX_LCORE', 256]
> +		],
> +		'part_number_config': part_number_config_arm
> +	},
> +	'0x41': {
> +		'description': 'Arm',
> +		'flags': [
> +			['RTE_MACHINE', '"armv8a"'],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 16]
> +		],
> +		'part_number_config': part_number_config_arm
> +	},
> +	'0x43': {
> +		'description': 'Cavium',
> +		'flags': [
> +			['RTE_MAX_VFIO_GROUPS', 128],
> +			['RTE_CACHE_LINE_SIZE', 128],
> +			['RTE_MAX_LCORE', 96],
> +			['RTE_MAX_NUMA_NODES', 2]
> +		],
> +		'part_number_config': {
> +			'generic': {'machine_args': ['-march=armv8-
> a+crc+crypto', '-mcpu=thunderx']},
> +			'native': {'machine_args': ['-march=native']},
> +			'0xa1': {
> +				'machine_args': ['-mcpu=thunderxt88'],
> +				'flags': flags_part_number_thunderx
> +			},
> +			'0xa2': {
> +				'machine_args': ['-mcpu=thunderxt81'],
> +				'flags': flags_part_number_thunderx
> +			},
> +			'0xa3': {
> +				'machine_args': ['-mcpu=thunderxt83'],
> +				'flags': flags_part_number_thunderx
> +			},
> +			'0xaf': {
> +				'machine_args': ['-march=armv8.1-
> a+crc+crypto','-mcpu=thunderx2t99'],
> +				'flags': [
> +					['RTE_MACHINE', '"thunderx2"'],
> +					['RTE_ARM_FEATURE_ATOMICS', true],
> +					['RTE_USE_C11_MEM_MODEL', true],
> +					['RTE_CACHE_LINE_SIZE', 64],
> +					['RTE_MAX_LCORE', 256],
> +					['RTE_MAX_NUMA_NODES', 2]
> +				]
> +			},
> +			'0xb2': {
> +				'machine_args': ['-march=armv8.2-
> a+crc+crypto+lse','-mcpu=octeontx2'],
> +				'flags': [
> +					['RTE_MACHINE', '"octeontx2"'],
> +					['RTE_ARM_FEATURE_ATOMICS', true],
> +					['RTE_USE_C11_MEM_MODEL', true],
> +					['RTE_EAL_IGB_UIO', false],
> +					['RTE_MAX_LCORE', 36],
> +					['RTE_MAX_NUMA_NODES', 1]
> +				]
> +			}
> +		}
> +	},
> +	'0x50': {
> +		'description': 'Ampere Computing',
> +		'flags': [
> +			['RTE_MACHINE', '"emag"'],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 32],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'part_number_config': {
> +			'generic': {'machine_args':  ['-march=armv8-
> a+crc+crypto', '-mtune=emag']},
> +			'native': {'machine_args':  ['-march=native']}
> +		}
> +	},
> +	'0x56': {
> +		'description': 'Marvell ARMADA',
> +		'flags': [
> +			['RTE_MACHINE', '"armv8a"'],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'part_number_config': part_number_config_arm
> +	},
> +	'dpaa': {
> +		'description': 'NXP DPAA',
> +		'flags': [
> +			['RTE_MACHINE', '"dpaa"'],
> +			['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'part_number_config': part_number_config_arm
> +	}
> +}

I have some questions here. Dpaa and armada are using the same part number config as 0x41. I think we should add their own par numbers (since part number config should be unique to each implementer) - any ideas on what those should be?

And what exactly is dpaa implementer? From the looks of it it's a feature and using it as implementer doesn't seem right.

> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -153,7 +184,7 @@ else
>  	implementer_id = 'generic'
>  	if machine == 'generic' and not meson.is_cross_build()
>  		# generic build
> -		implementer_config = implementer_generic
> +		implementer_config = implementer['generic']
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# native build
> @@ -168,9 +199,9 @@ else
>  			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> implementer_id, ['generic'])
> +		implementer_config = implementers.get(implementer_id,
> ['generic'])
>  		if implementer_config[0] == 'generic'
> -			implementer_config = implementer_generic
> +			implementer_config = implementer['generic']
>  			part_number = 'generic'
>  		endif
>  		if arm_force_native_march == true
> @@ -180,28 +211,35 @@ else
>  		# cross build
>  		implementer_id = meson.get_cross_property('implementer_id',
> 'generic')
>  		part_number = meson.get_cross_property('part_number',
> 'generic')
> -		implementer_config = get_variable('implementer_' +
> implementer_id)
> +		implementer_config = implementers.get(implementer_id)
>  	endif
> 
> -	message('Arm implementer: ' + implementer_config[0])
> +	message('Arm implementer: ' + implementer_config['description'])
>  	message('Arm part number: ' + part_number)
> 
> +	part_number_config = implementer_config['part_number_config']
> +	if part_number_config.has_key(part_number)
> +		# use the specified part_number machine args if found
> +		part_number_config = part_number_config[part_number]
> +	elif not meson.is_cross_build()
> +		# default to generic machine args if part_number is not found
> +		# and not forcing native machine args
> +		# but don't default in cross-builds; if part_number is specified
> +		# incorrectly in a cross-file, it needs to be fixed there
> +		part_number_config = part_number_config['generic']
> +	else
> +		# doing cross build and part number is not in
> part_number_config
> +		error('Cross build part number 0@0 not
> found.'.format(part_number))
> +	endif
> +
>  	# use default flags with implementer flags
> -	dpdk_flags = flags_common_default + implementer_config[1]
> +	dpdk_flags = flags_common_default + implementer_config['flags'] +
> +part_number_config.get('flags', [])
> 
> +	# apply supported machine args
>  	machine_args = [] # Clear previous machine args
> -	foreach marg: implementer_config[2]
> -		if marg[0] == part_number
> -			# apply supported machine args
> -			foreach flag: marg[1]
> -				if cc.has_argument(flag)
> -					machine_args += flag
> -				endif
> -			endforeach
> -			if marg.length() > 2
> -				# add extra flags for the part
> -				dpdk_flags += marg[2]
> -			endif
> +	foreach flag: part_number_config['machine_args']
> +		if cc.has_argument(flag)
> +			machine_args += flag
>  		endif
>  	endforeach
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v7 07/14] build: isolate configuration for generic build
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 07/14] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-05 14:09               ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-05 14:09 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev



> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Thursday, November 5, 2020 2:59 PM
> To: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v7 07/14] build: isolate configuration for generic build
> 
> Use generic configuration for the only build where it makes sense - the generic
> build. For other builds, if we don't know either of implementer ID or part
> number, the build is not supported.
> Add part numbers to cross files where fallback to generic configuration is
> assumed.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armv8_linux_gcc              | 11 ++---
>  config/arm/arm64_emag_linux_gcc               |  1 +
>  ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
>  config/arm/meson.build                        | 45 +++++++++----------
>  4 files changed, 30 insertions(+), 28 deletions(-)  rename
> config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc}
> (93%)
> 
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 04cd82ba9..818953e0f 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -22,8 +22,11 @@ endian = 'little'
>  # 'dpaa':    NXP DPAA
>  implementer_id = 'generic'
> 
> -# Supported part_numbers for generic, 0x41, 0x56, dpaa:
> -# 'generic': valid for all armv8-a architectures (default value)
> +# Supported part_numbers for generic:
> +# 'generic': valid for all armv8-a architectures (unoptimized portable
> +build) part_number = 'generic'
> +
> +# Supported part_numbers for 0x41, 0x56, dpaa:
>  # '0xd03':   cortex-a53
>  # '0xd04':   cortex-a35
>  # '0xd05':   cortex-a55
> @@ -33,10 +36,8 @@ implementer_id = 'generic'
>  # '0xd0a':   cortex-a75
>  # '0xd0b':   cortex-a76
>  # '0xd0c':   neoverse-n1
> -part_number = 'generic'
> 
>  # Supported part_numbers for 0x43:
> -# 'generic': valid for all Cavium builds
>  # '0xa1':    thunderxt88
>  # '0xa2':    thunderxt81
>  # '0xa3':    thunderxt83
> @@ -44,4 +45,4 @@ part_number = 'generic'
>  # '0xb2':    octeontx2
> 
>  # Supported part_numbers for 0x50:
> -# 'generic': valid for all Ampere builds
> +# '0x0':     emag
> diff --git a/config/arm/arm64_emag_linux_gcc
> b/config/arm/arm64_emag_linux_gcc index 24f3d533e..c675954fc 100644
> --- a/config/arm/arm64_emag_linux_gcc
> +++ b/config/arm/arm64_emag_linux_gcc
> @@ -14,3 +14,4 @@ endian = 'little'
> 
>  [properties]
>  implementer_id = '0x50'
> +part_number = '0x0'
> diff --git a/config/arm/arm64_thunderx_linux_gcc
> b/config/arm/arm64_thunderxt88_linux_gcc
> similarity index 93%
> rename from config/arm/arm64_thunderx_linux_gcc
> rename to config/arm/arm64_thunderxt88_linux_gcc
> index 670764437..758966262 100644
> --- a/config/arm/arm64_thunderx_linux_gcc
> +++ b/config/arm/arm64_thunderxt88_linux_gcc
> @@ -14,3 +14,4 @@ endian = 'little'
> 
>  [properties]
>  implementer_id = '0x43'
> +part_number = '0xa1'
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 3e692057a..92572f670 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -34,7 +34,6 @@ flags_part_number_thunderx = [
>  	['RTE_USE_C11_MEM_MODEL', false]
>  ]
>  part_number_config_arm = {
> -	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-
> atomics']},
>  	'native': {'machine_args':  ['-march=native']},
>  	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
>  	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']}, @@ -74,7 +73,9 @@
> implementers = {
>  			['RTE_CACHE_LINE_SIZE', 128],
>  			['RTE_MAX_LCORE', 256]
>  		],
> -		'part_number_config': part_number_config_arm
> +		'part_number_config': {
> +			'generic': {'machine_args':  ['-march=armv8-a+crc', '-
> moutline-atomics']}
> +		}
>  	},
>  	'0x41': {
>  		'description': 'Arm',
> @@ -95,7 +96,6 @@ implementers = {
>  			['RTE_MAX_NUMA_NODES', 2]
>  		],
>  		'part_number_config': {
> -			'generic': {'machine_args': ['-march=armv8-
> a+crc+crypto', '-mcpu=thunderx']},
>  			'native': {'machine_args': ['-march=native']},
>  			'0xa1': {
>  				'machine_args': ['-mcpu=thunderxt88'], @@ -
> 142,7 +142,7 @@ implementers = {
>  			['RTE_MAX_NUMA_NODES', 1]
>  		],
>  		'part_number_config': {
> -			'generic': {'machine_args':  ['-march=armv8-
> a+crc+crypto', '-mtune=emag']},
> +			'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
> +'-mtune=emag']},

I removed generic from emag and instead used 0x0. Ruifeng, can you confirm that this is the right part number for emag?

>  			'native': {'machine_args':  ['-march=native']}
>  		}
>  	},
> @@ -181,10 +181,9 @@ if dpdk_conf.get('RTE_ARCH_32')
>  	machine_args += '-mfpu=neon'
>  else
>  	# aarch64 build
> -	implementer_id = 'generic'
>  	if machine == 'generic' and not meson.is_cross_build()
>  		# generic build
> -		implementer_config = implementer['generic']
> +		implementer_id = 'generic'
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# native build
> @@ -197,21 +196,24 @@ else
>  			cmd_output = cmd.stdout().to_lower().strip().split(' ')
>  			implementer_id = cmd_output[0]
>  			part_number = cmd_output[3]
> -		endif
> -		# Set to generic if variable is not found
> -		implementer_config = implementers.get(implementer_id,
> ['generic'])
> -		if implementer_config[0] == 'generic'
> -			implementer_config = implementer['generic']
> -			part_number = 'generic'
> +		else
> +			error('Error when getting Arm Implementer ID and part
> number.')
>  		endif
>  		if arm_force_native_march == true
>  			part_number = 'native'
>  		endif
>  	else
>  		# cross build
> -		implementer_id = meson.get_cross_property('implementer_id',
> 'generic')
> -		part_number = meson.get_cross_property('part_number',
> 'generic')
> -		implementer_config = implementers.get(implementer_id)
> +		implementer_id = meson.get_cross_property('implementer_id')
> +		part_number = meson.get_cross_property('part_number')
> +	endif
> +
> +	if implementers.has_key(implementer_id)
> +		implementer_config = implementers[implementer_id]
> +	else
> +		error('Unsupported Arm implementer: @0@.
> '.format(implementer_id) +
> +		      'Please add support for it or use the generic ' +
> +		      '(-Dmachine=generic) build.')
>  	endif
> 
>  	message('Arm implementer: ' + implementer_config['description'])
> @@ -221,15 +223,12 @@ else
>  	if part_number_config.has_key(part_number)
>  		# use the specified part_number machine args if found
>  		part_number_config = part_number_config[part_number]
> -	elif not meson.is_cross_build()
> -		# default to generic machine args if part_number is not found
> -		# and not forcing native machine args
> -		# but don't default in cross-builds; if part_number is specified
> -		# incorrectly in a cross-file, it needs to be fixed there
> -		part_number_config = part_number_config['generic']
>  	else
> -		# doing cross build and part number is not in
> part_number_config
> -		error('Cross build part number 0@0 not
> found.'.format(part_number))
> +		# unknown part number
> +		error('Unsupported part number @0@ of implementer @1@. '
> +		      .format(part_number, implementer_id) +
> +		      'Please add support for it or use the generic ' +
> +		      '(-Dmachine=generic) build.')
>  	endif
> 
>  	# use default flags with implementer flags
> --
> 2.20.1


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

* [dpdk-dev] [PATCH v8 00/14] Arm build options rework
  2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
                               ` (13 preceding siblings ...)
  2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 14/14] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-06  8:03             ` Juraj Linkeš
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic Juraj Linkeš
                                 ` (15 more replies)
  14 siblings, 16 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in cross files.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs must be done using
  cross-files
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

Juraj Linkeš (14):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for generic build
  build: use native machine args in Arm native build
  ci: switch to generic Arm builds
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: disable libnuma in cross builds
  build: add Arm SoC meson option

 .ci/linux-build.sh                            |   4 +
 buildtools/get_cpu_count.py                   |   7 +
 buildtools/get_numa_count.py                  |  22 +
 buildtools/meson.build                        |   2 +
 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  26 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 494 ++++++++++++------
 config/meson.build                            |  90 +++-
 config/x86/meson.build                        |   2 +
 doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |  12 +-
 22 files changed, 483 insertions(+), 213 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-06 23:52                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 02/14] build: rename Arm build variables Juraj Linkeš
                                 ` (14 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/meson.build                    | 5 +++--
 config/meson.build                        | 9 +++++----
 doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
 meson_options.txt                         | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..d4066ade8 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -148,7 +149,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..c7f7aa6e2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +83,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 3429e2647..c7e12eedf 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
 
 	meson -Denable_docs=true fullbuild  # build and install docs
 
-	meson -Dmachine=default  # use builder-independent baseline -march
+	meson -Dmachine=generic  # use builder-independent baseline -march
 
 	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
 					# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
         re-scan from meson.
 
 .. note::
-        machine=default uses a config that works on all supported architectures
+        machine=generic uses a config that works on all supported architectures
         regardless of the capabilities of the machine where the build is happening.
 
 As well as those settings taken from ``meson configure``, other options
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..ce23289e3 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
 option('lib_musdk_dir', type: 'string', value: '',
 	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
-	description: 'set the target machine type')
+	description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
 option('max_lcores', type: 'integer', value: 128,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 02/14] build: rename Arm build variables
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-07  0:47                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 03/14] build: remove unused or superfluous variables Juraj Linkeš
                                 ` (13 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 110 +++++++++++++--------------
 11 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index d4066ade8..7fe0f3f3c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -29,58 +29,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -91,8 +91,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -101,36 +101,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -145,13 +145,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -162,19 +162,19 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
@@ -185,22 +185,22 @@ else
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 03/14] build: remove unused or superfluous variables
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic Juraj Linkeš
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 02/14] build: rename Arm build variables Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-07  0:52                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments Juraj Linkeš
                                 ` (12 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7fe0f3f3c..7c7059cc2 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -62,7 +58,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -119,17 +114,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -145,11 +132,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -160,14 +145,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -200,7 +186,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (2 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 03/14] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-08  2:51                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 05/14] build: simplify how Arm flags are processed Juraj Linkeš
                                 ` (11 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armv8_linux_gcc | 21 ++++++-
 config/arm/meson.build           | 94 +++++++++++++++++++-------------
 2 files changed, 77 insertions(+), 38 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..04cd82ba9 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,9 +13,16 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Supported implementers:
+# 'generic': Generic armv8
+# '0x41':    Arm
+# '0x43':    Cavium
+# '0x50':    Ampere Computing
+# '0x56':    Marvell ARMADA
+# 'dpaa':    NXP DPAA
 implementer_id = 'generic'
 
-# Valid options for Arm's part_number:
+# Supported part_numbers for generic, 0x41, 0x56, dpaa:
 # 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
@@ -25,4 +32,16 @@ implementer_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
+# '0xd0c':   neoverse-n1
 part_number = 'generic'
+
+# Supported part_numbers for 0x43:
+# 'generic': valid for all Cavium builds
+# '0xa1':    thunderxt88
+# '0xa2':    thunderxt81
+# '0xa3':    thunderxt83
+# '0xaf':    thunderx2t99
+# '0xb2':    octeontx2
+
+# Supported part_numbers for 0x50:
+# 'generic': valid for all Ampere builds
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7c7059cc2..5b922ef9c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,6 +5,7 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
@@ -12,8 +13,8 @@ flags_common_default = [
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -23,69 +24,86 @@ flags_common_default = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -96,8 +114,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -105,13 +123,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -123,21 +142,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
+		# generic build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -158,6 +177,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -194,7 +214,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 05/14] build: simplify how Arm flags are processed
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (3 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-08  3:19                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict Juraj Linkeš
                                 ` (10 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 5b922ef9c..eda485e7f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -150,7 +150,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
 		implementer_config = implementer_generic
@@ -183,34 +182,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_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('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common_default + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (4 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 05/14] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-08 19:45                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 07/14] build: isolate configuration for generic build Juraj Linkeš
                                 ` (9 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index eda485e7f..5d232f1c4 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -28,115 +28,146 @@ flags_common_default = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementers = {
+	'generic': {
+		'description': 'Generic armv8',
+		'flags': [
+			['RTE_MACHINE', '"armv8a"'],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_CACHE_LINE_SIZE', 128],
+			['RTE_MAX_LCORE', 256]
+		],
+		'part_number_config': part_number_config_arm
+	},
+	'0x41': {
+		'description': 'Arm',
+		'flags': [
+			['RTE_MACHINE', '"armv8a"'],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 16]
+		],
+		'part_number_config': part_number_config_arm
+	},
+	'0x43': {
+		'description': 'Cavium',
+		'flags': [
+			['RTE_MAX_VFIO_GROUPS', 128],
+			['RTE_CACHE_LINE_SIZE', 128],
+			['RTE_MAX_LCORE', 96],
+			['RTE_MAX_NUMA_NODES', 2]
+		],
+		'part_number_config': {
+			'generic': {'machine_args': ['-march=armv8-a+crc+crypto', '-mcpu=thunderx']},
+			'native': {'machine_args': ['-march=native']},
+			'0xa1': {
+				'machine_args': ['-mcpu=thunderxt88'],
+				'flags': flags_part_number_thunderx
+			},
+			'0xa2': {
+				'machine_args': ['-mcpu=thunderxt81'],
+				'flags': flags_part_number_thunderx
+			},
+			'0xa3': {
+				'machine_args': ['-mcpu=thunderxt83'],
+				'flags': flags_part_number_thunderx
+			},
+			'0xaf': {
+				'machine_args': ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
+				'flags': [
+					['RTE_MACHINE', '"thunderx2"'],
+					['RTE_ARM_FEATURE_ATOMICS', true],
+					['RTE_USE_C11_MEM_MODEL', true],
+					['RTE_CACHE_LINE_SIZE', 64],
+					['RTE_MAX_LCORE', 256],
+					['RTE_MAX_NUMA_NODES', 2]
+				]
+			},
+			'0xb2': {
+				'machine_args': ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
+				'flags': [
+					['RTE_MACHINE', '"octeontx2"'],
+					['RTE_ARM_FEATURE_ATOMICS', true],
+					['RTE_USE_C11_MEM_MODEL', true],
+					['RTE_EAL_IGB_UIO', false],
+					['RTE_MAX_LCORE', 36],
+					['RTE_MAX_NUMA_NODES', 1]
+				]
+			}
+		}
+	},
+	'0x50': {
+		'description': 'Ampere Computing',
+		'flags': [
+			['RTE_MACHINE', '"emag"'],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 32],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'part_number_config': {
+			'generic': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
+			'native': {'machine_args':  ['-march=native']}
+		}
+	},
+	'0x56': {
+		'description': 'Marvell ARMADA',
+		'flags': [
+			['RTE_MACHINE', '"armv8a"'],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'part_number_config': part_number_config_arm
+	},
+	'dpaa': {
+		'description': 'NXP DPAA',
+		'flags': [
+			['RTE_MACHINE', '"dpaa"'],
+			['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'part_number_config': part_number_config_arm
+	}
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -152,7 +183,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -167,9 +198,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -179,28 +210,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common_default + implementer_config[1]
+	dpdk_flags = flags_common_default + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 07/14] build: isolate configuration for generic build
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (5 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 08/14] build: use native machine args in Arm native build Juraj Linkeš
                                 ` (8 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armv8_linux_gcc              | 11 ++---
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 4 files changed, 30 insertions(+), 28 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 04cd82ba9..818953e0f 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -22,8 +22,11 @@ endian = 'little'
 # 'dpaa':    NXP DPAA
 implementer_id = 'generic'
 
-# Supported part_numbers for generic, 0x41, 0x56, dpaa:
-# 'generic': valid for all armv8-a architectures (default value)
+# Supported part_numbers for generic:
+# 'generic': valid for all armv8-a architectures (unoptimized portable build)
+part_number = 'generic'
+
+# Supported part_numbers for 0x41, 0x56, dpaa:
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -33,10 +36,8 @@ implementer_id = 'generic'
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
 # '0xd0c':   neoverse-n1
-part_number = 'generic'
 
 # Supported part_numbers for 0x43:
-# 'generic': valid for all Cavium builds
 # '0xa1':    thunderxt88
 # '0xa2':    thunderxt81
 # '0xa3':    thunderxt83
@@ -44,4 +45,4 @@ part_number = 'generic'
 # '0xb2':    octeontx2
 
 # Supported part_numbers for 0x50:
-# 'generic': valid for all Ampere builds
+# '0x0':     emag
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 5d232f1c4..fcf7107a5 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -33,7 +33,6 @@ flags_part_number_thunderx = [
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -73,7 +72,9 @@ implementers = {
 			['RTE_CACHE_LINE_SIZE', 128],
 			['RTE_MAX_LCORE', 256]
 		],
-		'part_number_config': part_number_config_arm
+		'part_number_config': {
+			'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']}
+		}
 	},
 	'0x41': {
 		'description': 'Arm',
@@ -94,7 +95,6 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 2]
 		],
 		'part_number_config': {
-			'generic': {'machine_args': ['-march=armv8-a+crc+crypto', '-mcpu=thunderx']},
 			'native': {'machine_args': ['-march=native']},
 			'0xa1': {
 				'machine_args': ['-mcpu=thunderxt88'],
@@ -141,7 +141,7 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 1]
 		],
 		'part_number_config': {
-			'generic': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
+			'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
 			'native': {'machine_args':  ['-march=native']}
 		}
 	},
@@ -180,10 +180,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -196,21 +195,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -220,15 +222,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 08/14] build: use native machine args in Arm native build
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (6 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 07/14] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds Juraj Linkeš
                                 ` (7 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index fcf7107a5..7def8bab5 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,8 +3,6 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -27,13 +25,13 @@ flags_common_default = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-march=native', '-mtune=native']
 
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -95,7 +93,6 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 2]
 		],
 		'part_number_config': {
-			'native': {'machine_args': ['-march=native']},
 			'0xa1': {
 				'machine_args': ['-mcpu=thunderxt88'],
 				'flags': flags_part_number_thunderx
@@ -141,8 +138,7 @@ implementers = {
 			['RTE_MAX_NUMA_NODES', 1]
 		],
 		'part_number_config': {
-			'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']},
-			'native': {'machine_args':  ['-march=native']}
+			'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto', '-mtune=emag']}
 		}
 	},
 	'0x56': {
@@ -180,26 +176,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'generic' and not meson.is_cross_build()
-		# generic build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -235,7 +232,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (7 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 08/14] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-08 14:42                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 10/14] build: optional NUMA and cpu counts detection Juraj Linkeš
                                 ` (6 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Switch to generic build on arm Travis machines to avoid differences in
build configuration caused by different Arm hardware.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..7fe0fcfd8 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$(uname -m)" = "aarch64" ]; then
+    OPTS="$OPTS -Dmachine=generic"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 10/14] build: optional NUMA and cpu counts detection
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (8 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-09 22:52                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 11/14] build: add core and NUMA counts to cross files Juraj Linkeš
                                 ` (5 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..b269d557b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..be73c5c3f
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index c7f7aa6e2..2974f7f6f 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,8 +231,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -251,6 +249,51 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovered values (user setting -1) are not supported be used when cross-compiling.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+	min_lcores = 2
+	# DPDK must be build for at least 2 cores
+	if max_lcores < min_lcores
+		message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+		max_lcores = min_lcores
+	else
+		message('Found @0@ cores'.format(max_lcores))
+	endif
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+endif
+
+max_numa_nodes = get_option('max_numa_nodes')
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovered values (user setting -1) are not supported be used when cross-compiling.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+	message('Found @0@ numa nodes'.format(max_numa_nodes))
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
+
+# check that cpu and numa count is set and error out if it's not set
+if not dpdk_conf.has('RTE_MAX_LCORE')
+	error('Number of cores not specified.')
+endif
+if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+	error('Number of numa nodes not specified.')
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index ce23289e3..e1059fb16 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type. Set to generic for a build usable on most machines of the build machine architecture, set to native to let the compiler choose the best fit for the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to use number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 11/14] build: add core and NUMA counts to cross files
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (9 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 10/14] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers Juraj Linkeš
                                 ` (4 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc      |  2 ++
 config/arm/arm64_armv8_linux_gcc       |  6 ++++++
 config/arm/arm64_bluefield_linux_gcc   |  2 ++
 config/arm/arm64_dpaa_linux_gcc        |  2 ++
 config/arm/arm64_emag_linux_gcc        |  2 ++
 config/arm/arm64_graviton2_linux_gcc   |  2 ++
 config/arm/arm64_n1sdp_linux_gcc       |  2 ++
 config/arm/arm64_octeontx2_linux_gcc   |  2 ++
 config/arm/arm64_stingray_linux_gcc    |  2 ++
 config/arm/arm64_thunderx2_linux_gcc   |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc |  2 ++
 config/arm/meson.build                 |  6 ++++--
 config/meson.build                     | 15 +++++++++++++++
 13 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..73945fbb4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 818953e0f..fb24be5fc 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -46,3 +46,9 @@ part_number = 'generic'
 
 # Supported part_numbers for 0x50:
 # '0x0':     emag
+
+# Supported extra configuration
+# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+# max_lcores = n      # will set RTE_MAX_LCORE
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..00101962b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7def8bab5..e9bb60045 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -68,7 +68,8 @@ implementers = {
 			['RTE_MACHINE', '"armv8a"'],
 			['RTE_USE_C11_MEM_MODEL', true],
 			['RTE_CACHE_LINE_SIZE', 128],
-			['RTE_MAX_LCORE', 256]
+			['RTE_MAX_LCORE', 256],
+			['RTE_MAX_NUMA_NODES', 4]
 		],
 		'part_number_config': {
 			'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']}
@@ -80,7 +81,8 @@ implementers = {
 			['RTE_MACHINE', '"armv8a"'],
 			['RTE_USE_C11_MEM_MODEL', true],
 			['RTE_CACHE_LINE_SIZE', 64],
-			['RTE_MAX_LCORE', 16]
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
 		],
 		'part_number_config': part_number_config_arm
 	},
diff --git a/config/meson.build b/config/meson.build
index 2974f7f6f..41adb2303 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -249,6 +249,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 max_lcores = get_option('max_lcores')
 if max_lcores > 0
 	# Overwrite the default value from arch_subdir with user input
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (10 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 11/14] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-08 20:19                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds Juraj Linkeš
                                 ` (3 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works. Remove
unneeded driver options ported from the old makefile system.
Add support for removing drivers for cross builds.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/arm64_armada_linux_gcc | 1 +
 config/arm/arm64_armv8_linux_gcc  | 3 +++
 config/arm/meson.build            | 7 +++----
 drivers/meson.build               | 6 +++++-
 meson.build                       | 1 +
 5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 73945fbb4..7383f42e2 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index fb24be5fc..245e06e5f 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -52,3 +52,6 @@ part_number = 'generic'
 # max_lcores = n      # will set RTE_MAX_LCORE
 max_lcores = 256
 max_numa_nodes = 4
+
+# disabled_drivers = ['bus/dpaa', 'crypto']
+    # add to the set of disabled libraries
diff --git a/config/arm/meson.build b/config/arm/meson.build
index e9bb60045..a39a35b6a 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,6 +3,9 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -17,9 +20,6 @@ flags_common_default = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -124,7 +124,6 @@ implementers = {
 					['RTE_MACHINE', '"octeontx2"'],
 					['RTE_ARM_FEATURE_ATOMICS', true],
 					['RTE_USE_C11_MEM_MODEL', true],
-					['RTE_EAL_IGB_UIO', false],
 					['RTE_MAX_LCORE', 36],
 					['RTE_MAX_NUMA_NODES', 1]
 				]
diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..a997387ad 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (11 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-09  0:24                 ` Honnappa Nagarahalli
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option Juraj Linkeš
                                 ` (2 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disabled NUMA in Arm cross files.

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

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


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

* [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (12 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-06  8:03               ` Juraj Linkeš
  2020-11-09  2:40                 ` Honnappa Nagarahalli
  2020-11-06  8:23               ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Morten Brørup
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc      |   6 +-
 config/arm/arm64_armv8_linux_gcc       |  58 +++--------
 config/arm/arm64_bluefield_linux_gcc   |   6 +-
 config/arm/arm64_dpaa_linux_gcc        |   5 +-
 config/arm/arm64_emag_linux_gcc        |   5 +-
 config/arm/arm64_graviton2_linux_gcc   |   6 +-
 config/arm/arm64_n1sdp_linux_gcc       |   6 +-
 config/arm/arm64_octeontx2_linux_gcc   |   6 +-
 config/arm/arm64_stingray_linux_gcc    |   6 +-
 config/arm/arm64_thunderx2_linux_gcc   |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc |   5 +-
 config/arm/meson.build                 | 132 ++++++++++++++++++++++++-
 meson_options.txt                      |   2 +
 13 files changed, 154 insertions(+), 94 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index f5403f0a6..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 77e3d6278..d4cb6b5bf 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,46 +13,18 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-# Supported implementers:
-# 'generic': Generic armv8
-# '0x41':    Arm
-# '0x43':    Cavium
-# '0x50':    Ampere Computing
-# '0x56':    Marvell ARMADA
-# 'dpaa':    NXP DPAA
-implementer_id = 'generic'
-
-# Supported part_numbers for generic:
-# 'generic': valid for all armv8-a architectures (unoptimized portable build)
-part_number = 'generic'
-
-# Supported part_numbers for 0x41, 0x56, dpaa:
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
-# '0xd0c':   neoverse-n1
-
-# Supported part_numbers for 0x43:
-# '0xa1':    thunderxt88
-# '0xa2':    thunderxt81
-# '0xa3':    thunderxt83
-# '0xaf':    thunderx2t99
-# '0xb2':    octeontx2
-
-# Supported part_numbers for 0x50:
-# '0x0':     emag
-
-# Supported extra configuration
-# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-# max_lcores = n      # will set RTE_MAX_LCORE
-max_lcores = 256
-max_numa_nodes = 4
-
-# numa = false        # set to false if the target is not a NUMA system
-# disabled_drivers = ['bus/dpaa', 'crypto']
-    # add to the set of disabled libraries
+# Supported SoCs:
+# generic
+# armada
+# bluefield
+# dpaa
+# emag
+# graviton2
+# n1sdp
+# octeontx2
+# stingray
+# thunderx2
+# thunderxt88
+# thunderx2t99
+
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 3458b9d7b..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,7 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 52274c0c5..cd270f84b 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -57,7 +57,7 @@ part_number_config_arm = {
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementers = {
 	'generic': {
@@ -164,6 +164,102 @@ implementers = {
 	}
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+socs = {
+	'generic': {
+		'implementer': 'generic',
+		'part_number': 'generic',
+		'flags': []
+	},
+	'armada': {
+		'implementer': '0x56',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false,
+		'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+	},
+	'bluefield': {
+		'implementer': '0x41',
+		'part_number': '0xd08',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'dpaa': {
+		'implementer': 'dpaa',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'emag': {
+		'implementer': '0x50',
+		'part_number': '0x0',
+		'flags': [
+			['RTE_MAX_LCORE', 32],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	},
+	'graviton2': {
+		'implementer': '0x41',
+		'part_number': '0xd0c',
+		'flags': [
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'n1sdp': {
+		'implementer': '0x41',
+		'part_number': '0xd0c',
+		'flags': [
+			['RTE_MAX_LCORE', 4],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'octeontx2': {
+		'implementer': '0x43',
+		'part_number': '0xb2',
+		'flags': [
+			['RTE_MAX_LCORE', 32],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'stingray': {
+		'implementer': '0x41',
+		'part_number': '0xd08',
+		'flags': [
+			['RTE_MAX_LCORE', 16],
+			['RTE_MAX_NUMA_NODES', 1]
+		],
+		'numa': false
+	},
+	'thunderx2': {
+		'implementer': '0x43',
+		'part_number': '0xaf',
+		'flags': [
+			['RTE_MAX_LCORE', 256],
+			['RTE_MAX_NUMA_NODES', 2]
+		]
+	},
+	'thunderxt88': {
+		'implementer': '0x43',
+		'part_number': '0xa1',
+		'flags': [
+			['RTE_MAX_LCORE', 96],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -176,11 +272,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -199,8 +302,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config['flags']
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -226,8 +348,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common_default + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common_default + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
diff --git a/meson_options.txt b/meson_options.txt
index e1059fb16..33b8b236c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular Arm SoC when building on an aarch64 machine.')
 option('armv8_crypto_dir', type: 'string', value: '',
 	description: 'path to the armv8_crypto library installation directory')
 option('disable_drivers', type: 'string', value: '',
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v8 00/14] Arm build options rework
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (13 preceding siblings ...)
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-06  8:23               ` Morten Brørup
  2020-11-06  8:39                 ` Juraj Linkeš
  2020-11-06  9:14                 ` Bruce Richardson
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
  15 siblings, 2 replies; 465+ messages in thread
From: Morten Brørup @ 2020-11-06  8:23 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aconole
  Cc: dev

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Juraj Linkeš
> Sent: Friday, November 6, 2020 9:03 AM
> 
> The current way of specifying Arm configuration options is insufficient
> since we can't identify the SoC we're building for from the MIDR
> information. For example, we can't distinguish between N1SDP, Graviton2
> or Ampere Altra.
> 
> Add a way to specify the cpu count and numa node count for cross
> builds.
> 
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed
> 2. a cross build on a fast aarch64 machine but with target SoC which
>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in cross files.
> 
> Among libraries, only libnuma can be now disabled.
> 
> Also add an optional way to discover cpu count a numa node count. Fix
> -Dmax_lcores and -Dmax_numa_nodes for arm builds.
> 
> The current implementation adds/supports the following:
> * x86 -> aarch64 cross build with added config options/disabled
>   drivers/libs
> * aarch64 -> aarch64 builds for a different SoCs must be done using
>   cross-files
> * max numa nodes and max lcore may be specified on the command line to
>   overwrite the values for any (native or cross) build
> 

We are cross building our application firmware x86 -> x86. Our firmware repository includes the cross compiler source code, target libc source code, and so on. This ensures that the entire firmware is exactly the same, independently of which host it was built on.

Back in the days, before we started using DPDK, we validated our cross building environment by building the complete firmware for our appliance (including bootloader, Linux kernel, libraries, applications, root file system, etc.) PPC -> x86. It worked.

The DPDK cross building system should work in any X -> Y environment, including X -> X cross building.

> v2:
> Major rework of the whole series.
> 
> v3:
> Added numa and core count defaults for x86 default build.
> Removed numa and core count defaults. Now requiring defaults to be
> specified in a cross file or on the cmdline.
> Added FreeBDS support for numa count discovery.
> 
> v4:
> Make automatic numa and cpu counts discovery optional.
> 
> v5:
> Split the refactor patch into smaller patches.
> Simplify buildtools/get_numa_count.py.
> Add more explanation to cover letter.
> 
> v6:
> Apply cross file options arch agnostically, not just in Arm cross
> builds.
> Streamline Arm build setup and machine args: always use native args in
> native builds, require implementer ID and part number for cross builds.
> 
> v7:
> Arm config options are now organized in one dictionary.
> Removed unsupported implementers and removed fallback to generic
> implementer/part number for unknown implementer/part number.
> Added meson config option arm_soc which can be used to specify
> configuration to be used, useful for aarch64 -> aarch64 builds.
> 
> v8:
> Rebase.
> 

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

* Re: [dpdk-dev] [PATCH v8 00/14] Arm build options rework
  2020-11-06  8:23               ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Morten Brørup
@ 2020-11-06  8:39                 ` Juraj Linkeš
  2020-11-06  8:56                   ` Morten Brørup
  2020-11-06  9:14                 ` Bruce Richardson
  1 sibling, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-06  8:39 UTC (permalink / raw)
  To: Morten Brørup, bruce.richardson, Ruifeng.Wang,
	Honnappa.Nagarahalli, Phil.Yang, vcchunga, Dharmik.Thakkar,
	jerinjacobk, hemant.agrawal, ajit.khaparde, ferruh.yigit,
	aconole
  Cc: dev



> -----Original Message-----
> From: Morten Brørup <mb@smartsharesystems.com>
> Sent: Friday, November 6, 2020 9:23 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v8 00/14] Arm build options rework
> 
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Juraj Linkeš
> > Sent: Friday, November 6, 2020 9:03 AM
> >
> > The current way of specifying Arm configuration options is
> > insufficient since we can't identify the SoC we're building for from
> > the MIDR information. For example, we can't distinguish between N1SDP,
> > Graviton2 or Ampere Altra.
> >
> > Add a way to specify the cpu count and numa node count for cross
> > builds.
> >
> > We also want to be able to disable which drivers (and possibly
> > libraries) are built without user input. This is useful when building:
> > 1. on an SoC that is slow and we want to build only what is necessary
> >   without the user having to check which libraries they have installed
> > 2. a cross build on a fast aarch64 machine but with target SoC which
> >   differs in capabilities or libraries.
> > This is achieved by specifying the drivers in cross files.
> >
> > Among libraries, only libnuma can be now disabled.
> >
> > Also add an optional way to discover cpu count a numa node count. Fix
> > -Dmax_lcores and -Dmax_numa_nodes for arm builds.
> >
> > The current implementation adds/supports the following:
> > * x86 -> aarch64 cross build with added config options/disabled
> >   drivers/libs
> > * aarch64 -> aarch64 builds for a different SoCs must be done using
> >   cross-files
> > * max numa nodes and max lcore may be specified on the command line to
> >   overwrite the values for any (native or cross) build
> >
> 
> We are cross building our application firmware x86 -> x86. Our firmware
> repository includes the cross compiler source code, target libc source code, and
> so on. This ensures that the entire firmware is exactly the same, independently
> of which host it was built on.
> 
> Back in the days, before we started using DPDK, we validated our cross building
> environment by building the complete firmware for our appliance (including
> bootloader, Linux kernel, libraries, applications, root file system, etc.) PPC ->
> x86. It worked.
> 
> The DPDK cross building system should work in any X -> Y environment, including
> X -> X cross building.
> 

The series only modifies aarch64 aspect of the build system. So anything else that worked before should be working as it was. The wording should've been more clearer - The series adds/supports those bullet points.

> > v2:
> > Major rework of the whole series.
> >
> > v3:
> > Added numa and core count defaults for x86 default build.
> > Removed numa and core count defaults. Now requiring defaults to be
> > specified in a cross file or on the cmdline.
> > Added FreeBDS support for numa count discovery.
> >
> > v4:
> > Make automatic numa and cpu counts discovery optional.
> >
> > v5:
> > Split the refactor patch into smaller patches.
> > Simplify buildtools/get_numa_count.py.
> > Add more explanation to cover letter.
> >
> > v6:
> > Apply cross file options arch agnostically, not just in Arm cross
> > builds.
> > Streamline Arm build setup and machine args: always use native args in
> > native builds, require implementer ID and part number for cross builds.
> >
> > v7:
> > Arm config options are now organized in one dictionary.
> > Removed unsupported implementers and removed fallback to generic
> > implementer/part number for unknown implementer/part number.
> > Added meson config option arm_soc which can be used to specify
> > configuration to be used, useful for aarch64 -> aarch64 builds.
> >
> > v8:
> > Rebase.
> >

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

* Re: [dpdk-dev] [PATCH v8 00/14] Arm build options rework
  2020-11-06  8:39                 ` Juraj Linkeš
@ 2020-11-06  8:56                   ` Morten Brørup
  2020-11-06  9:19                     ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Morten Brørup @ 2020-11-06  8:56 UTC (permalink / raw)
  To: bruce.richardson
  Cc: dev, Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aconole

> From: Juraj Linkeš [mailto:juraj.linkes@pantheon.tech]
> Sent: Friday, November 6, 2020 9:40 AM
> 
> > From: Morten Brørup <mb@smartsharesystems.com>
> > Sent: Friday, November 6, 2020 9:23 AM
> >
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Juraj Linkeš
> > > Sent: Friday, November 6, 2020 9:03 AM
> > >
> > > The current way of specifying Arm configuration options is
> > > insufficient since we can't identify the SoC we're building for
> from
> > > the MIDR information. For example, we can't distinguish between
> N1SDP,
> > > Graviton2 or Ampere Altra.
> > >
> > > Add a way to specify the cpu count and numa node count for cross
> > > builds.
> > >
> > > We also want to be able to disable which drivers (and possibly
> > > libraries) are built without user input. This is useful when
> building:
> > > 1. on an SoC that is slow and we want to build only what is
> necessary
> > >   without the user having to check which libraries they have
> installed
> > > 2. a cross build on a fast aarch64 machine but with target SoC
> which
> > >   differs in capabilities or libraries.
> > > This is achieved by specifying the drivers in cross files.
> > >
> > > Among libraries, only libnuma can be now disabled.
> > >
> > > Also add an optional way to discover cpu count a numa node count.
> Fix
> > > -Dmax_lcores and -Dmax_numa_nodes for arm builds.
> > >
> > > The current implementation adds/supports the following:
> > > * x86 -> aarch64 cross build with added config options/disabled
> > >   drivers/libs
> > > * aarch64 -> aarch64 builds for a different SoCs must be done using
> > >   cross-files
> > > * max numa nodes and max lcore may be specified on the command line
> to
> > >   overwrite the values for any (native or cross) build
> > >
> >
> > We are cross building our application firmware x86 -> x86. Our
> firmware
> > repository includes the cross compiler source code, target libc
> source code, and
> > so on. This ensures that the entire firmware is exactly the same,
> independently
> > of which host it was built on.
> >
> > Back in the days, before we started using DPDK, we validated our
> cross building
> > environment by building the complete firmware for our appliance
> (including
> > bootloader, Linux kernel, libraries, applications, root file system,
> etc.) PPC ->
> > x86. It worked.
> >
> > The DPDK cross building system should work in any X -> Y environment,
> including
> > X -> X cross building.
> >
> 
> The series only modifies aarch64 aspect of the build system. So
> anything else that worked before should be working as it was. The
> wording should've been more clearer - The series adds/supports those
> bullet points.
> 

Bruce,

Are all these nice details - such as being able to disable drivers and libraries - also available as configuration options for x86 -> x86 cross building?


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

* Re: [dpdk-dev] [PATCH v8 00/14] Arm build options rework
  2020-11-06  8:23               ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Morten Brørup
  2020-11-06  8:39                 ` Juraj Linkeš
@ 2020-11-06  9:14                 ` Bruce Richardson
  1 sibling, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-06  9:14 UTC (permalink / raw)
  To: Morten Brørup
  Cc: Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aconole, dev

On Fri, Nov 06, 2020 at 09:23:01AM +0100, Morten Brørup wrote:
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Juraj Linkeš Sent:
> > Friday, November 6, 2020 9:03 AM
> > 
> > The current way of specifying Arm configuration options is insufficient
> > since we can't identify the SoC we're building for from the MIDR
> > information. For example, we can't distinguish between N1SDP, Graviton2
> > or Ampere Altra.
> > 
> > Add a way to specify the cpu count and numa node count for cross
> > builds.
> > 
> > We also want to be able to disable which drivers (and possibly
> > libraries) are built without user input. This is useful when building:
> > 1. on an SoC that is slow and we want to build only what is necessary
> > without the user having to check which libraries they have installed 2.
> > a cross build on a fast aarch64 machine but with target SoC which
> > differs in capabilities or libraries.  This is achieved by specifying
> > the drivers in cross files.
> > 
> > Among libraries, only libnuma can be now disabled.
> > 
> > Also add an optional way to discover cpu count a numa node count. Fix
> > -Dmax_lcores and -Dmax_numa_nodes for arm builds.
> > 
> > The current implementation adds/supports the following: * x86 ->
> > aarch64 cross build with added config options/disabled drivers/libs *
> > aarch64 -> aarch64 builds for a different SoCs must be done using
> > cross-files * max numa nodes and max lcore may be specified on the
> > command line to overwrite the values for any (native or cross) build
> > 
> 
> We are cross building our application firmware x86 -> x86. Our firmware
> repository includes the cross compiler source code, target libc source
> code, and so on. This ensures that the entire firmware is exactly the
> same, independently of which host it was built on.
> 
> Back in the days, before we started using DPDK, we validated our cross
> building environment by building the complete firmware for our appliance
> (including bootloader, Linux kernel, libraries, applications, root file
> system, etc.) PPC -> x86. It worked.
> 
> The DPDK cross building system should work in any X -> Y environment,
> including X -> X cross building.
> 
It should indeed work for x86 -> x86, but I'm not sure anyone has ever
tested it yet. There are no cross-files for x86 included in the DPDK config
folder, but it should work fine if you create one for your own setup.

Some references, since this should all be handled by meson itself
transparently:
https://mesonbuild.com/Cross-compilation.html
https://mesonbuild.com/Machine-files.html

Only problem that I think would arise for x86-x86 would be if we had made
some assumptions on the "config/x86/meson.build" file about it being a native
build, but hopefully there are few or none of those. If you do get to try
out this cross-compile, please let us know how it goes for you.

Thanks,
/Bruce

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

* Re: [dpdk-dev] [PATCH v8 00/14] Arm build options rework
  2020-11-06  8:56                   ` Morten Brørup
@ 2020-11-06  9:19                     ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-06  9:19 UTC (permalink / raw)
  To: Morten Brørup
  Cc: dev, Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aconole

On Fri, Nov 06, 2020 at 09:56:42AM +0100, Morten Brørup wrote:
> > From: Juraj Linkeš [mailto:juraj.linkes@pantheon.tech]
> > Sent: Friday, November 6, 2020 9:40 AM
> > 
> > > From: Morten Brørup <mb@smartsharesystems.com>
> > > Sent: Friday, November 6, 2020 9:23 AM
> > >
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Juraj Linkeš
> > > > Sent: Friday, November 6, 2020 9:03 AM
> > > >
> > > > The current way of specifying Arm configuration options is
> > > > insufficient since we can't identify the SoC we're building for
> > from
> > > > the MIDR information. For example, we can't distinguish between
> > N1SDP,
> > > > Graviton2 or Ampere Altra.
> > > >
> > > > Add a way to specify the cpu count and numa node count for cross
> > > > builds.
> > > >
> > > > We also want to be able to disable which drivers (and possibly
> > > > libraries) are built without user input. This is useful when
> > building:
> > > > 1. on an SoC that is slow and we want to build only what is
> > necessary
> > > >   without the user having to check which libraries they have
> > installed
> > > > 2. a cross build on a fast aarch64 machine but with target SoC
> > which
> > > >   differs in capabilities or libraries.
> > > > This is achieved by specifying the drivers in cross files.
> > > >
> > > > Among libraries, only libnuma can be now disabled.
> > > >
> > > > Also add an optional way to discover cpu count a numa node count.
> > Fix
> > > > -Dmax_lcores and -Dmax_numa_nodes for arm builds.
> > > >
> > > > The current implementation adds/supports the following:
> > > > * x86 -> aarch64 cross build with added config options/disabled
> > > >   drivers/libs
> > > > * aarch64 -> aarch64 builds for a different SoCs must be done using
> > > >   cross-files
> > > > * max numa nodes and max lcore may be specified on the command line
> > to
> > > >   overwrite the values for any (native or cross) build
> > > >
> > >
> > > We are cross building our application firmware x86 -> x86. Our
> > firmware
> > > repository includes the cross compiler source code, target libc
> > source code, and
> > > so on. This ensures that the entire firmware is exactly the same,
> > independently
> > > of which host it was built on.
> > >
> > > Back in the days, before we started using DPDK, we validated our
> > cross building
> > > environment by building the complete firmware for our appliance
> > (including
> > > bootloader, Linux kernel, libraries, applications, root file system,
> > etc.) PPC ->
> > > x86. It worked.
> > >
> > > The DPDK cross building system should work in any X -> Y environment,
> > including
> > > X -> X cross building.
> > >
> > 
> > The series only modifies aarch64 aspect of the build system. So
> > anything else that worked before should be working as it was. The
> > wording should've been more clearer - The series adds/supports those
> > bullet points.
> > 
> 
> Bruce,
> 
> Are all these nice details - such as being able to disable drivers and libraries - also available as configuration options for x86 -> x86 cross building?

Yes and no. Disabling libraries is not currently supported for anything,
but there were proposals made to add a build option to support it.  In
terms of disabling driver that is supported via the existing build option,
and the support added in this set will also work for specifying drivers to
disable on x86 too.

/Bruce

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

* Re: [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection
  2020-11-03  9:44                   ` Bruce Richardson
  2020-11-05  9:23                     ` Juraj Linkeš
@ 2020-11-06 23:40                     ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-06 23:40 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > > >
> > > Part of the confusion arises from the fact that originally that was
> > > the only parameter set by this - and on x86 it still is. Perhaps
> > > this parameter needs to
> > Just wondering, for x86, what does it mean if we set the max_num_cores
> and max_numa_nodes based on dynamic detection for 'native' build?
> > ISA still remains the same as before. But, the build might not work on
> machines with higher number of cores and numa nodes.
> > At the same time, the build also might not work on a machine with a
> different ISA. The users need to be aware that the target machine has the
> same ISA and same number of cores/numa nodes as the target machine.
> >
> Yes, that is a fair summary.
> 
> > > be renamed to "isa-level" or "architecture-flag" or similar to
> > > reflect its meaning. This would then allow a new "machine" setting,
> > > which can be considered separately. The question then is how much
> > > that helps with the main issue under discussion, that of cores and numa
> node values.
> > If we rename it, we will have backward compatibility issue (i.e. 'native' build
> on x86 will have different meaning and whoever wants the original meaning,
> have to change to using this new name). Not sure about the complexity in
> meson scripts.
> >
> 
> Yep, it was just a thought to see if it could help in this situation.
> 
> >
> > >
> > > > But, I think other DPDK specific parameters should also be considered.
> > > > For ex: RTE_MAX_LCORE should have a particular value for 'generic'
> > > > build in
> > > all the supported architectures. The value could be different for
> > > each architecture, but it is fixed for the 'generic' build for a given
> architecture.
> > > Otherwise, the 'generic' build might not run on all the machines of
> > > that architecture.
> > > >
> > > > Similarly, for 'native' build, is there any reason not to include
> > > > other DPDK
> > > parameters as part of the definition? IMO, 'native' should refer to
> > > the entire build machine, not just the ISA. i.e. build on the target machine.
> > > >
> > >
> > > While I understand the idea here, it is somewhat complicated by the
> > > fact that the meson options given in "meson_options.txt" cannot be
> > > set by meson code, which means that when we change the machine flag
> > > to "native" we can only use or ignore the user-provided lcores and
> > > numa nodes setting - we have no way to change them and reflect those
> > > changes back to the user. :-( This leads to the situation in the
> > > discussion in this thread, where we start needing all sorts of magic
> > > values to indicate use of machine-type defaults or detected defaults.
> > I am wondering why we need to take the max_num_cores and
> max_numa_nodes from the user? This option was not provided in the make
> build system. I ask this question because for 'generic' this has to be a
> static/known configuration. For cross builds, this info can come (or derived)
> from the cross build file.
> > Was it supposed to be used in conjunction with 'native' build?
> >
> 
> Well, it was configurable in the build config files same as all other DPDK build
> settings with make. When working first on meson, I felt it was a setting the
> user might be likely to want to tune, which is why I put it into the
> meson_options.txt and nobody suggested otherwise on review [which is the
> reason why many of the current options are the way they are :-)].
> 
> From my side, I have a couple of unknowns:
> 1. How big a difference in terms of memory use etc. of DPDK does it make by
>    having really big values for these core/numa counts? If there is not much
>    difference, then there is indeed little value in having them configurable
>    at all, and we should just use big defaults and be done with it.
> 2. If there is a noticable difference in these settings, how many users are
>    going to want to actually go to the trouble of tweaking these?
> 3. How big an effort is it to switch to having these settings made entirely
>    dynamic at runtime? Doing so would naturally make the need for these
>    settings completely go away.
A lot of the usage seems to be in the test code. Are these constants exposed to the users?

> 
> With all that said, I'd be ok with a number of solutions. I'm ok to have these
> dropped as meson options and just have them specified in other ways, e.g.
> cross-file, or from meson.build files. [For x86, I'd tend towards having them
> defined in rte_config.h inside x86-specific ifdefs].
> Alternatively, I'm also happy enough with the proposed scheme here of
> allowing user override, with platform defaults using "0"-value and detection
> using "-1".
Ok, we will stick to the methods in this patch.

> 
> Regards,
> /Bruce

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

* Re: [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic Juraj Linkeš
@ 2020-11-06 23:52                 ` Honnappa Nagarahalli
  2020-11-09 12:12                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-06 23:52 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> The current machine='default' build name is not descriptive. The actual
> default build is machine='native'. Add an alternative string which does the
> same build and better describes what we're building:
> machine='generic'. Leave machine='default' for backwards compatibility.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build                    | 5 +++--
>  config/meson.build                        | 9 +++++----
>  doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
>  meson_options.txt                         | 2 +-
>  4 files changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 42b4e43c7..d4066ade8 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -1,12 +1,13 @@
>  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2017 Intel
> Corporation.
>  # Copyright(c) 2017 Cavium, Inc
> +# Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
>  # for checking defines we need to use the correct compiler flags  march_opt =
> '-march=@0@'.format(machine)
> 
>  arm_force_native_march = false
> -arm_force_default_march = (machine == 'default')
> +arm_force_generic_march = (machine == 'generic')
> 
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -148,7 +149,7 @@ else
>  	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()
> +	if arm_force_generic_march and not meson.is_cross_build()
>  		machine = impl_generic
>  		impl_pn = 'default'
>  	elif not meson.is_cross_build()
> diff --git a/config/meson.build b/config/meson.build index
> 258b01d06..c7f7aa6e2 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -68,13 +68,14 @@ else
>  	machine = get_option('machine')
>  endif
> 
> -# machine type 'default' is special, it defaults to the per arch agreed common
> -# minimal baseline needed for DPDK.
> +# machine type 'generic' is special, it defaults to the per arch agreed
> +common # minimal baseline needed for DPDK. Machine type 'default' is
> +also supported # with the same meaning for backwards compatibility.
>  # That might not be the most optimized, but the most portable version while
> # still being able to support the CPU features required for DPDK.
>  # This can be bumped up by the DPDK project, but it can never be an  #
> invariant like 'native'
> -if machine == 'default'
> +if machine == 'default' or machine == 'generic'
>  	if host_machine.cpu_family().startswith('x86')
>  		# matches the old pre-meson build systems default
>  		machine = 'corei7'
> @@ -82,7 +83,7 @@ if machine == 'default'
>  		machine = 'armv7-a'
>  	elif host_machine.cpu_family().startswith('aarch')
>  		# arm64 manages defaults in config/arm/meson.build
> -		machine = 'default'
> +		machine = 'generic'
>  	elif host_machine.cpu_family().startswith('ppc')
>  		machine = 'power8'
>  	endif
> diff --git a/doc/guides/prog_guide/build-sdk-meson.rst
> b/doc/guides/prog_guide/build-sdk-meson.rst
> index 3429e2647..c7e12eedf 100644
> --- a/doc/guides/prog_guide/build-sdk-meson.rst
> +++ b/doc/guides/prog_guide/build-sdk-meson.rst
> @@ -85,7 +85,7 @@ Project-specific options are passed used -
> Doption=value::
> 
>  	meson -Denable_docs=true fullbuild  # build and install docs
> 
> -	meson -Dmachine=default  # use builder-independent baseline -
> march
> +	meson -Dmachine=generic  # use builder-independent baseline -
> march
> 
>  	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
>  					# eventdev PMDs for a smaller build
> @@ -114,7 +114,7 @@ Examples of setting some of the same options using
> meson configure::
>          re-scan from meson.
> 
>  .. note::
> -        machine=default uses a config that works on all supported architectures
> +        machine=generic uses a config that works on all supported
> + architectures
>          regardless of the capabilities of the machine where the build is
> happening.
> 
>  As well as those settings taken from ``meson configure``, other options diff --
> git a/meson_options.txt b/meson_options.txt index 9bf18ab6b..ce23289e3
> 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
> option('lib_musdk_dir', type: 'string', value: '',
>  	description: 'path to the MUSDK library installation directory')
> option('machine', type: 'string', value: 'native',
> -	description: 'set the target machine type')
> +	description: 'set the target machine type. Set to generic for a build
> +usable on most machines of the build machine architecture, set to
                        ^^^^ all
> +native to let the compiler choose the best fit for the build machine.')
How about: native to let the compiler choose the attributes of the build machine

Otherwise, it looks good to me.
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

>  option('max_ethports', type: 'integer', value: 32,
>  	description: 'maximum number of Ethernet devices')
> option('max_lcores', type: 'integer', value: 128,
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 02/14] build: rename Arm build variables
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 02/14] build: rename Arm build variables Juraj Linkeš
@ 2020-11-07  0:47                 ` Honnappa Nagarahalli
  2020-11-07  0:51                   ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-07  0:47 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Rename Arm build variables and values so that they better conform to Arm
> specifications. Also rename generically sounding variable to names that better
> capture what the variables hold.
> 
> Rename machine_args_generic to part_number_config_arm since the variable
> contains more than just the generic machine args and is used mainly as the
> fallback arm configuration.
> Rename the default machine args to generic machine args to reflect that.
> The rest of the variables are self-explanatory.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>  config/arm/arm64_armada_linux_gcc    |   2 +-
>  config/arm/arm64_armv8_linux_gcc     |   8 +-
>  config/arm/arm64_bluefield_linux_gcc |   4 +-
>  config/arm/arm64_dpaa_linux_gcc      |   2 +-
>  config/arm/arm64_emag_linux_gcc      |   2 +-
>  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
>  config/arm/arm64_octeontx2_linux_gcc |   4 +-
>  config/arm/arm64_stingray_linux_gcc  |   4 +-
>  config/arm/arm64_thunderx2_linux_gcc |   4 +-
>  config/arm/arm64_thunderx_linux_gcc  |   2 +-
>  config/arm/meson.build               | 110 +++++++++++++--------------
>  11 files changed, 73 insertions(+), 73 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index fa40c0398..52c5f4476 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -14,4 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x56'
> +implementer_id = '0x56'
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 88f0ff9da..13ee8b223 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -13,10 +13,10 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = 'generic'
> +implementer_id = 'generic'
> 
> -# Valid options for Arm's implementor_pn:
> -# 'default': valid for all armv8-a architectures (default value)
> +# Valid options for Arm's part_number:
> +# 'generic': valid for all armv8-a architectures (default value)
>  # '0xd03':   cortex-a53
>  # '0xd04':   cortex-a35
>  # '0xd05':   cortex-a55
> @@ -25,4 +25,4 @@ implementor_id = 'generic'
>  # '0xd09':   cortex-a73
>  # '0xd0a':   cortex-a75
>  # '0xd0b':   cortex-a76
> -implementor_pn = 'default'
> +part_number = 'generic'

<snip>

> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> d4066ade8..7fe0f3f3c 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -29,58 +29,58 @@ flags_common_default = [
                                                                            ^^^^^^ this causes confusion. I think can be just 'flags_common'.

>  	['RTE_ARM_USE_WFE', false],
>  ]
> 
> -flags_generic = [
> +flags_implementer_generic = [
>  	['RTE_MACHINE', '"armv8a"'],
>  	['RTE_MAX_LCORE', 256],
>  	['RTE_USE_C11_MEM_MODEL', true],
>  	['RTE_CACHE_LINE_SIZE', 128]]

<snip>

> 
> -flags_default_extra = []
> -flags_thunderx_extra = [
> +flags_part_number_default = []
Should this be "flags_part_number_generic"?

> +flags_part_number_thunderx = [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]]

<snip>

> 
>  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
> -impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
> -impl_0x41 = ['Arm', flags_arm, machine_args_generic]
> -impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
> -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> -impl_0x44 = ['DEC', flags_generic, machine_args_generic]
> -impl_0x49 = ['Infineon', flags_generic, machine_args_generic] -impl_0x4d =
> ['Motorola', flags_generic, machine_args_generic] -impl_0x4e = ['NVIDIA',
> flags_generic, machine_args_generic]
> -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> -impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
> -impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
> -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
> -impl_0x69 = ['Intel', flags_generic, machine_args_generic] -impl_dpaa = ['NXP
> DPAA', flags_dpaa, machine_args_generic]
> +implementer_generic = ['Generic armv8', flags_implementer_generic,
> +part_number_config_arm]
> +implementer_0x41 = ['Arm', flags_implementer_arm,
> +part_number_config_arm]
> +implementer_0x42 = ['Broadcom', flags_implementer_generic,
> +part_number_config_arm]
> +implementer_0x43 = ['Cavium', flags_implementer_cavium,
> +part_number_config_cavium]
> +implementer_0x44 = ['DEC', flags_implementer_generic,
> +part_number_config_arm]
> +implementer_0x49 = ['Infineon', flags_implementer_generic,
> +part_number_config_arm] implementer_0x4d = ['Motorola',
> +flags_implementer_generic, part_number_config_arm] implementer_0x4e =
> +['NVIDIA', flags_implementer_generic, part_number_config_arm]
> +implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> +part_number_config_emag]
> +implementer_0x51 = ['Qualcomm', flags_implementer_generic,
> +part_number_config_arm]
> +implementer_0x53 = ['Samsung', flags_implementer_generic,
> +part_number_config_arm]
> +implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> +part_number_config_arm]
> +implementer_0x69 = ['Intel', flags_implementer_generic,
> +part_number_config_arm] implementer_dpaa = ['NXP DPAA',
> +flags_implementer_dpaa, part_number_config_arm]
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -145,13 +145,13 @@ else
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
>  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> 
> -	machine = []
> -	cmd_generic = ['generic', '', '', 'default', '']
> +	implementer_config = []
> +	cmd_generic = ['generic', '', '', 'generic', '']
>  	cmd_output = cmd_generic # Set generic by default
>  	machine_args = [] # Clear previous machine args
>  	if arm_force_generic_march and not meson.is_cross_build()
> -		machine = impl_generic
> -		impl_pn = 'default'
> +		implementer_config = implementer_generic
> +		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# The script returns ['Implementer', 'Variant', 'Architecture',
>  		# 'Primary Part number', 'Revision']
> @@ -162,19 +162,19 @@ else
>  			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
> +		implementer_config = get_variable('implementer_' +
> cmd_output[0], ['generic'])
> +		if implementer_config[0] == 'generic'
> +			implementer_config = implementer_generic
>  			cmd_output = cmd_generic
>  		endif
> -		impl_pn = cmd_output[3]
> +		part_number = cmd_output[3]
>  		if arm_force_native_march == true
> -			impl_pn = 'native'
> +			part_number = '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)
> +		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
> +		part_number = meson.get_cross_property('part_number',
> 'generic')
> +		implementer_config = get_variable('implementer_' +
> implementer_id)
>  	endif
> 
>  	# Apply Common Defaults. These settings may be overwritten by
> machine @@ -185,22 +185,22 @@ else
>  		endif
>  	endforeach
> 
> -	message('Implementer : ' + machine[0])
> -	foreach flag: machine[1]
> +	message('Implementer : ' + implementer_config[0])
> +	foreach flag: implementer_config[1]
>  		if flag.length() > 0
>  			dpdk_conf.set(flag[0], flag[1])
>  		endif
>  	endforeach
> 
> -	foreach marg: machine[2]
> -		if marg[0] == impl_pn
> +	foreach marg: implementer_config[2]
> +		if marg[0] == part_number
>  			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)
> +			foreach flag: marg.get(2, flags_part_number_default)
                                                                                                                             ^^^^^^ generic?
What does 'flags_part_number_default' (or 'flags_default_extra' earlier) mean? Why does it need to be applied to each part number? (this question does not belong to the changes in this patch)

>  				if flag.length() > 0
>  					dpdk_conf.set(flag[0], flag[1])
>  				endif
> --
> 2.20.1
Otherwise, it looks good.
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

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

* Re: [dpdk-dev] [PATCH v8 02/14] build: rename Arm build variables
  2020-11-07  0:47                 ` Honnappa Nagarahalli
@ 2020-11-07  0:51                   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-07  0:51 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > Rename Arm build variables and values so that they better conform to
> > Arm specifications. Also rename generically sounding variable to names
> > that better capture what the variables hold.
> >
> > Rename machine_args_generic to part_number_config_arm since the
> > variable contains more than just the generic machine args and is used
> > mainly as the fallback arm configuration.
> > Rename the default machine args to generic machine args to reflect that.
> > The rest of the variables are self-explanatory.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > ---
> >  config/arm/arm64_armada_linux_gcc    |   2 +-
> >  config/arm/arm64_armv8_linux_gcc     |   8 +-
> >  config/arm/arm64_bluefield_linux_gcc |   4 +-
> >  config/arm/arm64_dpaa_linux_gcc      |   2 +-
> >  config/arm/arm64_emag_linux_gcc      |   2 +-
> >  config/arm/arm64_n1sdp_linux_gcc     |   4 +-
> >  config/arm/arm64_octeontx2_linux_gcc |   4 +-
> >  config/arm/arm64_stingray_linux_gcc  |   4 +-
> >  config/arm/arm64_thunderx2_linux_gcc |   4 +-
> >  config/arm/arm64_thunderx_linux_gcc  |   2 +-
> >  config/arm/meson.build               | 110 +++++++++++++--------------
> >  11 files changed, 73 insertions(+), 73 deletions(-)
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/arm64_armada_linux_gcc
> > index fa40c0398..52c5f4476 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -14,4 +14,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x56'
> > +implementer_id = '0x56'
> > diff --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > index 88f0ff9da..13ee8b223 100644
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ b/config/arm/arm64_armv8_linux_gcc
> > @@ -13,10 +13,10 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = 'generic'
> > +implementer_id = 'generic'
> >
> > -# Valid options for Arm's implementor_pn:
> > -# 'default': valid for all armv8-a architectures (default value)
> > +# Valid options for Arm's part_number:
> > +# 'generic': valid for all armv8-a architectures (default value)
> >  # '0xd03':   cortex-a53
> >  # '0xd04':   cortex-a35
> >  # '0xd05':   cortex-a55
> > @@ -25,4 +25,4 @@ implementor_id = 'generic'
> >  # '0xd09':   cortex-a73
> >  # '0xd0a':   cortex-a75
> >  # '0xd0b':   cortex-a76
> > -implementor_pn = 'default'
> > +part_number = 'generic'
> 
> <snip>
> 
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > d4066ade8..7fe0f3f3c 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -29,58 +29,58 @@ flags_common_default = [
>                                                                             ^^^^^^ this causes confusion. I
> think can be just 'flags_common'.
> 
> >  	['RTE_ARM_USE_WFE', false],
> >  ]
> >
> > -flags_generic = [
> > +flags_implementer_generic = [
> >  	['RTE_MACHINE', '"armv8a"'],
> >  	['RTE_MAX_LCORE', 256],
> >  	['RTE_USE_C11_MEM_MODEL', true],
> >  	['RTE_CACHE_LINE_SIZE', 128]]
> 
> <snip>
> 
> >
> > -flags_default_extra = []
> > -flags_thunderx_extra = [
> > +flags_part_number_default = []
> Should this be "flags_part_number_generic"?
> 
> > +flags_part_number_thunderx = [
> >  	['RTE_MACHINE', '"thunderx"'],
> >  	['RTE_USE_C11_MEM_MODEL', false]]
> 
> <snip>
> 
> >
> >  ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > G7-5321) -impl_generic = ['Generic armv8', flags_generic,
> > machine_args_generic]
> > -impl_0x41 = ['Arm', flags_arm, machine_args_generic]
> > -impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
> > -impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
> > -impl_0x44 = ['DEC', flags_generic, machine_args_generic]
> > -impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
> > -impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
> > -impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
> > -impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
> > -impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
> > -impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
> > -impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
> > -impl_0x69 = ['Intel', flags_generic, machine_args_generic] -impl_dpaa
> > = ['NXP DPAA', flags_dpaa, machine_args_generic]
> > +implementer_generic = ['Generic armv8', flags_implementer_generic,
> > +part_number_config_arm]
> > +implementer_0x41 = ['Arm', flags_implementer_arm,
> > +part_number_config_arm]
> > +implementer_0x42 = ['Broadcom', flags_implementer_generic,
> > +part_number_config_arm]
> > +implementer_0x43 = ['Cavium', flags_implementer_cavium,
> > +part_number_config_cavium]
> > +implementer_0x44 = ['DEC', flags_implementer_generic,
> > +part_number_config_arm]
> > +implementer_0x49 = ['Infineon', flags_implementer_generic,
> > +part_number_config_arm] implementer_0x4d = ['Motorola',
> > +flags_implementer_generic, part_number_config_arm] implementer_0x4e
> =
> > +['NVIDIA', flags_implementer_generic, part_number_config_arm]
> > +implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> > +part_number_config_emag]
> > +implementer_0x51 = ['Qualcomm', flags_implementer_generic,
> > +part_number_config_arm]
> > +implementer_0x53 = ['Samsung', flags_implementer_generic,
> > +part_number_config_arm]
> > +implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> > +part_number_config_arm]
> > +implementer_0x69 = ['Intel', flags_implementer_generic,
> > +part_number_config_arm] implementer_dpaa = ['NXP DPAA',
> > +flags_implementer_dpaa, part_number_config_arm]
> >
> >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -145,13 +145,13 @@ else
> >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
> >  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> >
> > -	machine = []
> > -	cmd_generic = ['generic', '', '', 'default', '']
> > +	implementer_config = []
> > +	cmd_generic = ['generic', '', '', 'generic', '']
> >  	cmd_output = cmd_generic # Set generic by default
> >  	machine_args = [] # Clear previous machine args
> >  	if arm_force_generic_march and not meson.is_cross_build()
> > -		machine = impl_generic
> > -		impl_pn = 'default'
> > +		implementer_config = implementer_generic
> > +		part_number = 'generic'
> >  	elif not meson.is_cross_build()
> >  		# The script returns ['Implementer', 'Variant', 'Architecture',
> >  		# 'Primary Part number', 'Revision'] @@ -162,19 +162,19 @@
> else
> >  			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
> > +		implementer_config = get_variable('implementer_' +
> > cmd_output[0], ['generic'])
> > +		if implementer_config[0] == 'generic'
> > +			implementer_config = implementer_generic
> >  			cmd_output = cmd_generic
> >  		endif
> > -		impl_pn = cmd_output[3]
> > +		part_number = cmd_output[3]
> >  		if arm_force_native_march == true
> > -			impl_pn = 'native'
> > +			part_number = '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)
> > +		implementer_id =
> > meson.get_cross_property('implementer_id', 'generic')
> > +		part_number = meson.get_cross_property('part_number',
> > 'generic')
> > +		implementer_config = get_variable('implementer_' +
> > implementer_id)
> >  	endif
> >
> >  	# Apply Common Defaults. These settings may be overwritten by
> > machine @@ -185,22 +185,22 @@ else
> >  		endif
> >  	endforeach
> >
> > -	message('Implementer : ' + machine[0])
> > -	foreach flag: machine[1]
> > +	message('Implementer : ' + implementer_config[0])
> > +	foreach flag: implementer_config[1]
> >  		if flag.length() > 0
> >  			dpdk_conf.set(flag[0], flag[1])
> >  		endif
> >  	endforeach
> >
> > -	foreach marg: machine[2]
> > -		if marg[0] == impl_pn
> > +	foreach marg: implementer_config[2]
> > +		if marg[0] == part_number
> >  			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)
> > +			foreach flag: marg.get(2, flags_part_number_default)
>                                                                                                                              ^^^^^^
> generic?
> What does 'flags_part_number_default' (or 'flags_default_extra' earlier)
> mean? Why does it need to be applied to each part number? (this question
> does not belong to the changes in this patch)
Please ignore the question, I see it is fixed in 3/14

> 
> >  				if flag.length() > 0
> >  					dpdk_conf.set(flag[0], flag[1])
> >  				endif
> > --
> > 2.20.1
> Otherwise, it looks good.
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

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

* Re: [dpdk-dev] [PATCH v8 03/14] build: remove unused or superfluous variables
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 03/14] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-07  0:52                 ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-07  0:52 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Remove variables that were either not used, referenced just once or not
> needed.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/meson.build | 28 +++++++---------------------
>  1 file changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 7fe0f3f3c..7c7059cc2 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -3,11 +3,7 @@
>  # Copyright(c) 2017 Cavium, Inc
>  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
> -# for checking defines we need to use the correct compiler flags -march_opt =
> '-march=@0@'.format(machine)
> -
>  arm_force_native_march = false
> -arm_force_generic_march = (machine == 'generic')
> 
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -62,7 +58,6 @@ flags_implementer_armada = [
>  	['RTE_MAX_NUMA_NODES', 1],
>  	['RTE_MAX_LCORE', 16]]
> 
> -flags_part_number_default = []
>  flags_part_number_thunderx = [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]]
> @@ -119,17 +114,9 @@ part_number_config_emag = [  ## Arm implementer
> ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)  implementer_generic
> = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
>  implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
> -implementer_0x42 = ['Broadcom', flags_implementer_generic,
> part_number_config_arm]
>  implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium]
> -implementer_0x44 = ['DEC', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x49 = ['Infineon', flags_implementer_generic,
> part_number_config_arm] -implementer_0x4d = ['Motorola',
> flags_implementer_generic, part_number_config_arm] -implementer_0x4e =
> ['NVIDIA', flags_implementer_generic, part_number_config_arm]
>  implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> part_number_config_emag]
> -implementer_0x51 = ['Qualcomm', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x53 = ['Samsung', flags_implementer_generic,
> part_number_config_arm]
>  implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> part_number_config_arm]
> -implementer_0x69 = ['Intel', flags_implementer_generic,
> part_number_config_arm]  implementer_dpaa = ['NXP DPAA',
> flags_implementer_dpaa, part_number_config_arm]
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
> @@ -145,11 +132,9 @@ else
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
>  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> 
> -	implementer_config = []
> -	cmd_generic = ['generic', '', '', 'generic', '']
> -	cmd_output = cmd_generic # Set generic by default
> +	implementer_id = 'generic'
>  	machine_args = [] # Clear previous machine args
> -	if arm_force_generic_march and not meson.is_cross_build()
> +	if machine == 'generic' and not meson.is_cross_build()
>  		implementer_config = implementer_generic
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
> @@ -160,14 +145,15 @@ else
>  		cmd = run_command(detect_vendor.path())
>  		if cmd.returncode() == 0
>  			cmd_output = cmd.stdout().to_lower().strip().split(' ')
> +			implementer_id = cmd_output[0]
> +			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> cmd_output[0], ['generic'])
> +		implementer_config = get_variable('implementer_' +
> implementer_id,
> +['generic'])
>  		if implementer_config[0] == 'generic'
>  			implementer_config = implementer_generic
> -			cmd_output = cmd_generic
> +			part_number = 'generic'
>  		endif
> -		part_number = cmd_output[3]
>  		if arm_force_native_march == true
>  			part_number = 'native'
>  		endif
> @@ -200,7 +186,7 @@ else
>  				endif
>  			endforeach
>  			# Apply any extra machine specific flags.
> -			foreach flag: marg.get(2, flags_part_number_default)
> +			foreach flag: marg.get(2, [])
>  				if flag.length() > 0
>  					dpdk_conf.set(flag[0], flag[1])
>  				endif
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-08  2:51                 ` Honnappa Nagarahalli
  2020-11-09 12:48                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-08  2:51 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Change formatting so that it's more consistent and readable, add/modify
> comments/stdout messages, move configuration options to more appropriate
> places and make the order consistent according to these rules:
> 1. First list generic configuration options, then list options that may
>    be overwritten. List SoC-specific options last.
> 2. For SoC-specific options, list number of cores before the number of
>    NUMA nodes, to make it consistent with config/meson.build.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Few nits, otherwise, looks good.
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/arm64_armv8_linux_gcc | 21 ++++++-
>  config/arm/meson.build           | 94 +++++++++++++++++++-------------
>  2 files changed, 77 insertions(+), 38 deletions(-)
> 
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 13ee8b223..04cd82ba9 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -13,9 +13,16 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> +# Supported implementers:
> +# 'generic': Generic armv8
> +# '0x41':    Arm
> +# '0x43':    Cavium
> +# '0x50':    Ampere Computing
> +# '0x56':    Marvell ARMADA
> +# 'dpaa':    NXP DPAA
I do think the comments add much value here and they are not relevant too (as this is a cross build file for a generic build). They are captured in config/arm/meson.build already.

Instead, would be good to add something like "Generate binaries that are portable across all Armv8 machines"

>  implementer_id = 'generic'
> 
> -# Valid options for Arm's part_number:
> +# Supported part_numbers for generic, 0x41, 0x56, dpaa:
>  # 'generic': valid for all armv8-a architectures (default value)
>  # '0xd03':   cortex-a53
>  # '0xd04':   cortex-a35
> @@ -25,4 +32,16 @@ implementer_id = 'generic'
>  # '0xd09':   cortex-a73
>  # '0xd0a':   cortex-a75
>  # '0xd0b':   cortex-a76
> +# '0xd0c':   neoverse-n1
>  part_number = 'generic'
> +
> +# Supported part_numbers for 0x43:
> +# 'generic': valid for all Cavium builds
> +# '0xa1':    thunderxt88
> +# '0xa2':    thunderxt81
> +# '0xa3':    thunderxt83
> +# '0xaf':    thunderx2t99
> +# '0xb2':    octeontx2
Same here. It would be good to remove the existing comments as well.

> +
> +# Supported part_numbers for 0x50:
> +# 'generic': valid for all Ampere builds
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 7c7059cc2..5b922ef9c 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -5,6 +5,7 @@
> 
>  arm_force_native_march = false
> 
> +# common flags to all aarch64 builds, with lowest priority
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest)
>  	# to determine the best threshold in code. Refer to notes in source file
> @@ -12,8 +13,8 @@ flags_common_default = [
>  	['RTE_ARCH_ARM64_MEMCPY', false],
>  	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
>  	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
> -	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> unless there're
> -	# strong reasons.
> +	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> +	# unless there are strong reasons.
>  	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> @@ -23,69 +24,86 @@ flags_common_default = [
> 
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
> +	['RTE_ARCH_ARM64', true],
> +	['RTE_CACHE_LINE_SIZE', 128]
>  ]
> 
> +# implementer specific aarch64 flags, with middle priority # (will
Nit                                          ^^^^^^^ can be removed

> +overwrite common flags)
>  flags_implementer_generic = [
>  	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_MAX_LCORE', 256],
>  	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 128]]
> +	['RTE_CACHE_LINE_SIZE', 128],
> +	['RTE_MAX_LCORE', 256]
> +]

<snip>

>  flags_implementer_armada = [
>  	['RTE_MACHINE', '"armv8a"'],
>  	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_NUMA_NODES', 1],
> -	['RTE_MAX_LCORE', 16]]
> +	['RTE_MAX_LCORE', 16],
> +	['RTE_MAX_NUMA_NODES', 1]
> +]
> 
> +# part number specific aarch64 flags, with highest priority # (will
Nit                                         ^^^^^^^ can be removed

> +overwrite both common and implementer specific flags)
>  flags_part_number_thunderx = [
>  	['RTE_MACHINE', '"thunderx"'],
> -	['RTE_USE_C11_MEM_MODEL', false]]
> +	['RTE_USE_C11_MEM_MODEL', false]
> +]

<snip>

>  flags_part_number_n1generic = [
>  	['RTE_MACHINE', '"neoverse-n1"'],
> -	['RTE_MAX_LCORE', 64],
> -	['RTE_CACHE_LINE_SIZE', 64],
>  	['RTE_ARM_FEATURE_ATOMICS', true],
>  	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_MAX_MEM_MB', 1048576],
> -	['RTE_MAX_NUMA_NODES', 1],
>  	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false]]
> +	['RTE_LIBRTE_VHOST_NUMA', false],
> +	['RTE_MAX_MEM_MB', 1048576],
> +	['RTE_CACHE_LINE_SIZE', 64],
> +	['RTE_MAX_LCORE', 64],
> +	['RTE_MAX_NUMA_NODES', 1]
> +]
> 
> +# arm config (implementer 0x41) is the default config
I do not understand this comment. What does 'default' config mean? Are you referring to 'generic' config?

>  part_number_config_arm = [
>  	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
>  	['native', ['-march=native']],
> @@ -96,8 +114,8 @@ part_number_config_arm = [
>  	['0xd09', ['-mcpu=cortex-a73']],
>  	['0xd0a', ['-mcpu=cortex-a75']],
>  	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> flags_part_number_n1generic]]
> -
> +	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> +flags_part_number_n1generic] ]
>  part_number_config_cavium = [
>  	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
>  	['native', ['-march=native']],
> @@ -105,13 +123,14 @@ part_number_config_cavium = [
>  	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
>  	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
>  	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_part_number_thunderx2],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_part_number_octeontx2]]
> -
> +	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> +flags_part_number_octeontx2] ]
>  part_number_config_emag = [
>  	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]]
> +	['native', ['-march=native']]
> +]
> 
> -## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
> +## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
>  implementer_generic = ['Generic armv8', flags_implementer_generic,
> part_number_config_arm]
>  implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
>  implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium] @@ -123,21 +142,21 @@
> dpdk_conf.set('RTE_ARCH_ARM', 1)  dpdk_conf.set('RTE_FORCE_INTRINSICS',
> 1)
> 
>  if dpdk_conf.get('RTE_ARCH_32')
> +	# armv7 build
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> -
> +	# aarch64 build
>  	implementer_id = 'generic'
>  	machine_args = [] # Clear previous machine args
>  	if machine == 'generic' and not meson.is_cross_build()
> +		# generic build
>  		implementer_config = implementer_generic
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
> +		# native build
>  		# The script returns ['Implementer', 'Variant', 'Architecture',
>  		# 'Primary Part number', 'Revision']
>  		detect_vendor = find_program(join_paths( @@ -158,6 +177,7
> @@ else
>  			part_number = 'native'
>  		endif
>  	else
> +		# cross build
>  		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
>  		part_number = meson.get_cross_property('part_number',
> 'generic')
>  		implementer_config = get_variable('implementer_' +
> implementer_id) @@ -194,7 +214,7 @@ else
>  		endif
>  	endforeach
>  endif
> -message(machine_args)
> +message('Using machine args: @0@'.format(machine_args))
> 
>  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
>      cc.get_define('__aarch64__', args: machine_args) != '')
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 05/14] build: simplify how Arm flags are processed
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 05/14] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-08  3:19                 ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-08  3:19 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Set flags in one loop. Append flags to a list and use the list in the loop.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/meson.build | 37 +++++++++++++++++--------------------
>  1 file changed, 17 insertions(+), 20 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 5b922ef9c..eda485e7f 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -150,7 +150,6 @@ if dpdk_conf.get('RTE_ARCH_32')  else
>  	# aarch64 build
>  	implementer_id = 'generic'
> -	machine_args = [] # Clear previous machine args
>  	if machine == 'generic' and not meson.is_cross_build()
>  		# generic build
>  		implementer_config = implementer_generic @@ -183,34
> +182,32 @@ else
>  		implementer_config = get_variable('implementer_' +
> implementer_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('Arm implementer: ' + implementer_config[0])
> +	message('Arm part number: ' + part_number)
> 
> -	message('Implementer : ' + implementer_config[0])
> -	foreach flag: implementer_config[1]
> -		if flag.length() > 0
> -			dpdk_conf.set(flag[0], flag[1])
> -		endif
> -	endforeach
> +	# use default flags with implementer flags
> +	dpdk_flags = flags_common_default + implementer_config[1]
> 
> +	machine_args = [] # Clear previous machine args
>  	foreach marg: implementer_config[2]
>  		if marg[0] == part_number
> +			# apply supported machine args
>  			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, [])
> -				if flag.length() > 0
> -					dpdk_conf.set(flag[0], flag[1])
> -				endif
> -			endforeach
> +			if marg.length() > 2
> +				# add extra flags for the part
> +				dpdk_flags += marg[2]
> +			endif
> +		endif
> +	endforeach
> +
> +	# apply flags
> +	foreach flag: dpdk_flags
> +		if flag.length() > 0
> +			dpdk_conf.set(flag[0], flag[1])
>  		endif
>  	endforeach
>  endif
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds Juraj Linkeš
@ 2020-11-08 14:42                 ` Honnappa Nagarahalli
  2020-11-11 11:45                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-08 14:42 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Switch to generic build on arm Travis machines to avoid differences in build
> configuration caused by different Arm hardware.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .ci/linux-build.sh | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index d079801d7..7fe0fcfd8
> 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
>      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
>  fi
> 
> +if [ "$(uname -m)" = "aarch64" ]; then
> +    OPTS="$OPTS -Dmachine=generic"
> +fi
> +
I do not think we should change it by default. We would need to test generic builds as well as the SoC specific build.


>  if [ "$BUILD_DOCS" = "1" ]; then
>      OPTS="$OPTS -Denable_docs=true"
>  fi
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-08 19:45                 ` Honnappa Nagarahalli
  2020-11-09 10:38                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-08 19:45 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Use dictionary lookup instead of checking for existing variables, iterating over
> all elements in the list or checking lists for optional configuration. Move
> variable contents into the dictionary for variables that would be referenced
> only once.
> Fallback to generic part number if the discovered part number is unknown.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 282 +++++++++++++++++++++++------------------
>  1 file changed, 160 insertions(+), 122 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> eda485e7f..5d232f1c4 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -28,115 +28,146 @@ flags_common_default = [
>  	['RTE_CACHE_LINE_SIZE', 128]
>  ]
> 
> -# implementer specific aarch64 flags, with middle priority -# (will overwrite
> common flags) -flags_implementer_generic = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 256]
> -]
> -flags_implementer_arm = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16]
> -]
> -flags_implementer_cavium = [
> -	['RTE_MAX_VFIO_GROUPS', 128],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 96],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_implementer_dpaa = [
> -	['RTE_MACHINE', '"dpaa"'],
> -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_emag = [
> -	['RTE_MACHINE', '"emag"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 32],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_armada = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -
> -# part number specific aarch64 flags, with highest priority -# (will overwrite
> both common and implementer specific flags)  flags_part_number_thunderx =
> [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]
>  ]
> -flags_part_number_thunderx2 = [
> -	['RTE_MACHINE', '"thunderx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 256],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_part_number_octeontx2 = [
> -	['RTE_MACHINE', '"octeontx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_IGB_UIO', false],
> -	['RTE_MAX_LCORE', 36],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_part_number_n1generic = [
> -	['RTE_MACHINE', '"neoverse-n1"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false],
> -	['RTE_MAX_MEM_MB', 1048576],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 64],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -
> -# arm config (implementer 0x41) is the default config -
> part_number_config_arm = [
> -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> -	['native', ['-march=native']],
> -	['0xd03', ['-mcpu=cortex-a53']],
> -	['0xd04', ['-mcpu=cortex-a35']],
> -	['0xd07', ['-mcpu=cortex-a57']],
> -	['0xd08', ['-mcpu=cortex-a72']],
> -	['0xd09', ['-mcpu=cortex-a73']],
> -	['0xd0a', ['-mcpu=cortex-a75']],
> -	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> flags_part_number_n1generic]
> -]
> -part_number_config_cavium = [
> -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> -	['native', ['-march=native']],
> -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_part_number_thunderx2],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_part_number_octeontx2]
> -]
> -part_number_config_emag = [
> -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]
> -]
> +part_number_config_arm = {
> +	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-
> atomics']},
> +	'native': {'machine_args':  ['-march=native']},
> +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> +	'0xd0c': {
> +		'machine_args':  ['-march=armv8.2-a+crypto', '-
> mcpu=neoverse-n1'],
> +		'flags': [
> +			['RTE_MACHINE', '"neoverse-n1"'],
> +			['RTE_ARM_FEATURE_ATOMICS', true],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> +			['RTE_LIBRTE_VHOST_NUMA', false],
> +			['RTE_MAX_MEM_MB', 1048576],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 64],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		]
> +	}
> +}
> 
> -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> implementer_generic = ['Generic armv8', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
> -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium]
> -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> part_number_config_emag]
> -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> flags_implementer_dpaa, part_number_config_arm]
> +## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
> +## Part numbers are specific to Arm implementers # implementer specific
> +aarch64 flags have middle priority
> +#     (will overwrite common flags)
> +# part number specific aarch64 flags have the highest priority
> +#     (will overwrite both common and implementer specific flags)
> +implementers = {
I think this one is big. It will grow further in the future. I like the existing one, which is dis-integrated into smaller chunks and is easy to maintain in the future.

> +	'generic': {
> +		'description': 'Generic armv8',
> +		'flags': [
> +			['RTE_MACHINE', '"armv8a"'],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_CACHE_LINE_SIZE', 128],
> +			['RTE_MAX_LCORE', 256]
> +		],
> +		'part_number_config': part_number_config_arm
> +	},
> +	'0x41': {
> +		'description': 'Arm',
> +		'flags': [
> +			['RTE_MACHINE', '"armv8a"'],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 16]
> +		],
> +		'part_number_config': part_number_config_arm
> +	},
> +	'0x43': {
> +		'description': 'Cavium',
> +		'flags': [
> +			['RTE_MAX_VFIO_GROUPS', 128],
> +			['RTE_CACHE_LINE_SIZE', 128],
> +			['RTE_MAX_LCORE', 96],
> +			['RTE_MAX_NUMA_NODES', 2]
> +		],
> +		'part_number_config': {
> +			'generic': {'machine_args': ['-march=armv8-
> a+crc+crypto', '-mcpu=thunderx']},
> +			'native': {'machine_args': ['-march=native']},
> +			'0xa1': {
> +				'machine_args': ['-mcpu=thunderxt88'],
> +				'flags': flags_part_number_thunderx
> +			},
> +			'0xa2': {
> +				'machine_args': ['-mcpu=thunderxt81'],
> +				'flags': flags_part_number_thunderx
> +			},
> +			'0xa3': {
> +				'machine_args': ['-mcpu=thunderxt83'],
> +				'flags': flags_part_number_thunderx
> +			},
> +			'0xaf': {
> +				'machine_args': ['-march=armv8.1-
> a+crc+crypto','-mcpu=thunderx2t99'],
> +				'flags': [
> +					['RTE_MACHINE', '"thunderx2"'],
> +					['RTE_ARM_FEATURE_ATOMICS',
> true],
> +					['RTE_USE_C11_MEM_MODEL', true],
> +					['RTE_CACHE_LINE_SIZE', 64],
> +					['RTE_MAX_LCORE', 256],
> +					['RTE_MAX_NUMA_NODES', 2]
> +				]
> +			},
> +			'0xb2': {
> +				'machine_args': ['-march=armv8.2-
> a+crc+crypto+lse','-mcpu=octeontx2'],
> +				'flags': [
> +					['RTE_MACHINE', '"octeontx2"'],
> +					['RTE_ARM_FEATURE_ATOMICS',
> true],
> +					['RTE_USE_C11_MEM_MODEL', true],
> +					['RTE_EAL_IGB_UIO', false],
> +					['RTE_MAX_LCORE', 36],
> +					['RTE_MAX_NUMA_NODES', 1]
> +				]
> +			}
> +		}
> +	},
> +	'0x50': {
> +		'description': 'Ampere Computing',
> +		'flags': [
> +			['RTE_MACHINE', '"emag"'],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 32],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'part_number_config': {
> +			'generic': {'machine_args':  ['-march=armv8-
> a+crc+crypto', '-mtune=emag']},
> +			'native': {'machine_args':  ['-march=native']}
> +		}
> +	},
> +	'0x56': {
> +		'description': 'Marvell ARMADA',
> +		'flags': [
> +			['RTE_MACHINE', '"armv8a"'],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'part_number_config': part_number_config_arm
> +	},
> +	'dpaa': {
> +		'description': 'NXP DPAA',
> +		'flags': [
> +			['RTE_MACHINE', '"dpaa"'],
> +			['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'part_number_config': part_number_config_arm
> +	}
> +}
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -152,7 +183,7 @@ else
>  	implementer_id = 'generic'
>  	if machine == 'generic' and not meson.is_cross_build()
>  		# generic build
> -		implementer_config = implementer_generic
> +		implementer_config = implementer['generic']
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# native build
> @@ -167,9 +198,9 @@ else
>  			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> implementer_id, ['generic'])
> +		implementer_config = implementers.get(implementer_id,
> ['generic'])
>  		if implementer_config[0] == 'generic'
> -			implementer_config = implementer_generic
> +			implementer_config = implementer['generic']
>  			part_number = 'generic'
>  		endif
>  		if arm_force_native_march == true
> @@ -179,28 +210,35 @@ else
>  		# cross build
>  		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
>  		part_number = meson.get_cross_property('part_number',
> 'generic')
> -		implementer_config = get_variable('implementer_' +
> implementer_id)
> +		implementer_config = implementers.get(implementer_id)
>  	endif
> 
> -	message('Arm implementer: ' + implementer_config[0])
> +	message('Arm implementer: ' + implementer_config['description'])
>  	message('Arm part number: ' + part_number)
> 
> +	part_number_config = implementer_config['part_number_config']
> +	if part_number_config.has_key(part_number)
> +		# use the specified part_number machine args if found
> +		part_number_config = part_number_config[part_number]
> +	elif not meson.is_cross_build()
> +		# default to generic machine args if part_number is not found
> +		# and not forcing native machine args
> +		# but don't default in cross-builds; if part_number is specified
> +		# incorrectly in a cross-file, it needs to be fixed there
> +		part_number_config = part_number_config['generic']
> +	else
> +		# doing cross build and part number is not in
> part_number_config
> +		error('Cross build part number 0@0 not
> found.'.format(part_number))
> +	endif
> +
>  	# use default flags with implementer flags
> -	dpdk_flags = flags_common_default + implementer_config[1]
> +	dpdk_flags = flags_common_default + implementer_config['flags'] +
> +part_number_config.get('flags', [])
> 
> +	# apply supported machine args
>  	machine_args = [] # Clear previous machine args
> -	foreach marg: implementer_config[2]
> -		if marg[0] == part_number
> -			# apply supported machine args
> -			foreach flag: marg[1]
> -				if cc.has_argument(flag)
> -					machine_args += flag
> -				endif
> -			endforeach
> -			if marg.length() > 2
> -				# add extra flags for the part
> -				dpdk_flags += marg[2]
> -			endif
> +	foreach flag: part_number_config['machine_args']
> +		if cc.has_argument(flag)
> +			machine_args += flag
>  		endif
>  	endforeach
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers Juraj Linkeš
@ 2020-11-08 20:19                 ` Honnappa Nagarahalli
  2020-11-09 10:52                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-08 20:19 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> A few options that disabled drivers in the old makefiles were improperly
> ported to the meson build system. Fix this by adding a to the list of disabled
The fixes need to be separated into a different commit as they need to be backported.
It would be good to get the fix patch as the first patch, it will be easy to backport.

> drivers, similarly how the command line option works. Remove unneeded
> driver options ported from the old makefile system.
> Add support for removing drivers for cross builds.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  config/arm/arm64_armada_linux_gcc | 1 +
> config/arm/arm64_armv8_linux_gcc  | 3 +++
>  config/arm/meson.build            | 7 +++----
>  drivers/meson.build               | 6 +++++-
>  meson.build                       | 1 +
>  5 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index 73945fbb4..7383f42e2 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -17,3 +17,4 @@ endian = 'little'
>  implementer_id = '0x56'
>  max_lcores = 16
>  max_numa_nodes = 1
> +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index fb24be5fc..245e06e5f 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -52,3 +52,6 @@ part_number = 'generic'
>  # max_lcores = n      # will set RTE_MAX_LCORE
>  max_lcores = 256
>  max_numa_nodes = 4
> +
> +# disabled_drivers = ['bus/dpaa', 'crypto']
> +    # add to the set of disabled libraries
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> e9bb60045..a39a35b6a 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -3,6 +3,9 @@
>  # Copyright(c) 2017 Cavium, Inc
>  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
> +# disable Arm drivers for all builds
> +disabled_drivers += ['net/avp', 'net/fm10k']
> +
>  # common flags to all aarch64 builds, with lowest priority
> flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -17,9 +20,6 @@ flags_common_default = [
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> 
> -	['RTE_NET_FM10K', false],
> -	['RTE_NET_AVP', false],
> -
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
>  	['RTE_ARCH_ARM64', true],
> @@ -124,7 +124,6 @@ implementers = {
>  					['RTE_MACHINE', '"octeontx2"'],
>  					['RTE_ARM_FEATURE_ATOMICS',
> true],
>  					['RTE_USE_C11_MEM_MODEL', true],
> -					['RTE_EAL_IGB_UIO', false],
Does this need to go to octeon tx2 cross file?

>  					['RTE_MAX_LCORE', 36],
>  					['RTE_MAX_NUMA_NODES', 1]
>  				]
> diff --git a/drivers/meson.build b/drivers/meson.build index
> 4bb7e9218..a997387ad 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -18,9 +18,13 @@ subdirs = [
>  	'baseband', # depends on common and bus.
>  ]
> 
> -disabled_drivers = run_command(list_dir_globs,
> get_option('disable_drivers'),
> +disabled_drivers += run_command(list_dir_globs,
> +get_option('disable_drivers'),
>  		).stdout().split()
> 
> +if meson.is_cross_build()
> +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> +endif
> +
>  default_cflags = machine_args
>  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags += ['-
> DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build index
> 61d9a4f5f..8dadd70dc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -21,6 +21,7 @@ dpdk_drivers = []
>  dpdk_extra_ldflags = []
>  dpdk_libs_disabled = []
>  dpdk_drvs_disabled = []
> +disabled_drivers = []
>  abi_version_file = files('ABI_VERSION')
> 
>  if host_machine.cpu_family().startswith('x86')
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-09  0:24                 ` Honnappa Nagarahalli
  2020-11-09 11:10                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09  0:24 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

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

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

> +endif
> +if find_libnuma
> +	numa_dep = cc.find_library('numa', required: false)
> +	if numa_dep.found() and cc.has_header('numaif.h')
> +		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> +		has_libnuma = 1
> +		add_project_link_arguments('-lnuma', language: 'c')
> +		dpdk_extra_ldflags += '-lnuma'
> +	endif
>  endif
> 
>  has_libfdt = 0
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-09  2:40                 ` Honnappa Nagarahalli
  2020-11-09 11:45                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09  2:40 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Add Arm SoC configuration to Arm meson.build and add a meson option to
> enable those options for native builds. This is preferable to specifying a cross
> file when doing aarch64 -> aarch64 builds, since the cross file specifies the
> toolchain as well.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/arm64_armada_linux_gcc      |   6 +-
>  config/arm/arm64_armv8_linux_gcc       |  58 +++--------
>  config/arm/arm64_bluefield_linux_gcc   |   6 +-
>  config/arm/arm64_dpaa_linux_gcc        |   5 +-
>  config/arm/arm64_emag_linux_gcc        |   5 +-
>  config/arm/arm64_graviton2_linux_gcc   |   6 +-
>  config/arm/arm64_n1sdp_linux_gcc       |   6 +-
>  config/arm/arm64_octeontx2_linux_gcc   |   6 +-
>  config/arm/arm64_stingray_linux_gcc    |   6 +-
>  config/arm/arm64_thunderx2_linux_gcc   |   5 +-
>  config/arm/arm64_thunderxt88_linux_gcc |   5 +-
>  config/arm/meson.build                 | 132 ++++++++++++++++++++++++-
>  meson_options.txt                      |   2 +
>  13 files changed, 154 insertions(+), 94 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index f5403f0a6..7cc40d1f4 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -14,8 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x56'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> -disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> +soc = 'armada'
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 77e3d6278..d4cb6b5bf 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -13,46 +13,18 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -# Supported implementers:
> -# 'generic': Generic armv8
> -# '0x41':    Arm
> -# '0x43':    Cavium
> -# '0x50':    Ampere Computing
> -# '0x56':    Marvell ARMADA
> -# 'dpaa':    NXP DPAA
> -implementer_id = 'generic'
> -
> -# Supported part_numbers for generic:
> -# 'generic': valid for all armv8-a architectures (unoptimized portable build) -
> part_number = 'generic'
> -
> -# Supported part_numbers for 0x41, 0x56, dpaa:
> -# '0xd03':   cortex-a53
> -# '0xd04':   cortex-a35
> -# '0xd05':   cortex-a55
> -# '0xd07':   cortex-a57
> -# '0xd08':   cortex-a72
> -# '0xd09':   cortex-a73
> -# '0xd0a':   cortex-a75
> -# '0xd0b':   cortex-a76
> -# '0xd0c':   neoverse-n1
> -
> -# Supported part_numbers for 0x43:
> -# '0xa1':    thunderxt88
> -# '0xa2':    thunderxt81
> -# '0xa3':    thunderxt83
> -# '0xaf':    thunderx2t99
> -# '0xb2':    octeontx2
> -
> -# Supported part_numbers for 0x50:
> -# '0x0':     emag
> -
> -# Supported extra configuration
> -# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
> -# max_lcores = n      # will set RTE_MAX_LCORE
> -max_lcores = 256
> -max_numa_nodes = 4
> -
> -# numa = false        # set to false if the target is not a NUMA system
> -# disabled_drivers = ['bus/dpaa', 'crypto']
> -    # add to the set of disabled libraries
> +# Supported SoCs:
> +# generic
> +# armada
> +# bluefield
> +# dpaa
> +# emag
> +# graviton2
> +# n1sdp
> +# octeontx2
> +# stingray
> +# thunderx2
> +# thunderxt88
> +# thunderx2t99
We can remove the comments here. This list needs to be documented.

> +
> +soc = 'generic'
> diff --git a/config/arm/arm64_bluefield_linux_gcc
> b/config/arm/arm64_bluefield_linux_gcc
> index 6bef87fbd..7b1fae8b9 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x41'
> -part_number = '0xd08'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> +soc = 'bluefield'
> diff --git a/config/arm/arm64_dpaa_linux_gcc
> b/config/arm/arm64_dpaa_linux_gcc index 3458b9d7b..e52188842 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -14,7 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = 'dpaa'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> +soc = 'dpaa'
> diff --git a/config/arm/arm64_emag_linux_gcc
> b/config/arm/arm64_emag_linux_gcc index 7cbb05510..6c24b4bca 100644
> --- a/config/arm/arm64_emag_linux_gcc
> +++ b/config/arm/arm64_emag_linux_gcc
> @@ -13,7 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x50'
> -part_number = '0x0'
> -max_lcores = 32
> -max_numa_nodes = 1
> +soc = 'emag'
> diff --git a/config/arm/arm64_graviton2_linux_gcc
> b/config/arm/arm64_graviton2_linux_gcc
> index cfe239797..bae35d6be 100644
> --- a/config/arm/arm64_graviton2_linux_gcc
> +++ b/config/arm/arm64_graviton2_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd0c'
> -max_lcores = 64
> -max_numa_nodes = 1
> -numa = false
> +soc = 'graviton2'
> diff --git a/config/arm/arm64_n1sdp_linux_gcc
> b/config/arm/arm64_n1sdp_linux_gcc
> index b00f2d1ef..249ff4738 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x41'
> -part_number = '0xd0c'
> -max_lcores = 4
> -max_numa_nodes = 1
> -numa = false
> +soc = 'n1sdp'
> diff --git a/config/arm/arm64_octeontx2_linux_gcc
> b/config/arm/arm64_octeontx2_linux_gcc
> index 593769709..063018e8f 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x43'
> -part_number = '0xb2'
> -max_lcores = 36
> -max_numa_nodes = 1
> -numa = false
> +soc = 'octeontx2'
> diff --git a/config/arm/arm64_stingray_linux_gcc
> b/config/arm/arm64_stingray_linux_gcc
> index 6bef87fbd..1209a8c0b 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x41'
> -part_number = '0xd08'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> +soc = 'stingray'
> diff --git a/config/arm/arm64_thunderx2_linux_gcc
> b/config/arm/arm64_thunderx2_linux_gcc
> index c06dcdc2b..348650712 100644
> --- a/config/arm/arm64_thunderx2_linux_gcc
> +++ b/config/arm/arm64_thunderx2_linux_gcc
> @@ -13,7 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x43'
> -part_number = '0xaf'
> -max_lcores = 256
> -max_numa_nodes = 2
> +soc = 'thunderx2'
> diff --git a/config/arm/arm64_thunderxt88_linux_gcc
> b/config/arm/arm64_thunderxt88_linux_gcc
> index 3ba1528e4..d31d0c6d8 100644
> --- a/config/arm/arm64_thunderxt88_linux_gcc
> +++ b/config/arm/arm64_thunderxt88_linux_gcc
> @@ -13,7 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x43'
> -part_number = '0xa1'
> -max_lcores = 96
> -max_numa_nodes = 1
> +soc = 'thunderxt88'
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 52274c0c5..cd270f84b 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -57,7 +57,7 @@ part_number_config_arm = {  ## Part numbers are
> specific to Arm implementers  # implementer specific aarch64 flags have
> middle priority
>  #     (will overwrite common flags)
> -# part number specific aarch64 flags have the highest priority
> +# part number specific aarch64 flags have higher priority
>  #     (will overwrite both common and implementer specific flags)
>  implementers = {
>  	'generic': {
> @@ -164,6 +164,102 @@ implementers = {
>  	}
>  }
> 
> +# soc specific aarch64 flags have the highest priority
> +#     (will overwrite all other flags)
> +socs = {
Too big to maintain

> +	'generic': {
> +		'implementer': 'generic',
> +		'part_number': 'generic',
> +		'flags': []
> +	},
> +	'armada': {
> +		'implementer': '0x56',
> +		'flags': [
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'numa': false,
> +		'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> +	},
> +	'bluefield': {
> +		'implementer': '0x41',
> +		'part_number': '0xd08',
> +		'flags': [
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'numa': false
> +	},
> +	'dpaa': {
> +		'implementer': 'dpaa',
> +		'flags': [
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'numa': false
> +	},
> +	'emag': {
> +		'implementer': '0x50',
> +		'part_number': '0x0',
> +		'flags': [
> +			['RTE_MAX_LCORE', 32],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		]
> +	},
> +	'graviton2': {
> +		'implementer': '0x41',
> +		'part_number': '0xd0c',
> +		'flags': [
> +			['RTE_MAX_LCORE', 64],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'numa': false
> +	},
> +	'n1sdp': {
> +		'implementer': '0x41',
> +		'part_number': '0xd0c',
> +		'flags': [
> +			['RTE_MAX_LCORE', 4],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'numa': false
> +	},
> +	'octeontx2': {
> +		'implementer': '0x43',
> +		'part_number': '0xb2',
> +		'flags': [
> +			['RTE_MAX_LCORE', 32],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'numa': false
> +	},
> +	'stingray': {
> +		'implementer': '0x41',
> +		'part_number': '0xd08',
> +		'flags': [
> +			['RTE_MAX_LCORE', 16],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		],
> +		'numa': false
> +	},
> +	'thunderx2': {
> +		'implementer': '0x43',
> +		'part_number': '0xaf',
> +		'flags': [
> +			['RTE_MAX_LCORE', 256],
> +			['RTE_MAX_NUMA_NODES', 2]
> +		]
> +	},
> +	'thunderxt88': {
> +		'implementer': '0x43',
> +		'part_number': '0xa1',
> +		'flags': [
> +			['RTE_MAX_LCORE', 96],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		]
> +	}
> +}
> +
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> 
> @@ -176,11 +272,18 @@ if dpdk_conf.get('RTE_ARCH_32')  else
>  	# aarch64 build
>  	use_native_machine_args = false
> +	arm_soc = get_option('arm_soc')
> +	soc_config = {}
>  	if not meson.is_cross_build()
>  		if machine == 'generic'
>  			# generic build
> +			if arm_soc != ''
> +				error('Arm SoC is unsupported with generic
> build.')
> +			endif
>  			implementer_id = 'generic'
>  			part_number = 'generic'
> +		elif arm_soc != ''
> +			soc_config = socs.get(arm_soc, {'not_supported':
> true})
>  		else
>  			# native build
>  			# The script returns ['Implementer', 'Variant',
> 'Architecture', @@ -199,8 +302,27 @@ else
>  		endif
>  	else
>  		# cross build
> -		implementer_id =
> meson.get_cross_property('implementer_id')
> -		part_number = meson.get_cross_property('part_number')
> +		arm_soc = meson.get_cross_property('soc', '')
> +		if arm_soc == ''
> +			error('Arm SoC must be specified in the cross file.')
> +		endif
> +		soc_config = socs.get(arm_soc, {'not_supported': true})
> +	endif
> +
> +	soc_flags = []
> +	if soc_config.has_key('not_supported')
> +		error('SoC @0@ not supported.'.format(arm_soc))
> +	elif soc_config != {}
> +		implementer_id = soc_config['implementer']
> +		implementer_config = implementers[implementer_id]
> +		part_number = soc_config['part_number']
> +		soc_flags = soc_config['flags']
> +		if not soc_config.get('numa', true)
> +			has_libnuma = 0
> +		endif
> +		if soc_config.has_key('disabled_drivers')
> +			disabled_drivers += soc_config['disabled_drivers']
> +		endif
>  	endif
> 
>  	if implementers.has_key(implementer_id)
> @@ -226,8 +348,8 @@ else
>  		      '(-Dmachine=generic) build.')
>  	endif
> 
> -	# use default flags with implementer flags
> -	dpdk_flags = flags_common_default + implementer_config['flags'] +
> part_number_config.get('flags', [])
> +	# add flags in the proper order
> +	dpdk_flags = flags_common_default + implementer_config['flags'] +
> +part_number_config.get('flags', []) + soc_flags
> 
>  	# apply supported machine args
>  	machine_args = [] # Clear previous machine args diff --git
> a/meson_options.txt b/meson_options.txt index e1059fb16..33b8b236c
> 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -1,5 +1,7 @@
>  # Please keep these options sorted alphabetically.
> 
> +option('arm_soc', type: 'string', value: '',
> +	description: 'Specify if you want to build for a particular Arm SoC
> +when building on an aarch64 machine.')
Kind of indicates that it is a cross build.
How about: "Build natively for the specified Arm SoC"?

>  option('armv8_crypto_dir', type: 'string', value: '',
>  	description: 'path to the armv8_crypto library installation directory')
> option('disable_drivers', type: 'string', value: '',
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict
  2020-11-08 19:45                 ` Honnappa Nagarahalli
@ 2020-11-09 10:38                   ` Juraj Linkeš
  2020-11-09 23:15                     ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-09 10:38 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Sunday, November 8, 2020 8:46 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 06/14] build: organize Arm config into dict
> 
> <snip>
> 
> >
> > Use dictionary lookup instead of checking for existing variables,
> > iterating over all elements in the list or checking lists for optional
> > configuration. Move variable contents into the dictionary for
> > variables that would be referenced only once.
> > Fallback to generic part number if the discovered part number is unknown.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/meson.build | 282
> > +++++++++++++++++++++++------------------
> >  1 file changed, 160 insertions(+), 122 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > eda485e7f..5d232f1c4 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -28,115 +28,146 @@ flags_common_default = [
> >  	['RTE_CACHE_LINE_SIZE', 128]
> >  ]
> >
> > -# implementer specific aarch64 flags, with middle priority -# (will
> > overwrite common flags) -flags_implementer_generic = [
> > -	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 128],
> > -	['RTE_MAX_LCORE', 256]
> > -]
> > -flags_implementer_arm = [
> > -	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 16]
> > -]
> > -flags_implementer_cavium = [
> > -	['RTE_MAX_VFIO_GROUPS', 128],
> > -	['RTE_CACHE_LINE_SIZE', 128],
> > -	['RTE_MAX_LCORE', 96],
> > -	['RTE_MAX_NUMA_NODES', 2]
> > -]
> > -flags_implementer_dpaa = [
> > -	['RTE_MACHINE', '"dpaa"'],
> > -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 16],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -flags_implementer_emag = [
> > -	['RTE_MACHINE', '"emag"'],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 32],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -flags_implementer_armada = [
> > -	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 16],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -
> > -# part number specific aarch64 flags, with highest priority -# (will
> > overwrite both common and implementer specific flags)
> > flags_part_number_thunderx = [
> >  	['RTE_MACHINE', '"thunderx"'],
> >  	['RTE_USE_C11_MEM_MODEL', false]
> >  ]
> > -flags_part_number_thunderx2 = [
> > -	['RTE_MACHINE', '"thunderx2"'],
> > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 256],
> > -	['RTE_MAX_NUMA_NODES', 2]
> > -]
> > -flags_part_number_octeontx2 = [
> > -	['RTE_MACHINE', '"octeontx2"'],
> > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_EAL_IGB_UIO', false],
> > -	['RTE_MAX_LCORE', 36],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -flags_part_number_n1generic = [
> > -	['RTE_MACHINE', '"neoverse-n1"'],
> > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > -	['RTE_LIBRTE_VHOST_NUMA', false],
> > -	['RTE_MAX_MEM_MB', 1048576],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 64],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -
> > -# arm config (implementer 0x41) is the default config -
> > part_number_config_arm = [
> > -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> > -	['native', ['-march=native']],
> > -	['0xd03', ['-mcpu=cortex-a53']],
> > -	['0xd04', ['-mcpu=cortex-a35']],
> > -	['0xd07', ['-mcpu=cortex-a57']],
> > -	['0xd08', ['-mcpu=cortex-a72']],
> > -	['0xd09', ['-mcpu=cortex-a73']],
> > -	['0xd0a', ['-mcpu=cortex-a75']],
> > -	['0xd0b', ['-mcpu=cortex-a76']],
> > -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> > flags_part_number_n1generic]
> > -]
> > -part_number_config_cavium = [
> > -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > -	['native', ['-march=native']],
> > -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> > -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> > -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > flags_part_number_thunderx2],
> > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > flags_part_number_octeontx2]
> > -]
> > -part_number_config_emag = [
> > -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > -	['native', ['-march=native']]
> > -]
> > +part_number_config_arm = {
> > +	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-
> > atomics']},
> > +	'native': {'machine_args':  ['-march=native']},
> > +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> > +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> > +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> > +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> > +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> > +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> > +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> > +	'0xd0c': {
> > +		'machine_args':  ['-march=armv8.2-a+crypto', '-
> > mcpu=neoverse-n1'],
> > +		'flags': [
> > +			['RTE_MACHINE', '"neoverse-n1"'],
> > +			['RTE_ARM_FEATURE_ATOMICS', true],
> > +			['RTE_USE_C11_MEM_MODEL', true],
> > +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > +			['RTE_LIBRTE_VHOST_NUMA', false],
> > +			['RTE_MAX_MEM_MB', 1048576],
> > +			['RTE_CACHE_LINE_SIZE', 64],
> > +			['RTE_MAX_LCORE', 64],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		]
> > +	}
> > +}
> >
> > -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> > implementer_generic = ['Generic armv8', flags_implementer_generic,
> > part_number_config_arm]
> > -implementer_0x41 = ['Arm', flags_implementer_arm,
> > part_number_config_arm]
> > -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> > part_number_config_cavium]
> > -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> > part_number_config_emag]
> > -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> > part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> > flags_implementer_dpaa, part_number_config_arm]
> > +## Arm implementers (ID from MIDR in Arm Architecture Reference
> > +Manual) ## Part numbers are specific to Arm implementers #
> > +implementer specific
> > +aarch64 flags have middle priority
> > +#     (will overwrite common flags)
> > +# part number specific aarch64 flags have the highest priority
> > +#     (will overwrite both common and implementer specific flags)
> > +implementers = {
> I think this one is big. It will grow further in the future. I like the existing one,
> which is dis-integrated into smaller chunks and is easy to maintain in the future.
> 

My main concern was with the readability/understandability of the data (which affects maintenance), at least when a newcomer tries to wrap their head around them. The data are hierarchical and the relationship between implementer ID and part number and the order of flag application is more apparent when organized this way, although it could because of better formatting and better variable names. The bigger difference is in the code - using implementer_config['part_number_config'] immediately tells you what data are you working with as opposed to implementer_config[2].

I'm also looking at maintenance in terms of "where in this file do I need to change/add things for this implementer or their part number", which informed my motivation for (almost) removing the fragmentation, which we don't have to do, but it made sense to me. This way, if I'm looking for some configuration I know exactly where to find it in the file (under particular implementer ID/part number) and I don't have to chase variables around, although this is somewhat alleviated by better variable names. Or in other words having related configuration in one place rather than fragmented in multiple places is better organization of the data in my view, both in terms of readability and maintainability. 

I don't actually see how having fragmented configuration is better when it's going to grow. The disjointed parts which are logically connected (implemeter configuration connected to its part number config) are only going to be further apart in the code, causing more potential confusion. When we have configuration organized by their relationship new additions won't really affect existing organization - e.g. when we add a new implementer, it won't move the configuration within other implementers; the other implementer's configuration won't be affected.

If I understand correctly, your gripe is not with using a dictionary (or how I've formatted the data in it), but rather with the removal of fragmentation. I'd like to keep the dictionaries (and formatting), since it results in more readable code. I could put the fragmentetion back in place, but I don't think it's better maintanence-wise.

> > +	'generic': {
> > +		'description': 'Generic armv8',
> > +		'flags': [
> > +			['RTE_MACHINE', '"armv8a"'],
> > +			['RTE_USE_C11_MEM_MODEL', true],
> > +			['RTE_CACHE_LINE_SIZE', 128],
> > +			['RTE_MAX_LCORE', 256]
> > +		],
> > +		'part_number_config': part_number_config_arm
> > +	},
> > +	'0x41': {
> > +		'description': 'Arm',
> > +		'flags': [
> > +			['RTE_MACHINE', '"armv8a"'],
> > +			['RTE_USE_C11_MEM_MODEL', true],
> > +			['RTE_CACHE_LINE_SIZE', 64],
> > +			['RTE_MAX_LCORE', 16]
> > +		],
> > +		'part_number_config': part_number_config_arm
> > +	},
> > +	'0x43': {
> > +		'description': 'Cavium',
> > +		'flags': [
> > +			['RTE_MAX_VFIO_GROUPS', 128],
> > +			['RTE_CACHE_LINE_SIZE', 128],
> > +			['RTE_MAX_LCORE', 96],
> > +			['RTE_MAX_NUMA_NODES', 2]
> > +		],
> > +		'part_number_config': {
> > +			'generic': {'machine_args': ['-march=armv8-
> > a+crc+crypto', '-mcpu=thunderx']},
> > +			'native': {'machine_args': ['-march=native']},
> > +			'0xa1': {
> > +				'machine_args': ['-mcpu=thunderxt88'],
> > +				'flags': flags_part_number_thunderx
> > +			},
> > +			'0xa2': {
> > +				'machine_args': ['-mcpu=thunderxt81'],
> > +				'flags': flags_part_number_thunderx
> > +			},
> > +			'0xa3': {
> > +				'machine_args': ['-mcpu=thunderxt83'],
> > +				'flags': flags_part_number_thunderx
> > +			},
> > +			'0xaf': {
> > +				'machine_args': ['-march=armv8.1-
> > a+crc+crypto','-mcpu=thunderx2t99'],
> > +				'flags': [
> > +					['RTE_MACHINE', '"thunderx2"'],
> > +					['RTE_ARM_FEATURE_ATOMICS',
> > true],
> > +					['RTE_USE_C11_MEM_MODEL', true],
> > +					['RTE_CACHE_LINE_SIZE', 64],
> > +					['RTE_MAX_LCORE', 256],
> > +					['RTE_MAX_NUMA_NODES', 2]
> > +				]
> > +			},
> > +			'0xb2': {
> > +				'machine_args': ['-march=armv8.2-
> > a+crc+crypto+lse','-mcpu=octeontx2'],
> > +				'flags': [
> > +					['RTE_MACHINE', '"octeontx2"'],
> > +					['RTE_ARM_FEATURE_ATOMICS',
> > true],
> > +					['RTE_USE_C11_MEM_MODEL', true],
> > +					['RTE_EAL_IGB_UIO', false],
> > +					['RTE_MAX_LCORE', 36],
> > +					['RTE_MAX_NUMA_NODES', 1]
> > +				]
> > +			}
> > +		}
> > +	},
> > +	'0x50': {
> > +		'description': 'Ampere Computing',
> > +		'flags': [
> > +			['RTE_MACHINE', '"emag"'],
> > +			['RTE_CACHE_LINE_SIZE', 64],
> > +			['RTE_MAX_LCORE', 32],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'part_number_config': {
> > +			'generic': {'machine_args':  ['-march=armv8-
> > a+crc+crypto', '-mtune=emag']},
> > +			'native': {'machine_args':  ['-march=native']}
> > +		}
> > +	},
> > +	'0x56': {
> > +		'description': 'Marvell ARMADA',
> > +		'flags': [
> > +			['RTE_MACHINE', '"armv8a"'],
> > +			['RTE_CACHE_LINE_SIZE', 64],
> > +			['RTE_MAX_LCORE', 16],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'part_number_config': part_number_config_arm
> > +	},
> > +	'dpaa': {
> > +		'description': 'NXP DPAA',
> > +		'flags': [
> > +			['RTE_MACHINE', '"dpaa"'],
> > +			['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> > +			['RTE_USE_C11_MEM_MODEL', true],
> > +			['RTE_CACHE_LINE_SIZE', 64],
> > +			['RTE_MAX_LCORE', 16],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'part_number_config': part_number_config_arm
> > +	}
> > +}
> >
> >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -152,7 +183,7 @@ else
> >  	implementer_id = 'generic'
> >  	if machine == 'generic' and not meson.is_cross_build()
> >  		# generic build
> > -		implementer_config = implementer_generic
> > +		implementer_config = implementer['generic']
> >  		part_number = 'generic'
> >  	elif not meson.is_cross_build()
> >  		# native build
> > @@ -167,9 +198,9 @@ else
> >  			part_number = cmd_output[3]
> >  		endif
> >  		# Set to generic if variable is not found
> > -		implementer_config = get_variable('implementer_' +
> > implementer_id, ['generic'])
> > +		implementer_config = implementers.get(implementer_id,
> > ['generic'])
> >  		if implementer_config[0] == 'generic'
> > -			implementer_config = implementer_generic
> > +			implementer_config = implementer['generic']
> >  			part_number = 'generic'
> >  		endif
> >  		if arm_force_native_march == true
> > @@ -179,28 +210,35 @@ else
> >  		# cross build
> >  		implementer_id =
> > meson.get_cross_property('implementer_id', 'generic')
> >  		part_number = meson.get_cross_property('part_number',
> > 'generic')
> > -		implementer_config = get_variable('implementer_' +
> > implementer_id)
> > +		implementer_config = implementers.get(implementer_id)
> >  	endif
> >
> > -	message('Arm implementer: ' + implementer_config[0])
> > +	message('Arm implementer: ' + implementer_config['description'])
> >  	message('Arm part number: ' + part_number)
> >
> > +	part_number_config = implementer_config['part_number_config']
> > +	if part_number_config.has_key(part_number)
> > +		# use the specified part_number machine args if found
> > +		part_number_config = part_number_config[part_number]
> > +	elif not meson.is_cross_build()
> > +		# default to generic machine args if part_number is not found
> > +		# and not forcing native machine args
> > +		# but don't default in cross-builds; if part_number is specified
> > +		# incorrectly in a cross-file, it needs to be fixed there
> > +		part_number_config = part_number_config['generic']
> > +	else
> > +		# doing cross build and part number is not in
> > part_number_config
> > +		error('Cross build part number 0@0 not
> > found.'.format(part_number))
> > +	endif
> > +
> >  	# use default flags with implementer flags
> > -	dpdk_flags = flags_common_default + implementer_config[1]
> > +	dpdk_flags = flags_common_default + implementer_config['flags'] +
> > +part_number_config.get('flags', [])
> >
> > +	# apply supported machine args
> >  	machine_args = [] # Clear previous machine args
> > -	foreach marg: implementer_config[2]
> > -		if marg[0] == part_number
> > -			# apply supported machine args
> > -			foreach flag: marg[1]
> > -				if cc.has_argument(flag)
> > -					machine_args += flag
> > -				endif
> > -			endforeach
> > -			if marg.length() > 2
> > -				# add extra flags for the part
> > -				dpdk_flags += marg[2]
> > -			endif
> > +	foreach flag: part_number_config['machine_args']
> > +		if cc.has_argument(flag)
> > +			machine_args += flag
> >  		endif
> >  	endforeach
> >
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
  2020-11-08 20:19                 ` Honnappa Nagarahalli
@ 2020-11-09 10:52                   ` Juraj Linkeš
  2020-11-09 23:27                     ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-09 10:52 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Sunday, November 8, 2020 9:19 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 12/14] build: disable Arm drivers
> 
> <snip>
> 
> >
> > A few options that disabled drivers in the old makefiles were
> > improperly ported to the meson build system. Fix this by adding a to
> > the list of disabled
> The fixes need to be separated into a different commit as they need to be
> backported.
> It would be good to get the fix patch as the first patch, it will be easy to
> backport.
> 

Ok, I'll add support for disabling drivers for native and cross builds (that will be an independent easily portable change) and put the rest into a separate patch. That would be a compromise between v7 and v8.

> > drivers, similarly how the command line option works. Remove unneeded
> > driver options ported from the old makefile system.
> > Add support for removing drivers for cross builds.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  config/arm/arm64_armada_linux_gcc | 1 +
> > config/arm/arm64_armv8_linux_gcc  | 3 +++
> >  config/arm/meson.build            | 7 +++----
> >  drivers/meson.build               | 6 +++++-
> >  meson.build                       | 1 +
> >  5 files changed, 13 insertions(+), 5 deletions(-)
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/arm64_armada_linux_gcc
> > index 73945fbb4..7383f42e2 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -17,3 +17,4 @@ endian = 'little'
> >  implementer_id = '0x56'
> >  max_lcores = 16
> >  max_numa_nodes = 1
> > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > diff --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > index fb24be5fc..245e06e5f 100644
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ b/config/arm/arm64_armv8_linux_gcc
> > @@ -52,3 +52,6 @@ part_number = 'generic'
> >  # max_lcores = n      # will set RTE_MAX_LCORE
> >  max_lcores = 256
> >  max_numa_nodes = 4
> > +
> > +# disabled_drivers = ['bus/dpaa', 'crypto']
> > +    # add to the set of disabled libraries
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > e9bb60045..a39a35b6a 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -3,6 +3,9 @@
> >  # Copyright(c) 2017 Cavium, Inc
> >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> >
> > +# disable Arm drivers for all builds
> > +disabled_drivers += ['net/avp', 'net/fm10k']
> > +
> >  # common flags to all aarch64 builds, with lowest priority
> > flags_common_default = [
> >  	# Accelarate rte_memcpy. Be sure to run unit test
> > (memcpy_perf_autotest) @@ -17,9 +20,6 @@ flags_common_default = [
> >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> >
> > -	['RTE_NET_FM10K', false],
> > -	['RTE_NET_AVP', false],
> > -
> >  	['RTE_SCHED_VECTOR', false],
> >  	['RTE_ARM_USE_WFE', false],
> >  	['RTE_ARCH_ARM64', true],
> > @@ -124,7 +124,6 @@ implementers = {
> >  					['RTE_MACHINE', '"octeontx2"'],
> >  					['RTE_ARM_FEATURE_ATOMICS',
> > true],
> >  					['RTE_USE_C11_MEM_MODEL', true],
> > -					['RTE_EAL_IGB_UIO', false],
> Does this need to go to octeon tx2 cross file?
> 

Possibly.
Based on my understanding of the old makefile config (which could be wrong), I think there are two categories here:
1. drivers which were disabled because they weren't supported at all or just on that platform.
2. drivers which were explicitly disabled no matter the support.

If this is in category 1, we should investigate whether support was not added. If we don't know, it's better to disable it, in which case I'll put it to the cross file.

> >  					['RTE_MAX_LCORE', 36],
> >  					['RTE_MAX_NUMA_NODES', 1]
> >  				]
> > diff --git a/drivers/meson.build b/drivers/meson.build index
> > 4bb7e9218..a997387ad 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -18,9 +18,13 @@ subdirs = [
> >  	'baseband', # depends on common and bus.
> >  ]
> >
> > -disabled_drivers = run_command(list_dir_globs,
> > get_option('disable_drivers'),
> > +disabled_drivers += run_command(list_dir_globs,
> > +get_option('disable_drivers'),
> >  		).stdout().split()
> >
> > +if meson.is_cross_build()
> > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > +endif
> > +
> >  default_cflags = machine_args
> >  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags += ['-
> > DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build index
> > 61d9a4f5f..8dadd70dc 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -21,6 +21,7 @@ dpdk_drivers = []
> >  dpdk_extra_ldflags = []
> >  dpdk_libs_disabled = []
> >  dpdk_drvs_disabled = []
> > +disabled_drivers = []
> >  abi_version_file = files('ABI_VERSION')
> >
> >  if host_machine.cpu_family().startswith('x86')
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds
  2020-11-09  0:24                 ` Honnappa Nagarahalli
@ 2020-11-09 11:10                   ` Juraj Linkeš
  2020-11-09 23:29                     ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-09 11:10 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



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

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

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

Good catch. I'll fix this.

> > +endif
> > +if find_libnuma
> > +	numa_dep = cc.find_library('numa', required: false)
> > +	if numa_dep.found() and cc.has_header('numaif.h')
> > +		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> > +		has_libnuma = 1
> > +		add_project_link_arguments('-lnuma', language: 'c')
> > +		dpdk_extra_ldflags += '-lnuma'
> > +	endif
> >  endif
> >
> >  has_libfdt = 0
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option
  2020-11-09  2:40                 ` Honnappa Nagarahalli
@ 2020-11-09 11:45                   ` Juraj Linkeš
  2020-11-09 23:53                     ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-09 11:45 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Monday, November 9, 2020 3:40 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 14/14] build: add Arm SoC meson option
> 
> <snip>
> 
> >
> > Add Arm SoC configuration to Arm meson.build and add a meson option to
> > enable those options for native builds. This is preferable to
> > specifying a cross file when doing aarch64 -> aarch64 builds, since
> > the cross file specifies the toolchain as well.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/arm64_armada_linux_gcc      |   6 +-
> >  config/arm/arm64_armv8_linux_gcc       |  58 +++--------
> >  config/arm/arm64_bluefield_linux_gcc   |   6 +-
> >  config/arm/arm64_dpaa_linux_gcc        |   5 +-
> >  config/arm/arm64_emag_linux_gcc        |   5 +-
> >  config/arm/arm64_graviton2_linux_gcc   |   6 +-
> >  config/arm/arm64_n1sdp_linux_gcc       |   6 +-
> >  config/arm/arm64_octeontx2_linux_gcc   |   6 +-
> >  config/arm/arm64_stingray_linux_gcc    |   6 +-
> >  config/arm/arm64_thunderx2_linux_gcc   |   5 +-
> >  config/arm/arm64_thunderxt88_linux_gcc |   5 +-
> >  config/arm/meson.build                 | 132 ++++++++++++++++++++++++-
> >  meson_options.txt                      |   2 +
> >  13 files changed, 154 insertions(+), 94 deletions(-)
> >
> > diff --git a/config/arm/arm64_armada_linux_gcc
> > b/config/arm/arm64_armada_linux_gcc
> > index f5403f0a6..7cc40d1f4 100644
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -14,8 +14,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x56'
> > -max_lcores = 16
> > -max_numa_nodes = 1
> > -numa = false
> > -disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > +soc = 'armada'
> > diff --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > index 77e3d6278..d4cb6b5bf 100644
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ b/config/arm/arm64_armv8_linux_gcc
> > @@ -13,46 +13,18 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -# Supported implementers:
> > -# 'generic': Generic armv8
> > -# '0x41':    Arm
> > -# '0x43':    Cavium
> > -# '0x50':    Ampere Computing
> > -# '0x56':    Marvell ARMADA
> > -# 'dpaa':    NXP DPAA
> > -implementer_id = 'generic'
> > -
> > -# Supported part_numbers for generic:
> > -# 'generic': valid for all armv8-a architectures (unoptimized
> > portable build) - part_number = 'generic'
> > -
> > -# Supported part_numbers for 0x41, 0x56, dpaa:
> > -# '0xd03':   cortex-a53
> > -# '0xd04':   cortex-a35
> > -# '0xd05':   cortex-a55
> > -# '0xd07':   cortex-a57
> > -# '0xd08':   cortex-a72
> > -# '0xd09':   cortex-a73
> > -# '0xd0a':   cortex-a75
> > -# '0xd0b':   cortex-a76
> > -# '0xd0c':   neoverse-n1
> > -
> > -# Supported part_numbers for 0x43:
> > -# '0xa1':    thunderxt88
> > -# '0xa2':    thunderxt81
> > -# '0xa3':    thunderxt83
> > -# '0xaf':    thunderx2t99
> > -# '0xb2':    octeontx2
> > -
> > -# Supported part_numbers for 0x50:
> > -# '0x0':     emag
> > -
> > -# Supported extra configuration
> > -# max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
> > -# max_lcores = n      # will set RTE_MAX_LCORE
> > -max_lcores = 256
> > -max_numa_nodes = 4
> > -
> > -# numa = false        # set to false if the target is not a NUMA system
> > -# disabled_drivers = ['bus/dpaa', 'crypto']
> > -    # add to the set of disabled libraries
> > +# Supported SoCs:
> > +# generic
> > +# armada
> > +# bluefield
> > +# dpaa
> > +# emag
> > +# graviton2
> > +# n1sdp
> > +# octeontx2
> > +# stingray
> > +# thunderx2
> > +# thunderxt88
> > +# thunderx2t99
> We can remove the comments here. This list needs to be documented.
> 

Yea, makes sense.

> > +
> > +soc = 'generic'
> > diff --git a/config/arm/arm64_bluefield_linux_gcc
> > b/config/arm/arm64_bluefield_linux_gcc
> > index 6bef87fbd..7b1fae8b9 100644
> > --- a/config/arm/arm64_bluefield_linux_gcc
> > +++ b/config/arm/arm64_bluefield_linux_gcc
> > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x41'
> > -part_number = '0xd08'
> > -max_lcores = 16
> > -max_numa_nodes = 1
> > -numa = false
> > +soc = 'bluefield'
> > diff --git a/config/arm/arm64_dpaa_linux_gcc
> > b/config/arm/arm64_dpaa_linux_gcc index 3458b9d7b..e52188842 100644
> > --- a/config/arm/arm64_dpaa_linux_gcc
> > +++ b/config/arm/arm64_dpaa_linux_gcc
> > @@ -14,7 +14,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = 'dpaa'
> > -max_lcores = 16
> > -max_numa_nodes = 1
> > -numa = false
> > +soc = 'dpaa'
> > diff --git a/config/arm/arm64_emag_linux_gcc
> > b/config/arm/arm64_emag_linux_gcc index 7cbb05510..6c24b4bca 100644
> > --- a/config/arm/arm64_emag_linux_gcc
> > +++ b/config/arm/arm64_emag_linux_gcc
> > @@ -13,7 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x50'
> > -part_number = '0x0'
> > -max_lcores = 32
> > -max_numa_nodes = 1
> > +soc = 'emag'
> > diff --git a/config/arm/arm64_graviton2_linux_gcc
> > b/config/arm/arm64_graviton2_linux_gcc
> > index cfe239797..bae35d6be 100644
> > --- a/config/arm/arm64_graviton2_linux_gcc
> > +++ b/config/arm/arm64_graviton2_linux_gcc
> > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementor_id = '0x41'
> > -implementor_pn = '0xd0c'
> > -max_lcores = 64
> > -max_numa_nodes = 1
> > -numa = false
> > +soc = 'graviton2'
> > diff --git a/config/arm/arm64_n1sdp_linux_gcc
> > b/config/arm/arm64_n1sdp_linux_gcc
> > index b00f2d1ef..249ff4738 100644
> > --- a/config/arm/arm64_n1sdp_linux_gcc
> > +++ b/config/arm/arm64_n1sdp_linux_gcc
> > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x41'
> > -part_number = '0xd0c'
> > -max_lcores = 4
> > -max_numa_nodes = 1
> > -numa = false
> > +soc = 'n1sdp'
> > diff --git a/config/arm/arm64_octeontx2_linux_gcc
> > b/config/arm/arm64_octeontx2_linux_gcc
> > index 593769709..063018e8f 100644
> > --- a/config/arm/arm64_octeontx2_linux_gcc
> > +++ b/config/arm/arm64_octeontx2_linux_gcc
> > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x43'
> > -part_number = '0xb2'
> > -max_lcores = 36
> > -max_numa_nodes = 1
> > -numa = false
> > +soc = 'octeontx2'
> > diff --git a/config/arm/arm64_stingray_linux_gcc
> > b/config/arm/arm64_stingray_linux_gcc
> > index 6bef87fbd..1209a8c0b 100644
> > --- a/config/arm/arm64_stingray_linux_gcc
> > +++ b/config/arm/arm64_stingray_linux_gcc
> > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x41'
> > -part_number = '0xd08'
> > -max_lcores = 16
> > -max_numa_nodes = 1
> > -numa = false
> > +soc = 'stingray'
> > diff --git a/config/arm/arm64_thunderx2_linux_gcc
> > b/config/arm/arm64_thunderx2_linux_gcc
> > index c06dcdc2b..348650712 100644
> > --- a/config/arm/arm64_thunderx2_linux_gcc
> > +++ b/config/arm/arm64_thunderx2_linux_gcc
> > @@ -13,7 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x43'
> > -part_number = '0xaf'
> > -max_lcores = 256
> > -max_numa_nodes = 2
> > +soc = 'thunderx2'
> > diff --git a/config/arm/arm64_thunderxt88_linux_gcc
> > b/config/arm/arm64_thunderxt88_linux_gcc
> > index 3ba1528e4..d31d0c6d8 100644
> > --- a/config/arm/arm64_thunderxt88_linux_gcc
> > +++ b/config/arm/arm64_thunderxt88_linux_gcc
> > @@ -13,7 +13,4 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > -implementer_id = '0x43'
> > -part_number = '0xa1'
> > -max_lcores = 96
> > -max_numa_nodes = 1
> > +soc = 'thunderxt88'
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 52274c0c5..cd270f84b 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -57,7 +57,7 @@ part_number_config_arm = {  ## Part numbers are
> > specific to Arm implementers  # implementer specific aarch64 flags
> > have middle priority
> >  #     (will overwrite common flags)
> > -# part number specific aarch64 flags have the highest priority
> > +# part number specific aarch64 flags have higher priority
> >  #     (will overwrite both common and implementer specific flags)
> >  implementers = {
> >  	'generic': {
> > @@ -164,6 +164,102 @@ implementers = {
> >  	}
> >  }
> >
> > +# soc specific aarch64 flags have the highest priority
> > +#     (will overwrite all other flags)
> > +socs = {
> Too big to maintain
> 

I don't have great alternate solutions that would work:
1. Possibly adding 'soc' under machine specific configuration. That would result in terrible code (O(N)) which would have to go through all implementer/part numbers to find the soc configuration.
2. Move the config from this dict to machine specific configuration as in 1, but also keep the backwards mapping of soc->(implementer, part_number). That way we'll have sane code which just does dict lookups (O(log N), much better).

Actually, the second option doesn't look that bad. We'll end up with extra mapping like this:

'bluefield': {'implementer': '0x41', 'part_number': '0xd08'}

This would be in the soc dict and then the extra soc configuration in part number config.

NOTE: some socs have the same flags as their corresponsing part number flags (actually all of them except n1sdp). Do we want to make soc flags optional or do we want them to be speficied even when they won't change the config?

> > +	'generic': {
> > +		'implementer': 'generic',
> > +		'part_number': 'generic',
> > +		'flags': []
> > +	},
> > +	'armada': {
> > +		'implementer': '0x56',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 16],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'numa': false,
> > +		'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > +	},
> > +	'bluefield': {
> > +		'implementer': '0x41',
> > +		'part_number': '0xd08',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 16],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'numa': false
> > +	},
> > +	'dpaa': {
> > +		'implementer': 'dpaa',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 16],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'numa': false
> > +	},
> > +	'emag': {
> > +		'implementer': '0x50',
> > +		'part_number': '0x0',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 32],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		]
> > +	},
> > +	'graviton2': {
> > +		'implementer': '0x41',
> > +		'part_number': '0xd0c',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 64],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'numa': false
> > +	},
> > +	'n1sdp': {
> > +		'implementer': '0x41',
> > +		'part_number': '0xd0c',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 4],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'numa': false
> > +	},
> > +	'octeontx2': {
> > +		'implementer': '0x43',
> > +		'part_number': '0xb2',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 32],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'numa': false
> > +	},
> > +	'stingray': {
> > +		'implementer': '0x41',
> > +		'part_number': '0xd08',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 16],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		],
> > +		'numa': false
> > +	},
> > +	'thunderx2': {
> > +		'implementer': '0x43',
> > +		'part_number': '0xaf',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 256],
> > +			['RTE_MAX_NUMA_NODES', 2]
> > +		]
> > +	},
> > +	'thunderxt88': {
> > +		'implementer': '0x43',
> > +		'part_number': '0xa1',
> > +		'flags': [
> > +			['RTE_MAX_LCORE', 96],
> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		]
> > +	}
> > +}
> > +
> >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> >
> > @@ -176,11 +272,18 @@ if dpdk_conf.get('RTE_ARCH_32')  else
> >  	# aarch64 build
> >  	use_native_machine_args = false
> > +	arm_soc = get_option('arm_soc')
> > +	soc_config = {}
> >  	if not meson.is_cross_build()
> >  		if machine == 'generic'
> >  			# generic build
> > +			if arm_soc != ''
> > +				error('Arm SoC is unsupported with generic
> > build.')
> > +			endif
> >  			implementer_id = 'generic'
> >  			part_number = 'generic'
> > +		elif arm_soc != ''
> > +			soc_config = socs.get(arm_soc, {'not_supported':
> > true})
> >  		else
> >  			# native build
> >  			# The script returns ['Implementer', 'Variant',
> 'Architecture', @@
> > -199,8 +302,27 @@ else
> >  		endif
> >  	else
> >  		# cross build
> > -		implementer_id =
> > meson.get_cross_property('implementer_id')
> > -		part_number = meson.get_cross_property('part_number')
> > +		arm_soc = meson.get_cross_property('soc', '')
> > +		if arm_soc == ''
> > +			error('Arm SoC must be specified in the cross file.')
> > +		endif
> > +		soc_config = socs.get(arm_soc, {'not_supported': true})
> > +	endif
> > +
> > +	soc_flags = []
> > +	if soc_config.has_key('not_supported')
> > +		error('SoC @0@ not supported.'.format(arm_soc))
> > +	elif soc_config != {}
> > +		implementer_id = soc_config['implementer']
> > +		implementer_config = implementers[implementer_id]
> > +		part_number = soc_config['part_number']
> > +		soc_flags = soc_config['flags']
> > +		if not soc_config.get('numa', true)
> > +			has_libnuma = 0
> > +		endif
> > +		if soc_config.has_key('disabled_drivers')
> > +			disabled_drivers += soc_config['disabled_drivers']
> > +		endif
> >  	endif
> >
> >  	if implementers.has_key(implementer_id)
> > @@ -226,8 +348,8 @@ else
> >  		      '(-Dmachine=generic) build.')
> >  	endif
> >
> > -	# use default flags with implementer flags
> > -	dpdk_flags = flags_common_default + implementer_config['flags'] +
> > part_number_config.get('flags', [])
> > +	# add flags in the proper order
> > +	dpdk_flags = flags_common_default + implementer_config['flags'] +
> > +part_number_config.get('flags', []) + soc_flags
> >
> >  	# apply supported machine args
> >  	machine_args = [] # Clear previous machine args diff --git
> > a/meson_options.txt b/meson_options.txt index e1059fb16..33b8b236c
> > 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -1,5 +1,7 @@
> >  # Please keep these options sorted alphabetically.
> >
> > +option('arm_soc', type: 'string', value: '',
> > +	description: 'Specify if you want to build for a particular Arm SoC
> > +when building on an aarch64 machine.')
> Kind of indicates that it is a cross build.

What do you mean by cross build in this context? It's not a meson cross build, since it doesn't mention cross files, so I don't think you meant that. Aside from that, how does building on an aarch64 machine for aarch64 target indicate a cross build? I guess it says Arm SoC, so it could be a aarch64 -> armv7 cross build? Then I could change it to "a particular aarch64 Arm SoC".

> How about: "Build natively for the specified Arm SoC"?
> 

I specifically didn't want to use the word native here because arm native build implies ['-march=native', '-mtune=native'], which won't be used in soc builds. Also, this wording assumes an aarch64 build machine, which is likely a safe assumption, but I wanted to avoid the assumption and spell it out.

> >  option('armv8_crypto_dir', type: 'string', value: '',
> >  	description: 'path to the armv8_crypto library installation
> > directory') option('disable_drivers', type: 'string', value: '',
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic
  2020-11-06 23:52                 ` Honnappa Nagarahalli
@ 2020-11-09 12:12                   ` Juraj Linkeš
  2020-11-09 12:47                     ` Bruce Richardson
  2020-11-09 22:54                     ` Honnappa Nagarahalli
  0 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-09 12:12 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Saturday, November 7, 2020 12:53 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 01/14] build: alias default build as generic
> 
> <snip>
> 
> >
> > The current machine='default' build name is not descriptive. The
> > actual default build is machine='native'. Add an alternative string
> > which does the same build and better describes what we're building:
> > machine='generic'. Leave machine='default' for backwards compatibility.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  config/arm/meson.build                    | 5 +++--
> >  config/meson.build                        | 9 +++++----
> >  doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
> >  meson_options.txt                         | 2 +-
> >  4 files changed, 11 insertions(+), 9 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 42b4e43c7..d4066ade8 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -1,12 +1,13 @@
> >  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2017 Intel
> > Corporation.
> >  # Copyright(c) 2017 Cavium, Inc
> > +# Copyright(c) 2020 PANTHEON.tech s.r.o.
> >
> >  # for checking defines we need to use the correct compiler flags
> > march_opt =
> > '-march=@0@'.format(machine)
> >
> >  arm_force_native_march = false
> > -arm_force_default_march = (machine == 'default')
> > +arm_force_generic_march = (machine == 'generic')
> >
> >  flags_common_default = [
> >  	# Accelarate rte_memcpy. Be sure to run unit test
> > (memcpy_perf_autotest) @@ -148,7 +149,7 @@ else
> >  	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()
> > +	if arm_force_generic_march and not meson.is_cross_build()
> >  		machine = impl_generic
> >  		impl_pn = 'default'
> >  	elif not meson.is_cross_build()
> > diff --git a/config/meson.build b/config/meson.build index
> > 258b01d06..c7f7aa6e2 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -68,13 +68,14 @@ else
> >  	machine = get_option('machine')
> >  endif
> >
> > -# machine type 'default' is special, it defaults to the per arch
> > agreed common -# minimal baseline needed for DPDK.
> > +# machine type 'generic' is special, it defaults to the per arch
> > +agreed common # minimal baseline needed for DPDK. Machine type
> > +'default' is also supported # with the same meaning for backwards
> compatibility.
> >  # That might not be the most optimized, but the most portable version
> > while # still being able to support the CPU features required for DPDK.
> >  # This can be bumped up by the DPDK project, but it can never be an
> > # invariant like 'native'
> > -if machine == 'default'
> > +if machine == 'default' or machine == 'generic'
> >  	if host_machine.cpu_family().startswith('x86')
> >  		# matches the old pre-meson build systems default
> >  		machine = 'corei7'
> > @@ -82,7 +83,7 @@ if machine == 'default'
> >  		machine = 'armv7-a'
> >  	elif host_machine.cpu_family().startswith('aarch')
> >  		# arm64 manages defaults in config/arm/meson.build
> > -		machine = 'default'
> > +		machine = 'generic'
> >  	elif host_machine.cpu_family().startswith('ppc')
> >  		machine = 'power8'
> >  	endif
> > diff --git a/doc/guides/prog_guide/build-sdk-meson.rst
> > b/doc/guides/prog_guide/build-sdk-meson.rst
> > index 3429e2647..c7e12eedf 100644
> > --- a/doc/guides/prog_guide/build-sdk-meson.rst
> > +++ b/doc/guides/prog_guide/build-sdk-meson.rst
> > @@ -85,7 +85,7 @@ Project-specific options are passed used -
> > Doption=value::
> >
> >  	meson -Denable_docs=true fullbuild  # build and install docs
> >
> > -	meson -Dmachine=default  # use builder-independent baseline -
> > march
> > +	meson -Dmachine=generic  # use builder-independent baseline -
> > march
> >
> >  	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
> >  					# eventdev PMDs for a smaller build
> @@ -114,7 +114,7 @@ Examples
> > of setting some of the same options using meson configure::
> >          re-scan from meson.
> >
> >  .. note::
> > -        machine=default uses a config that works on all supported architectures
> > +        machine=generic uses a config that works on all supported
> > + architectures
> >          regardless of the capabilities of the machine where the build
> > is happening.
> >
> >  As well as those settings taken from ``meson configure``, other
> > options diff -- git a/meson_options.txt b/meson_options.txt index
> > 9bf18ab6b..ce23289e3
> > 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
> > option('lib_musdk_dir', type: 'string', value: '',
> >  	description: 'path to the MUSDK library installation directory')
> > option('machine', type: 'string', value: 'native',
> > -	description: 'set the target machine type')
> > +	description: 'set the target machine type. Set to generic for a
> > +build usable on most machines of the build machine architecture, set
> > +to
>                         ^^^^ all

I don't think we've settled this with Bruce. According to him, the build with "machine=generic" on x86 won't necessarily produce a build usable on all machines, so I went with most machines.

> > +native to let the compiler choose the best fit for the build
> > +machine.')
> How about: native to let the compiler choose the attributes of the build machine
> 

I haven't looked at what the docs before, so now here's what GCC docs say: https://gcc.gnu.org/onlinedocs/gcc-8.4.0/gcc/AArch64-Options.html#AArch64-Options:
The value ‘native’ is available on native AArch64 GNU/Linux and causes the compiler to pick the architecture of the host system.

Best fit is kinda vague and choosing the attibutes is probably not using the right verb (it's always going to use the same subset of attributes of the build machine in question, so it's not really a choice), I like use the attributes more.

So it would be either "use the attributes of the build machine" or "pick the architecture of the build machine" (I've changed host system to build machine to match meson language). Both look fine to be, but I'm always inclined to use wording from documentation, even if it's from one compiler. Which one do you like more?

> Otherwise, it looks good to me.
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> 
> >  option('max_ethports', type: 'integer', value: 32,
> >  	description: 'maximum number of Ethernet devices')
> > option('max_lcores', type: 'integer', value: 128,
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic
  2020-11-09 12:12                   ` Juraj Linkeš
@ 2020-11-09 12:47                     ` Bruce Richardson
  2020-11-09 22:54                     ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-09 12:47 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Honnappa Nagarahalli, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole, dev, nd

On Mon, Nov 09, 2020 at 12:12:48PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Sent: Saturday, November 7, 2020 12:53 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> > Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> > vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > ferruh.yigit@intel.com; aconole@redhat.com
> > Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > Subject: RE: [PATCH v8 01/14] build: alias default build as generic
> > 
> > <snip>
> > 
> > >
> > > The current machine='default' build name is not descriptive. The
> > > actual default build is machine='native'. Add an alternative string
> > > which does the same build and better describes what we're building:
> > > machine='generic'. Leave machine='default' for backwards compatibility.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/meson.build                    | 5 +++--
> > >  config/meson.build                        | 9 +++++----
> > >  doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
> > >  meson_options.txt                         | 2 +-
> > >  4 files changed, 11 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 42b4e43c7..d4066ade8 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -1,12 +1,13 @@
> > >  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2017 Intel
> > > Corporation.
> > >  # Copyright(c) 2017 Cavium, Inc
> > > +# Copyright(c) 2020 PANTHEON.tech s.r.o.
> > >
> > >  # for checking defines we need to use the correct compiler flags
> > > march_opt =
> > > '-march=@0@'.format(machine)
> > >
> > >  arm_force_native_march = false
> > > -arm_force_default_march = (machine == 'default')
> > > +arm_force_generic_march = (machine == 'generic')
> > >
> > >  flags_common_default = [
> > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > (memcpy_perf_autotest) @@ -148,7 +149,7 @@ else
> > >  	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()
> > > +	if arm_force_generic_march and not meson.is_cross_build()
> > >  		machine = impl_generic
> > >  		impl_pn = 'default'
> > >  	elif not meson.is_cross_build()
> > > diff --git a/config/meson.build b/config/meson.build index
> > > 258b01d06..c7f7aa6e2 100644
> > > --- a/config/meson.build
> > > +++ b/config/meson.build
> > > @@ -68,13 +68,14 @@ else
> > >  	machine = get_option('machine')
> > >  endif
> > >
> > > -# machine type 'default' is special, it defaults to the per arch
> > > agreed common -# minimal baseline needed for DPDK.
> > > +# machine type 'generic' is special, it defaults to the per arch
> > > +agreed common # minimal baseline needed for DPDK. Machine type
> > > +'default' is also supported # with the same meaning for backwards
> > compatibility.
> > >  # That might not be the most optimized, but the most portable version
> > > while # still being able to support the CPU features required for DPDK.
> > >  # This can be bumped up by the DPDK project, but it can never be an
> > > # invariant like 'native'
> > > -if machine == 'default'
> > > +if machine == 'default' or machine == 'generic'
> > >  	if host_machine.cpu_family().startswith('x86')
> > >  		# matches the old pre-meson build systems default
> > >  		machine = 'corei7'
> > > @@ -82,7 +83,7 @@ if machine == 'default'
> > >  		machine = 'armv7-a'
> > >  	elif host_machine.cpu_family().startswith('aarch')
> > >  		# arm64 manages defaults in config/arm/meson.build
> > > -		machine = 'default'
> > > +		machine = 'generic'
> > >  	elif host_machine.cpu_family().startswith('ppc')
> > >  		machine = 'power8'
> > >  	endif
> > > diff --git a/doc/guides/prog_guide/build-sdk-meson.rst
> > > b/doc/guides/prog_guide/build-sdk-meson.rst
> > > index 3429e2647..c7e12eedf 100644
> > > --- a/doc/guides/prog_guide/build-sdk-meson.rst
> > > +++ b/doc/guides/prog_guide/build-sdk-meson.rst
> > > @@ -85,7 +85,7 @@ Project-specific options are passed used -
> > > Doption=value::
> > >
> > >  	meson -Denable_docs=true fullbuild  # build and install docs
> > >
> > > -	meson -Dmachine=default  # use builder-independent baseline -
> > > march
> > > +	meson -Dmachine=generic  # use builder-independent baseline -
> > > march
> > >
> > >  	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
> > >  					# eventdev PMDs for a smaller build
> > @@ -114,7 +114,7 @@ Examples
> > > of setting some of the same options using meson configure::
> > >          re-scan from meson.
> > >
> > >  .. note::
> > > -        machine=default uses a config that works on all supported architectures
> > > +        machine=generic uses a config that works on all supported
> > > + architectures
> > >          regardless of the capabilities of the machine where the build
> > > is happening.
> > >
> > >  As well as those settings taken from ``meson configure``, other
> > > options diff -- git a/meson_options.txt b/meson_options.txt index
> > > 9bf18ab6b..ce23289e3
> > > 100644
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > @@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
> > > option('lib_musdk_dir', type: 'string', value: '',
> > >  	description: 'path to the MUSDK library installation directory')
> > > option('machine', type: 'string', value: 'native',
> > > -	description: 'set the target machine type')
> > > +	description: 'set the target machine type. Set to generic for a
> > > +build usable on most machines of the build machine architecture, set
> > > +to
> >                         ^^^^ all
> 
> I don't think we've settled this with Bruce. According to him, the build with "machine=generic" on x86 won't necessarily produce a build usable on all machines, so I went with most machines.
> 
It will produce a build that works on all supported machines, so I think
"all" is probably ok to use.

/Bruce

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

* Re: [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments
  2020-11-08  2:51                 ` Honnappa Nagarahalli
@ 2020-11-09 12:48                   ` Juraj Linkeš
  2020-11-10  0:02                     ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-09 12:48 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Sunday, November 8, 2020 3:51 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 04/14] build: reformat and move Arm config and
> comments
> 
> <snip>
> 
> >
> > Change formatting so that it's more consistent and readable,
> > add/modify comments/stdout messages, move configuration options to
> > more appropriate places and make the order consistent according to these
> rules:
> > 1. First list generic configuration options, then list options that may
> >    be overwritten. List SoC-specific options last.
> > 2. For SoC-specific options, list number of cores before the number of
> >    NUMA nodes, to make it consistent with config/meson.build.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Few nits, otherwise, looks good.
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> 
> > ---
> >  config/arm/arm64_armv8_linux_gcc | 21 ++++++-
> >  config/arm/meson.build           | 94 +++++++++++++++++++-------------
> >  2 files changed, 77 insertions(+), 38 deletions(-)
> >
> > diff --git a/config/arm/arm64_armv8_linux_gcc
> > b/config/arm/arm64_armv8_linux_gcc
> > index 13ee8b223..04cd82ba9 100644
> > --- a/config/arm/arm64_armv8_linux_gcc
> > +++ b/config/arm/arm64_armv8_linux_gcc
> > @@ -13,9 +13,16 @@ cpu = 'armv8-a'
> >  endian = 'little'
> >
> >  [properties]
> > +# Supported implementers:
> > +# 'generic': Generic armv8
> > +# '0x41':    Arm
> > +# '0x43':    Cavium
> > +# '0x50':    Ampere Computing
> > +# '0x56':    Marvell ARMADA
> > +# 'dpaa':    NXP DPAA
> I do think the comments add much value here and they are not relevant too (as
> this is a cross build file for a generic build). They are captured in
> config/arm/meson.build already.
> 

Judging from the previous explanatory comments, this file was also serving as an example cross file explaining the supported values, so I expanded that, because I like the concept of an example cross file. In my opinion, the comments actually do add a bit in that the user doesn't have to extract the supported values from code.
But, as mentioned in one of the other threads, we should move this to docs, so I'll remove the comments.

> Instead, would be good to add something like "Generate binaries that are
> portable across all Armv8 machines"
> 

At first I though about the inconsistency this comment would introduce, but I think it's fine, since generic is a special build and having an explanation of this build only is welcome.

> >  implementer_id = 'generic'
> >
> > -# Valid options for Arm's part_number:
> > +# Supported part_numbers for generic, 0x41, 0x56, dpaa:
> >  # 'generic': valid for all armv8-a architectures (default value)
> >  # '0xd03':   cortex-a53
> >  # '0xd04':   cortex-a35
> > @@ -25,4 +32,16 @@ implementer_id = 'generic'
> >  # '0xd09':   cortex-a73
> >  # '0xd0a':   cortex-a75
> >  # '0xd0b':   cortex-a76
> > +# '0xd0c':   neoverse-n1
> >  part_number = 'generic'
> > +
> > +# Supported part_numbers for 0x43:
> > +# 'generic': valid for all Cavium builds
> > +# '0xa1':    thunderxt88
> > +# '0xa2':    thunderxt81
> > +# '0xa3':    thunderxt83
> > +# '0xaf':    thunderx2t99
> > +# '0xb2':    octeontx2
> Same here. It would be good to remove the existing comments as well.
> 
> > +
> > +# Supported part_numbers for 0x50:
> > +# 'generic': valid for all Ampere builds
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 7c7059cc2..5b922ef9c 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -5,6 +5,7 @@
> >
> >  arm_force_native_march = false
> >
> > +# common flags to all aarch64 builds, with lowest priority
> >  flags_common_default = [
> >  	# Accelarate rte_memcpy. Be sure to run unit test
> > (memcpy_perf_autotest)
> >  	# to determine the best threshold in code. Refer to notes in source
> > file @@ -12,8 +13,8 @@ flags_common_default = [
> >  	['RTE_ARCH_ARM64_MEMCPY', false],
> >  	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
> >  	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
> > -	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> > unless there're
> > -	# strong reasons.
> > +	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
> > +	# unless there are strong reasons.
> >  	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
> >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > @@ -23,69 +24,86 @@ flags_common_default = [
> >
> >  	['RTE_SCHED_VECTOR', false],
> >  	['RTE_ARM_USE_WFE', false],
> > +	['RTE_ARCH_ARM64', true],
> > +	['RTE_CACHE_LINE_SIZE', 128]
> >  ]
> >
> > +# implementer specific aarch64 flags, with middle priority # (will
> Nit                                          ^^^^^^^ can be removed
> 
> > +overwrite common flags)
> >  flags_implementer_generic = [
> >  	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_MAX_LCORE', 256],
> >  	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 128]]
> > +	['RTE_CACHE_LINE_SIZE', 128],
> > +	['RTE_MAX_LCORE', 256]
> > +]
> 
> <snip>
> 
> >  flags_implementer_armada = [
> >  	['RTE_MACHINE', '"armv8a"'],
> >  	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_NUMA_NODES', 1],
> > -	['RTE_MAX_LCORE', 16]]
> > +	['RTE_MAX_LCORE', 16],
> > +	['RTE_MAX_NUMA_NODES', 1]
> > +]
> >
> > +# part number specific aarch64 flags, with highest priority # (will
> Nit                                         ^^^^^^^ can be removed
> 

I added the aarch64 specifier since we're also defining armv7 build in this file, however briefly. I thought Implementer ID and part number also exist on armv7, is that not right? I wanted to make it explicit that these flags would only be used for aarch64 builds, but I guess it's implicit enough.

> > +overwrite both common and implementer specific flags)
> >  flags_part_number_thunderx = [
> >  	['RTE_MACHINE', '"thunderx"'],
> > -	['RTE_USE_C11_MEM_MODEL', false]]
> > +	['RTE_USE_C11_MEM_MODEL', false]
> > +]
> 
> <snip>
> 
> >  flags_part_number_n1generic = [
> >  	['RTE_MACHINE', '"neoverse-n1"'],
> > -	['RTE_MAX_LCORE', 64],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> >  	['RTE_ARM_FEATURE_ATOMICS', true],
> >  	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_MAX_MEM_MB', 1048576],
> > -	['RTE_MAX_NUMA_NODES', 1],
> >  	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > -	['RTE_LIBRTE_VHOST_NUMA', false]]
> > +	['RTE_LIBRTE_VHOST_NUMA', false],
> > +	['RTE_MAX_MEM_MB', 1048576],
> > +	['RTE_CACHE_LINE_SIZE', 64],
> > +	['RTE_MAX_LCORE', 64],
> > +	['RTE_MAX_NUMA_NODES', 1]
> > +]
> >
> > +# arm config (implementer 0x41) is the default config
> I do not understand this comment. What does 'default' config mean? Are you
> referring to 'generic' config?
> 

I am using the dictionary definition - use the config when no other alternative is found. We're using part_number_config_arm in four places, implementers generic, 0x41, 0x56, dpaa. For 0x41, it's the actual config, the other implementers default to it since we don't have specific config for them.

> >  part_number_config_arm = [
> >  	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> >  	['native', ['-march=native']],
> > @@ -96,8 +114,8 @@ part_number_config_arm = [
> >  	['0xd09', ['-mcpu=cortex-a73']],
> >  	['0xd0a', ['-mcpu=cortex-a75']],
> >  	['0xd0b', ['-mcpu=cortex-a76']],
> > -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> > flags_part_number_n1generic]]
> > -
> > +	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> > +flags_part_number_n1generic] ]
> >  part_number_config_cavium = [
> >  	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> >  	['native', ['-march=native']],
> > @@ -105,13 +123,14 @@ part_number_config_cavium = [
> >  	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> >  	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> >  	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > flags_part_number_thunderx2],
> > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > flags_part_number_octeontx2]]
> > -
> > +	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > +flags_part_number_octeontx2] ]
> >  part_number_config_emag = [
> >  	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > -	['native', ['-march=native']]]
> > +	['native', ['-march=native']]
> > +]
> >
> > -## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > G7-5321)
> > +## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
> >  implementer_generic = ['Generic armv8', flags_implementer_generic,
> > part_number_config_arm]
> >  implementer_0x41 = ['Arm', flags_implementer_arm,
> > part_number_config_arm]
> >  implementer_0x43 = ['Cavium', flags_implementer_cavium,
> > part_number_config_cavium] @@ -123,21 +142,21 @@
> > dpdk_conf.set('RTE_ARCH_ARM', 1)
> > dpdk_conf.set('RTE_FORCE_INTRINSICS',
> > 1)
> >
> >  if dpdk_conf.get('RTE_ARCH_32')
> > +	# armv7 build
> >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > -
> > +	# aarch64 build
> >  	implementer_id = 'generic'
> >  	machine_args = [] # Clear previous machine args
> >  	if machine == 'generic' and not meson.is_cross_build()
> > +		# generic build
> >  		implementer_config = implementer_generic
> >  		part_number = 'generic'
> >  	elif not meson.is_cross_build()
> > +		# native build
> >  		# The script returns ['Implementer', 'Variant', 'Architecture',
> >  		# 'Primary Part number', 'Revision']
> >  		detect_vendor = find_program(join_paths( @@ -158,6 +177,7
> @@ else
> >  			part_number = 'native'
> >  		endif
> >  	else
> > +		# cross build
> >  		implementer_id =
> > meson.get_cross_property('implementer_id', 'generic')
> >  		part_number = meson.get_cross_property('part_number',
> > 'generic')
> >  		implementer_config = get_variable('implementer_' +
> > implementer_id) @@ -194,7 +214,7 @@ else
> >  		endif
> >  	endforeach
> >  endif
> > -message(machine_args)
> > +message('Using machine args: @0@'.format(machine_args))
> >
> >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> >      cc.get_define('__aarch64__', args: machine_args) != '')
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 10/14] build: optional NUMA and cpu counts detection
  2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 10/14] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-09 22:52                 ` Honnappa Nagarahalli
  2020-11-10  8:30                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09 22:52 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Add an option to automatically discover the host's numa and cpu counts and
> use those values for a non cross-build.
> Give users the option to override the per-arch default values or values from
> cross files by specifying them on the command line with -Dmax_lcores and -
> Dmax_numa_nodes.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Few nits, otherwise looks fine
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  buildtools/get_cpu_count.py  |  7 ++++++  buildtools/get_numa_count.py |
> 22 +++++++++++++++++
>  buildtools/meson.build       |  2 ++
>  config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
>  config/x86/meson.build       |  2 ++
>  meson_options.txt            |  8 +++---
>  6 files changed, 82 insertions(+), 6 deletions(-)  create mode 100644
> buildtools/get_cpu_count.py  create mode 100644
> buildtools/get_numa_count.py
> 
> diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py new
> file mode 100644 index 000000000..b269d557b
> --- /dev/null
> +++ b/buildtools/get_cpu_count.py
> @@ -0,0 +1,7 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> +PANTHEON.tech s.r.o.
> +
> +import os
> +
> +print(os.cpu_count())
> diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
> new file mode 100644 index 000000000..be73c5c3f
> --- /dev/null
> +++ b/buildtools/get_numa_count.py
> @@ -0,0 +1,22 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> +PANTHEON.tech s.r.o.
> +
> +import ctypes
> +import glob
> +import os
> +import subprocess
> +
> +if os.name == 'posix':
> +    if os.path.isdir('/sys/devices/system/node'):
> +        print(len(glob.glob('/sys/devices/system/node/node*')))
> +    else:
> +        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
> +
> +elif os.name == 'nt':
> +    libkernel32 = ctypes.windll.kernel32
> +
> +    count = ctypes.c_ulong()
> +
> +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> +    print(count.value + 1)
> diff --git a/buildtools/meson.build b/buildtools/meson.build index
> 04808dabc..925e733b1 100644
> --- a/buildtools/meson.build
> +++ b/buildtools/meson.build
> @@ -17,3 +17,5 @@ else
>  endif
>  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> files('call-sphinx-build.py')
> +get_cpu_count_cmd = py3 + files('get_cpu_count.py') get_numa_count_cmd
> += py3 + files('get_numa_count.py')
> diff --git a/config/meson.build b/config/meson.build index
> c7f7aa6e2..2974f7f6f 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -231,8 +231,6 @@ foreach arg: warning_flags  endforeach
> 
>  # set other values pulled from the build options -
> dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores')) -
> dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@
> -251,6 +249,51 @@ compile_time_cpuflags = []
>  subdir(arch_subdir)
>  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> ','.join(compile_time_cpuflags))
> 
> +max_lcores = get_option('max_lcores')
> +if max_lcores > 0
> +	# Overwrite the default value from arch_subdir with user input
> +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores) elif max_lcores == -1
> +	# Overwrite the default value with discovered values
> +	if meson.is_cross_build()
> +		error('Discovered values (user setting -1) are not supported
> be used when cross-compiling.')
Suggest something like:
'Discovery of max_lcore value not supported for cross-compilation'

> +	endif
> +	# Discovery makes sense only for non-cross builds
> +	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
> +	min_lcores = 2
> +	# DPDK must be build for at least 2 cores
> +	if max_lcores < min_lcores
> +		message('Found less than @0@ cores, building for @0@
> cores'.format(min_lcores))
> +		max_lcores = min_lcores
> +	else
> +		message('Found @0@ cores'.format(max_lcores))
> +	endif
> +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores) endif
> +
> +max_numa_nodes = get_option('max_numa_nodes') if max_numa_nodes >
> 0
> +	# Overwrite the default value from arch_subdir with user input
> +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) elif
> +max_numa_nodes == -1
> +	# Overwrite the default value with discovered values
> +	if meson.is_cross_build()
> +		error('Discovered values (user setting -1) are not supported
> be used when cross-compiling.')
Suggest something like:
'Discovery of max_numa_nodes value not supported for cross-compilation'

> +	endif
> +	# Discovery makes sense only for non-cross builds
> +	max_numa_nodes =
> run_command(get_numa_count_cmd).stdout().to_int()
> +	message('Found @0@ numa nodes'.format(max_numa_nodes))
> +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) endif
> +
> +# check that cpu and numa count is set and error out if it's not set if
> +not dpdk_conf.has('RTE_MAX_LCORE')
> +	error('Number of cores not specified.') endif if not
> +dpdk_conf.has('RTE_MAX_NUMA_NODES')
> +	error('Number of numa nodes not specified.') endif
> +
>  # set the install path for the drivers
>  dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> 
> diff --git a/config/x86/meson.build b/config/x86/meson.build index
> 31bfa63b1..4989d47f3 100644
> --- a/config/x86/meson.build
> +++ b/config/x86/meson.build
> @@ -57,3 +57,5 @@ else
>  endif
> 
>  dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
> +dpdk_conf.set('RTE_MAX_LCORE', 128)
> +dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
> diff --git a/meson_options.txt b/meson_options.txt index
> ce23289e3..e1059fb16 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
>  	description: 'set the target machine type. Set to generic for a build
> usable on most machines of the build machine architecture, set to native to let
> the compiler choose the best fit for the build machine.')
> option('max_ethports', type: 'integer', value: 32,
>  	description: 'maximum number of Ethernet devices') -
> option('max_lcores', type: 'integer', value: 128,
> -	description: 'maximum number of cores/threads supported by EAL')
> -option('max_numa_nodes', type: 'integer', value: 4,
> -	description: 'maximum number of NUMA nodes supported by EAL')
> +option('max_lcores', type: 'integer', value: 0,
> +	description: 'maximum number of cores/threads supported by EAL.
> Set to
> +positive integer to overwrite per-arch or cross-compilation defaults. Set to -1
> to use number of cores on the build machine.') option('max_numa_nodes',
        ^^^ detect? will be aligned with the comment above

> type: 'integer', value: 0,
> +	description: 'maximum number of NUMA nodes supported by EAL.
> Set to
> +positive integer to overwrite per-arch or cross-compilation defaults.
> +Set to -1 to use number of numa nodes on the build machine.')
                          ^^^ detect? will be aligned with the comment above

>  option('enable_trace_fp', type: 'boolean', value: false,
>  	description: 'enable fast path trace points.')  option('tests', type:
> 'boolean', value: true,
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic
  2020-11-09 12:12                   ` Juraj Linkeš
  2020-11-09 12:47                     ` Bruce Richardson
@ 2020-11-09 22:54                     ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09 22:54 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> > >
> > > The current machine='default' build name is not descriptive. The
> > > actual default build is machine='native'. Add an alternative string
> > > which does the same build and better describes what we're building:
> > > machine='generic'. Leave machine='default' for backwards compatibility.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/meson.build                    | 5 +++--
> > >  config/meson.build                        | 9 +++++----
> > >  doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
> > >  meson_options.txt                         | 2 +-
> > >  4 files changed, 11 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 42b4e43c7..d4066ade8 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -1,12 +1,13 @@
> > >  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2017 Intel
> > > Corporation.
> > >  # Copyright(c) 2017 Cavium, Inc
> > > +# Copyright(c) 2020 PANTHEON.tech s.r.o.
> > >
> > >  # for checking defines we need to use the correct compiler flags
> > > march_opt =
> > > '-march=@0@'.format(machine)
> > >
> > >  arm_force_native_march = false
> > > -arm_force_default_march = (machine == 'default')
> > > +arm_force_generic_march = (machine == 'generic')
> > >
> > >  flags_common_default = [
> > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > (memcpy_perf_autotest) @@ -148,7 +149,7 @@ else
> > >  	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()
> > > +	if arm_force_generic_march and not meson.is_cross_build()
> > >  		machine = impl_generic
> > >  		impl_pn = 'default'
> > >  	elif not meson.is_cross_build()
> > > diff --git a/config/meson.build b/config/meson.build index
> > > 258b01d06..c7f7aa6e2 100644
> > > --- a/config/meson.build
> > > +++ b/config/meson.build
> > > @@ -68,13 +68,14 @@ else
> > >  	machine = get_option('machine')
> > >  endif
> > >
> > > -# machine type 'default' is special, it defaults to the per arch
> > > agreed common -# minimal baseline needed for DPDK.
> > > +# machine type 'generic' is special, it defaults to the per arch
> > > +agreed common # minimal baseline needed for DPDK. Machine type
> > > +'default' is also supported # with the same meaning for backwards
> > compatibility.
> > >  # That might not be the most optimized, but the most portable
> > > version while # still being able to support the CPU features required for
> DPDK.
> > >  # This can be bumped up by the DPDK project, but it can never be an
> > > # invariant like 'native'
> > > -if machine == 'default'
> > > +if machine == 'default' or machine == 'generic'
> > >  	if host_machine.cpu_family().startswith('x86')
> > >  		# matches the old pre-meson build systems default
> > >  		machine = 'corei7'
> > > @@ -82,7 +83,7 @@ if machine == 'default'
> > >  		machine = 'armv7-a'
> > >  	elif host_machine.cpu_family().startswith('aarch')
> > >  		# arm64 manages defaults in config/arm/meson.build
> > > -		machine = 'default'
> > > +		machine = 'generic'
> > >  	elif host_machine.cpu_family().startswith('ppc')
> > >  		machine = 'power8'
> > >  	endif
> > > diff --git a/doc/guides/prog_guide/build-sdk-meson.rst
> > > b/doc/guides/prog_guide/build-sdk-meson.rst
> > > index 3429e2647..c7e12eedf 100644
> > > --- a/doc/guides/prog_guide/build-sdk-meson.rst
> > > +++ b/doc/guides/prog_guide/build-sdk-meson.rst
> > > @@ -85,7 +85,7 @@ Project-specific options are passed used -
> > > Doption=value::
> > >
> > >  	meson -Denable_docs=true fullbuild  # build and install docs
> > >
> > > -	meson -Dmachine=default  # use builder-independent baseline -
> > > march
> > > +	meson -Dmachine=generic  # use builder-independent baseline -
> > > march
> > >
> > >  	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
> > >  					# eventdev PMDs for a smaller build
> > @@ -114,7 +114,7 @@ Examples
> > > of setting some of the same options using meson configure::
> > >          re-scan from meson.
> > >
> > >  .. note::
> > > -        machine=default uses a config that works on all supported
> architectures
> > > +        machine=generic uses a config that works on all supported
> > > + architectures
> > >          regardless of the capabilities of the machine where the
> > > build is happening.
> > >
> > >  As well as those settings taken from ``meson configure``, other
> > > options diff -- git a/meson_options.txt b/meson_options.txt index
> > > 9bf18ab6b..ce23289e3
> > > 100644
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > @@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
> > > option('lib_musdk_dir', type: 'string', value: '',
> > >  	description: 'path to the MUSDK library installation directory')
> > > option('machine', type: 'string', value: 'native',
> > > -	description: 'set the target machine type')
> > > +	description: 'set the target machine type. Set to generic for a
> > > +build usable on most machines of the build machine architecture,
> > > +set to
> >                         ^^^^ all
> 
> I don't think we've settled this with Bruce. According to him, the build with
> "machine=generic" on x86 won't necessarily produce a build usable on all
> machines, so I went with most machines.
> 
> > > +native to let the compiler choose the best fit for the build
> > > +machine.')
> > How about: native to let the compiler choose the attributes of the
> > build machine
> >
> 
> I haven't looked at what the docs before, so now here's what GCC docs say:
> https://gcc.gnu.org/onlinedocs/gcc-8.4.0/gcc/AArch64-
> Options.html#AArch64-Options:
> The value ‘native’ is available on native AArch64 GNU/Linux and causes the
> compiler to pick the architecture of the host system.
> 
> Best fit is kinda vague and choosing the attibutes is probably not using the
> right verb (it's always going to use the same subset of attributes of the build
> machine in question, so it's not really a choice), I like use the attributes more.
> 
> So it would be either "use the attributes of the build machine" or "pick the
> architecture of the build machine" (I've changed host system to build machine
> to match meson language). Both look fine to be, but I'm always inclined to use
> wording from documentation, even if it's from one compiler. Which one do
> you like more?
I am fine with "pick the architecture of the build machine"

> 
> > Otherwise, it looks good to me.
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> >
> > >  option('max_ethports', type: 'integer', value: 32,
> > >  	description: 'maximum number of Ethernet devices')
> > > option('max_lcores', type: 'integer', value: 128,
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict
  2020-11-09 10:38                   ` Juraj Linkeš
@ 2020-11-09 23:15                     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09 23:15 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > >
> > > Use dictionary lookup instead of checking for existing variables,
> > > iterating over all elements in the list or checking lists for
> > > optional configuration. Move variable contents into the dictionary
> > > for variables that would be referenced only once.
> > > Fallback to generic part number if the discovered part number is unknown.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/meson.build | 282
> > > +++++++++++++++++++++++------------------
> > >  1 file changed, 160 insertions(+), 122 deletions(-)
> > >
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > eda485e7f..5d232f1c4 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -28,115 +28,146 @@ flags_common_default = [
> > >  	['RTE_CACHE_LINE_SIZE', 128]
> > >  ]
> > >
> > > -# implementer specific aarch64 flags, with middle priority -# (will
> > > overwrite common flags) -flags_implementer_generic = [
> > > -	['RTE_MACHINE', '"armv8a"'],
> > > -	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 128],
> > > -	['RTE_MAX_LCORE', 256]
> > > -]
> > > -flags_implementer_arm = [
> > > -	['RTE_MACHINE', '"armv8a"'],
> > > -	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > -	['RTE_MAX_LCORE', 16]
> > > -]
> > > -flags_implementer_cavium = [
> > > -	['RTE_MAX_VFIO_GROUPS', 128],
> > > -	['RTE_CACHE_LINE_SIZE', 128],
> > > -	['RTE_MAX_LCORE', 96],
> > > -	['RTE_MAX_NUMA_NODES', 2]
> > > -]
> > > -flags_implementer_dpaa = [
> > > -	['RTE_MACHINE', '"dpaa"'],
> > > -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> > > -	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > -	['RTE_MAX_LCORE', 16],
> > > -	['RTE_MAX_NUMA_NODES', 1]
> > > -]
> > > -flags_implementer_emag = [
> > > -	['RTE_MACHINE', '"emag"'],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > -	['RTE_MAX_LCORE', 32],
> > > -	['RTE_MAX_NUMA_NODES', 1]
> > > -]
> > > -flags_implementer_armada = [
> > > -	['RTE_MACHINE', '"armv8a"'],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > -	['RTE_MAX_LCORE', 16],
> > > -	['RTE_MAX_NUMA_NODES', 1]
> > > -]
> > > -
> > > -# part number specific aarch64 flags, with highest priority -#
> > > (will overwrite both common and implementer specific flags)
> > > flags_part_number_thunderx = [
> > >  	['RTE_MACHINE', '"thunderx"'],
> > >  	['RTE_USE_C11_MEM_MODEL', false]
> > >  ]
> > > -flags_part_number_thunderx2 = [
> > > -	['RTE_MACHINE', '"thunderx2"'],
> > > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > > -	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > -	['RTE_MAX_LCORE', 256],
> > > -	['RTE_MAX_NUMA_NODES', 2]
> > > -]
> > > -flags_part_number_octeontx2 = [
> > > -	['RTE_MACHINE', '"octeontx2"'],
> > > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > > -	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_EAL_IGB_UIO', false],
> > > -	['RTE_MAX_LCORE', 36],
> > > -	['RTE_MAX_NUMA_NODES', 1]
> > > -]
> > > -flags_part_number_n1generic = [
> > > -	['RTE_MACHINE', '"neoverse-n1"'],
> > > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > > -	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > > -	['RTE_LIBRTE_VHOST_NUMA', false],
> > > -	['RTE_MAX_MEM_MB', 1048576],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > > -	['RTE_MAX_LCORE', 64],
> > > -	['RTE_MAX_NUMA_NODES', 1]
> > > -]
> > > -
> > > -# arm config (implementer 0x41) is the default config -
> > > part_number_config_arm = [
> > > -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> > > -	['native', ['-march=native']],
> > > -	['0xd03', ['-mcpu=cortex-a53']],
> > > -	['0xd04', ['-mcpu=cortex-a35']],
> > > -	['0xd07', ['-mcpu=cortex-a57']],
> > > -	['0xd08', ['-mcpu=cortex-a72']],
> > > -	['0xd09', ['-mcpu=cortex-a73']],
> > > -	['0xd0a', ['-mcpu=cortex-a75']],
> > > -	['0xd0b', ['-mcpu=cortex-a76']],
> > > -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> > > flags_part_number_n1generic]
> > > -]
> > > -part_number_config_cavium = [
> > > -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > > -	['native', ['-march=native']],
> > > -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> > > -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> > > -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> > > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > flags_part_number_thunderx2],
> > > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > flags_part_number_octeontx2]
> > > -]
> > > -part_number_config_emag = [
> > > -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > -	['native', ['-march=native']]
> > > -]
> > > +part_number_config_arm = {
> > > +	'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-
> > > atomics']},
> > > +	'native': {'machine_args':  ['-march=native']},
> > > +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> > > +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> > > +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> > > +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> > > +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> > > +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> > > +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> > > +	'0xd0c': {
> > > +		'machine_args':  ['-march=armv8.2-a+crypto', '-
> > > mcpu=neoverse-n1'],
> > > +		'flags': [
> > > +			['RTE_MACHINE', '"neoverse-n1"'],
> > > +			['RTE_ARM_FEATURE_ATOMICS', true],
> > > +			['RTE_USE_C11_MEM_MODEL', true],
> > > +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > > +			['RTE_LIBRTE_VHOST_NUMA', false],
> > > +			['RTE_MAX_MEM_MB', 1048576],
> > > +			['RTE_CACHE_LINE_SIZE', 64],
> > > +			['RTE_MAX_LCORE', 64],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		]
> > > +	}
> > > +}
> > >
> > > -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> > > implementer_generic = ['Generic armv8', flags_implementer_generic,
> > > part_number_config_arm]
> > > -implementer_0x41 = ['Arm', flags_implementer_arm,
> > > part_number_config_arm]
> > > -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> > > part_number_config_cavium]
> > > -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> > > part_number_config_emag]
> > > -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> > > part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> > > flags_implementer_dpaa, part_number_config_arm]
> > > +## Arm implementers (ID from MIDR in Arm Architecture Reference
> > > +Manual) ## Part numbers are specific to Arm implementers #
> > > +implementer specific
> > > +aarch64 flags have middle priority
> > > +#     (will overwrite common flags)
> > > +# part number specific aarch64 flags have the highest priority
> > > +#     (will overwrite both common and implementer specific flags)
> > > +implementers = {
> > I think this one is big. It will grow further in the future. I like
> > the existing one, which is dis-integrated into smaller chunks and is easy to
> maintain in the future.
> >
> 
> My main concern was with the readability/understandability of the data
> (which affects maintenance), at least when a newcomer tries to wrap their
> head around them. The data are hierarchical and the relationship between
> implementer ID and part number and the order of flag application is more
> apparent when organized this way, although it could because of better
> formatting and better variable names. The bigger difference is in the code -
> using implementer_config['part_number_config'] immediately tells you what
> data are you working with as opposed to implementer_config[2].
> 
> I'm also looking at maintenance in terms of "where in this file do I need to
> change/add things for this implementer or their part number", which informed
> my motivation for (almost) removing the fragmentation, which we don't have
> to do, but it made sense to me. This way, if I'm looking for some configuration
> I know exactly where to find it in the file (under particular implementer
> ID/part number) and I don't have to chase variables around, although this is
> somewhat alleviated by better variable names. Or in other words having
> related configuration in one place rather than fragmented in multiple places is
> better organization of the data in my view, both in terms of readability and
> maintainability.
> 
> I don't actually see how having fragmented configuration is better when it's
> going to grow. The disjointed parts which are logically connected (implemeter
> configuration connected to its part number config) are only going to be further
> apart in the code, causing more potential confusion. When we have
> configuration organized by their relationship new additions won't really affect
> existing organization - e.g. when we add a new implementer, it won't move
> the configuration within other implementers; the other implementer's
> configuration won't be affected.
> 
> If I understand correctly, your gripe is not with using a dictionary (or how I've
> formatted the data in it), but rather with the removal of fragmentation. I'd like
> to keep the dictionaries (and formatting), since it results in more readable
> code. I could put the fragmentetion back in place, but I don't think it's better
> maintanence-wise.
I would not call it gripe, just trying to figure out if there is another way.
I like the dictionary method.  The problem I see is that, this structure is ~100 lines (that of SoC is ~100) and does not fit in one screen. I have to scroll back and forth to the top to understand the various fields. Some of the lines are beyond 80 characters (I guess this can be fixed).

IMO, splitting each implementation into its own structures and then combining them together might be easier. For ex: (I have not paid attention to syntax)

implementer_generic = {
        'generic': {
                'description': 'Generic armv8',
                'flags': [
                        ['RTE_MACHINE', '"armv8a"'],
                        ['RTE_USE_C11_MEM_MODEL', true],
                        ['RTE_CACHE_LINE_SIZE', 128],
                        ['RTE_MAX_LCORE', 256],
                        ['RTE_MAX_NUMA_NODES', 4]
                ],
                'part_number_config': {
                        'generic': {'machine_args':  ['-march=armv8-a+crc', '-moutline-atomics']}
                }
        }
}

implementer_arm = {
        '0x41': {
                'description': 'Arm',
                'flags': [
                        ['RTE_MACHINE', '"armv8a"'],
                        ['RTE_USE_C11_MEM_MODEL', true],
                        ['RTE_CACHE_LINE_SIZE', 64],
                        ['RTE_MAX_LCORE', 16],
                        ['RTE_MAX_NUMA_NODES', 1]
                ],
                'part_number_config': part_number_config_arm
        },
}
......

implementers = {
    implementer_generic,
    implementer_arm,
    ....}

> 
> > > +	'generic': {
> > > +		'description': 'Generic armv8',
> > > +		'flags': [
> > > +			['RTE_MACHINE', '"armv8a"'],
> > > +			['RTE_USE_C11_MEM_MODEL', true],
> > > +			['RTE_CACHE_LINE_SIZE', 128],
> > > +			['RTE_MAX_LCORE', 256]
> > > +		],
> > > +		'part_number_config': part_number_config_arm
> > > +	},
> > > +	'0x41': {
> > > +		'description': 'Arm',
> > > +		'flags': [
> > > +			['RTE_MACHINE', '"armv8a"'],
> > > +			['RTE_USE_C11_MEM_MODEL', true],
> > > +			['RTE_CACHE_LINE_SIZE', 64],
> > > +			['RTE_MAX_LCORE', 16]
> > > +		],
> > > +		'part_number_config': part_number_config_arm
> > > +	},
> > > +	'0x43': {
> > > +		'description': 'Cavium',
> > > +		'flags': [
> > > +			['RTE_MAX_VFIO_GROUPS', 128],
> > > +			['RTE_CACHE_LINE_SIZE', 128],
> > > +			['RTE_MAX_LCORE', 96],
> > > +			['RTE_MAX_NUMA_NODES', 2]
> > > +		],
> > > +		'part_number_config': {
> > > +			'generic': {'machine_args': ['-march=armv8-
> > > a+crc+crypto', '-mcpu=thunderx']},
> > > +			'native': {'machine_args': ['-march=native']},
> > > +			'0xa1': {
> > > +				'machine_args': ['-mcpu=thunderxt88'],
> > > +				'flags': flags_part_number_thunderx
> > > +			},
> > > +			'0xa2': {
> > > +				'machine_args': ['-mcpu=thunderxt81'],
> > > +				'flags': flags_part_number_thunderx
> > > +			},
> > > +			'0xa3': {
> > > +				'machine_args': ['-mcpu=thunderxt83'],
> > > +				'flags': flags_part_number_thunderx
> > > +			},
> > > +			'0xaf': {
> > > +				'machine_args': ['-march=armv8.1-
> > > a+crc+crypto','-mcpu=thunderx2t99'],
> > > +				'flags': [
> > > +					['RTE_MACHINE', '"thunderx2"'],
> > > +					['RTE_ARM_FEATURE_ATOMICS',
> > > true],
> > > +					['RTE_USE_C11_MEM_MODEL', true],
> > > +					['RTE_CACHE_LINE_SIZE', 64],
> > > +					['RTE_MAX_LCORE', 256],
> > > +					['RTE_MAX_NUMA_NODES', 2]
> > > +				]
> > > +			},
> > > +			'0xb2': {
> > > +				'machine_args': ['-march=armv8.2-
> > > a+crc+crypto+lse','-mcpu=octeontx2'],
> > > +				'flags': [
> > > +					['RTE_MACHINE', '"octeontx2"'],
> > > +					['RTE_ARM_FEATURE_ATOMICS',
> > > true],
> > > +					['RTE_USE_C11_MEM_MODEL', true],
> > > +					['RTE_EAL_IGB_UIO', false],
> > > +					['RTE_MAX_LCORE', 36],
> > > +					['RTE_MAX_NUMA_NODES', 1]
> > > +				]
> > > +			}
> > > +		}
> > > +	},
> > > +	'0x50': {
> > > +		'description': 'Ampere Computing',
> > > +		'flags': [
> > > +			['RTE_MACHINE', '"emag"'],
> > > +			['RTE_CACHE_LINE_SIZE', 64],
> > > +			['RTE_MAX_LCORE', 32],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'part_number_config': {
> > > +			'generic': {'machine_args':  ['-march=armv8-
> > > a+crc+crypto', '-mtune=emag']},
> > > +			'native': {'machine_args':  ['-march=native']}
> > > +		}
> > > +	},
> > > +	'0x56': {
> > > +		'description': 'Marvell ARMADA',
> > > +		'flags': [
> > > +			['RTE_MACHINE', '"armv8a"'],
> > > +			['RTE_CACHE_LINE_SIZE', 64],
> > > +			['RTE_MAX_LCORE', 16],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'part_number_config': part_number_config_arm
> > > +	},
> > > +	'dpaa': {
> > > +		'description': 'NXP DPAA',
> > > +		'flags': [
> > > +			['RTE_MACHINE', '"dpaa"'],
> > > +			['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> > > +			['RTE_USE_C11_MEM_MODEL', true],
> > > +			['RTE_CACHE_LINE_SIZE', 64],
> > > +			['RTE_MAX_LCORE', 16],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'part_number_config': part_number_config_arm
> > > +	}
> > > +}
> > >
> > >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> > >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -152,7 +183,7 @@ else
> > >  	implementer_id = 'generic'
> > >  	if machine == 'generic' and not meson.is_cross_build()
> > >  		# generic build
> > > -		implementer_config = implementer_generic
> > > +		implementer_config = implementer['generic']
> > >  		part_number = 'generic'
> > >  	elif not meson.is_cross_build()
> > >  		# native build
> > > @@ -167,9 +198,9 @@ else
> > >  			part_number = cmd_output[3]
> > >  		endif
> > >  		# Set to generic if variable is not found
> > > -		implementer_config = get_variable('implementer_' +
> > > implementer_id, ['generic'])
> > > +		implementer_config = implementers.get(implementer_id,
> > > ['generic'])
> > >  		if implementer_config[0] == 'generic'
> > > -			implementer_config = implementer_generic
> > > +			implementer_config = implementer['generic']
> > >  			part_number = 'generic'
> > >  		endif
> > >  		if arm_force_native_march == true @@ -179,28 +210,35 @@
> else
> > >  		# cross build
> > >  		implementer_id =
> > > meson.get_cross_property('implementer_id', 'generic')
> > >  		part_number = meson.get_cross_property('part_number',
> > > 'generic')
> > > -		implementer_config = get_variable('implementer_' +
> > > implementer_id)
> > > +		implementer_config = implementers.get(implementer_id)
> > >  	endif
> > >
> > > -	message('Arm implementer: ' + implementer_config[0])
> > > +	message('Arm implementer: ' + implementer_config['description'])
> > >  	message('Arm part number: ' + part_number)
> > >
> > > +	part_number_config = implementer_config['part_number_config']
> > > +	if part_number_config.has_key(part_number)
> > > +		# use the specified part_number machine args if found
> > > +		part_number_config = part_number_config[part_number]
> > > +	elif not meson.is_cross_build()
> > > +		# default to generic machine args if part_number is not found
> > > +		# and not forcing native machine args
> > > +		# but don't default in cross-builds; if part_number is specified
> > > +		# incorrectly in a cross-file, it needs to be fixed there
> > > +		part_number_config = part_number_config['generic']
> > > +	else
> > > +		# doing cross build and part number is not in
> > > part_number_config
> > > +		error('Cross build part number 0@0 not
> > > found.'.format(part_number))
> > > +	endif
> > > +
> > >  	# use default flags with implementer flags
> > > -	dpdk_flags = flags_common_default + implementer_config[1]
> > > +	dpdk_flags = flags_common_default + implementer_config['flags'] +
> > > +part_number_config.get('flags', [])
> > >
> > > +	# apply supported machine args
> > >  	machine_args = [] # Clear previous machine args
> > > -	foreach marg: implementer_config[2]
> > > -		if marg[0] == part_number
> > > -			# apply supported machine args
> > > -			foreach flag: marg[1]
> > > -				if cc.has_argument(flag)
> > > -					machine_args += flag
> > > -				endif
> > > -			endforeach
> > > -			if marg.length() > 2
> > > -				# add extra flags for the part
> > > -				dpdk_flags += marg[2]
> > > -			endif
> > > +	foreach flag: part_number_config['machine_args']
> > > +		if cc.has_argument(flag)
> > > +			machine_args += flag
> > >  		endif
> > >  	endforeach
> > >
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
  2020-11-09 10:52                   ` Juraj Linkeš
@ 2020-11-09 23:27                     ` Honnappa Nagarahalli
  2020-11-10  9:03                       ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09 23:27 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > >
> > > A few options that disabled drivers in the old makefiles were
> > > improperly ported to the meson build system. Fix this by adding a to
> > > the list of disabled
> > The fixes need to be separated into a different commit as they need to
> > be backported.
> > It would be good to get the fix patch as the first patch, it will be
> > easy to backport.
> >
> 
> Ok, I'll add support for disabling drivers for native and cross builds (that will be
> an independent easily portable change) and put the rest into a separate patch.
> That would be a compromise between v7 and v8.
I did not understand the last sentence.

> 
> > > drivers, similarly how the command line option works. Remove
> > > unneeded driver options ported from the old makefile system.
> > > Add support for removing drivers for cross builds.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > >  config/arm/arm64_armada_linux_gcc | 1 +
> > > config/arm/arm64_armv8_linux_gcc  | 3 +++
> > >  config/arm/meson.build            | 7 +++----
> > >  drivers/meson.build               | 6 +++++-
> > >  meson.build                       | 1 +
> > >  5 files changed, 13 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > b/config/arm/arm64_armada_linux_gcc
> > > index 73945fbb4..7383f42e2 100644
> > > --- a/config/arm/arm64_armada_linux_gcc
> > > +++ b/config/arm/arm64_armada_linux_gcc
> > > @@ -17,3 +17,4 @@ endian = 'little'
> > >  implementer_id = '0x56'
> > >  max_lcores = 16
> > >  max_numa_nodes = 1
> > > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > b/config/arm/arm64_armv8_linux_gcc
> > > index fb24be5fc..245e06e5f 100644
> > > --- a/config/arm/arm64_armv8_linux_gcc
> > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > @@ -52,3 +52,6 @@ part_number = 'generic'
> > >  # max_lcores = n      # will set RTE_MAX_LCORE
> > >  max_lcores = 256
> > >  max_numa_nodes = 4
> > > +
> > > +# disabled_drivers = ['bus/dpaa', 'crypto']
> > > +    # add to the set of disabled libraries
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > e9bb60045..a39a35b6a 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -3,6 +3,9 @@
> > >  # Copyright(c) 2017 Cavium, Inc
> > >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> > >
> > > +# disable Arm drivers for all builds disabled_drivers +=
> > > +['net/avp', 'net/fm10k']
> > > +
> > >  # common flags to all aarch64 builds, with lowest priority
> > > flags_common_default = [
> > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > (memcpy_perf_autotest) @@ -17,9 +20,6 @@ flags_common_default = [
> > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > >
> > > -	['RTE_NET_FM10K', false],
> > > -	['RTE_NET_AVP', false],
> > > -
> > >  	['RTE_SCHED_VECTOR', false],
> > >  	['RTE_ARM_USE_WFE', false],
> > >  	['RTE_ARCH_ARM64', true],
> > > @@ -124,7 +124,6 @@ implementers = {
> > >  					['RTE_MACHINE', '"octeontx2"'],
> > >  					['RTE_ARM_FEATURE_ATOMICS',
> > > true],
> > >  					['RTE_USE_C11_MEM_MODEL', true],
> > > -					['RTE_EAL_IGB_UIO', false],
> > Does this need to go to octeon tx2 cross file?
> >
> 
> Possibly.
> Based on my understanding of the old makefile config (which could be wrong),
> I think there are two categories here:
> 1. drivers which were disabled because they weren't supported at all or just on
> that platform.
> 2. drivers which were explicitly disabled no matter the support.
> 
> If this is in category 1, we should investigate whether support was not added.
> If we don't know, it's better to disable it, in which case I'll put it to the cross
> file.
I think all the platforms have moved to VFIO. It should be fine to disable this.

> 
> > >  					['RTE_MAX_LCORE', 36],
> > >  					['RTE_MAX_NUMA_NODES', 1]
> > >  				]
> > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > 4bb7e9218..a997387ad 100644
> > > --- a/drivers/meson.build
> > > +++ b/drivers/meson.build
> > > @@ -18,9 +18,13 @@ subdirs = [
> > >  	'baseband', # depends on common and bus.
> > >  ]
> > >
> > > -disabled_drivers = run_command(list_dir_globs,
> > > get_option('disable_drivers'),
> > > +disabled_drivers += run_command(list_dir_globs,
> > > +get_option('disable_drivers'),
> > >  		).stdout().split()
> > >
> > > +if meson.is_cross_build()
> > > +	disabled_drivers += meson.get_cross_property('disabled_drivers',
> > > +[]) endif
> > > +
> > >  default_cflags = machine_args
> > >  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags +=
> > > ['- DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build
> > > index 61d9a4f5f..8dadd70dc 100644
> > > --- a/meson.build
> > > +++ b/meson.build
> > > @@ -21,6 +21,7 @@ dpdk_drivers = []
> > >  dpdk_extra_ldflags = []
> > >  dpdk_libs_disabled = []
> > >  dpdk_drvs_disabled = []
> > > +disabled_drivers = []
> > >  abi_version_file = files('ABI_VERSION')
> > >
> > >  if host_machine.cpu_family().startswith('x86')
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds
  2020-11-09 11:10                   ` Juraj Linkeš
@ 2020-11-09 23:29                     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09 23:29 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

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

<snip>


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

* Re: [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option
  2020-11-09 11:45                   ` Juraj Linkeš
@ 2020-11-09 23:53                     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-09 23:53 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > >
> > > Add Arm SoC configuration to Arm meson.build and add a meson option
> > > to enable those options for native builds. This is preferable to
> > > specifying a cross file when doing aarch64 -> aarch64 builds, since
> > > the cross file specifies the toolchain as well.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  config/arm/arm64_armada_linux_gcc      |   6 +-
> > >  config/arm/arm64_armv8_linux_gcc       |  58 +++--------
> > >  config/arm/arm64_bluefield_linux_gcc   |   6 +-
> > >  config/arm/arm64_dpaa_linux_gcc        |   5 +-
> > >  config/arm/arm64_emag_linux_gcc        |   5 +-
> > >  config/arm/arm64_graviton2_linux_gcc   |   6 +-
> > >  config/arm/arm64_n1sdp_linux_gcc       |   6 +-
> > >  config/arm/arm64_octeontx2_linux_gcc   |   6 +-
> > >  config/arm/arm64_stingray_linux_gcc    |   6 +-
> > >  config/arm/arm64_thunderx2_linux_gcc   |   5 +-
> > >  config/arm/arm64_thunderxt88_linux_gcc |   5 +-
> > >  config/arm/meson.build                 | 132 ++++++++++++++++++++++++-
> > >  meson_options.txt                      |   2 +
> > >  13 files changed, 154 insertions(+), 94 deletions(-)
> > >

<snip>

> 
> > > +
> > > +soc = 'generic'
> > > diff --git a/config/arm/arm64_bluefield_linux_gcc
> > > b/config/arm/arm64_bluefield_linux_gcc
> > > index 6bef87fbd..7b1fae8b9 100644
> > > --- a/config/arm/arm64_bluefield_linux_gcc
> > > +++ b/config/arm/arm64_bluefield_linux_gcc
> > > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = '0x41'
> > > -part_number = '0xd08'
> > > -max_lcores = 16
> > > -max_numa_nodes = 1
> > > -numa = false
> > > +soc = 'bluefield'
> > > diff --git a/config/arm/arm64_dpaa_linux_gcc
> > > b/config/arm/arm64_dpaa_linux_gcc index 3458b9d7b..e52188842
> 100644
> > > --- a/config/arm/arm64_dpaa_linux_gcc
> > > +++ b/config/arm/arm64_dpaa_linux_gcc
> > > @@ -14,7 +14,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = 'dpaa'
> > > -max_lcores = 16
> > > -max_numa_nodes = 1
> > > -numa = false
> > > +soc = 'dpaa'
> > > diff --git a/config/arm/arm64_emag_linux_gcc
> > > b/config/arm/arm64_emag_linux_gcc index 7cbb05510..6c24b4bca
> 100644
> > > --- a/config/arm/arm64_emag_linux_gcc
> > > +++ b/config/arm/arm64_emag_linux_gcc
> > > @@ -13,7 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = '0x50'
> > > -part_number = '0x0'
> > > -max_lcores = 32
> > > -max_numa_nodes = 1
> > > +soc = 'emag'
> > > diff --git a/config/arm/arm64_graviton2_linux_gcc
> > > b/config/arm/arm64_graviton2_linux_gcc
> > > index cfe239797..bae35d6be 100644
> > > --- a/config/arm/arm64_graviton2_linux_gcc
> > > +++ b/config/arm/arm64_graviton2_linux_gcc
> > > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementor_id = '0x41'
> > > -implementor_pn = '0xd0c'
> > > -max_lcores = 64
> > > -max_numa_nodes = 1
> > > -numa = false
> > > +soc = 'graviton2'
> > > diff --git a/config/arm/arm64_n1sdp_linux_gcc
> > > b/config/arm/arm64_n1sdp_linux_gcc
> > > index b00f2d1ef..249ff4738 100644
> > > --- a/config/arm/arm64_n1sdp_linux_gcc
> > > +++ b/config/arm/arm64_n1sdp_linux_gcc
> > > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = '0x41'
> > > -part_number = '0xd0c'
> > > -max_lcores = 4
> > > -max_numa_nodes = 1
> > > -numa = false
> > > +soc = 'n1sdp'
> > > diff --git a/config/arm/arm64_octeontx2_linux_gcc
> > > b/config/arm/arm64_octeontx2_linux_gcc
> > > index 593769709..063018e8f 100644
> > > --- a/config/arm/arm64_octeontx2_linux_gcc
> > > +++ b/config/arm/arm64_octeontx2_linux_gcc
> > > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = '0x43'
> > > -part_number = '0xb2'
> > > -max_lcores = 36
> > > -max_numa_nodes = 1
> > > -numa = false
> > > +soc = 'octeontx2'
> > > diff --git a/config/arm/arm64_stingray_linux_gcc
> > > b/config/arm/arm64_stingray_linux_gcc
> > > index 6bef87fbd..1209a8c0b 100644
> > > --- a/config/arm/arm64_stingray_linux_gcc
> > > +++ b/config/arm/arm64_stingray_linux_gcc
> > > @@ -13,8 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = '0x41'
> > > -part_number = '0xd08'
> > > -max_lcores = 16
> > > -max_numa_nodes = 1
> > > -numa = false
> > > +soc = 'stingray'
> > > diff --git a/config/arm/arm64_thunderx2_linux_gcc
> > > b/config/arm/arm64_thunderx2_linux_gcc
> > > index c06dcdc2b..348650712 100644
> > > --- a/config/arm/arm64_thunderx2_linux_gcc
> > > +++ b/config/arm/arm64_thunderx2_linux_gcc
> > > @@ -13,7 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = '0x43'
> > > -part_number = '0xaf'
> > > -max_lcores = 256
> > > -max_numa_nodes = 2
> > > +soc = 'thunderx2'
> > > diff --git a/config/arm/arm64_thunderxt88_linux_gcc
> > > b/config/arm/arm64_thunderxt88_linux_gcc
> > > index 3ba1528e4..d31d0c6d8 100644
> > > --- a/config/arm/arm64_thunderxt88_linux_gcc
> > > +++ b/config/arm/arm64_thunderxt88_linux_gcc
> > > @@ -13,7 +13,4 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >
> > >  [properties]
> > > -implementer_id = '0x43'
> > > -part_number = '0xa1'
> > > -max_lcores = 96
> > > -max_numa_nodes = 1
> > > +soc = 'thunderxt88'
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 52274c0c5..cd270f84b 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -57,7 +57,7 @@ part_number_config_arm = {  ## Part numbers are
> > > specific to Arm implementers  # implementer specific aarch64 flags
> > > have middle priority
> > >  #     (will overwrite common flags)
> > > -# part number specific aarch64 flags have the highest priority
> > > +# part number specific aarch64 flags have higher priority
> > >  #     (will overwrite both common and implementer specific flags)
> > >  implementers = {
> > >  	'generic': {
> > > @@ -164,6 +164,102 @@ implementers = {
> > >  	}
> > >  }
> > >
> > > +# soc specific aarch64 flags have the highest priority
> > > +#     (will overwrite all other flags)
> > > +socs = {
> > Too big to maintain
> >
> 
> I don't have great alternate solutions that would work:
> 1. Possibly adding 'soc' under machine specific configuration. That would
> result in terrible code (O(N)) which would have to go through all
> implementer/part numbers to find the soc configuration.
> 2. Move the config from this dict to machine specific configuration as in 1, but
> also keep the backwards mapping of soc->(implementer, part_number). That
> way we'll have sane code which just does dict lookups (O(log N), much better).
> 
> Actually, the second option doesn't look that bad. We'll end up with extra
> mapping like this:
> 
> 'bluefield': {'implementer': '0x41', 'part_number': '0xd08'}
> 
> This would be in the soc dict and then the extra soc configuration in part
> number config.
> 
> NOTE: some socs have the same flags as their corresponsing part number flags
> (actually all of them except n1sdp). Do we want to make soc flags optional or
> do we want them to be speficied even when they won't change the config?
I think soc flags should be optional. Add the flags if they are not their in part number flags or if the part number flags need to be overwritten.

I think the solution for socs will be the same as for 'implementers'. We can come up with the syntax for 'implementers' apply the same here.

> 
> > > +	'generic': {
> > > +		'implementer': 'generic',
> > > +		'part_number': 'generic',
> > > +		'flags': []
> > > +	},
> > > +	'armada': {
> > > +		'implementer': '0x56',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 16],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'numa': false,
> > > +		'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > > +	},
> > > +	'bluefield': {
> > > +		'implementer': '0x41',
> > > +		'part_number': '0xd08',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 16],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'numa': false
> > > +	},
> > > +	'dpaa': {
> > > +		'implementer': 'dpaa',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 16],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'numa': false
> > > +	},
> > > +	'emag': {
> > > +		'implementer': '0x50',
> > > +		'part_number': '0x0',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 32],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		]
> > > +	},
> > > +	'graviton2': {
> > > +		'implementer': '0x41',
> > > +		'part_number': '0xd0c',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 64],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'numa': false
> > > +	},
> > > +	'n1sdp': {
> > > +		'implementer': '0x41',
> > > +		'part_number': '0xd0c',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 4],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'numa': false
> > > +	},
> > > +	'octeontx2': {
> > > +		'implementer': '0x43',
> > > +		'part_number': '0xb2',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 32],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'numa': false
> > > +	},
> > > +	'stingray': {
> > > +		'implementer': '0x41',
> > > +		'part_number': '0xd08',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 16],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		],
> > > +		'numa': false
> > > +	},
> > > +	'thunderx2': {
> > > +		'implementer': '0x43',
> > > +		'part_number': '0xaf',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 256],
> > > +			['RTE_MAX_NUMA_NODES', 2]
> > > +		]
> > > +	},
> > > +	'thunderxt88': {
> > > +		'implementer': '0x43',
> > > +		'part_number': '0xa1',
> > > +		'flags': [
> > > +			['RTE_MAX_LCORE', 96],
> > > +			['RTE_MAX_NUMA_NODES', 1]
> > > +		]
> > > +	}
> > > +}
> > > +
> > >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> > >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> > >
> > > @@ -176,11 +272,18 @@ if dpdk_conf.get('RTE_ARCH_32')  else
> > >  	# aarch64 build
> > >  	use_native_machine_args = false
> > > +	arm_soc = get_option('arm_soc')
> > > +	soc_config = {}
> > >  	if not meson.is_cross_build()
> > >  		if machine == 'generic'
> > >  			# generic build
> > > +			if arm_soc != ''
> > > +				error('Arm SoC is unsupported with generic
> > > build.')
> > > +			endif
> > >  			implementer_id = 'generic'
> > >  			part_number = 'generic'
> > > +		elif arm_soc != ''
> > > +			soc_config = socs.get(arm_soc, {'not_supported':
> > > true})
> > >  		else
> > >  			# native build
> > >  			# The script returns ['Implementer', 'Variant',
> > 'Architecture', @@
> > > -199,8 +302,27 @@ else
> > >  		endif
> > >  	else
> > >  		# cross build
> > > -		implementer_id =
> > > meson.get_cross_property('implementer_id')
> > > -		part_number = meson.get_cross_property('part_number')
> > > +		arm_soc = meson.get_cross_property('soc', '')
> > > +		if arm_soc == ''
> > > +			error('Arm SoC must be specified in the cross file.')
> > > +		endif
> > > +		soc_config = socs.get(arm_soc, {'not_supported': true})
> > > +	endif
> > > +
> > > +	soc_flags = []
> > > +	if soc_config.has_key('not_supported')
> > > +		error('SoC @0@ not supported.'.format(arm_soc))
> > > +	elif soc_config != {}
> > > +		implementer_id = soc_config['implementer']
> > > +		implementer_config = implementers[implementer_id]
> > > +		part_number = soc_config['part_number']
> > > +		soc_flags = soc_config['flags']
> > > +		if not soc_config.get('numa', true)
> > > +			has_libnuma = 0
> > > +		endif
> > > +		if soc_config.has_key('disabled_drivers')
> > > +			disabled_drivers += soc_config['disabled_drivers']
> > > +		endif
> > >  	endif
> > >
> > >  	if implementers.has_key(implementer_id)
> > > @@ -226,8 +348,8 @@ else
> > >  		      '(-Dmachine=generic) build.')
> > >  	endif
> > >
> > > -	# use default flags with implementer flags
> > > -	dpdk_flags = flags_common_default + implementer_config['flags'] +
> > > part_number_config.get('flags', [])
> > > +	# add flags in the proper order
> > > +	dpdk_flags = flags_common_default + implementer_config['flags'] +
> > > +part_number_config.get('flags', []) + soc_flags
> > >
> > >  	# apply supported machine args
> > >  	machine_args = [] # Clear previous machine args diff --git
> > > a/meson_options.txt b/meson_options.txt index e1059fb16..33b8b236c
> > > 100644
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > @@ -1,5 +1,7 @@
> > >  # Please keep these options sorted alphabetically.
> > >
> > > +option('arm_soc', type: 'string', value: '',
> > > +	description: 'Specify if you want to build for a particular Arm
> > > +SoC when building on an aarch64 machine.')
> > Kind of indicates that it is a cross build.
> 
> What do you mean by cross build in this context? It's not a meson cross build,
I meant, the sentence conveys that there is a target Arm SoC and the build machine is a different machine (though it is aarch64). May be I am reading into it too much.

> since it doesn't mention cross files, so I don't think you meant that. Aside from
> that, how does building on an aarch64 machine for aarch64 target indicate a
> cross build? I guess it says Arm SoC, so it could be a aarch64 -> armv7 cross
> build? Then I could change it to "a particular aarch64 Arm SoC".
I think this is better. We could document it better in the docs.

> 
> > How about: "Build natively for the specified Arm SoC"?
> >
> 
> I specifically didn't want to use the word native here because arm native build
> implies ['-march=native', '-mtune=native'], which won't be used in soc builds.
Agree, better to avoid the word 'native'

> Also, this wording assumes an aarch64 build machine, which is likely a safe
> assumption, but I wanted to avoid the assumption and spell it out.
> 
> > >  option('armv8_crypto_dir', type: 'string', value: '',
> > >  	description: 'path to the armv8_crypto library installation
> > > directory') option('disable_drivers', type: 'string', value: '',
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments
  2020-11-09 12:48                   ` Juraj Linkeš
@ 2020-11-10  0:02                     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-10  0:02 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> > > Change formatting so that it's more consistent and readable,
> > > add/modify comments/stdout messages, move configuration options to
> > > more appropriate places and make the order consistent according to
> > > these
> > rules:
> > > 1. First list generic configuration options, then list options that may
> > >    be overwritten. List SoC-specific options last.
> > > 2. For SoC-specific options, list number of cores before the number of
> > >    NUMA nodes, to make it consistent with config/meson.build.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Few nits, otherwise, looks good.
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> >
> > > ---
> > >  config/arm/arm64_armv8_linux_gcc | 21 ++++++-
> > >  config/arm/meson.build           | 94 +++++++++++++++++++-------------
> > >  2 files changed, 77 insertions(+), 38 deletions(-)
> > >
> > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > b/config/arm/arm64_armv8_linux_gcc
> > > index 13ee8b223..04cd82ba9 100644
> > > --- a/config/arm/arm64_armv8_linux_gcc
> > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > @@ -13,9 +13,16 @@ cpu = 'armv8-a'
> > >  endian = 'little'
> > >

<snip>

> > >
> > > +# implementer specific aarch64 flags, with middle priority # (will
> > Nit                                          ^^^^^^^ can be removed
> >
> > > +overwrite common flags)
> > >  flags_implementer_generic = [
> > >  	['RTE_MACHINE', '"armv8a"'],
> > > -	['RTE_MAX_LCORE', 256],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_CACHE_LINE_SIZE', 128]]
> > > +	['RTE_CACHE_LINE_SIZE', 128],
> > > +	['RTE_MAX_LCORE', 256]
> > > +]
> >
> > <snip>
> >
> > >  flags_implementer_armada = [
> > >  	['RTE_MACHINE', '"armv8a"'],
> > >  	['RTE_CACHE_LINE_SIZE', 64],
> > > -	['RTE_MAX_NUMA_NODES', 1],
> > > -	['RTE_MAX_LCORE', 16]]
> > > +	['RTE_MAX_LCORE', 16],
> > > +	['RTE_MAX_NUMA_NODES', 1]
> > > +]
> > >
> > > +# part number specific aarch64 flags, with highest priority # (will
> > Nit                                         ^^^^^^^ can be removed
> >
> 
> I added the aarch64 specifier since we're also defining armv7 build in this file,
Agree, no need to change

> however briefly. I thought Implementer ID and part number also exist on
> armv7, is that not right? I wanted to make it explicit that these flags would
> only be used for aarch64 builds, but I guess it's implicit enough.
> 
> > > +overwrite both common and implementer specific flags)
> > >  flags_part_number_thunderx = [
> > >  	['RTE_MACHINE', '"thunderx"'],
> > > -	['RTE_USE_C11_MEM_MODEL', false]]
> > > +	['RTE_USE_C11_MEM_MODEL', false]
> > > +]
> >
> > <snip>
> >
> > >  flags_part_number_n1generic = [
> > >  	['RTE_MACHINE', '"neoverse-n1"'],
> > > -	['RTE_MAX_LCORE', 64],
> > > -	['RTE_CACHE_LINE_SIZE', 64],
> > >  	['RTE_ARM_FEATURE_ATOMICS', true],
> > >  	['RTE_USE_C11_MEM_MODEL', true],
> > > -	['RTE_MAX_MEM_MB', 1048576],
> > > -	['RTE_MAX_NUMA_NODES', 1],
> > >  	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > > -	['RTE_LIBRTE_VHOST_NUMA', false]]
> > > +	['RTE_LIBRTE_VHOST_NUMA', false],
> > > +	['RTE_MAX_MEM_MB', 1048576],
> > > +	['RTE_CACHE_LINE_SIZE', 64],
> > > +	['RTE_MAX_LCORE', 64],
> > > +	['RTE_MAX_NUMA_NODES', 1]
> > > +]
> > >
> > > +# arm config (implementer 0x41) is the default config
> > I do not understand this comment. What does 'default' config mean? Are
> > you referring to 'generic' config?
> >
> 
> I am using the dictionary definition - use the config when no other alternative
> is found. We're using part_number_config_arm in four places, implementers
> generic, 0x41, 0x56, dpaa. For 0x41, it's the actual config, the other
> implementers default to it since we don't have specific config for them.
Ok

> 
> > >  part_number_config_arm = [
> > >  	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> > >  	['native', ['-march=native']],
> > > @@ -96,8 +114,8 @@ part_number_config_arm = [
> > >  	['0xd09', ['-mcpu=cortex-a73']],
> > >  	['0xd0a', ['-mcpu=cortex-a75']],
> > >  	['0xd0b', ['-mcpu=cortex-a76']],
> > > -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> > > flags_part_number_n1generic]]
> > > -
> > > +	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> > > +flags_part_number_n1generic] ]
> > >  part_number_config_cavium = [
> > >  	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > >  	['native', ['-march=native']],
> > > @@ -105,13 +123,14 @@ part_number_config_cavium = [
> > >  	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> > >  	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> > >  	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > > flags_part_number_thunderx2],
> > > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > flags_part_number_octeontx2]]
> > > -
> > > +	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > > +flags_part_number_octeontx2] ]
> > >  part_number_config_emag = [
> > >  	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > > -	['native', ['-march=native']]]
> > > +	['native', ['-march=native']]
> > > +]
> > >
> > > -## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page
> > > G7-5321)
> > > +## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
> > >  implementer_generic = ['Generic armv8', flags_implementer_generic,
> > > part_number_config_arm]
> > >  implementer_0x41 = ['Arm', flags_implementer_arm,
> > > part_number_config_arm]
> > >  implementer_0x43 = ['Cavium', flags_implementer_cavium,
> > > part_number_config_cavium] @@ -123,21 +142,21 @@
> > > dpdk_conf.set('RTE_ARCH_ARM', 1)
> > > dpdk_conf.set('RTE_FORCE_INTRINSICS',
> > > 1)
> > >
> > >  if dpdk_conf.get('RTE_ARCH_32')
> > > +	# armv7 build
> > >  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
> > > -
> > > +	# aarch64 build
> > >  	implementer_id = 'generic'
> > >  	machine_args = [] # Clear previous machine args
> > >  	if machine == 'generic' and not meson.is_cross_build()
> > > +		# generic build
> > >  		implementer_config = implementer_generic
> > >  		part_number = 'generic'
> > >  	elif not meson.is_cross_build()
> > > +		# native build
> > >  		# The script returns ['Implementer', 'Variant', 'Architecture',
> > >  		# 'Primary Part number', 'Revision']
> > >  		detect_vendor = find_program(join_paths( @@ -158,6 +177,7
> > @@ else
> > >  			part_number = 'native'
> > >  		endif
> > >  	else
> > > +		# cross build
> > >  		implementer_id =
> > > meson.get_cross_property('implementer_id', 'generic')
> > >  		part_number = meson.get_cross_property('part_number',
> > > 'generic')
> > >  		implementer_config = get_variable('implementer_' +
> > > implementer_id) @@ -194,7 +214,7 @@ else
> > >  		endif
> > >  	endforeach
> > >  endif
> > > -message(machine_args)
> > > +message('Using machine args: @0@'.format(machine_args))
> > >
> > >  if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
> > >      cc.get_define('__aarch64__', args: machine_args) != '')
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 10/14] build: optional NUMA and cpu counts detection
  2020-11-09 22:52                 ` Honnappa Nagarahalli
@ 2020-11-10  8:30                   ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-10  8:30 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Monday, November 9, 2020 11:53 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 10/14] build: optional NUMA and cpu counts detection
> 
> <snip>
> 
> >
> > Add an option to automatically discover the host's numa and cpu counts
> > and use those values for a non cross-build.
> > Give users the option to override the per-arch default values or
> > values from cross files by specifying them on the command line with
> > -Dmax_lcores and - Dmax_numa_nodes.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Few nits, otherwise looks fine
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> 
> > ---
> >  buildtools/get_cpu_count.py  |  7 ++++++
> > buildtools/get_numa_count.py |
> > 22 +++++++++++++++++
> >  buildtools/meson.build       |  2 ++
> >  config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
> >  config/x86/meson.build       |  2 ++
> >  meson_options.txt            |  8 +++---
> >  6 files changed, 82 insertions(+), 6 deletions(-)  create mode 100644
> > buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py
> >
> > diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
> > new file mode 100644 index 000000000..b269d557b
> > --- /dev/null
> > +++ b/buildtools/get_cpu_count.py
> > @@ -0,0 +1,7 @@
> > +#!/usr/bin/env python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import os
> > +
> > +print(os.cpu_count())
> > diff --git a/buildtools/get_numa_count.py
> > b/buildtools/get_numa_count.py new file mode 100644 index
> > 000000000..be73c5c3f
> > --- /dev/null
> > +++ b/buildtools/get_numa_count.py
> > @@ -0,0 +1,22 @@
> > +#!/usr/bin/env python3
> > +# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2020
> > +PANTHEON.tech s.r.o.
> > +
> > +import ctypes
> > +import glob
> > +import os
> > +import subprocess
> > +
> > +if os.name == 'posix':
> > +    if os.path.isdir('/sys/devices/system/node'):
> > +        print(len(glob.glob('/sys/devices/system/node/node*')))
> > +    else:
> > +        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
> > +
> > +elif os.name == 'nt':
> > +    libkernel32 = ctypes.windll.kernel32
> > +
> > +    count = ctypes.c_ulong()
> > +
> > +    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
> > +    print(count.value + 1)
> > diff --git a/buildtools/meson.build b/buildtools/meson.build index
> > 04808dabc..925e733b1 100644
> > --- a/buildtools/meson.build
> > +++ b/buildtools/meson.build
> > @@ -17,3 +17,5 @@ else
> >  endif
> >  map_to_win_cmd = py3 + files('map_to_win.py')  sphinx_wrapper = py3 +
> > files('call-sphinx-build.py')
> > +get_cpu_count_cmd = py3 + files('get_cpu_count.py')
> > +get_numa_count_cmd = py3 + files('get_numa_count.py')
> > diff --git a/config/meson.build b/config/meson.build index
> > c7f7aa6e2..2974f7f6f 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -231,8 +231,6 @@ foreach arg: warning_flags  endforeach
> >
> >  # set other values pulled from the build options -
> > dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores')) -
> > dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
> > dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
> > dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
> > dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp')) @@
> > -251,6 +249,51 @@ compile_time_cpuflags = []
> >  subdir(arch_subdir)
> >  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> > ','.join(compile_time_cpuflags))
> >
> > +max_lcores = get_option('max_lcores') if max_lcores > 0
> > +	# Overwrite the default value from arch_subdir with user input
> > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores) elif max_lcores == -1
> > +	# Overwrite the default value with discovered values
> > +	if meson.is_cross_build()
> > +		error('Discovered values (user setting -1) are not supported
> > be used when cross-compiling.')
> Suggest something like:
> 'Discovery of max_lcore value not supported for cross-compilation'
> 
> > +	endif
> > +	# Discovery makes sense only for non-cross builds
> > +	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
> > +	min_lcores = 2
> > +	# DPDK must be build for at least 2 cores
> > +	if max_lcores < min_lcores
> > +		message('Found less than @0@ cores, building for @0@
> > cores'.format(min_lcores))
> > +		max_lcores = min_lcores
> > +	else
> > +		message('Found @0@ cores'.format(max_lcores))
> > +	endif
> > +	dpdk_conf.set('RTE_MAX_LCORE', max_lcores) endif
> > +
> > +max_numa_nodes = get_option('max_numa_nodes') if max_numa_nodes >
> > 0
> > +	# Overwrite the default value from arch_subdir with user input
> > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) elif
> > +max_numa_nodes == -1
> > +	# Overwrite the default value with discovered values
> > +	if meson.is_cross_build()
> > +		error('Discovered values (user setting -1) are not supported
> > be used when cross-compiling.')
> Suggest something like:
> 'Discovery of max_numa_nodes value not supported for cross-compilation'
> 

This is a bit better, thanks.

> > +	endif
> > +	# Discovery makes sense only for non-cross builds
> > +	max_numa_nodes =
> > run_command(get_numa_count_cmd).stdout().to_int()
> > +	message('Found @0@ numa nodes'.format(max_numa_nodes))
> > +	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes) endif
> > +
> > +# check that cpu and numa count is set and error out if it's not set
> > +if not dpdk_conf.has('RTE_MAX_LCORE')
> > +	error('Number of cores not specified.') endif if not
> > +dpdk_conf.has('RTE_MAX_NUMA_NODES')
> > +	error('Number of numa nodes not specified.') endif
> > +
> >  # set the install path for the drivers
> > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
> >
> > diff --git a/config/x86/meson.build b/config/x86/meson.build index
> > 31bfa63b1..4989d47f3 100644
> > --- a/config/x86/meson.build
> > +++ b/config/x86/meson.build
> > @@ -57,3 +57,5 @@ else
> >  endif
> >
> >  dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
> > +dpdk_conf.set('RTE_MAX_LCORE', 128)
> > +dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
> > diff --git a/meson_options.txt b/meson_options.txt index
> > ce23289e3..e1059fb16 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
> >  	description: 'set the target machine type. Set to generic for a
> > build usable on most machines of the build machine architecture, set
> > to native to let the compiler choose the best fit for the build
> > machine.') option('max_ethports', type: 'integer', value: 32,
> >  	description: 'maximum number of Ethernet devices') -
> > option('max_lcores', type: 'integer', value: 128,
> > -	description: 'maximum number of cores/threads supported by EAL')
> > -option('max_numa_nodes', type: 'integer', value: 4,
> > -	description: 'maximum number of NUMA nodes supported by EAL')
> > +option('max_lcores', type: 'integer', value: 0,
> > +	description: 'maximum number of cores/threads supported by EAL.
> > Set to
> > +positive integer to overwrite per-arch or cross-compilation defaults.
> > +Set to -1
> > to use number of cores on the build machine.')
> > option('max_numa_nodes',
>         ^^^ detect? will be aligned with the comment above
> 

Ok, that's also better.

> > type: 'integer', value: 0,
> > +	description: 'maximum number of NUMA nodes supported by EAL.
> > Set to
> > +positive integer to overwrite per-arch or cross-compilation defaults.
> > +Set to -1 to use number of numa nodes on the build machine.')
>                           ^^^ detect? will be aligned with the comment above
> 
> >  option('enable_trace_fp', type: 'boolean', value: false,
> >  	description: 'enable fast path trace points.')  option('tests', type:
> > 'boolean', value: true,
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
  2020-11-09 23:27                     ` Honnappa Nagarahalli
@ 2020-11-10  9:03                       ` Juraj Linkeš
  2020-11-10 15:13                         ` Honnappa Nagarahalli
  2020-11-11 10:10                         ` Juraj Linkeš
  0 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-10  9:03 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, November 10, 2020 12:27 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 12/14] build: disable Arm drivers
> 
> <snip>
> 
> > >
> > > >
> > > > A few options that disabled drivers in the old makefiles were
> > > > improperly ported to the meson build system. Fix this by adding a
> > > > to the list of disabled
> > > The fixes need to be separated into a different commit as they need
> > > to be backported.
> > > It would be good to get the fix patch as the first patch, it will be
> > > easy to backport.
> > >
> >
> > Ok, I'll add support for disabling drivers for native and cross builds
> > (that will be an independent easily portable change) and put the rest into a
> separate patch.
> > That would be a compromise between v7 and v8.
> I did not understand the last sentence.
> 

A compromise between version 7 of the series and version 8 of the series. V7 had the support for arm disabling drivers in non-cross builds in one commit and support for cross builds in another patch, v8 joined the two patches and the new version will be in between.

> >
> > > > drivers, similarly how the command line option works. Remove
> > > > unneeded driver options ported from the old makefile system.
> > > > Add support for removing drivers for cross builds.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > ---
> > > >  config/arm/arm64_armada_linux_gcc | 1 +
> > > > config/arm/arm64_armv8_linux_gcc  | 3 +++
> > > >  config/arm/meson.build            | 7 +++----
> > > >  drivers/meson.build               | 6 +++++-
> > > >  meson.build                       | 1 +
> > > >  5 files changed, 13 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > > b/config/arm/arm64_armada_linux_gcc
> > > > index 73945fbb4..7383f42e2 100644
> > > > --- a/config/arm/arm64_armada_linux_gcc
> > > > +++ b/config/arm/arm64_armada_linux_gcc
> > > > @@ -17,3 +17,4 @@ endian = 'little'
> > > >  implementer_id = '0x56'
> > > >  max_lcores = 16
> > > >  max_numa_nodes = 1
> > > > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > > b/config/arm/arm64_armv8_linux_gcc
> > > > index fb24be5fc..245e06e5f 100644
> > > > --- a/config/arm/arm64_armv8_linux_gcc
> > > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > > @@ -52,3 +52,6 @@ part_number = 'generic'
> > > >  # max_lcores = n      # will set RTE_MAX_LCORE
> > > >  max_lcores = 256
> > > >  max_numa_nodes = 4
> > > > +
> > > > +# disabled_drivers = ['bus/dpaa', 'crypto']
> > > > +    # add to the set of disabled libraries
> > > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > > e9bb60045..a39a35b6a 100644
> > > > --- a/config/arm/meson.build
> > > > +++ b/config/arm/meson.build
> > > > @@ -3,6 +3,9 @@
> > > >  # Copyright(c) 2017 Cavium, Inc
> > > >  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> > > >
> > > > +# disable Arm drivers for all builds disabled_drivers +=
> > > > +['net/avp', 'net/fm10k']
> > > > +
> > > >  # common flags to all aarch64 builds, with lowest priority
> > > > flags_common_default = [
> > > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > > (memcpy_perf_autotest) @@ -17,9 +20,6 @@ flags_common_default = [
> > > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > >
> > > > -	['RTE_NET_FM10K', false],
> > > > -	['RTE_NET_AVP', false],
> > > > -
> > > >  	['RTE_SCHED_VECTOR', false],
> > > >  	['RTE_ARM_USE_WFE', false],
> > > >  	['RTE_ARCH_ARM64', true],
> > > > @@ -124,7 +124,6 @@ implementers = {
> > > >  					['RTE_MACHINE', '"octeontx2"'],
> > > >  					['RTE_ARM_FEATURE_ATOMICS',
> > > > true],
> > > >  					['RTE_USE_C11_MEM_MODEL', true],
> > > > -					['RTE_EAL_IGB_UIO', false],
> > > Does this need to go to octeon tx2 cross file?
> > >
> >
> > Possibly.
> > Based on my understanding of the old makefile config (which could be
> > wrong), I think there are two categories here:
> > 1. drivers which were disabled because they weren't supported at all
> > or just on that platform.
> > 2. drivers which were explicitly disabled no matter the support.
> >
> > If this is in category 1, we should investigate whether support was not added.
> > If we don't know, it's better to disable it, in which case I'll put it
> > to the cross file.
> I think all the platforms have moved to VFIO. It should be fine to disable this.
> 

Do you mean all arm platforms? If so, I'll add this to disabled drivers for all arm builds instead of just one soc.

> >
> > > >  					['RTE_MAX_LCORE', 36],
> > > >  					['RTE_MAX_NUMA_NODES', 1]
> > > >  				]
> > > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > > 4bb7e9218..a997387ad 100644
> > > > --- a/drivers/meson.build
> > > > +++ b/drivers/meson.build
> > > > @@ -18,9 +18,13 @@ subdirs = [
> > > >  	'baseband', # depends on common and bus.
> > > >  ]
> > > >
> > > > -disabled_drivers = run_command(list_dir_globs,
> > > > get_option('disable_drivers'),
> > > > +disabled_drivers += run_command(list_dir_globs,
> > > > +get_option('disable_drivers'),
> > > >  		).stdout().split()
> > > >
> > > > +if meson.is_cross_build()
> > > > +	disabled_drivers += meson.get_cross_property('disabled_drivers',
> > > > +[]) endif
> > > > +
> > > >  default_cflags = machine_args
> > > >  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags +=
> > > > ['- DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build
> > > > index 61d9a4f5f..8dadd70dc 100644
> > > > --- a/meson.build
> > > > +++ b/meson.build
> > > > @@ -21,6 +21,7 @@ dpdk_drivers = []  dpdk_extra_ldflags = []
> > > > dpdk_libs_disabled = []  dpdk_drvs_disabled = []
> > > > +disabled_drivers = []
> > > >  abi_version_file = files('ABI_VERSION')
> > > >
> > > >  if host_machine.cpu_family().startswith('x86')
> > > > --
> > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
  2020-11-10  9:03                       ` Juraj Linkeš
@ 2020-11-10 15:13                         ` Honnappa Nagarahalli
  2020-11-11 10:10                         ` Juraj Linkeš
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-10 15:13 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> > > > >
> > > > > A few options that disabled drivers in the old makefiles were
> > > > > improperly ported to the meson build system. Fix this by adding
> > > > > a to the list of disabled
> > > > The fixes need to be separated into a different commit as they
> > > > need to be backported.
> > > > It would be good to get the fix patch as the first patch, it will
> > > > be easy to backport.
> > > >
> > >
> > > Ok, I'll add support for disabling drivers for native and cross
> > > builds (that will be an independent easily portable change) and put
> > > the rest into a
> > separate patch.
> > > That would be a compromise between v7 and v8.
> > I did not understand the last sentence.
> >
> 
> A compromise between version 7 of the series and version 8 of the series. V7
> had the support for arm disabling drivers in non-cross builds in one commit
> and support for cross builds in another patch, v8 joined the two patches and
> the new version will be in between.
> 
> > >
> > > > > drivers, similarly how the command line option works. Remove
> > > > > unneeded driver options ported from the old makefile system.
> > > > > Add support for removing drivers for cross builds.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > > ---
> > > > >  config/arm/arm64_armada_linux_gcc | 1 +
> > > > > config/arm/arm64_armv8_linux_gcc  | 3 +++
> > > > >  config/arm/meson.build            | 7 +++----
> > > > >  drivers/meson.build               | 6 +++++-
> > > > >  meson.build                       | 1 +
> > > > >  5 files changed, 13 insertions(+), 5 deletions(-)
> > > > >
> > > > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > > > b/config/arm/arm64_armada_linux_gcc
> > > > > index 73945fbb4..7383f42e2 100644
> > > > > --- a/config/arm/arm64_armada_linux_gcc
> > > > > +++ b/config/arm/arm64_armada_linux_gcc
> > > > > @@ -17,3 +17,4 @@ endian = 'little'
> > > > >  implementer_id = '0x56'
> > > > >  max_lcores = 16
> > > > >  max_numa_nodes = 1
> > > > > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > > > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > > > b/config/arm/arm64_armv8_linux_gcc
> > > > > index fb24be5fc..245e06e5f 100644
> > > > > --- a/config/arm/arm64_armv8_linux_gcc
> > > > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > > > @@ -52,3 +52,6 @@ part_number = 'generic'
> > > > >  # max_lcores = n      # will set RTE_MAX_LCORE
> > > > >  max_lcores = 256
> > > > >  max_numa_nodes = 4
> > > > > +
> > > > > +# disabled_drivers = ['bus/dpaa', 'crypto']
> > > > > +    # add to the set of disabled libraries
> > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > > > > index e9bb60045..a39a35b6a 100644
> > > > > --- a/config/arm/meson.build
> > > > > +++ b/config/arm/meson.build
> > > > > @@ -3,6 +3,9 @@
> > > > >  # Copyright(c) 2017 Cavium, Inc  # Copyright(c) 2020
> > > > > PANTHEON.tech s.r.o.
> > > > >
> > > > > +# disable Arm drivers for all builds disabled_drivers +=
> > > > > +['net/avp', 'net/fm10k']
> > > > > +
> > > > >  # common flags to all aarch64 builds, with lowest priority
> > > > > flags_common_default = [
> > > > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > > > (memcpy_perf_autotest) @@ -17,9 +20,6 @@ flags_common_default
> = [
> > > > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > > > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > > >
> > > > > -	['RTE_NET_FM10K', false],
> > > > > -	['RTE_NET_AVP', false],
> > > > > -
> > > > >  	['RTE_SCHED_VECTOR', false],
> > > > >  	['RTE_ARM_USE_WFE', false],
> > > > >  	['RTE_ARCH_ARM64', true],
> > > > > @@ -124,7 +124,6 @@ implementers = {
> > > > >  					['RTE_MACHINE', '"octeontx2"'],
> > > > >  					['RTE_ARM_FEATURE_ATOMICS',
> true],
> > > > >  					['RTE_USE_C11_MEM_MODEL', true],
> > > > > -					['RTE_EAL_IGB_UIO', false],
> > > > Does this need to go to octeon tx2 cross file?
> > > >
> > >
> > > Possibly.
> > > Based on my understanding of the old makefile config (which could be
> > > wrong), I think there are two categories here:
> > > 1. drivers which were disabled because they weren't supported at all
> > > or just on that platform.
> > > 2. drivers which were explicitly disabled no matter the support.
> > >
> > > If this is in category 1, we should investigate whether support was not
> added.
> > > If we don't know, it's better to disable it, in which case I'll put
> > > it to the cross file.
> > I think all the platforms have moved to VFIO. It should be fine to disable this.
> >
> 
> Do you mean all arm platforms? If so, I'll add this to disabled drivers for all arm
> builds instead of just one soc.
Jerin, Hemant, can you comment on this?

> 
> > >
> > > > >  					['RTE_MAX_LCORE', 36],
> > > > >  					['RTE_MAX_NUMA_NODES', 1]
> > > > >  				]
> > > > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > > > 4bb7e9218..a997387ad 100644
> > > > > --- a/drivers/meson.build
> > > > > +++ b/drivers/meson.build
> > > > > @@ -18,9 +18,13 @@ subdirs = [
> > > > >  	'baseband', # depends on common and bus.
> > > > >  ]
> > > > >
> > > > > -disabled_drivers = run_command(list_dir_globs,
> > > > > get_option('disable_drivers'),
> > > > > +disabled_drivers += run_command(list_dir_globs,
> > > > > +get_option('disable_drivers'),
> > > > >  		).stdout().split()
> > > > >
> > > > > +if meson.is_cross_build()
> > > > > +	disabled_drivers +=
> > > > > +meson.get_cross_property('disabled_drivers',
> > > > > +[]) endif
> > > > > +
> > > > >  default_cflags = machine_args
> > > > >  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags
> > > > > +=
> > > > > ['- DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build
> > > > > index 61d9a4f5f..8dadd70dc 100644
> > > > > --- a/meson.build
> > > > > +++ b/meson.build
> > > > > @@ -21,6 +21,7 @@ dpdk_drivers = []  dpdk_extra_ldflags = []
> > > > > dpdk_libs_disabled = []  dpdk_drvs_disabled = []
> > > > > +disabled_drivers = []
> > > > >  abi_version_file = files('ABI_VERSION')
> > > > >
> > > > >  if host_machine.cpu_family().startswith('x86')
> > > > > --
> > > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
  2020-11-10  9:03                       ` Juraj Linkeš
  2020-11-10 15:13                         ` Honnappa Nagarahalli
@ 2020-11-11 10:10                         ` Juraj Linkeš
  1 sibling, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 10:10 UTC (permalink / raw)
  To: Juraj Linkeš,
	Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Juraj Linkeš
> Sent: Tuesday, November 10, 2020 10:03 AM
> To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil
> Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers
> 
> 
> 
> > -----Original Message-----
> > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Sent: Tuesday, November 10, 2020 12:27 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil
> > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > ferruh.yigit@intel.com; aconole@redhat.com
> > Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > Subject: RE: [PATCH v8 12/14] build: disable Arm drivers
> >
> > <snip>
> >
> > > >
> > > > >
> > > > > A few options that disabled drivers in the old makefiles were
> > > > > improperly ported to the meson build system. Fix this by adding
> > > > > a to the list of disabled
> > > > The fixes need to be separated into a different commit as they
> > > > need to be backported.
> > > > It would be good to get the fix patch as the first patch, it will
> > > > be easy to backport.
> > > >
> > >
> > > Ok, I'll add support for disabling drivers for native and cross
> > > builds (that will be an independent easily portable change) and put
> > > the rest into a
> > separate patch.
> > > That would be a compromise between v7 and v8.
> > I did not understand the last sentence.
> >
> 
> A compromise between version 7 of the series and version 8 of the series. V7
> had the support for arm disabling drivers in non-cross builds in one commit and
> support for cross builds in another patch, v8 joined the two patches and the new
> version will be in between.
> 

Now that I'm looking at the patch, what exactly do you want to separate? The patch fixes what the previous arm makefile driver config (such as CONFIG_RTE_LIBRTE_FM10K_PMD or CONFIG_RTE_LIBRTE_DPAA_BUS) did - some of the config was applicable to all builds, some only to the Armada SoC (implemented in cross files). The commit is standalone as it does not depend on anything and should thus be easy to backport.

> > >
> > > > > drivers, similarly how the command line option works. Remove
> > > > > unneeded driver options ported from the old makefile system.
> > > > > Add support for removing drivers for cross builds.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > > ---
> > > > >  config/arm/arm64_armada_linux_gcc | 1 +
> > > > > config/arm/arm64_armv8_linux_gcc  | 3 +++
> > > > >  config/arm/meson.build            | 7 +++----
> > > > >  drivers/meson.build               | 6 +++++-
> > > > >  meson.build                       | 1 +
> > > > >  5 files changed, 13 insertions(+), 5 deletions(-)
> > > > >
> > > > > diff --git a/config/arm/arm64_armada_linux_gcc
> > > > > b/config/arm/arm64_armada_linux_gcc
> > > > > index 73945fbb4..7383f42e2 100644
> > > > > --- a/config/arm/arm64_armada_linux_gcc
> > > > > +++ b/config/arm/arm64_armada_linux_gcc
> > > > > @@ -17,3 +17,4 @@ endian = 'little'
> > > > >  implementer_id = '0x56'
> > > > >  max_lcores = 16
> > > > >  max_numa_nodes = 1
> > > > > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> > > > > diff --git a/config/arm/arm64_armv8_linux_gcc
> > > > > b/config/arm/arm64_armv8_linux_gcc
> > > > > index fb24be5fc..245e06e5f 100644
> > > > > --- a/config/arm/arm64_armv8_linux_gcc
> > > > > +++ b/config/arm/arm64_armv8_linux_gcc
> > > > > @@ -52,3 +52,6 @@ part_number = 'generic'
> > > > >  # max_lcores = n      # will set RTE_MAX_LCORE
> > > > >  max_lcores = 256
> > > > >  max_numa_nodes = 4
> > > > > +
> > > > > +# disabled_drivers = ['bus/dpaa', 'crypto']
> > > > > +    # add to the set of disabled libraries
> > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > > > > index e9bb60045..a39a35b6a 100644
> > > > > --- a/config/arm/meson.build
> > > > > +++ b/config/arm/meson.build
> > > > > @@ -3,6 +3,9 @@
> > > > >  # Copyright(c) 2017 Cavium, Inc  # Copyright(c) 2020
> > > > > PANTHEON.tech s.r.o.
> > > > >
> > > > > +# disable Arm drivers for all builds disabled_drivers +=
> > > > > +['net/avp', 'net/fm10k']
> > > > > +
> > > > >  # common flags to all aarch64 builds, with lowest priority
> > > > > flags_common_default = [
> > > > >  	# Accelarate rte_memcpy. Be sure to run unit test
> > > > > (memcpy_perf_autotest) @@ -17,9 +20,6 @@ flags_common_default =
> [
> > > > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > > > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > > >
> > > > > -	['RTE_NET_FM10K', false],
> > > > > -	['RTE_NET_AVP', false],
> > > > > -
> > > > >  	['RTE_SCHED_VECTOR', false],
> > > > >  	['RTE_ARM_USE_WFE', false],
> > > > >  	['RTE_ARCH_ARM64', true],
> > > > > @@ -124,7 +124,6 @@ implementers = {
> > > > >  					['RTE_MACHINE', '"octeontx2"'],
> > > > >  					['RTE_ARM_FEATURE_ATOMICS', true],
> > > > >  					['RTE_USE_C11_MEM_MODEL', true],
> > > > > -					['RTE_EAL_IGB_UIO', false],
> > > > Does this need to go to octeon tx2 cross file?
> > > >
> > >
> > > Possibly.
> > > Based on my understanding of the old makefile config (which could be
> > > wrong), I think there are two categories here:
> > > 1. drivers which were disabled because they weren't supported at all
> > > or just on that platform.
> > > 2. drivers which were explicitly disabled no matter the support.
> > >
> > > If this is in category 1, we should investigate whether support was not
> added.
> > > If we don't know, it's better to disable it, in which case I'll put
> > > it to the cross file.
> > I think all the platforms have moved to VFIO. It should be fine to disable this.
> >
> 
> Do you mean all arm platforms? If so, I'll add this to disabled drivers for all arm
> builds instead of just one soc.
> 
> > >
> > > > >  					['RTE_MAX_LCORE', 36],
> > > > >  					['RTE_MAX_NUMA_NODES', 1]
> > > > >  				]
> > > > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > > > 4bb7e9218..a997387ad 100644
> > > > > --- a/drivers/meson.build
> > > > > +++ b/drivers/meson.build
> > > > > @@ -18,9 +18,13 @@ subdirs = [
> > > > >  	'baseband', # depends on common and bus.
> > > > >  ]
> > > > >
> > > > > -disabled_drivers = run_command(list_dir_globs,
> > > > > get_option('disable_drivers'),
> > > > > +disabled_drivers += run_command(list_dir_globs,
> > > > > +get_option('disable_drivers'),
> > > > >  		).stdout().split()
> > > > >
> > > > > +if meson.is_cross_build()
> > > > > +	disabled_drivers +=
> > > > > +meson.get_cross_property('disabled_drivers',
> > > > > +[]) endif
> > > > > +
> > > > >  default_cflags = machine_args
> > > > >  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags
> > > > > +=
> > > > > ['- DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build
> > > > > index 61d9a4f5f..8dadd70dc 100644
> > > > > --- a/meson.build
> > > > > +++ b/meson.build
> > > > > @@ -21,6 +21,7 @@ dpdk_drivers = []  dpdk_extra_ldflags = []
> > > > > dpdk_libs_disabled = []  dpdk_drvs_disabled = []
> > > > > +disabled_drivers = []
> > > > >  abi_version_file = files('ABI_VERSION')
> > > > >
> > > > >  if host_machine.cpu_family().startswith('x86')
> > > > > --
> > > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-08 14:42                 ` Honnappa Nagarahalli
@ 2020-11-11 11:45                   ` Juraj Linkeš
  2020-11-11 14:52                     ` Ruifeng Wang
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 11:45 UTC (permalink / raw)
  To: Honnappa Nagarahalli, bruce.richardson, Ruifeng Wang, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Sunday, November 8, 2020 3:43 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> 
> <snip>
> 
> >
> > Switch to generic build on arm Travis machines to avoid differences in
> > build configuration caused by different Arm hardware.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  .ci/linux-build.sh | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > d079801d7..7fe0fcfd8
> > 100755
> > --- a/.ci/linux-build.sh
> > +++ b/.ci/linux-build.sh
> > @@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
> >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> >  fi
> >
> > +if [ "$(uname -m)" = "aarch64" ]; then
> > +    OPTS="$OPTS -Dmachine=generic"
> > +fi
> > +
> I do not think we should change it by default. We would need to test generic
> builds as well as the SoC specific build.
> 

I'll drop the patch. Testing without it revealed a failure in clang Graviton2 build (only in that one build, other build are working fine):
../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error: instruction requires: lse

Here's the build with full log: https://travis-ci.com/github/jlinkes/dpdk/jobs/433176503

I think we need to add a commit that fixes the failure but I don't know how to fix it.

> 
> >  if [ "$BUILD_DOCS" = "1" ]; then
> >      OPTS="$OPTS -Denable_docs=true"
> >  fi
> > --
> > 2.20.1


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

* [dpdk-dev] [PATCH v9 00/14] Arm build options rework
  2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
                                 ` (14 preceding siblings ...)
  2020-11-06  8:23               ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Morten Brørup
@ 2020-11-11 13:18               ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 01/14] build: alias default build as generic Juraj Linkeš
                                   ` (16 more replies)
  15 siblings, 17 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds
and aarch64 -> aarch64 (SoC) builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
  option or using a cross file
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native, SoC or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

v9:
Split SoC and implementer dictionaries into smaller parts.
Fixed DPAA and ARMADA SoC configuration.
Added documentation about supported SoCs.

Juraj Linkeš (14):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for generic build
  build: use native machine args in Arm native build
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: disable libnuma in cross builds
  build: add Arm SoC meson option
  config: fix Arm implementer and its SoCs

 buildtools/get_cpu_count.py                   |   7 +
 buildtools/get_numa_count.py                  |  22 +
 buildtools/meson.build                        |   2 +
 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  15 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 503 ++++++++++++------
 config/meson.build                            |  90 +++-
 config/x86/meson.build                        |   2 +
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
 doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |  12 +-
 22 files changed, 504 insertions(+), 216 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 01/14] build: alias default build as generic
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 02/14] build: rename Arm build variables Juraj Linkeš
                                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build                    | 5 +++--
 config/meson.build                        | 9 +++++----
 doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
 meson_options.txt                         | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..d4066ade8 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -148,7 +149,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..c7f7aa6e2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +83,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 3429e2647..c7e12eedf 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
 
 	meson -Denable_docs=true fullbuild  # build and install docs
 
-	meson -Dmachine=default  # use builder-independent baseline -march
+	meson -Dmachine=generic  # use builder-independent baseline -march
 
 	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
 					# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
         re-scan from meson.
 
 .. note::
-        machine=default uses a config that works on all supported architectures
+        machine=generic uses a config that works on all supported architectures
         regardless of the capabilities of the machine where the build is happening.
 
 As well as those settings taken from ``meson configure``, other options
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..bc649f245 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
 option('lib_musdk_dir', type: 'string', value: '',
 	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
-	description: 'set the target machine type')
+	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
 option('max_lcores', type: 'integer', value: 128,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 02/14] build: rename Arm build variables
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 01/14] build: alias default build as generic Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 03/14] build: remove unused or superfluous variables Juraj Linkeš
                                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 114 +++++++++++++--------------
 11 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index d4066ade8..704be567d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -9,7 +9,7 @@ march_opt = '-march=@0@'.format(machine)
 arm_force_native_march = false
 arm_force_generic_march = (machine == 'generic')
 
-flags_common_default = [
+flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
@@ -29,58 +29,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -91,8 +91,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -101,36 +101,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -145,13 +145,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -162,45 +162,45 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
-	foreach flag: flags_common_default
+	foreach flag: flags_common
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 03/14] build: remove unused or superfluous variables
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 01/14] build: alias default build as generic Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 02/14] build: rename Arm build variables Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 04/14] build: reformat and move Arm config and comments Juraj Linkeš
                                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 704be567d..ee9277b5d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -62,7 +58,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -119,17 +114,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -145,11 +132,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -160,14 +145,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -200,7 +186,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 04/14] build: reformat and move Arm config and comments
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (2 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 03/14] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 05/14] build: simplify how Arm flags are processed Juraj Linkeš
                                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armv8_linux_gcc              | 12 +--
 config/arm/meson.build                        | 96 +++++++++++--------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
 3 files changed, 93 insertions(+), 49 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..0099f5ca2 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,16 +13,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
-
-# Valid options for Arm's part_number:
-# 'generic': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
 part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index ee9277b5d..7ab856143 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,15 +5,16 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common = [
-	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
+	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -23,69 +24,86 @@ flags_common = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -96,8 +114,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -105,13 +123,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -123,21 +142,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
+		# generic build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -158,6 +177,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -194,7 +214,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
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..972598835 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -99,3 +99,37 @@ command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+Supported cross-compilation targets
+-----------------------------------
+
+If you wish to build for a target which is not among the current cross-files,
+you may use various combinations of implementer/part number::
+
+   Supported implementers:
+      'generic': Generic armv8
+      '0x41':    Arm
+      '0x43':    Cavium
+      '0x50':    Ampere Computing
+      '0x56':    Marvell ARMADA
+      'dpaa':    NXP DPAA
+
+   Supported part_numbers for generic, 0x41, 0x56, dpaa:
+      'generic': valid for all armv8-a architectures (default value)
+      '0xd03':   cortex-a53
+      '0xd04':   cortex-a35
+      '0xd09':   cortex-a73
+      '0xd0a':   cortex-a75
+      '0xd0b':   cortex-a76
+      '0xd0c':   neoverse-n1
+
+   Supported part_numbers for 0x43:
+      'generic': valid for all Cavium builds
+      '0xa1':    thunderxt88
+      '0xa2':    thunderxt81
+      '0xa3':    thunderxt83
+      '0xaf':    thunderx2t99
+      '0xb2':    octeontx2
+
+   Supported part_numbers for 0x50:
+      'generic': valid for all Ampere builds
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 05/14] build: simplify how Arm flags are processed
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (3 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 04/14] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 06/14] build: organize Arm config into dict Juraj Linkeš
                                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7ab856143..0f8a94ffe 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -150,7 +150,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
 		implementer_config = implementer_generic
@@ -183,34 +182,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 06/14] build: organize Arm config into dict
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (4 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 05/14] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-13  5:48                   ` Honnappa Nagarahalli
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build Juraj Linkeš
                                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 0f8a94ffe..eb15848cb 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -28,115 +28,166 @@ flags_common = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementer_generic = {
+	'description': 'Generic armv8',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 256]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc',
+					     '-moutline-atomics']}
+	}
+}
+
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc',
+				      '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto',
+				  '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+implementer_arm = {
+	'description': 'Arm',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+implementer_cavium = {
+	'description': 'Cavium',
+	'flags': [
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 96],
+		['RTE_MAX_NUMA_NODES', 2]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
+					     '-mcpu=thunderx']},
+		'native': {'machine_args': ['-march=native']},
+		'0xa1': {
+			'machine_args': ['-mcpu=thunderxt88'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa2': {
+			'machine_args': ['-mcpu=thunderxt81'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa3': {
+			'machine_args': ['-mcpu=thunderxt83'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xaf': {
+			'machine_args': ['-march=armv8.1-a+crc+crypto',
+					 '-mcpu=thunderx2t99'],
+			'flags': [
+				['RTE_MACHINE', '"thunderx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_CACHE_LINE_SIZE', 64],
+				['RTE_MAX_LCORE', 256],
+				['RTE_MAX_NUMA_NODES', 2]
+			]
+		},
+		'0xb2': {
+			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
+					 '-mcpu=octeontx2'],
+			'flags': [
+				['RTE_MACHINE', '"octeontx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_EAL_IGB_UIO', false],
+				['RTE_MAX_LCORE', 36],
+				['RTE_MAX_NUMA_NODES', 1]
+			]
+		}
+	}
+}
 
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+implementer_ampere = {
+	'description': 'Ampere Computing',
+	'flags': [
+		['RTE_MACHINE', '"emag"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 32],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': {
+		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					      '-mtune=emag']},
+		'native': {'machine_args':  ['-march=native']}
+	}
+}
+
+implementer_marvell = {
+	'description': 'Marvell ARMADA',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
+
+implementer_dpaa = {
+	'description': 'NXP DPAA',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+implementers = {
+	'generic': implementer_generic,
+	'0x41': implementer_arm,
+	'0x43': implementer_cavium,
+	'0x50': implementer_ampere,
+	'0x56': implementer_marvell,
+	'dpaa': implementer_dpaa
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -152,7 +203,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -167,9 +218,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -179,28 +230,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config[1]
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (5 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 06/14] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-13  5:50                   ` Honnappa Nagarahalli
  2020-11-13 13:11                   ` Thomas Monjalon
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 08/14] build: use native machine args in Arm native build Juraj Linkeš
                                   ` (9 subsequent siblings)
  16 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
 4 files changed, 27 insertions(+), 29 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index eb15848cb..fec06e70c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -48,8 +48,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc',
-				      '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -98,8 +96,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
-					     '-mcpu=thunderx']},
 		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
@@ -149,8 +145,8 @@ implementer_ampere = {
 		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': {
-		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					      '-mtune=emag']},
+		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					  '-mtune=emag']},
 		'native': {'machine_args':  ['-march=native']}
 	}
 }
@@ -200,10 +196,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -216,21 +211,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -240,15 +238,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
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 972598835..6a883b030 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -114,8 +114,10 @@ you may use various combinations of implementer/part number::
       '0x56':    Marvell ARMADA
       'dpaa':    NXP DPAA
 
-   Supported part_numbers for generic, 0x41, 0x56, dpaa:
-      'generic': valid for all armv8-a architectures (default value)
+   Supported part_numbers for generic:
+      'generic': valid for all armv8-a architectures (unoptimized portable build)
+
+   Supported part_numbers for 0x41, 0x56, dpaa:
       '0xd03':   cortex-a53
       '0xd04':   cortex-a35
       '0xd09':   cortex-a73
@@ -124,7 +126,6 @@ you may use various combinations of implementer/part number::
       '0xd0c':   neoverse-n1
 
    Supported part_numbers for 0x43:
-      'generic': valid for all Cavium builds
       '0xa1':    thunderxt88
       '0xa2':    thunderxt81
       '0xa3':    thunderxt83
@@ -132,4 +133,4 @@ you may use various combinations of implementer/part number::
       '0xb2':    octeontx2
 
    Supported part_numbers for 0x50:
-      'generic': valid for all Ampere builds
+      '0x0':     emag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 08/14] build: use native machine args in Arm native build
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (6 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
                                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index fec06e70c..cdbdcee85 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,8 +3,6 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -27,6 +25,7 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-march=native', '-mtune=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -48,7 +47,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -96,7 +94,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
 			'flags': flags_part_number_thunderx
@@ -146,8 +143,7 @@ implementer_ampere = {
 	],
 	'part_number_config': {
 		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					  '-mtune=emag']},
-		'native': {'machine_args':  ['-march=native']}
+					  '-mtune=emag']}
 	}
 }
 
@@ -196,26 +192,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'generic' and not meson.is_cross_build()
-		# generic build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -251,7 +248,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 09/14] build: optional NUMA and cpu counts detection
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (7 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 08/14] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 10/14] build: add core and NUMA counts to cross files Juraj Linkeš
                                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..b269d557b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..be73c5c3f
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index c7f7aa6e2..ce0abe49b 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,8 +231,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -251,6 +249,51 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_lcores is not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+	min_lcores = 2
+	# DPDK must be build for at least 2 cores
+	if max_lcores < min_lcores
+		message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+		max_lcores = min_lcores
+	else
+		message('Found @0@ cores'.format(max_lcores))
+	endif
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+endif
+
+max_numa_nodes = get_option('max_numa_nodes')
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_numa_nodes not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+	message('Found @0@ numa nodes'.format(max_numa_nodes))
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
+
+# check that cpu and numa count is set and error out if it's not set
+if not dpdk_conf.has('RTE_MAX_LCORE')
+	error('Number of cores not specified.')
+endif
+if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+	error('Number of numa nodes not specified.')
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index bc649f245..0c9adb1bb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 10/14] build: add core and NUMA counts to cross files
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (8 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-13  5:53                   ` Honnappa Nagarahalli
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 11/14] build: disable Arm drivers Juraj Linkeš
                                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc                 |  2 ++
 config/arm/arm64_armv8_linux_gcc                  |  2 ++
 config/arm/arm64_bluefield_linux_gcc              |  2 ++
 config/arm/arm64_dpaa_linux_gcc                   |  2 ++
 config/arm/arm64_emag_linux_gcc                   |  2 ++
 config/arm/arm64_graviton2_linux_gcc              |  2 ++
 config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
 config/arm/arm64_octeontx2_linux_gcc              |  2 ++
 config/arm/arm64_stingray_linux_gcc               |  2 ++
 config/arm/arm64_thunderx2_linux_gcc              |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
 config/arm/meson.build                            |  6 ++++--
 config/meson.build                                | 15 +++++++++++++++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
 14 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..73945fbb4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 0099f5ca2..5451a01da 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 # Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
 part_number = 'generic'
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..00101962b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index cdbdcee85..fdc402898 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -38,7 +38,8 @@ implementer_generic = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 128],
-		['RTE_MAX_LCORE', 256]
+		['RTE_MAX_LCORE', 256],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': {
 		'generic': {'machine_args': ['-march=armv8-a+crc',
@@ -76,7 +77,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16]
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': part_number_config_arm
 }
diff --git a/config/meson.build b/config/meson.build
index ce0abe49b..208d1ea01 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -249,6 +249,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 max_lcores = get_option('max_lcores')
 if max_lcores > 0
 	# Overwrite the default value from arch_subdir with user input
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 6a883b030..4e65b271c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -134,3 +134,12 @@ you may use various combinations of implementer/part number::
 
    Supported part_numbers for 0x50:
       '0x0':     emag
+
+Other cross file options
+------------------------
+
+There are other options you may specify in a cross file to tailor the build::
+
+   Supported extra configuration
+      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+      max_lcores = n      # will set RTE_MAX_LCORE
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 11/14] build: disable Arm drivers
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (9 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 10/14] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-13  5:54                   ` Honnappa Nagarahalli
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 12/14] build: disable libnuma in cross builds Juraj Linkeš
                                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works. Remove
unneeded driver options ported from the old makefile system.
Add support for removing drivers for cross builds.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/arm/arm64_armada_linux_gcc                   | 1 +
 config/arm/meson.build                              | 7 +++----
 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
 drivers/meson.build                                 | 6 +++++-
 meson.build                                         | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 73945fbb4..7383f42e2 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index fdc402898..7233db120 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,6 +3,9 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -17,9 +20,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -127,7 +127,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 4e65b271c..210ad4508 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -143,3 +143,7 @@ There are other options you may specify in a cross file to tailor the build::
    Supported extra configuration
       max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
       max_lcores = n      # will set RTE_MAX_LCORE
+
+      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
+         # valid values are directories (optionally with their subdirs)
+         # in the drivers directory
diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..a997387ad 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 12/14] build: disable libnuma in cross builds
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (10 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 11/14] build: disable Arm drivers Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-13  5:55                   ` Honnappa Nagarahalli
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 13/14] build: add Arm SoC meson option Juraj Linkeš
                                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disabled NUMA in Arm cross files.

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

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 7383f42e2..f5403f0a6 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,4 +17,5 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 00101962b..3458b9d7b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = 'dpaa'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@ implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7233db120..a2584b1fb 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -62,8 +62,6 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_USE_C11_MEM_MODEL', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_CACHE_LINE_SIZE', 64],
 			['RTE_MAX_LCORE', 64],
diff --git a/config/meson.build b/config/meson.build
index 208d1ea01..2ddde22b7 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -141,12 +141,19 @@ endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
-	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-	has_libnuma = 1
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+	# don't look for libnuma if explicitly disabled in cross build
+	check_libnuma = false
+endif
+if find_libnuma
+	numa_dep = cc.find_library('numa', required: false)
+	if numa_dep.found() and cc.has_header('numaif.h')
+		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+		has_libnuma = 1
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0
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 210ad4508..063661ebf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -147,3 +147,7 @@ There are other options you may specify in a cross file to tailor the build::
       disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
          # valid values are directories (optionally with their subdirs)
          # in the drivers directory
+
+      numa = false        # set to false to force building for a non-NUMA system
+         # if not set or set to true, the build system will build for a NUMA
+         # system only if libnuma is installed
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 13/14] build: add Arm SoC meson option
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (11 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 12/14] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-13  5:57                   ` Honnappa Nagarahalli
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
                                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   5 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 129 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
 meson_options.txt                             |   2 +
 14 files changed, 166 insertions(+), 106 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index f5403f0a6..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da..64d44ead8 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 3458b9d7b..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,7 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index a2584b1fb..d991f9954 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -30,7 +30,7 @@ native_machine_args = ['-march=native', '-mtune=native']
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -180,6 +180,99 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines.',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false,
+	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -192,11 +285,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -215,8 +315,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -242,8 +361,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 063661ebf..83bdb78bf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -100,54 +100,32 @@ command::
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
-         # valid values are directories (optionally with their subdirs)
-         # in the drivers directory
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Darm_soc meson
+option::
+
+   meson soc_build -Darm_soc=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   soc = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index 0c9adb1bb..7563a139e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')
 option('armv8_crypto_dir', type: 'string', value: '',
 	description: 'path to the armv8_crypto library installation directory')
 option('disable_drivers', type: 'string', value: '',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v9 14/14] config: fix Arm implementer and its SoCs
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (12 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 13/14] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-11 13:18                 ` Juraj Linkeš
  2020-11-13  6:05                   ` Honnappa Nagarahalli
  2020-11-12 17:00                 ` [dpdk-dev] [PATCH v9 00/14] Arm build options rework Jerin Jacob
                                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 13:18 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index d991f9954..b06dfb5ed 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -75,8 +75,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -146,38 +146,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -190,8 +164,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
 }
@@ -200,13 +178,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -243,6 +231,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-11 11:45                   ` Juraj Linkeš
@ 2020-11-11 14:52                     ` Ruifeng Wang
  2020-11-11 16:19                       ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Ruifeng Wang @ 2020-11-11 14:52 UTC (permalink / raw)
  To: Juraj Linkeš,
	Honnappa Nagarahalli, bruce.richardson, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, November 11, 2020 7:46 PM
> To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil
> Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> 
> 
> 
> > -----Original Message-----
> > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Sent: Sunday, November 8, 2020 3:43 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Phil
> > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > ferruh.yigit@intel.com; aconole@redhat.com
> > Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> >
> > <snip>
> >
> > >
> > > Switch to generic build on arm Travis machines to avoid differences
> > > in build configuration caused by different Arm hardware.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > ---
> > >  .ci/linux-build.sh | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > > d079801d7..7fe0fcfd8
> > > 100755
> > > --- a/.ci/linux-build.sh
> > > +++ b/.ci/linux-build.sh
> > > @@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
> > >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> > >  fi
> > >
> > > +if [ "$(uname -m)" = "aarch64" ]; then
> > > +    OPTS="$OPTS -Dmachine=generic"
> > > +fi
> > > +
> > I do not think we should change it by default. We would need to test
> > generic builds as well as the SoC specific build.
> >
> 
> I'll drop the patch. Testing without it revealed a failure in clang Graviton2
> build (only in that one build, other build are working fine):
> ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error: instruction
> requires: lse
> 
> Here's the build with full log: https://travis-
> ci.com/github/jlinkes/dpdk/jobs/433176503
> 
> I think we need to add a commit that fixes the failure but I don't know how
> to fix it.

Can you try '-mcpu=native' instead of '-march=native -mtune=native' for native build?
Clang doesn't support '-march=native'.
Reference can be found here:
https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu
> 
> >
> > >  if [ "$BUILD_DOCS" = "1" ]; then
> > >      OPTS="$OPTS -Denable_docs=true"
> > >  fi
> > > --
> > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-11 14:52                     ` Ruifeng Wang
@ 2020-11-11 16:19                       ` Juraj Linkeš
  2020-11-11 23:47                         ` Honnappa Nagarahalli
  2020-11-12 10:36                         ` Ruifeng Wang
  0 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-11 16:19 UTC (permalink / raw)
  To: Ruifeng Wang, Honnappa Nagarahalli, bruce.richardson, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd, nd



> -----Original Message-----
> From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> Sent: Wednesday, November 11, 2020 3:52 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; bruce.richardson@intel.com; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> 
> 
> > -----Original Message-----
> > From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Sent: Wednesday, November 11, 2020 7:46 PM
> > To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil
> > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> > aconole@redhat.com
> > Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> >
> >
> >
> > > -----Original Message-----
> > > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > Sent: Sunday, November 8, 2020 3:43 PM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > Phil
> > > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > > hemant.agrawal@nxp.com; Ajit Khaparde
> > > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > > ferruh.yigit@intel.com; aconole@redhat.com
> > > Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> > >
> > > <snip>
> > >
> > > >
> > > > Switch to generic build on arm Travis machines to avoid
> > > > differences in build configuration caused by different Arm hardware.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > ---
> > > >  .ci/linux-build.sh | 4 ++++
> > > >  1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > > > d079801d7..7fe0fcfd8
> > > > 100755
> > > > --- a/.ci/linux-build.sh
> > > > +++ b/.ci/linux-build.sh
> > > > @@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
> > > >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> > > >  fi
> > > >
> > > > +if [ "$(uname -m)" = "aarch64" ]; then
> > > > +    OPTS="$OPTS -Dmachine=generic"
> > > > +fi
> > > > +
> > > I do not think we should change it by default. We would need to test
> > > generic builds as well as the SoC specific build.
> > >
> >
> > I'll drop the patch. Testing without it revealed a failure in clang
> > Graviton2 build (only in that one build, other build are working fine):
> > ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error:
> > instruction
> > requires: lse
> >
> > Here's the build with full log: https://travis-
> > ci.com/github/jlinkes/dpdk/jobs/433176503
> >
> > I think we need to add a commit that fixes the failure but I don't
> > know how to fix it.
> 
> Can you try '-mcpu=native' instead of '-march=native -mtune=native' for native
> build?
> Clang doesn't support '-march=native'.
> Reference can be found here:
> https://community.arm.com/developer/tools-software/tools/b/tools-software-
> ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu
> >

Unfortunately, it did not help:
Compiler for C supports arguments -mcpu=native: YES
Message: Using machine args: ['-mcpu=native']
...
../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error: instruction requires: lse

Full log here: https://travis-ci.com/github/jlinkes/dpdk/jobs/433414180

> > >
> > > >  if [ "$BUILD_DOCS" = "1" ]; then
> > > >      OPTS="$OPTS -Denable_docs=true"
> > > >  fi
> > > > --
> > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-11 16:19                       ` Juraj Linkeš
@ 2020-11-11 23:47                         ` Honnappa Nagarahalli
  2020-11-12 10:36                         ` Ruifeng Wang
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-11 23:47 UTC (permalink / raw)
  To: Juraj Linkeš,
	Ruifeng Wang, bruce.richardson, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> > > > >
> > > > > Switch to generic build on arm Travis machines to avoid
> > > > > differences in build configuration caused by different Arm hardware.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > ---
> > > > >  .ci/linux-build.sh | 4 ++++
> > > > >  1 file changed, 4 insertions(+)
> > > > >
> > > > > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > > > > d079801d7..7fe0fcfd8
> > > > > 100755
> > > > > --- a/.ci/linux-build.sh
> > > > > +++ b/.ci/linux-build.sh
> > > > > @@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
> > > > >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> > > > >  fi
> > > > >
> > > > > +if [ "$(uname -m)" = "aarch64" ]; then
> > > > > +    OPTS="$OPTS -Dmachine=generic"
> > > > > +fi
> > > > > +
> > > > I do not think we should change it by default. We would need to
> > > > test generic builds as well as the SoC specific build.
> > > >
> > >
> > > I'll drop the patch. Testing without it revealed a failure in clang
> > > Graviton2 build (only in that one build, other build are working fine):
> > > ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error:
> > > instruction
> > > requires: lse
> > >
> > > Here's the build with full log: https://travis-
> > > ci.com/github/jlinkes/dpdk/jobs/433176503
> > >
> > > I think we need to add a commit that fixes the failure but I don't
> > > know how to fix it.
> >
> > Can you try '-mcpu=native' instead of '-march=native -mtune=native'
> > for native build?
> > Clang doesn't support '-march=native'.
> > Reference can be found here:
> > https://community.arm.com/developer/tools-software/tools/b/tools-
> softw
> > are-
> > ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mc
> > pu
> > >
> 
> Unfortunately, it did not help:
> Compiler for C supports arguments -mcpu=native: YES
> Message: Using machine args: ['-mcpu=native'] ...
> ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error: instruction
> requires: lse
> 
> Full log here: https://travis-ci.com/github/jlinkes/dpdk/jobs/433414180
> 
I was able to reproduce this on N1SDP through some hacks. The current code uses the flags " -march=armv8.2-a+crypto -mcpu=neoverse-n1" and the compilation succeeds.

With "-march=native, -mtune=native", the build fails
"-march=native" I see the message " Compiler for C supports arguments -march=native: NO (cached)" and the build fails
"-mtune=native" I see the message " Compiler for C supports arguments -mtune=native: YES (cached)" and the build fails
"-mcpu=native" I see the message "Compiler for C supports arguments -mcpu=native: YES" and the build fails.

Looks like a compiler issue to me

> > > >
> > > > >  if [ "$BUILD_DOCS" = "1" ]; then
> > > > >      OPTS="$OPTS -Denable_docs=true"
> > > > >  fi
> > > > > --
> > > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-11 16:19                       ` Juraj Linkeš
  2020-11-11 23:47                         ` Honnappa Nagarahalli
@ 2020-11-12 10:36                         ` Ruifeng Wang
  2020-11-12 12:43                           ` Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Ruifeng Wang @ 2020-11-12 10:36 UTC (permalink / raw)
  To: Juraj Linkeš,
	Honnappa Nagarahalli, bruce.richardson, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd, nd, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Thursday, November 12, 2020 12:19 AM
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; bruce.richardson@intel.com; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>; nd
> <nd@arm.com>
> Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> 
> 
> 
> > -----Original Message-----
> > From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> > Sent: Wednesday, November 11, 2020 3:52 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; bruce.richardson@intel.com; Phil Yang
> > <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> > aconole@redhat.com
> > Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>; nd
> <nd@arm.com>
> > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> >
> >
> > > -----Original Message-----
> > > From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Sent: Wednesday, November 11, 2020 7:46 PM
> > > To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> > > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > > Phil Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik
> Thakkar
> > > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > > hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com)
> > > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> > > aconole@redhat.com
> > > Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> > > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > > Sent: Sunday, November 8, 2020 3:43 PM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > > Phil
> > > > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > > > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > > > hemant.agrawal@nxp.com; Ajit Khaparde
> > > > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > > > ferruh.yigit@intel.com; aconole@redhat.com
> > > > Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > > > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > > > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> > > >
> > > > <snip>
> > > >
> > > > >
> > > > > Switch to generic build on arm Travis machines to avoid
> > > > > differences in build configuration caused by different Arm hardware.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > ---
> > > > >  .ci/linux-build.sh | 4 ++++
> > > > >  1 file changed, 4 insertions(+)
> > > > >
> > > > > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > > > > d079801d7..7fe0fcfd8
> > > > > 100755
> > > > > --- a/.ci/linux-build.sh
> > > > > +++ b/.ci/linux-build.sh
> > > > > @@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
> > > > >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> > > > >  fi
> > > > >
> > > > > +if [ "$(uname -m)" = "aarch64" ]; then
> > > > > +    OPTS="$OPTS -Dmachine=generic"
> > > > > +fi
> > > > > +
> > > > I do not think we should change it by default. We would need to
> > > > test generic builds as well as the SoC specific build.
> > > >
> > >
> > > I'll drop the patch. Testing without it revealed a failure in clang
> > > Graviton2 build (only in that one build, other build are working fine):
> > > ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error:
> > > instruction
> > > requires: lse
> > >
> > > Here's the build with full log: https://travis-
> > > ci.com/github/jlinkes/dpdk/jobs/433176503
> > >
> > > I think we need to add a commit that fixes the failure but I don't
> > > know how to fix it.
> >
> > Can you try '-mcpu=native' instead of '-march=native -mtune=native'
> > for native build?
> > Clang doesn't support '-march=native'.
> > Reference can be found here:
> > https://community.arm.com/developer/tools-software/tools/b/tools-
> softw
> > are-
> > ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mc
> > pu
> > >
> 
> Unfortunately, it did not help:
> Compiler for C supports arguments -mcpu=native: YES
> Message: Using machine args: ['-mcpu=native'] ...
> ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error: instruction
> requires: lse
> 
> Full log here: https://travis-ci.com/github/jlinkes/dpdk/jobs/433414180
> 
I created a patch to fix this issue:
http://patches.dpdk.org/patch/84054/
It fixes build when using native detection on N1 with Clang < version 11.
> > > >
> > > > >  if [ "$BUILD_DOCS" = "1" ]; then
> > > > >      OPTS="$OPTS -Denable_docs=true"
> > > > >  fi
> > > > > --
> > > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds
  2020-11-12 10:36                         ` Ruifeng Wang
@ 2020-11-12 12:43                           ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-12 12:43 UTC (permalink / raw)
  To: Ruifeng Wang, Honnappa Nagarahalli, bruce.richardson, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aconole
  Cc: dev, nd, nd, nd, nd



> -----Original Message-----
> From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> Sent: Thursday, November 12, 2020 11:37 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; bruce.richardson@intel.com; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com; aconole@redhat.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>; nd <nd@arm.com>;
> nd <nd@arm.com>
> Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> 
> 
> > -----Original Message-----
> > From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Sent: Thursday, November 12, 2020 12:19 AM
> > To: Ruifeng Wang <Ruifeng.Wang@arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; bruce.richardson@intel.com; Phil Yang
> > <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> > aconole@redhat.com
> > Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>; nd
> <nd@arm.com>
> > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> >
> >
> >
> > > -----Original Message-----
> > > From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> > > Sent: Wednesday, November 11, 2020 3:52 PM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Honnappa Nagarahalli
> > > <Honnappa.Nagarahalli@arm.com>; bruce.richardson@intel.com; Phil
> > > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > > hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> > > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> > > aconole@redhat.com
> > > Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>; nd
> > <nd@arm.com>
> > > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> > >
> > >
> > > > -----Original Message-----
> > > > From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Sent: Wednesday, November 11, 2020 7:46 PM
> > > > To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> > > > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > > > Phil Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik
> > Thakkar
> > > > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > > > hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com)
> > > > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> > > > aconole@redhat.com
> > > > Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> > > > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > > > Sent: Sunday, November 8, 2020 3:43 PM
> > > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > > > > bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > > > Phil
> > > > > Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > > > > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > > > > hemant.agrawal@nxp.com; Ajit Khaparde
> > > > > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > > > > ferruh.yigit@intel.com; aconole@redhat.com
> > > > > Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > > > > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > > > > Subject: RE: [PATCH v8 09/14] ci: switch to generic Arm builds
> > > > >
> > > > > <snip>
> > > > >
> > > > > >
> > > > > > Switch to generic build on arm Travis machines to avoid
> > > > > > differences in build configuration caused by different Arm hardware.
> > > > > >
> > > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > > ---
> > > > > >  .ci/linux-build.sh | 4 ++++
> > > > > >  1 file changed, 4 insertions(+)
> > > > > >
> > > > > > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > > > > > d079801d7..7fe0fcfd8
> > > > > > 100755
> > > > > > --- a/.ci/linux-build.sh
> > > > > > +++ b/.ci/linux-build.sh
> > > > > > @@ -33,6 +33,10 @@ if [ "$AARCH64" = "1" ]; then
> > > > > >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> > > > > >  fi
> > > > > >
> > > > > > +if [ "$(uname -m)" = "aarch64" ]; then
> > > > > > +    OPTS="$OPTS -Dmachine=generic"
> > > > > > +fi
> > > > > > +
> > > > > I do not think we should change it by default. We would need to
> > > > > test generic builds as well as the SoC specific build.
> > > > >
> > > >
> > > > I'll drop the patch. Testing without it revealed a failure in
> > > > clang
> > > > Graviton2 build (only in that one build, other build are working fine):
> > > > ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error:
> > > > instruction
> > > > requires: lse
> > > >
> > > > Here's the build with full log: https://travis-
> > > > ci.com/github/jlinkes/dpdk/jobs/433176503
> > > >
> > > > I think we need to add a commit that fixes the failure but I don't
> > > > know how to fix it.
> > >
> > > Can you try '-mcpu=native' instead of '-march=native -mtune=native'
> > > for native build?
> > > Clang doesn't support '-march=native'.
> > > Reference can be found here:
> > > https://community.arm.com/developer/tools-software/tools/b/tools-
> > softw
> > > are-
> > > ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-
> > > mc
> > > pu
> > > >
> >
> > Unfortunately, it did not help:
> > Compiler for C supports arguments -mcpu=native: YES
> > Message: Using machine args: ['-mcpu=native'] ...
> > ../lib/librte_eal/arm/include/rte_atomic_64.h:76:39: error:
> > instruction
> > requires: lse
> >
> > Full log here:
> > https://travis-ci.com/github/jlinkes/dpdk/jobs/433414180
> >
> I created a patch to fix this issue:
> http://patches.dpdk.org/patch/84054/
> It fixes build when using native detection on N1 with Clang < version 11.

Thanks for fixing the issue, Ruifeng. Should I add it to this patch series?

> > > > >
> > > > > >  if [ "$BUILD_DOCS" = "1" ]; then
> > > > > >      OPTS="$OPTS -Denable_docs=true"
> > > > > >  fi
> > > > > > --
> > > > > > 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 00/14] Arm build options rework
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (13 preceding siblings ...)
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-11-12 17:00                 ` Jerin Jacob
  2020-11-13  6:59                 ` Dharmik Thakkar
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
  16 siblings, 0 replies; 465+ messages in thread
From: Jerin Jacob @ 2020-11-12 17:00 UTC (permalink / raw)
  To: Juraj Linkeš, Thomas Monjalon
  Cc: Richardson, Bruce, Ruifeng Wang (Arm Technology China),
	Honnappa Nagarahalli, Phil Yang, Vimal Chungath, Dharmik Thakkar,
	Hemant Agrawal, Ajit Khaparde, Ferruh Yigit, dpdk-dev

On Wed, Nov 11, 2020 at 6:48 PM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
> The current way of specifying Arm configuration options is insufficient
> since we can't identify the SoC we're building for from the MIDR
> information. For example, we can't distinguish between N1SDP, Graviton2
> or Ampere Altra.
>
> Add a way to specify the cpu count and numa node count for cross builds
> and aarch64 -> aarch64 (SoC) builds.
>
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed
> 2. a cross build on a fast aarch64 machine but with target SoC which
>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in SoC configuration.
>
> Among libraries, only libnuma can be now disabled.
>
> Also add an optional way to discover cpu count a numa node count. Fix
> -Dmax_lcores and -Dmax_numa_nodes for arm builds.


Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Jerin Jacob <jerinj@marvell.com>

# Verified the mcpu and cache line aspects of generic an octeontx2 build
# Test the performance of build. No regression see with testpmd,
l2fwd, and l3fwd,

I would suggest merging this for RC4. Additional features/enhancements
can be done in 21.02 for release.

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

* Re: [dpdk-dev] [PATCH v9 06/14] build: organize Arm config into dict
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 06/14] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-13  5:48                   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-13  5:48 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Use dictionary lookup instead of checking for existing variables, iterating over
> all elements in the list or checking lists for optional configuration. Move
> variable contents into the dictionary for variables that would be referenced
> only once.
> Fallback to generic part number if the discovered part number is unknown.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  config/arm/meson.build | 298 ++++++++++++++++++++++++-----------------
>  1 file changed, 178 insertions(+), 120 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 0f8a94ffe..eb15848cb 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -28,115 +28,166 @@ flags_common = [
>  	['RTE_CACHE_LINE_SIZE', 128]
>  ]
> 
> -# implementer specific aarch64 flags, with middle priority -# (will overwrite
> common flags) -flags_implementer_generic = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 256]
> -]
> -flags_implementer_arm = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16]
> -]
> -flags_implementer_cavium = [
> -	['RTE_MAX_VFIO_GROUPS', 128],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 96],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_implementer_dpaa = [
> -	['RTE_MACHINE', '"dpaa"'],
> -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_emag = [
> -	['RTE_MACHINE', '"emag"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 32],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_armada = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> +## Part numbers are specific to Arm implementers # implementer specific
> +aarch64 flags have middle priority
> +#     (will overwrite common flags)
> +# part number specific aarch64 flags have the highest priority
> +#     (will overwrite both common and implementer specific flags)
> +implementer_generic = {
> +	'description': 'Generic armv8',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 128],
> +		['RTE_MAX_LCORE', 256]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args': ['-march=armv8-a+crc',
> +					     '-moutline-atomics']}
> +	}
> +}
> +
> +part_number_config_arm = {
> +	'generic': {'machine_args':  ['-march=armv8-a+crc',
> +				      '-moutline-atomics']},
> +	'native': {'machine_args':  ['-march=native']},
> +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> +	'0xd0c': {
> +		'machine_args':  ['-march=armv8.2-a+crypto',
> +				  '-mcpu=neoverse-n1'],
> +		'flags': [
> +			['RTE_MACHINE', '"neoverse-n1"'],
> +			['RTE_ARM_FEATURE_ATOMICS', true],
> +			['RTE_USE_C11_MEM_MODEL', true],
> +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> +			['RTE_LIBRTE_VHOST_NUMA', false],
> +			['RTE_MAX_MEM_MB', 1048576],
> +			['RTE_CACHE_LINE_SIZE', 64],
> +			['RTE_MAX_LCORE', 64],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		]
> +	}
> +}
> +implementer_arm = {
> +	'description': 'Arm',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16]
> +	],
> +	'part_number_config': part_number_config_arm }
> 
> -# part number specific aarch64 flags, with highest priority -# (will overwrite
> both common and implementer specific flags)  flags_part_number_thunderx
> = [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]
>  ]
> -flags_part_number_thunderx2 = [
> -	['RTE_MACHINE', '"thunderx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 256],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_part_number_octeontx2 = [
> -	['RTE_MACHINE', '"octeontx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_IGB_UIO', false],
> -	['RTE_MAX_LCORE', 36],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_part_number_n1generic = [
> -	['RTE_MACHINE', '"neoverse-n1"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false],
> -	['RTE_MAX_MEM_MB', 1048576],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 64],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> +implementer_cavium = {
> +	'description': 'Cavium',
> +	'flags': [
> +		['RTE_MAX_VFIO_GROUPS', 128],
> +		['RTE_CACHE_LINE_SIZE', 128],
> +		['RTE_MAX_LCORE', 96],
> +		['RTE_MAX_NUMA_NODES', 2]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
> +					     '-mcpu=thunderx']},
> +		'native': {'machine_args': ['-march=native']},
> +		'0xa1': {
> +			'machine_args': ['-mcpu=thunderxt88'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xa2': {
> +			'machine_args': ['-mcpu=thunderxt81'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xa3': {
> +			'machine_args': ['-mcpu=thunderxt83'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xaf': {
> +			'machine_args': ['-march=armv8.1-a+crc+crypto',
> +					 '-mcpu=thunderx2t99'],
> +			'flags': [
> +				['RTE_MACHINE', '"thunderx2"'],
> +				['RTE_ARM_FEATURE_ATOMICS', true],
> +				['RTE_USE_C11_MEM_MODEL', true],
> +				['RTE_CACHE_LINE_SIZE', 64],
> +				['RTE_MAX_LCORE', 256],
> +				['RTE_MAX_NUMA_NODES', 2]
> +			]
> +		},
> +		'0xb2': {
> +			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
> +					 '-mcpu=octeontx2'],
> +			'flags': [
> +				['RTE_MACHINE', '"octeontx2"'],
> +				['RTE_ARM_FEATURE_ATOMICS', true],
> +				['RTE_USE_C11_MEM_MODEL', true],
> +				['RTE_EAL_IGB_UIO', false],
> +				['RTE_MAX_LCORE', 36],
> +				['RTE_MAX_NUMA_NODES', 1]
> +			]
> +		}
> +	}
> +}
> 
> -# arm config (implementer 0x41) is the default config -
> part_number_config_arm = [
> -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> -	['native', ['-march=native']],
> -	['0xd03', ['-mcpu=cortex-a53']],
> -	['0xd04', ['-mcpu=cortex-a35']],
> -	['0xd07', ['-mcpu=cortex-a57']],
> -	['0xd08', ['-mcpu=cortex-a72']],
> -	['0xd09', ['-mcpu=cortex-a73']],
> -	['0xd0a', ['-mcpu=cortex-a75']],
> -	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> flags_part_number_n1generic]
> -]
> -part_number_config_cavium = [
> -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> -	['native', ['-march=native']],
> -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_part_number_thunderx2],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_part_number_octeontx2]
> -]
> -part_number_config_emag = [
> -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]
> -]
> +implementer_ampere = {
> +	'description': 'Ampere Computing',
> +	'flags': [
> +		['RTE_MACHINE', '"emag"'],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 32],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
> +					      '-mtune=emag']},
> +		'native': {'machine_args':  ['-march=native']}
> +	}
> +}
> +
> +implementer_marvell = {
> +	'description': 'Marvell ARMADA',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': part_number_config_arm }
> +
> +implementer_dpaa = {
> +	'description': 'NXP DPAA',
> +	'flags': [
> +		['RTE_MACHINE', '"dpaa"'],
> +		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': part_number_config_arm }
> 
> -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> implementer_generic = ['Generic armv8', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
> -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium]
> -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> part_number_config_emag]
> -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> flags_implementer_dpaa, part_number_config_arm]
> +## Arm implementers (ID from MIDR in Arm Architecture Reference
> Manual)
> +implementers = {
> +	'generic': implementer_generic,
> +	'0x41': implementer_arm,
> +	'0x43': implementer_cavium,
> +	'0x50': implementer_ampere,
> +	'0x56': implementer_marvell,
> +	'dpaa': implementer_dpaa
> +}
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -152,7 +203,7 @@ else
>  	implementer_id = 'generic'
>  	if machine == 'generic' and not meson.is_cross_build()
>  		# generic build
> -		implementer_config = implementer_generic
> +		implementer_config = implementer['generic']
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# native build
> @@ -167,9 +218,9 @@ else
>  			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> implementer_id, ['generic'])
> +		implementer_config = implementers.get(implementer_id,
> ['generic'])
>  		if implementer_config[0] == 'generic'
> -			implementer_config = implementer_generic
> +			implementer_config = implementer['generic']
>  			part_number = 'generic'
>  		endif
>  		if arm_force_native_march == true
> @@ -179,28 +230,35 @@ else
>  		# cross build
>  		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
>  		part_number = meson.get_cross_property('part_number',
> 'generic')
> -		implementer_config = get_variable('implementer_' +
> implementer_id)
> +		implementer_config = implementers.get(implementer_id)
>  	endif
> 
> -	message('Arm implementer: ' + implementer_config[0])
> +	message('Arm implementer: ' + implementer_config['description'])
>  	message('Arm part number: ' + part_number)
> 
> +	part_number_config = implementer_config['part_number_config']
> +	if part_number_config.has_key(part_number)
> +		# use the specified part_number machine args if found
> +		part_number_config = part_number_config[part_number]
> +	elif not meson.is_cross_build()
> +		# default to generic machine args if part_number is not found
> +		# and not forcing native machine args
> +		# but don't default in cross-builds; if part_number is specified
> +		# incorrectly in a cross-file, it needs to be fixed there
> +		part_number_config = part_number_config['generic']
> +	else
> +		# doing cross build and part number is not in
> part_number_config
> +		error('Cross build part number 0@0 not
> found.'.format(part_number))
> +	endif
> +
>  	# use default flags with implementer flags
> -	dpdk_flags = flags_common + implementer_config[1]
> +	dpdk_flags = flags_common + implementer_config['flags'] +
> +part_number_config.get('flags', [])
> 
> +	# apply supported machine args
>  	machine_args = [] # Clear previous machine args
> -	foreach marg: implementer_config[2]
> -		if marg[0] == part_number
> -			# apply supported machine args
> -			foreach flag: marg[1]
> -				if cc.has_argument(flag)
> -					machine_args += flag
> -				endif
> -			endforeach
> -			if marg.length() > 2
> -				# add extra flags for the part
> -				dpdk_flags += marg[2]
> -			endif
> +	foreach flag: part_number_config['machine_args']
> +		if cc.has_argument(flag)
> +			machine_args += flag
>  		endif
>  	endforeach
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-13  5:50                   ` Honnappa Nagarahalli
  2020-11-13 13:11                   ` Thomas Monjalon
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-13  5:50 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Use generic configuration for the only build where it makes sense - the
> generic build. For other builds, if we don't know either of implementer ID or
> part number, the build is not supported.
> Add part numbers to cross files where fallback to generic configuration is
> assumed.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/arm64_emag_linux_gcc               |  1 +
>  ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
>  config/arm/meson.build                        | 45 +++++++++----------
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
>  4 files changed, 27 insertions(+), 29 deletions(-)  rename
> config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc}
> (93%)
> 
> diff --git a/config/arm/arm64_emag_linux_gcc
> b/config/arm/arm64_emag_linux_gcc index 24f3d533e..c675954fc 100644
> --- a/config/arm/arm64_emag_linux_gcc
> +++ b/config/arm/arm64_emag_linux_gcc
> @@ -14,3 +14,4 @@ endian = 'little'
> 
>  [properties]
>  implementer_id = '0x50'
> +part_number = '0x0'
> diff --git a/config/arm/arm64_thunderx_linux_gcc
> b/config/arm/arm64_thunderxt88_linux_gcc
> similarity index 93%
> rename from config/arm/arm64_thunderx_linux_gcc
> rename to config/arm/arm64_thunderxt88_linux_gcc
> index 670764437..758966262 100644
> --- a/config/arm/arm64_thunderx_linux_gcc
> +++ b/config/arm/arm64_thunderxt88_linux_gcc
> @@ -14,3 +14,4 @@ endian = 'little'
> 
>  [properties]
>  implementer_id = '0x43'
> +part_number = '0xa1'
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> eb15848cb..fec06e70c 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -48,8 +48,6 @@ implementer_generic = {  }
> 
>  part_number_config_arm = {
> -	'generic': {'machine_args':  ['-march=armv8-a+crc',
> -				      '-moutline-atomics']},
>  	'native': {'machine_args':  ['-march=native']},
>  	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
>  	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']}, @@ -98,8 +96,6 @@
> implementer_cavium = {
>  		['RTE_MAX_NUMA_NODES', 2]
>  	],
>  	'part_number_config': {
> -		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
> -					     '-mcpu=thunderx']},
>  		'native': {'machine_args': ['-march=native']},
>  		'0xa1': {
>  			'machine_args': ['-mcpu=thunderxt88'], @@ -149,8
> +145,8 @@ implementer_ampere = {
>  		['RTE_MAX_NUMA_NODES', 1]
>  	],
>  	'part_number_config': {
> -		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
> -					      '-mtune=emag']},
> +		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
> +					  '-mtune=emag']},
>  		'native': {'machine_args':  ['-march=native']}
>  	}
>  }
> @@ -200,10 +196,9 @@ if dpdk_conf.get('RTE_ARCH_32')
>  	machine_args += '-mfpu=neon'
>  else
>  	# aarch64 build
> -	implementer_id = 'generic'
>  	if machine == 'generic' and not meson.is_cross_build()
>  		# generic build
> -		implementer_config = implementer['generic']
> +		implementer_id = 'generic'
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# native build
> @@ -216,21 +211,24 @@ else
>  			cmd_output = cmd.stdout().to_lower().strip().split('
> ')
>  			implementer_id = cmd_output[0]
>  			part_number = cmd_output[3]
> -		endif
> -		# Set to generic if variable is not found
> -		implementer_config = implementers.get(implementer_id,
> ['generic'])
> -		if implementer_config[0] == 'generic'
> -			implementer_config = implementer['generic']
> -			part_number = 'generic'
> +		else
> +			error('Error when getting Arm Implementer ID and
> part number.')
>  		endif
>  		if arm_force_native_march == true
>  			part_number = 'native'
>  		endif
>  	else
>  		# cross build
> -		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
> -		part_number = meson.get_cross_property('part_number',
> 'generic')
> -		implementer_config = implementers.get(implementer_id)
> +		implementer_id =
> meson.get_cross_property('implementer_id')
> +		part_number = meson.get_cross_property('part_number')
> +	endif
> +
> +	if implementers.has_key(implementer_id)
> +		implementer_config = implementers[implementer_id]
> +	else
> +		error('Unsupported Arm implementer: @0@.
> '.format(implementer_id) +
> +		      'Please add support for it or use the generic ' +
> +		      '(-Dmachine=generic) build.')
>  	endif
> 
>  	message('Arm implementer: ' + implementer_config['description'])
> @@ -240,15 +238,12 @@ else
>  	if part_number_config.has_key(part_number)
>  		# use the specified part_number machine args if found
>  		part_number_config = part_number_config[part_number]
> -	elif not meson.is_cross_build()
> -		# default to generic machine args if part_number is not found
> -		# and not forcing native machine args
> -		# but don't default in cross-builds; if part_number is specified
> -		# incorrectly in a cross-file, it needs to be fixed there
> -		part_number_config = part_number_config['generic']
>  	else
> -		# doing cross build and part number is not in
> part_number_config
> -		error('Cross build part number 0@0 not
> found.'.format(part_number))
> +		# unknown part number
> +		error('Unsupported part number @0@ of implementer
> @1@. '
> +		      .format(part_number, implementer_id) +
> +		      'Please add support for it or use the generic ' +
> +		      '(-Dmachine=generic) build.')
>  	endif
> 
>  	# use default flags with implementer flags 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 972598835..6a883b030 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -114,8 +114,10 @@ you may use various combinations of
> implementer/part number::
>        '0x56':    Marvell ARMADA
>        'dpaa':    NXP DPAA
> 
> -   Supported part_numbers for generic, 0x41, 0x56, dpaa:
> -      'generic': valid for all armv8-a architectures (default value)
> +   Supported part_numbers for generic:
> +      'generic': valid for all armv8-a architectures (unoptimized
> + portable build)
> +
> +   Supported part_numbers for 0x41, 0x56, dpaa:
>        '0xd03':   cortex-a53
>        '0xd04':   cortex-a35
>        '0xd09':   cortex-a73
> @@ -124,7 +126,6 @@ you may use various combinations of
> implementer/part number::
>        '0xd0c':   neoverse-n1
> 
>     Supported part_numbers for 0x43:
> -      'generic': valid for all Cavium builds
>        '0xa1':    thunderxt88
>        '0xa2':    thunderxt81
>        '0xa3':    thunderxt83
> @@ -132,4 +133,4 @@ you may use various combinations of
> implementer/part number::
>        '0xb2':    octeontx2
> 
>     Supported part_numbers for 0x50:
> -      'generic': valid for all Ampere builds
> +      '0x0':     emag
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 10/14] build: add core and NUMA counts to cross files
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 10/14] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-13  5:53                   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-13  5:53 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Add support for setting core count and numa nodes in cross files. The values
> specified in cross files will override the default values.
> Also add missing default values to Arm config.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/arm64_armada_linux_gcc                 |  2 ++
>  config/arm/arm64_armv8_linux_gcc                  |  2 ++
>  config/arm/arm64_bluefield_linux_gcc              |  2 ++
>  config/arm/arm64_dpaa_linux_gcc                   |  2 ++
>  config/arm/arm64_emag_linux_gcc                   |  2 ++
>  config/arm/arm64_graviton2_linux_gcc              |  2 ++
>  config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
>  config/arm/arm64_octeontx2_linux_gcc              |  2 ++
>  config/arm/arm64_stingray_linux_gcc               |  2 ++
>  config/arm/arm64_thunderx2_linux_gcc              |  2 ++
>  config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
>  config/arm/meson.build                            |  6 ++++--
>  config/meson.build                                | 15 +++++++++++++++
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
>  14 files changed, 50 insertions(+), 2 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index 52c5f4476..73945fbb4 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
> 
>  [properties]
>  implementer_id = '0x56'
> +max_lcores = 16
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 0099f5ca2..5451a01da 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -16,3 +16,5 @@ endian = 'little'
>  # Generate binaries that are portable across all Armv8 machines
> implementer_id = 'generic'
>  part_number = 'generic'
> +max_lcores = 256
> +max_numa_nodes = 4
> diff --git a/config/arm/arm64_bluefield_linux_gcc
> b/config/arm/arm64_bluefield_linux_gcc
> index b79389d85..4f56790c5 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementer_id = '0x41'
>  part_number = '0xd08'
> +max_lcores = 16
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_dpaa_linux_gcc
> b/config/arm/arm64_dpaa_linux_gcc index 573ae7e42..00101962b 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
> 
>  [properties]
>  implementer_id = 'dpaa'
> +max_lcores = 16
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_emag_linux_gcc
> b/config/arm/arm64_emag_linux_gcc index c675954fc..7cbb05510 100644
> --- a/config/arm/arm64_emag_linux_gcc
> +++ b/config/arm/arm64_emag_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementer_id = '0x50'
>  part_number = '0x0'
> +max_lcores = 32
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_graviton2_linux_gcc
> b/config/arm/arm64_graviton2_linux_gcc
> index 022e06303..d0bfec87d 100644
> --- a/config/arm/arm64_graviton2_linux_gcc
> +++ b/config/arm/arm64_graviton2_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementor_id = '0x41'
>  implementor_pn = '0xd0c'
> +max_lcores = 64
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_n1sdp_linux_gcc
> b/config/arm/arm64_n1sdp_linux_gcc
> index 6fb3f02ea..138ae08c3 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementer_id = '0x41'
>  part_number = '0xd0c'
> +max_lcores = 4
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_octeontx2_linux_gcc
> b/config/arm/arm64_octeontx2_linux_gcc
> index ac1042806..26cf471ad 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementer_id = '0x43'
>  part_number = '0xb2'
> +max_lcores = 36
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_stingray_linux_gcc
> b/config/arm/arm64_stingray_linux_gcc
> index b79389d85..4f56790c5 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementer_id = '0x41'
>  part_number = '0xd08'
> +max_lcores = 16
> +max_numa_nodes = 1
> diff --git a/config/arm/arm64_thunderx2_linux_gcc
> b/config/arm/arm64_thunderx2_linux_gcc
> index dd257745e..c06dcdc2b 100644
> --- a/config/arm/arm64_thunderx2_linux_gcc
> +++ b/config/arm/arm64_thunderx2_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementer_id = '0x43'
>  part_number = '0xaf'
> +max_lcores = 256
> +max_numa_nodes = 2
> diff --git a/config/arm/arm64_thunderxt88_linux_gcc
> b/config/arm/arm64_thunderxt88_linux_gcc
> index 758966262..3ba1528e4 100644
> --- a/config/arm/arm64_thunderxt88_linux_gcc
> +++ b/config/arm/arm64_thunderxt88_linux_gcc
> @@ -15,3 +15,5 @@ endian = 'little'
>  [properties]
>  implementer_id = '0x43'
>  part_number = '0xa1'
> +max_lcores = 96
> +max_numa_nodes = 1
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> cdbdcee85..fdc402898 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -38,7 +38,8 @@ implementer_generic = {
>  		['RTE_MACHINE', '"armv8a"'],
>  		['RTE_USE_C11_MEM_MODEL', true],
>  		['RTE_CACHE_LINE_SIZE', 128],
> -		['RTE_MAX_LCORE', 256]
> +		['RTE_MAX_LCORE', 256],
> +		['RTE_MAX_NUMA_NODES', 4]
>  	],
>  	'part_number_config': {
>  		'generic': {'machine_args': ['-march=armv8-a+crc', @@ -76,7
> +77,8 @@ implementer_arm = {
>  		['RTE_MACHINE', '"armv8a"'],
>  		['RTE_USE_C11_MEM_MODEL', true],
>  		['RTE_CACHE_LINE_SIZE', 64],
> -		['RTE_MAX_LCORE', 16]
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
>  	],
>  	'part_number_config': part_number_config_arm  } diff --git
> a/config/meson.build b/config/meson.build index ce0abe49b..208d1ea01
> 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -249,6 +249,21 @@ compile_time_cpuflags = []
>  subdir(arch_subdir)
>  dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS',
> ','.join(compile_time_cpuflags))
> 
> +# apply cross-specific options
> +if meson.is_cross_build()
> +	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from
> cross file
> +	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
> +	if cross_max_lcores != 0
> +		message('Setting RTE_MAX_LCORE from cross file')
> +		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
> +	endif
> +	cross_max_numa_nodes =
> meson.get_cross_property('max_numa_nodes', 0)
> +	if cross_max_numa_nodes != 0
> +		message('Setting RTE_MAX_NUMA_NODES from cross file')
> +		dpdk_conf.set('RTE_MAX_NUMA_NODES',
> cross_max_numa_nodes)
> +	endif
> +endif
> +
>  max_lcores = get_option('max_lcores')
>  if max_lcores > 0
>  	# Overwrite the default value from arch_subdir with user input 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 6a883b030..4e65b271c 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -134,3 +134,12 @@ you may use various combinations of
> implementer/part number::
> 
>     Supported part_numbers for 0x50:
>        '0x0':     emag
> +
> +Other cross file options
> +------------------------
> +
> +There are other options you may specify in a cross file to tailor the build::
> +
> +   Supported extra configuration
> +      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
> +      max_lcores = n      # will set RTE_MAX_LCORE
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 11/14] build: disable Arm drivers
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 11/14] build: disable Arm drivers Juraj Linkeš
@ 2020-11-13  5:54                   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-13  5:54 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> A few options that disabled drivers in the old makefiles were improperly
> ported to the meson build system. Fix this by adding a to the list of disabled
> drivers, similarly how the command line option works. Remove unneeded
> driver options ported from the old makefile system.
> Add support for removing drivers for cross builds.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/arm64_armada_linux_gcc                   | 1 +
>  config/arm/meson.build                              | 7 +++----
>  doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
>  drivers/meson.build                                 | 6 +++++-
>  meson.build                                         | 1 +
>  5 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index 73945fbb4..7383f42e2 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -17,3 +17,4 @@ endian = 'little'
>  implementer_id = '0x56'
>  max_lcores = 16
>  max_numa_nodes = 1
> +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> fdc402898..7233db120 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -3,6 +3,9 @@
>  # Copyright(c) 2017 Cavium, Inc
>  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
> +# disable Arm drivers for all builds
> +disabled_drivers += ['net/avp', 'net/fm10k']
> +
>  # common flags to all aarch64 builds, with lowest priority  flags_common = [
>  	# Accelerate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -17,9 +20,6 @@ flags_common = [
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> 
> -	['RTE_NET_FM10K', false],
> -	['RTE_NET_AVP', false],
> -
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
>  	['RTE_ARCH_ARM64', true],
> @@ -127,7 +127,6 @@ implementer_cavium = {
>  				['RTE_MACHINE', '"octeontx2"'],
>  				['RTE_ARM_FEATURE_ATOMICS', true],
>  				['RTE_USE_C11_MEM_MODEL', true],
> -				['RTE_EAL_IGB_UIO', false],
>  				['RTE_MAX_LCORE', 36],
>  				['RTE_MAX_NUMA_NODES', 1]
>  			]
> 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 4e65b271c..210ad4508 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -143,3 +143,7 @@ There are other options you may specify in a cross file
> to tailor the build::
>     Supported extra configuration
>        max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
>        max_lcores = n      # will set RTE_MAX_LCORE
> +
> +      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
> +         # valid values are directories (optionally with their subdirs)
> +         # in the drivers directory
> diff --git a/drivers/meson.build b/drivers/meson.build index
> 4bb7e9218..a997387ad 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -18,9 +18,13 @@ subdirs = [
>  	'baseband', # depends on common and bus.
>  ]
> 
> -disabled_drivers = run_command(list_dir_globs,
> get_option('disable_drivers'),
> +disabled_drivers += run_command(list_dir_globs,
> +get_option('disable_drivers'),
>  		).stdout().split()
> 
> +if meson.is_cross_build()
> +	disabled_drivers += meson.get_cross_property('disabled_drivers',
> [])
> +endif
> +
>  default_cflags = machine_args
>  default_cflags += ['-DALLOW_EXPERIMENTAL_API']  default_cflags += ['-
> DALLOW_INTERNAL_API'] diff --git a/meson.build b/meson.build index
> 61d9a4f5f..8dadd70dc 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -21,6 +21,7 @@ dpdk_drivers = []
>  dpdk_extra_ldflags = []
>  dpdk_libs_disabled = []
>  dpdk_drvs_disabled = []
> +disabled_drivers = []
>  abi_version_file = files('ABI_VERSION')
> 
>  if host_machine.cpu_family().startswith('x86')
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 12/14] build: disable libnuma in cross builds
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 12/14] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-13  5:55                   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-13  5:55 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
> for cross build and disabled NUMA in Arm cross files.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/arm64_armada_linux_gcc             |  1 +
>  config/arm/arm64_bluefield_linux_gcc          |  1 +
>  config/arm/arm64_dpaa_linux_gcc               |  1 +
>  config/arm/arm64_graviton2_linux_gcc          |  1 +
>  config/arm/arm64_n1sdp_linux_gcc              |  1 +
>  config/arm/arm64_octeontx2_linux_gcc          |  1 +
>  config/arm/arm64_stingray_linux_gcc           |  1 +
>  config/arm/meson.build                        |  2 --
>  config/meson.build                            | 19 +++++++++++++------
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
>  10 files changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index 7383f42e2..f5403f0a6 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -17,4 +17,5 @@ endian = 'little'
>  implementer_id = '0x56'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
>  disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax'] diff --git
> a/config/arm/arm64_bluefield_linux_gcc
> b/config/arm/arm64_bluefield_linux_gcc
> index 4f56790c5..6bef87fbd 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd08'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_dpaa_linux_gcc
> b/config/arm/arm64_dpaa_linux_gcc index 00101962b..3458b9d7b 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -17,3 +17,4 @@ endian = 'little'
>  implementer_id = 'dpaa'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_graviton2_linux_gcc
> b/config/arm/arm64_graviton2_linux_gcc
> index d0bfec87d..cfe239797 100644
> --- a/config/arm/arm64_graviton2_linux_gcc
> +++ b/config/arm/arm64_graviton2_linux_gcc
> @@ -17,3 +17,4 @@ implementor_id = '0x41'
>  implementor_pn = '0xd0c'
>  max_lcores = 64
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_n1sdp_linux_gcc
> b/config/arm/arm64_n1sdp_linux_gcc
> index 138ae08c3..b00f2d1ef 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd0c'
>  max_lcores = 4
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_octeontx2_linux_gcc
> b/config/arm/arm64_octeontx2_linux_gcc
> index 26cf471ad..593769709 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x43'
>  part_number = '0xb2'
>  max_lcores = 36
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/arm64_stingray_linux_gcc
> b/config/arm/arm64_stingray_linux_gcc
> index 4f56790c5..6bef87fbd 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -17,3 +17,4 @@ implementer_id = '0x41'
>  part_number = '0xd08'
>  max_lcores = 16
>  max_numa_nodes = 1
> +numa = false
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 7233db120..a2584b1fb 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -62,8 +62,6 @@ part_number_config_arm = {
>  			['RTE_MACHINE', '"neoverse-n1"'],
>  			['RTE_ARM_FEATURE_ATOMICS', true],
>  			['RTE_USE_C11_MEM_MODEL', true],
> -			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -			['RTE_LIBRTE_VHOST_NUMA', false],
>  			['RTE_MAX_MEM_MB', 1048576],
>  			['RTE_CACHE_LINE_SIZE', 64],
>  			['RTE_MAX_LCORE', 64],
> diff --git a/config/meson.build b/config/meson.build index
> 208d1ea01..2ddde22b7 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -141,12 +141,19 @@ endif
> 
>  # check for libraries used in multiple places in DPDK  has_libnuma = 0 -
> numa_dep = cc.find_library('numa', required: false) -if numa_dep.found()
> and cc.has_header('numaif.h')
> -	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> -	has_libnuma = 1
> -	add_project_link_arguments('-lnuma', language: 'c')
> -	dpdk_extra_ldflags += '-lnuma'
> +find_libnuma = true
> +if meson.is_cross_build() and not meson.get_cross_property('numa', true)
> +	# don't look for libnuma if explicitly disabled in cross build
> +	check_libnuma = false
> +endif
> +if find_libnuma
> +	numa_dep = cc.find_library('numa', required: false)
> +	if numa_dep.found() and cc.has_header('numaif.h')
> +		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> +		has_libnuma = 1
> +		add_project_link_arguments('-lnuma', language: 'c')
> +		dpdk_extra_ldflags += '-lnuma'
> +	endif
>  endif
> 
>  has_libfdt = 0
> 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 210ad4508..063661ebf 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -147,3 +147,7 @@ There are other options you may specify in a cross file
> to tailor the build::
>        disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
>           # valid values are directories (optionally with their subdirs)
>           # in the drivers directory
> +
> +      numa = false        # set to false to force building for a non-NUMA system
> +         # if not set or set to true, the build system will build for a NUMA
> +         # system only if libnuma is installed
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 13/14] build: add Arm SoC meson option
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 13/14] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-13  5:57                   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-13  5:57 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> Add Arm SoC configuration to Arm meson.build and add a meson option to
> enable those options for native builds. This is preferable to specifying a cross
> file when doing aarch64 -> aarch64 builds, since the cross file specifies the
> toolchain as well.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/arm64_armada_linux_gcc             |   6 +-
>  config/arm/arm64_armv8_linux_gcc              |   5 +-
>  config/arm/arm64_bluefield_linux_gcc          |   6 +-
>  config/arm/arm64_dpaa_linux_gcc               |   5 +-
>  config/arm/arm64_emag_linux_gcc               |   5 +-
>  config/arm/arm64_graviton2_linux_gcc          |   6 +-
>  config/arm/arm64_n1sdp_linux_gcc              |   6 +-
>  config/arm/arm64_octeontx2_linux_gcc          |   6 +-
>  config/arm/arm64_stingray_linux_gcc           |   6 +-
>  config/arm/arm64_thunderx2_linux_gcc          |   5 +-
>  config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
>  config/arm/meson.build                        | 129 +++++++++++++++++-
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
>  meson_options.txt                             |   2 +
>  14 files changed, 166 insertions(+), 106 deletions(-)
> 
> diff --git a/config/arm/arm64_armada_linux_gcc
> b/config/arm/arm64_armada_linux_gcc
> index f5403f0a6..7cc40d1f4 100644
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -14,8 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x56'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> -disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> +soc = 'armada'
> diff --git a/config/arm/arm64_armv8_linux_gcc
> b/config/arm/arm64_armv8_linux_gcc
> index 5451a01da..64d44ead8 100644
> --- a/config/arm/arm64_armv8_linux_gcc
> +++ b/config/arm/arm64_armv8_linux_gcc
> @@ -14,7 +14,4 @@ endian = 'little'
> 
>  [properties]
>  # Generate binaries that are portable across all Armv8 machines -
> implementer_id = 'generic'
> -part_number = 'generic'
> -max_lcores = 256
> -max_numa_nodes = 4
> +soc = 'generic'
> diff --git a/config/arm/arm64_bluefield_linux_gcc
> b/config/arm/arm64_bluefield_linux_gcc
> index 6bef87fbd..7b1fae8b9 100644
> --- a/config/arm/arm64_bluefield_linux_gcc
> +++ b/config/arm/arm64_bluefield_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x41'
> -part_number = '0xd08'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> +soc = 'bluefield'
> diff --git a/config/arm/arm64_dpaa_linux_gcc
> b/config/arm/arm64_dpaa_linux_gcc index 3458b9d7b..e52188842 100644
> --- a/config/arm/arm64_dpaa_linux_gcc
> +++ b/config/arm/arm64_dpaa_linux_gcc
> @@ -14,7 +14,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = 'dpaa'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> +soc = 'dpaa'
> diff --git a/config/arm/arm64_emag_linux_gcc
> b/config/arm/arm64_emag_linux_gcc index 7cbb05510..6c24b4bca 100644
> --- a/config/arm/arm64_emag_linux_gcc
> +++ b/config/arm/arm64_emag_linux_gcc
> @@ -13,7 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x50'
> -part_number = '0x0'
> -max_lcores = 32
> -max_numa_nodes = 1
> +soc = 'emag'
> diff --git a/config/arm/arm64_graviton2_linux_gcc
> b/config/arm/arm64_graviton2_linux_gcc
> index cfe239797..bae35d6be 100644
> --- a/config/arm/arm64_graviton2_linux_gcc
> +++ b/config/arm/arm64_graviton2_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd0c'
> -max_lcores = 64
> -max_numa_nodes = 1
> -numa = false
> +soc = 'graviton2'
> diff --git a/config/arm/arm64_n1sdp_linux_gcc
> b/config/arm/arm64_n1sdp_linux_gcc
> index b00f2d1ef..249ff4738 100644
> --- a/config/arm/arm64_n1sdp_linux_gcc
> +++ b/config/arm/arm64_n1sdp_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x41'
> -part_number = '0xd0c'
> -max_lcores = 4
> -max_numa_nodes = 1
> -numa = false
> +soc = 'n1sdp'
> diff --git a/config/arm/arm64_octeontx2_linux_gcc
> b/config/arm/arm64_octeontx2_linux_gcc
> index 593769709..063018e8f 100644
> --- a/config/arm/arm64_octeontx2_linux_gcc
> +++ b/config/arm/arm64_octeontx2_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x43'
> -part_number = '0xb2'
> -max_lcores = 36
> -max_numa_nodes = 1
> -numa = false
> +soc = 'octeontx2'
> diff --git a/config/arm/arm64_stingray_linux_gcc
> b/config/arm/arm64_stingray_linux_gcc
> index 6bef87fbd..1209a8c0b 100644
> --- a/config/arm/arm64_stingray_linux_gcc
> +++ b/config/arm/arm64_stingray_linux_gcc
> @@ -13,8 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x41'
> -part_number = '0xd08'
> -max_lcores = 16
> -max_numa_nodes = 1
> -numa = false
> +soc = 'stingray'
> diff --git a/config/arm/arm64_thunderx2_linux_gcc
> b/config/arm/arm64_thunderx2_linux_gcc
> index c06dcdc2b..348650712 100644
> --- a/config/arm/arm64_thunderx2_linux_gcc
> +++ b/config/arm/arm64_thunderx2_linux_gcc
> @@ -13,7 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x43'
> -part_number = '0xaf'
> -max_lcores = 256
> -max_numa_nodes = 2
> +soc = 'thunderx2'
> diff --git a/config/arm/arm64_thunderxt88_linux_gcc
> b/config/arm/arm64_thunderxt88_linux_gcc
> index 3ba1528e4..d31d0c6d8 100644
> --- a/config/arm/arm64_thunderxt88_linux_gcc
> +++ b/config/arm/arm64_thunderxt88_linux_gcc
> @@ -13,7 +13,4 @@ cpu = 'armv8-a'
>  endian = 'little'
> 
>  [properties]
> -implementer_id = '0x43'
> -part_number = '0xa1'
> -max_lcores = 96
> -max_numa_nodes = 1
> +soc = 'thunderxt88'
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> a2584b1fb..d991f9954 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -30,7 +30,7 @@ native_machine_args = ['-march=native', '-
> mtune=native']  ## Part numbers are specific to Arm implementers  #
> implementer specific aarch64 flags have middle priority
>  #     (will overwrite common flags)
> -# part number specific aarch64 flags have the highest priority
> +# part number specific aarch64 flags have higher priority
>  #     (will overwrite both common and implementer specific flags)
>  implementer_generic = {
>  	'description': 'Generic armv8',
> @@ -180,6 +180,99 @@ implementers = {
>  	'dpaa': implementer_dpaa
>  }
> 
> +# soc specific aarch64 flags have the highest priority
> +#     (will overwrite all other flags)
> +soc_generic = {
> +	'description': 'Generic un-optimized build for all aarch64 machines.',
> +	'implementer': 'generic',
> +	'part_number': 'generic'
> +}
> +
> +soc_armada = {
> +	'description': 'Marvell ARMADA',
> +	'implementer': '0x56',
> +	'part_number': '0xd08',
> +	'numa': false,
> +	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax'] }
> +
> +soc_bluefield = {
> +	'description': 'NVIDIA BlueField',
> +	'implementer': '0x41',
> +	'part_number': '0xd08',
> +	'numa': false
> +}
> +
> +soc_dpaa = {
> +	'description': 'NXP DPAA',
> +	'implementer': 'dpaa',
> +	'part_number': '0xd08',
> +	'numa': false
> +}
> +
> +soc_emag = {
> +	'description': 'Ampere eMAG',
> +	'implementer': '0x50',
> +	'part_number': '0x0'
> +}
> +
> +soc_graviton2 = {
> +	'description': 'AWS Graviton2',
> +	'implementer': '0x41',
> +	'part_number': '0xd0c',
> +	'numa': false
> +}
> +
> +soc_n1sdp = {
> +	'description': 'Arm Neoverse N1SDP',
> +	'implementer': '0x41',
> +	'part_number': '0xd0c',
> +	'flags': [
> +		['RTE_MAX_LCORE', 4]
> +	],
> +	'numa': false
> +}
> +
> +soc_octeontx2 = {
> +	'description': 'Marvell OCTEON TX2',
> +	'implementer': '0x43',
> +	'part_number': '0xb2',
> +	'numa': false
> +}
> +
> +soc_stingray = {
> +	'description': 'Broadcom Stingray',
> +	'implementer': '0x41',
> +	'part_number': '0xd08',
> +	'numa': false
> +}
> +
> +soc_thunderx2 = {
> +	'description': 'Marvell ThunderX2 T99',
> +	'implementer': '0x43',
> +	'part_number': '0xaf'
> +}
> +
> +soc_thunderxt88 = {
> +	'description': 'Marvell ThunderX T88',
> +	'implementer': '0x43',
> +	'part_number': '0xa1'
> +}
> +
> +socs = {
> +	'generic': soc_generic,
> +	'armada': soc_armada,
> +	'bluefield': soc_bluefield,
> +	'dpaa': soc_dpaa,
> +	'emag': soc_emag,
> +	'graviton2': soc_graviton2,
> +	'n1sdp': soc_n1sdp,
> +	'octeontx2': soc_octeontx2,
> +	'stingray': soc_stingray,
> +	'thunderx2': soc_thunderx2,
> +	'thunderxt88': soc_thunderxt88
> +}
> +
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
> 
> @@ -192,11 +285,18 @@ if dpdk_conf.get('RTE_ARCH_32')  else
>  	# aarch64 build
>  	use_native_machine_args = false
> +	arm_soc = get_option('arm_soc')
> +	soc_config = {}
>  	if not meson.is_cross_build()
>  		if machine == 'generic'
>  			# generic build
> +			if arm_soc != ''
> +				error('Arm SoC is unsupported with generic
> build.')
> +			endif
>  			implementer_id = 'generic'
>  			part_number = 'generic'
> +		elif arm_soc != ''
> +			soc_config = socs.get(arm_soc, {'not_supported':
> true})
>  		else
>  			# native build
>  			# The script returns ['Implementer', 'Variant',
> 'Architecture', @@ -215,8 +315,27 @@ else
>  		endif
>  	else
>  		# cross build
> -		implementer_id =
> meson.get_cross_property('implementer_id')
> -		part_number = meson.get_cross_property('part_number')
> +		arm_soc = meson.get_cross_property('soc', '')
> +		if arm_soc == ''
> +			error('Arm SoC must be specified in the cross file.')
> +		endif
> +		soc_config = socs.get(arm_soc, {'not_supported': true})
> +	endif
> +
> +	soc_flags = []
> +	if soc_config.has_key('not_supported')
> +		error('SoC @0@ not supported.'.format(arm_soc))
> +	elif soc_config != {}
> +		implementer_id = soc_config['implementer']
> +		implementer_config = implementers[implementer_id]
> +		part_number = soc_config['part_number']
> +		soc_flags = soc_config.get('flags', [])
> +		if not soc_config.get('numa', true)
> +			has_libnuma = 0
> +		endif
> +		if soc_config.has_key('disabled_drivers')
> +			disabled_drivers += soc_config['disabled_drivers']
> +		endif
>  	endif
> 
>  	if implementers.has_key(implementer_id)
> @@ -242,8 +361,8 @@ else
>  		      '(-Dmachine=generic) build.')
>  	endif
> 
> -	# use default flags with implementer flags
> -	dpdk_flags = flags_common + implementer_config['flags'] +
> part_number_config.get('flags', [])
> +	# add flags in the proper order
> +	dpdk_flags = flags_common + implementer_config['flags'] +
> +part_number_config.get('flags', []) + soc_flags
> 
>  	# apply supported machine args
>  	machine_args = [] # Clear previous machine args 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 063661ebf..83bdb78bf 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -100,54 +100,32 @@ command::
>  	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
>  	ninja -C arm64-build
> 
> -Supported cross-compilation targets
> ------------------------------------
> -
> -If you wish to build for a target which is not among the current cross-files, -
> you may use various combinations of implementer/part number::
> -
> -   Supported implementers:
> -      'generic': Generic armv8
> -      '0x41':    Arm
> -      '0x43':    Cavium
> -      '0x50':    Ampere Computing
> -      '0x56':    Marvell ARMADA
> -      'dpaa':    NXP DPAA
> -
> -   Supported part_numbers for generic:
> -      'generic': valid for all armv8-a architectures (unoptimized portable build)
> -
> -   Supported part_numbers for 0x41, 0x56, dpaa:
> -      '0xd03':   cortex-a53
> -      '0xd04':   cortex-a35
> -      '0xd09':   cortex-a73
> -      '0xd0a':   cortex-a75
> -      '0xd0b':   cortex-a76
> -      '0xd0c':   neoverse-n1
> -
> -   Supported part_numbers for 0x43:
> -      '0xa1':    thunderxt88
> -      '0xa2':    thunderxt81
> -      '0xa3':    thunderxt83
> -      '0xaf':    thunderx2t99
> -      '0xb2':    octeontx2
> -
> -   Supported part_numbers for 0x50:
> -      '0x0':     emag
> -
> -Other cross file options
> -------------------------
> -
> -There are other options you may specify in a cross file to tailor the build::
> -
> -   Supported extra configuration
> -      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
> -      max_lcores = n      # will set RTE_MAX_LCORE
> -
> -      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
> -         # valid values are directories (optionally with their subdirs)
> -         # in the drivers directory
> -
> -      numa = false        # set to false to force building for a non-NUMA system
> -         # if not set or set to true, the build system will build for a NUMA
> -         # system only if libnuma is installed
> +Building for an aarch64 SoC on an aarch64 build machine
> +-------------------------------------------------------
> +
> +If you wish to build on an aarch64 build machine for a different
> +aarch64 SoC, you don't need a separate cross toolchain, just a
> +different set of configuration options. To build for an aarch64 SoC,
> +use the -Darm_soc meson
> +option::
> +
> +   meson soc_build -Darm_soc=<target_soc>
> +
> +Substitute <target_soc> with one of the supported SoCs::
> +
> +   generic:     Generic un-optimized build for all aarch64 machines.
> +   armada:      Marvell ARMADA
> +   bluefield:   NVIDIA BlueField
> +   dpaa:        NXP DPAA
> +   emag:        Ampere eMAG
> +   graviton2:   AWS Graviton2
> +   n1sdp:       Arm Neoverse N1SDP
> +   octeontx2:   Marvell OCTEON TX2
> +   stingray:    Broadcom Stingray
> +   thunderx2:   Marvell ThunderX2 T99
> +   thunderxt88: Marvell ThunderX T88
> +
> +These SoCs are also used in cross files, e.g.::
> +
> +   [properties]
> +   # Generate binaries that are portable across all Armv8 machines
> +   soc = 'generic'
> diff --git a/meson_options.txt b/meson_options.txt index
> 0c9adb1bb..7563a139e 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -1,5 +1,7 @@
>  # Please keep these options sorted alphabetically.
> 
> +option('arm_soc', type: 'string', value: '',
> +	description: 'Specify if you want to build for a particular aarch64
> +Arm SoC when building on an aarch64 machine.')
>  option('armv8_crypto_dir', type: 'string', value: '',
>  	description: 'path to the armv8_crypto library installation directory')
> option('disable_drivers', type: 'string', value: '',
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 14/14] config: fix Arm implementer and its SoCs
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-11-13  6:05                   ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-13  6:05 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, thomas
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

Hi Juraj,
	The failure in Travis should be fixed by [1]. I think you can include it in this series so that we get a clean build in Travis.

Ajit, Hemant, Vimal, Thomas,
	Appreciate if you could test this series on your respective platforms.

We need testing on x86 as well.

[1] http://patches.dpdk.org/patch/84054/

> 
> Fix the implementer and part number of DPAA and ARMADA SoCs.
> The current values of 16 cores and 1 NUMA node don't cover all SoCs from
> the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
> Increase these to 64 and 4 to widen the coverage.
> Add configuration to SoC options where smaller values are needed.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/meson.build | 54 ++++++++++++++++++------------------------
>  1 file changed, 23 insertions(+), 31 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> d991f9954..b06dfb5ed 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -75,8 +75,8 @@ implementer_arm = {
>  		['RTE_MACHINE', '"armv8a"'],
>  		['RTE_USE_C11_MEM_MODEL', true],
>  		['RTE_CACHE_LINE_SIZE', 64],
> -		['RTE_MAX_LCORE', 16],
> -		['RTE_MAX_NUMA_NODES', 1]
> +		['RTE_MAX_LCORE', 64],
> +		['RTE_MAX_NUMA_NODES', 4]
>  	],
>  	'part_number_config': part_number_config_arm  } @@ -146,38
> +146,12 @@ implementer_ampere = {
>  	}
>  }
> 
> -implementer_marvell = {
> -	'description': 'Marvell ARMADA',
> -	'flags': [
> -		['RTE_MACHINE', '"armv8a"'],
> -		['RTE_CACHE_LINE_SIZE', 64],
> -		['RTE_MAX_LCORE', 16],
> -		['RTE_MAX_NUMA_NODES', 1]
> -	],
> -	'part_number_config': part_number_config_arm
> -}
> -
> -implementer_dpaa = {
> -	'description': 'NXP DPAA',
> -	'flags': [
> -		['RTE_MACHINE', '"dpaa"'],
> -		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> -		['RTE_USE_C11_MEM_MODEL', true],
> -		['RTE_CACHE_LINE_SIZE', 64],
> -		['RTE_MAX_LCORE', 16],
> -		['RTE_MAX_NUMA_NODES', 1]
> -	],
> -	'part_number_config': part_number_config_arm
> -}
> -
>  ## Arm implementers (ID from MIDR in Arm Architecture Reference
> Manual)  implementers = {
>  	'generic': implementer_generic,
>  	'0x41': implementer_arm,
>  	'0x43': implementer_cavium,
> -	'0x50': implementer_ampere,
> -	'0x56': implementer_marvell,
> -	'dpaa': implementer_dpaa
> +	'0x50': implementer_ampere
>  }
> 
>  # soc specific aarch64 flags have the highest priority @@ -190,8 +164,12 @@
> soc_generic = {
> 
>  soc_armada = {
>  	'description': 'Marvell ARMADA',
> -	'implementer': '0x56',
> +	'implementer': '0x41',
>  	'part_number': '0xd08',
> +	'flags': [
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
>  	'numa': false,
>  	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']  } @@ -
> 200,13 +178,23 @@ soc_bluefield = {
>  	'description': 'NVIDIA BlueField',
>  	'implementer': '0x41',
>  	'part_number': '0xd08',
> +	'flags': [
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
>  	'numa': false
>  }
> 
>  soc_dpaa = {
>  	'description': 'NXP DPAA',
> -	'implementer': 'dpaa',
> +	'implementer': '0x41',
>  	'part_number': '0xd08',
> +	'flags': [
> +		['RTE_MACHINE', '"dpaa"'],
> +		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
>  	'numa': false
>  }
> 
> @@ -243,6 +231,10 @@ soc_octeontx2 = {
>  soc_stingray = {
>  	'description': 'Broadcom Stingray',
>  	'implementer': '0x41',
> +	'flags': [
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
>  	'part_number': '0xd08',
>  	'numa': false
>  }
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 00/14] Arm build options rework
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (14 preceding siblings ...)
  2020-11-12 17:00                 ` [dpdk-dev] [PATCH v9 00/14] Arm build options rework Jerin Jacob
@ 2020-11-13  6:59                 ` Dharmik Thakkar
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
  16 siblings, 0 replies; 465+ messages in thread
From: Dharmik Thakkar @ 2020-11-13  6:59 UTC (permalink / raw)
  To: Juraj ARM
  Cc: Bruce Richardson, Ruifeng Wang, Honnappa Nagarahalli, Phil Yang,
	vcchunga, Jerin Jacob, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	Ferruh Yigit, dev, nd



> On Nov 11, 2020, at 7:18 AM, Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
> 
> The current way of specifying Arm configuration options is insufficient
> since we can't identify the SoC we're building for from the MIDR
> information. For example, we can't distinguish between N1SDP, Graviton2
> or Ampere Altra.
> 
> Add a way to specify the cpu count and numa node count for cross builds
> and aarch64 -> aarch64 (SoC) builds.
> 
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>  without the user having to check which libraries they have installed
> 2. a cross build on a fast aarch64 machine but with target SoC which
>  differs in capabilities or libraries.
> This is achieved by specifying the drivers in SoC configuration.
> 
> Among libraries, only libnuma can be now disabled.
> 
> Also add an optional way to discover cpu count a numa node count. Fix
> -Dmax_lcores and -Dmax_numa_nodes for arm builds.
> 
> The current implementation adds/supports the following:
> * x86 -> aarch64 cross build with added config options/disabled
>  drivers/libs
> * aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
>  option or using a cross file
> * max numa nodes and max lcore may be specified on the command line to
>  overwrite the values for any (native, SoC or cross) build
> 

Tested ok on N1SDP and ThunderX2. No regression seen with testpmd and l3fwd.
Tested using native build, default build and using arm_soc option.
Series Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>


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

* [dpdk-dev] [PATCH v10 00/15] Arm build options rework
  2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
                                   ` (15 preceding siblings ...)
  2020-11-13  6:59                 ` Dharmik Thakkar
@ 2020-11-13 11:09                 ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 01/15] build: alias default build as generic Juraj Linkeš
                                     ` (15 more replies)
  16 siblings, 16 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds
and aarch64 -> aarch64 (SoC) builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
  option or using a cross file
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native, SoC or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

v9:
Split SoC and implementer dictionaries into smaller parts.
Fixed DPAA and ARMADA SoC configuration.
Added documentation about supported SoCs.

v10:
Added a commit that fixes Graviton2 clang build failures in native
build.

Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>

Juraj Linkeš (14):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for generic build
  build: use native machine args in Arm native build
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: disable libnuma in cross builds
  build: add Arm SoC meson option
  config: fix Arm implementer and its SoCs

Ruifeng Wang (1):
  eal/arm: fix clang build of native target

 buildtools/get_cpu_count.py                   |   7 +
 buildtools/get_numa_count.py                  |  22 +
 buildtools/meson.build                        |   2 +
 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  15 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 503 ++++++++++++------
 config/meson.build                            |  90 +++-
 config/x86/meson.build                        |   2 +
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
 doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
 drivers/meson.build                           |   6 +-
 lib/librte_eal/arm/include/rte_atomic_64.h    |   4 +
 meson.build                                   |   1 +
 meson_options.txt                             |  12 +-
 23 files changed, 508 insertions(+), 216 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 01/15] build: alias default build as generic
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 02/15] build: rename Arm build variables Juraj Linkeš
                                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build                    | 5 +++--
 config/meson.build                        | 9 +++++----
 doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
 meson_options.txt                         | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..d4066ade8 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -148,7 +149,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..c7f7aa6e2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +83,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 3429e2647..c7e12eedf 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
 
 	meson -Denable_docs=true fullbuild  # build and install docs
 
-	meson -Dmachine=default  # use builder-independent baseline -march
+	meson -Dmachine=generic  # use builder-independent baseline -march
 
 	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
 					# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
         re-scan from meson.
 
 .. note::
-        machine=default uses a config that works on all supported architectures
+        machine=generic uses a config that works on all supported architectures
         regardless of the capabilities of the machine where the build is happening.
 
 As well as those settings taken from ``meson configure``, other options
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..bc649f245 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -23,7 +23,7 @@ option('kernel_dir', type: 'string', value: '',
 option('lib_musdk_dir', type: 'string', value: '',
 	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
-	description: 'set the target machine type')
+	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
 option('max_lcores', type: 'integer', value: 128,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 02/15] build: rename Arm build variables
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 01/15] build: alias default build as generic Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 03/15] build: remove unused or superfluous variables Juraj Linkeš
                                     ` (13 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 114 +++++++++++++--------------
 11 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index d4066ade8..704be567d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -9,7 +9,7 @@ march_opt = '-march=@0@'.format(machine)
 arm_force_native_march = false
 arm_force_generic_march = (machine == 'generic')
 
-flags_common_default = [
+flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
@@ -29,58 +29,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -91,8 +91,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -101,36 +101,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -145,13 +145,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -162,45 +162,45 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
-	foreach flag: flags_common_default
+	foreach flag: flags_common
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 03/15] build: remove unused or superfluous variables
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 01/15] build: alias default build as generic Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 02/15] build: rename Arm build variables Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 04/15] build: reformat and move Arm config and comments Juraj Linkeš
                                     ` (12 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 704be567d..ee9277b5d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -62,7 +58,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -119,17 +114,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -145,11 +132,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -160,14 +145,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -200,7 +186,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 04/15] build: reformat and move Arm config and comments
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (2 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 03/15] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 05/15] build: simplify how Arm flags are processed Juraj Linkeš
                                     ` (11 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armv8_linux_gcc              | 12 +--
 config/arm/meson.build                        | 96 +++++++++++--------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
 3 files changed, 93 insertions(+), 49 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..0099f5ca2 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,16 +13,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
-
-# Valid options for Arm's part_number:
-# 'generic': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
 part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index ee9277b5d..7ab856143 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,15 +5,16 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common = [
-	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
+	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -23,69 +24,86 @@ flags_common = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -96,8 +114,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -105,13 +123,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -123,21 +142,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
+		# generic build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -158,6 +177,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -194,7 +214,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
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..972598835 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -99,3 +99,37 @@ command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+Supported cross-compilation targets
+-----------------------------------
+
+If you wish to build for a target which is not among the current cross-files,
+you may use various combinations of implementer/part number::
+
+   Supported implementers:
+      'generic': Generic armv8
+      '0x41':    Arm
+      '0x43':    Cavium
+      '0x50':    Ampere Computing
+      '0x56':    Marvell ARMADA
+      'dpaa':    NXP DPAA
+
+   Supported part_numbers for generic, 0x41, 0x56, dpaa:
+      'generic': valid for all armv8-a architectures (default value)
+      '0xd03':   cortex-a53
+      '0xd04':   cortex-a35
+      '0xd09':   cortex-a73
+      '0xd0a':   cortex-a75
+      '0xd0b':   cortex-a76
+      '0xd0c':   neoverse-n1
+
+   Supported part_numbers for 0x43:
+      'generic': valid for all Cavium builds
+      '0xa1':    thunderxt88
+      '0xa2':    thunderxt81
+      '0xa3':    thunderxt83
+      '0xaf':    thunderx2t99
+      '0xb2':    octeontx2
+
+   Supported part_numbers for 0x50:
+      'generic': valid for all Ampere builds
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 05/15] build: simplify how Arm flags are processed
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (3 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 04/15] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 06/15] build: organize Arm config into dict Juraj Linkeš
                                     ` (10 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7ab856143..0f8a94ffe 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -150,7 +150,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
 		implementer_config = implementer_generic
@@ -183,34 +182,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 06/15] build: organize Arm config into dict
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (4 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 05/15] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 07/15] build: isolate configuration for generic build Juraj Linkeš
                                     ` (9 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 298 ++++++++++++++++++++++++-----------------
 1 file changed, 178 insertions(+), 120 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 0f8a94ffe..eb15848cb 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -28,115 +28,166 @@ flags_common = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementer_generic = {
+	'description': 'Generic armv8',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 256]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc',
+					     '-moutline-atomics']}
+	}
+}
+
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc',
+				      '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto',
+				  '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+implementer_arm = {
+	'description': 'Arm',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+implementer_cavium = {
+	'description': 'Cavium',
+	'flags': [
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 96],
+		['RTE_MAX_NUMA_NODES', 2]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
+					     '-mcpu=thunderx']},
+		'native': {'machine_args': ['-march=native']},
+		'0xa1': {
+			'machine_args': ['-mcpu=thunderxt88'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa2': {
+			'machine_args': ['-mcpu=thunderxt81'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa3': {
+			'machine_args': ['-mcpu=thunderxt83'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xaf': {
+			'machine_args': ['-march=armv8.1-a+crc+crypto',
+					 '-mcpu=thunderx2t99'],
+			'flags': [
+				['RTE_MACHINE', '"thunderx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_CACHE_LINE_SIZE', 64],
+				['RTE_MAX_LCORE', 256],
+				['RTE_MAX_NUMA_NODES', 2]
+			]
+		},
+		'0xb2': {
+			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
+					 '-mcpu=octeontx2'],
+			'flags': [
+				['RTE_MACHINE', '"octeontx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_EAL_IGB_UIO', false],
+				['RTE_MAX_LCORE', 36],
+				['RTE_MAX_NUMA_NODES', 1]
+			]
+		}
+	}
+}
 
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+implementer_ampere = {
+	'description': 'Ampere Computing',
+	'flags': [
+		['RTE_MACHINE', '"emag"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 32],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': {
+		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					      '-mtune=emag']},
+		'native': {'machine_args':  ['-march=native']}
+	}
+}
+
+implementer_marvell = {
+	'description': 'Marvell ARMADA',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
+
+implementer_dpaa = {
+	'description': 'NXP DPAA',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+implementers = {
+	'generic': implementer_generic,
+	'0x41': implementer_arm,
+	'0x43': implementer_cavium,
+	'0x50': implementer_ampere,
+	'0x56': implementer_marvell,
+	'dpaa': implementer_dpaa
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -152,7 +203,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -167,9 +218,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -179,28 +230,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config[1]
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 07/15] build: isolate configuration for generic build
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (5 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 06/15] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 08/15] eal/arm: fix clang build of native target Juraj Linkeš
                                     ` (8 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
 4 files changed, 27 insertions(+), 29 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index eb15848cb..fec06e70c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -48,8 +48,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc',
-				      '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -98,8 +96,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
-					     '-mcpu=thunderx']},
 		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
@@ -149,8 +145,8 @@ implementer_ampere = {
 		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': {
-		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					      '-mtune=emag']},
+		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					  '-mtune=emag']},
 		'native': {'machine_args':  ['-march=native']}
 	}
 }
@@ -200,10 +196,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -216,21 +211,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -240,15 +238,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
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 972598835..6a883b030 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -114,8 +114,10 @@ you may use various combinations of implementer/part number::
       '0x56':    Marvell ARMADA
       'dpaa':    NXP DPAA
 
-   Supported part_numbers for generic, 0x41, 0x56, dpaa:
-      'generic': valid for all armv8-a architectures (default value)
+   Supported part_numbers for generic:
+      'generic': valid for all armv8-a architectures (unoptimized portable build)
+
+   Supported part_numbers for 0x41, 0x56, dpaa:
       '0xd03':   cortex-a53
       '0xd04':   cortex-a35
       '0xd09':   cortex-a73
@@ -124,7 +126,6 @@ you may use various combinations of implementer/part number::
       '0xd0c':   neoverse-n1
 
    Supported part_numbers for 0x43:
-      'generic': valid for all Cavium builds
       '0xa1':    thunderxt88
       '0xa2':    thunderxt81
       '0xa3':    thunderxt83
@@ -132,4 +133,4 @@ you may use various combinations of implementer/part number::
       '0xb2':    octeontx2
 
    Supported part_numbers for 0x50:
-      'generic': valid for all Ampere builds
+      '0x0':     emag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 08/15] eal/arm: fix clang build of native target
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (6 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 07/15] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 09/15] build: use native machine args in Arm native build Juraj Linkeš
                                     ` (7 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Ruifeng Wang, stable

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

When doing Clang build with '-mcpu=native' on N1 platform, build failed
with:
../lib/librte_eal/arm/include/rte_atomic_64.h:76:39:
	error: instruction requires: lse
__ATOMIC128_CAS_OP(__cas_128_release, "caspl")

This is because native detection for Neoverse N1 was added in Clang-11.
Prior version of Clang's assembler doesn't know LSE support on hardware.
Fixed this for Clang earlier than version 11 by specifying architecture
for assembler.
Referred to [1] for this fix.

Fixes: 7e2c3e17fe2c ("eal/arm64: add 128-bit atomic compare exchange")
Cc: stable@dpdk.org

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e0d5896bd356cd577f9710a02d7a474cdf58426b

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 lib/librte_eal/arm/include/rte_atomic_64.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/arm/include/rte_atomic_64.h b/lib/librte_eal/arm/include/rte_atomic_64.h
index 2cef88629..7fcd17466 100644
--- a/lib/librte_eal/arm/include/rte_atomic_64.h
+++ b/lib/librte_eal/arm/include/rte_atomic_64.h
@@ -46,6 +46,8 @@ rte_atomic_thread_fence(int memorder)
 /*------------------------ 128 bit atomic operations -------------------------*/
 
 #if defined(__ARM_FEATURE_ATOMICS) || defined(RTE_ARM_FEATURE_ATOMICS)
+#define __LSE_PREAMBLE	".arch armv8-a+lse\n"
+
 #define __ATOMIC128_CAS_OP(cas_op_name, op_string)                          \
 static __rte_noinline rte_int128_t                                          \
 cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
@@ -59,6 +61,7 @@ cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
 	register uint64_t x2 __asm("x2") = (uint64_t)updated.val[0];        \
 	register uint64_t x3 __asm("x3") = (uint64_t)updated.val[1];        \
 	asm volatile(                                                       \
+		__LSE_PREAMBLE						    \
 		op_string " %[old0], %[old1], %[upd0], %[upd1], [%[dst]]"   \
 		: [old0] "+r" (x0),                                         \
 		[old1] "+r" (x1)                                            \
@@ -76,6 +79,7 @@ __ATOMIC128_CAS_OP(__cas_128_acquire, "caspa")
 __ATOMIC128_CAS_OP(__cas_128_release, "caspl")
 __ATOMIC128_CAS_OP(__cas_128_acq_rel, "caspal")
 
+#undef __LSE_PREAMBLE
 #undef __ATOMIC128_CAS_OP
 
 #endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 09/15] build: use native machine args in Arm native build
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (7 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 08/15] eal/arm: fix clang build of native target Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 10/15] build: optional NUMA and cpu counts detection Juraj Linkeš
                                     ` (6 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args usable for both GCC and Clang.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index fec06e70c..bee57f089 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,8 +3,6 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -27,6 +25,7 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -48,7 +47,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -96,7 +94,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
 			'flags': flags_part_number_thunderx
@@ -146,8 +143,7 @@ implementer_ampere = {
 	],
 	'part_number_config': {
 		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					  '-mtune=emag']},
-		'native': {'machine_args':  ['-march=native']}
+					  '-mtune=emag']}
 	}
 }
 
@@ -196,26 +192,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'generic' and not meson.is_cross_build()
-		# generic build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -251,7 +248,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 10/15] build: optional NUMA and cpu counts detection
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (8 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 09/15] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 11/15] build: add core and NUMA counts to cross files Juraj Linkeš
                                     ` (5 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..b269d557b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..be73c5c3f
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index c7f7aa6e2..ce0abe49b 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,8 +231,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -251,6 +249,51 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_lcores is not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+	min_lcores = 2
+	# DPDK must be build for at least 2 cores
+	if max_lcores < min_lcores
+		message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+		max_lcores = min_lcores
+	else
+		message('Found @0@ cores'.format(max_lcores))
+	endif
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+endif
+
+max_numa_nodes = get_option('max_numa_nodes')
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_numa_nodes not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+	message('Found @0@ numa nodes'.format(max_numa_nodes))
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
+
+# check that cpu and numa count is set and error out if it's not set
+if not dpdk_conf.has('RTE_MAX_LCORE')
+	error('Number of cores not specified.')
+endif
+if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+	error('Number of numa nodes not specified.')
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index bc649f245..0c9adb1bb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,10 +26,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 11/15] build: add core and NUMA counts to cross files
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (9 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 10/15] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 12/15] build: disable Arm drivers Juraj Linkeš
                                     ` (4 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                 |  2 ++
 config/arm/arm64_armv8_linux_gcc                  |  2 ++
 config/arm/arm64_bluefield_linux_gcc              |  2 ++
 config/arm/arm64_dpaa_linux_gcc                   |  2 ++
 config/arm/arm64_emag_linux_gcc                   |  2 ++
 config/arm/arm64_graviton2_linux_gcc              |  2 ++
 config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
 config/arm/arm64_octeontx2_linux_gcc              |  2 ++
 config/arm/arm64_stingray_linux_gcc               |  2 ++
 config/arm/arm64_thunderx2_linux_gcc              |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
 config/arm/meson.build                            |  6 ++++--
 config/meson.build                                | 15 +++++++++++++++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
 14 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..73945fbb4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 0099f5ca2..5451a01da 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 # Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
 part_number = 'generic'
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..00101962b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index bee57f089..7945efb72 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -38,7 +38,8 @@ implementer_generic = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 128],
-		['RTE_MAX_LCORE', 256]
+		['RTE_MAX_LCORE', 256],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': {
 		'generic': {'machine_args': ['-march=armv8-a+crc',
@@ -76,7 +77,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16]
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': part_number_config_arm
 }
diff --git a/config/meson.build b/config/meson.build
index ce0abe49b..208d1ea01 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -249,6 +249,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 max_lcores = get_option('max_lcores')
 if max_lcores > 0
 	# Overwrite the default value from arch_subdir with user input
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 6a883b030..4e65b271c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -134,3 +134,12 @@ you may use various combinations of implementer/part number::
 
    Supported part_numbers for 0x50:
       '0x0':     emag
+
+Other cross file options
+------------------------
+
+There are other options you may specify in a cross file to tailor the build::
+
+   Supported extra configuration
+      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+      max_lcores = n      # will set RTE_MAX_LCORE
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 12/15] build: disable Arm drivers
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (10 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 11/15] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 13/15] build: disable libnuma in cross builds Juraj Linkeš
                                     ` (3 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works. Remove
unneeded driver options ported from the old makefile system.
Add support for removing drivers for cross builds.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                   | 1 +
 config/arm/meson.build                              | 7 +++----
 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
 drivers/meson.build                                 | 6 +++++-
 meson.build                                         | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 73945fbb4..7383f42e2 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7945efb72..9b167267f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,6 +3,9 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -17,9 +20,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -127,7 +127,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 4e65b271c..210ad4508 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -143,3 +143,7 @@ There are other options you may specify in a cross file to tailor the build::
    Supported extra configuration
       max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
       max_lcores = n      # will set RTE_MAX_LCORE
+
+      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
+         # valid values are directories (optionally with their subdirs)
+         # in the drivers directory
diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..a997387ad 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 61d9a4f5f..8dadd70dc 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 13/15] build: disable libnuma in cross builds
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (11 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 12/15] build: disable Arm drivers Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 14/15] build: add Arm SoC meson option Juraj Linkeš
                                     ` (2 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disable NUMA in Arm cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_bluefield_linux_gcc          |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_graviton2_linux_gcc          |  1 +
 config/arm/arm64_n1sdp_linux_gcc              |  1 +
 config/arm/arm64_octeontx2_linux_gcc          |  1 +
 config/arm/arm64_stingray_linux_gcc           |  1 +
 config/arm/meson.build                        |  2 --
 config/meson.build                            | 19 +++++++++++++------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
 10 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 7383f42e2..f5403f0a6 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,4 +17,5 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 00101962b..3458b9d7b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = 'dpaa'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@ implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 9b167267f..492b7e40f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -62,8 +62,6 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_USE_C11_MEM_MODEL', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_CACHE_LINE_SIZE', 64],
 			['RTE_MAX_LCORE', 64],
diff --git a/config/meson.build b/config/meson.build
index 208d1ea01..2ddde22b7 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -141,12 +141,19 @@ endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
-	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-	has_libnuma = 1
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+	# don't look for libnuma if explicitly disabled in cross build
+	check_libnuma = false
+endif
+if find_libnuma
+	numa_dep = cc.find_library('numa', required: false)
+	if numa_dep.found() and cc.has_header('numaif.h')
+		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+		has_libnuma = 1
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0
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 210ad4508..063661ebf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -147,3 +147,7 @@ There are other options you may specify in a cross file to tailor the build::
       disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
          # valid values are directories (optionally with their subdirs)
          # in the drivers directory
+
+      numa = false        # set to false to force building for a non-NUMA system
+         # if not set or set to true, the build system will build for a NUMA
+         # system only if libnuma is installed
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 14/15] build: add Arm SoC meson option
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (12 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 13/15] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 15/15] config: fix Arm implementer and its SoCs Juraj Linkeš
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   5 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 129 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
 meson_options.txt                             |   2 +
 14 files changed, 166 insertions(+), 106 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index f5403f0a6..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da..64d44ead8 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 3458b9d7b..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,7 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 492b7e40f..1738e36c3 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -30,7 +30,7 @@ native_machine_args = ['-mcpu=native']
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -180,6 +180,99 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines.',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false,
+	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -192,11 +285,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -215,8 +315,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -242,8 +361,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 063661ebf..83bdb78bf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -100,54 +100,32 @@ command::
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
-         # valid values are directories (optionally with their subdirs)
-         # in the drivers directory
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Darm_soc meson
+option::
+
+   meson soc_build -Darm_soc=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   soc = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index 0c9adb1bb..7563a139e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')
 option('armv8_crypto_dir', type: 'string', value: '',
 	description: 'path to the armv8_crypto library installation directory')
 option('disable_drivers', type: 'string', value: '',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v10 15/15] config: fix Arm implementer and its SoCs
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (13 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 14/15] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-13 11:09                   ` Juraj Linkeš
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:09 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 54 ++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 1738e36c3..f25a7dbab 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -75,8 +75,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -146,38 +146,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -190,8 +164,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
 }
@@ -200,13 +178,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -243,6 +231,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 00/15] Arm build options rework
  2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
                                     ` (14 preceding siblings ...)
  2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 15/15] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-11-13 11:37                   ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 01/15] crypto/armv8: replace meson option with pkg-config support Juraj Linkeš
                                       ` (16 more replies)
  15 siblings, 17 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds
and aarch64 -> aarch64 (SoC) builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
  option or using a cross file
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native, SoC or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

v9:
Split SoC and implementer dictionaries into smaller parts.
Fixed DPAA and ARMADA SoC configuration.
Added documentation about supported SoCs.

v10:
Added a commit that fixes Graviton2 clang build failures in native
build.

v11:
Rebase.

Dharmik Thakkar (1):
  crypto/armv8: replace meson option with pkg-config support

Juraj Linkeš (14):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for generic build
  build: use native machine args in Arm native build
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: disable libnuma in cross builds
  build: add Arm SoC meson option
  config: fix Arm implementer and its SoCs

 buildtools/get_cpu_count.py                   |   7 +
 buildtools/get_numa_count.py                  |  22 +
 buildtools/meson.build                        |   2 +
 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  15 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 503 ++++++++++++------
 config/meson.build                            |  90 +++-
 config/x86/meson.build                        |   2 +
 doc/guides/cryptodevs/armv8.rst               |  10 +-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
 doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
 drivers/crypto/armv8/meson.build              |  19 +-
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |  14 +-
 24 files changed, 516 insertions(+), 235 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 01/15] crypto/armv8: replace meson option with pkg-config support
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 02/15] build: alias default build as generic Juraj Linkeš
                                       ` (15 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Dharmik Thakkar

From: Dharmik Thakkar <dharmik.thakkar@arm.com>

With pkg-config support available within AArch64crypto library,
meson option 'armv8_crypto_dir' can be removed.
PKG_CONFIG_PATH environment variable should be set appropriately
to use the crypto library.

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/cryptodevs/armv8.rst  | 10 ++++++++--
 drivers/crypto/armv8/meson.build | 19 ++++---------------
 meson_options.txt                |  2 --
 3 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/doc/guides/cryptodevs/armv8.rst b/doc/guides/cryptodevs/armv8.rst
index f0f30fe00..8963f66a2 100644
--- a/doc/guides/cryptodevs/armv8.rst
+++ b/doc/guides/cryptodevs/armv8.rst
@@ -37,11 +37,17 @@ To build DPDK with this virtual crypto PMD, the user is required to:
 
    make
 
-* Build DPDK with meson option ``-Darmv8_crypto_dir=<path_to_AArch64cryptolib>``:
+* Add path to `libAArch64crypto.pc` in `PKG_CONFIG_PATH` environment variable:
 
 .. code-block:: console
 
-   meson -Darmv8_crypto_dir=<path_to_AArch64cryptolib> build
+   export PKG_CONFIG_PATH=<path_to_AArch64cryptolib>/pkgconfig/:$PKG_CONFIG_PATH
+
+* Build DPDK:
+
+.. code-block:: console
+
+   meson build
    ninja -C build
 
 The corresponding device can be created only if the following features
diff --git a/drivers/crypto/armv8/meson.build b/drivers/crypto/armv8/meson.build
index c445c5bd3..3289a2adc 100644
--- a/drivers/crypto/armv8/meson.build
+++ b/drivers/crypto/armv8/meson.build
@@ -1,24 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Arm Limited
 
-path = get_option('armv8_crypto_dir')
-if path == ''
+dep = dependency('libAArch64crypto', required: false)
+if not dep.found()
 	build = false
-	reason = 'missing dependency, "armv8_crypto"'
+	reason = 'missing dependency, "libAArch64crypto"'
 	subdir_done()
 endif
 
-inc_dir = path
-
-lib = cc.find_library('libAArch64crypto', dirs: [path], required: false)
-if not lib.found()
-	build = false
-	reason = 'missing dependency, "AArch64crypto"'
-	subdir_done()
-else
-	ext_deps += lib
-	includes += include_directories(inc_dir)
-endif
-
+ext_deps += dep
 deps += ['bus_vdev']
 sources = files('rte_armv8_pmd.c', 'rte_armv8_pmd_ops.c')
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..e384e6dbb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,7 +1,5 @@
 # Please keep these options sorted alphabetically.
 
-option('armv8_crypto_dir', type: 'string', value: '',
-	description: 'path to the armv8_crypto library installation directory')
 option('disable_drivers', type: 'string', value: '',
 	description: 'Comma-separated list of drivers to explicitly disable.')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 02/15] build: alias default build as generic
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 01/15] crypto/armv8: replace meson option with pkg-config support Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 03/15] build: rename Arm build variables Juraj Linkeš
                                       ` (14 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build                    | 5 +++--
 config/meson.build                        | 9 +++++----
 doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
 meson_options.txt                         | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..d4066ade8 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -148,7 +149,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index 258b01d06..c7f7aa6e2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -68,13 +68,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -82,7 +83,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 3429e2647..c7e12eedf 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
 
 	meson -Denable_docs=true fullbuild  # build and install docs
 
-	meson -Dmachine=default  # use builder-independent baseline -march
+	meson -Dmachine=generic  # use builder-independent baseline -march
 
 	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
 					# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
         re-scan from meson.
 
 .. note::
-        machine=default uses a config that works on all supported architectures
+        machine=generic uses a config that works on all supported architectures
         regardless of the capabilities of the machine where the build is happening.
 
 As well as those settings taken from ``meson configure``, other options
diff --git a/meson_options.txt b/meson_options.txt
index e384e6dbb..dd9b37f98 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,7 +21,7 @@ option('kernel_dir', type: 'string', value: '',
 option('lib_musdk_dir', type: 'string', value: '',
 	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
-	description: 'set the target machine type')
+	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
 option('max_lcores', type: 'integer', value: 128,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 03/15] build: rename Arm build variables
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 01/15] crypto/armv8: replace meson option with pkg-config support Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 02/15] build: alias default build as generic Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 04/15] build: remove unused or superfluous variables Juraj Linkeš
                                       ` (13 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 114 +++++++++++++--------------
 11 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index d4066ade8..704be567d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -9,7 +9,7 @@ march_opt = '-march=@0@'.format(machine)
 arm_force_native_march = false
 arm_force_generic_march = (machine == 'generic')
 
-flags_common_default = [
+flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
@@ -29,58 +29,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -91,8 +91,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -101,36 +101,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -145,13 +145,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -162,45 +162,45 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
-	foreach flag: flags_common_default
+	foreach flag: flags_common
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 04/15] build: remove unused or superfluous variables
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (2 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 03/15] build: rename Arm build variables Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 05/15] build: reformat and move Arm config and comments Juraj Linkeš
                                       ` (12 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 704be567d..ee9277b5d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -62,7 +58,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -119,17 +114,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -145,11 +132,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -160,14 +145,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -200,7 +186,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 05/15] build: reformat and move Arm config and comments
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (3 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 04/15] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 06/15] build: simplify how Arm flags are processed Juraj Linkeš
                                       ` (11 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armv8_linux_gcc              | 12 +--
 config/arm/meson.build                        | 96 +++++++++++--------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
 3 files changed, 93 insertions(+), 49 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..0099f5ca2 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,16 +13,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
-
-# Valid options for Arm's part_number:
-# 'generic': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
 part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index ee9277b5d..7ab856143 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,15 +5,16 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common = [
-	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
+	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -23,69 +24,86 @@ flags_common = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -96,8 +114,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -105,13 +123,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -123,21 +142,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
+		# generic build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -158,6 +177,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -194,7 +214,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
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..972598835 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -99,3 +99,37 @@ command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+Supported cross-compilation targets
+-----------------------------------
+
+If you wish to build for a target which is not among the current cross-files,
+you may use various combinations of implementer/part number::
+
+   Supported implementers:
+      'generic': Generic armv8
+      '0x41':    Arm
+      '0x43':    Cavium
+      '0x50':    Ampere Computing
+      '0x56':    Marvell ARMADA
+      'dpaa':    NXP DPAA
+
+   Supported part_numbers for generic, 0x41, 0x56, dpaa:
+      'generic': valid for all armv8-a architectures (default value)
+      '0xd03':   cortex-a53
+      '0xd04':   cortex-a35
+      '0xd09':   cortex-a73
+      '0xd0a':   cortex-a75
+      '0xd0b':   cortex-a76
+      '0xd0c':   neoverse-n1
+
+   Supported part_numbers for 0x43:
+      'generic': valid for all Cavium builds
+      '0xa1':    thunderxt88
+      '0xa2':    thunderxt81
+      '0xa3':    thunderxt83
+      '0xaf':    thunderx2t99
+      '0xb2':    octeontx2
+
+   Supported part_numbers for 0x50:
+      'generic': valid for all Ampere builds
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 06/15] build: simplify how Arm flags are processed
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (4 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 05/15] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 07/15] build: organize Arm config into dict Juraj Linkeš
                                       ` (10 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7ab856143..0f8a94ffe 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -150,7 +150,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
 		implementer_config = implementer_generic
@@ -183,34 +182,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 07/15] build: organize Arm config into dict
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (5 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 06/15] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 08/15] build: isolate configuration for generic build Juraj Linkeš
                                       ` (9 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 298 ++++++++++++++++++++++++-----------------
 1 file changed, 178 insertions(+), 120 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 0f8a94ffe..eb15848cb 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -28,115 +28,166 @@ flags_common = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementer_generic = {
+	'description': 'Generic armv8',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 256]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc',
+					     '-moutline-atomics']}
+	}
+}
+
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc',
+				      '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto',
+				  '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+implementer_arm = {
+	'description': 'Arm',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+implementer_cavium = {
+	'description': 'Cavium',
+	'flags': [
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 96],
+		['RTE_MAX_NUMA_NODES', 2]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
+					     '-mcpu=thunderx']},
+		'native': {'machine_args': ['-march=native']},
+		'0xa1': {
+			'machine_args': ['-mcpu=thunderxt88'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa2': {
+			'machine_args': ['-mcpu=thunderxt81'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa3': {
+			'machine_args': ['-mcpu=thunderxt83'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xaf': {
+			'machine_args': ['-march=armv8.1-a+crc+crypto',
+					 '-mcpu=thunderx2t99'],
+			'flags': [
+				['RTE_MACHINE', '"thunderx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_CACHE_LINE_SIZE', 64],
+				['RTE_MAX_LCORE', 256],
+				['RTE_MAX_NUMA_NODES', 2]
+			]
+		},
+		'0xb2': {
+			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
+					 '-mcpu=octeontx2'],
+			'flags': [
+				['RTE_MACHINE', '"octeontx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_EAL_IGB_UIO', false],
+				['RTE_MAX_LCORE', 36],
+				['RTE_MAX_NUMA_NODES', 1]
+			]
+		}
+	}
+}
 
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+implementer_ampere = {
+	'description': 'Ampere Computing',
+	'flags': [
+		['RTE_MACHINE', '"emag"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 32],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': {
+		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					      '-mtune=emag']},
+		'native': {'machine_args':  ['-march=native']}
+	}
+}
+
+implementer_marvell = {
+	'description': 'Marvell ARMADA',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
+
+implementer_dpaa = {
+	'description': 'NXP DPAA',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+implementers = {
+	'generic': implementer_generic,
+	'0x41': implementer_arm,
+	'0x43': implementer_cavium,
+	'0x50': implementer_ampere,
+	'0x56': implementer_marvell,
+	'dpaa': implementer_dpaa
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -152,7 +203,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -167,9 +218,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -179,28 +230,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config[1]
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 08/15] build: isolate configuration for generic build
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (6 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 07/15] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 09/15] build: use native machine args in Arm native build Juraj Linkeš
                                       ` (8 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
 4 files changed, 27 insertions(+), 29 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index eb15848cb..fec06e70c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -48,8 +48,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc',
-				      '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -98,8 +96,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
-					     '-mcpu=thunderx']},
 		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
@@ -149,8 +145,8 @@ implementer_ampere = {
 		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': {
-		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					      '-mtune=emag']},
+		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					  '-mtune=emag']},
 		'native': {'machine_args':  ['-march=native']}
 	}
 }
@@ -200,10 +196,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -216,21 +211,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -240,15 +238,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
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 972598835..6a883b030 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -114,8 +114,10 @@ you may use various combinations of implementer/part number::
       '0x56':    Marvell ARMADA
       'dpaa':    NXP DPAA
 
-   Supported part_numbers for generic, 0x41, 0x56, dpaa:
-      'generic': valid for all armv8-a architectures (default value)
+   Supported part_numbers for generic:
+      'generic': valid for all armv8-a architectures (unoptimized portable build)
+
+   Supported part_numbers for 0x41, 0x56, dpaa:
       '0xd03':   cortex-a53
       '0xd04':   cortex-a35
       '0xd09':   cortex-a73
@@ -124,7 +126,6 @@ you may use various combinations of implementer/part number::
       '0xd0c':   neoverse-n1
 
    Supported part_numbers for 0x43:
-      'generic': valid for all Cavium builds
       '0xa1':    thunderxt88
       '0xa2':    thunderxt81
       '0xa3':    thunderxt83
@@ -132,4 +133,4 @@ you may use various combinations of implementer/part number::
       '0xb2':    octeontx2
 
    Supported part_numbers for 0x50:
-      'generic': valid for all Ampere builds
+      '0x0':     emag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 09/15] build: use native machine args in Arm native build
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (7 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 08/15] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 10/15] build: optional NUMA and cpu counts detection Juraj Linkeš
                                       ` (7 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args usable for both GCC and Clang.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index fec06e70c..bee57f089 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,8 +3,6 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -27,6 +25,7 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -48,7 +47,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -96,7 +94,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
 			'flags': flags_part_number_thunderx
@@ -146,8 +143,7 @@ implementer_ampere = {
 	],
 	'part_number_config': {
 		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					  '-mtune=emag']},
-		'native': {'machine_args':  ['-march=native']}
+					  '-mtune=emag']}
 	}
 }
 
@@ -196,26 +192,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'generic' and not meson.is_cross_build()
-		# generic build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -251,7 +248,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 10/15] build: optional NUMA and cpu counts detection
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (8 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 09/15] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 11/15] build: add core and NUMA counts to cross files Juraj Linkeš
                                       ` (6 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..b269d557b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..be73c5c3f
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index c7f7aa6e2..ce0abe49b 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,8 +231,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -251,6 +249,51 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_lcores is not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+	min_lcores = 2
+	# DPDK must be build for at least 2 cores
+	if max_lcores < min_lcores
+		message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+		max_lcores = min_lcores
+	else
+		message('Found @0@ cores'.format(max_lcores))
+	endif
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+endif
+
+max_numa_nodes = get_option('max_numa_nodes')
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_numa_nodes not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+	message('Found @0@ numa nodes'.format(max_numa_nodes))
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
+
+# check that cpu and numa count is set and error out if it's not set
+if not dpdk_conf.has('RTE_MAX_LCORE')
+	error('Number of cores not specified.')
+endif
+if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+	error('Number of numa nodes not specified.')
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index dd9b37f98..51ea63a4c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,10 +24,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 11/15] build: add core and NUMA counts to cross files
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (9 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 10/15] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-13 11:37                     ` Juraj Linkeš
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 12/15] build: disable Arm drivers Juraj Linkeš
                                       ` (5 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:37 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                 |  2 ++
 config/arm/arm64_armv8_linux_gcc                  |  2 ++
 config/arm/arm64_bluefield_linux_gcc              |  2 ++
 config/arm/arm64_dpaa_linux_gcc                   |  2 ++
 config/arm/arm64_emag_linux_gcc                   |  2 ++
 config/arm/arm64_graviton2_linux_gcc              |  2 ++
 config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
 config/arm/arm64_octeontx2_linux_gcc              |  2 ++
 config/arm/arm64_stingray_linux_gcc               |  2 ++
 config/arm/arm64_thunderx2_linux_gcc              |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
 config/arm/meson.build                            |  6 ++++--
 config/meson.build                                | 15 +++++++++++++++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
 14 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..73945fbb4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 0099f5ca2..5451a01da 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 # Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
 part_number = 'generic'
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..00101962b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index bee57f089..7945efb72 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -38,7 +38,8 @@ implementer_generic = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 128],
-		['RTE_MAX_LCORE', 256]
+		['RTE_MAX_LCORE', 256],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': {
 		'generic': {'machine_args': ['-march=armv8-a+crc',
@@ -76,7 +77,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16]
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': part_number_config_arm
 }
diff --git a/config/meson.build b/config/meson.build
index ce0abe49b..208d1ea01 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -249,6 +249,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 max_lcores = get_option('max_lcores')
 if max_lcores > 0
 	# Overwrite the default value from arch_subdir with user input
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 6a883b030..4e65b271c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -134,3 +134,12 @@ you may use various combinations of implementer/part number::
 
    Supported part_numbers for 0x50:
       '0x0':     emag
+
+Other cross file options
+------------------------
+
+There are other options you may specify in a cross file to tailor the build::
+
+   Supported extra configuration
+      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+      max_lcores = n      # will set RTE_MAX_LCORE
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 12/15] build: disable Arm drivers
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (10 preceding siblings ...)
  2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 11/15] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-13 11:38                     ` Juraj Linkeš
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 13/15] build: disable libnuma in cross builds Juraj Linkeš
                                       ` (4 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:38 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works. Remove
unneeded driver options ported from the old makefile system.
Add support for removing drivers for cross builds.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                   | 1 +
 config/arm/meson.build                              | 7 +++----
 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
 drivers/meson.build                                 | 6 +++++-
 meson.build                                         | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 73945fbb4..7383f42e2 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7945efb72..9b167267f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,6 +3,9 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -17,9 +20,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -127,7 +127,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 4e65b271c..210ad4508 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -143,3 +143,7 @@ There are other options you may specify in a cross file to tailor the build::
    Supported extra configuration
       max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
       max_lcores = n      # will set RTE_MAX_LCORE
+
+      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
+         # valid values are directories (optionally with their subdirs)
+         # in the drivers directory
diff --git a/drivers/meson.build b/drivers/meson.build
index 4bb7e9218..a997387ad 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 45d974cd2..fcc8931f0 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 13/15] build: disable libnuma in cross builds
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (11 preceding siblings ...)
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 12/15] build: disable Arm drivers Juraj Linkeš
@ 2020-11-13 11:38                     ` Juraj Linkeš
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 14/15] build: add Arm SoC meson option Juraj Linkeš
                                       ` (3 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:38 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disable NUMA in Arm cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_bluefield_linux_gcc          |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_graviton2_linux_gcc          |  1 +
 config/arm/arm64_n1sdp_linux_gcc              |  1 +
 config/arm/arm64_octeontx2_linux_gcc          |  1 +
 config/arm/arm64_stingray_linux_gcc           |  1 +
 config/arm/meson.build                        |  2 --
 config/meson.build                            | 19 +++++++++++++------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
 10 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 7383f42e2..f5403f0a6 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -17,4 +17,5 @@ endian = 'little'
 implementer_id = '0x56'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 00101962b..3458b9d7b 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -17,3 +17,4 @@ endian = 'little'
 implementer_id = 'dpaa'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@ implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 9b167267f..492b7e40f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -62,8 +62,6 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_USE_C11_MEM_MODEL', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_CACHE_LINE_SIZE', 64],
 			['RTE_MAX_LCORE', 64],
diff --git a/config/meson.build b/config/meson.build
index 208d1ea01..2ddde22b7 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -141,12 +141,19 @@ endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
-	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-	has_libnuma = 1
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+	# don't look for libnuma if explicitly disabled in cross build
+	check_libnuma = false
+endif
+if find_libnuma
+	numa_dep = cc.find_library('numa', required: false)
+	if numa_dep.found() and cc.has_header('numaif.h')
+		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+		has_libnuma = 1
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0
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 210ad4508..063661ebf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -147,3 +147,7 @@ There are other options you may specify in a cross file to tailor the build::
       disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
          # valid values are directories (optionally with their subdirs)
          # in the drivers directory
+
+      numa = false        # set to false to force building for a non-NUMA system
+         # if not set or set to true, the build system will build for a NUMA
+         # system only if libnuma is installed
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 14/15] build: add Arm SoC meson option
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (12 preceding siblings ...)
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 13/15] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-13 11:38                     ` Juraj Linkeš
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 15/15] config: fix Arm implementer and its SoCs Juraj Linkeš
                                       ` (2 subsequent siblings)
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:38 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   5 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 129 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
 meson_options.txt                             |   2 +
 14 files changed, 166 insertions(+), 106 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index f5403f0a6..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da..64d44ead8 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 3458b9d7b..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,7 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 492b7e40f..1738e36c3 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -30,7 +30,7 @@ native_machine_args = ['-mcpu=native']
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -180,6 +180,99 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines.',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false,
+	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -192,11 +285,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -215,8 +315,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -242,8 +361,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 063661ebf..83bdb78bf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -100,54 +100,32 @@ command::
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
-         # valid values are directories (optionally with their subdirs)
-         # in the drivers directory
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Darm_soc meson
+option::
+
+   meson soc_build -Darm_soc=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   soc = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index 51ea63a4c..4ad6acfb2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')
 option('disable_drivers', type: 'string', value: '',
 	description: 'Comma-separated list of drivers to explicitly disable.')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v11 15/15] config: fix Arm implementer and its SoCs
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (13 preceding siblings ...)
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 14/15] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-13 11:38                     ` Juraj Linkeš
  2020-11-13 13:51                     ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Ruifeng Wang
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
  16 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 11:38 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 54 ++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 1738e36c3..f25a7dbab 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -75,8 +75,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -146,38 +146,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -190,8 +164,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
 }
@@ -200,13 +178,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -243,6 +231,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build
  2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build Juraj Linkeš
  2020-11-13  5:50                   ` Honnappa Nagarahalli
@ 2020-11-13 13:11                   ` Thomas Monjalon
  2020-11-13 14:03                     ` Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-13 13:11 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

11/11/2020 14:18, Juraj Linkeš:
> Use generic configuration for the only build where it makes sense - the
> generic build. For other builds, if we don't know either of implementer
> ID or part number, the build is not supported.
> Add part numbers to cross files where fallback to generic configuration
> is assumed.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>

It fails for config/arm/arm64_dpaa_linux_gcc:
config/arm/meson.build:223:2: ERROR: Unknown cross property: part_number.

Are you testing all platforms in config/arm/?




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

* Re: [dpdk-dev] [PATCH v11 00/15] Arm build options rework
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (14 preceding siblings ...)
  2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 15/15] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-11-13 13:51                     ` Ruifeng Wang
  2020-11-13 13:57                       ` Juraj Linkeš
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
  16 siblings, 1 reply; 465+ messages in thread
From: Ruifeng Wang @ 2020-11-13 13:51 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, November 13, 2020 7:38 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v11 00/15] Arm build options rework
> 
> The current way of specifying Arm configuration options is insufficient since
> we can't identify the SoC we're building for from the MIDR information. For
> example, we can't distinguish between N1SDP, Graviton2 or Ampere Altra.
> 
> Add a way to specify the cpu count and numa node count for cross builds and
> aarch64 -> aarch64 (SoC) builds.
> 
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed 2. a
> cross build on a fast aarch64 machine but with target SoC which
>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in SoC configuration.
> 
> Among libraries, only libnuma can be now disabled.
> 
> Also add an optional way to discover cpu count a numa node count. Fix -
> Dmax_lcores and -Dmax_numa_nodes for arm builds.
> 
> The current implementation adds/supports the following:
> * x86 -> aarch64 cross build with added config options/disabled
>   drivers/libs
> * aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
>   option or using a cross file
> * max numa nodes and max lcore may be specified on the command line to
>   overwrite the values for any (native, SoC or cross) build
> 
> v2:
> Major rework of the whole series.
> 
> v3:
> Added numa and core count defaults for x86 default build.
> Removed numa and core count defaults. Now requiring defaults to be
> specified in a cross file or on the cmdline.
> Added FreeBDS support for numa count discovery.
> 
> v4:
> Make automatic numa and cpu counts discovery optional.
> 
> v5:
> Split the refactor patch into smaller patches.
> Simplify buildtools/get_numa_count.py.
> Add more explanation to cover letter.
> 
> v6:
> Apply cross file options arch agnostically, not just in Arm cross builds.
> Streamline Arm build setup and machine args: always use native args in
> native builds, require implementer ID and part number for cross builds.
> 
> v7:
> Arm config options are now organized in one dictionary.
> Removed unsupported implementers and removed fallback to generic
> implementer/part number for unknown implementer/part number.
> Added meson config option arm_soc which can be used to specify
> configuration to be used, useful for aarch64 -> aarch64 builds.
> 
> v8:
> Rebase.
> 
> v9:
> Split SoC and implementer dictionaries into smaller parts.
> Fixed DPAA and ARMADA SoC configuration.
> Added documentation about supported SoCs.
> 
> v10:
> Added a commit that fixes Graviton2 clang build failures in native build.
> 
> v11:
> Rebase.
> 

Hi Juraj,

I see the clang build fix was added to v10 but is missing in v11.
Some tags are not taken in v11.
Please have a check.

Thanks.
> Dharmik Thakkar (1):
>   crypto/armv8: replace meson option with pkg-config support
> 
> Juraj Linkeš (14):
>   build: alias default build as generic
>   build: rename Arm build variables
>   build: remove unused or superfluous variables
>   build: reformat and move Arm config and comments
>   build: simplify how Arm flags are processed
>   build: organize Arm config into dict
>   build: isolate configuration for generic build
>   build: use native machine args in Arm native build
>   build: optional NUMA and cpu counts detection
>   build: add core and NUMA counts to cross files
>   build: disable Arm drivers
>   build: disable libnuma in cross builds
>   build: add Arm SoC meson option
>   config: fix Arm implementer and its SoCs
> 
>  buildtools/get_cpu_count.py                   |   7 +
>  buildtools/get_numa_count.py                  |  22 +
>  buildtools/meson.build                        |   2 +
>  config/arm/arm64_armada_linux_gcc             |   2 +-
>  config/arm/arm64_armv8_linux_gcc              |  15 +-
>  config/arm/arm64_bluefield_linux_gcc          |   3 +-
>  config/arm/arm64_dpaa_linux_gcc               |   2 +-
>  config/arm/arm64_emag_linux_gcc               |   2 +-
>  config/arm/arm64_graviton2_linux_gcc          |   3 +-
>  config/arm/arm64_n1sdp_linux_gcc              |   3 +-
>  config/arm/arm64_octeontx2_linux_gcc          |   3 +-
>  config/arm/arm64_stingray_linux_gcc           |   3 +-
>  config/arm/arm64_thunderx2_linux_gcc          |   3 +-
>  ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
>  config/arm/meson.build                        | 503 ++++++++++++------
>  config/meson.build                            |  90 +++-
>  config/x86/meson.build                        |   2 +
>  doc/guides/cryptodevs/armv8.rst               |  10 +-
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
>  doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
>  drivers/crypto/armv8/meson.build              |  19 +-
>  drivers/meson.build                           |   6 +-
>  meson.build                                   |   1 +
>  meson_options.txt                             |  14 +-
>  24 files changed, 516 insertions(+), 235 deletions(-)  create mode 100644
> buildtools/get_cpu_count.py  create mode 100644
> buildtools/get_numa_count.py  rename
> config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc}
> (92%)
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v11 00/15] Arm build options rework
  2020-11-13 13:51                     ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Ruifeng Wang
@ 2020-11-13 13:57                       ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 13:57 UTC (permalink / raw)
  To: Ruifeng Wang, bruce.richardson, Honnappa Nagarahalli, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd



> -----Original Message-----
> From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> Sent: Friday, November 13, 2020 2:52 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; nd <nd@arm.com>
> Subject: RE: [PATCH v11 00/15] Arm build options rework
> 
> > -----Original Message-----
> > From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Sent: Friday, November 13, 2020 7:38 PM
> > To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> > <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> > Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Subject: [PATCH v11 00/15] Arm build options rework
> >
> > The current way of specifying Arm configuration options is
> > insufficient since we can't identify the SoC we're building for from
> > the MIDR information. For example, we can't distinguish between N1SDP,
> Graviton2 or Ampere Altra.
> >
> > Add a way to specify the cpu count and numa node count for cross
> > builds and
> > aarch64 -> aarch64 (SoC) builds.
> >
> > We also want to be able to disable which drivers (and possibly
> > libraries) are built without user input. This is useful when building:
> > 1. on an SoC that is slow and we want to build only what is necessary
> >   without the user having to check which libraries they have installed
> > 2. a cross build on a fast aarch64 machine but with target SoC which
> >   differs in capabilities or libraries.
> > This is achieved by specifying the drivers in SoC configuration.
> >
> > Among libraries, only libnuma can be now disabled.
> >
> > Also add an optional way to discover cpu count a numa node count. Fix
> > - Dmax_lcores and -Dmax_numa_nodes for arm builds.
> >
> > The current implementation adds/supports the following:
> > * x86 -> aarch64 cross build with added config options/disabled
> >   drivers/libs
> > * aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
> >   option or using a cross file
> > * max numa nodes and max lcore may be specified on the command line to
> >   overwrite the values for any (native, SoC or cross) build
> >
> > v2:
> > Major rework of the whole series.
> >
> > v3:
> > Added numa and core count defaults for x86 default build.
> > Removed numa and core count defaults. Now requiring defaults to be
> > specified in a cross file or on the cmdline.
> > Added FreeBDS support for numa count discovery.
> >
> > v4:
> > Make automatic numa and cpu counts discovery optional.
> >
> > v5:
> > Split the refactor patch into smaller patches.
> > Simplify buildtools/get_numa_count.py.
> > Add more explanation to cover letter.
> >
> > v6:
> > Apply cross file options arch agnostically, not just in Arm cross builds.
> > Streamline Arm build setup and machine args: always use native args in
> > native builds, require implementer ID and part number for cross builds.
> >
> > v7:
> > Arm config options are now organized in one dictionary.
> > Removed unsupported implementers and removed fallback to generic
> > implementer/part number for unknown implementer/part number.
> > Added meson config option arm_soc which can be used to specify
> > configuration to be used, useful for aarch64 -> aarch64 builds.
> >
> > v8:
> > Rebase.
> >
> > v9:
> > Split SoC and implementer dictionaries into smaller parts.
> > Fixed DPAA and ARMADA SoC configuration.
> > Added documentation about supported SoCs.
> >
> > v10:
> > Added a commit that fixes Graviton2 clang build failures in native build.
> >
> > v11:
> > Rebase.
> >
> 
> Hi Juraj,
> 
> I see the clang build fix was added to v10 but is missing in v11.
> Some tags are not taken in v11.
> Please have a check.
> 

The clang build fix has already been merged, so the rebase automatically reshuffled the order, which resulted in me sending Dharmik's already merged patch. I'll recheck the tags (unicast send me please the ones you've noticed) and send a new version.

> Thanks.
> > Dharmik Thakkar (1):
> >   crypto/armv8: replace meson option with pkg-config support
> >
> > Juraj Linkeš (14):
> >   build: alias default build as generic
> >   build: rename Arm build variables
> >   build: remove unused or superfluous variables
> >   build: reformat and move Arm config and comments
> >   build: simplify how Arm flags are processed
> >   build: organize Arm config into dict
> >   build: isolate configuration for generic build
> >   build: use native machine args in Arm native build
> >   build: optional NUMA and cpu counts detection
> >   build: add core and NUMA counts to cross files
> >   build: disable Arm drivers
> >   build: disable libnuma in cross builds
> >   build: add Arm SoC meson option
> >   config: fix Arm implementer and its SoCs
> >
> >  buildtools/get_cpu_count.py                   |   7 +
> >  buildtools/get_numa_count.py                  |  22 +
> >  buildtools/meson.build                        |   2 +
> >  config/arm/arm64_armada_linux_gcc             |   2 +-
> >  config/arm/arm64_armv8_linux_gcc              |  15 +-
> >  config/arm/arm64_bluefield_linux_gcc          |   3 +-
> >  config/arm/arm64_dpaa_linux_gcc               |   2 +-
> >  config/arm/arm64_emag_linux_gcc               |   2 +-
> >  config/arm/arm64_graviton2_linux_gcc          |   3 +-
> >  config/arm/arm64_n1sdp_linux_gcc              |   3 +-
> >  config/arm/arm64_octeontx2_linux_gcc          |   3 +-
> >  config/arm/arm64_stingray_linux_gcc           |   3 +-
> >  config/arm/arm64_thunderx2_linux_gcc          |   3 +-
> >  ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
> >  config/arm/meson.build                        | 503 ++++++++++++------
> >  config/meson.build                            |  90 +++-
> >  config/x86/meson.build                        |   2 +
> >  doc/guides/cryptodevs/armv8.rst               |  10 +-
> >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
> >  doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
> >  drivers/crypto/armv8/meson.build              |  19 +-
> >  drivers/meson.build                           |   6 +-
> >  meson.build                                   |   1 +
> >  meson_options.txt                             |  14 +-
> >  24 files changed, 516 insertions(+), 235 deletions(-)  create mode
> > 100644 buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py  rename
> > config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc}
> > (92%)
> >
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build
  2020-11-13 13:11                   ` Thomas Monjalon
@ 2020-11-13 14:03                     ` Juraj Linkeš
  2020-11-13 14:18                       ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:03 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev


> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, November 13, 2020 2:11 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic
> build
> 
> 11/11/2020 14:18, Juraj Linkeš:
> > Use generic configuration for the only build where it makes sense -
> > the generic build. For other builds, if we don't know either of
> > implementer ID or part number, the build is not supported.
> > Add part numbers to cross files where fallback to generic
> > configuration is assumed.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> 
> It fails for config/arm/arm64_dpaa_linux_gcc:
> config/arm/meson.build:223:2: ERROR: Unknown cross property: part_number.
> 
> Are you testing all platforms in config/arm/?
> 

I've tested this, but I forgot to fix it when I learned what the proper part_number should be. It works with all the patches in the series, but I can add it here as well if you want me to.

> 
> 


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

* Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build
  2020-11-13 14:03                     ` Juraj Linkeš
@ 2020-11-13 14:18                       ` Thomas Monjalon
  2020-11-13 14:22                         ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-13 14:18 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

13/11/2020 15:03, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 11/11/2020 14:18, Juraj Linkeš:
> > > Use generic configuration for the only build where it makes sense -
> > > the generic build. For other builds, if we don't know either of
> > > implementer ID or part number, the build is not supported.
> > > Add part numbers to cross files where fallback to generic
> > > configuration is assumed.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > 
> > It fails for config/arm/arm64_dpaa_linux_gcc:
> > config/arm/meson.build:223:2: ERROR: Unknown cross property: part_number.
> > 
> > Are you testing all platforms in config/arm/?
> > 
> 
> I've tested this, but I forgot to fix it when I learned what the proper part_number should be. It works with all the patches in the series, but I can add it here as well if you want me to.

All patches must compile please.
I'm afraid it will make this series deferred to later.



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

* Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build
  2020-11-13 14:18                       ` Thomas Monjalon
@ 2020-11-13 14:22                         ` Juraj Linkeš
  2020-11-13 14:35                           ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:22 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, November 13, 2020 3:18 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic
> build
> 
> 13/11/2020 15:03, Juraj Linkeš:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 11/11/2020 14:18, Juraj Linkeš:
> > > > Use generic configuration for the only build where it makes sense
> > > > - the generic build. For other builds, if we don't know either of
> > > > implementer ID or part number, the build is not supported.
> > > > Add part numbers to cross files where fallback to generic
> > > > configuration is assumed.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > >
> > > It fails for config/arm/arm64_dpaa_linux_gcc:
> > > config/arm/meson.build:223:2: ERROR: Unknown cross property:
> part_number.
> > >
> > > Are you testing all platforms in config/arm/?
> > >
> >
> > I've tested this, but I forgot to fix it when I learned what the proper
> part_number should be. It works with all the patches in the series, but I can add
> it here as well if you want me to.
> 
> All patches must compile please.
> I'm afraid it will make this series deferred to later.
> 
> 

I can send a fixed version right away.

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

* [dpdk-dev] [PATCH v12 00/14] Arm build options rework
  2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
                                       ` (15 preceding siblings ...)
  2020-11-13 13:51                     ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Ruifeng Wang
@ 2020-11-13 14:31                     ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic Juraj Linkeš
                                         ` (15 more replies)
  16 siblings, 16 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds
and aarch64 -> aarch64 (SoC) builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
  option or using a cross file
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native, SoC or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

v9:
Split SoC and implementer dictionaries into smaller parts.
Fixed DPAA and ARMADA SoC configuration.
Added documentation about supported SoCs.

v10:
Added a commit that fixes Graviton2 clang build failures in native
build.

v11:
Rebase.

v12:
Fixed dpaa and armada cross builds in generic build commit.

Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>

Juraj Linkeš (14):
  build: alias default build as generic
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for generic build
  build: use native machine args in Arm native build
  build: optional NUMA and cpu counts detection
  build: add core and NUMA counts to cross files
  build: disable Arm drivers
  build: disable libnuma in cross builds
  build: add Arm SoC meson option
  config: fix Arm implementer and its SoCs

 buildtools/get_cpu_count.py                   |   7 +
 buildtools/get_numa_count.py                  |  22 +
 buildtools/meson.build                        |   2 +
 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  15 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 503 ++++++++++++------
 config/meson.build                            |  90 +++-
 config/x86/meson.build                        |   2 +
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
 doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |  12 +-
 22 files changed, 504 insertions(+), 216 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-16  7:32                         ` Thomas Monjalon
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 02/14] build: rename Arm build variables Juraj Linkeš
                                         ` (14 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current machine='default' build name is not descriptive. The actual
default build is machine='native'. Add an alternative string which does
the same build and better describes what we're building:
machine='generic'. Leave machine='default' for backwards compatibility.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build                    | 5 +++--
 config/meson.build                        | 9 +++++----
 doc/guides/prog_guide/build-sdk-meson.rst | 4 ++--
 meson_options.txt                         | 2 +-
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..d4066ade8 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -1,12 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
+# Copyright(c) 2020 PANTHEON.tech s.r.o.
 
 # for checking defines we need to use the correct compiler flags
 march_opt = '-march=@0@'.format(machine)
 
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
+arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -148,7 +149,7 @@ else
 	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()
+	if arm_force_generic_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
 	elif not meson.is_cross_build()
diff --git a/config/meson.build b/config/meson.build
index a29693b88..04694b8ad 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -70,13 +70,14 @@ else
 	machine = get_option('machine')
 endif
 
-# machine type 'default' is special, it defaults to the per arch agreed common
-# minimal baseline needed for DPDK.
+# machine type 'generic' is special, it defaults to the per arch agreed common
+# minimal baseline needed for DPDK. Machine type 'default' is also supported
+# with the same meaning for backwards compatibility.
 # That might not be the most optimized, but the most portable version while
 # still being able to support the CPU features required for DPDK.
 # This can be bumped up by the DPDK project, but it can never be an
 # invariant like 'native'
-if machine == 'default'
+if machine == 'default' or machine == 'generic'
 	if host_machine.cpu_family().startswith('x86')
 		# matches the old pre-meson build systems default
 		machine = 'corei7'
@@ -84,7 +85,7 @@ if machine == 'default'
 		machine = 'armv7-a'
 	elif host_machine.cpu_family().startswith('aarch')
 		# arm64 manages defaults in config/arm/meson.build
-		machine = 'default'
+		machine = 'generic'
 	elif host_machine.cpu_family().startswith('ppc')
 		machine = 'power8'
 	endif
diff --git a/doc/guides/prog_guide/build-sdk-meson.rst b/doc/guides/prog_guide/build-sdk-meson.rst
index 3429e2647..c7e12eedf 100644
--- a/doc/guides/prog_guide/build-sdk-meson.rst
+++ b/doc/guides/prog_guide/build-sdk-meson.rst
@@ -85,7 +85,7 @@ Project-specific options are passed used -Doption=value::
 
 	meson -Denable_docs=true fullbuild  # build and install docs
 
-	meson -Dmachine=default  # use builder-independent baseline -march
+	meson -Dmachine=generic  # use builder-independent baseline -march
 
 	meson -Ddisable_drivers=event/*,net/tap  # disable tap driver and all
 					# eventdev PMDs for a smaller build
@@ -114,7 +114,7 @@ Examples of setting some of the same options using meson configure::
         re-scan from meson.
 
 .. note::
-        machine=default uses a config that works on all supported architectures
+        machine=generic uses a config that works on all supported architectures
         regardless of the capabilities of the machine where the build is happening.
 
 As well as those settings taken from ``meson configure``, other options
diff --git a/meson_options.txt b/meson_options.txt
index e384e6dbb..dd9b37f98 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,7 +21,7 @@ option('kernel_dir', type: 'string', value: '',
 option('lib_musdk_dir', type: 'string', value: '',
 	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
-	description: 'set the target machine type')
+	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
 option('max_lcores', type: 'integer', value: 128,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 02/14] build: rename Arm build variables
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 03/14] build: remove unused or superfluous variables Juraj Linkeš
                                         ` (13 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 114 +++++++++++++--------------
 11 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index d4066ade8..704be567d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -9,7 +9,7 @@ march_opt = '-march=@0@'.format(machine)
 arm_force_native_march = false
 arm_force_generic_march = (machine == 'generic')
 
-flags_common_default = [
+flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
@@ -29,58 +29,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -91,8 +91,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -101,36 +101,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -145,13 +145,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	cmd_output = cmd_generic # Set generic by default
 	machine_args = [] # Clear previous machine args
 	if arm_force_generic_march and not meson.is_cross_build()
-		machine = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -162,45 +162,45 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
-	foreach flag: flags_common_default
+	foreach flag: flags_common
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 03/14] build: remove unused or superfluous variables
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 02/14] build: rename Arm build variables Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 04/14] build: reformat and move Arm config and comments Juraj Linkeš
                                         ` (12 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 704be567d..ee9277b5d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -62,7 +58,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -119,17 +114,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -145,11 +132,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -160,14 +145,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -200,7 +186,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 04/14] build: reformat and move Arm config and comments
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (2 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 03/14] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 05/14] build: simplify how Arm flags are processed Juraj Linkeš
                                         ` (11 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armv8_linux_gcc              | 12 +--
 config/arm/meson.build                        | 96 +++++++++++--------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
 3 files changed, 93 insertions(+), 49 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..0099f5ca2 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,16 +13,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
-
-# Valid options for Arm's part_number:
-# 'generic': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
 part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index ee9277b5d..7ab856143 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -5,15 +5,16 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common = [
-	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
+	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -23,69 +24,86 @@ flags_common = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -96,8 +114,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -105,13 +123,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -123,21 +142,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
+		# generic build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -158,6 +177,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -194,7 +214,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
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..972598835 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -99,3 +99,37 @@ command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+Supported cross-compilation targets
+-----------------------------------
+
+If you wish to build for a target which is not among the current cross-files,
+you may use various combinations of implementer/part number::
+
+   Supported implementers:
+      'generic': Generic armv8
+      '0x41':    Arm
+      '0x43':    Cavium
+      '0x50':    Ampere Computing
+      '0x56':    Marvell ARMADA
+      'dpaa':    NXP DPAA
+
+   Supported part_numbers for generic, 0x41, 0x56, dpaa:
+      'generic': valid for all armv8-a architectures (default value)
+      '0xd03':   cortex-a53
+      '0xd04':   cortex-a35
+      '0xd09':   cortex-a73
+      '0xd0a':   cortex-a75
+      '0xd0b':   cortex-a76
+      '0xd0c':   neoverse-n1
+
+   Supported part_numbers for 0x43:
+      'generic': valid for all Cavium builds
+      '0xa1':    thunderxt88
+      '0xa2':    thunderxt81
+      '0xa3':    thunderxt83
+      '0xaf':    thunderx2t99
+      '0xb2':    octeontx2
+
+   Supported part_numbers for 0x50:
+      'generic': valid for all Ampere builds
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 05/14] build: simplify how Arm flags are processed
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (3 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 04/14] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 06/14] build: organize Arm config into dict Juraj Linkeš
                                         ` (10 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7ab856143..0f8a94ffe 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -150,7 +150,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
 		implementer_config = implementer_generic
@@ -183,34 +182,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 06/14] build: organize Arm config into dict
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (4 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 05/14] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 07/14] build: isolate configuration for generic build Juraj Linkeš
                                         ` (9 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 298 ++++++++++++++++++++++++-----------------
 1 file changed, 178 insertions(+), 120 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 0f8a94ffe..eb15848cb 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -28,115 +28,166 @@ flags_common = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementer_generic = {
+	'description': 'Generic armv8',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 256]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc',
+					     '-moutline-atomics']}
+	}
+}
+
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc',
+				      '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto',
+				  '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+implementer_arm = {
+	'description': 'Arm',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+implementer_cavium = {
+	'description': 'Cavium',
+	'flags': [
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 96],
+		['RTE_MAX_NUMA_NODES', 2]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
+					     '-mcpu=thunderx']},
+		'native': {'machine_args': ['-march=native']},
+		'0xa1': {
+			'machine_args': ['-mcpu=thunderxt88'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa2': {
+			'machine_args': ['-mcpu=thunderxt81'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa3': {
+			'machine_args': ['-mcpu=thunderxt83'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xaf': {
+			'machine_args': ['-march=armv8.1-a+crc+crypto',
+					 '-mcpu=thunderx2t99'],
+			'flags': [
+				['RTE_MACHINE', '"thunderx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_CACHE_LINE_SIZE', 64],
+				['RTE_MAX_LCORE', 256],
+				['RTE_MAX_NUMA_NODES', 2]
+			]
+		},
+		'0xb2': {
+			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
+					 '-mcpu=octeontx2'],
+			'flags': [
+				['RTE_MACHINE', '"octeontx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_EAL_IGB_UIO', false],
+				['RTE_MAX_LCORE', 36],
+				['RTE_MAX_NUMA_NODES', 1]
+			]
+		}
+	}
+}
 
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+implementer_ampere = {
+	'description': 'Ampere Computing',
+	'flags': [
+		['RTE_MACHINE', '"emag"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 32],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': {
+		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					      '-mtune=emag']},
+		'native': {'machine_args':  ['-march=native']}
+	}
+}
+
+implementer_marvell = {
+	'description': 'Marvell ARMADA',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
+
+implementer_dpaa = {
+	'description': 'NXP DPAA',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+implementers = {
+	'generic': implementer_generic,
+	'0x41': implementer_arm,
+	'0x43': implementer_cavium,
+	'0x50': implementer_ampere,
+	'0x56': implementer_marvell,
+	'dpaa': implementer_dpaa
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -152,7 +203,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -167,9 +218,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -179,28 +230,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config[1]
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 07/14] build: isolate configuration for generic build
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (5 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 06/14] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 08/14] build: use native machine args in Arm native build Juraj Linkeš
                                         ` (8 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
 6 files changed, 29 insertions(+), 29 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..143a3c9f8 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..c3c8a1ef6 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+part_number = '0xd08'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index eb15848cb..fec06e70c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -48,8 +48,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc',
-				      '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -98,8 +96,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
-					     '-mcpu=thunderx']},
 		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
@@ -149,8 +145,8 @@ implementer_ampere = {
 		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': {
-		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					      '-mtune=emag']},
+		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					  '-mtune=emag']},
 		'native': {'machine_args':  ['-march=native']}
 	}
 }
@@ -200,10 +196,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'generic' and not meson.is_cross_build()
 		# generic build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -216,21 +211,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -240,15 +238,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
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 972598835..6a883b030 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -114,8 +114,10 @@ you may use various combinations of implementer/part number::
       '0x56':    Marvell ARMADA
       'dpaa':    NXP DPAA
 
-   Supported part_numbers for generic, 0x41, 0x56, dpaa:
-      'generic': valid for all armv8-a architectures (default value)
+   Supported part_numbers for generic:
+      'generic': valid for all armv8-a architectures (unoptimized portable build)
+
+   Supported part_numbers for 0x41, 0x56, dpaa:
       '0xd03':   cortex-a53
       '0xd04':   cortex-a35
       '0xd09':   cortex-a73
@@ -124,7 +126,6 @@ you may use various combinations of implementer/part number::
       '0xd0c':   neoverse-n1
 
    Supported part_numbers for 0x43:
-      'generic': valid for all Cavium builds
       '0xa1':    thunderxt88
       '0xa2':    thunderxt81
       '0xa3':    thunderxt83
@@ -132,4 +133,4 @@ you may use various combinations of implementer/part number::
       '0xb2':    octeontx2
 
    Supported part_numbers for 0x50:
-      'generic': valid for all Ampere builds
+      '0x0':     emag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 08/14] build: use native machine args in Arm native build
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (6 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 07/14] build: isolate configuration for generic build Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
                                         ` (7 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args usable for both GCC and Clang.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index fec06e70c..bee57f089 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,8 +3,6 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -27,6 +25,7 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -48,7 +47,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -96,7 +94,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
 			'flags': flags_part_number_thunderx
@@ -146,8 +143,7 @@ implementer_ampere = {
 	],
 	'part_number_config': {
 		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					  '-mtune=emag']},
-		'native': {'machine_args':  ['-march=native']}
+					  '-mtune=emag']}
 	}
 }
 
@@ -196,26 +192,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'generic' and not meson.is_cross_build()
-		# generic build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'generic'
+			# generic build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -251,7 +248,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (7 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 08/14] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-14 13:16                         ` Thomas Monjalon
  2020-11-16  7:24                         ` Thomas Monjalon
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 10/14] build: add core and NUMA counts to cross files Juraj Linkeš
                                         ` (6 subsequent siblings)
  15 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add an option to automatically discover the host's numa and cpu counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 buildtools/get_cpu_count.py  |  7 ++++++
 buildtools/get_numa_count.py | 22 +++++++++++++++++
 buildtools/meson.build       |  2 ++
 config/meson.build           | 47 ++++++++++++++++++++++++++++++++++--
 config/x86/meson.build       |  2 ++
 meson_options.txt            |  8 +++---
 6 files changed, 82 insertions(+), 6 deletions(-)
 create mode 100644 buildtools/get_cpu_count.py
 create mode 100644 buildtools/get_numa_count.py

diff --git a/buildtools/get_cpu_count.py b/buildtools/get_cpu_count.py
new file mode 100644
index 000000000..b269d557b
--- /dev/null
+++ b/buildtools/get_cpu_count.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import os
+
+print(os.cpu_count())
diff --git a/buildtools/get_numa_count.py b/buildtools/get_numa_count.py
new file mode 100644
index 000000000..be73c5c3f
--- /dev/null
+++ b/buildtools/get_numa_count.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2020 PANTHEON.tech s.r.o.
+
+import ctypes
+import glob
+import os
+import subprocess
+
+if os.name == 'posix':
+    if os.path.isdir('/sys/devices/system/node'):
+        print(len(glob.glob('/sys/devices/system/node/node*')))
+    else:
+        subprocess.run(['sysctl', '-n', 'vm.ndomains'])
+
+elif os.name == 'nt':
+    libkernel32 = ctypes.windll.kernel32
+
+    count = ctypes.c_ulong()
+
+    libkernel32.GetNumaHighestNodeNumber(ctypes.pointer(count))
+    print(count.value + 1)
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 04808dabc..925e733b1 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -17,3 +17,5 @@ else
 endif
 map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
+get_cpu_count_cmd = py3 + files('get_cpu_count.py')
+get_numa_count_cmd = py3 + files('get_numa_count.py')
diff --git a/config/meson.build b/config/meson.build
index 04694b8ad..1c541b5f2 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -233,8 +233,6 @@ foreach arg: warning_flags
 endforeach
 
 # set other values pulled from the build options
-dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
-dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
@@ -253,6 +251,51 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+max_lcores = get_option('max_lcores')
+if max_lcores > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+elif max_lcores == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_lcores is not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
+	min_lcores = 2
+	# DPDK must be build for at least 2 cores
+	if max_lcores < min_lcores
+		message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
+		max_lcores = min_lcores
+	else
+		message('Found @0@ cores'.format(max_lcores))
+	endif
+	dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
+endif
+
+max_numa_nodes = get_option('max_numa_nodes')
+if max_numa_nodes > 0
+	# Overwrite the default value from arch_subdir with user input
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+elif max_numa_nodes == -1
+	# Overwrite the default value with discovered values
+	if meson.is_cross_build()
+		error('Discovery of max_numa_nodes not supported for cross-compilation.')
+	endif
+	# Discovery makes sense only for non-cross builds
+	max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
+	message('Found @0@ numa nodes'.format(max_numa_nodes))
+	dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
+endif
+
+# check that cpu and numa count is set and error out if it's not set
+if not dpdk_conf.has('RTE_MAX_LCORE')
+	error('Number of cores not specified.')
+endif
+if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
+	error('Number of numa nodes not specified.')
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 31bfa63b1..4989d47f3 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -57,3 +57,5 @@ else
 endif
 
 dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
+dpdk_conf.set('RTE_MAX_LCORE', 128)
+dpdk_conf.set('RTE_MAX_NUMA_NODES', 4)
diff --git a/meson_options.txt b/meson_options.txt
index dd9b37f98..51ea63a4c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,10 +24,10 @@ option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type. Set to generic for a build usable on all machines of the build machine architecture, set to native to let the compiler pick the architecture of the build machine.')
 option('max_ethports', type: 'integer', value: 32,
 	description: 'maximum number of Ethernet devices')
-option('max_lcores', type: 'integer', value: 128,
-	description: 'maximum number of cores/threads supported by EAL')
-option('max_numa_nodes', type: 'integer', value: 4,
-	description: 'maximum number of NUMA nodes supported by EAL')
+option('max_lcores', type: 'integer', value: 0,
+	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
+option('max_numa_nodes', type: 'integer', value: 0,
+	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa nodes on the build machine.')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 10/14] build: add core and NUMA counts to cross files
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (8 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers Juraj Linkeš
                                         ` (5 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                 |  2 ++
 config/arm/arm64_armv8_linux_gcc                  |  2 ++
 config/arm/arm64_bluefield_linux_gcc              |  2 ++
 config/arm/arm64_dpaa_linux_gcc                   |  2 ++
 config/arm/arm64_emag_linux_gcc                   |  2 ++
 config/arm/arm64_graviton2_linux_gcc              |  2 ++
 config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
 config/arm/arm64_octeontx2_linux_gcc              |  2 ++
 config/arm/arm64_stingray_linux_gcc               |  2 ++
 config/arm/arm64_thunderx2_linux_gcc              |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
 config/arm/meson.build                            |  6 ++++--
 config/meson.build                                | 15 +++++++++++++++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
 14 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 143a3c9f8..2ecc4604c 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x56'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 0099f5ca2..5451a01da 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 # Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
 part_number = 'generic'
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index c3c8a1ef6..8641fee63 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = 'dpaa'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index bee57f089..7945efb72 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -38,7 +38,8 @@ implementer_generic = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 128],
-		['RTE_MAX_LCORE', 256]
+		['RTE_MAX_LCORE', 256],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': {
 		'generic': {'machine_args': ['-march=armv8-a+crc',
@@ -76,7 +77,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16]
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': part_number_config_arm
 }
diff --git a/config/meson.build b/config/meson.build
index 1c541b5f2..a95567420 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -251,6 +251,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 max_lcores = get_option('max_lcores')
 if max_lcores > 0
 	# Overwrite the default value from arch_subdir with user input
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 6a883b030..4e65b271c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -134,3 +134,12 @@ you may use various combinations of implementer/part number::
 
    Supported part_numbers for 0x50:
       '0x0':     emag
+
+Other cross file options
+------------------------
+
+There are other options you may specify in a cross file to tailor the build::
+
+   Supported extra configuration
+      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+      max_lcores = n      # will set RTE_MAX_LCORE
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (9 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 10/14] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-16  7:28                         ` Thomas Monjalon
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 12/14] build: disable libnuma in cross builds Juraj Linkeš
                                         ` (4 subsequent siblings)
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works. Remove
unneeded driver options ported from the old makefile system.
Add support for removing drivers for cross builds.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                   | 1 +
 config/arm/meson.build                              | 7 +++----
 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
 drivers/meson.build                                 | 6 +++++-
 meson.build                                         | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 2ecc4604c..e365f61d0 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7945efb72..9b167267f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,6 +3,9 @@
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -17,9 +20,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -127,7 +127,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 4e65b271c..210ad4508 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -143,3 +143,7 @@ There are other options you may specify in a cross file to tailor the build::
    Supported extra configuration
       max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
       max_lcores = n      # will set RTE_MAX_LCORE
+
+      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
+         # valid values are directories (optionally with their subdirs)
+         # in the drivers directory
diff --git a/drivers/meson.build b/drivers/meson.build
index 6b50f7238..21a296b55 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 45d974cd2..fcc8931f0 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 12/14] build: disable libnuma in cross builds
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (10 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 13/14] build: add Arm SoC meson option Juraj Linkeš
                                         ` (3 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disable NUMA in Arm cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_bluefield_linux_gcc          |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_graviton2_linux_gcc          |  1 +
 config/arm/arm64_n1sdp_linux_gcc              |  1 +
 config/arm/arm64_octeontx2_linux_gcc          |  1 +
 config/arm/arm64_stingray_linux_gcc           |  1 +
 config/arm/meson.build                        |  2 --
 config/meson.build                            | 19 +++++++++++++------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
 10 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index e365f61d0..487cb2923 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,4 +18,5 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 8641fee63..37398c762 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = 'dpaa'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@ implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 9b167267f..492b7e40f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -62,8 +62,6 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_USE_C11_MEM_MODEL', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_CACHE_LINE_SIZE', 64],
 			['RTE_MAX_LCORE', 64],
diff --git a/config/meson.build b/config/meson.build
index a95567420..5f2f81346 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -143,12 +143,19 @@ endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
-	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-	has_libnuma = 1
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+	# don't look for libnuma if explicitly disabled in cross build
+	check_libnuma = false
+endif
+if find_libnuma
+	numa_dep = cc.find_library('numa', required: false)
+	if numa_dep.found() and cc.has_header('numaif.h')
+		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+		has_libnuma = 1
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0
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 210ad4508..063661ebf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -147,3 +147,7 @@ There are other options you may specify in a cross file to tailor the build::
       disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
          # valid values are directories (optionally with their subdirs)
          # in the drivers directory
+
+      numa = false        # set to false to force building for a non-NUMA system
+         # if not set or set to true, the build system will build for a NUMA
+         # system only if libnuma is installed
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 13/14] build: add Arm SoC meson option
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (11 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 12/14] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
                                         ` (2 subsequent siblings)
  15 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   7 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 129 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
 meson_options.txt                             |   2 +
 14 files changed, 166 insertions(+), 108 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 487cb2923..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,9 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da..64d44ead8 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c762..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 492b7e40f..1738e36c3 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -30,7 +30,7 @@ native_machine_args = ['-mcpu=native']
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -180,6 +180,99 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines.',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false,
+	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -192,11 +285,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -215,8 +315,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -242,8 +361,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 063661ebf..83bdb78bf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -100,54 +100,32 @@ command::
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
-         # valid values are directories (optionally with their subdirs)
-         # in the drivers directory
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Darm_soc meson
+option::
+
+   meson soc_build -Darm_soc=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   soc = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index 51ea63a4c..4ad6acfb2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')
 option('disable_drivers', type: 'string', value: '',
 	description: 'Comma-separated list of drivers to explicitly disable.')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v12 14/14] config: fix Arm implementer and its SoCs
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (12 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 13/14] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-13 14:31                       ` Juraj Linkeš
  2020-11-14 17:52                         ` [dpdk-dev] [EXT] " Liron Himi
  2020-11-13 14:40                       ` [dpdk-dev] [PATCH v12 00/14] Arm build options rework Ruifeng Wang
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
  15 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-13 14:31 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 54 ++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 1738e36c3..f25a7dbab 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -75,8 +75,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -146,38 +146,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -190,8 +164,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
 }
@@ -200,13 +178,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -243,6 +231,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build
  2020-11-13 14:22                         ` Juraj Linkeš
@ 2020-11-13 14:35                           ` Thomas Monjalon
  0 siblings, 0 replies; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-13 14:35 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

13/11/2020 15:22, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 13/11/2020 15:03, Juraj Linkeš:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > 11/11/2020 14:18, Juraj Linkeš:
> > > > > Use generic configuration for the only build where it makes sense
> > > > > - the generic build. For other builds, if we don't know either of
> > > > > implementer ID or part number, the build is not supported.
> > > > > Add part numbers to cross files where fallback to generic
> > > > > configuration is assumed.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > >
> > > > It fails for config/arm/arm64_dpaa_linux_gcc:
> > > > config/arm/meson.build:223:2: ERROR: Unknown cross property:
> > part_number.
> > > >
> > > > Are you testing all platforms in config/arm/?
> > > >
> > >
> > > I've tested this, but I forgot to fix it when I learned what the proper
> > part_number should be. It works with all the patches in the series, but I can add
> > it here as well if you want me to.
> > 
> > All patches must compile please.
> > I'm afraid it will make this series deferred to later.
> 
> I can send a fixed version right away.

OK but be aware that we need to wait for the CI
and I won't have time to test again compilation today,
so no guarantee about when it can be merged.



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

* Re: [dpdk-dev] [PATCH v12 00/14] Arm build options rework
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (13 preceding siblings ...)
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-11-13 14:40                       ` Ruifeng Wang
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
  15 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2020-11-13 14:40 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, November 13, 2020 10:31 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v12 00/14] Arm build options rework
> 
> The current way of specifying Arm configuration options is insufficient since
> we can't identify the SoC we're building for from the MIDR information. For
> example, we can't distinguish between N1SDP, Graviton2 or Ampere Altra.
> 
> Add a way to specify the cpu count and numa node count for cross builds and
> aarch64 -> aarch64 (SoC) builds.
> 
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed 2. a
> cross build on a fast aarch64 machine but with target SoC which
>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in SoC configuration.
> 
> Among libraries, only libnuma can be now disabled.
> 
> Also add an optional way to discover cpu count a numa node count. Fix -
> Dmax_lcores and -Dmax_numa_nodes for arm builds.
> 
> The current implementation adds/supports the following:
> * x86 -> aarch64 cross build with added config options/disabled
>   drivers/libs
> * aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
>   option or using a cross file
> * max numa nodes and max lcore may be specified on the command line to
>   overwrite the values for any (native, SoC or cross) build
> 
> v2:
> Major rework of the whole series.
> 
> v3:
> Added numa and core count defaults for x86 default build.
> Removed numa and core count defaults. Now requiring defaults to be
> specified in a cross file or on the cmdline.
> Added FreeBDS support for numa count discovery.
> 
> v4:
> Make automatic numa and cpu counts discovery optional.
> 
> v5:
> Split the refactor patch into smaller patches.
> Simplify buildtools/get_numa_count.py.
> Add more explanation to cover letter.
> 
> v6:
> Apply cross file options arch agnostically, not just in Arm cross builds.
> Streamline Arm build setup and machine args: always use native args in
> native builds, require implementer ID and part number for cross builds.
> 
> v7:
> Arm config options are now organized in one dictionary.
> Removed unsupported implementers and removed fallback to generic
> implementer/part number for unknown implementer/part number.
> Added meson config option arm_soc which can be used to specify
> configuration to be used, useful for aarch64 -> aarch64 builds.
> 
> v8:
> Rebase.
> 
> v9:
> Split SoC and implementer dictionaries into smaller parts.
> Fixed DPAA and ARMADA SoC configuration.
> Added documentation about supported SoCs.
> 
> v10:
> Added a commit that fixes Graviton2 clang build failures in native build.
> 
> v11:
> Rebase.
> 
> v12:
> Fixed dpaa and armada cross builds in generic build commit.
> 
> Series Acked-by: Jerin Jacob <jerinj@marvell.com> Series Tested-by: Jerin
> Jacob <jerinj@marvell.com> Series Tested-by: Dharmik Thakkar
> <dharmik.thakkar@arm.com>
> 
Series Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>

> Juraj Linkeš (14):
>   build: alias default build as generic
>   build: rename Arm build variables
>   build: remove unused or superfluous variables
>   build: reformat and move Arm config and comments
>   build: simplify how Arm flags are processed
>   build: organize Arm config into dict
>   build: isolate configuration for generic build
>   build: use native machine args in Arm native build
>   build: optional NUMA and cpu counts detection
>   build: add core and NUMA counts to cross files
>   build: disable Arm drivers
>   build: disable libnuma in cross builds
>   build: add Arm SoC meson option
>   config: fix Arm implementer and its SoCs
> 
>  buildtools/get_cpu_count.py                   |   7 +
>  buildtools/get_numa_count.py                  |  22 +
>  buildtools/meson.build                        |   2 +
>  config/arm/arm64_armada_linux_gcc             |   2 +-
>  config/arm/arm64_armv8_linux_gcc              |  15 +-
>  config/arm/arm64_bluefield_linux_gcc          |   3 +-
>  config/arm/arm64_dpaa_linux_gcc               |   2 +-
>  config/arm/arm64_emag_linux_gcc               |   2 +-
>  config/arm/arm64_graviton2_linux_gcc          |   3 +-
>  config/arm/arm64_n1sdp_linux_gcc              |   3 +-
>  config/arm/arm64_octeontx2_linux_gcc          |   3 +-
>  config/arm/arm64_stingray_linux_gcc           |   3 +-
>  config/arm/arm64_thunderx2_linux_gcc          |   3 +-
>  ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
>  config/arm/meson.build                        | 503 ++++++++++++------
>  config/meson.build                            |  90 +++-
>  config/x86/meson.build                        |   2 +
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
>  doc/guides/prog_guide/build-sdk-meson.rst     |   4 +-
>  drivers/meson.build                           |   6 +-
>  meson.build                                   |   1 +
>  meson_options.txt                             |  12 +-
>  22 files changed, 504 insertions(+), 216 deletions(-)  create mode 100644
> buildtools/get_cpu_count.py  create mode 100644
> buildtools/get_numa_count.py  rename
> config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc}
> (92%)
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
@ 2020-11-14 13:16                         ` Thomas Monjalon
  2020-11-16  7:15                           ` Juraj Linkeš
  2020-11-16  7:37                           ` Thomas Monjalon
  2020-11-16  7:24                         ` Thomas Monjalon
  1 sibling, 2 replies; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-14 13:16 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

13/11/2020 15:31, Juraj Linkeš:
> Add an option to automatically discover the host's numa and cpu counts
> and use those values for a non cross-build.
> Give users the option to override the per-arch default values or values
> from cross files by specifying them on the command line with -Dmax_lcores
> and -Dmax_numa_nodes.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
[...]
>  create mode 100644 buildtools/get_cpu_count.py
>  create mode 100644 buildtools/get_numa_count.py

These new files should be added in the file MAINTAINERS.
The recommended pattern is to use - as word separator in script filenames.

I'm also worried there is no more review on such general change,
especially the description in meson_options.txt:

> +option('max_lcores', type: 'integer', value: 0,
> +       description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
> +option('max_numa_nodes', type: 'integer', value: 0,
> +       description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa\0

I didn't think this series is changing options for all archs.
It was supposed to be an Arm-only rework.
Clearly it is too late for such change in 20.11.

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

* Re: [dpdk-dev] [EXT] [PATCH v12 14/14] config: fix Arm implementer and its SoCs
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-11-14 17:52                         ` Liron Himi
  0 siblings, 0 replies; 465+ messages in thread
From: Liron Himi @ 2020-11-14 17:52 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, yskoh, Liron Himi

Reviewed-by: Liron Himi<lironh@marvell.com>

-----Original Message-----
From: Juraj Linkeš <juraj.linkes@pantheon.tech> 
Sent: Friday, 13 November 2020 16:31
To: bruce.richardson@intel.com; Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com; hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com; ferruh.yigit@intel.com
Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>; Liron Himi <lironh@marvell.com>; yskoh@mellanox.com
Subject: [EXT] [PATCH v12 14/14] config: fix Arm implementer and its SoCs

External Email

----------------------------------------------------------------------
Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 54 ++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build index 1738e36c3..f25a7dbab 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -75,8 +75,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm  } @@ -146,38 +146,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)  implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority @@ -190,8 +164,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']  } @@ -200,13 +178,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -243,6 +231,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
--
2.20.1


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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-14 13:16                         ` Thomas Monjalon
@ 2020-11-16  7:15                           ` Juraj Linkeš
  2020-11-16  7:19                             ` Thomas Monjalon
  2020-11-16  7:37                           ` Thomas Monjalon
  1 sibling, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-16  7:15 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Saturday, November 14, 2020 2:16 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> detection
> 
> 13/11/2020 15:31, Juraj Linkeš:
> > Add an option to automatically discover the host's numa and cpu counts
> > and use those values for a non cross-build.
> > Give users the option to override the per-arch default values or
> > values from cross files by specifying them on the command line with
> > -Dmax_lcores and -Dmax_numa_nodes.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> [...]
> >  create mode 100644 buildtools/get_cpu_count.py  create mode 100644
> > buildtools/get_numa_count.py
> 
> These new files should be added in the file MAINTAINERS.

Should I add a new section? I just add them under Build System, making Bruce the maintainer of these?

> The recommended pattern is to use - as word separator in script filenames.
> 

Ok, I'll rename them.

> I'm also worried there is no more review on such general change, especially the
> description in meson_options.txt:
> 
> > +option('max_lcores', type: 'integer', value: 0,
> > +       description: 'maximum number of cores/threads supported by
> > +EAL. Set to positive integer to overwrite per-arch or cross-compilation
> defaults. Set to -1 to detect the number of cores on the build machine.')
> option('max_numa_nodes', type: 'integer', value: 0,
> > +       description: 'maximum number of NUMA nodes supported by EAL. Set to
> positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to
> detect the number of numa

Honnappa reviewed this and Bruce also provided his comments and he's the only maintainer listed for meson_options.txt. Who else should review this?

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-16  7:15                           ` Juraj Linkeš
@ 2020-11-16  7:19                             ` Thomas Monjalon
  2020-11-18 14:20                               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16  7:19 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

16/11/2020 08:15, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 13/11/2020 15:31, Juraj Linkeš:
> > > Add an option to automatically discover the host's numa and cpu counts
> > > and use those values for a non cross-build.
> > > Give users the option to override the per-arch default values or
> > > values from cross files by specifying them on the command line with
> > > -Dmax_lcores and -Dmax_numa_nodes.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > [...]
> > >  create mode 100644 buildtools/get_cpu_count.py  create mode 100644
> > > buildtools/get_numa_count.py
> > 
> > These new files should be added in the file MAINTAINERS.
> 
> Should I add a new section? I just add them under Build System,
> making Bruce the maintainer of these?

If Bruce is OK, it looks fine.


> > The recommended pattern is to use - as word separator in script filenames.
> > 
> 
> Ok, I'll rename them.
> 
> > I'm also worried there is no more review on such general change, especially the
> > description in meson_options.txt:
> > 
> > > +option('max_lcores', type: 'integer', value: 0,
> > > +       description: 'maximum number of cores/threads supported by
> > > +EAL. Set to positive integer to overwrite per-arch or cross-compilation
> > defaults. Set to -1 to detect the number of cores on the build machine.')
> > option('max_numa_nodes', type: 'integer', value: 0,
> > > +       description: 'maximum number of NUMA nodes supported by EAL. Set to
> > positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to
> > detect the number of numa
> 
> Honnappa reviewed this and Bruce also provided his comments
> and he's the only maintainer listed for meson_options.txt.
> Who else should review this?

Bruce did not ack.
I want to do careful reviews myself as well.



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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
  2020-11-14 13:16                         ` Thomas Monjalon
@ 2020-11-16  7:24                         ` Thomas Monjalon
  2020-11-16  9:13                           ` Bruce Richardson
  1 sibling, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16  7:24 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

13/11/2020 15:31, Juraj Linkeš:
> +option('max_lcores', type: 'integer', value: 0,
> +	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
> +option('max_numa_nodes', type: 'integer', value: 0,
> +	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa nodes on the build machine.')

First comment: I don't like having so long description.
Second: I don't understand.

It is said the default value is 0 so I expect it means automatic detection.
But later it is said -1 is for detection. So ?



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

* Re: [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers Juraj Linkeš
@ 2020-11-16  7:28                         ` Thomas Monjalon
  2020-11-16  7:56                           ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16  7:28 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

What do you mean by "disable Arm drivers"?
What are "Arm drivers"

13/11/2020 15:31, Juraj Linkeš:
> A few options that disabled drivers in the old makefiles were improperly
> ported to the meson build system. Fix this by adding a to the list of
> disabled drivers, similarly how the command line option works. Remove
> unneeded driver options ported from the old makefile system.
> Add support for removing drivers for cross builds.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
[...]
> -	['RTE_NET_FM10K', false],
> -	['RTE_NET_AVP', false],

Isn't it enabling drivers?

[...]
> +if meson.is_cross_build()
> +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> +endif

Why is it specific to cross build?




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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic Juraj Linkeš
@ 2020-11-16  7:32                         ` Thomas Monjalon
  2020-11-16 15:50                           ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16  7:32 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

13/11/2020 15:31, Juraj Linkeš:
> The current machine='default' build name is not descriptive. The actual
> default build is machine='native'. Add an alternative string which does
> the same build and better describes what we're building:
> machine='generic'. Leave machine='default' for backwards compatibility.

What?

"default" should be the most common set of options to make a build work everywhere.
"native" is the build machine.

"generic" means... nothing.




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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-14 13:16                         ` Thomas Monjalon
  2020-11-16  7:15                           ` Juraj Linkeš
@ 2020-11-16  7:37                           ` Thomas Monjalon
  2020-11-18 13:24                             ` Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16  7:37 UTC (permalink / raw)
  To: Juraj Linkeš, Honnappa.Nagarahalli
  Cc: dev, bruce.richardson, Ruifeng.Wang, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, david.marchand

14/11/2020 14:16, Thomas Monjalon:
> I didn't think this series is changing options for all archs.
> It was supposed to be an Arm-only rework.
> Clearly it is too late for such change in 20.11.

I recommend splitting the series for 21.02.
Do not change global stuff in a series named "Arm build options rework".
It will be easier to absorb as smaller items. Step by step.



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

* Re: [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
  2020-11-16  7:28                         ` Thomas Monjalon
@ 2020-11-16  7:56                           ` Juraj Linkeš
  2020-11-16  8:22                             ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-16  7:56 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, November 16, 2020 8:29 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
> 
> What do you mean by "disable Arm drivers"?
> What are "Arm drivers"
> 

These are the drivers that we're disableing for Arm builds. I'll change it to something more clearer like "disable drivers in Arm builds"

> 13/11/2020 15:31, Juraj Linkeš:
> > A few options that disabled drivers in the old makefiles were
> > improperly ported to the meson build system. Fix this by adding a to
> > the list of disabled drivers, similarly how the command line option
> > works. Remove unneeded driver options ported from the old makefile system.
> > Add support for removing drivers for cross builds.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> [...]
> > -	['RTE_NET_FM10K', false],
> > -	['RTE_NET_AVP', false],
> 
> Isn't it enabling drivers?
> 

These options don't do anything in the way the current meson build system is set up, since they'll be overwritten in drivers/meson.build. The order is, from meson.build (in the git root):
subdir('config')   # here we're setting arm specific flags
...
subdir('drivers')  # and here they'd be overwritten

> [...]
> > +if meson.is_cross_build()
> > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > +endif
> 
> Why is it specific to cross build?
> 

I don't understand the question, what is "it"? This is adding support for disabling drivers in cross builds so I guess that part is specific to cross builds?

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

* Re: [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
  2020-11-16  7:56                           ` Juraj Linkeš
@ 2020-11-16  8:22                             ` Thomas Monjalon
  2020-11-16 15:54                               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16  8:22 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

16/11/2020 08:56, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 
> > What do you mean by "disable Arm drivers"?
> > What are "Arm drivers"
> > 
> 
> These are the drivers that we're disableing for Arm builds. I'll change it to something more clearer like "disable drivers in Arm builds"
> 
> > 13/11/2020 15:31, Juraj Linkeš:
> > > A few options that disabled drivers in the old makefiles were
> > > improperly ported to the meson build system. Fix this by adding a to
> > > the list of disabled drivers, similarly how the command line option
> > > works. Remove unneeded driver options ported from the old makefile system.
> > > Add support for removing drivers for cross builds.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > [...]
> > > -	['RTE_NET_FM10K', false],
> > > -	['RTE_NET_AVP', false],
> > 
> > Isn't it enabling drivers?
> > 
> 
> These options don't do anything in the way the current meson build system is set up, since they'll be overwritten in drivers/meson.build. The order is, from meson.build (in the git root):
> subdir('config')   # here we're setting arm specific flags
> ...
> subdir('drivers')  # and here they'd be overwritten

Should this change be in the same patch as disabling some drivers?
If yes, please explain in the commit log.


> > [...]
> > > +if meson.is_cross_build()
> > > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > > +endif
> > 
> > Why is it specific to cross build?
> 
> I don't understand the question, what is "it"? This is adding support for disabling drivers in cross builds so I guess that part is specific to cross builds?

OK I understand.



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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-16  7:24                         ` Thomas Monjalon
@ 2020-11-16  9:13                           ` Bruce Richardson
  2020-11-16  9:23                             ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-16  9:13 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev

On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> 13/11/2020 15:31, Juraj Linkeš:
> > +option('max_lcores', type: 'integer', value: 0,
> > +	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
> > +option('max_numa_nodes', type: 'integer', value: 0,
> > +	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa nodes on the build machine.')
> 
> First comment: I don't like having so long description.
> Second: I don't understand.
> 
> It is said the default value is 0 so I expect it means automatic detection.
> But later it is said -1 is for detection. So ?
> 
Zero is for the "per-arch or cross-compilation default". This was discussed
quite a bit in previous versions and this was te best compromise we could
come up with. Having a default of auto-detect is definitely not something I
think we should go with - just thinking of all the build CI jobs running on
2 or 4 core VMs! However, Juraj really felt there was value in having
auto-detection, so it's set as a -1 value, which I'm ok with.

As I flagged in a previous mail thread, the whole config of DPDK builds is
something we need to take a bigger look at in 21.02 and beyond.

/Bruce

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-16  9:13                           ` Bruce Richardson
@ 2020-11-16  9:23                             ` Thomas Monjalon
  2020-11-18 14:19                               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16  9:23 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev

16/11/2020 10:13, Bruce Richardson:
> On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > 13/11/2020 15:31, Juraj Linkeš:
> > > +option('max_lcores', type: 'integer', value: 0,
> > > +	description: 'maximum number of cores/threads supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of cores on the build machine.')
> > > +option('max_numa_nodes', type: 'integer', value: 0,
> > > +	description: 'maximum number of NUMA nodes supported by EAL. Set to positive integer to overwrite per-arch or cross-compilation defaults. Set to -1 to detect the number of numa nodes on the build machine.')
> > 
> > First comment: I don't like having so long description.
> > Second: I don't understand.
> > 
> > It is said the default value is 0 so I expect it means automatic detection.
> > But later it is said -1 is for detection. So ?
> > 
> Zero is for the "per-arch or cross-compilation default". This was discussed
> quite a bit in previous versions and this was te best compromise we could
> come up with. Having a default of auto-detect is definitely not something I
> think we should go with - just thinking of all the build CI jobs running on
> 2 or 4 core VMs! However, Juraj really felt there was value in having
> auto-detection, so it's set as a -1 value, which I'm ok with.

The problem is that I don't understand what 0 means.

> As I flagged in a previous mail thread, the whole config of DPDK builds is
> something we need to take a bigger look at in 21.02 and beyond.

Yes definitely.



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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-16  7:32                         ` Thomas Monjalon
@ 2020-11-16 15:50                           ` Juraj Linkeš
  2020-11-16 16:16                             ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-16 15:50 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, November 16, 2020 8:33 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
> 
> 13/11/2020 15:31, Juraj Linkeš:
> > The current machine='default' build name is not descriptive. The
> > actual default build is machine='native'. Add an alternative string
> > which does the same build and better describes what we're building:
> > machine='generic'. Leave machine='default' for backwards compatibility.
> 
> What?
> 
> "generic" means... nothing.
> 

An absence of anything means nothing. Generic means "characteristic of or relating to a class or group of things; not specific", which is pretty much what we're looking for.

> "default" should be the most common set of options to make a build work
> everywhere.

What we want is a value of machine that would "be the most common set of options to make a build work everywhere" and using the above definition of generic, it fits very well.
The reason I said the actual default build is machine='native' is because that's how the machine option is defined in meson_options.txt. It follows from what default actually means - "a preselected option adopted by a computer program or other mechanism when no alternative is specified by the user or programmer". Default then means no user input, which means machine='native', which means the default build is the default build.

What ""default" should mean" looks like an attempt at redefining what the word actually means and leads to confusion, in my experience. Hence an attempt to remove the potential ambiguity.

> "native" is the build machine.
> 

The other thing we want is a value for build machine and there's no need to change anything about that.

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

* Re: [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
  2020-11-16  8:22                             ` Thomas Monjalon
@ 2020-11-16 15:54                               ` Juraj Linkeš
  2020-11-16 20:35                                 ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-16 15:54 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, November 16, 2020 9:23 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
> 
> 16/11/2020 08:56, Juraj Linkeš:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > >
> > > What do you mean by "disable Arm drivers"?
> > > What are "Arm drivers"
> > >
> >
> > These are the drivers that we're disableing for Arm builds. I'll change it to
> something more clearer like "disable drivers in Arm builds"
> >
> > > 13/11/2020 15:31, Juraj Linkeš:
> > > > A few options that disabled drivers in the old makefiles were
> > > > improperly ported to the meson build system. Fix this by adding a
> > > > to the list of disabled drivers, similarly how the command line
> > > > option works. Remove unneeded driver options ported from the old
> makefile system.
> > > > Add support for removing drivers for cross builds.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > [...]
> > > > -	['RTE_NET_FM10K', false],
> > > > -	['RTE_NET_AVP', false],
> > >
> > > Isn't it enabling drivers?
> > >
> >
> > These options don't do anything in the way the current meson build system is
> set up, since they'll be overwritten in drivers/meson.build. The order is, from
> meson.build (in the git root):
> > subdir('config')   # here we're setting arm specific flags
> > ...
> > subdir('drivers')  # and here they'd be overwritten
> 
> Should this change be in the same patch as disabling some drivers?
> If yes, please explain in the commit log.
> 

I think so, the fix consist not only of adding support for disabling drivers, but also removing the parts that look like they're doing that but fail to do so (so, in essence replacing the faulty config with proper support). I'll update the commit message.

> 
> > > [...]
> > > > +if meson.is_cross_build()
> > > > +	disabled_drivers += meson.get_cross_property('disabled_drivers',
> > > > +[]) endif
> > >
> > > Why is it specific to cross build?
> >
> > I don't understand the question, what is "it"? This is adding support for
> disabling drivers in cross builds so I guess that part is specific to cross builds?
> 
> OK I understand.
> 
> 


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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-16 15:50                           ` Juraj Linkeš
@ 2020-11-16 16:16                             ` Bruce Richardson
  2020-11-16 20:35                               ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-16 16:16 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Thomas Monjalon, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

On Mon, Nov 16, 2020 at 03:50:31PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Sent: Monday, November 16, 2020 8:33 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> > Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> > vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> > ferruh.yigit@intel.com; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
> > 
> > 13/11/2020 15:31, Juraj Linkeš:
> > > The current machine='default' build name is not descriptive. The
> > > actual default build is machine='native'. Add an alternative string
> > > which does the same build and better describes what we're building:
> > > machine='generic'. Leave machine='default' for backwards compatibility.
> > 
> > What?
> > 
> > "generic" means... nothing.
> > 
> 
> An absence of anything means nothing. Generic means "characteristic of or relating to a class or group of things; not specific", which is pretty much what we're looking for.
> 
> > "default" should be the most common set of options to make a build work
> > everywhere.
> 
> What we want is a value of machine that would "be the most common set of options to make a build work everywhere" and using the above definition of generic, it fits very well.
> The reason I said the actual default build is machine='native' is because that's how the machine option is defined in meson_options.txt. It follows from what default actually means - "a preselected option adopted by a computer program or other mechanism when no alternative is specified by the user or programmer". Default then means no user input, which means machine='native', which means the default build is the default build.
> 
> What ""default" should mean" looks like an attempt at redefining what the word actually means and leads to confusion, in my experience. Hence an attempt to remove the potential ambiguity.
> 

I would tend to agree that "generic" is probably a better term than
"default" for what we use it for here in the config.

/Bruce

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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-16 16:16                             ` Bruce Richardson
@ 2020-11-16 20:35                               ` Thomas Monjalon
  2020-11-17  2:46                                 ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16 20:35 UTC (permalink / raw)
  To: Juraj Linkeš, Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev, david.marchand

16/11/2020 17:16, Bruce Richardson:
> On Mon, Nov 16, 2020 at 03:50:31PM +0000, Juraj Linkeš wrote:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 13/11/2020 15:31, Juraj Linkeš:
> > > > The current machine='default' build name is not descriptive. The
> > > > actual default build is machine='native'. Add an alternative string
> > > > which does the same build and better describes what we're building:
> > > > machine='generic'. Leave machine='default' for backwards compatibility.
> > > 
> > > What?
> > > 
> > > "generic" means... nothing.
> > > 
> > 
> > An absence of anything means nothing. Generic means "characteristic of or relating to a class or group of things; not specific", which is pretty much what we're looking for.
> > 
> > > "default" should be the most common set of options to make a build work
> > > everywhere.
> > 
> > What we want is a value of machine that would "be the most common set of options to make a build work everywhere" and using the above definition of generic, it fits very well.
> > The reason I said the actual default build is machine='native' is because that's how the machine option is defined in meson_options.txt. It follows from what default actually means - "a preselected option adopted by a computer program or other mechanism when no alternative is specified by the user or programmer". Default then means no user input, which means machine='native', which means the default build is the default build.
> > 
> > What ""default" should mean" looks like an attempt at redefining what the word actually means and leads to confusion, in my experience. Hence an attempt to remove the potential ambiguity.
> > 
> 
> I would tend to agree that "generic" is probably a better term than
> "default" for what we use it for here in the config.

In the past, we had a different definition with make config.
I am just trying to be consistent.
Even with meson, default means "minimal CPU instructions".

Example in devtools/test-meson-builds.sh:
"test compilation with minimal x86 instruction set"
is called build-x86-default.

In config/meson.build:
"
machine type 'default' is special, it defaults to the per arch agreed common
minimal baseline needed for DPDK.
That might not be the most optimized, but the most portable version while
still being able to support the CPU features required for DPDK.
This can be bumped up by the DPDK project, but it can never be an
invariant like 'native'
"

So, why this definition is called "generic" in meson Arm config?



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

* Re: [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers
  2020-11-16 15:54                               ` Juraj Linkeš
@ 2020-11-16 20:35                                 ` Thomas Monjalon
  0 siblings, 0 replies; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-16 20:35 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

16/11/2020 16:54, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 16/11/2020 08:56, Juraj Linkeš:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > >
> > > > What do you mean by "disable Arm drivers"?
> > > > What are "Arm drivers"
> > > >
> > >
> > > These are the drivers that we're disableing for Arm builds. I'll change it to
> > something more clearer like "disable drivers in Arm builds"
> > >
> > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > A few options that disabled drivers in the old makefiles were
> > > > > improperly ported to the meson build system. Fix this by adding a
> > > > > to the list of disabled drivers, similarly how the command line
> > > > > option works. Remove unneeded driver options ported from the old
> > makefile system.
> > > > > Add support for removing drivers for cross builds.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > > [...]
> > > > > -	['RTE_NET_FM10K', false],
> > > > > -	['RTE_NET_AVP', false],
> > > >
> > > > Isn't it enabling drivers?
> > > >
> > >
> > > These options don't do anything in the way the current meson build system is
> > set up, since they'll be overwritten in drivers/meson.build. The order is, from
> > meson.build (in the git root):
> > > subdir('config')   # here we're setting arm specific flags
> > > ...
> > > subdir('drivers')  # and here they'd be overwritten
> > 
> > Should this change be in the same patch as disabling some drivers?
> > If yes, please explain in the commit log.
> > 
> 
> I think so, the fix consist not only of adding support for disabling drivers, but also removing the parts that look like they're doing that but fail to do so (so, in essence replacing the faulty config with proper support). I'll update the commit message.

OK



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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-16 20:35                               ` Thomas Monjalon
@ 2020-11-17  2:46                                 ` Honnappa Nagarahalli
  2020-11-17  7:49                                   ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-17  2:46 UTC (permalink / raw)
  To: thomas, Juraj Linkeš, Bruce Richardson
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, david.marchand, nd, Honnappa Nagarahalli, nd

<snip>

> 
> 16/11/2020 17:16, Bruce Richardson:
> > On Mon, Nov 16, 2020 at 03:50:31PM +0000, Juraj Linkeš wrote:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > The current machine='default' build name is not descriptive. The
> > > > > actual default build is machine='native'. Add an alternative
> > > > > string which does the same build and better describes what we're
> building:
> > > > > machine='generic'. Leave machine='default' for backwards
> compatibility.
> > > >
> > > > What?
> > > >
> > > > "generic" means... nothing.
> > > >
> > >
> > > An absence of anything means nothing. Generic means "characteristic of
> or relating to a class or group of things; not specific", which is pretty much
> what we're looking for.
> > >
> > > > "default" should be the most common set of options to make a build
> > > > work everywhere.
> > >
> > > What we want is a value of machine that would "be the most common
> set of options to make a build work everywhere" and using the above
> definition of generic, it fits very well.
> > > The reason I said the actual default build is machine='native' is because
> that's how the machine option is defined in meson_options.txt. It follows
> from what default actually means - "a preselected option adopted by a
> computer program or other mechanism when no alternative is specified by
> the user or programmer". Default then means no user input, which means
> machine='native', which means the default build is the default build.
> > >
> > > What ""default" should mean" looks like an attempt at redefining what
> the word actually means and leads to confusion, in my experience. Hence an
> attempt to remove the potential ambiguity.
> > >
> >
> > I would tend to agree that "generic" is probably a better term than
> > "default" for what we use it for here in the config.
> 
> In the past, we had a different definition with make config.
> I am just trying to be consistent.
> Even with meson, default means "minimal CPU instructions".
> 
> Example in devtools/test-meson-builds.sh:
> "test compilation with minimal x86 instruction set"
> is called build-x86-default.
> 
> In config/meson.build:
> "
> machine type 'default' is special, it defaults to the per arch agreed common
> minimal baseline needed for DPDK.
> That might not be the most optimized, but the most portable version while
> still being able to support the CPU features required for DPDK.
> This can be bumped up by the DPDK project, but it can never be an invariant
> like 'native'
> "
> 
> So, why this definition is called "generic" in meson Arm config?
The explanation above is for a build type 'default'. Whereas meson by default builds for build type 'native'. Also when you look at the config/arm/meson.build the word 'default' was used where it was not related to the build type default. It created lot of confusion.

From the dictionary 'default' - "a preselected option adopted by a computer program or other mechanism when no alternative is specified by the user or programmer." But, if one had to do build of type default, they have to mention -Dmachine=default. If nothing is mentioned, it is a build type 'native', which does not go along with the definition of 'default'.

But for 'generic' - "characteristic of or relating to a class or group of things; not specific". IMO, it better suits the explanation you have provided above. So, separating this machine type to 'generic' to cover the same definition makes more sense.

However, 'default' is still supported for backward compatibility.


> 


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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-17  2:46                                 ` Honnappa Nagarahalli
@ 2020-11-17  7:49                                   ` Thomas Monjalon
  2020-11-17  9:15                                     ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-17  7:49 UTC (permalink / raw)
  To: Juraj Linkeš, Bruce Richardson, Honnappa Nagarahalli
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, david.marchand, nd

17/11/2020 03:46, Honnappa Nagarahalli:
> <snip>
> 
> > 
> > 16/11/2020 17:16, Bruce Richardson:
> > > On Mon, Nov 16, 2020 at 03:50:31PM +0000, Juraj Linkeš wrote:
> > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > The current machine='default' build name is not descriptive. The
> > > > > > actual default build is machine='native'. Add an alternative
> > > > > > string which does the same build and better describes what we're
> > building:
> > > > > > machine='generic'. Leave machine='default' for backwards
> > compatibility.
> > > > >
> > > > > What?
> > > > >
> > > > > "generic" means... nothing.
> > > > >
> > > >
> > > > An absence of anything means nothing. Generic means "characteristic of
> > or relating to a class or group of things; not specific", which is pretty much
> > what we're looking for.
> > > >
> > > > > "default" should be the most common set of options to make a build
> > > > > work everywhere.
> > > >
> > > > What we want is a value of machine that would "be the most common
> > set of options to make a build work everywhere" and using the above
> > definition of generic, it fits very well.
> > > > The reason I said the actual default build is machine='native' is because
> > that's how the machine option is defined in meson_options.txt. It follows
> > from what default actually means - "a preselected option adopted by a
> > computer program or other mechanism when no alternative is specified by
> > the user or programmer". Default then means no user input, which means
> > machine='native', which means the default build is the default build.
> > > >
> > > > What ""default" should mean" looks like an attempt at redefining what
> > the word actually means and leads to confusion, in my experience. Hence an
> > attempt to remove the potential ambiguity.
> > > >
> > >
> > > I would tend to agree that "generic" is probably a better term than
> > > "default" for what we use it for here in the config.
> > 
> > In the past, we had a different definition with make config.
> > I am just trying to be consistent.
> > Even with meson, default means "minimal CPU instructions".
> > 
> > Example in devtools/test-meson-builds.sh:
> > "test compilation with minimal x86 instruction set"
> > is called build-x86-default.
> > 
> > In config/meson.build:
> > "
> > machine type 'default' is special, it defaults to the per arch agreed common
> > minimal baseline needed for DPDK.
> > That might not be the most optimized, but the most portable version while
> > still being able to support the CPU features required for DPDK.
> > This can be bumped up by the DPDK project, but it can never be an invariant
> > like 'native'
> > "
> > 
> > So, why this definition is called "generic" in meson Arm config?
> The explanation above is for a build type 'default'. Whereas meson by default builds for build type 'native'. Also when you look at the config/arm/meson.build the word 'default' was used where it was not related to the build type default. It created lot of confusion.
> 
> From the dictionary 'default' - "a preselected option adopted by a computer program or other mechanism when no alternative is specified by the user or programmer." But, if one had to do build of type default, they have to mention -Dmachine=default. If nothing is mentioned, it is a build type 'native', which does not go along with the definition of 'default'.
> 
> But for 'generic' - "characteristic of or relating to a class or group of things; not specific". IMO, it better suits the explanation you have provided above. So, separating this machine type to 'generic' to cover the same definition makes more sense.
> 
> However, 'default' is still supported for backward compatibility.

So? Are you going to change the DPDK definitions we had for years?



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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-17  7:49                                   ` Thomas Monjalon
@ 2020-11-17  9:15                                     ` Bruce Richardson
  2020-11-17  9:58                                       ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-17  9:15 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Juraj Linkeš,
	Honnappa Nagarahalli, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, david.marchand, nd

On Tue, Nov 17, 2020 at 08:49:45AM +0100, Thomas Monjalon wrote:
> 17/11/2020 03:46, Honnappa Nagarahalli:
> > <snip>
> > 
> > > 
> > > 16/11/2020 17:16, Bruce Richardson:
> > > > On Mon, Nov 16, 2020 at 03:50:31PM +0000, Juraj Linkeš wrote:
> > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > The current machine='default' build name is not descriptive. The
> > > > > > > actual default build is machine='native'. Add an alternative
> > > > > > > string which does the same build and better describes what we're
> > > building:
> > > > > > > machine='generic'. Leave machine='default' for backwards
> > > compatibility.
> > > > > >
> > > > > > What?
> > > > > >
> > > > > > "generic" means... nothing.
> > > > > >
> > > > >
> > > > > An absence of anything means nothing. Generic means "characteristic of
> > > or relating to a class or group of things; not specific", which is pretty much
> > > what we're looking for.
> > > > >
> > > > > > "default" should be the most common set of options to make a build
> > > > > > work everywhere.
> > > > >
> > > > > What we want is a value of machine that would "be the most common
> > > set of options to make a build work everywhere" and using the above
> > > definition of generic, it fits very well.
> > > > > The reason I said the actual default build is machine='native' is because
> > > that's how the machine option is defined in meson_options.txt. It follows
> > > from what default actually means - "a preselected option adopted by a
> > > computer program or other mechanism when no alternative is specified by
> > > the user or programmer". Default then means no user input, which means
> > > machine='native', which means the default build is the default build.
> > > > >
> > > > > What ""default" should mean" looks like an attempt at redefining what
> > > the word actually means and leads to confusion, in my experience. Hence an
> > > attempt to remove the potential ambiguity.
> > > > >
> > > >
> > > > I would tend to agree that "generic" is probably a better term than
> > > > "default" for what we use it for here in the config.
> > > 
> > > In the past, we had a different definition with make config.
> > > I am just trying to be consistent.
> > > Even with meson, default means "minimal CPU instructions".
> > > 
> > > Example in devtools/test-meson-builds.sh:
> > > "test compilation with minimal x86 instruction set"
> > > is called build-x86-default.
> > > 
> > > In config/meson.build:
> > > "
> > > machine type 'default' is special, it defaults to the per arch agreed common
> > > minimal baseline needed for DPDK.
> > > That might not be the most optimized, but the most portable version while
> > > still being able to support the CPU features required for DPDK.
> > > This can be bumped up by the DPDK project, but it can never be an invariant
> > > like 'native'
> > > "
> > > 
> > > So, why this definition is called "generic" in meson Arm config?
> > The explanation above is for a build type 'default'. Whereas meson by default builds for build type 'native'. Also when you look at the config/arm/meson.build the word 'default' was used where it was not related to the build type default. It created lot of confusion.
> > 
> > From the dictionary 'default' - "a preselected option adopted by a computer program or other mechanism when no alternative is specified by the user or programmer." But, if one had to do build of type default, they have to mention -Dmachine=default. If nothing is mentioned, it is a build type 'native', which does not go along with the definition of 'default'.
> > 
> > But for 'generic' - "characteristic of or relating to a class or group of things; not specific". IMO, it better suits the explanation you have provided above. So, separating this machine type to 'generic' to cover the same definition makes more sense.
> > 
> > However, 'default' is still supported for backward compatibility.
> 
> So? Are you going to change the DPDK definitions we had for years?
> 

I think we should, or at least support "generic" alongside it. Using the term
"default" for something that is not the default is confusing. It's also not
a good description of what the result is, since it's a generic binary for
the architecture, rather than a "default" one for the architecture.

/Bruce

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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-17  9:15                                     ` Bruce Richardson
@ 2020-11-17  9:58                                       ` Thomas Monjalon
  2020-11-18 14:23                                         ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-17  9:58 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Juraj Linkeš,
	Honnappa Nagarahalli, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, david.marchand, nd

17/11/2020 10:15, Bruce Richardson:
> On Tue, Nov 17, 2020 at 08:49:45AM +0100, Thomas Monjalon wrote:
> > 17/11/2020 03:46, Honnappa Nagarahalli:
> > > <snip>
> > > 
> > > > 
> > > > 16/11/2020 17:16, Bruce Richardson:
> > > > > On Mon, Nov 16, 2020 at 03:50:31PM +0000, Juraj Linkeš wrote:
> > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > The current machine='default' build name is not descriptive. The
> > > > > > > > actual default build is machine='native'. Add an alternative
> > > > > > > > string which does the same build and better describes what we're
> > > > building:
> > > > > > > > machine='generic'. Leave machine='default' for backwards
> > > > compatibility.
> > > > > > >
> > > > > > > What?
> > > > > > >
> > > > > > > "generic" means... nothing.
> > > > > > >
> > > > > >
> > > > > > An absence of anything means nothing. Generic means "characteristic of
> > > > or relating to a class or group of things; not specific", which is pretty much
> > > > what we're looking for.
> > > > > >
> > > > > > > "default" should be the most common set of options to make a build
> > > > > > > work everywhere.
> > > > > >
> > > > > > What we want is a value of machine that would "be the most common
> > > > set of options to make a build work everywhere" and using the above
> > > > definition of generic, it fits very well.
> > > > > > The reason I said the actual default build is machine='native' is because
> > > > that's how the machine option is defined in meson_options.txt. It follows
> > > > from what default actually means - "a preselected option adopted by a
> > > > computer program or other mechanism when no alternative is specified by
> > > > the user or programmer". Default then means no user input, which means
> > > > machine='native', which means the default build is the default build.
> > > > > >
> > > > > > What ""default" should mean" looks like an attempt at redefining what
> > > > the word actually means and leads to confusion, in my experience. Hence an
> > > > attempt to remove the potential ambiguity.
> > > > > >
> > > > >
> > > > > I would tend to agree that "generic" is probably a better term than
> > > > > "default" for what we use it for here in the config.
> > > > 
> > > > In the past, we had a different definition with make config.
> > > > I am just trying to be consistent.
> > > > Even with meson, default means "minimal CPU instructions".
> > > > 
> > > > Example in devtools/test-meson-builds.sh:
> > > > "test compilation with minimal x86 instruction set"
> > > > is called build-x86-default.
> > > > 
> > > > In config/meson.build:
> > > > "
> > > > machine type 'default' is special, it defaults to the per arch agreed common
> > > > minimal baseline needed for DPDK.
> > > > That might not be the most optimized, but the most portable version while
> > > > still being able to support the CPU features required for DPDK.
> > > > This can be bumped up by the DPDK project, but it can never be an invariant
> > > > like 'native'
> > > > "
> > > > 
> > > > So, why this definition is called "generic" in meson Arm config?
> > > The explanation above is for a build type 'default'. Whereas meson by default builds for build type 'native'. Also when you look at the config/arm/meson.build the word 'default' was used where it was not related to the build type default. It created lot of confusion.
> > > 
> > > From the dictionary 'default' - "a preselected option adopted by a computer program or other mechanism when no alternative is specified by the user or programmer." But, if one had to do build of type default, they have to mention -Dmachine=default. If nothing is mentioned, it is a build type 'native', which does not go along with the definition of 'default'.
> > > 
> > > But for 'generic' - "characteristic of or relating to a class or group of things; not specific". IMO, it better suits the explanation you have provided above. So, separating this machine type to 'generic' to cover the same definition makes more sense.
> > > 
> > > However, 'default' is still supported for backward compatibility.
> > 
> > So? Are you going to change the DPDK definitions we had for years?
> > 
> 
> I think we should, or at least support "generic" alongside it. Using the term
> "default" for something that is not the default is confusing. It's also not
> a good description of what the result is, since it's a generic binary for
> the architecture, rather than a "default" one for the architecture.

OK in this case, please do the patch which changes it everywhere,
not only for Arm. We can change our names as long as it is explained
and have some consistency.




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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-16  7:37                           ` Thomas Monjalon
@ 2020-11-18 13:24                             ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-18 13:24 UTC (permalink / raw)
  To: Thomas Monjalon, Honnappa.Nagarahalli
  Cc: dev, bruce.richardson, Ruifeng.Wang, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, david.marchand



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, November 16, 2020 8:38 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>;
> Honnappa.Nagarahalli@arm.com
> Cc: dev@dpdk.org; bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com;
> david.marchand@redhat.com
> Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> detection
> 
> 14/11/2020 14:16, Thomas Monjalon:
> > I didn't think this series is changing options for all archs.
> > It was supposed to be an Arm-only rework.
> > Clearly it is too late for such change in 20.11.
> 
> I recommend splitting the series for 21.02.
> Do not change global stuff in a series named "Arm build options rework".
> It will be easier to absorb as smaller items. Step by step.
> 
> 

Yes, this makes sense. This commit first started with arm specific parts/considerations, went through a lot of discussion and ended up here. I'll send it separately.



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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-16  9:23                             ` Thomas Monjalon
@ 2020-11-18 14:19                               ` Juraj Linkeš
  2020-11-18 14:42                                 ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-18 14:19 UTC (permalink / raw)
  To: Thomas Monjalon, Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, November 16, 2020 10:24 AM
> To: Bruce Richardson <bruce.richardson@intel.com>
> Cc: Juraj Linkeš <juraj.linkes@pantheon.tech>; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> detection
> 
> 16/11/2020 10:13, Bruce Richardson:
> > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > 13/11/2020 15:31, Juraj Linkeš:
> > > > +option('max_lcores', type: 'integer', value: 0,
> > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > +Set to positive integer to overwrite per-arch or cross-compilation
> defaults. Set to -1 to detect the number of cores on the build machine.')
> option('max_numa_nodes', type: 'integer', value: 0,
> > > > +	description: 'maximum number of NUMA nodes supported by EAL. Set
> > > > +to positive integer to overwrite per-arch or cross-compilation
> > > > +defaults. Set to -1 to detect the number of numa nodes on the
> > > > +build machine.')
> > >
> > > First comment: I don't like having so long description.
> > > Second: I don't understand.
> > >
> > > It is said the default value is 0 so I expect it means automatic detection.
> > > But later it is said -1 is for detection. So ?
> > >
> > Zero is for the "per-arch or cross-compilation default". This was
> > discussed quite a bit in previous versions and this was te best
> > compromise we could come up with. Having a default of auto-detect is
> > definitely not something I think we should go with - just thinking of
> > all the build CI jobs running on
> > 2 or 4 core VMs! However, Juraj really felt there was value in having
> > auto-detection, so it's set as a -1 value, which I'm ok with.
> 
> The problem is that I don't understand what 0 means.
> 

There are three pieces of information which we need to convey:
1. The default value (0) indicates that per-arch or cross-compilation defaults will be used.
2. Positive integer values will be used instead of these defaults.
3. Detected values will be used for native build when the value is -1.

The description is a bit longer because of this and I've already tried to shorten it by combining 1 and 2 into one sentence. But maybe we can shorten it while making it a bit clearer. I'll think about it.

> > As I flagged in a previous mail thread, the whole config of DPDK
> > builds is something we need to take a bigger look at in 21.02 and beyond.
> 
> Yes definitely.
> 
> 


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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-16  7:19                             ` Thomas Monjalon
@ 2020-11-18 14:20                               ` Juraj Linkeš
  2020-11-18 14:32                                 ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-18 14:20 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, November 16, 2020 8:20 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> detection
> 
> 16/11/2020 08:15, Juraj Linkeš:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 13/11/2020 15:31, Juraj Linkeš:
> > > > Add an option to automatically discover the host's numa and cpu
> > > > counts and use those values for a non cross-build.
> > > > Give users the option to override the per-arch default values or
> > > > values from cross files by specifying them on the command line
> > > > with -Dmax_lcores and -Dmax_numa_nodes.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > [...]
> > > >  create mode 100644 buildtools/get_cpu_count.py  create mode
> > > > 100644 buildtools/get_numa_count.py
> > >
> > > These new files should be added in the file MAINTAINERS.
> >
> > Should I add a new section? I just add them under Build System, making
> > Bruce the maintainer of these?
> 
> If Bruce is OK, it looks fine.
> 

Bruce, may I add the files to MAINTAINERS under your name?

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

* Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
  2020-11-17  9:58                                       ` Thomas Monjalon
@ 2020-11-18 14:23                                         ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-18 14:23 UTC (permalink / raw)
  To: Thomas Monjalon, Bruce Richardson
  Cc: Honnappa Nagarahalli, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, david.marchand, nd



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, November 17, 2020 10:58 AM
> To: Bruce Richardson <bruce.richardson@intel.com>
> Cc: Juraj Linkeš <juraj.linkes@pantheon.tech>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; dev@dpdk.org; david.marchand@redhat.com; nd
> <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic
> 
> 17/11/2020 10:15, Bruce Richardson:
> > On Tue, Nov 17, 2020 at 08:49:45AM +0100, Thomas Monjalon wrote:
> > > 17/11/2020 03:46, Honnappa Nagarahalli:
> > > > <snip>
> > > >
> > > > >
> > > > > 16/11/2020 17:16, Bruce Richardson:
> > > > > > On Mon, Nov 16, 2020 at 03:50:31PM +0000, Juraj Linkeš wrote:
> > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > The current machine='default' build name is not
> > > > > > > > > descriptive. The actual default build is
> > > > > > > > > machine='native'. Add an alternative string which does
> > > > > > > > > the same build and better describes what we're
> > > > > building:
> > > > > > > > > machine='generic'. Leave machine='default' for backwards
> > > > > compatibility.
> > > > > > > >
> > > > > > > > What?
> > > > > > > >
> > > > > > > > "generic" means... nothing.
> > > > > > > >
> > > > > > >
> > > > > > > An absence of anything means nothing. Generic means
> > > > > > > "characteristic of
> > > > > or relating to a class or group of things; not specific", which
> > > > > is pretty much what we're looking for.
> > > > > > >
> > > > > > > > "default" should be the most common set of options to make
> > > > > > > > a build work everywhere.
> > > > > > >
> > > > > > > What we want is a value of machine that would "be the most
> > > > > > > common
> > > > > set of options to make a build work everywhere" and using the
> > > > > above definition of generic, it fits very well.
> > > > > > > The reason I said the actual default build is
> > > > > > > machine='native' is because
> > > > > that's how the machine option is defined in meson_options.txt.
> > > > > It follows from what default actually means - "a preselected
> > > > > option adopted by a computer program or other mechanism when no
> > > > > alternative is specified by the user or programmer". Default
> > > > > then means no user input, which means machine='native', which means
> the default build is the default build.
> > > > > > >
> > > > > > > What ""default" should mean" looks like an attempt at
> > > > > > > redefining what
> > > > > the word actually means and leads to confusion, in my
> > > > > experience. Hence an attempt to remove the potential ambiguity.
> > > > > > >
> > > > > >
> > > > > > I would tend to agree that "generic" is probably a better term
> > > > > > than "default" for what we use it for here in the config.
> > > > >
> > > > > In the past, we had a different definition with make config.
> > > > > I am just trying to be consistent.
> > > > > Even with meson, default means "minimal CPU instructions".
> > > > >
> > > > > Example in devtools/test-meson-builds.sh:
> > > > > "test compilation with minimal x86 instruction set"
> > > > > is called build-x86-default.
> > > > >
> > > > > In config/meson.build:
> > > > > "
> > > > > machine type 'default' is special, it defaults to the per arch
> > > > > agreed common minimal baseline needed for DPDK.
> > > > > That might not be the most optimized, but the most portable
> > > > > version while still being able to support the CPU features required for
> DPDK.
> > > > > This can be bumped up by the DPDK project, but it can never be
> > > > > an invariant like 'native'
> > > > > "
> > > > >
> > > > > So, why this definition is called "generic" in meson Arm config?
> > > > The explanation above is for a build type 'default'. Whereas meson by
> default builds for build type 'native'. Also when you look at the
> config/arm/meson.build the word 'default' was used where it was not related to
> the build type default. It created lot of confusion.
> > > >
> > > > From the dictionary 'default' - "a preselected option adopted by a
> computer program or other mechanism when no alternative is specified by the
> user or programmer." But, if one had to do build of type default, they have to
> mention -Dmachine=default. If nothing is mentioned, it is a build type 'native',
> which does not go along with the definition of 'default'.
> > > >
> > > > But for 'generic' - "characteristic of or relating to a class or group of things;
> not specific". IMO, it better suits the explanation you have provided above. So,
> separating this machine type to 'generic' to cover the same definition makes
> more sense.
> > > >
> > > > However, 'default' is still supported for backward compatibility.
> > >
> > > So? Are you going to change the DPDK definitions we had for years?
> > >
> >
> > I think we should, or at least support "generic" alongside it. Using
> > the term "default" for something that is not the default is confusing.
> > It's also not a good description of what the result is, since it's a
> > generic binary for the architecture, rather than a "default" one for the
> architecture.
> 
> OK in this case, please do the patch which changes it everywhere, not only for
> Arm. We can change our names as long as it is explained and have some
> consistency.
> 

Yes, I'll make a separate patchset for this. In this case the change also started out as arm specific and we made it arch agnostic over time.

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 14:20                               ` Juraj Linkeš
@ 2020-11-18 14:32                                 ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-18 14:32 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Thomas Monjalon, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

On Wed, Nov 18, 2020 at 02:20:53PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Sent: Monday, November 16, 2020 8:20 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> > Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> > vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> > ferruh.yigit@intel.com; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> > detection
> > 
> > 16/11/2020 08:15, Juraj Linkeš:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > Add an option to automatically discover the host's numa and cpu
> > > > > counts and use those values for a non cross-build.
> > > > > Give users the option to override the per-arch default values or
> > > > > values from cross files by specifying them on the command line
> > > > > with -Dmax_lcores and -Dmax_numa_nodes.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > > [...]
> > > > >  create mode 100644 buildtools/get_cpu_count.py  create mode
> > > > > 100644 buildtools/get_numa_count.py
> > > >
> > > > These new files should be added in the file MAINTAINERS.
> > >
> > > Should I add a new section? I just add them under Build System, making
> > > Bruce the maintainer of these?
> > 
> > If Bruce is OK, it looks fine.
> > 
> 
> Bruce, may I add the files to MAINTAINERS under your name?

Yes, that is ok for these simple scripts.

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 14:19                               ` Juraj Linkeš
@ 2020-11-18 14:42                                 ` Thomas Monjalon
  2020-11-18 14:54                                   ` Bruce Richardson
  2020-11-18 15:23                                   ` Juraj Linkeš
  0 siblings, 2 replies; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-18 14:42 UTC (permalink / raw)
  To: Bruce Richardson, Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev

18/11/2020 15:19, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 16/11/2020 10:13, Bruce Richardson:
> > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > > +Set to positive integer to overwrite per-arch or cross-compilation
> > defaults. Set to -1 to detect the number of cores on the build machine.')
> > option('max_numa_nodes', type: 'integer', value: 0,
> > > > > +	description: 'maximum number of NUMA nodes supported by EAL. Set
> > > > > +to positive integer to overwrite per-arch or cross-compilation
> > > > > +defaults. Set to -1 to detect the number of numa nodes on the
> > > > > +build machine.')
> > > >
> > > > First comment: I don't like having so long description.
> > > > Second: I don't understand.
> > > >
> > > > It is said the default value is 0 so I expect it means automatic detection.
> > > > But later it is said -1 is for detection. So ?
> > > >
> > > Zero is for the "per-arch or cross-compilation default". This was
> > > discussed quite a bit in previous versions and this was te best
> > > compromise we could come up with. Having a default of auto-detect is
> > > definitely not something I think we should go with - just thinking of
> > > all the build CI jobs running on
> > > 2 or 4 core VMs! However, Juraj really felt there was value in having
> > > auto-detection, so it's set as a -1 value, which I'm ok with.
> > 
> > The problem is that I don't understand what 0 means.
> > 
> 
> There are three pieces of information which we need to convey:
> 1. The default value (0) indicates that per-arch or cross-compilation defaults will be used.
> 2. Positive integer values will be used instead of these defaults.

Where these positive values come from?

> 3. Detected values will be used for native build when the value is -1.

Why not detect for any native build set up with 0 (default)?




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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 14:42                                 ` Thomas Monjalon
@ 2020-11-18 14:54                                   ` Bruce Richardson
  2020-11-18 15:04                                     ` Thomas Monjalon
  2020-11-18 15:23                                   ` Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-18 14:54 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev

On Wed, Nov 18, 2020 at 03:42:36PM +0100, Thomas Monjalon wrote:
> 18/11/2020 15:19, Juraj Linkeš:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 16/11/2020 10:13, Bruce Richardson:
> > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > > > +Set to positive integer to overwrite per-arch or cross-compilation
> > > defaults. Set to -1 to detect the number of cores on the build machine.')
> > > option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > +	description: 'maximum number of NUMA nodes supported by EAL. Set
> > > > > > +to positive integer to overwrite per-arch or cross-compilation
> > > > > > +defaults. Set to -1 to detect the number of numa nodes on the
> > > > > > +build machine.')
> > > > >
> > > > > First comment: I don't like having so long description.
> > > > > Second: I don't understand.
> > > > >
> > > > > It is said the default value is 0 so I expect it means automatic detection.
> > > > > But later it is said -1 is for detection. So ?
> > > > >
> > > > Zero is for the "per-arch or cross-compilation default". This was
> > > > discussed quite a bit in previous versions and this was te best
> > > > compromise we could come up with. Having a default of auto-detect is
> > > > definitely not something I think we should go with - just thinking of
> > > > all the build CI jobs running on
> > > > 2 or 4 core VMs! However, Juraj really felt there was value in having
> > > > auto-detection, so it's set as a -1 value, which I'm ok with.
> > > 
> > > The problem is that I don't understand what 0 means.
> > > 
> > 
> > There are three pieces of information which we need to convey:
> > 1. The default value (0) indicates that per-arch or cross-compilation defaults will be used.
> > 2. Positive integer values will be used instead of these defaults.
> 
> Where these positive values come from?
> 
> > 3. Detected values will be used for native build when the value is -1.
> 
> Why not detect for any native build set up with 0 (default)?
> 
That was one of the original suggestions, but I strongly disagreed with
that, because many builds are done on hardware very different from the
final deployment. It would mean that any builds done in e.g. jenkins or
travis, with a 2-core vm, would be limited to running with two cores only.

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 14:54                                   ` Bruce Richardson
@ 2020-11-18 15:04                                     ` Thomas Monjalon
  2020-11-18 15:46                                       ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-11-18 15:04 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev

18/11/2020 15:54, Bruce Richardson:
> On Wed, Nov 18, 2020 at 03:42:36PM +0100, Thomas Monjalon wrote:
> > 18/11/2020 15:19, Juraj Linkeš:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > > > > +Set to positive integer to overwrite per-arch or cross-compilation
> > > > defaults. Set to -1 to detect the number of cores on the build machine.')
> > > > option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > > +	description: 'maximum number of NUMA nodes supported by EAL. Set
> > > > > > > +to positive integer to overwrite per-arch or cross-compilation
> > > > > > > +defaults. Set to -1 to detect the number of numa nodes on the
> > > > > > > +build machine.')
> > > > > >
> > > > > > First comment: I don't like having so long description.
> > > > > > Second: I don't understand.
> > > > > >
> > > > > > It is said the default value is 0 so I expect it means automatic detection.
> > > > > > But later it is said -1 is for detection. So ?
> > > > > >
> > > > > Zero is for the "per-arch or cross-compilation default". This was
> > > > > discussed quite a bit in previous versions and this was te best
> > > > > compromise we could come up with. Having a default of auto-detect is
> > > > > definitely not something I think we should go with - just thinking of
> > > > > all the build CI jobs running on
> > > > > 2 or 4 core VMs! However, Juraj really felt there was value in having
> > > > > auto-detection, so it's set as a -1 value, which I'm ok with.
> > > > 
> > > > The problem is that I don't understand what 0 means.
> > > > 
> > > 
> > > There are three pieces of information which we need to convey:
> > > 1. The default value (0) indicates that per-arch or cross-compilation defaults will be used.
> > > 2. Positive integer values will be used instead of these defaults.
> > 
> > Where these positive values come from?
> > 
> > > 3. Detected values will be used for native build when the value is -1.
> > 
> > Why not detect for any native build set up with 0 (default)?
> > 
> That was one of the original suggestions, but I strongly disagreed with
> that, because many builds are done on hardware very different from the
> final deployment. It would mean that any builds done in e.g. jenkins or
> travis, with a 2-core vm, would be limited to running with two cores only.

Yes that's the difference between native and cross build:
native build is not for running on a different machine.
I feel you have a different understanding of native build?



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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 14:42                                 ` Thomas Monjalon
  2020-11-18 14:54                                   ` Bruce Richardson
@ 2020-11-18 15:23                                   ` Juraj Linkeš
  2020-11-19 12:19                                     ` Bruce Richardson
  1 sibling, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-18 15:23 UTC (permalink / raw)
  To: Thomas Monjalon, Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, November 18, 2020 3:43 PM
> To: Bruce Richardson <bruce.richardson@intel.com>; Juraj Linkeš
> <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> detection
> 
> 18/11/2020 15:19, Juraj Linkeš:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 16/11/2020 10:13, Bruce Richardson:
> > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > +	description: 'maximum number of cores/threads supported by
> EAL.
> > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > +cross-compilation
> > > defaults. Set to -1 to detect the number of cores on the build
> > > machine.') option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > +	description: 'maximum number of NUMA nodes supported by
> EAL.
> > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > +cross-compilation defaults. Set to -1 to detect the number of
> > > > > > +numa nodes on the build machine.')
> > > > >
> > > > > First comment: I don't like having so long description.
> > > > > Second: I don't understand.
> > > > >
> > > > > It is said the default value is 0 so I expect it means automatic detection.
> > > > > But later it is said -1 is for detection. So ?
> > > > >
> > > > Zero is for the "per-arch or cross-compilation default". This was
> > > > discussed quite a bit in previous versions and this was te best
> > > > compromise we could come up with. Having a default of auto-detect
> > > > is definitely not something I think we should go with - just
> > > > thinking of all the build CI jobs running on
> > > > 2 or 4 core VMs! However, Juraj really felt there was value in
> > > > having auto-detection, so it's set as a -1 value, which I'm ok with.
> > >
> > > The problem is that I don't understand what 0 means.
> > >
> >
> > There are three pieces of information which we need to convey:
> > 1. The default value (0) indicates that per-arch or cross-compilation defaults
> will be used.
> > 2. Positive integer values will be used instead of these defaults.
> 
> Where these positive values come from?
> 

From the user - they will have the option to set it to whatever the like if they don't want to use defaults.

> > 3. Detected values will be used for native build when the value is -1.
> 
> Why not detect for any native build set up with 0 (default)?
> 

I'll let Bruce explain this, but I'll just say that we wanted to make the detection the default for native builds, so we're in agreement.

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 15:04                                     ` Thomas Monjalon
@ 2020-11-18 15:46                                       ` Bruce Richardson
  2020-11-18 20:01                                         ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-18 15:46 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, dev

On Wed, Nov 18, 2020 at 04:04:25PM +0100, Thomas Monjalon wrote:
> 18/11/2020 15:54, Bruce Richardson:
> > On Wed, Nov 18, 2020 at 03:42:36PM +0100, Thomas Monjalon wrote:
> > > 18/11/2020 15:19, Juraj Linkeš:
> > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > +	description: 'maximum number of cores/threads supported by EAL.
> > > > > > > > +Set to positive integer to overwrite per-arch or cross-compilation
> > > > > defaults. Set to -1 to detect the number of cores on the build machine.')
> > > > > option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > > > +	description: 'maximum number of NUMA nodes supported by EAL. Set
> > > > > > > > +to positive integer to overwrite per-arch or cross-compilation
> > > > > > > > +defaults. Set to -1 to detect the number of numa nodes on the
> > > > > > > > +build machine.')
> > > > > > >
> > > > > > > First comment: I don't like having so long description.
> > > > > > > Second: I don't understand.
> > > > > > >
> > > > > > > It is said the default value is 0 so I expect it means automatic detection.
> > > > > > > But later it is said -1 is for detection. So ?
> > > > > > >
> > > > > > Zero is for the "per-arch or cross-compilation default". This was
> > > > > > discussed quite a bit in previous versions and this was te best
> > > > > > compromise we could come up with. Having a default of auto-detect is
> > > > > > definitely not something I think we should go with - just thinking of
> > > > > > all the build CI jobs running on
> > > > > > 2 or 4 core VMs! However, Juraj really felt there was value in having
> > > > > > auto-detection, so it's set as a -1 value, which I'm ok with.
> > > > > 
> > > > > The problem is that I don't understand what 0 means.
> > > > > 
> > > > 
> > > > There are three pieces of information which we need to convey:
> > > > 1. The default value (0) indicates that per-arch or cross-compilation defaults will be used.
> > > > 2. Positive integer values will be used instead of these defaults.
> > > 
> > > Where these positive values come from?
> > > 
> > > > 3. Detected values will be used for native build when the value is -1.
> > > 
> > > Why not detect for any native build set up with 0 (default)?
> > > 
> > That was one of the original suggestions, but I strongly disagreed with
> > that, because many builds are done on hardware very different from the
> > final deployment. It would mean that any builds done in e.g. jenkins or
> > travis, with a 2-core vm, would be limited to running with two cores only.
> 
> Yes that's the difference between native and cross build:
> native build is not for running on a different machine.
> I feel you have a different understanding of native build?
>
A cross-build is for running on a different architecture, not a different
machine. I can build on my laptop to run on a Xeon server and it's still a
native build rather than a cross build. For this discussion, a cross-build
is considered something using a cross-file.

/Bruce

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 15:46                                       ` Bruce Richardson
@ 2020-11-18 20:01                                         ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-18 20:01 UTC (permalink / raw)
  To: Bruce Richardson, thomas
  Cc: Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> On Wed, Nov 18, 2020 at 04:04:25PM +0100, Thomas Monjalon wrote:
> > 18/11/2020 15:54, Bruce Richardson:
> > > On Wed, Nov 18, 2020 at 03:42:36PM +0100, Thomas Monjalon wrote:
> > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon
> wrote:
> > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > +	description: 'maximum number of cores/threads
> supported by EAL.
> > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > +cross-compilation
> > > > > > defaults. Set to -1 to detect the number of cores on the build
> > > > > > machine.') option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > > > > +	description: 'maximum number of NUMA nodes
> supported
> > > > > > > > > +by EAL. Set to positive integer to overwrite per-arch
> > > > > > > > > +or cross-compilation defaults. Set to -1 to detect the
> > > > > > > > > +number of numa nodes on the build machine.')
> > > > > > > >
> > > > > > > > First comment: I don't like having so long description.
> > > > > > > > Second: I don't understand.
> > > > > > > >
> > > > > > > > It is said the default value is 0 so I expect it means automatic
> detection.
> > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > >
> > > > > > > Zero is for the "per-arch or cross-compilation default".
> > > > > > > This was discussed quite a bit in previous versions and this
> > > > > > > was te best compromise we could come up with. Having a
> > > > > > > default of auto-detect is definitely not something I think
> > > > > > > we should go with - just thinking of all the build CI jobs
> > > > > > > running on
> > > > > > > 2 or 4 core VMs! However, Juraj really felt there was value
> > > > > > > in having auto-detection, so it's set as a -1 value, which I'm ok
> with.
> > > > > >
> > > > > > The problem is that I don't understand what 0 means.
> > > > > >
> > > > >
> > > > > There are three pieces of information which we need to convey:
> > > > > 1. The default value (0) indicates that per-arch or cross-compilation
> defaults will be used.
> > > > > 2. Positive integer values will be used instead of these defaults.
> > > >
> > > > Where these positive values come from?
> > > >
> > > > > 3. Detected values will be used for native build when the value is -1.
> > > >
> > > > Why not detect for any native build set up with 0 (default)?
> > > >
> > > That was one of the original suggestions, but I strongly disagreed
> > > with that, because many builds are done on hardware very different
> > > from the final deployment. It would mean that any builds done in
> > > e.g. jenkins or travis, with a 2-core vm, would be limited to running with
> two cores only.
> >
> > Yes that's the difference between native and cross build:
> > native build is not for running on a different machine.
> > I feel you have a different understanding of native build?
> >
> A cross-build is for running on a different architecture, not a different
> machine. I can build on my laptop to run on a Xeon server and it's still a native
> build rather than a cross build. For this discussion, a cross-build is considered
> something using a cross-file.
> 
This requires that the CPU on the laptop and the Xeon server support the same ISA version (I am not sure what it is called in x86). For ex: if the laptop supports AVX512, the Xeon server also needs to support AVX512. So, the user needs to be aware of all the instructions (or ISA version) on which the binary was built to be able to run it on another x86 machine. I am not sure if this is called out or understood by the users. In this regard, I tend to agree with Thomas that a native build is running on the same machine where it was built.

> /Bruce

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-18 15:23                                   ` Juraj Linkeš
@ 2020-11-19 12:19                                     ` Bruce Richardson
  2020-11-19 13:57                                       ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-19 12:19 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Thomas Monjalon, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

On Wed, Nov 18, 2020 at 03:23:13PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Sent: Wednesday, November 18, 2020 3:43 PM
> > To: Bruce Richardson <bruce.richardson@intel.com>; Juraj Linkeš
> > <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> > detection
> > 
> > 18/11/2020 15:19, Juraj Linkeš:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > +	description: 'maximum number of cores/threads supported by
> > EAL.
> > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > +cross-compilation
> > > > defaults. Set to -1 to detect the number of cores on the build
> > > > machine.') option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > > +	description: 'maximum number of NUMA nodes supported by
> > EAL.
> > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > +cross-compilation defaults. Set to -1 to detect the number of
> > > > > > > +numa nodes on the build machine.')
> > > > > >
> > > > > > First comment: I don't like having so long description.
> > > > > > Second: I don't understand.
> > > > > >
> > > > > > It is said the default value is 0 so I expect it means automatic detection.
> > > > > > But later it is said -1 is for detection. So ?
> > > > > >
> > > > > Zero is for the "per-arch or cross-compilation default". This was
> > > > > discussed quite a bit in previous versions and this was te best
> > > > > compromise we could come up with. Having a default of auto-detect
> > > > > is definitely not something I think we should go with - just
> > > > > thinking of all the build CI jobs running on
> > > > > 2 or 4 core VMs! However, Juraj really felt there was value in
> > > > > having auto-detection, so it's set as a -1 value, which I'm ok with.
> > > >
> > > > The problem is that I don't understand what 0 means.
> > > >
> > >
> > > There are three pieces of information which we need to convey:
> > > 1. The default value (0) indicates that per-arch or cross-compilation defaults
> > will be used.
> > > 2. Positive integer values will be used instead of these defaults.
> > 
> > Where these positive values come from?
> > 
> 
> From the user - they will have the option to set it to whatever the like if they don't want to use defaults.
> 
> > > 3. Detected values will be used for native build when the value is -1.
> > 
> > Why not detect for any native build set up with 0 (default)?
> > 
> 
> I'll let Bruce explain this, but I'll just say that we wanted to make the detection the default for native builds, so we're in agreement.

I think most of us agree that the different understanding of the term
"native build", is the cause of much of the disagreements and points of
dispute on this thread. From my view point, the term "native" can refer to:

1. what meson considers a native build, i.e. one not using a cross-file
2. a build for a different machine architecture to the one on the build
   machine (this largely overlaps with #1, except that e.g. 32-bit build on
   64-bit may be considered a cross-build in this case).
3. a build tailored exactly for the build machine itself i.e. both ISA, and
   things like core counts.
4. a flag passed to the compiler to indicate the uarch level of the
   instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
   that of the build machine.

Historically, IIRC, in DPDK the "RTE_MACHINE" value was originally #4 since
that was it's use on x86 in the first versions of DPDK. With the move from
make to meson, that aspect was kept, but the meaning of #1 (I think we can
ignore #2) also came into play. Finally, while for x86 architecture, the
idea of #4 still held, for ARM use #3 is of major concern.

Is this a fair summary?

Based on this, my thinking is that the current "machine" value really needs
to be either renamed or split into two. We need to separate out the idea of
the "platform" (apologies if this is not the right term), from the
"instruction set"/"uarch" to make it clear what the value refers to. The
default "platform" value should probably be "generic", and the default
"instruction set" should be "default", which means it's set by the
"platform" value.

This I believe should allow the flexibility we need, i.e. to tune to the
native machine (case #3) above, adjust the platform to "native", while to
get behaviour #4, and only just the ISA level, but keep generic in terms of
other values, adjust the "instruction set" value. In other words, for x86
the "machine" value as used becomes the "instruction set" one, while for
ARM (if I understand the requirements correctly) the "machine" value
becomes the "platform" one.

Thoughts on this?

/Bruce

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-19 12:19                                     ` Bruce Richardson
@ 2020-11-19 13:57                                       ` Juraj Linkeš
  2020-11-19 14:51                                         ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-19 13:57 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Thomas Monjalon, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Thursday, November 19, 2020 1:20 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Thomas Monjalon <thomas@monjalon.net>; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> detection
> 
> On Wed, Nov 18, 2020 at 03:23:13PM +0000, Juraj Linkeš wrote:
> >
> >
> > > -----Original Message-----
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > Sent: Wednesday, November 18, 2020 3:43 PM
> > > To: Bruce Richardson <bruce.richardson@intel.com>; Juraj Linkeš
> > > <juraj.linkes@pantheon.tech>
> > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and
> > > cpu counts detection
> > >
> > > 18/11/2020 15:19, Juraj Linkeš:
> > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > +	description: 'maximum number of cores/threads supported
> > > > > > > > +by
> > > EAL.
> > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > +cross-compilation
> > > > > defaults. Set to -1 to detect the number of cores on the build
> > > > > machine.') option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > > > +	description: 'maximum number of NUMA nodes supported by
> > > EAL.
> > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > +cross-compilation defaults. Set to -1 to detect the
> > > > > > > > +number of numa nodes on the build machine.')
> > > > > > >
> > > > > > > First comment: I don't like having so long description.
> > > > > > > Second: I don't understand.
> > > > > > >
> > > > > > > It is said the default value is 0 so I expect it means automatic
> detection.
> > > > > > > But later it is said -1 is for detection. So ?
> > > > > > >
> > > > > > Zero is for the "per-arch or cross-compilation default". This
> > > > > > was discussed quite a bit in previous versions and this was te
> > > > > > best compromise we could come up with. Having a default of
> > > > > > auto-detect is definitely not something I think we should go
> > > > > > with - just thinking of all the build CI jobs running on
> > > > > > 2 or 4 core VMs! However, Juraj really felt there was value in
> > > > > > having auto-detection, so it's set as a -1 value, which I'm ok with.
> > > > >
> > > > > The problem is that I don't understand what 0 means.
> > > > >
> > > >
> > > > There are three pieces of information which we need to convey:
> > > > 1. The default value (0) indicates that per-arch or
> > > > cross-compilation defaults
> > > will be used.
> > > > 2. Positive integer values will be used instead of these defaults.
> > >
> > > Where these positive values come from?
> > >
> >
> > From the user - they will have the option to set it to whatever the like if they
> don't want to use defaults.
> >
> > > > 3. Detected values will be used for native build when the value is -1.
> > >
> > > Why not detect for any native build set up with 0 (default)?
> > >
> >
> > I'll let Bruce explain this, but I'll just say that we wanted to make the detection
> the default for native builds, so we're in agreement.
> 
> I think most of us agree that the different understanding of the term "native
> build", is the cause of much of the disagreements and points of dispute on this
> thread. From my view point, the term "native" can refer to:
> 
> 1. what meson considers a native build, i.e. one not using a cross-file 2. a build
> for a different machine architecture to the one on the build
>    machine (this largely overlaps with #1, except that e.g. 32-bit build on
>    64-bit may be considered a cross-build in this case).
> 3. a build tailored exactly for the build machine itself i.e. both ISA, and
>    things like core counts.
> 4. a flag passed to the compiler to indicate the uarch level of the
>    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
>    that of the build machine.
> 
> Historically, IIRC, in DPDK the "RTE_MACHINE" value was originally #4 since that
> was it's use on x86 in the first versions of DPDK. With the move from make to
> meson, that aspect was kept, but the meaning of #1 (I think we can ignore #2)
> also came into play. Finally, while for x86 architecture, the idea of #4 still held,
> for ARM use #3 is of major concern.
> 
> Is this a fair summary?
> 
> Based on this, my thinking is that the current "machine" value really needs to be
> either renamed or split into two. We need to separate out the idea of the
> "platform" (apologies if this is not the right term), from the "instruction
> set"/"uarch" to make it clear what the value refers to. The default "platform"
> value should probably be "generic", and the default "instruction set" should be
> "default", which means it's set by the "platform" value.
> 
> This I believe should allow the flexibility we need, i.e. to tune to the native
> machine (case #3) above, adjust the platform to "native", while to get behaviour
> #4, and only just the ISA level, but keep generic in terms of other values, adjust
> the "instruction set" value. In other words, for x86 the "machine" value as used
> becomes the "instruction set" one, while for ARM (if I understand the
> requirements correctly) the "machine" value becomes the "platform" one.
> 
> Thoughts on this?
> 
> /Bruce

I like where this is heading.
Using a new option to set the platform/build type will remove all the confusion, I think.
Then the 'machine' option will just set the machine args (and RTE_MACHINE, but that doesn't do anything as far as I can tell) and it'll work just like 'max_lcores' and 'max_numa_nodes' do - set just that one thing. But I don't like using the value 'default' to mean 'set by other option' (it's more 'ignore this' than 'default'). I like 'auto' or something similar more.

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-19 13:57                                       ` Juraj Linkeš
@ 2020-11-19 14:51                                         ` Bruce Richardson
  2020-11-20  4:33                                           ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-19 14:51 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Thomas Monjalon, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

On Thu, Nov 19, 2020 at 01:57:59PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Thursday, November 19, 2020 1:20 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Thomas Monjalon <thomas@monjalon.net>; Ruifeng.Wang@arm.com;
> > Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> > vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> > ferruh.yigit@intel.com; dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> > detection
> > 
> > On Wed, Nov 18, 2020 at 03:23:13PM +0000, Juraj Linkeš wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > Sent: Wednesday, November 18, 2020 3:43 PM
> > > > To: Bruce Richardson <bruce.richardson@intel.com>; Juraj Linkeš
> > > > <juraj.linkes@pantheon.tech>
> > > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > > > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and
> > > > cpu counts detection
> > > >
> > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon wrote:
> > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > +	description: 'maximum number of cores/threads supported
> > > > > > > > > +by
> > > > EAL.
> > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > +cross-compilation
> > > > > > defaults. Set to -1 to detect the number of cores on the build
> > > > > > machine.') option('max_numa_nodes', type: 'integer', value: 0,
> > > > > > > > > +	description: 'maximum number of NUMA nodes supported by
> > > > EAL.
> > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > +cross-compilation defaults. Set to -1 to detect the
> > > > > > > > > +number of numa nodes on the build machine.')
> > > > > > > >
> > > > > > > > First comment: I don't like having so long description.
> > > > > > > > Second: I don't understand.
> > > > > > > >
> > > > > > > > It is said the default value is 0 so I expect it means automatic
> > detection.
> > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > >
> > > > > > > Zero is for the "per-arch or cross-compilation default". This
> > > > > > > was discussed quite a bit in previous versions and this was te
> > > > > > > best compromise we could come up with. Having a default of
> > > > > > > auto-detect is definitely not something I think we should go
> > > > > > > with - just thinking of all the build CI jobs running on
> > > > > > > 2 or 4 core VMs! However, Juraj really felt there was value in
> > > > > > > having auto-detection, so it's set as a -1 value, which I'm ok with.
> > > > > >
> > > > > > The problem is that I don't understand what 0 means.
> > > > > >
> > > > >
> > > > > There are three pieces of information which we need to convey:
> > > > > 1. The default value (0) indicates that per-arch or
> > > > > cross-compilation defaults
> > > > will be used.
> > > > > 2. Positive integer values will be used instead of these defaults.
> > > >
> > > > Where these positive values come from?
> > > >
> > >
> > > From the user - they will have the option to set it to whatever the like if they
> > don't want to use defaults.
> > >
> > > > > 3. Detected values will be used for native build when the value is -1.
> > > >
> > > > Why not detect for any native build set up with 0 (default)?
> > > >
> > >
> > > I'll let Bruce explain this, but I'll just say that we wanted to make the detection
> > the default for native builds, so we're in agreement.
> > 
> > I think most of us agree that the different understanding of the term "native
> > build", is the cause of much of the disagreements and points of dispute on this
> > thread. From my view point, the term "native" can refer to:
> > 
> > 1. what meson considers a native build, i.e. one not using a cross-file 2. a build
> > for a different machine architecture to the one on the build
> >    machine (this largely overlaps with #1, except that e.g. 32-bit build on
> >    64-bit may be considered a cross-build in this case).
> > 3. a build tailored exactly for the build machine itself i.e. both ISA, and
> >    things like core counts.
> > 4. a flag passed to the compiler to indicate the uarch level of the
> >    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
> >    that of the build machine.
> > 
> > Historically, IIRC, in DPDK the "RTE_MACHINE" value was originally #4 since that
> > was it's use on x86 in the first versions of DPDK. With the move from make to
> > meson, that aspect was kept, but the meaning of #1 (I think we can ignore #2)
> > also came into play. Finally, while for x86 architecture, the idea of #4 still held,
> > for ARM use #3 is of major concern.
> > 
> > Is this a fair summary?
> > 
> > Based on this, my thinking is that the current "machine" value really needs to be
> > either renamed or split into two. We need to separate out the idea of the
> > "platform" (apologies if this is not the right term), from the "instruction
> > set"/"uarch" to make it clear what the value refers to. The default "platform"
> > value should probably be "generic", and the default "instruction set" should be
> > "default", which means it's set by the "platform" value.
> > 
> > This I believe should allow the flexibility we need, i.e. to tune to the native
> > machine (case #3) above, adjust the platform to "native", while to get behaviour
> > #4, and only just the ISA level, but keep generic in terms of other values, adjust
> > the "instruction set" value. In other words, for x86 the "machine" value as used
> > becomes the "instruction set" one, while for ARM (if I understand the
> > requirements correctly) the "machine" value becomes the "platform" one.
> > 
> > Thoughts on this?
> > 
> > /Bruce
> 
> I like where this is heading.
> Using a new option to set the platform/build type will remove all the confusion, I think.
> Then the 'machine' option will just set the machine args (and RTE_MACHINE, but that doesn't do anything as far as I can tell) and it'll work just like 'max_lcores' and 'max_numa_nodes' do - set just that one thing. But I don't like using the value 'default' to mean 'set by other option' (it's more 'ignore this' than 'default'). I like 'auto' or something similar more.

I'm ok with "auto" instead of "default". If max_lcores and max_numa_nodes
stick around as options, I'd even suggest changing them to string type so
that we can use "auto" as a default value there too.

I actually think too that to avoid any confusion with what went before, we
should remove the "machine" option entirely and replace it with the
"platform" and "ISA" (or suitable name, maybe "march_flag"??) options. I'd
like to remove any expectations of behaviour similar to what went before,
otherwise we'll get stuck in lots of compatibility issues. Better to define
new options with new - clearly defined - behaviours than try clarifying an
existing option after the fact.

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-19 14:51                                         ` Bruce Richardson
@ 2020-11-20  4:33                                           ` Honnappa Nagarahalli
  2020-11-20 10:15                                             ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-20  4:33 UTC (permalink / raw)
  To: Bruce Richardson, Juraj Linkeš
  Cc: thomas, Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar,
	jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd, Honnappa Nagarahalli, nd

<snip>

> > > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon
> wrote:
> > > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > > +	description: 'maximum number of cores/threads
> > > > > > > > > > +supported by
> > > > > EAL.
> > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > +cross-compilation
> > > > > > > defaults. Set to -1 to detect the number of cores on the
> > > > > > > build
> > > > > > > machine.') option('max_numa_nodes', type: 'integer', value:
> > > > > > > 0,
> > > > > > > > > > +	description: 'maximum number of NUMA nodes
> supported
> > > > > > > > > > +by
> > > > > EAL.
> > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > +cross-compilation defaults. Set to -1 to detect the
> > > > > > > > > > +number of numa nodes on the build machine.')
> > > > > > > > >
> > > > > > > > > First comment: I don't like having so long description.
> > > > > > > > > Second: I don't understand.
> > > > > > > > >
> > > > > > > > > It is said the default value is 0 so I expect it means
> > > > > > > > > automatic
> > > detection.
> > > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > > >
> > > > > > > > Zero is for the "per-arch or cross-compilation default".
> > > > > > > > This was discussed quite a bit in previous versions and
> > > > > > > > this was te best compromise we could come up with. Having
> > > > > > > > a default of auto-detect is definitely not something I
> > > > > > > > think we should go with - just thinking of all the build
> > > > > > > > CI jobs running on
> > > > > > > > 2 or 4 core VMs! However, Juraj really felt there was
> > > > > > > > value in having auto-detection, so it's set as a -1 value, which I'm
> ok with.
> > > > > > >
> > > > > > > The problem is that I don't understand what 0 means.
> > > > > > >
> > > > > >
> > > > > > There are three pieces of information which we need to convey:
> > > > > > 1. The default value (0) indicates that per-arch or
> > > > > > cross-compilation defaults
> > > > > will be used.
> > > > > > 2. Positive integer values will be used instead of these defaults.
> > > > >
> > > > > Where these positive values come from?
> > > > >
> > > >
> > > > From the user - they will have the option to set it to whatever
> > > > the like if they
> > > don't want to use defaults.
> > > >
> > > > > > 3. Detected values will be used for native build when the value is -1.
> > > > >
> > > > > Why not detect for any native build set up with 0 (default)?
> > > > >
> > > >
> > > > I'll let Bruce explain this, but I'll just say that we wanted to
> > > > make the detection
> > > the default for native builds, so we're in agreement.
> > >
> > > I think most of us agree that the different understanding of the
> > > term "native build", is the cause of much of the disagreements and
Agree, that's the main reason.

> > > points of dispute on this thread. From my view point, the term "native"
> can refer to:
> > >
> > > 1. what meson considers a native build, i.e. one not using a
> > > cross-file 2. a build for a different machine architecture to the one on the
> build
> > >    machine (this largely overlaps with #1, except that e.g. 32-bit build on
> > >    64-bit may be considered a cross-build in this case).
Sorry, I did not understand #2 here. Are you saying, native "means" - "a build for a different machine architecture to the one on the build machine"

> > > 3. a build tailored exactly for the build machine itself i.e. both ISA, and
> > >    things like core counts.
> > > 4. a flag passed to the compiler to indicate the uarch level of the
> > >    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
> > >    that of the build machine.
> > >
> > > Historically, IIRC, in DPDK the "RTE_MACHINE" value was originally
> > > #4 since that was it's use on x86 in the first versions of DPDK.
> > > With the move from make to meson, that aspect was kept, but the
> > > meaning of #1 (I think we can ignore #2) also came into play.
> > > Finally, while for x86 architecture, the idea of #4 still held, for ARM use #3
> is of major concern.
Yes, #3 is the concern.

At the same time, I am also interested in avoiding 'native' (or any other option) having different meaning for different architectures.
Now that we have introduced 'soc' option for Arm platforms, we are able to achieve the builds that would be produced by #3.
'soc' combines both the 'platform' and 'instruction set' (as you have defined them below).


> > >
> > > Is this a fair summary?
> > >
> > > Based on this, my thinking is that the current "machine" value
> > > really needs to be either renamed or split into two. We need to
> > > separate out the idea of the "platform" (apologies if this is not
> > > the right term), from the "instruction set"/"uarch" to make it clear what
> the value refers to. The default "platform"
> > > value should probably be "generic", and the default "instruction
> > > set" should be "default", which means it's set by the "platform" value.
> > >
> > > This I believe should allow the flexibility we need, i.e. to tune to
> > > the native machine (case #3) above, adjust the platform to "native",
> > > while to get behaviour #4, and only just the ISA level, but keep
> > > generic in terms of other values, adjust the "instruction set"
> > > value. In other words, for x86 the "machine" value as used becomes
> > > the "instruction set" one, while for ARM (if I understand the
> requirements correctly) the "machine" value becomes the "platform" one.
> > >
> > > Thoughts on this?
> > >
> > > /Bruce
> >
> > I like where this is heading.
> > Using a new option to set the platform/build type will remove all the
> confusion, I think.
> > Then the 'machine' option will just set the machine args (and
> RTE_MACHINE, but that doesn't do anything as far as I can tell) and it'll work
> just like 'max_lcores' and 'max_numa_nodes' do - set just that one thing. But
> I don't like using the value 'default' to mean 'set by other option' (it's more
> 'ignore this' than 'default'). I like 'auto' or something similar more.
> 
> I'm ok with "auto" instead of "default". If max_lcores and max_numa_nodes
> stick around as options, I'd even suggest changing them to string type so that
> we can use "auto" as a default value there too.
> 
> I actually think too that to avoid any confusion with what went before, we
> should remove the "machine" option entirely and replace it with the
> "platform" and "ISA" (or suitable name, maybe "march_flag"??) options. I'd
> like to remove any expectations of behaviour similar to what went before,
> otherwise we'll get stuck in lots of compatibility issues. Better to define new
> options with new - clearly defined - behaviours than try clarifying an existing
> option after the fact.

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-20  4:33                                           ` Honnappa Nagarahalli
@ 2020-11-20 10:15                                             ` Bruce Richardson
  2020-11-20 10:19                                               ` Bruce Richardson
  2020-11-20 15:56                                               ` Honnappa Nagarahalli
  0 siblings, 2 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-20 10:15 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	thomas, Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar,
	jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd

On Fri, Nov 20, 2020 at 04:33:12AM +0000, Honnappa Nagarahalli wrote:
> <snip>
> 
> > > > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon
> > wrote:
> > > > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > > > +	description: 'maximum number of cores/threads
> > > > > > > > > > > +supported by
> > > > > > EAL.
> > > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > > +cross-compilation
> > > > > > > > defaults. Set to -1 to detect the number of cores on the
> > > > > > > > build
> > > > > > > > machine.') option('max_numa_nodes', type: 'integer', value:
> > > > > > > > 0,
> > > > > > > > > > > +	description: 'maximum number of NUMA nodes
> > supported
> > > > > > > > > > > +by
> > > > > > EAL.
> > > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > > +cross-compilation defaults. Set to -1 to detect the
> > > > > > > > > > > +number of numa nodes on the build machine.')
> > > > > > > > > >
> > > > > > > > > > First comment: I don't like having so long description.
> > > > > > > > > > Second: I don't understand.
> > > > > > > > > >
> > > > > > > > > > It is said the default value is 0 so I expect it means
> > > > > > > > > > automatic
> > > > detection.
> > > > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > > > >
> > > > > > > > > Zero is for the "per-arch or cross-compilation default".
> > > > > > > > > This was discussed quite a bit in previous versions and
> > > > > > > > > this was te best compromise we could come up with. Having
> > > > > > > > > a default of auto-detect is definitely not something I
> > > > > > > > > think we should go with - just thinking of all the build
> > > > > > > > > CI jobs running on
> > > > > > > > > 2 or 4 core VMs! However, Juraj really felt there was
> > > > > > > > > value in having auto-detection, so it's set as a -1 value, which I'm
> > ok with.
> > > > > > > >
> > > > > > > > The problem is that I don't understand what 0 means.
> > > > > > > >
> > > > > > >
> > > > > > > There are three pieces of information which we need to convey:
> > > > > > > 1. The default value (0) indicates that per-arch or
> > > > > > > cross-compilation defaults
> > > > > > will be used.
> > > > > > > 2. Positive integer values will be used instead of these defaults.
> > > > > >
> > > > > > Where these positive values come from?
> > > > > >
> > > > >
> > > > > From the user - they will have the option to set it to whatever
> > > > > the like if they
> > > > don't want to use defaults.
> > > > >
> > > > > > > 3. Detected values will be used for native build when the value is -1.
> > > > > >
> > > > > > Why not detect for any native build set up with 0 (default)?
> > > > > >
> > > > >
> > > > > I'll let Bruce explain this, but I'll just say that we wanted to
> > > > > make the detection
> > > > the default for native builds, so we're in agreement.
> > > >
> > > > I think most of us agree that the different understanding of the
> > > > term "native build", is the cause of much of the disagreements and
> Agree, that's the main reason.
> 
> > > > points of dispute on this thread. From my view point, the term "native"
> > can refer to:
> > > >
> > > > 1. what meson considers a native build, i.e. one not using a
> > > > cross-file 2. a build for a different machine architecture to the one on the
> > build
> > > >    machine (this largely overlaps with #1, except that e.g. 32-bit build on
> > > >    64-bit may be considered a cross-build in this case).
> Sorry, I did not understand #2 here. Are you saying, native "means" - "a build for a different machine architecture to the one on the build machine"
> 
> > > > 3. a build tailored exactly for the build machine itself i.e. both ISA, and
> > > >    things like core counts.
> > > > 4. a flag passed to the compiler to indicate the uarch level of the
> > > >    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
> > > >    that of the build machine.
> > > >
> > > > Historically, IIRC, in DPDK the "RTE_MACHINE" value was originally
> > > > #4 since that was it's use on x86 in the first versions of DPDK.
> > > > With the move from make to meson, that aspect was kept, but the
> > > > meaning of #1 (I think we can ignore #2) also came into play.
> > > > Finally, while for x86 architecture, the idea of #4 still held, for ARM use #3
> > is of major concern.
> Yes, #3 is the concern.
> 
> At the same time, I am also interested in avoiding 'native' (or any other option) having different meaning for different architectures.
> Now that we have introduced 'soc' option for Arm platforms, we are able to achieve the builds that would be produced by #3.
> 'soc' combines both the 'platform' and 'instruction set' (as you have defined them below).
> 

My thinking was that platform would be a synonym for "soc" for SOCs - it
would just seem weird to refer to x86 or PPC server systems as soc's, so I
thought "platform" a more neutral term.
Also, as I defined it above, the idea of "platform" would always encompass
the "instruction set" option too, unless the user explicitly overrode it -
hence the "auto" default value.

/Bruce

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-20 10:15                                             ` Bruce Richardson
@ 2020-11-20 10:19                                               ` Bruce Richardson
  2020-11-20 11:56                                                 ` Juraj Linkeš
  2020-11-20 15:56                                               ` Honnappa Nagarahalli
  1 sibling, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2020-11-20 10:19 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	thomas, Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar,
	jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd

On Fri, Nov 20, 2020 at 10:15:42AM +0000, Bruce Richardson wrote:
> On Fri, Nov 20, 2020 at 04:33:12AM +0000, Honnappa Nagarahalli wrote:
> > <snip>
> > 
> > > > > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas Monjalon
> > > wrote:
> > > > > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > > > > +	description: 'maximum number of cores/threads
> > > > > > > > > > > > +supported by
> > > > > > > EAL.
> > > > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > > > +cross-compilation
> > > > > > > > > defaults. Set to -1 to detect the number of cores on the
> > > > > > > > > build
> > > > > > > > > machine.') option('max_numa_nodes', type: 'integer', value:
> > > > > > > > > 0,
> > > > > > > > > > > > +	description: 'maximum number of NUMA nodes
> > > supported
> > > > > > > > > > > > +by
> > > > > > > EAL.
> > > > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > > > +cross-compilation defaults. Set to -1 to detect the
> > > > > > > > > > > > +number of numa nodes on the build machine.')
> > > > > > > > > > >
> > > > > > > > > > > First comment: I don't like having so long description.
> > > > > > > > > > > Second: I don't understand.
> > > > > > > > > > >
> > > > > > > > > > > It is said the default value is 0 so I expect it means
> > > > > > > > > > > automatic
> > > > > detection.
> > > > > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > > > > >
> > > > > > > > > > Zero is for the "per-arch or cross-compilation default".
> > > > > > > > > > This was discussed quite a bit in previous versions and
> > > > > > > > > > this was te best compromise we could come up with. Having
> > > > > > > > > > a default of auto-detect is definitely not something I
> > > > > > > > > > think we should go with - just thinking of all the build
> > > > > > > > > > CI jobs running on
> > > > > > > > > > 2 or 4 core VMs! However, Juraj really felt there was
> > > > > > > > > > value in having auto-detection, so it's set as a -1 value, which I'm
> > > ok with.
> > > > > > > > >
> > > > > > > > > The problem is that I don't understand what 0 means.
> > > > > > > > >
> > > > > > > >
> > > > > > > > There are three pieces of information which we need to convey:
> > > > > > > > 1. The default value (0) indicates that per-arch or
> > > > > > > > cross-compilation defaults
> > > > > > > will be used.
> > > > > > > > 2. Positive integer values will be used instead of these defaults.
> > > > > > >
> > > > > > > Where these positive values come from?
> > > > > > >
> > > > > >
> > > > > > From the user - they will have the option to set it to whatever
> > > > > > the like if they
> > > > > don't want to use defaults.
> > > > > >
> > > > > > > > 3. Detected values will be used for native build when the value is -1.
> > > > > > >
> > > > > > > Why not detect for any native build set up with 0 (default)?
> > > > > > >
> > > > > >
> > > > > > I'll let Bruce explain this, but I'll just say that we wanted to
> > > > > > make the detection
> > > > > the default for native builds, so we're in agreement.
> > > > >
> > > > > I think most of us agree that the different understanding of the
> > > > > term "native build", is the cause of much of the disagreements and
> > Agree, that's the main reason.
> > 
> > > > > points of dispute on this thread. From my view point, the term "native"
> > > can refer to:
> > > > >
> > > > > 1. what meson considers a native build, i.e. one not using a
> > > > > cross-file 2. a build for a different machine architecture to the one on the
> > > build
> > > > >    machine (this largely overlaps with #1, except that e.g. 32-bit build on
> > > > >    64-bit may be considered a cross-build in this case).
> > Sorry, I did not understand #2 here. Are you saying, native "means" - "a build for a different machine architecture to the one on the build machine"
> > 
> > > > > 3. a build tailored exactly for the build machine itself i.e. both ISA, and
> > > > >    things like core counts.
> > > > > 4. a flag passed to the compiler to indicate the uarch level of the
> > > > >    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
> > > > >    that of the build machine.
> > > > >
> > > > > Historically, IIRC, in DPDK the "RTE_MACHINE" value was originally
> > > > > #4 since that was it's use on x86 in the first versions of DPDK.
> > > > > With the move from make to meson, that aspect was kept, but the
> > > > > meaning of #1 (I think we can ignore #2) also came into play.
> > > > > Finally, while for x86 architecture, the idea of #4 still held, for ARM use #3
> > > is of major concern.
> > Yes, #3 is the concern.
> > 
> > At the same time, I am also interested in avoiding 'native' (or any other option) having different meaning for different architectures.
> > Now that we have introduced 'soc' option for Arm platforms, we are able to achieve the builds that would be produced by #3.
> > 'soc' combines both the 'platform' and 'instruction set' (as you have defined them below).
> > 
> 
> My thinking was that platform would be a synonym for "soc" for SOCs - it
> would just seem weird to refer to x86 or PPC server systems as soc's, so I
> thought "platform" a more neutral term.
> Also, as I defined it above, the idea of "platform" would always encompass
> the "instruction set" option too, unless the user explicitly overrode it -
> hence the "auto" default value.
>
Also, we could document the "instruction set" value as a 'hint', rather
than a mandatory value, which gives the arm meson.build files the option to
ignore it if it doesn't make sense to use for a given value of
"platform/soc".

/Bruce

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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-20 10:19                                               ` Bruce Richardson
@ 2020-11-20 11:56                                                 ` Juraj Linkeš
  2020-11-20 12:04                                                   ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 11:56 UTC (permalink / raw)
  To: Bruce Richardson, Honnappa Nagarahalli
  Cc: thomas, Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar,
	jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday, November 20, 2020 11:20 AM
> To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Cc: Juraj Linkeš <juraj.linkes@pantheon.tech>; thomas@monjalon.net; Ruifeng
> Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; dev@dpdk.org; nd <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> detection
> 
> On Fri, Nov 20, 2020 at 10:15:42AM +0000, Bruce Richardson wrote:
> > On Fri, Nov 20, 2020 at 04:33:12AM +0000, Honnappa Nagarahalli wrote:
> > > <snip>
> > >
> > > > > > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas
> > > > > > > > > > > Monjalon
> > > > wrote:
> > > > > > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > > > > > +	description: 'maximum number of cores/threads
> > > > > > > > > > > > > +supported by
> > > > > > > > EAL.
> > > > > > > > > > > > > +Set to positive integer to overwrite per-arch
> > > > > > > > > > > > > +or cross-compilation
> > > > > > > > > > defaults. Set to -1 to detect the number of cores on
> > > > > > > > > > the build
> > > > > > > > > > machine.') option('max_numa_nodes', type: 'integer', value:
> > > > > > > > > > 0,
> > > > > > > > > > > > > +	description: 'maximum number of NUMA nodes
> > > > supported
> > > > > > > > > > > > > +by
> > > > > > > > EAL.
> > > > > > > > > > > > > +Set to positive integer to overwrite per-arch
> > > > > > > > > > > > > +or cross-compilation defaults. Set to -1 to
> > > > > > > > > > > > > +detect the number of numa nodes on the build
> > > > > > > > > > > > > +machine.')
> > > > > > > > > > > >
> > > > > > > > > > > > First comment: I don't like having so long description.
> > > > > > > > > > > > Second: I don't understand.
> > > > > > > > > > > >
> > > > > > > > > > > > It is said the default value is 0 so I expect it
> > > > > > > > > > > > means automatic
> > > > > > detection.
> > > > > > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > > > > > >
> > > > > > > > > > > Zero is for the "per-arch or cross-compilation default".
> > > > > > > > > > > This was discussed quite a bit in previous versions
> > > > > > > > > > > and this was te best compromise we could come up
> > > > > > > > > > > with. Having a default of auto-detect is definitely
> > > > > > > > > > > not something I think we should go with - just
> > > > > > > > > > > thinking of all the build CI jobs running on
> > > > > > > > > > > 2 or 4 core VMs! However, Juraj really felt there
> > > > > > > > > > > was value in having auto-detection, so it's set as a
> > > > > > > > > > > -1 value, which I'm
> > > > ok with.
> > > > > > > > > >
> > > > > > > > > > The problem is that I don't understand what 0 means.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > There are three pieces of information which we need to convey:
> > > > > > > > > 1. The default value (0) indicates that per-arch or
> > > > > > > > > cross-compilation defaults
> > > > > > > > will be used.
> > > > > > > > > 2. Positive integer values will be used instead of these defaults.
> > > > > > > >
> > > > > > > > Where these positive values come from?
> > > > > > > >
> > > > > > >
> > > > > > > From the user - they will have the option to set it to
> > > > > > > whatever the like if they
> > > > > > don't want to use defaults.
> > > > > > >
> > > > > > > > > 3. Detected values will be used for native build when the value is -
> 1.
> > > > > > > >
> > > > > > > > Why not detect for any native build set up with 0 (default)?
> > > > > > > >
> > > > > > >
> > > > > > > I'll let Bruce explain this, but I'll just say that we
> > > > > > > wanted to make the detection
> > > > > > the default for native builds, so we're in agreement.
> > > > > >
> > > > > > I think most of us agree that the different understanding of
> > > > > > the term "native build", is the cause of much of the
> > > > > > disagreements and
> > > Agree, that's the main reason.
> > >
> > > > > > points of dispute on this thread. From my view point, the term "native"
> > > > can refer to:
> > > > > >
> > > > > > 1. what meson considers a native build, i.e. one not using a
> > > > > > cross-file 2. a build for a different machine architecture to
> > > > > > the one on the
> > > > build
> > > > > >    machine (this largely overlaps with #1, except that e.g. 32-bit build on
> > > > > >    64-bit may be considered a cross-build in this case).
> > > Sorry, I did not understand #2 here. Are you saying, native "means" - "a build
> for a different machine architecture to the one on the build machine"
> > >
> > > > > > 3. a build tailored exactly for the build machine itself i.e. both ISA, and
> > > > > >    things like core counts.
> > > > > > 4. a flag passed to the compiler to indicate the uarch level of the
> > > > > >    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
> > > > > >    that of the build machine.
> > > > > >
> > > > > > Historically, IIRC, in DPDK the "RTE_MACHINE" value was
> > > > > > originally
> > > > > > #4 since that was it's use on x86 in the first versions of DPDK.
> > > > > > With the move from make to meson, that aspect was kept, but
> > > > > > the meaning of #1 (I think we can ignore #2) also came into play.
> > > > > > Finally, while for x86 architecture, the idea of #4 still
> > > > > > held, for ARM use #3
> > > > is of major concern.
> > > Yes, #3 is the concern.
> > >
> > > At the same time, I am also interested in avoiding 'native' (or any other
> option) having different meaning for different architectures.
> > > Now that we have introduced 'soc' option for Arm platforms, we are able to
> achieve the builds that would be produced by #3.
> > > 'soc' combines both the 'platform' and 'instruction set' (as you have defined
> them below).
> > >
> >
> > My thinking was that platform would be a synonym for "soc" for SOCs -
> > it would just seem weird to refer to x86 or PPC server systems as
> > soc's, so I thought "platform" a more neutral term.
> > Also, as I defined it above, the idea of "platform" would always
> > encompass the "instruction set" option too, unless the user explicitly
> > overrode it - hence the "auto" default value.
> >
> Also, we could document the "instruction set" value as a 'hint', rather than a
> mandatory value, which gives the arm meson.build files the option to ignore it if
> it doesn't make sense to use for a given value of "platform/soc".
> 
> /Bruce

Let's (or let me) put together a new patch that would decouple ISA from platform. How should we do this?

I want to send this commit separately - should I add the ISA/platform to that series or do a completely new series? I like the latter, since we're basically done with reviewing this commit.


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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-20 11:56                                                 ` Juraj Linkeš
@ 2020-11-20 12:04                                                   ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2020-11-20 12:04 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Honnappa Nagarahalli, thomas, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd

On Fri, Nov 20, 2020 at 11:56:44AM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Friday, November 20, 2020 11:20 AM
> > To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Cc: Juraj Linkeš <juraj.linkes@pantheon.tech>; thomas@monjalon.net; Ruifeng
> > Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> > vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > ferruh.yigit@intel.com; dev@dpdk.org; nd <nd@arm.com>
> > Subject: Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts
> > detection
> > 
> > On Fri, Nov 20, 2020 at 10:15:42AM +0000, Bruce Richardson wrote:
> > > On Fri, Nov 20, 2020 at 04:33:12AM +0000, Honnappa Nagarahalli wrote:
> > > > <snip>
> > > >
> > > > > > > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas
> > > > > > > > > > > > Monjalon
> > > > > wrote:
> > > > > > > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > > > > > > +	description: 'maximum number of cores/threads
> > > > > > > > > > > > > > +supported by
> > > > > > > > > EAL.
> > > > > > > > > > > > > > +Set to positive integer to overwrite per-arch
> > > > > > > > > > > > > > +or cross-compilation
> > > > > > > > > > > defaults. Set to -1 to detect the number of cores on
> > > > > > > > > > > the build
> > > > > > > > > > > machine.') option('max_numa_nodes', type: 'integer', value:
> > > > > > > > > > > 0,
> > > > > > > > > > > > > > +	description: 'maximum number of NUMA nodes
> > > > > supported
> > > > > > > > > > > > > > +by
> > > > > > > > > EAL.
> > > > > > > > > > > > > > +Set to positive integer to overwrite per-arch
> > > > > > > > > > > > > > +or cross-compilation defaults. Set to -1 to
> > > > > > > > > > > > > > +detect the number of numa nodes on the build
> > > > > > > > > > > > > > +machine.')
> > > > > > > > > > > > >
> > > > > > > > > > > > > First comment: I don't like having so long description.
> > > > > > > > > > > > > Second: I don't understand.
> > > > > > > > > > > > >
> > > > > > > > > > > > > It is said the default value is 0 so I expect it
> > > > > > > > > > > > > means automatic
> > > > > > > detection.
> > > > > > > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > > > > > > >
> > > > > > > > > > > > Zero is for the "per-arch or cross-compilation default".
> > > > > > > > > > > > This was discussed quite a bit in previous versions
> > > > > > > > > > > > and this was te best compromise we could come up
> > > > > > > > > > > > with. Having a default of auto-detect is definitely
> > > > > > > > > > > > not something I think we should go with - just
> > > > > > > > > > > > thinking of all the build CI jobs running on
> > > > > > > > > > > > 2 or 4 core VMs! However, Juraj really felt there
> > > > > > > > > > > > was value in having auto-detection, so it's set as a
> > > > > > > > > > > > -1 value, which I'm
> > > > > ok with.
> > > > > > > > > > >
> > > > > > > > > > > The problem is that I don't understand what 0 means.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > There are three pieces of information which we need to convey:
> > > > > > > > > > 1. The default value (0) indicates that per-arch or
> > > > > > > > > > cross-compilation defaults
> > > > > > > > > will be used.
> > > > > > > > > > 2. Positive integer values will be used instead of these defaults.
> > > > > > > > >
> > > > > > > > > Where these positive values come from?
> > > > > > > > >
> > > > > > > >
> > > > > > > > From the user - they will have the option to set it to
> > > > > > > > whatever the like if they
> > > > > > > don't want to use defaults.
> > > > > > > >
> > > > > > > > > > 3. Detected values will be used for native build when the value is -
> > 1.
> > > > > > > > >
> > > > > > > > > Why not detect for any native build set up with 0 (default)?
> > > > > > > > >
> > > > > > > >
> > > > > > > > I'll let Bruce explain this, but I'll just say that we
> > > > > > > > wanted to make the detection
> > > > > > > the default for native builds, so we're in agreement.
> > > > > > >
> > > > > > > I think most of us agree that the different understanding of
> > > > > > > the term "native build", is the cause of much of the
> > > > > > > disagreements and
> > > > Agree, that's the main reason.
> > > >
> > > > > > > points of dispute on this thread. From my view point, the term "native"
> > > > > can refer to:
> > > > > > >
> > > > > > > 1. what meson considers a native build, i.e. one not using a
> > > > > > > cross-file 2. a build for a different machine architecture to
> > > > > > > the one on the
> > > > > build
> > > > > > >    machine (this largely overlaps with #1, except that e.g. 32-bit build on
> > > > > > >    64-bit may be considered a cross-build in this case).
> > > > Sorry, I did not understand #2 here. Are you saying, native "means" - "a build
> > for a different machine architecture to the one on the build machine"
> > > >
> > > > > > > 3. a build tailored exactly for the build machine itself i.e. both ISA, and
> > > > > > >    things like core counts.
> > > > > > > 4. a flag passed to the compiler to indicate the uarch level of the
> > > > > > >    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
> > > > > > >    that of the build machine.
> > > > > > >
> > > > > > > Historically, IIRC, in DPDK the "RTE_MACHINE" value was
> > > > > > > originally
> > > > > > > #4 since that was it's use on x86 in the first versions of DPDK.
> > > > > > > With the move from make to meson, that aspect was kept, but
> > > > > > > the meaning of #1 (I think we can ignore #2) also came into play.
> > > > > > > Finally, while for x86 architecture, the idea of #4 still
> > > > > > > held, for ARM use #3
> > > > > is of major concern.
> > > > Yes, #3 is the concern.
> > > >
> > > > At the same time, I am also interested in avoiding 'native' (or any other
> > option) having different meaning for different architectures.
> > > > Now that we have introduced 'soc' option for Arm platforms, we are able to
> > achieve the builds that would be produced by #3.
> > > > 'soc' combines both the 'platform' and 'instruction set' (as you have defined
> > them below).
> > > >
> > >
> > > My thinking was that platform would be a synonym for "soc" for SOCs -
> > > it would just seem weird to refer to x86 or PPC server systems as
> > > soc's, so I thought "platform" a more neutral term.
> > > Also, as I defined it above, the idea of "platform" would always
> > > encompass the "instruction set" option too, unless the user explicitly
> > > overrode it - hence the "auto" default value.
> > >
> > Also, we could document the "instruction set" value as a 'hint', rather than a
> > mandatory value, which gives the arm meson.build files the option to ignore it if
> > it doesn't make sense to use for a given value of "platform/soc".
> > 
> > /Bruce
> 
> Let's (or let me) put together a new patch that would decouple ISA from platform. How should we do this?
> 
> I want to send this commit separately - should I add the ISA/platform to that series or do a completely new series? I like the latter, since we're basically done with reviewing this commit.
>

Yes, let's start a new series for this. It makes the whole thing easier to
see and review.

/Bruce

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

* [dpdk-dev] [PATCH v13 00/12] Arm build options rework
  2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
                                         ` (14 preceding siblings ...)
  2020-11-13 14:40                       ` [dpdk-dev] [PATCH v12 00/14] Arm build options rework Ruifeng Wang
@ 2020-11-20 12:08                       ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 01/12] build: rename Arm build variables Juraj Linkeš
                                           ` (13 more replies)
  15 siblings, 14 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds
and aarch64 -> aarch64 (SoC) builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
  option or using a cross file
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native, SoC or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

v9:
Split SoC and implementer dictionaries into smaller parts.
Fixed DPAA and ARMADA SoC configuration.
Added documentation about supported SoCs.

v10:
Added a commit that fixes Graviton2 clang build failures in native
build.

v11:
Rebase.

v12:
Fixed dpaa and armada cross builds in generic build commit.

v13:
Removed two commits which were not arm-specific:
1. build: alias default build as generic
2. build: optional NUMA and cpu counts detection
Also minor adjustments to commit messages in:
1. build: isolate configuration for Arm generic build
2. build: disable drivers in Arm builds

Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>

Juraj Linkeš (12):
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for Arm generic build
  build: use native machine args in Arm native build
  build: add core and NUMA counts to cross files
  build: disable drivers in Arm builds
  build: disable libnuma in cross builds
  build: add Arm SoC meson option
  config: fix Arm implementer and its SoCs

 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  15 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 502 ++++++++++++------
 config/meson.build                            |  34 +-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |   2 +
 17 files changed, 413 insertions(+), 203 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 01/12] build: rename Arm build variables
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 02/12] build: remove unused or superfluous variables Juraj Linkeš
                                           ` (12 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 114 +++++++++++++--------------
 11 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..4fc0ae0fc 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,7 +8,7 @@ march_opt = '-march=@0@'.format(machine)
 arm_force_native_march = false
 arm_force_default_march = (machine == 'default')
 
-flags_common_default = [
+flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
@@ -28,58 +28,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -90,8 +90,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -100,36 +100,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -144,13 +144,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	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 = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -161,45 +161,45 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
-	foreach flag: flags_common_default
+	foreach flag: flags_common
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 02/12] build: remove unused or superfluous variables
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 01/12] build: rename Arm build variables Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 03/12] build: reformat and move Arm config and comments Juraj Linkeš
                                           ` (11 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4fc0ae0fc..be6776ff0 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,11 +2,7 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
 
 flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -61,7 +57,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -118,17 +113,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -144,11 +131,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_default_march and not meson.is_cross_build()
+	if machine == 'default' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -159,14 +144,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -199,7 +185,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 03/12] build: reformat and move Arm config and comments
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 01/12] build: rename Arm build variables Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 02/12] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 04/12] build: simplify how Arm flags are processed Juraj Linkeš
                                           ` (10 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armv8_linux_gcc              | 12 +--
 config/arm/meson.build                        | 96 +++++++++++--------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
 3 files changed, 93 insertions(+), 49 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..0099f5ca2 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,16 +13,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
-
-# Valid options for Arm's part_number:
-# 'generic': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
 part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index be6776ff0..89c196048 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -4,15 +4,16 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common = [
-	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
+	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -22,69 +23,86 @@ flags_common = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -95,8 +113,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -104,13 +122,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -122,21 +141,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'default' and not meson.is_cross_build()
+		# default build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -157,6 +176,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -193,7 +213,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
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..972598835 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -99,3 +99,37 @@ command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+Supported cross-compilation targets
+-----------------------------------
+
+If you wish to build for a target which is not among the current cross-files,
+you may use various combinations of implementer/part number::
+
+   Supported implementers:
+      'generic': Generic armv8
+      '0x41':    Arm
+      '0x43':    Cavium
+      '0x50':    Ampere Computing
+      '0x56':    Marvell ARMADA
+      'dpaa':    NXP DPAA
+
+   Supported part_numbers for generic, 0x41, 0x56, dpaa:
+      'generic': valid for all armv8-a architectures (default value)
+      '0xd03':   cortex-a53
+      '0xd04':   cortex-a35
+      '0xd09':   cortex-a73
+      '0xd0a':   cortex-a75
+      '0xd0b':   cortex-a76
+      '0xd0c':   neoverse-n1
+
+   Supported part_numbers for 0x43:
+      'generic': valid for all Cavium builds
+      '0xa1':    thunderxt88
+      '0xa2':    thunderxt81
+      '0xa3':    thunderxt83
+      '0xaf':    thunderx2t99
+      '0xb2':    octeontx2
+
+   Supported part_numbers for 0x50:
+      'generic': valid for all Ampere builds
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 04/12] build: simplify how Arm flags are processed
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (2 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 03/12] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 05/12] build: organize Arm config into dict Juraj Linkeš
                                           ` (9 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 89c196048..fb877fe77 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -149,7 +149,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
 		implementer_config = implementer_generic
@@ -182,34 +181,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 05/12] build: organize Arm config into dict
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (3 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 04/12] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
                                           ` (8 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 298 ++++++++++++++++++++++++-----------------
 1 file changed, 178 insertions(+), 120 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index fb877fe77..b449b10c3 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -27,115 +27,166 @@ flags_common = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementer_generic = {
+	'description': 'Generic armv8',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 256]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc',
+					     '-moutline-atomics']}
+	}
+}
+
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc',
+				      '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto',
+				  '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+implementer_arm = {
+	'description': 'Arm',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+implementer_cavium = {
+	'description': 'Cavium',
+	'flags': [
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 96],
+		['RTE_MAX_NUMA_NODES', 2]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
+					     '-mcpu=thunderx']},
+		'native': {'machine_args': ['-march=native']},
+		'0xa1': {
+			'machine_args': ['-mcpu=thunderxt88'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa2': {
+			'machine_args': ['-mcpu=thunderxt81'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa3': {
+			'machine_args': ['-mcpu=thunderxt83'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xaf': {
+			'machine_args': ['-march=armv8.1-a+crc+crypto',
+					 '-mcpu=thunderx2t99'],
+			'flags': [
+				['RTE_MACHINE', '"thunderx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_CACHE_LINE_SIZE', 64],
+				['RTE_MAX_LCORE', 256],
+				['RTE_MAX_NUMA_NODES', 2]
+			]
+		},
+		'0xb2': {
+			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
+					 '-mcpu=octeontx2'],
+			'flags': [
+				['RTE_MACHINE', '"octeontx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_EAL_IGB_UIO', false],
+				['RTE_MAX_LCORE', 36],
+				['RTE_MAX_NUMA_NODES', 1]
+			]
+		}
+	}
+}
 
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+implementer_ampere = {
+	'description': 'Ampere Computing',
+	'flags': [
+		['RTE_MACHINE', '"emag"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 32],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': {
+		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					      '-mtune=emag']},
+		'native': {'machine_args':  ['-march=native']}
+	}
+}
+
+implementer_marvell = {
+	'description': 'Marvell ARMADA',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
+
+implementer_dpaa = {
+	'description': 'NXP DPAA',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+implementers = {
+	'generic': implementer_generic,
+	'0x41': implementer_arm,
+	'0x43': implementer_cavium,
+	'0x50': implementer_ampere,
+	'0x56': implementer_marvell,
+	'dpaa': implementer_dpaa
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -151,7 +202,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -166,9 +217,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -178,28 +229,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config[1]
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 06/12] build: isolate configuration for Arm generic build
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (4 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 05/12] build: organize Arm config into dict Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 07/12] build: use native machine args in Arm native build Juraj Linkeš
                                           ` (7 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
 6 files changed, 29 insertions(+), 29 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..143a3c9f8 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..c3c8a1ef6 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+part_number = '0xd08'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index b449b10c3..403e1a02f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -47,8 +47,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc',
-				      '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -97,8 +95,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
-					     '-mcpu=thunderx']},
 		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
@@ -148,8 +144,8 @@ implementer_ampere = {
 		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': {
-		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					      '-mtune=emag']},
+		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					  '-mtune=emag']},
 		'native': {'machine_args':  ['-march=native']}
 	}
 }
@@ -199,10 +195,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -215,21 +210,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -239,15 +237,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
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 972598835..6a883b030 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -114,8 +114,10 @@ you may use various combinations of implementer/part number::
       '0x56':    Marvell ARMADA
       'dpaa':    NXP DPAA
 
-   Supported part_numbers for generic, 0x41, 0x56, dpaa:
-      'generic': valid for all armv8-a architectures (default value)
+   Supported part_numbers for generic:
+      'generic': valid for all armv8-a architectures (unoptimized portable build)
+
+   Supported part_numbers for 0x41, 0x56, dpaa:
       '0xd03':   cortex-a53
       '0xd04':   cortex-a35
       '0xd09':   cortex-a73
@@ -124,7 +126,6 @@ you may use various combinations of implementer/part number::
       '0xd0c':   neoverse-n1
 
    Supported part_numbers for 0x43:
-      'generic': valid for all Cavium builds
       '0xa1':    thunderxt88
       '0xa2':    thunderxt81
       '0xa3':    thunderxt83
@@ -132,4 +133,4 @@ you may use various combinations of implementer/part number::
       '0xb2':    octeontx2
 
    Supported part_numbers for 0x50:
-      'generic': valid for all Ampere builds
+      '0x0':     emag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 07/12] build: use native machine args in Arm native build
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (5 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
                                           ` (6 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args usable for both GCC and Clang.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 403e1a02f..4508f369c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,8 +2,6 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -26,6 +24,7 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -47,7 +46,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -95,7 +93,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
 			'flags': flags_part_number_thunderx
@@ -145,8 +142,7 @@ implementer_ampere = {
 	],
 	'part_number_config': {
 		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					  '-mtune=emag']},
-		'native': {'machine_args':  ['-march=native']}
+					  '-mtune=emag']}
 	}
 }
 
@@ -195,26 +191,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'default' and not meson.is_cross_build()
-		# default build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'default'
+			# default build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -250,7 +247,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 08/12] build: add core and NUMA counts to cross files
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (6 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 07/12] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 09/12] build: disable drivers in Arm builds Juraj Linkeš
                                           ` (5 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                 |  2 ++
 config/arm/arm64_armv8_linux_gcc                  |  2 ++
 config/arm/arm64_bluefield_linux_gcc              |  2 ++
 config/arm/arm64_dpaa_linux_gcc                   |  2 ++
 config/arm/arm64_emag_linux_gcc                   |  2 ++
 config/arm/arm64_graviton2_linux_gcc              |  2 ++
 config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
 config/arm/arm64_octeontx2_linux_gcc              |  2 ++
 config/arm/arm64_stingray_linux_gcc               |  2 ++
 config/arm/arm64_thunderx2_linux_gcc              |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
 config/arm/meson.build                            |  6 ++++--
 config/meson.build                                | 15 +++++++++++++++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
 14 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 143a3c9f8..2ecc4604c 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x56'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 0099f5ca2..5451a01da 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 # Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
 part_number = 'generic'
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index c3c8a1ef6..8641fee63 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = 'dpaa'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4508f369c..375a804ac 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -37,7 +37,8 @@ implementer_generic = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 128],
-		['RTE_MAX_LCORE', 256]
+		['RTE_MAX_LCORE', 256],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': {
 		'generic': {'machine_args': ['-march=armv8-a+crc',
@@ -75,7 +76,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16]
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': part_number_config_arm
 }
diff --git a/config/meson.build b/config/meson.build
index a29693b88..2bff6137f 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -252,6 +252,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
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 6a883b030..4e65b271c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -134,3 +134,12 @@ you may use various combinations of implementer/part number::
 
    Supported part_numbers for 0x50:
       '0x0':     emag
+
+Other cross file options
+------------------------
+
+There are other options you may specify in a cross file to tailor the build::
+
+   Supported extra configuration
+      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+      max_lcores = n      # will set RTE_MAX_LCORE
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 09/12] build: disable drivers in Arm builds
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (7 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds Juraj Linkeš
                                           ` (4 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works and remove
unneeded driver options ported from the old makefile system, since they
don't work in the current Meson build system.
Add support for removing drivers for cross builds so that we can disable
them in cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                   | 1 +
 config/arm/meson.build                              | 7 +++----
 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
 drivers/meson.build                                 | 6 +++++-
 meson.build                                         | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 2ecc4604c..e365f61d0 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 375a804ac..7db343b8a 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,6 +2,9 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -16,9 +19,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -126,7 +126,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 4e65b271c..210ad4508 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -143,3 +143,7 @@ There are other options you may specify in a cross file to tailor the build::
    Supported extra configuration
       max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
       max_lcores = n      # will set RTE_MAX_LCORE
+
+      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
+         # valid values are directories (optionally with their subdirs)
+         # in the drivers directory
diff --git a/drivers/meson.build b/drivers/meson.build
index 6b50f7238..21a296b55 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 45d974cd2..fcc8931f0 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (8 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 09/12] build: disable drivers in Arm builds Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2021-01-11 20:22                           ` Andrew Boyer
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 11/12] build: add Arm SoC meson option Juraj Linkeš
                                           ` (3 subsequent siblings)
  13 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disable NUMA in Arm cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_bluefield_linux_gcc          |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_graviton2_linux_gcc          |  1 +
 config/arm/arm64_n1sdp_linux_gcc              |  1 +
 config/arm/arm64_octeontx2_linux_gcc          |  1 +
 config/arm/arm64_stingray_linux_gcc           |  1 +
 config/arm/meson.build                        |  2 --
 config/meson.build                            | 19 +++++++++++++------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
 10 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index e365f61d0..487cb2923 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,4 +18,5 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 8641fee63..37398c762 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = 'dpaa'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@ implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7db343b8a..f5e1ad20c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -61,8 +61,6 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_USE_C11_MEM_MODEL', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_CACHE_LINE_SIZE', 64],
 			['RTE_MAX_LCORE', 64],
diff --git a/config/meson.build b/config/meson.build
index 2bff6137f..9583be4ab 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -142,12 +142,19 @@ endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
-	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-	has_libnuma = 1
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+	# don't look for libnuma if explicitly disabled in cross build
+	check_libnuma = false
+endif
+if find_libnuma
+	numa_dep = cc.find_library('numa', required: false)
+	if numa_dep.found() and cc.has_header('numaif.h')
+		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+		has_libnuma = 1
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0
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 210ad4508..063661ebf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -147,3 +147,7 @@ There are other options you may specify in a cross file to tailor the build::
       disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
          # valid values are directories (optionally with their subdirs)
          # in the drivers directory
+
+      numa = false        # set to false to force building for a non-NUMA system
+         # if not set or set to true, the build system will build for a NUMA
+         # system only if libnuma is installed
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 11/12] build: add Arm SoC meson option
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (9 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
                                           ` (2 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   7 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 129 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
 meson_options.txt                             |   2 +
 14 files changed, 166 insertions(+), 108 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 487cb2923..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,9 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da..64d44ead8 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c762..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index f5e1ad20c..94a7dd295 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -29,7 +29,7 @@ native_machine_args = ['-mcpu=native']
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -179,6 +179,99 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines.',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false,
+	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -191,11 +284,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with default build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -214,8 +314,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -241,8 +360,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 063661ebf..83bdb78bf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -100,54 +100,32 @@ command::
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
-         # valid values are directories (optionally with their subdirs)
-         # in the drivers directory
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Darm_soc meson
+option::
+
+   meson soc_build -Darm_soc=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   soc = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index e384e6dbb..ea7bd46fc 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')
 option('disable_drivers', type: 'string', value: '',
 	description: 'Comma-separated list of drivers to explicitly disable.')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v13 12/12] config: fix Arm implementer and its SoCs
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (10 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 11/12] build: add Arm SoC meson option Juraj Linkeš
@ 2020-11-20 12:08                         ` Juraj Linkeš
  2020-12-16 23:28                         ` [dpdk-dev] [PATCH v13 00/12] Arm build options rework Vimal Chungath
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-11-20 12:08 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 54 ++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 94a7dd295..3f15000ff 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -74,8 +74,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -145,38 +145,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -189,8 +163,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
 }
@@ -199,13 +177,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -242,6 +230,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection
  2020-11-20 10:15                                             ` Bruce Richardson
  2020-11-20 10:19                                               ` Bruce Richardson
@ 2020-11-20 15:56                                               ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2020-11-20 15:56 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Juraj Linkeš,
	thomas, Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar,
	jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd, Honnappa Nagarahalli, nd

<snip>
> >
> > > > > > > 18/11/2020 15:19, Juraj Linkeš:
> > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > 16/11/2020 10:13, Bruce Richardson:
> > > > > > > > > > On Mon, Nov 16, 2020 at 08:24:48AM +0100, Thomas
> > > > > > > > > > Monjalon
> > > wrote:
> > > > > > > > > > > 13/11/2020 15:31, Juraj Linkeš:
> > > > > > > > > > > > +option('max_lcores', type: 'integer', value: 0,
> > > > > > > > > > > > +	description: 'maximum number of cores/threads
> > > > > > > > > > > > +supported by
> > > > > > > EAL.
> > > > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > > > +cross-compilation
> > > > > > > > > defaults. Set to -1 to detect the number of cores on the
> > > > > > > > > build
> > > > > > > > > machine.') option('max_numa_nodes', type: 'integer', value:
> > > > > > > > > 0,
> > > > > > > > > > > > +	description: 'maximum number of NUMA nodes
> > > supported
> > > > > > > > > > > > +by
> > > > > > > EAL.
> > > > > > > > > > > > +Set to positive integer to overwrite per-arch or
> > > > > > > > > > > > +cross-compilation defaults. Set to -1 to detect
> > > > > > > > > > > > +the number of numa nodes on the build machine.')
> > > > > > > > > > >
> > > > > > > > > > > First comment: I don't like having so long description.
> > > > > > > > > > > Second: I don't understand.
> > > > > > > > > > >
> > > > > > > > > > > It is said the default value is 0 so I expect it
> > > > > > > > > > > means automatic
> > > > > detection.
> > > > > > > > > > > But later it is said -1 is for detection. So ?
> > > > > > > > > > >
> > > > > > > > > > Zero is for the "per-arch or cross-compilation default".
> > > > > > > > > > This was discussed quite a bit in previous versions
> > > > > > > > > > and this was te best compromise we could come up with.
> > > > > > > > > > Having a default of auto-detect is definitely not
> > > > > > > > > > something I think we should go with - just thinking of
> > > > > > > > > > all the build CI jobs running on
> > > > > > > > > > 2 or 4 core VMs! However, Juraj really felt there was
> > > > > > > > > > value in having auto-detection, so it's set as a -1
> > > > > > > > > > value, which I'm
> > > ok with.
> > > > > > > > >
> > > > > > > > > The problem is that I don't understand what 0 means.
> > > > > > > > >
> > > > > > > >
> > > > > > > > There are three pieces of information which we need to convey:
> > > > > > > > 1. The default value (0) indicates that per-arch or
> > > > > > > > cross-compilation defaults
> > > > > > > will be used.
> > > > > > > > 2. Positive integer values will be used instead of these defaults.
> > > > > > >
> > > > > > > Where these positive values come from?
> > > > > > >
> > > > > >
> > > > > > From the user - they will have the option to set it to
> > > > > > whatever the like if they
> > > > > don't want to use defaults.
> > > > > >
> > > > > > > > 3. Detected values will be used for native build when the value is
> -1.
> > > > > > >
> > > > > > > Why not detect for any native build set up with 0 (default)?
> > > > > > >
> > > > > >
> > > > > > I'll let Bruce explain this, but I'll just say that we wanted
> > > > > > to make the detection
> > > > > the default for native builds, so we're in agreement.
> > > > >
> > > > > I think most of us agree that the different understanding of the
> > > > > term "native build", is the cause of much of the disagreements
> > > > > and
> > Agree, that's the main reason.
> >
> > > > > points of dispute on this thread. From my view point, the term
> "native"
> > > can refer to:
> > > > >
> > > > > 1. what meson considers a native build, i.e. one not using a
> > > > > cross-file 2. a build for a different machine architecture to
> > > > > the one on the
> > > build
> > > > >    machine (this largely overlaps with #1, except that e.g. 32-bit build
> on
> > > > >    64-bit may be considered a cross-build in this case).
> > Sorry, I did not understand #2 here. Are you saying, native "means" - "a
> build for a different machine architecture to the one on the build machine"
> >
> > > > > 3. a build tailored exactly for the build machine itself i.e. both ISA, and
> > > > >    things like core counts.
> > > > > 4. a flag passed to the compiler to indicate the uarch level of the
> > > > >    instruction set to be used, e.g. on x86, AVX2, AVX-512 etc., based on
> > > > >    that of the build machine.
> > > > >
> > > > > Historically, IIRC, in DPDK the "RTE_MACHINE" value was
> > > > > originally
> > > > > #4 since that was it's use on x86 in the first versions of DPDK.
> > > > > With the move from make to meson, that aspect was kept, but the
> > > > > meaning of #1 (I think we can ignore #2) also came into play.
> > > > > Finally, while for x86 architecture, the idea of #4 still held,
> > > > > for ARM use #3
> > > is of major concern.
> > Yes, #3 is the concern.
> >
> > At the same time, I am also interested in avoiding 'native' (or any other
> option) having different meaning for different architectures.
> > Now that we have introduced 'soc' option for Arm platforms, we are able
> to achieve the builds that would be produced by #3.
> > 'soc' combines both the 'platform' and 'instruction set' (as you have defined
> them below).
> >
> 
> My thinking was that platform would be a synonym for "soc" for SOCs - it
> would just seem weird to refer to x86 or PPC server systems as soc's, so I
> thought "platform" a more neutral term.
I am fine with using 'platform' for 'soc'.

> Also, as I defined it above, the idea of "platform" would always encompass
> the "instruction set" option too, unless the user explicitly overrode it - hence
> the "auto" default value.
Ok.

> 
> /Bruce

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

* Re: [dpdk-dev] [PATCH v13 00/12] Arm build options rework
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (11 preceding siblings ...)
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-12-16 23:28                         ` Vimal Chungath
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
  13 siblings, 0 replies; 465+ messages in thread
From: Vimal Chungath @ 2020-12-16 23:28 UTC (permalink / raw)
  To: juraj.linkes
  Cc: Dharmik.Thakkar, Honnappa.Nagarahalli, Phil.Yang, Ruifeng.Wang,
	ajit.khaparde, bruce.richardson, dev, ferruh.yigit,
	hemant.agrawal, jerinjacobk, vcchunga

On 11/20/20 4:08 AM, Juraj Linkeš wrote:
> The current way of specifying Arm configuration options is insufficient
> since we can't identify the SoC we're building for from the MIDR
> information. For example, we can't distinguish between N1SDP, Graviton2
> or Ampere Altra.
>
> Add a way to specify the cpu count and numa node count for cross builds
> and aarch64 -> aarch64 (SoC) builds.
>
> We also want to be able to disable which drivers (and possibly
> libraries) are built without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed
> 2. a cross build on a fast aarch64 machine but with target SoC which
>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in SoC configuration.
>
> Among libraries, only libnuma can be now disabled.
>
> Also add an optional way to discover cpu count a numa node count. Fix
> -Dmax_lcores and -Dmax_numa_nodes for arm builds.
>
> The current implementation adds/supports the following:
> * x86 -> aarch64 cross build with added config options/disabled
>   drivers/libs
> * aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
>   option or using a cross file
> * max numa nodes and max lcore may be specified on the command line to
>   overwrite the values for any (native, SoC or cross) build
>

I tested on Graviton2 and it looks good to me. I tested native, cross and the 
arm_soc builds and verified the config options for Graviton2.

Series Tested-by: Vimal Chungath <vcchunga@amazon.com>

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

* [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
                                           ` (12 preceding siblings ...)
  2020-12-16 23:28                         ` [dpdk-dev] [PATCH v13 00/12] Arm build options rework Vimal Chungath
@ 2020-12-23 11:47                         ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 01/12] build: rename Arm build variables Juraj Linkeš
                                             ` (14 more replies)
  13 siblings, 15 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds
and aarch64 -> aarch64 (SoC) builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
  option or using a cross file
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native, SoC or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

v9:
Split SoC and implementer dictionaries into smaller parts.
Fixed DPAA and ARMADA SoC configuration.
Added documentation about supported SoCs.

v10:
Added a commit that fixes Graviton2 clang build failures in native
build.

v11:
Rebase.

v12:
Fixed dpaa and armada cross builds in generic build commit.

v13:
Removed two commits which were not arm-specific:
1. build: alias default build as generic
2. build: optional NUMA and cpu counts detection
Also minor adjustments to commit messages in:
1. build: isolate configuration for Arm generic build
2. build: disable drivers in Arm builds

v14:
Resent for retesting (because of suspected false negative).

Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Series Tested-by: Vimal Chungath <vcchunga@amazon.com>

Juraj Linkeš (12):
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for Arm generic build
  build: use native machine args in Arm native build
  build: add core and NUMA counts to cross files
  build: disable drivers in Arm builds
  build: disable libnuma in cross builds
  build: add Arm SoC meson option
  config: fix Arm implementer and its SoCs

 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  15 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 502 ++++++++++++------
 config/meson.build                            |  34 +-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |   2 +
 17 files changed, 413 insertions(+), 203 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 01/12] build: rename Arm build variables
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 02/12] build: remove unused or superfluous variables Juraj Linkeš
                                             ` (13 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 114 +++++++++++++--------------
 11 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..4fc0ae0fc 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,7 +8,7 @@ march_opt = '-march=@0@'.format(machine)
 arm_force_native_march = false
 arm_force_default_march = (machine == 'default')
 
-flags_common_default = [
+flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
@@ -28,58 +28,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -90,8 +90,8 @@ flags_n1generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -100,36 +100,36 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -144,13 +144,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	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 = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -161,45 +161,45 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
-	foreach flag: flags_common_default
+	foreach flag: flags_common
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 02/12] build: remove unused or superfluous variables
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 01/12] build: rename Arm build variables Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config and comments Juraj Linkeš
                                             ` (12 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4fc0ae0fc..be6776ff0 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,11 +2,7 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
 
 flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -61,7 +57,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -118,17 +113,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -144,11 +131,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_default_march and not meson.is_cross_build()
+	if machine == 'default' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -159,14 +144,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -199,7 +185,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config and comments
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 01/12] build: rename Arm build variables Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 02/12] build: remove unused or superfluous variables Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2021-01-11 20:26                             ` Andrew Boyer
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 04/12] build: simplify how Arm flags are processed Juraj Linkeš
                                             ` (11 subsequent siblings)
  14 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armv8_linux_gcc              | 12 +--
 config/arm/meson.build                        | 96 +++++++++++--------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
 3 files changed, 93 insertions(+), 49 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..0099f5ca2 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,16 +13,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
-
-# Valid options for Arm's part_number:
-# 'generic': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
 part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index be6776ff0..89c196048 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -4,15 +4,16 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common = [
-	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
+	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -22,69 +23,86 @@ flags_common = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_CACHE_LINE_SIZE', 128],
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -95,8 +113,8 @@ part_number_config_arm = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]]
-
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
+]
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
@@ -104,13 +122,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -122,21 +141,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'default' and not meson.is_cross_build()
+		# default build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -157,6 +176,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -193,7 +213,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
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..972598835 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -99,3 +99,37 @@ command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+Supported cross-compilation targets
+-----------------------------------
+
+If you wish to build for a target which is not among the current cross-files,
+you may use various combinations of implementer/part number::
+
+   Supported implementers:
+      'generic': Generic armv8
+      '0x41':    Arm
+      '0x43':    Cavium
+      '0x50':    Ampere Computing
+      '0x56':    Marvell ARMADA
+      'dpaa':    NXP DPAA
+
+   Supported part_numbers for generic, 0x41, 0x56, dpaa:
+      'generic': valid for all armv8-a architectures (default value)
+      '0xd03':   cortex-a53
+      '0xd04':   cortex-a35
+      '0xd09':   cortex-a73
+      '0xd0a':   cortex-a75
+      '0xd0b':   cortex-a76
+      '0xd0c':   neoverse-n1
+
+   Supported part_numbers for 0x43:
+      'generic': valid for all Cavium builds
+      '0xa1':    thunderxt88
+      '0xa2':    thunderxt81
+      '0xa3':    thunderxt83
+      '0xaf':    thunderx2t99
+      '0xb2':    octeontx2
+
+   Supported part_numbers for 0x50:
+      'generic': valid for all Ampere builds
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 04/12] build: simplify how Arm flags are processed
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (2 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config and comments Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 05/12] build: organize Arm config into dict Juraj Linkeš
                                             ` (10 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 89c196048..fb877fe77 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -149,7 +149,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
 		implementer_config = implementer_generic
@@ -182,34 +181,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 05/12] build: organize Arm config into dict
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (3 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 04/12] build: simplify how Arm flags are processed Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2021-01-15  8:38                             ` Ruifeng Wang
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
                                             ` (9 subsequent siblings)
  14 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 298 ++++++++++++++++++++++++-----------------
 1 file changed, 178 insertions(+), 120 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index fb877fe77..b449b10c3 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -27,115 +27,166 @@ flags_common = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementer_generic = {
+	'description': 'Generic armv8',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 256]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc',
+					     '-moutline-atomics']}
+	}
+}
+
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc',
+				      '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto',
+				  '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_USE_C11_MEM_MODEL', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_CACHE_LINE_SIZE', 64],
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	}
+}
+implementer_arm = {
+	'description': 'Arm',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+implementer_cavium = {
+	'description': 'Cavium',
+	'flags': [
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_CACHE_LINE_SIZE', 128],
+		['RTE_MAX_LCORE', 96],
+		['RTE_MAX_NUMA_NODES', 2]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
+					     '-mcpu=thunderx']},
+		'native': {'machine_args': ['-march=native']},
+		'0xa1': {
+			'machine_args': ['-mcpu=thunderxt88'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa2': {
+			'machine_args': ['-mcpu=thunderxt81'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa3': {
+			'machine_args': ['-mcpu=thunderxt83'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xaf': {
+			'machine_args': ['-march=armv8.1-a+crc+crypto',
+					 '-mcpu=thunderx2t99'],
+			'flags': [
+				['RTE_MACHINE', '"thunderx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_CACHE_LINE_SIZE', 64],
+				['RTE_MAX_LCORE', 256],
+				['RTE_MAX_NUMA_NODES', 2]
+			]
+		},
+		'0xb2': {
+			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
+					 '-mcpu=octeontx2'],
+			'flags': [
+				['RTE_MACHINE', '"octeontx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_EAL_IGB_UIO', false],
+				['RTE_MAX_LCORE', 36],
+				['RTE_MAX_NUMA_NODES', 1]
+			]
+		}
+	}
+}
 
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic]
-]
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+implementer_ampere = {
+	'description': 'Ampere Computing',
+	'flags': [
+		['RTE_MACHINE', '"emag"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 32],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': {
+		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					      '-mtune=emag']},
+		'native': {'machine_args':  ['-march=native']}
+	}
+}
+
+implementer_marvell = {
+	'description': 'Marvell ARMADA',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
+
+implementer_dpaa = {
+	'description': 'NXP DPAA',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+implementers = {
+	'generic': implementer_generic,
+	'0x41': implementer_arm,
+	'0x43': implementer_cavium,
+	'0x50': implementer_ampere,
+	'0x56': implementer_marvell,
+	'dpaa': implementer_dpaa
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -151,7 +202,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -166,9 +217,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -178,28 +229,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config[1]
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 06/12] build: isolate configuration for Arm generic build
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (4 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 05/12] build: organize Arm config into dict Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 07/12] build: use native machine args in Arm native build Juraj Linkeš
                                             ` (8 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
 6 files changed, 29 insertions(+), 29 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..143a3c9f8 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..c3c8a1ef6 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+part_number = '0xd08'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index b449b10c3..403e1a02f 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -47,8 +47,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc',
-				      '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -97,8 +95,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
-					     '-mcpu=thunderx']},
 		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
@@ -148,8 +144,8 @@ implementer_ampere = {
 		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': {
-		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					      '-mtune=emag']},
+		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					  '-mtune=emag']},
 		'native': {'machine_args':  ['-march=native']}
 	}
 }
@@ -199,10 +195,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -215,21 +210,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -239,15 +237,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
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 972598835..6a883b030 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -114,8 +114,10 @@ you may use various combinations of implementer/part number::
       '0x56':    Marvell ARMADA
       'dpaa':    NXP DPAA
 
-   Supported part_numbers for generic, 0x41, 0x56, dpaa:
-      'generic': valid for all armv8-a architectures (default value)
+   Supported part_numbers for generic:
+      'generic': valid for all armv8-a architectures (unoptimized portable build)
+
+   Supported part_numbers for 0x41, 0x56, dpaa:
       '0xd03':   cortex-a53
       '0xd04':   cortex-a35
       '0xd09':   cortex-a73
@@ -124,7 +126,6 @@ you may use various combinations of implementer/part number::
       '0xd0c':   neoverse-n1
 
    Supported part_numbers for 0x43:
-      'generic': valid for all Cavium builds
       '0xa1':    thunderxt88
       '0xa2':    thunderxt81
       '0xa3':    thunderxt83
@@ -132,4 +133,4 @@ you may use various combinations of implementer/part number::
       '0xb2':    octeontx2
 
    Supported part_numbers for 0x50:
-      'generic': valid for all Ampere builds
+      '0x0':     emag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 07/12] build: use native machine args in Arm native build
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (5 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2021-01-15  8:39                             ` Ruifeng Wang
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
                                             ` (7 subsequent siblings)
  14 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args usable for both GCC and Clang.

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

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 403e1a02f..4508f369c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,8 +2,6 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -26,6 +24,7 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -47,7 +46,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -95,7 +93,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
 			'flags': flags_part_number_thunderx
@@ -145,8 +142,7 @@ implementer_ampere = {
 	],
 	'part_number_config': {
 		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					  '-mtune=emag']},
-		'native': {'machine_args':  ['-march=native']}
+					  '-mtune=emag']}
 	}
 }
 
@@ -195,26 +191,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'default' and not meson.is_cross_build()
-		# default build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'default'
+			# default build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -250,7 +247,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 08/12] build: add core and NUMA counts to cross files
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (6 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 07/12] build: use native machine args in Arm native build Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 09/12] build: disable drivers in Arm builds Juraj Linkeš
                                             ` (6 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                 |  2 ++
 config/arm/arm64_armv8_linux_gcc                  |  2 ++
 config/arm/arm64_bluefield_linux_gcc              |  2 ++
 config/arm/arm64_dpaa_linux_gcc                   |  2 ++
 config/arm/arm64_emag_linux_gcc                   |  2 ++
 config/arm/arm64_graviton2_linux_gcc              |  2 ++
 config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
 config/arm/arm64_octeontx2_linux_gcc              |  2 ++
 config/arm/arm64_stingray_linux_gcc               |  2 ++
 config/arm/arm64_thunderx2_linux_gcc              |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
 config/arm/meson.build                            |  6 ++++--
 config/meson.build                                | 15 +++++++++++++++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
 14 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 143a3c9f8..2ecc4604c 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x56'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 0099f5ca2..5451a01da 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 # Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
 part_number = 'generic'
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index c3c8a1ef6..8641fee63 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = 'dpaa'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 4508f369c..375a804ac 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -37,7 +37,8 @@ implementer_generic = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 128],
-		['RTE_MAX_LCORE', 256]
+		['RTE_MAX_LCORE', 256],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': {
 		'generic': {'machine_args': ['-march=armv8-a+crc',
@@ -75,7 +76,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16]
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': part_number_config_arm
 }
diff --git a/config/meson.build b/config/meson.build
index a3154e29c..19c743091 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -253,6 +253,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
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 6a883b030..4e65b271c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -134,3 +134,12 @@ you may use various combinations of implementer/part number::
 
    Supported part_numbers for 0x50:
       '0x0':     emag
+
+Other cross file options
+------------------------
+
+There are other options you may specify in a cross file to tailor the build::
+
+   Supported extra configuration
+      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+      max_lcores = n      # will set RTE_MAX_LCORE
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 09/12] build: disable drivers in Arm builds
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (7 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 10/12] build: disable libnuma in cross builds Juraj Linkeš
                                             ` (5 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works and remove
unneeded driver options ported from the old makefile system, since they
don't work in the current Meson build system.
Add support for removing drivers for cross builds so that we can disable
them in cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                   | 1 +
 config/arm/meson.build                              | 7 +++----
 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
 drivers/meson.build                                 | 6 +++++-
 meson.build                                         | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 2ecc4604c..e365f61d0 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 375a804ac..7db343b8a 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,6 +2,9 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -16,9 +19,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -126,7 +126,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 4e65b271c..210ad4508 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -143,3 +143,7 @@ There are other options you may specify in a cross file to tailor the build::
    Supported extra configuration
       max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
       max_lcores = n      # will set RTE_MAX_LCORE
+
+      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
+         # valid values are directories (optionally with their subdirs)
+         # in the drivers directory
diff --git a/drivers/meson.build b/drivers/meson.build
index f9febc579..c307929a4 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 45d974cd2..fcc8931f0 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 10/12] build: disable libnuma in cross builds
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (8 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 09/12] build: disable drivers in Arm builds Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 11/12] build: add Arm SoC meson option Juraj Linkeš
                                             ` (4 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disable NUMA in Arm cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_bluefield_linux_gcc          |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_graviton2_linux_gcc          |  1 +
 config/arm/arm64_n1sdp_linux_gcc              |  1 +
 config/arm/arm64_octeontx2_linux_gcc          |  1 +
 config/arm/arm64_stingray_linux_gcc           |  1 +
 config/arm/meson.build                        |  2 --
 config/meson.build                            | 19 +++++++++++++------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
 10 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index e365f61d0..487cb2923 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,4 +18,5 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 8641fee63..37398c762 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = 'dpaa'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@ implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7db343b8a..f5e1ad20c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -61,8 +61,6 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_USE_C11_MEM_MODEL', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_CACHE_LINE_SIZE', 64],
 			['RTE_MAX_LCORE', 64],
diff --git a/config/meson.build b/config/meson.build
index 19c743091..7fbd09e37 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -142,12 +142,19 @@ endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
-	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-	has_libnuma = 1
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+	# don't look for libnuma if explicitly disabled in cross build
+	check_libnuma = false
+endif
+if find_libnuma
+	numa_dep = cc.find_library('numa', required: false)
+	if numa_dep.found() and cc.has_header('numaif.h')
+		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+		has_libnuma = 1
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0
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 210ad4508..063661ebf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -147,3 +147,7 @@ There are other options you may specify in a cross file to tailor the build::
       disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
          # valid values are directories (optionally with their subdirs)
          # in the drivers directory
+
+      numa = false        # set to false to force building for a non-NUMA system
+         # if not set or set to true, the build system will build for a NUMA
+         # system only if libnuma is installed
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 11/12] build: add Arm SoC meson option
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (9 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 10/12] build: disable libnuma in cross builds Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
                                             ` (3 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   7 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 129 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
 meson_options.txt                             |   2 +
 14 files changed, 166 insertions(+), 108 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 487cb2923..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,9 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da..64d44ead8 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c762..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index f5e1ad20c..94a7dd295 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -29,7 +29,7 @@ native_machine_args = ['-mcpu=native']
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -179,6 +179,99 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines.',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false,
+	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -191,11 +284,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with default build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -214,8 +314,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -241,8 +360,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 063661ebf..83bdb78bf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -100,54 +100,32 @@ command::
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
-         # valid values are directories (optionally with their subdirs)
-         # in the drivers directory
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Darm_soc meson
+option::
+
+   meson soc_build -Darm_soc=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   soc = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index e384e6dbb..ea7bd46fc 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')
 option('disable_drivers', type: 'string', value: '',
 	description: 'Comma-separated list of drivers to explicitly disable.')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v14 12/12] config: fix Arm implementer and its SoCs
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (10 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 11/12] build: add Arm SoC meson option Juraj Linkeš
@ 2020-12-23 11:47                           ` Juraj Linkeš
  2020-12-30 19:09                           ` [dpdk-dev] [PATCH v14 00/12] Arm build options rework Andrew Boyer
                                             ` (2 subsequent siblings)
  14 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2020-12-23 11:47 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 54 ++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 94a7dd295..3f15000ff 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -74,8 +74,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -145,38 +145,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -189,8 +163,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
 }
@@ -199,13 +177,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -242,6 +230,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (11 preceding siblings ...)
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2020-12-30 19:09                           ` Andrew Boyer
  2020-12-30 20:56                             ` Thomas Monjalon
  2021-01-05 11:02                           ` Pavan Nikhilesh Bhagavatula
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
  14 siblings, 1 reply; 465+ messages in thread
From: Andrew Boyer @ 2020-12-30 19:09 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev


> On Dec 23, 2020, at 6:47 AM, Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
> 
> The current way of specifying Arm configuration options is insufficient
> since we can't identify the SoC we're building for from the MIDR
> information. For example, we can't distinguish between N1SDP, Graviton2
> or Ampere Altra.
> 
> Add a way to specify the cpu count and numa node count for cross builds
> and aarch64 -> aarch64 (SoC) builds.
> 

Hello Juraj,
This is great, you have solved a problem for me before I even knew there was one. (We have two SoCs with the same id and pn, but different core counts etc.)

Can anyone fill me in on how and when this patchset is going to be taken? Will it go to dpdk-next-net, or to some other branch?

Thank you,
Andrew


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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2020-12-30 19:09                           ` [dpdk-dev] [PATCH v14 00/12] Arm build options rework Andrew Boyer
@ 2020-12-30 20:56                             ` Thomas Monjalon
  2021-01-01 17:19                               ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2020-12-30 20:56 UTC (permalink / raw)
  To: Andrew Boyer
  Cc: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev

30/12/2020 20:09, Andrew Boyer:
> 
> > On Dec 23, 2020, at 6:47 AM, Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
> > 
> > The current way of specifying Arm configuration options is insufficient
> > since we can't identify the SoC we're building for from the MIDR
> > information. For example, we can't distinguish between N1SDP, Graviton2
> > or Ampere Altra.
> > 
> > Add a way to specify the cpu count and numa node count for cross builds
> > and aarch64 -> aarch64 (SoC) builds.
> > 
> 
> Hello Juraj,
> This is great, you have solved a problem for me before I even knew there was one. (We have two SoCs with the same id and pn, but different core counts etc.)
> 
> Can anyone fill me in on how and when this patchset is going to be taken? Will it go to dpdk-next-net, or to some other branch?

It should go in the main branch.
I cannot commit on any date, but for sure it would help
if you can do a detailed review, thanks.



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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2020-12-30 20:56                             ` Thomas Monjalon
@ 2021-01-01 17:19                               ` Honnappa Nagarahalli
  2021-01-04 22:46                                 ` Andrew Boyer
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-01 17:19 UTC (permalink / raw)
  To: thomas, Andrew Boyer
  Cc: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd, nd

<snip>

> 
> 30/12/2020 20:09, Andrew Boyer:
> >
> > > On Dec 23, 2020, at 6:47 AM, Juraj Linkeš <juraj.linkes@pantheon.tech>
> wrote:
> > >
> > > The current way of specifying Arm configuration options is
> > > insufficient since we can't identify the SoC we're building for from
> > > the MIDR information. For example, we can't distinguish between
> > > N1SDP, Graviton2 or Ampere Altra.
> > >
> > > Add a way to specify the cpu count and numa node count for cross
> > > builds and aarch64 -> aarch64 (SoC) builds.
> > >
> >
> > Hello Juraj,
> > This is great, you have solved a problem for me before I even knew
> > there was one. (We have two SoCs with the same id and pn, but
> > different core counts etc.)
> >
> > Can anyone fill me in on how and when this patchset is going to be taken?
> Will it go to dpdk-next-net, or to some other branch?
> 
> It should go in the main branch.
> I cannot commit on any date, but for sure it would help if you can do a
> detailed review, thanks.
Testing on your SoC would be of great help.


> 


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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-01 17:19                               ` Honnappa Nagarahalli
@ 2021-01-04 22:46                                 ` Andrew Boyer
  2021-01-06 13:40                                   ` Bruce Richardson
                                                     ` (2 more replies)
  0 siblings, 3 replies; 465+ messages in thread
From: Andrew Boyer @ 2021-01-04 22:46 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: thomas, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd


> On Jan 1, 2021, at 12:19 PM, Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com> wrote:
>> 
>> 30/12/2020 20:09, Andrew Boyer:
>>> 
>>>> On Dec 23, 2020, at 6:47 AM, Juraj Linkeš <juraj.linkes@pantheon.tech>
>> wrote:
>>>> 
>>>> The current way of specifying Arm configuration options is
>>>> insufficient since we can't identify the SoC we're building for from
>>>> the MIDR information. For example, we can't distinguish between
>>>> N1SDP, Graviton2 or Ampere Altra.
>>>> 
>>>> Add a way to specify the cpu count and numa node count for cross
>>>> builds and aarch64 -> aarch64 (SoC) builds.
>>>> 
>>> 
>>> Hello Juraj,
>>> This is great, you have solved a problem for me before I even knew
>>> there was one. (We have two SoCs with the same id and pn, but
>>> different core counts etc.)
>>> 
>>> Can anyone fill me in on how and when this patchset is going to be taken?
>> Will it go to dpdk-next-net, or to some other branch?
>> 
>> It should go in the main branch.
>> I cannot commit on any date, but for sure it would help if you can do a
>> detailed review, thanks.
> Testing on your SoC would be of great help.
> 

Hello Honnappa, Juraj, and Bruce,

I've got most of the build working under meson. A few questions:

1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build fails with this error. It’s been broken for a long time; maybe this option isn’t supported and should be blocked earlier?

	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown variable "both_rte_ethdev".

2) Is there a way to disable specific libraries? I’ve pruned down the list of drivers, which is great. This feature existed under make but I don’t see anything about it in meson yet.

3) We need to build kni against the aarch64 kernel headers, but it fails. It appears that kernel/linux/kni/meson.build doesn’t pass any cross-compile flags in the make command it creates. The diff below shows how I hardcoded it to get it to work for now. Thoughts on how to do this right? meson has the path (in $PATH) and the binary prefixs (in ‘[binaries]’ in the cross file). It must know the arch, too.

--- a/kernel/linux/kni/meson.build
+++ b/kernel/linux/kni/meson.build
@@ -14,6 +14,8 @@ custom_target('rte_kni',
        input: kni_sources,
        output: 'rte_kni.ko',
        command: ['make', '-j4', '-C', kernel_dir + '/build',
+               'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux-gnu-',
+               'ARCH=aarch64',
                'M=' + meson.current_build_dir(),
                'src=' + meson.current_source_dir(),
                'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' +

I will try to get to a full review soon.

Thank you,
Andrew

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (12 preceding siblings ...)
  2020-12-30 19:09                           ` [dpdk-dev] [PATCH v14 00/12] Arm build options rework Andrew Boyer
@ 2021-01-05 11:02                           ` Pavan Nikhilesh Bhagavatula
  2021-01-05 15:12                             ` Honnappa Nagarahalli
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
  14 siblings, 1 reply; 465+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2021-01-05 11:02 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit
  Cc: dev



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Juraj Linkeš
>Sent: Wednesday, December 23, 2020 5:17 PM
>To: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
>Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
>vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
>jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
>ajit.khaparde@broadcom.com; ferruh.yigit@intel.com
>Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
>Subject: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
>
>The current way of specifying Arm configuration options is insufficient
>since we can't identify the SoC we're building for from the MIDR
>information. For example, we can't distinguish between N1SDP,
>Graviton2
>or Ampere Altra.
>
>Add a way to specify the cpu count and numa node count for cross
>builds
>and aarch64 -> aarch64 (SoC) builds.
>
>We also want to be able to disable which drivers (and possibly
>libraries) are built without user input. This is useful when building:
>1. on an SoC that is slow and we want to build only what is necessary
>  without the user having to check which libraries they have installed
>2. a cross build on a fast aarch64 machine but with target SoC which
>  differs in capabilities or libraries.
>This is achieved by specifying the drivers in SoC configuration.
>
>Among libraries, only libnuma can be now disabled.
>
>Also add an optional way to discover cpu count a numa node count. Fix
>-Dmax_lcores and -Dmax_numa_nodes for arm builds.
>
>The current implementation adds/supports the following:
>* x86 -> aarch64 cross build with added config options/disabled
>  drivers/libs
>* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
>  option or using a cross file
>* max numa nodes and max lcore may be specified on the command
>line to
>  overwrite the values for any (native, SoC or cross) build
>
>v2:
>Major rework of the whole series.
>
>v3:
>Added numa and core count defaults for x86 default build.
>Removed numa and core count defaults. Now requiring defaults to be
>specified in a cross file or on the cmdline.
>Added FreeBDS support for numa count discovery.
>
>v4:
>Make automatic numa and cpu counts discovery optional.
>
>v5:
>Split the refactor patch into smaller patches.
>Simplify buildtools/get_numa_count.py.
>Add more explanation to cover letter.
>
>v6:
>Apply cross file options arch agnostically, not just in Arm cross
>builds.
>Streamline Arm build setup and machine args: always use native args in
>native builds, require implementer ID and part number for cross builds.
>
>v7:
>Arm config options are now organized in one dictionary.
>Removed unsupported implementers and removed fallback to generic
>implementer/part number for unknown implementer/part number.
>Added meson config option arm_soc which can be used to specify
>configuration to be used, useful for aarch64 -> aarch64 builds.
>
>v8:
>Rebase.
>
>v9:
>Split SoC and implementer dictionaries into smaller parts.
>Fixed DPAA and ARMADA SoC configuration.
>Added documentation about supported SoCs.
>
>v10:
>Added a commit that fixes Graviton2 clang build failures in native
>build.
>
>v11:
>Rebase.
>
>v12:
>Fixed dpaa and armada cross builds in generic build commit.
>
>v13:
>Removed two commits which were not arm-specific:
>1. build: alias default build as generic
>2. build: optional NUMA and cpu counts detection
>Also minor adjustments to commit messages in:
>1. build: isolate configuration for Arm generic build
>2. build: disable drivers in Arm builds
>
>v14:
>Resent for retesting (because of suspected false negative).
>
>Series Acked-by: Jerin Jacob <jerinj@marvell.com>
>Series Tested-by: Jerin Jacob <jerinj@marvell.com>
>Series Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>Series Tested-by: Vimal Chungath <vcchunga@amazon.com>
>

Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Also, I believe we need to take a look at ARCH_SOC_ID support 
coming up in 5.9 kernel.

https://lore.kernel.org/linux-arm-kernel/20200506164411.3284-1-sudeep.holla@arm.com/

>Juraj Linkeš (12):
>  build: rename Arm build variables
>  build: remove unused or superfluous variables
>  build: reformat and move Arm config and comments
>  build: simplify how Arm flags are processed
>  build: organize Arm config into dict
>  build: isolate configuration for Arm generic build
>  build: use native machine args in Arm native build
>  build: add core and NUMA counts to cross files
>  build: disable drivers in Arm builds
>  build: disable libnuma in cross builds
>  build: add Arm SoC meson option
>  config: fix Arm implementer and its SoCs
>
> config/arm/arm64_armada_linux_gcc             |   2 +-
> config/arm/arm64_armv8_linux_gcc              |  15 +-
> config/arm/arm64_bluefield_linux_gcc          |   3 +-
> config/arm/arm64_dpaa_linux_gcc               |   2 +-
> config/arm/arm64_emag_linux_gcc               |   2 +-
> config/arm/arm64_graviton2_linux_gcc          |   3 +-
> config/arm/arm64_n1sdp_linux_gcc              |   3 +-
> config/arm/arm64_octeontx2_linux_gcc          |   3 +-
> config/arm/arm64_stingray_linux_gcc           |   3 +-
> config/arm/arm64_thunderx2_linux_gcc          |   3 +-
> ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
> config/arm/meson.build                        | 502 ++++++++++++------
> config/meson.build                            |  34 +-
> .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
> drivers/meson.build                           |   6 +-
> meson.build                                   |   1 +
> meson_options.txt                             |   2 +
> 17 files changed, 413 insertions(+), 203 deletions(-)
> rename config/arm/{arm64_thunderx_linux_gcc =>
>arm64_thunderxt88_linux_gcc} (92%)
>
>--
>2.20.1


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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-05 11:02                           ` Pavan Nikhilesh Bhagavatula
@ 2021-01-05 15:12                             ` Honnappa Nagarahalli
  2021-01-22  8:53                               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-05 15:12 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, nd

<snip>

> >
> >v14:
> >Resent for retesting (because of suspected false negative).
> >
> >Series Acked-by: Jerin Jacob <jerinj@marvell.com> Series Tested-by:
> >Jerin Jacob <jerinj@marvell.com> Series Tested-by: Dharmik Thakkar
> ><dharmik.thakkar@arm.com> Series Tested-by: Vimal Chungath
> ><vcchunga@amazon.com>
> >
> 
> Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Also, I believe we need to take a look at ARCH_SOC_ID support coming up in
> 5.9 kernel.
> 
> https://lore.kernel.org/linux-arm-kernel/20200506164411.3284-1-
> sudeep.holla@arm.com/

Agree, it can come after this series is merged.

Note that it requires firmware with SMCCC v1.2 support in the underlying platform.

> 
> >Juraj Linkeš (12):
> >  build: rename Arm build variables
> >  build: remove unused or superfluous variables
> >  build: reformat and move Arm config and comments
> >  build: simplify how Arm flags are processed
> >  build: organize Arm config into dict
> >  build: isolate configuration for Arm generic build
> >  build: use native machine args in Arm native build
> >  build: add core and NUMA counts to cross files
> >  build: disable drivers in Arm builds
> >  build: disable libnuma in cross builds
> >  build: add Arm SoC meson option
> >  config: fix Arm implementer and its SoCs
> >
> > config/arm/arm64_armada_linux_gcc             |   2 +-
> > config/arm/arm64_armv8_linux_gcc              |  15 +-
> > config/arm/arm64_bluefield_linux_gcc          |   3 +-
> > config/arm/arm64_dpaa_linux_gcc               |   2 +-
> > config/arm/arm64_emag_linux_gcc               |   2 +-
> > config/arm/arm64_graviton2_linux_gcc          |   3 +-
> > config/arm/arm64_n1sdp_linux_gcc              |   3 +-
> > config/arm/arm64_octeontx2_linux_gcc          |   3 +-
> > config/arm/arm64_stingray_linux_gcc           |   3 +-
> > config/arm/arm64_thunderx2_linux_gcc          |   3 +-
> > ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
> > config/arm/meson.build                        | 502 ++++++++++++------
> > config/meson.build                            |  34 +-
> > .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 ++
> > drivers/meson.build                           |   6 +-
> > meson.build                                   |   1 +
> > meson_options.txt                             |   2 +
> > 17 files changed, 413 insertions(+), 203 deletions(-)  rename
> >config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc}
> >(92%)
> >
> >--
> >2.20.1


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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-04 22:46                                 ` Andrew Boyer
@ 2021-01-06 13:40                                   ` Bruce Richardson
  2021-01-08 17:36                                   ` Bruce Richardson
  2021-01-12  8:28                                   ` Juraj Linkeš
  2 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2021-01-06 13:40 UTC (permalink / raw)
  To: Andrew Boyer
  Cc: Honnappa Nagarahalli, thomas, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd

On Mon, Jan 04, 2021 at 05:46:20PM -0500, Andrew Boyer wrote:
> 
> > On Jan 1, 2021, at 12:19 PM, Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com> wrote:
> >> 
> >> 30/12/2020 20:09, Andrew Boyer:
> >>> 
> >>>> On Dec 23, 2020, at 6:47 AM, Juraj Linkeš <juraj.linkes@pantheon.tech>
> >> wrote:
> >>>> 
> >>>> The current way of specifying Arm configuration options is
> >>>> insufficient since we can't identify the SoC we're building for from
> >>>> the MIDR information. For example, we can't distinguish between
> >>>> N1SDP, Graviton2 or Ampere Altra.
> >>>> 
> >>>> Add a way to specify the cpu count and numa node count for cross
> >>>> builds and aarch64 -> aarch64 (SoC) builds.
> >>>> 
> >>> 
> >>> Hello Juraj,
> >>> This is great, you have solved a problem for me before I even knew
> >>> there was one. (We have two SoCs with the same id and pn, but
> >>> different core counts etc.)
> >>> 
> >>> Can anyone fill me in on how and when this patchset is going to be taken?
> >> Will it go to dpdk-next-net, or to some other branch?
> >> 
> >> It should go in the main branch.
> >> I cannot commit on any date, but for sure it would help if you can do a
> >> detailed review, thanks.
> > Testing on your SoC would be of great help.
> > 
> 
> Hello Honnappa, Juraj, and Bruce,
> 
> I've got most of the build working under meson. A few questions:
> 
> 1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build fails with this error. It’s been broken for a long time; maybe this option isn’t supported and should be blocked earlier?
> 

Yes, we should catch this earlier.

> 	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown variable "both_rte_ethdev".
> 
> 2) Is there a way to disable specific libraries? I’ve pruned down the list of drivers, which is great. This feature existed under make but I don’t see anything about it in meson yet.
> 
> 3) We need to build kni against the aarch64 kernel headers, but it fails. It appears that kernel/linux/kni/meson.build doesn’t pass any cross-compile flags in the make command it creates. The diff below shows how I hardcoded it to get it to work for now. Thoughts on how to do this right? meson has the path (in $PATH) and the binary prefixs (in ‘[binaries]’ in the cross file). It must know the arch, too.
> 

I'll try and investigate a little on these. Patches welcome, especially for
issue #3 which is new to me.
For #2, there has been some previous discussion about this on list before.

/Bruce

> --- a/kernel/linux/kni/meson.build
> +++ b/kernel/linux/kni/meson.build
> @@ -14,6 +14,8 @@ custom_target('rte_kni',
>         input: kni_sources,
>         output: 'rte_kni.ko',
>         command: ['make', '-j4', '-C', kernel_dir + '/build',
> +               'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux-gnu-',
> +               'ARCH=aarch64',
>                 'M=' + meson.current_build_dir(),
>                 'src=' + meson.current_source_dir(),
>                 'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' +
> 
> I will try to get to a full review soon.
> 
> Thank you,
> Andrew

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-04 22:46                                 ` Andrew Boyer
  2021-01-06 13:40                                   ` Bruce Richardson
@ 2021-01-08 17:36                                   ` Bruce Richardson
  2021-01-08 20:20                                     ` Honnappa Nagarahalli
  2021-01-12  8:28                                   ` Juraj Linkeš
  2 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-01-08 17:36 UTC (permalink / raw)
  To: Andrew Boyer
  Cc: Honnappa Nagarahalli, thomas, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, bluca, david.marchand, kevin.traynor

On Mon, Jan 04, 2021 at 05:46:20PM -0500, Andrew Boyer wrote:
> 
> 1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build fails with this error. It’s been broken for a long time; maybe this option isn’t supported and should be blocked earlier?
> 
> 	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown variable "both_rte_ethdev".
> 
Revisiting this point, since there are a number of possible approaches we
can take here, and I'd like feedback on them before we do anything. Of
these approaches, 2 are simple, and 1 is more complicated.

1. We can just detect this as an invalid/unsupported setting and error out
earlier with a suitable errors message
2. Since we already support in all cases building "both" libraries, we can
just convert "both" to be the same as "shared" for app linking (since app
linking is all the value is actually used for by us)
3. We can change how we do the builds to actually repect the value as
intended - only build static or shared libs as requested and only build
both when value "both" is passed.

Of these, #3 is obviously the most work, but may make the most sense to
users. However, it does have the following open issues - which are all linked:
1. What way do we make the default linkage in the case of "both" being
selected?
2. What do we make the default for builds?
3. Is there ever a case where someone needs both libraries build but
non-default linkage?

The initial answers I thought for these would be that the default for
"both" builds should be "shared", and that "both" should be the default.
However, that then is a behaviour change for DPDK since we don't get
static binaries by default. The solution to that is that we change the
default to "static", but then we revert to the situation we used to have
with the make build where we regularly got patches upstreamed which failed
to build with shared libs because the map file update was missing and the
submitter never tested shared builds. The third alternative there is that
we default to "both" but have "static" binaries when that is selected. That
option runs against question #3 where I suspect there will be cases (e.g.
packaging) where one does want both library sets generated but shared
binaries.

Therefore, is keeping things largely as they are and taking the simpler
options #1 or #2 better? Do we want to look into #3 but with further
additions such as a "default_app_linkage" DPDK option, or linking all apps
twice when "both" is specified as "default_library"?

Feedback welcome please.

/Bruce

PS: For background, when the DPDK transition to meson started, there
wasn't a "both" option which is why this is not the best supported. :-)

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-08 17:36                                   ` Bruce Richardson
@ 2021-01-08 20:20                                     ` Honnappa Nagarahalli
  2021-01-11  9:38                                       ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-08 20:20 UTC (permalink / raw)
  To: Bruce Richardson, Andrew Boyer
  Cc: thomas, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, bluca, david.marchand, kevin.traynor, nd, nd

<snip>

> 
> On Mon, Jan 04, 2021 at 05:46:20PM -0500, Andrew Boyer wrote:
> >
> > 1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build
> fails with this error. It’s been broken for a long time; maybe this option isn’t
> supported and should be blocked earlier?
> >
> > 	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown
> variable "both_rte_ethdev".
> >
> Revisiting this point, since there are a number of possible approaches we can
> take here, and I'd like feedback on them before we do anything. Of these
> approaches, 2 are simple, and 1 is more complicated.
> 
> 1. We can just detect this as an invalid/unsupported setting and error out
> earlier with a suitable errors message 2. Since we already support in all cases
I would prefer option 1 here (detect and error out). IMO, the option "both" does not seem to solve a compelling problem. I would prefer to avoid the additional code and complications. Mostly, everyone would do the development with either 'static' or 'shared' and test the other at the end when the development is completed.

> building "both" libraries, we can just convert "both" to be the same as
> "shared" for app linking (since app linking is all the value is actually used for
I do not think option 2 solves the problem completely. i.e. if the user specifies 'both', app needs to be built for both static and shared libraries.

> by us) 3. We can change how we do the builds to actually repect the value as
> intended - only build static or shared libs as requested and only build both
> when value "both" is passed.
> 
> Of these, #3 is obviously the most work, but may make the most sense to
> users. However, it does have the following open issues - which are all linked:
> 1. What way do we make the default linkage in the case of "both" being
> selected?
> 2. What do we make the default for builds?
> 3. Is there ever a case where someone needs both libraries build but non-
> default linkage?
> 
> The initial answers I thought for these would be that the default for "both"
> builds should be "shared", and that "both" should be the default.
> However, that then is a behaviour change for DPDK since we don't get static
> binaries by default. The solution to that is that we change the default to
> "static", but then we revert to the situation we used to have with the make
> build where we regularly got patches upstreamed which failed to build with
> shared libs because the map file update was missing and the submitter never
> tested shared builds.
I have been one among submitting the patches without testing for shared libraries. But, I am thinking that we have a good CI now that compiles for various combinations. I think that should be enough.

The third alternative there is that we default to "both"
> but have "static" binaries when that is selected. That option runs against
> question #3 where I suspect there will be cases (e.g.
> packaging) where one does want both library sets generated but shared
> binaries.
> 
> Therefore, is keeping things largely as they are and taking the simpler options
> #1 or #2 better? Do we want to look into #3 but with further additions such
> as a "default_app_linkage" DPDK option, or linking all apps twice when
> "both" is specified as "default_library"?
I would say stick with #1 as there is not a compelling problem to solve.

> 
> Feedback welcome please.
> 
> /Bruce
> 
> PS: For background, when the DPDK transition to meson started, there
> wasn't a "both" option which is why this is not the best supported. :-)

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-08 20:20                                     ` Honnappa Nagarahalli
@ 2021-01-11  9:38                                       ` Thomas Monjalon
  2021-01-11 10:01                                         ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-11  9:38 UTC (permalink / raw)
  To: Bruce Richardson, Honnappa Nagarahalli
  Cc: Andrew Boyer, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, bluca, david.marchand, kevin.traynor

08/01/2021 21:20, Honnappa Nagarahalli:
> > On Mon, Jan 04, 2021 at 05:46:20PM -0500, Andrew Boyer wrote:
> > >
> > > 1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build
> > fails with this error. It’s been broken for a long time; maybe this option isn’t
> > supported and should be blocked earlier?
> > >
> > > 	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown
> > variable "both_rte_ethdev".
> > >
> > Revisiting this point, since there are a number of possible approaches we can
> > take here, and I'd like feedback on them before we do anything. Of these
> > approaches, 2 are simple, and 1 is more complicated.
> > 
> > 1. We can just detect this as an invalid/unsupported setting and error out
> > earlier with a suitable errors message 2. Since we already support in all cases
> 
> I would prefer option 1 here (detect and error out). IMO, the option "both" does not seem to solve a compelling problem. I would prefer to avoid the additional code and complications. Mostly, everyone would do the development with either 'static' or 'shared' and test the other at the end when the development is completed.

+1 for not supporting linking with both.


> > building "both" libraries, we can just convert "both" to be the same as
> > "shared" for app linking (since app linking is all the value is actually used for
> I do not think option 2 solves the problem completely. i.e. if the user specifies 'both', app needs to be built for both static and shared libraries.
> 
> > by us) 3. We can change how we do the builds to actually repect the value as
> > intended - only build static or shared libs as requested and only build both
> > when value "both" is passed.
> > 
> > Of these, #3 is obviously the most work, but may make the most sense to
> > users. However, it does have the following open issues - which are all linked:
> > 1. What way do we make the default linkage in the case of "both" being
> > selected?
> > 2. What do we make the default for builds?
> > 3. Is there ever a case where someone needs both libraries build but non-
> > default linkage?
> > 
> > The initial answers I thought for these would be that the default for "both"
> > builds should be "shared", and that "both" should be the default.
> > However, that then is a behaviour change for DPDK since we don't get static
> > binaries by default. The solution to that is that we change the default to
> > "static", but then we revert to the situation we used to have with the make
> > build where we regularly got patches upstreamed which failed to build with
> > shared libs because the map file update was missing and the submitter never
> > tested shared builds.
> 
> I have been one among submitting the patches without testing for shared libraries. But, I am thinking that we have a good CI now that compiles for various combinations. I think that should be enough.
> 
> > The third alternative there is that we default to "both"
> > but have "static" binaries when that is selected. That option runs against
> > question #3 where I suspect there will be cases (e.g.
> > packaging) where one does want both library sets generated but shared
> > binaries.
> > 
> > Therefore, is keeping things largely as they are and taking the simpler options
> > #1 or #2 better? Do we want to look into #3 but with further additions such
> > as a "default_app_linkage" DPDK option, or linking all apps twice when
> > "both" is specified as "default_library"?
> 
> I would say stick with #1 as there is not a compelling problem to solve.

me too
And I want to avoid linking static apps by default because they are huge.




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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-11  9:38                                       ` Thomas Monjalon
@ 2021-01-11 10:01                                         ` Bruce Richardson
  2021-01-11 16:16                                           ` Andrew Boyer
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-01-11 10:01 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Honnappa Nagarahalli, Andrew Boyer, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, bluca, david.marchand, kevin.traynor

On Mon, Jan 11, 2021 at 10:38:09AM +0100, Thomas Monjalon wrote:
> 08/01/2021 21:20, Honnappa Nagarahalli:
> > > On Mon, Jan 04, 2021 at 05:46:20PM -0500, Andrew Boyer wrote:
> > > >
> > > > 1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build
> > > fails with this error. It’s been broken for a long time; maybe this option isn’t
> > > supported and should be blocked earlier?
> > > >
> > > > 	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown
> > > variable "both_rte_ethdev".
> > > >
> > > Revisiting this point, since there are a number of possible approaches we can
> > > take here, and I'd like feedback on them before we do anything. Of these
> > > approaches, 2 are simple, and 1 is more complicated.
> > > 
> > > 1. We can just detect this as an invalid/unsupported setting and error out
> > > earlier with a suitable errors message 2. Since we already support in all cases
> > 
> > I would prefer option 1 here (detect and error out). IMO, the option "both" does not seem to solve a compelling problem. I would prefer to avoid the additional code and complications. Mostly, everyone would do the development with either 'static' or 'shared' and test the other at the end when the development is completed.
> 
> +1 for not supporting linking with both.
> 
Ok, thanks for the clear consensus. Will do patch to check and error out
appropriately.

/Bruce

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-11 10:01                                         ` Bruce Richardson
@ 2021-01-11 16:16                                           ` Andrew Boyer
  2021-01-11 16:59                                             ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Andrew Boyer @ 2021-01-11 16:16 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Thomas Monjalon, Honnappa Nagarahalli, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, bluca, david.marchand, kevin.traynor



> On Jan 11, 2021, at 5:01 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> 
> On Mon, Jan 11, 2021 at 10:38:09AM +0100, Thomas Monjalon wrote:
>> 08/01/2021 21:20, Honnappa Nagarahalli:
>>>> On Mon, Jan 04, 2021 at 05:46:20PM -0500, Andrew Boyer wrote:
>>>>> 
>>>>> 1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build
>>>> fails with this error. It’s been broken for a long time; maybe this option isn’t
>>>> supported and should be blocked earlier?
>>>>> 
>>>>> 	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown
>>>> variable "both_rte_ethdev".
>>>>> 
>>>> Revisiting this point, since there are a number of possible approaches we can
>>>> take here, and I'd like feedback on them before we do anything. Of these
>>>> approaches, 2 are simple, and 1 is more complicated.
>>>> 
>>>> 1. We can just detect this as an invalid/unsupported setting and error out
>>>> earlier with a suitable errors message 2. Since we already support in all cases
>>> 
>>> I would prefer option 1 here (detect and error out). IMO, the option "both" does not seem to solve a compelling problem. I would prefer to avoid the additional code and complications. Mostly, everyone would do the development with either 'static' or 'shared' and test the other at the end when the development is completed.
>> 
>> +1 for not supporting linking with both.
>> 
> Ok, thanks for the clear consensus. Will do patch to check and error out
> appropriately.
> 
> /Bruce

It would be great if the error message for “both” pointed out that both sets of libraries are built in the “shared” case.
e.g.
‘Error: ‘both’ unsupported. ‘shared’ will build both static and shared libraries and dynamically-linked binaries. ‘static’ will build only static libraries and statically-linked binaries.’

-Andrew

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-11 16:16                                           ` Andrew Boyer
@ 2021-01-11 16:59                                             ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2021-01-11 16:59 UTC (permalink / raw)
  To: Andrew Boyer
  Cc: Thomas Monjalon, Honnappa Nagarahalli, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, bluca, david.marchand, kevin.traynor

On Mon, Jan 11, 2021 at 11:16:38AM -0500, Andrew Boyer wrote:
>    On Jan 11, 2021, at 5:01 AM, Bruce Richardson
>    <[1]bruce.richardson@intel.com> wrote:
> 
>    On Mon, Jan 11, 2021 at 10:38:09AM +0100, Thomas Monjalon wrote:
> 
>      08/01/2021 21:20, Honnappa Nagarahalli:
> 
>      On Mon, Jan 04, 2021 at 05:46:20PM -0500, Andrew Boyer wrote:
> 
>      1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the
>      build
> 
>      fails with this error. It’s been broken for a long time; maybe this
>      option isn’t
>      supported and should be blocked earlier?
> 
>      ../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown
> 
>      variable "both_rte_ethdev".
> 
>      Revisiting this point, since there are a number of possible
>      approaches we can
>      take here, and I'd like feedback on them before we do anything. Of
>      these
>      approaches, 2 are simple, and 1 is more complicated.
>      1. We can just detect this as an invalid/unsupported setting and
>      error out
>      earlier with a suitable errors message 2. Since we already support
>      in all cases
> 
>      I would prefer option 1 here (detect and error out). IMO, the option
>      "both" does not seem to solve a compelling problem. I would prefer
>      to avoid the additional code and complications. Mostly, everyone
>      would do the development with either 'static' or 'shared' and test
>      the other at the end when the development is completed.
> 
>      +1 for not supporting linking with both.
> 
>    Ok, thanks for the clear consensus. Will do patch to check and error
>    out
>    appropriately.
>    /Bruce
> 
>    It would be great if the error message for “both” pointed out that both
>    sets of libraries are built in the “shared” case.
> 
>    e.g.
> 
>    ‘Error: ‘both’ unsupported. ‘shared’ will build both static and shared
>    libraries and dynamically-linked binaries. ‘static’ will build only
>    static libraries and statically-linked binaries.’
> 
Actually "static" builds both libraries also, so default_library only
affects the linking of apps/examples in the DPDK build itself. I've put
that info in the patch error message as you suggested.

/Bruce

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

* Re: [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds
  2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds Juraj Linkeš
@ 2021-01-11 20:22                           ` Andrew Boyer
  2021-01-12  6:54                             ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Andrew Boyer @ 2021-01-11 20:22 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Bruce Richardson, Ruifeng Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> On Nov 20, 2020, at 7:08 AM, Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
> 
> Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
> for cross build and disable NUMA in Arm cross files.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
> config/arm/arm64_armada_linux_gcc             |  1 +
> config/arm/arm64_bluefield_linux_gcc          |  1 +
> config/arm/arm64_dpaa_linux_gcc               |  1 +
> config/arm/arm64_graviton2_linux_gcc          |  1 +
> config/arm/arm64_n1sdp_linux_gcc              |  1 +
> config/arm/arm64_octeontx2_linux_gcc          |  1 +
> config/arm/arm64_stingray_linux_gcc           |  1 +
> config/arm/meson.build                        |  2 --
> config/meson.build                            | 19 +++++++++++++------
> .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
> 10 files changed, 24 insertions(+), 8 deletions(-)
> 
> ...
> diff --git a/config/meson.build b/config/meson.build
> index 2bff6137f..9583be4ab 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -142,12 +142,19 @@ endif
> 
> # check for libraries used in multiple places in DPDK
> has_libnuma = 0
> -numa_dep = cc.find_library('numa', required: false)
> -if numa_dep.found() and cc.has_header('numaif.h')
> -	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> -	has_libnuma = 1
> -	add_project_link_arguments('-lnuma', language: 'c')
> -	dpdk_extra_ldflags += '-lnuma'
> +find_libnuma = true
> +if meson.is_cross_build() and not meson.get_cross_property('numa', true)
> +	# don't look for libnuma if explicitly disabled in cross build
> +	check_libnuma = false
> +endif

Looks like ‘check_libnuma’ should be ‘find_libnuma’. There are no other references to ‘check_libnuma’.

-Andrew

> +if find_libnuma
> +	numa_dep = cc.find_library('numa', required: false)
> +	if numa_dep.found() and cc.has_header('numaif.h')
> +		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> +		has_libnuma = 1
> +		add_project_link_arguments('-lnuma', language: 'c')
> +		dpdk_extra_ldflags += '-lnuma'
> +	endif
> endif
> 
> ...


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

* Re: [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config and comments
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config and comments Juraj Linkeš
@ 2021-01-11 20:26                             ` Andrew Boyer
  2021-01-12  8:12                               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Andrew Boyer @ 2021-01-11 20:26 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Bruce Richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> On Dec 23, 2020, at 6:47 AM, Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
> 
> Change formatting so that it's more consistent and readable, add/modify
> comments/stdout messages, move configuration options to more appropriate
> places and make the order consistent according to these rules:
> 1. First list generic configuration options, then list options that may
>   be overwritten. List SoC-specific options last.
> 2. For SoC-specific options, list number of cores before the number of
>   NUMA nodes, to make it consistent with config/meson.build.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
> config/arm/arm64_armv8_linux_gcc              | 12 +--
> config/arm/meson.build                        | 96 +++++++++++--------
> .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
> 3 files changed, 93 insertions(+), 49 deletions(-)
> 
> ...
> @@ -22,69 +23,86 @@ flags_common = [
> 
> 	['RTE_SCHED_VECTOR', false],
> 	['RTE_ARM_USE_WFE', false],
> +	['RTE_ARCH_ARM64', true],
> +	['RTE_CACHE_LINE_SIZE', 128]
> ]
> 
> +# implementer specific aarch64 flags, with middle priority
> +# (will overwrite common flags)
> flags_implementer_generic = [
> 	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_MAX_LCORE', 256],
> 	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 128]]
> +	['RTE_CACHE_LINE_SIZE', 128],
> +	['RTE_MAX_LCORE', 256]
> +]
> ...

All of these other instances of [‘RTE_CACHE_LINE_SIZE’, 128] are just repeating the values from flags_common. Would it be clearer to omit the duplicates?

I can imagine a case where SoC uses 128, overriding implementer value of 64, overriding default value of 128 - but is that worth worrying about?

-Andrew

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

* Re: [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds
  2021-01-11 20:22                           ` Andrew Boyer
@ 2021-01-12  6:54                             ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-12  6:54 UTC (permalink / raw)
  To: Andrew Boyer
  Cc: Bruce Richardson, Ruifeng Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Andrew Boyer <aboyer@pensando.io>
> Sent: Monday, January 11, 2021 9:23 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds
> 
> 
> 
> > On Nov 20, 2020, at 7:08 AM, Juraj Linkeš <juraj.linkes@pantheon.tech>
> wrote:
> >
> > Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
> > for cross build and disable NUMA in Arm cross files.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > ---
> > config/arm/arm64_armada_linux_gcc             |  1 +
> > config/arm/arm64_bluefield_linux_gcc          |  1 +
> > config/arm/arm64_dpaa_linux_gcc               |  1 +
> > config/arm/arm64_graviton2_linux_gcc          |  1 +
> > config/arm/arm64_n1sdp_linux_gcc              |  1 +
> > config/arm/arm64_octeontx2_linux_gcc          |  1 +
> > config/arm/arm64_stingray_linux_gcc           |  1 +
> > config/arm/meson.build                        |  2 --
> > config/meson.build                            | 19 +++++++++++++------
> > .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
> > 10 files changed, 24 insertions(+), 8 deletions(-)
> >
> > ...
> > diff --git a/config/meson.build b/config/meson.build index
> > 2bff6137f..9583be4ab 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -142,12 +142,19 @@ endif
> >
> > # check for libraries used in multiple places in DPDK has_libnuma = 0
> > -numa_dep = cc.find_library('numa', required: false) -if
> > numa_dep.found() and cc.has_header('numaif.h')
> > -	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> > -	has_libnuma = 1
> > -	add_project_link_arguments('-lnuma', language: 'c')
> > -	dpdk_extra_ldflags += '-lnuma'
> > +find_libnuma = true
> > +if meson.is_cross_build() and not meson.get_cross_property('numa', true)
> > +	# don't look for libnuma if explicitly disabled in cross build
> > +	check_libnuma = false
> > +endif
> 
> Looks like ‘check_libnuma’ should be ‘find_libnuma’. There are no other
> references to ‘check_libnuma’.
> 

I thought I fixed this already, but it is in v14 as well, good catch.

> -Andrew
> 
> > +if find_libnuma
> > +	numa_dep = cc.find_library('numa', required: false)
> > +	if numa_dep.found() and cc.has_header('numaif.h')
> > +		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
> > +		has_libnuma = 1
> > +		add_project_link_arguments('-lnuma', language: 'c')
> > +		dpdk_extra_ldflags += '-lnuma'
> > +	endif
> > endif
> >
> > ...
> 


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

* Re: [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config and comments
  2021-01-11 20:26                             ` Andrew Boyer
@ 2021-01-12  8:12                               ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-12  8:12 UTC (permalink / raw)
  To: Andrew Boyer
  Cc: Bruce Richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, dev



> -----Original Message-----
> From: Andrew Boyer <aboyer@pensando.io>
> Sent: Monday, January 11, 2021 9:27 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config
> and comments
> 
> 
> 
> > On Dec 23, 2020, at 6:47 AM, Juraj Linkeš <juraj.linkes@pantheon.tech>
> wrote:
> >
> > Change formatting so that it's more consistent and readable,
> > add/modify comments/stdout messages, move configuration options to
> > more appropriate places and make the order consistent according to these
> rules:
> > 1. First list generic configuration options, then list options that may
> >   be overwritten. List SoC-specific options last.
> > 2. For SoC-specific options, list number of cores before the number of
> >   NUMA nodes, to make it consistent with config/meson.build.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > ---
> > config/arm/arm64_armv8_linux_gcc              | 12 +--
> > config/arm/meson.build                        | 96 +++++++++++--------
> > .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 34 +++++++
> > 3 files changed, 93 insertions(+), 49 deletions(-)
> >
> > ...
> > @@ -22,69 +23,86 @@ flags_common = [
> >
> > 	['RTE_SCHED_VECTOR', false],
> > 	['RTE_ARM_USE_WFE', false],
> > +	['RTE_ARCH_ARM64', true],
> > +	['RTE_CACHE_LINE_SIZE', 128]
> > ]
> >
> > +# implementer specific aarch64 flags, with middle priority # (will
> > +overwrite common flags)
> > flags_implementer_generic = [
> > 	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_MAX_LCORE', 256],
> > 	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 128]]
> > +	['RTE_CACHE_LINE_SIZE', 128],
> > +	['RTE_MAX_LCORE', 256]
> > +]
> > ...
> 
> All of these other instances of [‘RTE_CACHE_LINE_SIZE’, 128] are just repeating
> the values from flags_common. Would it be clearer to omit the duplicates?
> 

Overwriting the same value doesn't make much sense and it doesn't even add to readability (as it could easily confuse people), so I'll remove these.

> I can imagine a case where SoC uses 128, overriding implementer value of 64,
> overriding default value of 128 - but is that worth worrying about?
> 

The whole series actually addresses this - it's possible to do that in the "build: add Arm SoC meson option" commit.

> -Andrew

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-04 22:46                                 ` Andrew Boyer
  2021-01-06 13:40                                   ` Bruce Richardson
  2021-01-08 17:36                                   ` Bruce Richardson
@ 2021-01-12  8:28                                   ` Juraj Linkeš
  2021-01-29  8:41                                     ` Juraj Linkeš
  2 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-12  8:28 UTC (permalink / raw)
  To: Andrew Boyer, Honnappa Nagarahalli
  Cc: thomas, bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd



> -----Original Message-----
> From: Andrew Boyer <aboyer@pensando.io>
> Sent: Monday, January 4, 2021 11:46 PM
> To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Cc: thomas@monjalon.net; Juraj Linkeš <juraj.linkes@pantheon.tech>;
> bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil
> Yang <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com; dev@dpdk.org; nd
> <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
> 
> 
> > On Jan 1, 2021, at 12:19 PM, Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com> wrote:
> >>
> >> 30/12/2020 20:09, Andrew Boyer:
> >>>
> >>>> On Dec 23, 2020, at 6:47 AM, Juraj Linkeš
> >>>> <juraj.linkes@pantheon.tech>
> >> wrote:
> >>>>
> >>>> The current way of specifying Arm configuration options is
> >>>> insufficient since we can't identify the SoC we're building for
> >>>> from the MIDR information. For example, we can't distinguish
> >>>> between N1SDP, Graviton2 or Ampere Altra.
> >>>>
> >>>> Add a way to specify the cpu count and numa node count for cross
> >>>> builds and aarch64 -> aarch64 (SoC) builds.
> >>>>
> >>>
> >>> Hello Juraj,
> >>> This is great, you have solved a problem for me before I even knew
> >>> there was one. (We have two SoCs with the same id and pn, but
> >>> different core counts etc.)
> >>>
> >>> Can anyone fill me in on how and when this patchset is going to be taken?
> >> Will it go to dpdk-next-net, or to some other branch?
> >>
> >> It should go in the main branch.
> >> I cannot commit on any date, but for sure it would help if you can do
> >> a detailed review, thanks.
> > Testing on your SoC would be of great help.
> >
> 
> Hello Honnappa, Juraj, and Bruce,
> 

Let me add my 2 cents.

> I've got most of the build working under meson. A few questions:
> 
> 1)  Bruce - when the “-Ddefault_library=both” flag is passed in, the build fails
> with this error. It’s been broken for a long time; maybe this option isn’t
> supported and should be blocked earlier?
> 
> 	../../dpdk/app/meson.build:48:3: ERROR: Tried to get unknown variable
> "both_rte_ethdev".
> 

This doesn't seem like an arm specific problem. I understand Bruce is already working on a patch, so won't do anything with this in this series.

> 2) Is there a way to disable specific libraries? I’ve pruned down the list of drivers,
> which is great. This feature existed under make but I don’t see anything about it
> in meson yet.
> 

We're missing an arch agnostic way to disable these, so there's no support for it in this series. When that exists we can use that to disable libs for arm socs.

There was some discussion about this in http://patches.dpdk.org/patch/78077/, but maybe there's more.

> 3) We need to build kni against the aarch64 kernel headers, but it fails. It
> appears that kernel/linux/kni/meson.build doesn’t pass any cross-compile flags
> in the make command it creates. The diff below shows how I hardcoded it to get
> it to work for now. Thoughts on how to do this right? meson has the path (in
> $PATH) and the binary prefixs (in ‘[binaries]’ in the cross file). It must know the
> arch, too.
> 
> --- a/kernel/linux/kni/meson.build
> +++ b/kernel/linux/kni/meson.build
> @@ -14,6 +14,8 @@ custom_target('rte_kni',
>         input: kni_sources,
>         output: 'rte_kni.ko',
>         command: ['make', '-j4', '-C', kernel_dir + '/build',
> +               'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux-
> gnu-',
> +               'ARCH=aarch64',
>                 'M=' + meson.current_build_dir(),
>                 'src=' + meson.current_source_dir(),
>                 'MODULE_CFLAGS=-include ' + meson.source_root() +
> '/config/rte_config.h' +
> 

Yes, Meson should know these. I'll submit this separately (in a new series), as this series is getting pretty big and this fix is actually unrelated.

> I will try to get to a full review soon.
> 
> Thank you,
> Andrew

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

* Re: [dpdk-dev] [PATCH v14 05/12] build: organize Arm config into dict
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 05/12] build: organize Arm config into dict Juraj Linkeš
@ 2021-01-15  8:38                             ` Ruifeng Wang
  2021-01-15 12:18                               ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Ruifeng Wang @ 2021-01-15  8:38 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, December 23, 2020 7:48 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v14 05/12] build: organize Arm config into dict
> 
> Use dictionary lookup instead of checking for existing variables, iterating over
> all elements in the list or checking lists for optional configuration. Move
> variable contents into the dictionary for variables that would be referenced
> only once.
> Fallback to generic part number if the discovered part number is unknown.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  config/arm/meson.build | 298 ++++++++++++++++++++++++-----------------
>  1 file changed, 178 insertions(+), 120 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> fb877fe77..b449b10c3 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -27,115 +27,166 @@ flags_common = [
>  	['RTE_CACHE_LINE_SIZE', 128]
>  ]
> 
> -# implementer specific aarch64 flags, with middle priority -# (will overwrite
> common flags) -flags_implementer_generic = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 256]
> -]
> -flags_implementer_arm = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16]
> -]
> -flags_implementer_cavium = [
> -	['RTE_MAX_VFIO_GROUPS', 128],
> -	['RTE_CACHE_LINE_SIZE', 128],
> -	['RTE_MAX_LCORE', 96],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_implementer_dpaa = [
> -	['RTE_MACHINE', '"dpaa"'],
> -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_emag = [
> -	['RTE_MACHINE', '"emag"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 32],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_armada = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> +## Part numbers are specific to Arm implementers # implementer specific
> +aarch64 flags have middle priority
> +#     (will overwrite common flags)
> +# part number specific aarch64 flags have the highest priority
> +#     (will overwrite both common and implementer specific flags)
> +implementer_generic = {
> +	'description': 'Generic armv8',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 128],
> +		['RTE_MAX_LCORE', 256]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args': ['-march=armv8-a+crc',
> +					     '-moutline-atomics']}
> +	}
> +}
> +
> +part_number_config_arm = {
> +	'generic': {'machine_args':  ['-march=armv8-a+crc',
> +				      '-moutline-atomics']},
> +	'native': {'machine_args':  ['-march=native']},
> +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> +	'0xd0c': {
> +		'machine_args':  ['-march=armv8.2-a+crypto',
> +				  '-mcpu=neoverse-n1'],
> +		'flags': [
> +			['RTE_MACHINE', '"neoverse-n1"'],
> +			['RTE_ARM_FEATURE_ATOMICS', true],
> +			['RTE_USE_C11_MEM_MODEL', true],
This duplicates what in implementer flags.
Can we remove it?

> +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> +			['RTE_LIBRTE_VHOST_NUMA', false],
> +			['RTE_MAX_MEM_MB', 1048576],
> +			['RTE_CACHE_LINE_SIZE', 64],
Also this one.

> +			['RTE_MAX_LCORE', 64],
Do you want to change this to 80?
Ampere Altra SoC has 80 N1 cores.

> +			['RTE_MAX_NUMA_NODES', 1]
> +		]
> +	}
> +}
> +implementer_arm = {
> +	'description': 'Arm',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16]
> +	],
> +	'part_number_config': part_number_config_arm }
> 
> -# part number specific aarch64 flags, with highest priority -# (will overwrite
> both common and implementer specific flags)  flags_part_number_thunderx
> = [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]
>  ]
> -flags_part_number_thunderx2 = [
> -	['RTE_MACHINE', '"thunderx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 256],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_part_number_octeontx2 = [
> -	['RTE_MACHINE', '"octeontx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_IGB_UIO', false],
> -	['RTE_MAX_LCORE', 36],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_part_number_n1generic = [
> -	['RTE_MACHINE', '"neoverse-n1"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false],
> -	['RTE_MAX_MEM_MB', 1048576],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 64],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> +implementer_cavium = {
> +	'description': 'Cavium',
> +	'flags': [
> +		['RTE_MAX_VFIO_GROUPS', 128],
> +		['RTE_CACHE_LINE_SIZE', 128],
> +		['RTE_MAX_LCORE', 96],
> +		['RTE_MAX_NUMA_NODES', 2]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
> +					     '-mcpu=thunderx']},
> +		'native': {'machine_args': ['-march=native']},
> +		'0xa1': {
> +			'machine_args': ['-mcpu=thunderxt88'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xa2': {
> +			'machine_args': ['-mcpu=thunderxt81'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xa3': {
> +			'machine_args': ['-mcpu=thunderxt83'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xaf': {
> +			'machine_args': ['-march=armv8.1-a+crc+crypto',
> +					 '-mcpu=thunderx2t99'],
> +			'flags': [
> +				['RTE_MACHINE', '"thunderx2"'],
> +				['RTE_ARM_FEATURE_ATOMICS', true],
> +				['RTE_USE_C11_MEM_MODEL', true],
> +				['RTE_CACHE_LINE_SIZE', 64],
> +				['RTE_MAX_LCORE', 256],
> +				['RTE_MAX_NUMA_NODES', 2]
> +			]
> +		},
> +		'0xb2': {
> +			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
> +					 '-mcpu=octeontx2'],
> +			'flags': [
> +				['RTE_MACHINE', '"octeontx2"'],
> +				['RTE_ARM_FEATURE_ATOMICS', true],
> +				['RTE_USE_C11_MEM_MODEL', true],
> +				['RTE_EAL_IGB_UIO', false],
> +				['RTE_MAX_LCORE', 36],
> +				['RTE_MAX_NUMA_NODES', 1]
> +			]
> +		}
> +	}
> +}
> 
> -# arm config (implementer 0x41) is the default config -
> part_number_config_arm = [
> -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> -	['native', ['-march=native']],
> -	['0xd03', ['-mcpu=cortex-a53']],
> -	['0xd04', ['-mcpu=cortex-a35']],
> -	['0xd07', ['-mcpu=cortex-a57']],
> -	['0xd08', ['-mcpu=cortex-a72']],
> -	['0xd09', ['-mcpu=cortex-a73']],
> -	['0xd0a', ['-mcpu=cortex-a75']],
> -	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> flags_part_number_n1generic]
> -]
> -part_number_config_cavium = [
> -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> -	['native', ['-march=native']],
> -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_part_number_thunderx2],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_part_number_octeontx2]
> -]
> -part_number_config_emag = [
> -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]
> -]
> +implementer_ampere = {
> +	'description': 'Ampere Computing',
> +	'flags': [
> +		['RTE_MACHINE', '"emag"'],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 32],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
> +					      '-mtune=emag']},
> +		'native': {'machine_args':  ['-march=native']}
> +	}
> +}
> +
> +implementer_marvell = {
> +	'description': 'Marvell ARMADA',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': part_number_config_arm }
> +
> +implementer_dpaa = {
> +	'description': 'NXP DPAA',
> +	'flags': [
> +		['RTE_MACHINE', '"dpaa"'],
> +		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': part_number_config_arm }
> 
> -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> implementer_generic = ['Generic armv8', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
> -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium]
> -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> part_number_config_emag]
> -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> flags_implementer_dpaa, part_number_config_arm]
> +## Arm implementers (ID from MIDR in Arm Architecture Reference
> Manual)
> +implementers = {
> +	'generic': implementer_generic,
> +	'0x41': implementer_arm,
> +	'0x43': implementer_cavium,
> +	'0x50': implementer_ampere,
> +	'0x56': implementer_marvell,
> +	'dpaa': implementer_dpaa
> +}
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -151,7 +202,7 @@ else
>  	implementer_id = 'generic'
>  	if machine == 'default' and not meson.is_cross_build()
>  		# default build
> -		implementer_config = implementer_generic
> +		implementer_config = implementer['generic']
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# native build
> @@ -166,9 +217,9 @@ else
>  			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> implementer_id, ['generic'])
> +		implementer_config = implementers.get(implementer_id,
> ['generic'])
>  		if implementer_config[0] == 'generic'
> -			implementer_config = implementer_generic
> +			implementer_config = implementer['generic']
>  			part_number = 'generic'
>  		endif
>  		if arm_force_native_march == true
> @@ -178,28 +229,35 @@ else
>  		# cross build
>  		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
>  		part_number = meson.get_cross_property('part_number',
> 'generic')
> -		implementer_config = get_variable('implementer_' +
> implementer_id)
> +		implementer_config = implementers.get(implementer_id)
>  	endif
> 
> -	message('Arm implementer: ' + implementer_config[0])
> +	message('Arm implementer: ' + implementer_config['description'])
>  	message('Arm part number: ' + part_number)
> 
> +	part_number_config = implementer_config['part_number_config']
> +	if part_number_config.has_key(part_number)
> +		# use the specified part_number machine args if found
> +		part_number_config = part_number_config[part_number]
> +	elif not meson.is_cross_build()
> +		# default to generic machine args if part_number is not found
> +		# and not forcing native machine args
> +		# but don't default in cross-builds; if part_number is specified
> +		# incorrectly in a cross-file, it needs to be fixed there
> +		part_number_config = part_number_config['generic']
> +	else
> +		# doing cross build and part number is not in
> part_number_config
> +		error('Cross build part number 0@0 not
> found.'.format(part_number))
> +	endif
> +
>  	# use default flags with implementer flags
> -	dpdk_flags = flags_common + implementer_config[1]
> +	dpdk_flags = flags_common + implementer_config['flags'] +
> +part_number_config.get('flags', [])
> 
> +	# apply supported machine args
>  	machine_args = [] # Clear previous machine args
> -	foreach marg: implementer_config[2]
> -		if marg[0] == part_number
> -			# apply supported machine args
> -			foreach flag: marg[1]
> -				if cc.has_argument(flag)
> -					machine_args += flag
> -				endif
> -			endforeach
> -			if marg.length() > 2
> -				# add extra flags for the part
> -				dpdk_flags += marg[2]
> -			endif
> +	foreach flag: part_number_config['machine_args']
> +		if cc.has_argument(flag)
> +			machine_args += flag
>  		endif
>  	endforeach
> 
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v14 07/12] build: use native machine args in Arm native build
  2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 07/12] build: use native machine args in Arm native build Juraj Linkeš
@ 2021-01-15  8:39                             ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2021-01-15  8:39 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, December 23, 2020 7:48 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v14 07/12] build: use native machine args in Arm native build
> 
> Letting the compiler decide is going to yield the best results for native builds,
> so use native machine args usable for both GCC and Clang.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  config/arm/meson.build | 54 ++++++++++++++++++++++--------------------
>  1 file changed, 28 insertions(+), 26 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 403e1a02f..4508f369c 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -2,8 +2,6 @@
>  # Copyright(c) 2017 Intel Corporation.
>  # Copyright(c) 2017 Cavium, Inc
> 
> -arm_force_native_march = false
> -
>  # common flags to all aarch64 builds, with lowest priority  flags_common = [
>  	# Accelerate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -26,6 +24,7 @@ flags_common = [
>  	['RTE_ARCH_ARM64', true],
>  	['RTE_CACHE_LINE_SIZE', 128]
>  ]
> +native_machine_args = ['-mcpu=native']
> 
>  ## Part numbers are specific to Arm implementers  # implementer specific
> aarch64 flags have middle priority @@ -47,7 +46,6 @@ implementer_generic
> = {  }
> 
>  part_number_config_arm = {
> -	'native': {'machine_args':  ['-march=native']},
>  	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
>  	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
>  	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']}, @@ -95,7 +93,6 @@
> implementer_cavium = {
>  		['RTE_MAX_NUMA_NODES', 2]
>  	],
>  	'part_number_config': {
> -		'native': {'machine_args': ['-march=native']},
>  		'0xa1': {
>  			'machine_args': ['-mcpu=thunderxt88'],
>  			'flags': flags_part_number_thunderx
> @@ -145,8 +142,7 @@ implementer_ampere = {
>  	],
>  	'part_number_config': {
>  		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
> -					  '-mtune=emag']},
> -		'native': {'machine_args':  ['-march=native']}
> +					  '-mtune=emag']}
>  	}
>  }
> 
> @@ -195,26 +191,27 @@ if dpdk_conf.get('RTE_ARCH_32')
>  	machine_args += '-mfpu=neon'
>  else
>  	# aarch64 build
> -	if machine == 'default' and not meson.is_cross_build()
> -		# default build
> -		implementer_id = 'generic'
> -		part_number = 'generic'
> -	elif not meson.is_cross_build()
> -		# native 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(' ')
> -			implementer_id = cmd_output[0]
> -			part_number = cmd_output[3]
> +	use_native_machine_args = false
> +	if not meson.is_cross_build()
> +		if machine == 'default'
> +			# default build
> +			implementer_id = 'generic'
> +			part_number = 'generic'
>  		else
> -			error('Error when getting Arm Implementer ID and
> part number.')
> -		endif
> -		if arm_force_native_march == true
> -			part_number = 'native'
> +			# native 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(' ')
> +				implementer_id = cmd_output[0]
> +				part_number = cmd_output[3]
> +			else
> +				error('Error when getting Arm Implementer
> ID and part number.')
> +			endif
> +			use_native_machine_args = true
>  		endif
>  	else
>  		# cross build
> @@ -250,7 +247,12 @@ else
> 
>  	# apply supported machine args
>  	machine_args = [] # Clear previous machine args
> -	foreach flag: part_number_config['machine_args']
> +	if use_native_machine_args
> +		candidate_machine_args = native_machine_args
> +	else
> +		candidate_machine_args =
> part_number_config['machine_args']
> +	endif
> +	foreach flag: candidate_machine_args
>  		if cc.has_argument(flag)
>  			machine_args += flag
>  		endif
> --
> 2.20.1

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v14 05/12] build: organize Arm config into dict
  2021-01-15  8:38                             ` Ruifeng Wang
@ 2021-01-15 12:18                               ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 12:18 UTC (permalink / raw)
  To: Ruifeng Wang, bruce.richardson, Honnappa Nagarahalli, Phil Yang,
	vcchunga, Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd



> -----Original Message-----
> From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> Sent: Friday, January 15, 2021 9:38 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> Cc: dev@dpdk.org; nd <nd@arm.com>
> Subject: RE: [PATCH v14 05/12] build: organize Arm config into dict
> 
> 
> > -----Original Message-----
> > From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Sent: Wednesday, December 23, 2020 7:48 PM
> > To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> > <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com
> > Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Subject: [PATCH v14 05/12] build: organize Arm config into dict
> >
> > Use dictionary lookup instead of checking for existing variables,
> > iterating over all elements in the list or checking lists for optional
> > configuration. Move variable contents into the dictionary for
> > variables that would be referenced only once.
> > Fallback to generic part number if the discovered part number is unknown.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > ---
> >  config/arm/meson.build | 298
> > ++++++++++++++++++++++++-----------------
> >  1 file changed, 178 insertions(+), 120 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > fb877fe77..b449b10c3 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -27,115 +27,166 @@ flags_common = [
> >  	['RTE_CACHE_LINE_SIZE', 128]
> >  ]
> >
> > -# implementer specific aarch64 flags, with middle priority -# (will
> > overwrite common flags) -flags_implementer_generic = [
> > -	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 128],
> > -	['RTE_MAX_LCORE', 256]
> > -]
> > -flags_implementer_arm = [
> > -	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 16]
> > -]
> > -flags_implementer_cavium = [
> > -	['RTE_MAX_VFIO_GROUPS', 128],
> > -	['RTE_CACHE_LINE_SIZE', 128],
> > -	['RTE_MAX_LCORE', 96],
> > -	['RTE_MAX_NUMA_NODES', 2]
> > -]
> > -flags_implementer_dpaa = [
> > -	['RTE_MACHINE', '"dpaa"'],
> > -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 16],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -flags_implementer_emag = [
> > -	['RTE_MACHINE', '"emag"'],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 32],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -flags_implementer_armada = [
> > -	['RTE_MACHINE', '"armv8a"'],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 16],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > +## Part numbers are specific to Arm implementers # implementer
> > +specific
> > +aarch64 flags have middle priority
> > +#     (will overwrite common flags)
> > +# part number specific aarch64 flags have the highest priority
> > +#     (will overwrite both common and implementer specific flags)
> > +implementer_generic = {
> > +	'description': 'Generic armv8',
> > +	'flags': [
> > +		['RTE_MACHINE', '"armv8a"'],
> > +		['RTE_USE_C11_MEM_MODEL', true],
> > +		['RTE_CACHE_LINE_SIZE', 128],
> > +		['RTE_MAX_LCORE', 256]
> > +	],
> > +	'part_number_config': {
> > +		'generic': {'machine_args': ['-march=armv8-a+crc',
> > +					     '-moutline-atomics']}
> > +	}
> > +}
> > +
> > +part_number_config_arm = {
> > +	'generic': {'machine_args':  ['-march=armv8-a+crc',
> > +				      '-moutline-atomics']},
> > +	'native': {'machine_args':  ['-march=native']},
> > +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> > +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> > +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> > +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> > +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> > +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> > +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> > +	'0xd0c': {
> > +		'machine_args':  ['-march=armv8.2-a+crypto',
> > +				  '-mcpu=neoverse-n1'],
> > +		'flags': [
> > +			['RTE_MACHINE', '"neoverse-n1"'],
> > +			['RTE_ARM_FEATURE_ATOMICS', true],
> > +			['RTE_USE_C11_MEM_MODEL', true],
> This duplicates what in implementer flags.
> Can we remove it?
> 
> > +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > +			['RTE_LIBRTE_VHOST_NUMA', false],
> > +			['RTE_MAX_MEM_MB', 1048576],
> > +			['RTE_CACHE_LINE_SIZE', 64],
> Also this one.
> 

Yea, let's not duplicate the config, I'll remove both of thoes.

> > +			['RTE_MAX_LCORE', 64],
> Do you want to change this to 80?
> Ampere Altra SoC has 80 N1 cores.
> 

Yes, makes sense to update it.

> > +			['RTE_MAX_NUMA_NODES', 1]
> > +		]
> > +	}
> > +}
> > +implementer_arm = {
> > +	'description': 'Arm',
> > +	'flags': [
> > +		['RTE_MACHINE', '"armv8a"'],
> > +		['RTE_USE_C11_MEM_MODEL', true],
> > +		['RTE_CACHE_LINE_SIZE', 64],
> > +		['RTE_MAX_LCORE', 16]
> > +	],
> > +	'part_number_config': part_number_config_arm }
> >
> > -# part number specific aarch64 flags, with highest priority -# (will
> > overwrite both common and implementer specific flags)
> > flags_part_number_thunderx = [
> >  	['RTE_MACHINE', '"thunderx"'],
> >  	['RTE_USE_C11_MEM_MODEL', false]
> >  ]
> > -flags_part_number_thunderx2 = [
> > -	['RTE_MACHINE', '"thunderx2"'],
> > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 256],
> > -	['RTE_MAX_NUMA_NODES', 2]
> > -]
> > -flags_part_number_octeontx2 = [
> > -	['RTE_MACHINE', '"octeontx2"'],
> > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_EAL_IGB_UIO', false],
> > -	['RTE_MAX_LCORE', 36],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > -flags_part_number_n1generic = [
> > -	['RTE_MACHINE', '"neoverse-n1"'],
> > -	['RTE_ARM_FEATURE_ATOMICS', true],
> > -	['RTE_USE_C11_MEM_MODEL', true],
> > -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> > -	['RTE_LIBRTE_VHOST_NUMA', false],
> > -	['RTE_MAX_MEM_MB', 1048576],
> > -	['RTE_CACHE_LINE_SIZE', 64],
> > -	['RTE_MAX_LCORE', 64],
> > -	['RTE_MAX_NUMA_NODES', 1]
> > -]
> > +implementer_cavium = {
> > +	'description': 'Cavium',
> > +	'flags': [
> > +		['RTE_MAX_VFIO_GROUPS', 128],
> > +		['RTE_CACHE_LINE_SIZE', 128],
> > +		['RTE_MAX_LCORE', 96],
> > +		['RTE_MAX_NUMA_NODES', 2]
> > +	],
> > +	'part_number_config': {
> > +		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
> > +					     '-mcpu=thunderx']},
> > +		'native': {'machine_args': ['-march=native']},
> > +		'0xa1': {
> > +			'machine_args': ['-mcpu=thunderxt88'],
> > +			'flags': flags_part_number_thunderx
> > +		},
> > +		'0xa2': {
> > +			'machine_args': ['-mcpu=thunderxt81'],
> > +			'flags': flags_part_number_thunderx
> > +		},
> > +		'0xa3': {
> > +			'machine_args': ['-mcpu=thunderxt83'],
> > +			'flags': flags_part_number_thunderx
> > +		},
> > +		'0xaf': {
> > +			'machine_args': ['-march=armv8.1-a+crc+crypto',
> > +					 '-mcpu=thunderx2t99'],
> > +			'flags': [
> > +				['RTE_MACHINE', '"thunderx2"'],
> > +				['RTE_ARM_FEATURE_ATOMICS', true],
> > +				['RTE_USE_C11_MEM_MODEL', true],
> > +				['RTE_CACHE_LINE_SIZE', 64],
> > +				['RTE_MAX_LCORE', 256],
> > +				['RTE_MAX_NUMA_NODES', 2]
> > +			]
> > +		},
> > +		'0xb2': {
> > +			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
> > +					 '-mcpu=octeontx2'],
> > +			'flags': [
> > +				['RTE_MACHINE', '"octeontx2"'],
> > +				['RTE_ARM_FEATURE_ATOMICS', true],
> > +				['RTE_USE_C11_MEM_MODEL', true],
> > +				['RTE_EAL_IGB_UIO', false],
> > +				['RTE_MAX_LCORE', 36],
> > +				['RTE_MAX_NUMA_NODES', 1]
> > +			]
> > +		}
> > +	}
> > +}
> >
> > -# arm config (implementer 0x41) is the default config -
> > part_number_config_arm = [
> > -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> > -	['native', ['-march=native']],
> > -	['0xd03', ['-mcpu=cortex-a53']],
> > -	['0xd04', ['-mcpu=cortex-a35']],
> > -	['0xd07', ['-mcpu=cortex-a57']],
> > -	['0xd08', ['-mcpu=cortex-a72']],
> > -	['0xd09', ['-mcpu=cortex-a73']],
> > -	['0xd0a', ['-mcpu=cortex-a75']],
> > -	['0xd0b', ['-mcpu=cortex-a76']],
> > -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> > flags_part_number_n1generic]
> > -]
> > -part_number_config_cavium = [
> > -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> > -	['native', ['-march=native']],
> > -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> > -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> > -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> > -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> > flags_part_number_thunderx2],
> > -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> > flags_part_number_octeontx2]
> > -]
> > -part_number_config_emag = [
> > -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> > -	['native', ['-march=native']]
> > -]
> > +implementer_ampere = {
> > +	'description': 'Ampere Computing',
> > +	'flags': [
> > +		['RTE_MACHINE', '"emag"'],
> > +		['RTE_CACHE_LINE_SIZE', 64],
> > +		['RTE_MAX_LCORE', 32],
> > +		['RTE_MAX_NUMA_NODES', 1]
> > +	],
> > +	'part_number_config': {
> > +		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
> > +					      '-mtune=emag']},
> > +		'native': {'machine_args':  ['-march=native']}
> > +	}
> > +}
> > +
> > +implementer_marvell = {
> > +	'description': 'Marvell ARMADA',
> > +	'flags': [
> > +		['RTE_MACHINE', '"armv8a"'],
> > +		['RTE_CACHE_LINE_SIZE', 64],
> > +		['RTE_MAX_LCORE', 16],
> > +		['RTE_MAX_NUMA_NODES', 1]
> > +	],
> > +	'part_number_config': part_number_config_arm }
> > +
> > +implementer_dpaa = {
> > +	'description': 'NXP DPAA',
> > +	'flags': [
> > +		['RTE_MACHINE', '"dpaa"'],
> > +		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> > +		['RTE_USE_C11_MEM_MODEL', true],
> > +		['RTE_CACHE_LINE_SIZE', 64],
> > +		['RTE_MAX_LCORE', 16],
> > +		['RTE_MAX_NUMA_NODES', 1]
> > +	],
> > +	'part_number_config': part_number_config_arm }
> >
> > -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> > implementer_generic = ['Generic armv8', flags_implementer_generic,
> > part_number_config_arm]
> > -implementer_0x41 = ['Arm', flags_implementer_arm,
> > part_number_config_arm]
> > -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> > part_number_config_cavium]
> > -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> > part_number_config_emag]
> > -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> > part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> > flags_implementer_dpaa, part_number_config_arm]
> > +## Arm implementers (ID from MIDR in Arm Architecture Reference
> > Manual)
> > +implementers = {
> > +	'generic': implementer_generic,
> > +	'0x41': implementer_arm,
> > +	'0x43': implementer_cavium,
> > +	'0x50': implementer_ampere,
> > +	'0x56': implementer_marvell,
> > +	'dpaa': implementer_dpaa
> > +}
> >
> >  dpdk_conf.set('RTE_ARCH_ARM', 1)
> >  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -151,7 +202,7 @@ else
> >  	implementer_id = 'generic'
> >  	if machine == 'default' and not meson.is_cross_build()
> >  		# default build
> > -		implementer_config = implementer_generic
> > +		implementer_config = implementer['generic']
> >  		part_number = 'generic'
> >  	elif not meson.is_cross_build()
> >  		# native build
> > @@ -166,9 +217,9 @@ else
> >  			part_number = cmd_output[3]
> >  		endif
> >  		# Set to generic if variable is not found
> > -		implementer_config = get_variable('implementer_' +
> > implementer_id, ['generic'])
> > +		implementer_config = implementers.get(implementer_id,
> > ['generic'])
> >  		if implementer_config[0] == 'generic'
> > -			implementer_config = implementer_generic
> > +			implementer_config = implementer['generic']
> >  			part_number = 'generic'
> >  		endif
> >  		if arm_force_native_march == true
> > @@ -178,28 +229,35 @@ else
> >  		# cross build
> >  		implementer_id =
> > meson.get_cross_property('implementer_id', 'generic')
> >  		part_number = meson.get_cross_property('part_number',
> > 'generic')
> > -		implementer_config = get_variable('implementer_' +
> > implementer_id)
> > +		implementer_config = implementers.get(implementer_id)
> >  	endif
> >
> > -	message('Arm implementer: ' + implementer_config[0])
> > +	message('Arm implementer: ' + implementer_config['description'])
> >  	message('Arm part number: ' + part_number)
> >
> > +	part_number_config = implementer_config['part_number_config']
> > +	if part_number_config.has_key(part_number)
> > +		# use the specified part_number machine args if found
> > +		part_number_config = part_number_config[part_number]
> > +	elif not meson.is_cross_build()
> > +		# default to generic machine args if part_number is not found
> > +		# and not forcing native machine args
> > +		# but don't default in cross-builds; if part_number is specified
> > +		# incorrectly in a cross-file, it needs to be fixed there
> > +		part_number_config = part_number_config['generic']
> > +	else
> > +		# doing cross build and part number is not in
> > part_number_config
> > +		error('Cross build part number 0@0 not
> > found.'.format(part_number))
> > +	endif
> > +
> >  	# use default flags with implementer flags
> > -	dpdk_flags = flags_common + implementer_config[1]
> > +	dpdk_flags = flags_common + implementer_config['flags'] +
> > +part_number_config.get('flags', [])
> >
> > +	# apply supported machine args
> >  	machine_args = [] # Clear previous machine args
> > -	foreach marg: implementer_config[2]
> > -		if marg[0] == part_number
> > -			# apply supported machine args
> > -			foreach flag: marg[1]
> > -				if cc.has_argument(flag)
> > -					machine_args += flag
> > -				endif
> > -			endforeach
> > -			if marg.length() > 2
> > -				# add extra flags for the part
> > -				dpdk_flags += marg[2]
> > -			endif
> > +	foreach flag: part_number_config['machine_args']
> > +		if cc.has_argument(flag)
> > +			machine_args += flag
> >  		endif
> >  	endforeach
> >
> > --
> > 2.20.1


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

* [dpdk-dev] [PATCH v15 00/12] Arm build options rework
  2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
                                             ` (13 preceding siblings ...)
  2021-01-05 11:02                           ` Pavan Nikhilesh Bhagavatula
@ 2021-01-15 13:25                           ` Juraj Linkeš
  2021-01-15 13:25                             ` [dpdk-dev] [PATCH v15 01/12] build: rename Arm build variables Juraj Linkeš
                                               ` (13 more replies)
  14 siblings, 14 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:25 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

Add a way to specify the cpu count and numa node count for cross builds
and aarch64 -> aarch64 (SoC) builds.

We also want to be able to disable which drivers (and possibly
libraries) are built without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

Among libraries, only libnuma can be now disabled.

Also add an optional way to discover cpu count a numa node count. Fix
-Dmax_lcores and -Dmax_numa_nodes for arm builds.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/disabled
  drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Darm_soc
  option or using a cross file
* max numa nodes and max lcore may be specified on the command line to
  overwrite the values for any (native, SoC or cross) build

v2:
Major rework of the whole series.

v3:
Added numa and core count defaults for x86 default build.
Removed numa and core count defaults. Now requiring defaults to be
specified in a cross file or on the cmdline.
Added FreeBDS support for numa count discovery.

v4:
Make automatic numa and cpu counts discovery optional.

v5:
Split the refactor patch into smaller patches.
Simplify buildtools/get_numa_count.py.
Add more explanation to cover letter.

v6:
Apply cross file options arch agnostically, not just in Arm cross
builds.
Streamline Arm build setup and machine args: always use native args in
native builds, require implementer ID and part number for cross builds.

v7:
Arm config options are now organized in one dictionary.
Removed unsupported implementers and removed fallback to generic
implementer/part number for unknown implementer/part number.
Added meson config option arm_soc which can be used to specify
configuration to be used, useful for aarch64 -> aarch64 builds.

v8:
Rebase.

v9:
Split SoC and implementer dictionaries into smaller parts.
Fixed DPAA and ARMADA SoC configuration.
Added documentation about supported SoCs.

v10:
Added a commit that fixes Graviton2 clang build failures in native
build.

v11:
Rebase.

v12:
Fixed dpaa and armada cross builds in generic build commit.

v13:
Removed two commits which were not arm-specific:
1. build: alias default build as generic
2. build: optional NUMA and cpu counts detection
Also minor adjustments to commit messages in:
1. build: isolate configuration for Arm generic build
2. build: disable drivers in Arm builds

v14:
Resent for retesting (because of suspected false negative).

v15:
Fixed 'check_libnuma' var in build: disable libnuma in cross builds.
Removed duplicate configs. Updated n1sdp cores to 80.


Series Acked-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Jerin Jacob <jerinj@marvell.com>
Series Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Series Tested-by: Vimal Chungath <vcchunga@amazon.com>
Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Juraj Linkeš (12):
  build: rename Arm build variables
  build: remove unused or superfluous variables
  build: reformat and move Arm config and comments
  build: simplify how Arm flags are processed
  build: organize Arm config into dict
  build: isolate configuration for Arm generic build
  build: use native machine args in Arm native build
  build: add core and NUMA counts to cross files
  build: disable drivers in Arm builds
  build: disable libnuma in cross builds
  build: add Arm SoC meson option
  config: fix Arm implementer and its SoCs

 config/arm/arm64_armada_linux_gcc             |   2 +-
 config/arm/arm64_armv8_linux_gcc              |  15 +-
 config/arm/arm64_bluefield_linux_gcc          |   3 +-
 config/arm/arm64_dpaa_linux_gcc               |   2 +-
 config/arm/arm64_emag_linux_gcc               |   2 +-
 config/arm/arm64_graviton2_linux_gcc          |   3 +-
 config/arm/arm64_n1sdp_linux_gcc              |   3 +-
 config/arm/arm64_n2_linux_gcc                 |   3 +-
 config/arm/arm64_octeontx2_linux_gcc          |   3 +-
 config/arm/arm64_stingray_linux_gcc           |   3 +-
 config/arm/arm64_thunderx2_linux_gcc          |   3 +-
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |   2 +-
 config/arm/meson.build                        | 522 ++++++++++++------
 config/meson.build                            |  34 +-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  30 +
 drivers/meson.build                           |   6 +-
 meson.build                                   |   1 +
 meson_options.txt                             |   2 +
 18 files changed, 425 insertions(+), 214 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (92%)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 01/12] build: rename Arm build variables
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
@ 2021-01-15 13:25                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 02/12] build: remove unused or superfluous variables Juraj Linkeš
                                               ` (12 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:25 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Rename Arm build variables and values so that they better conform to Arm
specifications. Also rename generically sounding variable to names that
better capture what the variables hold.

Rename machine_args_generic to part_number_config_arm since the
variable contains more than just the generic machine args and is used
mainly as the fallback arm configuration.
Rename the default machine args to generic machine args to reflect that.
The rest of the variables are self-explanatory.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc    |   2 +-
 config/arm/arm64_armv8_linux_gcc     |   8 +-
 config/arm/arm64_bluefield_linux_gcc |   4 +-
 config/arm/arm64_dpaa_linux_gcc      |   2 +-
 config/arm/arm64_emag_linux_gcc      |   2 +-
 config/arm/arm64_n1sdp_linux_gcc     |   4 +-
 config/arm/arm64_n2_linux_gcc        |   4 +-
 config/arm/arm64_octeontx2_linux_gcc |   4 +-
 config/arm/arm64_stingray_linux_gcc  |   4 +-
 config/arm/arm64_thunderx2_linux_gcc |   4 +-
 config/arm/arm64_thunderx_linux_gcc  |   2 +-
 config/arm/meson.build               | 118 +++++++++++++--------------
 12 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index fa40c0398..52c5f4476 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x56'
+implementer_id = '0x56'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 88f0ff9da..13ee8b223 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,10 +13,10 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'generic'
+implementer_id = 'generic'
 
-# Valid options for Arm's implementor_pn:
-# 'default': valid for all armv8-a architectures (default value)
+# Valid options for Arm's part_number:
+# 'generic': valid for all armv8-a architectures (default value)
 # '0xd03':   cortex-a53
 # '0xd04':   cortex-a35
 # '0xd05':   cortex-a55
@@ -25,4 +25,4 @@ implementor_id = 'generic'
 # '0xd09':   cortex-a73
 # '0xd0a':   cortex-a75
 # '0xd0b':   cortex-a76
-implementor_pn = 'default'
+part_number = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 1a4682154..573ae7e42 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,4 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = 'dpaa'
+implementer_id = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 8edcd3e97..24f3d533e 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x50'
+implementer_id = '0x50'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 022e06303..6fb3f02ea 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
+implementer_id = '0x41'
+part_number = '0xd0c'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 78f6f3e2b..3de5a6eb1 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd49'
+implementer_id = '0x41'
+part_number = '0xd49'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 365bd7cbd..ac1042806 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xb2'
+implementer_id = '0x43'
+part_number = '0xb2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 86797d23c..b79389d85 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd08'
+implementer_id = '0x41'
+part_number = '0xd08'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index 2b41acc61..dd257745e 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,5 +13,5 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
-implementor_pn = '0xaf'
+implementer_id = '0x43'
+part_number = '0xaf'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderx_linux_gcc
index 6572ab615..670764437 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderx_linux_gcc
@@ -13,4 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x43'
+implementer_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 5fd1c40a0..20bb70a6d 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -8,7 +8,7 @@ march_opt = '-march=@0@'.format(machine)
 arm_force_native_march = false
 arm_force_default_march = (machine == 'default')
 
-flags_common_default = [
+flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
@@ -28,58 +28,58 @@ flags_common_default = [
 	['RTE_ARM_USE_WFE', false],
 ]
 
-flags_generic = [
+flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 128]]
-flags_arm = [
+flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64]]
-flags_cavium = [
+flags_implementer_cavium = [
 	['RTE_CACHE_LINE_SIZE', 128],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 96],
 	['RTE_MAX_VFIO_GROUPS', 128]]
-flags_dpaa = [
+flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
 	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
-flags_emag = [
+flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 32]]
-flags_armada = [
+flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_default_extra = []
-flags_thunderx_extra = [
+flags_part_number_default = []
+flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
-flags_thunderx2_extra = [
+flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
 	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_octeontx2_extra = [
+flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_EAL_IGB_UIO', false],
 	['RTE_USE_C11_MEM_MODEL', true]]
-flags_n1generic_extra = [
+flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -89,7 +89,7 @@ flags_n1generic_extra = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
-flags_n2generic_extra = [
+flags_part_number_n2generic = [
 	['RTE_MACHINE', '"neoverse-n2"'],
 	['RTE_MAX_LCORE', 64],
 	['RTE_CACHE_LINE_SIZE', 64],
@@ -98,8 +98,8 @@ flags_n2generic_extra = [
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 	['RTE_LIBRTE_VHOST_NUMA', false]]
 
-machine_args_generic = [
-	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
+part_number_config_arm = [
+	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
@@ -108,37 +108,37 @@ machine_args_generic = [
 	['0xd09', ['-mcpu=cortex-a73']],
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_n1generic_extra],
-	['0xd49', ['-march=armv8.5-a+crypto+sve2'], flags_n2generic_extra]]
+	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic],
+	['0xd49', ['-march=armv8.5-a+crypto+sve2'], flags_part_number_n2generic]]
 
-machine_args_cavium = [
-	['default', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
+part_number_config_cavium = [
+	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
 	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_thunderx_extra],
-	['0xa2', ['-mcpu=thunderxt81'], flags_thunderx_extra],
-	['0xa3', ['-mcpu=thunderxt83'], flags_thunderx_extra],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_thunderx2_extra],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_octeontx2_extra]]
-
-machine_args_emag = [
-	['default', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
+	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
+	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
+	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
+	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
+
+part_number_config_emag = [
+	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
 	['native', ['-march=native']]]
 
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
-impl_generic = ['Generic armv8', flags_generic, machine_args_generic]
-impl_0x41 = ['Arm', flags_arm, machine_args_generic]
-impl_0x42 = ['Broadcom', flags_generic, machine_args_generic]
-impl_0x43 = ['Cavium', flags_cavium, machine_args_cavium]
-impl_0x44 = ['DEC', flags_generic, machine_args_generic]
-impl_0x49 = ['Infineon', flags_generic, machine_args_generic]
-impl_0x4d = ['Motorola', flags_generic, machine_args_generic]
-impl_0x4e = ['NVIDIA', flags_generic, machine_args_generic]
-impl_0x50 = ['Ampere Computing', flags_emag, machine_args_emag]
-impl_0x51 = ['Qualcomm', flags_generic, machine_args_generic]
-impl_0x53 = ['Samsung', flags_generic, machine_args_generic]
-impl_0x56 = ['Marvell ARMADA', flags_armada, machine_args_generic]
-impl_0x69 = ['Intel', flags_generic, machine_args_generic]
-impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
+implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
+implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
+implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
+implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
+implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
+implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
+implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
+implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
+implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
+implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
+implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
+implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
+implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
+implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -153,13 +153,13 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	machine = []
-	cmd_generic = ['generic', '', '', 'default', '']
+	implementer_config = []
+	cmd_generic = ['generic', '', '', 'generic', '']
 	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 = impl_generic
-		impl_pn = 'default'
+		implementer_config = implementer_generic
+		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -170,45 +170,45 @@ else
 			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
+		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		if implementer_config[0] == 'generic'
+			implementer_config = implementer_generic
 			cmd_output = cmd_generic
 		endif
-		impl_pn = cmd_output[3]
+		part_number = cmd_output[3]
 		if arm_force_native_march == true
-			impl_pn = 'native'
+			part_number = '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)
+		implementer_id = meson.get_cross_property('implementer_id', 'generic')
+		part_number = meson.get_cross_property('part_number', 'generic')
+		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
-	foreach flag: flags_common_default
+	foreach flag: flags_common
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	message('Implementer : ' + machine[0])
-	foreach flag: machine[1]
+	message('Implementer : ' + implementer_config[0])
+	foreach flag: implementer_config[1]
 		if flag.length() > 0
 			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 
-	foreach marg: machine[2]
-		if marg[0] == impl_pn
+	foreach marg: implementer_config[2]
+		if marg[0] == part_number
 			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)
+			foreach flag: marg.get(2, flags_part_number_default)
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 02/12] build: remove unused or superfluous variables
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
  2021-01-15 13:25                             ` [dpdk-dev] [PATCH v15 01/12] build: rename Arm build variables Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 03/12] build: reformat and move Arm config and comments Juraj Linkeš
                                               ` (11 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 20bb70a6d..0e8800546 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,11 +2,7 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_default_march = (machine == 'default')
 
 flags_common = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -61,7 +57,6 @@ flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -127,17 +122,9 @@ part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -153,11 +140,9 @@ else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_default_march and not meson.is_cross_build()
+	if machine == 'default' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -168,14 +153,15 @@ else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -208,7 +194,7 @@ else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 03/12] build: reformat and move Arm config and comments
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
  2021-01-15 13:25                             ` [dpdk-dev] [PATCH v15 01/12] build: rename Arm build variables Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 02/12] build: remove unused or superfluous variables Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 04/12] build: simplify how Arm flags are processed Juraj Linkeš
                                               ` (10 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Change formatting so that it's more consistent and readable, add/modify
comments/stdout messages, move configuration options to more appropriate
places and make the order consistent according to these rules:
1. First list generic configuration options, then list options that may
   be overwritten. List SoC-specific options last.
2. For SoC-specific options, list number of cores before the number of
   NUMA nodes, to make it consistent with config/meson.build.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armv8_linux_gcc              |  12 +--
 config/arm/meson.build                        | 102 +++++++++++-------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  34 ++++++
 3 files changed, 96 insertions(+), 52 deletions(-)

diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 13ee8b223..0099f5ca2 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -13,16 +13,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
+# Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
-
-# Valid options for Arm's part_number:
-# 'generic': valid for all armv8-a architectures (default value)
-# '0xd03':   cortex-a53
-# '0xd04':   cortex-a35
-# '0xd05':   cortex-a55
-# '0xd07':   cortex-a57
-# '0xd08':   cortex-a72
-# '0xd09':   cortex-a73
-# '0xd0a':   cortex-a75
-# '0xd0b':   cortex-a76
 part_number = 'generic'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 0e8800546..28d81b070 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -4,15 +4,16 @@
 
 arm_force_native_march = false
 
+# common flags to all aarch64 builds, with lowest priority
 flags_common = [
-	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
+	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
 	# to determine the best threshold in code. Refer to notes in source file
 	# (lib/librte_eal/arm/include/rte_memcpy_64.h) for more info.
 	['RTE_ARCH_ARM64_MEMCPY', false],
 	#	['RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD', 2048],
 	#	['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
-	# Leave below RTE_ARM64_MEMCPY_xxx options commented out, unless there're
-	# strong reasons.
+	# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
+	# unless there are strong reasons.
 	#	['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
@@ -22,77 +23,93 @@ flags_common = [
 
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
+	['RTE_ARCH_ARM64', true],
+	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
+# implementer specific aarch64 flags, with middle priority
+# (will overwrite common flags)
 flags_implementer_generic = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 256],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 128]]
+	['RTE_MAX_LCORE', 256]
+]
 flags_implementer_arm = [
 	['RTE_MACHINE', '"armv8a"'],
-	['RTE_MAX_LCORE', 16],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64]]
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 16]
+]
 flags_implementer_cavium = [
-	['RTE_CACHE_LINE_SIZE', 128],
-	['RTE_MAX_NUMA_NODES', 2],
+	['RTE_MAX_VFIO_GROUPS', 128],
 	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_VFIO_GROUPS', 128]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_implementer_dpaa = [
 	['RTE_MACHINE', '"dpaa"'],
+	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false]]
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_emag = [
 	['RTE_MACHINE', '"emag"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 32]]
+	['RTE_MAX_LCORE', 32],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_implementer_armada = [
 	['RTE_MACHINE', '"armv8a"'],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 16]]
+	['RTE_MAX_LCORE', 16],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 
+# part number specific aarch64 flags, with highest priority
+# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
-	['RTE_USE_C11_MEM_MODEL', false]]
+	['RTE_USE_C11_MEM_MODEL', false]
+]
 flags_part_number_thunderx2 = [
 	['RTE_MACHINE', '"thunderx2"'],
+	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_NUMA_NODES', 2],
 	['RTE_MAX_LCORE', 256],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_NUMA_NODES', 2]
+]
 flags_part_number_octeontx2 = [
 	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_MAX_NUMA_NODES', 1],
-	['RTE_MAX_LCORE', 36],
 	['RTE_ARM_FEATURE_ATOMICS', true],
+	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_IGB_UIO', false],
-	['RTE_USE_C11_MEM_MODEL', true]]
+	['RTE_MAX_LCORE', 36],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n1generic = [
 	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_MEM_MB', 1048576],
+	['RTE_CACHE_LINE_SIZE', 64],
+	['RTE_MAX_LCORE', 64],
+	['RTE_MAX_NUMA_NODES', 1]
+]
 flags_part_number_n2generic = [
 	['RTE_MACHINE', '"neoverse-n2"'],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64],
 	['RTE_ARM_FEATURE_ATOMICS', true],
 	['RTE_USE_C11_MEM_MODEL', true],
 	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false]]
+	['RTE_LIBRTE_VHOST_NUMA', false],
+	['RTE_MAX_LCORE', 64],
+	['RTE_CACHE_LINE_SIZE', 64]
+]
 
+# arm config (implementer 0x41) is the default config
 part_number_config_arm = [
 	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
@@ -104,7 +121,8 @@ part_number_config_arm = [
 	['0xd0a', ['-mcpu=cortex-a75']],
 	['0xd0b', ['-mcpu=cortex-a76']],
 	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic],
-	['0xd49', ['-march=armv8.5-a+crypto+sve2'], flags_part_number_n2generic]]
+	['0xd49', ['-march=armv8.5-a+crypto+sve2'], flags_part_number_n2generic]
+]
 
 part_number_config_cavium = [
 	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
@@ -113,13 +131,14 @@ part_number_config_cavium = [
 	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
 	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
 	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]]
-
+	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
+]
 part_number_config_emag = [
 	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]]
+	['native', ['-march=native']]
+]
 
-## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
+## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
@@ -131,21 +150,21 @@ dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
 if dpdk_conf.get('RTE_ARCH_32')
+	# armv7 build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 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)
-
+	# aarch64 build
 	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
 	if machine == 'default' and not meson.is_cross_build()
+		# default build
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
+		# native build
 		# The script returns ['Implementer', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
 		detect_vendor = find_program(join_paths(
@@ -166,6 +185,7 @@ else
 			part_number = 'native'
 		endif
 	else
+		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
 		implementer_config = get_variable('implementer_' + implementer_id)
@@ -202,7 +222,7 @@ else
 		endif
 	endforeach
 endif
-message(machine_args)
+message('Using machine args: @0@'.format(machine_args))
 
 if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
     cc.get_define('__aarch64__', args: machine_args) != '')
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..972598835 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -99,3 +99,37 @@ command::
 
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
+
+Supported cross-compilation targets
+-----------------------------------
+
+If you wish to build for a target which is not among the current cross-files,
+you may use various combinations of implementer/part number::
+
+   Supported implementers:
+      'generic': Generic armv8
+      '0x41':    Arm
+      '0x43':    Cavium
+      '0x50':    Ampere Computing
+      '0x56':    Marvell ARMADA
+      'dpaa':    NXP DPAA
+
+   Supported part_numbers for generic, 0x41, 0x56, dpaa:
+      'generic': valid for all armv8-a architectures (default value)
+      '0xd03':   cortex-a53
+      '0xd04':   cortex-a35
+      '0xd09':   cortex-a73
+      '0xd0a':   cortex-a75
+      '0xd0b':   cortex-a76
+      '0xd0c':   neoverse-n1
+
+   Supported part_numbers for 0x43:
+      'generic': valid for all Cavium builds
+      '0xa1':    thunderxt88
+      '0xa2':    thunderxt81
+      '0xa3':    thunderxt83
+      '0xaf':    thunderx2t99
+      '0xb2':    octeontx2
+
+   Supported part_numbers for 0x50:
+      'generic': valid for all Ampere builds
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 04/12] build: simplify how Arm flags are processed
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (2 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 03/12] build: reformat and move Arm config and comments Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 05/12] build: organize Arm config into dict Juraj Linkeš
                                               ` (9 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Set flags in one loop. Append flags to a list and use the list in the
loop.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 28d81b070..7a74938bd 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -158,7 +158,6 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	implementer_id = 'generic'
-	machine_args = [] # Clear previous machine args
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
 		implementer_config = implementer_generic
@@ -191,34 +190,32 @@ else
 		implementer_config = get_variable('implementer_' + implementer_id)
 	endif
 
-	# Apply Common Defaults. These settings may be overwritten by machine
-	# settings later.
-	foreach flag: flags_common
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	message('Arm implementer: ' + implementer_config[0])
+	message('Arm part number: ' + part_number)
 
-	message('Implementer : ' + implementer_config[0])
-	foreach flag: implementer_config[1]
-		if flag.length() > 0
-			dpdk_conf.set(flag[0], flag[1])
-		endif
-	endforeach
+	# use default flags with implementer flags
+	dpdk_flags = flags_common + implementer_config[1]
 
+	machine_args = [] # Clear previous machine args
 	foreach marg: implementer_config[2]
 		if marg[0] == part_number
+			# apply supported machine args
 			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, [])
-				if flag.length() > 0
-					dpdk_conf.set(flag[0], flag[1])
-				endif
-			endforeach
+			if marg.length() > 2
+				# add extra flags for the part
+				dpdk_flags += marg[2]
+			endif
+		endif
+	endforeach
+
+	# apply flags
+	foreach flag: dpdk_flags
+		if flag.length() > 0
+			dpdk_conf.set(flag[0], flag[1])
 		endif
 	endforeach
 endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 05/12] build: organize Arm config into dict
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (3 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 04/12] build: simplify how Arm flags are processed Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-16 14:12                               ` Ruifeng Wang
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
                                               ` (8 subsequent siblings)
  13 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Use dictionary lookup instead of checking for existing variables,
iterating over all elements in the list or checking lists for optional
configuration. Move variable contents into the dictionary for variables
that would be referenced only once.
Fallback to generic part number if the discovered part number is
unknown.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 311 ++++++++++++++++++++++++-----------------
 1 file changed, 183 insertions(+), 128 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7a74938bd..39cf98c67 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -27,124 +27,172 @@ flags_common = [
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
 
-# implementer specific aarch64 flags, with middle priority
-# (will overwrite common flags)
-flags_implementer_generic = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_MAX_LCORE', 256]
-]
-flags_implementer_arm = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16]
-]
-flags_implementer_cavium = [
-	['RTE_MAX_VFIO_GROUPS', 128],
-	['RTE_MAX_LCORE', 96],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_implementer_dpaa = [
-	['RTE_MACHINE', '"dpaa"'],
-	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_emag = [
-	['RTE_MACHINE', '"emag"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 32],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_implementer_armada = [
-	['RTE_MACHINE', '"armv8a"'],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 16],
-	['RTE_MAX_NUMA_NODES', 1]
-]
+## Part numbers are specific to Arm implementers
+# implementer specific aarch64 flags have middle priority
+#     (will overwrite common flags)
+# part number specific aarch64 flags have the highest priority
+#     (will overwrite both common and implementer specific flags)
+implementer_generic = {
+	'description': 'Generic armv8',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_MAX_LCORE', 256]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc',
+					     '-moutline-atomics']}
+	}
+}
+
+part_number_config_arm = {
+	'generic': {'machine_args':  ['-march=armv8-a+crc',
+				      '-moutline-atomics']},
+	'native': {'machine_args':  ['-march=native']},
+	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
+	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
+	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
+	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
+	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
+	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
+	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
+	'0xd0c': {
+		'machine_args':  ['-march=armv8.2-a+crypto',
+				  '-mcpu=neoverse-n1'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n1"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_MEM_MB', 1048576],
+			['RTE_MAX_LCORE', 80],
+			['RTE_MAX_NUMA_NODES', 1]
+		]
+	},
+	'0xd49': {
+		'machine_args':  ['-march=armv8.5-a+crypto+sve2'],
+		'flags': [
+			['RTE_MACHINE', '"neoverse-n2"'],
+			['RTE_ARM_FEATURE_ATOMICS', true],
+			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+			['RTE_LIBRTE_VHOST_NUMA', false],
+			['RTE_MAX_LCORE', 64]
+		]
+	}
+}
+implementer_arm = {
+	'description': 'Arm',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-# part number specific aarch64 flags, with highest priority
-# (will overwrite both common and implementer specific flags)
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]
 ]
-flags_part_number_thunderx2 = [
-	['RTE_MACHINE', '"thunderx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 256],
-	['RTE_MAX_NUMA_NODES', 2]
-]
-flags_part_number_octeontx2 = [
-	['RTE_MACHINE', '"octeontx2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_IGB_UIO', false],
-	['RTE_MAX_LCORE', 36],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n1generic = [
-	['RTE_MACHINE', '"neoverse-n1"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_MEM_MB', 1048576],
-	['RTE_CACHE_LINE_SIZE', 64],
-	['RTE_MAX_LCORE', 64],
-	['RTE_MAX_NUMA_NODES', 1]
-]
-flags_part_number_n2generic = [
-	['RTE_MACHINE', '"neoverse-n2"'],
-	['RTE_ARM_FEATURE_ATOMICS', true],
-	['RTE_USE_C11_MEM_MODEL', true],
-	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-	['RTE_LIBRTE_VHOST_NUMA', false],
-	['RTE_MAX_LCORE', 64],
-	['RTE_CACHE_LINE_SIZE', 64]
-]
+implementer_cavium = {
+	'description': 'Cavium',
+	'flags': [
+		['RTE_MAX_VFIO_GROUPS', 128],
+		['RTE_MAX_LCORE', 96],
+		['RTE_MAX_NUMA_NODES', 2]
+	],
+	'part_number_config': {
+		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
+					     '-mcpu=thunderx']},
+		'native': {'machine_args': ['-march=native']},
+		'0xa1': {
+			'machine_args': ['-mcpu=thunderxt88'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa2': {
+			'machine_args': ['-mcpu=thunderxt81'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xa3': {
+			'machine_args': ['-mcpu=thunderxt83'],
+			'flags': flags_part_number_thunderx
+		},
+		'0xaf': {
+			'machine_args': ['-march=armv8.1-a+crc+crypto',
+					 '-mcpu=thunderx2t99'],
+			'flags': [
+				['RTE_MACHINE', '"thunderx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_CACHE_LINE_SIZE', 64],
+				['RTE_MAX_LCORE', 256],
+				['RTE_MAX_NUMA_NODES', 2]
+			]
+		},
+		'0xb2': {
+			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
+					 '-mcpu=octeontx2'],
+			'flags': [
+				['RTE_MACHINE', '"octeontx2"'],
+				['RTE_ARM_FEATURE_ATOMICS', true],
+				['RTE_USE_C11_MEM_MODEL', true],
+				['RTE_EAL_IGB_UIO', false],
+				['RTE_MAX_LCORE', 36],
+				['RTE_MAX_NUMA_NODES', 1]
+			]
+		}
+	}
+}
 
-# arm config (implementer 0x41) is the default config
-part_number_config_arm = [
-	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
-	['native', ['-march=native']],
-	['0xd03', ['-mcpu=cortex-a53']],
-	['0xd04', ['-mcpu=cortex-a35']],
-	['0xd07', ['-mcpu=cortex-a57']],
-	['0xd08', ['-mcpu=cortex-a72']],
-	['0xd09', ['-mcpu=cortex-a73']],
-	['0xd0a', ['-mcpu=cortex-a75']],
-	['0xd0b', ['-mcpu=cortex-a76']],
-	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'], flags_part_number_n1generic],
-	['0xd49', ['-march=armv8.5-a+crypto+sve2'], flags_part_number_n2generic]
-]
+implementer_ampere = {
+	'description': 'Ampere Computing',
+	'flags': [
+		['RTE_MACHINE', '"emag"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 32],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': {
+		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					      '-mtune=emag']},
+		'native': {'machine_args':  ['-march=native']}
+	}
+}
 
-part_number_config_cavium = [
-	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
-	['native', ['-march=native']],
-	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
-	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
-	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
-	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'], flags_part_number_thunderx2],
-	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'], flags_part_number_octeontx2]
-]
-part_number_config_emag = [
-	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
-	['native', ['-march=native']]
-]
+implementer_marvell = {
+	'description': 'Marvell ARMADA',
+	'flags': [
+		['RTE_MACHINE', '"armv8a"'],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
+
+implementer_dpaa = {
+	'description': 'NXP DPAA',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_USE_C11_MEM_MODEL', true],
+		['RTE_CACHE_LINE_SIZE', 64],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
+	'part_number_config': part_number_config_arm
+}
 
-## Arm implementer ID (MIDR in Arm Architecture Reference Manual)
-implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
-implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
+## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
+implementers = {
+	'generic': implementer_generic,
+	'0x41': implementer_arm,
+	'0x43': implementer_cavium,
+	'0x50': implementer_ampere,
+	'0x56': implementer_marvell,
+	'dpaa': implementer_dpaa
+}
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
@@ -160,7 +208,7 @@ else
 	implementer_id = 'generic'
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
-		implementer_config = implementer_generic
+		implementer_config = implementer['generic']
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -175,9 +223,9 @@ else
 			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
+		implementer_config = implementers.get(implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
-			implementer_config = implementer_generic
+			implementer_config = implementer['generic']
 			part_number = 'generic'
 		endif
 		if arm_force_native_march == true
@@ -187,28 +235,35 @@ else
 		# cross build
 		implementer_id = meson.get_cross_property('implementer_id', 'generic')
 		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = get_variable('implementer_' + implementer_id)
+		implementer_config = implementers.get(implementer_id)
 	endif
 
-	message('Arm implementer: ' + implementer_config[0])
+	message('Arm implementer: ' + implementer_config['description'])
 	message('Arm part number: ' + part_number)
 
+	part_number_config = implementer_config['part_number_config']
+	if part_number_config.has_key(part_number)
+		# use the specified part_number machine args if found
+		part_number_config = part_number_config[part_number]
+	elif not meson.is_cross_build()
+		# default to generic machine args if part_number is not found
+		# and not forcing native machine args
+		# but don't default in cross-builds; if part_number is specified
+		# incorrectly in a cross-file, it needs to be fixed there
+		part_number_config = part_number_config['generic']
+	else
+		# doing cross build and part number is not in part_number_config
+		error('Cross build part number 0@0 not found.'.format(part_number))
+	endif
+
 	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config[1]
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
 
+	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach marg: implementer_config[2]
-		if marg[0] == part_number
-			# apply supported machine args
-			foreach flag: marg[1]
-				if cc.has_argument(flag)
-					machine_args += flag
-				endif
-			endforeach
-			if marg.length() > 2
-				# add extra flags for the part
-				dpdk_flags += marg[2]
-			endif
+	foreach flag: part_number_config['machine_args']
+		if cc.has_argument(flag)
+			machine_args += flag
 		endif
 	endforeach
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 06/12] build: isolate configuration for Arm generic build
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (4 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 05/12] build: organize Arm config into dict Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 07/12] build: use native machine args in Arm native build Juraj Linkeš
                                               ` (7 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Use generic configuration for the only build where it makes sense - the
generic build. For other builds, if we don't know either of implementer
ID or part number, the build is not supported.
Add part numbers to cross files where fallback to generic configuration
is assumed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_emag_linux_gcc               |  1 +
 ..._linux_gcc => arm64_thunderxt88_linux_gcc} |  1 +
 config/arm/meson.build                        | 45 +++++++++----------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  9 ++--
 6 files changed, 29 insertions(+), 29 deletions(-)
 rename config/arm/{arm64_thunderx_linux_gcc => arm64_thunderxt88_linux_gcc} (93%)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 52c5f4476..143a3c9f8 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x56'
+part_number = '0xd08'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 573ae7e42..c3c8a1ef6 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -15,3 +15,4 @@ endian = 'little'
 
 [properties]
 implementer_id = 'dpaa'
+part_number = '0xd08'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 24f3d533e..c675954fc 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x50'
+part_number = '0x0'
diff --git a/config/arm/arm64_thunderx_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
similarity index 93%
rename from config/arm/arm64_thunderx_linux_gcc
rename to config/arm/arm64_thunderxt88_linux_gcc
index 670764437..758966262 100644
--- a/config/arm/arm64_thunderx_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -14,3 +14,4 @@ endian = 'little'
 
 [properties]
 implementer_id = '0x43'
+part_number = '0xa1'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 39cf98c67..be9263058 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -46,8 +46,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'generic': {'machine_args':  ['-march=armv8-a+crc',
-				      '-moutline-atomics']},
 	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
@@ -103,8 +101,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
-					     '-mcpu=thunderx']},
 		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
@@ -154,8 +150,8 @@ implementer_ampere = {
 		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': {
-		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					      '-mtune=emag']},
+		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
+					  '-mtune=emag']},
 		'native': {'machine_args':  ['-march=native']}
 	}
 }
@@ -205,10 +201,9 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	implementer_id = 'generic'
 	if machine == 'default' and not meson.is_cross_build()
 		# default build
-		implementer_config = implementer['generic']
+		implementer_id = 'generic'
 		part_number = 'generic'
 	elif not meson.is_cross_build()
 		# native build
@@ -221,21 +216,24 @@ else
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
 			implementer_id = cmd_output[0]
 			part_number = cmd_output[3]
-		endif
-		# Set to generic if variable is not found
-		implementer_config = implementers.get(implementer_id, ['generic'])
-		if implementer_config[0] == 'generic'
-			implementer_config = implementer['generic']
-			part_number = 'generic'
+		else
+			error('Error when getting Arm Implementer ID and part number.')
 		endif
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id', 'generic')
-		part_number = meson.get_cross_property('part_number', 'generic')
-		implementer_config = implementers.get(implementer_id)
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+	endif
+
+	if implementers.has_key(implementer_id)
+		implementer_config = implementers[implementer_id]
+	else
+		error('Unsupported Arm implementer: @0@. '.format(implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	message('Arm implementer: ' + implementer_config['description'])
@@ -245,15 +243,12 @@ else
 	if part_number_config.has_key(part_number)
 		# use the specified part_number machine args if found
 		part_number_config = part_number_config[part_number]
-	elif not meson.is_cross_build()
-		# default to generic machine args if part_number is not found
-		# and not forcing native machine args
-		# but don't default in cross-builds; if part_number is specified
-		# incorrectly in a cross-file, it needs to be fixed there
-		part_number_config = part_number_config['generic']
 	else
-		# doing cross build and part number is not in part_number_config
-		error('Cross build part number 0@0 not found.'.format(part_number))
+		# unknown part number
+		error('Unsupported part number @0@ of implementer @1@. '
+		      .format(part_number, implementer_id) +
+		      'Please add support for it or use the generic ' +
+		      '(-Dmachine=generic) build.')
 	endif
 
 	# use default flags with implementer flags
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 972598835..6a883b030 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -114,8 +114,10 @@ you may use various combinations of implementer/part number::
       '0x56':    Marvell ARMADA
       'dpaa':    NXP DPAA
 
-   Supported part_numbers for generic, 0x41, 0x56, dpaa:
-      'generic': valid for all armv8-a architectures (default value)
+   Supported part_numbers for generic:
+      'generic': valid for all armv8-a architectures (unoptimized portable build)
+
+   Supported part_numbers for 0x41, 0x56, dpaa:
       '0xd03':   cortex-a53
       '0xd04':   cortex-a35
       '0xd09':   cortex-a73
@@ -124,7 +126,6 @@ you may use various combinations of implementer/part number::
       '0xd0c':   neoverse-n1
 
    Supported part_numbers for 0x43:
-      'generic': valid for all Cavium builds
       '0xa1':    thunderxt88
       '0xa2':    thunderxt81
       '0xa3':    thunderxt83
@@ -132,4 +133,4 @@ you may use various combinations of implementer/part number::
       '0xb2':    octeontx2
 
    Supported part_numbers for 0x50:
-      'generic': valid for all Ampere builds
+      '0x0':     emag
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 07/12] build: use native machine args in Arm native build
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (5 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
                                               ` (6 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Letting the compiler decide is going to yield the best results for
native builds, so use native machine args usable for both GCC and Clang.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build | 54 ++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 26 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index be9263058..9c33490e8 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,8 +2,6 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
-arm_force_native_march = false
-
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -26,6 +24,7 @@ flags_common = [
 	['RTE_ARCH_ARM64', true],
 	['RTE_CACHE_LINE_SIZE', 128]
 ]
+native_machine_args = ['-mcpu=native']
 
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
@@ -46,7 +45,6 @@ implementer_generic = {
 }
 
 part_number_config_arm = {
-	'native': {'machine_args':  ['-march=native']},
 	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
 	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
 	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
@@ -101,7 +99,6 @@ implementer_cavium = {
 		['RTE_MAX_NUMA_NODES', 2]
 	],
 	'part_number_config': {
-		'native': {'machine_args': ['-march=native']},
 		'0xa1': {
 			'machine_args': ['-mcpu=thunderxt88'],
 			'flags': flags_part_number_thunderx
@@ -151,8 +148,7 @@ implementer_ampere = {
 	],
 	'part_number_config': {
 		'0x0': {'machine_args':  ['-march=armv8-a+crc+crypto',
-					  '-mtune=emag']},
-		'native': {'machine_args':  ['-march=native']}
+					  '-mtune=emag']}
 	}
 }
 
@@ -201,26 +197,27 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
-	if machine == 'default' and not meson.is_cross_build()
-		# default build
-		implementer_id = 'generic'
-		part_number = 'generic'
-	elif not meson.is_cross_build()
-		# native 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(' ')
-			implementer_id = cmd_output[0]
-			part_number = cmd_output[3]
+	use_native_machine_args = false
+	if not meson.is_cross_build()
+		if machine == 'default'
+			# default build
+			implementer_id = 'generic'
+			part_number = 'generic'
 		else
-			error('Error when getting Arm Implementer ID and part number.')
-		endif
-		if arm_force_native_march == true
-			part_number = 'native'
+			# native 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(' ')
+				implementer_id = cmd_output[0]
+				part_number = cmd_output[3]
+			else
+				error('Error when getting Arm Implementer ID and part number.')
+			endif
+			use_native_machine_args = true
 		endif
 	else
 		# cross build
@@ -256,7 +253,12 @@ else
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
-	foreach flag: part_number_config['machine_args']
+	if use_native_machine_args
+		candidate_machine_args = native_machine_args
+	else
+		candidate_machine_args = part_number_config['machine_args']
+	endif
+	foreach flag: candidate_machine_args
 		if cc.has_argument(flag)
 			machine_args += flag
 		endif
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 08/12] build: add core and NUMA counts to cross files
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (6 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 07/12] build: use native machine args in Arm native build Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds Juraj Linkeš
                                               ` (5 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add support for setting core count and numa nodes in cross files. The
values specified in cross files will override the default values.
Also add missing default values to Arm config.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                 |  2 ++
 config/arm/arm64_armv8_linux_gcc                  |  2 ++
 config/arm/arm64_bluefield_linux_gcc              |  2 ++
 config/arm/arm64_dpaa_linux_gcc                   |  2 ++
 config/arm/arm64_emag_linux_gcc                   |  2 ++
 config/arm/arm64_graviton2_linux_gcc              |  2 ++
 config/arm/arm64_n1sdp_linux_gcc                  |  2 ++
 config/arm/arm64_n2_linux_gcc                     |  2 ++
 config/arm/arm64_octeontx2_linux_gcc              |  2 ++
 config/arm/arm64_stingray_linux_gcc               |  2 ++
 config/arm/arm64_thunderx2_linux_gcc              |  2 ++
 config/arm/arm64_thunderxt88_linux_gcc            |  2 ++
 config/arm/meson.build                            | 12 ++++++------
 config/meson.build                                | 15 +++++++++++++++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst      |  9 +++++++++
 15 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 143a3c9f8..2ecc4604c 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x56'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 0099f5ca2..5451a01da 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 # Generate binaries that are portable across all Armv8 machines
 implementer_id = 'generic'
 part_number = 'generic'
+max_lcores = 256
+max_numa_nodes = 4
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index c3c8a1ef6..8641fee63 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -16,3 +16,5 @@ endian = 'little'
 [properties]
 implementer_id = 'dpaa'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index c675954fc..7cbb05510 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x50'
 part_number = '0x0'
+max_lcores = 32
+max_numa_nodes = 1
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index 022e06303..d0bfec87d 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementor_id = '0x41'
 implementor_pn = '0xd0c'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 6fb3f02ea..138ae08c3 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd0c'
+max_lcores = 4
+max_numa_nodes = 1
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 3de5a6eb1..d249ccf91 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd49'
+max_lcores = 64
+max_numa_nodes = 1
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index ac1042806..26cf471ad 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xb2'
+max_lcores = 36
+max_numa_nodes = 1
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index b79389d85..4f56790c5 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x41'
 part_number = '0xd08'
+max_lcores = 16
+max_numa_nodes = 1
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index dd257745e..c06dcdc2b 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xaf'
+max_lcores = 256
+max_numa_nodes = 2
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 758966262..3ba1528e4 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -15,3 +15,5 @@ endian = 'little'
 [properties]
 implementer_id = '0x43'
 part_number = '0xa1'
+max_lcores = 96
+max_numa_nodes = 1
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 9c33490e8..d397471eb 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -36,7 +36,8 @@ implementer_generic = {
 	'flags': [
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_MAX_LCORE', 256]
+		['RTE_MAX_LCORE', 256],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': {
 		'generic': {'machine_args': ['-march=armv8-a+crc',
@@ -61,8 +62,7 @@ part_number_config_arm = {
 			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
 			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80],
-			['RTE_MAX_NUMA_NODES', 1]
+			['RTE_MAX_LCORE', 80]
 		]
 	},
 	'0xd49': {
@@ -82,7 +82,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16]
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -119,8 +120,7 @@ implementer_cavium = {
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
 				['RTE_CACHE_LINE_SIZE', 64],
-				['RTE_MAX_LCORE', 256],
-				['RTE_MAX_NUMA_NODES', 2]
+				['RTE_MAX_LCORE', 256]
 			]
 		},
 		'0xb2': {
diff --git a/config/meson.build b/config/meson.build
index a3154e29c..19c743091 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -253,6 +253,21 @@ compile_time_cpuflags = []
 subdir(arch_subdir)
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
+# apply cross-specific options
+if meson.is_cross_build()
+	# configure RTE_MAX_LCORE and RTE_MAX_NUMA_NODES from cross file
+	cross_max_lcores = meson.get_cross_property('max_lcores', 0)
+	if cross_max_lcores != 0
+		message('Setting RTE_MAX_LCORE from cross file')
+		dpdk_conf.set('RTE_MAX_LCORE', cross_max_lcores)
+	endif
+	cross_max_numa_nodes = meson.get_cross_property('max_numa_nodes', 0)
+	if cross_max_numa_nodes != 0
+		message('Setting RTE_MAX_NUMA_NODES from cross file')
+		dpdk_conf.set('RTE_MAX_NUMA_NODES', cross_max_numa_nodes)
+	endif
+endif
+
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 
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 6a883b030..4e65b271c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -134,3 +134,12 @@ you may use various combinations of implementer/part number::
 
    Supported part_numbers for 0x50:
       '0x0':     emag
+
+Other cross file options
+------------------------
+
+There are other options you may specify in a cross file to tailor the build::
+
+   Supported extra configuration
+      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
+      max_lcores = n      # will set RTE_MAX_LCORE
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (7 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-18 13:37                               ` Thomas Monjalon
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 10/12] build: disable libnuma in cross builds Juraj Linkeš
                                               ` (4 subsequent siblings)
  13 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

A few options that disabled drivers in the old makefiles were improperly
ported to the meson build system. Fix this by adding a to the list of
disabled drivers, similarly how the command line option works and remove
unneeded driver options ported from the old makefile system, since they
don't work in the current Meson build system.
Add support for removing drivers for cross builds so that we can disable
them in cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc                   | 1 +
 config/arm/meson.build                              | 7 +++----
 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 4 ++++
 drivers/meson.build                                 | 6 +++++-
 meson.build                                         | 1 +
 5 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 2ecc4604c..e365f61d0 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/meson.build b/config/arm/meson.build
index d397471eb..c6eecd14c 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -2,6 +2,9 @@
 # Copyright(c) 2017 Intel Corporation.
 # Copyright(c) 2017 Cavium, Inc
 
+# disable Arm drivers for all builds
+disabled_drivers += ['net/avp', 'net/fm10k']
+
 # common flags to all aarch64 builds, with lowest priority
 flags_common = [
 	# Accelerate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -16,9 +19,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -130,7 +130,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 4e65b271c..210ad4508 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -143,3 +143,7 @@ There are other options you may specify in a cross file to tailor the build::
    Supported extra configuration
       max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
       max_lcores = n      # will set RTE_MAX_LCORE
+
+      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
+         # valid values are directories (optionally with their subdirs)
+         # in the drivers directory
diff --git a/drivers/meson.build b/drivers/meson.build
index f9febc579..c307929a4 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,9 +18,13 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+disabled_drivers += run_command(list_dir_globs, get_option('disable_drivers'),
 		).stdout().split()
 
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+endif
+
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
diff --git a/meson.build b/meson.build
index 45d974cd2..fcc8931f0 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,7 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 10/12] build: disable libnuma in cross builds
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (8 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option Juraj Linkeš
                                               ` (3 subsequent siblings)
  13 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Some Arm SoCs are not NUMA systems. Add the capability to disable NUMA
for cross build and disable NUMA in Arm cross files.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |  1 +
 config/arm/arm64_bluefield_linux_gcc          |  1 +
 config/arm/arm64_dpaa_linux_gcc               |  1 +
 config/arm/arm64_graviton2_linux_gcc          |  1 +
 config/arm/arm64_n1sdp_linux_gcc              |  1 +
 config/arm/arm64_n2_linux_gcc                 |  1 +
 config/arm/arm64_octeontx2_linux_gcc          |  1 +
 config/arm/arm64_stingray_linux_gcc           |  1 +
 config/arm/meson.build                        |  4 ----
 config/meson.build                            | 19 +++++++++++++------
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  4 ++++
 11 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index e365f61d0..487cb2923 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -18,4 +18,5 @@ implementer_id = '0x56'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
 disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 8641fee63..37398c762 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -18,3 +18,4 @@ implementer_id = 'dpaa'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index d0bfec87d..cfe239797 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -17,3 +17,4 @@ implementor_id = '0x41'
 implementor_pn = '0xd0c'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index 138ae08c3..b00f2d1ef 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd0c'
 max_lcores = 4
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index d249ccf91..817b8ee28 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd49'
 max_lcores = 64
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 26cf471ad..593769709 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x43'
 part_number = '0xb2'
 max_lcores = 36
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 4f56790c5..6bef87fbd 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -17,3 +17,4 @@ implementer_id = '0x41'
 part_number = '0xd08'
 max_lcores = 16
 max_numa_nodes = 1
+numa = false
diff --git a/config/arm/meson.build b/config/arm/meson.build
index c6eecd14c..bf3adb2c6 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -59,8 +59,6 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_MEM_MB', 1048576],
 			['RTE_MAX_LCORE', 80]
 		]
@@ -70,8 +68,6 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
-			['RTE_LIBRTE_VHOST_NUMA', false],
 			['RTE_MAX_LCORE', 64]
 		]
 	}
diff --git a/config/meson.build b/config/meson.build
index 19c743091..f3d61b170 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -142,12 +142,19 @@ endif
 
 # check for libraries used in multiple places in DPDK
 has_libnuma = 0
-numa_dep = cc.find_library('numa', required: false)
-if numa_dep.found() and cc.has_header('numaif.h')
-	dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
-	has_libnuma = 1
-	add_project_link_arguments('-lnuma', language: 'c')
-	dpdk_extra_ldflags += '-lnuma'
+find_libnuma = true
+if meson.is_cross_build() and not meson.get_cross_property('numa', true)
+	# don't look for libnuma if explicitly disabled in cross build
+	find_libnuma = false
+endif
+if find_libnuma
+	numa_dep = cc.find_library('numa', required: false)
+	if numa_dep.found() and cc.has_header('numaif.h')
+		dpdk_conf.set10('RTE_HAS_LIBNUMA', true)
+		has_libnuma = 1
+		add_project_link_arguments('-lnuma', language: 'c')
+		dpdk_extra_ldflags += '-lnuma'
+	endif
 endif
 
 has_libfdt = 0
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 210ad4508..063661ebf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -147,3 +147,7 @@ There are other options you may specify in a cross file to tailor the build::
       disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
          # valid values are directories (optionally with their subdirs)
          # in the drivers directory
+
+      numa = false        # set to false to force building for a non-NUMA system
+         # if not set or set to true, the build system will build for a NUMA
+         # system only if libnuma is installed
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (9 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 10/12] build: disable libnuma in cross builds Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-18 13:41                               ` Thomas Monjalon
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
                                               ` (2 subsequent siblings)
  13 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration to Arm meson.build and add a meson option to
enable those options for native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   7 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 136 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  80 ++++-------
 meson_options.txt                             |   2 +
 15 files changed, 174 insertions(+), 113 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 487cb2923..7cc40d1f4 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,9 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
-disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+soc = 'armada'
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da..64d44ead8 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+soc = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd..7b1fae8b9 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c762..e52188842 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb05510..6c24b4bca 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+soc = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index cfe239797..bae35d6be 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementor_id = '0x41'
-implementor_pn = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef..249ff4738 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+soc = 'n1sdp'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 817b8ee28..157a88192 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd49'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+soc = 'n2'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 593769709..063018e8f 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+soc = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd..1209a8c0b 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+soc = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b..348650712 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+soc = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e4..d31d0c6d8 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+soc = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index bf3adb2c6..eb91e80ff 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -29,7 +29,7 @@ native_machine_args = ['-mcpu=native']
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -181,6 +181,106 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines.',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false,
+	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_n2 = {
+	'description': 'Arm Neoverse N2',
+	'implementer': '0x41',
+	'part_number': '0xd49',
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -193,11 +293,18 @@ if dpdk_conf.get('RTE_ARCH_32')
 else
 	# aarch64 build
 	use_native_machine_args = false
+	arm_soc = get_option('arm_soc')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
+			if arm_soc != ''
+				error('Arm SoC is unsupported with default build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif arm_soc != ''
+			soc_config = socs.get(arm_soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -216,8 +323,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		arm_soc = meson.get_cross_property('soc', '')
+		if arm_soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(arm_soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(arm_soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -243,8 +369,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 063661ebf..83bdb78bf 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -100,54 +100,32 @@ command::
 	meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
 	ninja -C arm64-build
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      disabled_drivers = ['bus/dpaa', 'crypto']  # add disabled drivers
-         # valid values are directories (optionally with their subdirs)
-         # in the drivers directory
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Darm_soc meson
+option::
+
+   meson soc_build -Darm_soc=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   soc = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index 460432822..2aa056aa1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,7 @@
 # Please keep these options sorted alphabetically.
 
+option('arm_soc', type: 'string', value: '',
+	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')
 option('disable_drivers', type: 'string', value: '',
 	description: 'Comma-separated list of drivers to explicitly disable.')
 option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (10 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option Juraj Linkeš
@ 2021-01-15 13:26                             ` Juraj Linkeš
  2021-01-18 13:45                               ` Thomas Monjalon
                                                 ` (2 more replies)
  2021-01-18 21:31                             ` [dpdk-dev] [PATCH v15 00/12] Arm build options rework Thomas Monjalon
  2021-02-03 14:03                             ` [dpdk-dev] [PATCH v16 0/3] " Juraj Linkeš
  13 siblings, 3 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-15 13:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build | 60 +++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 33 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index eb91e80ff..f6cd7a5e0 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -60,7 +60,8 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80]
+			['RTE_MAX_LCORE', 80],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	},
 	'0xd49': {
@@ -68,7 +69,8 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_MAX_LCORE', 64]
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	}
 }
@@ -78,8 +80,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -147,38 +149,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -191,8 +167,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false,
 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
 }
@@ -201,13 +181,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -251,6 +241,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v15 05/12] build: organize Arm config into dict
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 05/12] build: organize Arm config into dict Juraj Linkeš
@ 2021-01-16 14:12                               ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2021-01-16 14:12 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, nd


> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, January 15, 2021 9:26 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aboyer@pensando.io
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v15 05/12] build: organize Arm config into dict
> 
> Use dictionary lookup instead of checking for existing variables, iterating over
> all elements in the list or checking lists for optional configuration. Move
> variable contents into the dictionary for variables that would be referenced
> only once.
> Fallback to generic part number if the discovered part number is unknown.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  config/arm/meson.build | 311 ++++++++++++++++++++++++-----------------
>  1 file changed, 183 insertions(+), 128 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 7a74938bd..39cf98c67 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -27,124 +27,172 @@ flags_common = [
>  	['RTE_CACHE_LINE_SIZE', 128]
>  ]
> 
> -# implementer specific aarch64 flags, with middle priority -# (will overwrite
> common flags) -flags_implementer_generic = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_MAX_LCORE', 256]
> -]
> -flags_implementer_arm = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16]
> -]
> -flags_implementer_cavium = [
> -	['RTE_MAX_VFIO_GROUPS', 128],
> -	['RTE_MAX_LCORE', 96],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_implementer_dpaa = [
> -	['RTE_MACHINE', '"dpaa"'],
> -	['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_emag = [
> -	['RTE_MACHINE', '"emag"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 32],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_implementer_armada = [
> -	['RTE_MACHINE', '"armv8a"'],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 16],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> +## Part numbers are specific to Arm implementers # implementer specific
> +aarch64 flags have middle priority
> +#     (will overwrite common flags)
> +# part number specific aarch64 flags have the highest priority
> +#     (will overwrite both common and implementer specific flags)
> +implementer_generic = {
> +	'description': 'Generic armv8',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_MAX_LCORE', 256]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args': ['-march=armv8-a+crc',
> +					     '-moutline-atomics']}
> +	}
> +}
> +
> +part_number_config_arm = {
> +	'generic': {'machine_args':  ['-march=armv8-a+crc',
> +				      '-moutline-atomics']},
> +	'native': {'machine_args':  ['-march=native']},
> +	'0xd03': {'machine_args':  ['-mcpu=cortex-a53']},
> +	'0xd04': {'machine_args':  ['-mcpu=cortex-a35']},
> +	'0xd07': {'machine_args':  ['-mcpu=cortex-a57']},
> +	'0xd08': {'machine_args':  ['-mcpu=cortex-a72']},
> +	'0xd09': {'machine_args':  ['-mcpu=cortex-a73']},
> +	'0xd0a': {'machine_args':  ['-mcpu=cortex-a75']},
> +	'0xd0b': {'machine_args':  ['-mcpu=cortex-a76']},
> +	'0xd0c': {
> +		'machine_args':  ['-march=armv8.2-a+crypto',
> +				  '-mcpu=neoverse-n1'],
> +		'flags': [
> +			['RTE_MACHINE', '"neoverse-n1"'],
> +			['RTE_ARM_FEATURE_ATOMICS', true],
> +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> +			['RTE_LIBRTE_VHOST_NUMA', false],
> +			['RTE_MAX_MEM_MB', 1048576],
> +			['RTE_MAX_LCORE', 80],
> +			['RTE_MAX_NUMA_NODES', 1]
> +		]
> +	},
> +	'0xd49': {
> +		'machine_args':  ['-march=armv8.5-a+crypto+sve2'],
> +		'flags': [
> +			['RTE_MACHINE', '"neoverse-n2"'],
> +			['RTE_ARM_FEATURE_ATOMICS', true],
> +			['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> +			['RTE_LIBRTE_VHOST_NUMA', false],
> +			['RTE_MAX_LCORE', 64]
> +		]
> +	}
> +}
> +implementer_arm = {
> +	'description': 'Arm',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16]
> +	],
> +	'part_number_config': part_number_config_arm }
> 
> -# part number specific aarch64 flags, with highest priority -# (will overwrite
> both common and implementer specific flags)  flags_part_number_thunderx
> = [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]
>  ]
> -flags_part_number_thunderx2 = [
> -	['RTE_MACHINE', '"thunderx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 256],
> -	['RTE_MAX_NUMA_NODES', 2]
> -]
> -flags_part_number_octeontx2 = [
> -	['RTE_MACHINE', '"octeontx2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_IGB_UIO', false],
> -	['RTE_MAX_LCORE', 36],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_part_number_n1generic = [
> -	['RTE_MACHINE', '"neoverse-n1"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false],
> -	['RTE_MAX_MEM_MB', 1048576],
> -	['RTE_CACHE_LINE_SIZE', 64],
> -	['RTE_MAX_LCORE', 64],
> -	['RTE_MAX_NUMA_NODES', 1]
> -]
> -flags_part_number_n2generic = [
> -	['RTE_MACHINE', '"neoverse-n2"'],
> -	['RTE_ARM_FEATURE_ATOMICS', true],
> -	['RTE_USE_C11_MEM_MODEL', true],
> -	['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
> -	['RTE_LIBRTE_VHOST_NUMA', false],
> -	['RTE_MAX_LCORE', 64],
> -	['RTE_CACHE_LINE_SIZE', 64]
> -]
> +implementer_cavium = {
> +	'description': 'Cavium',
> +	'flags': [
> +		['RTE_MAX_VFIO_GROUPS', 128],
> +		['RTE_MAX_LCORE', 96],
> +		['RTE_MAX_NUMA_NODES', 2]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args': ['-march=armv8-a+crc+crypto',
> +					     '-mcpu=thunderx']},
> +		'native': {'machine_args': ['-march=native']},
> +		'0xa1': {
> +			'machine_args': ['-mcpu=thunderxt88'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xa2': {
> +			'machine_args': ['-mcpu=thunderxt81'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xa3': {
> +			'machine_args': ['-mcpu=thunderxt83'],
> +			'flags': flags_part_number_thunderx
> +		},
> +		'0xaf': {
> +			'machine_args': ['-march=armv8.1-a+crc+crypto',
> +					 '-mcpu=thunderx2t99'],
> +			'flags': [
> +				['RTE_MACHINE', '"thunderx2"'],
> +				['RTE_ARM_FEATURE_ATOMICS', true],
> +				['RTE_USE_C11_MEM_MODEL', true],
> +				['RTE_CACHE_LINE_SIZE', 64],
> +				['RTE_MAX_LCORE', 256],
> +				['RTE_MAX_NUMA_NODES', 2]
> +			]
> +		},
> +		'0xb2': {
> +			'machine_args': ['-march=armv8.2-a+crc+crypto+lse',
> +					 '-mcpu=octeontx2'],
> +			'flags': [
> +				['RTE_MACHINE', '"octeontx2"'],
> +				['RTE_ARM_FEATURE_ATOMICS', true],
> +				['RTE_USE_C11_MEM_MODEL', true],
> +				['RTE_EAL_IGB_UIO', false],
> +				['RTE_MAX_LCORE', 36],
> +				['RTE_MAX_NUMA_NODES', 1]
> +			]
> +		}
> +	}
> +}
> 
> -# arm config (implementer 0x41) is the default config -
> part_number_config_arm = [
> -	['generic', ['-march=armv8-a+crc', '-moutline-atomics']],
> -	['native', ['-march=native']],
> -	['0xd03', ['-mcpu=cortex-a53']],
> -	['0xd04', ['-mcpu=cortex-a35']],
> -	['0xd07', ['-mcpu=cortex-a57']],
> -	['0xd08', ['-mcpu=cortex-a72']],
> -	['0xd09', ['-mcpu=cortex-a73']],
> -	['0xd0a', ['-mcpu=cortex-a75']],
> -	['0xd0b', ['-mcpu=cortex-a76']],
> -	['0xd0c', ['-march=armv8.2-a+crypto', '-mcpu=neoverse-n1'],
> flags_part_number_n1generic],
> -	['0xd49', ['-march=armv8.5-a+crypto+sve2'],
> flags_part_number_n2generic]
> -]
> +implementer_ampere = {
> +	'description': 'Ampere Computing',
> +	'flags': [
> +		['RTE_MACHINE', '"emag"'],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 32],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': {
> +		'generic': {'machine_args':  ['-march=armv8-a+crc+crypto',
> +					      '-mtune=emag']},
> +		'native': {'machine_args':  ['-march=native']}
> +	}
> +}
> 
> -part_number_config_cavium = [
> -	['generic', ['-march=armv8-a+crc+crypto','-mcpu=thunderx']],
> -	['native', ['-march=native']],
> -	['0xa1', ['-mcpu=thunderxt88'], flags_part_number_thunderx],
> -	['0xa2', ['-mcpu=thunderxt81'], flags_part_number_thunderx],
> -	['0xa3', ['-mcpu=thunderxt83'], flags_part_number_thunderx],
> -	['0xaf', ['-march=armv8.1-a+crc+crypto','-mcpu=thunderx2t99'],
> flags_part_number_thunderx2],
> -	['0xb2', ['-march=armv8.2-a+crc+crypto+lse','-mcpu=octeontx2'],
> flags_part_number_octeontx2]
> -]
> -part_number_config_emag = [
> -	['generic', ['-march=armv8-a+crc+crypto', '-mtune=emag']],
> -	['native', ['-march=native']]
> -]
> +implementer_marvell = {
> +	'description': 'Marvell ARMADA',
> +	'flags': [
> +		['RTE_MACHINE', '"armv8a"'],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': part_number_config_arm }
> +
> +implementer_dpaa = {
> +	'description': 'NXP DPAA',
> +	'flags': [
> +		['RTE_MACHINE', '"dpaa"'],
> +		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
> +		['RTE_USE_C11_MEM_MODEL', true],
> +		['RTE_CACHE_LINE_SIZE', 64],
> +		['RTE_MAX_LCORE', 16],
> +		['RTE_MAX_NUMA_NODES', 1]
> +	],
> +	'part_number_config': part_number_config_arm }
> 
> -## Arm implementer ID (MIDR in Arm Architecture Reference Manual) -
> implementer_generic = ['Generic armv8', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
> -implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium]
> -implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> part_number_config_emag]
> -implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> part_number_config_arm] -implementer_dpaa = ['NXP DPAA',
> flags_implementer_dpaa, part_number_config_arm]
> +## Arm implementers (ID from MIDR in Arm Architecture Reference
> Manual)
> +implementers = {
> +	'generic': implementer_generic,
> +	'0x41': implementer_arm,
> +	'0x43': implementer_cavium,
> +	'0x50': implementer_ampere,
> +	'0x56': implementer_marvell,
> +	'dpaa': implementer_dpaa
> +}
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
>  dpdk_conf.set('RTE_FORCE_INTRINSICS', 1) @@ -160,7 +208,7 @@ else
>  	implementer_id = 'generic'
>  	if machine == 'default' and not meson.is_cross_build()
>  		# default build
> -		implementer_config = implementer_generic
> +		implementer_config = implementer['generic']
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
>  		# native build
> @@ -175,9 +223,9 @@ else
>  			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> implementer_id, ['generic'])
> +		implementer_config = implementers.get(implementer_id,
> ['generic'])
>  		if implementer_config[0] == 'generic'
> -			implementer_config = implementer_generic
> +			implementer_config = implementer['generic']
>  			part_number = 'generic'
>  		endif
>  		if arm_force_native_march == true
> @@ -187,28 +235,35 @@ else
>  		# cross build
>  		implementer_id =
> meson.get_cross_property('implementer_id', 'generic')
>  		part_number = meson.get_cross_property('part_number',
> 'generic')
> -		implementer_config = get_variable('implementer_' +
> implementer_id)
> +		implementer_config = implementers.get(implementer_id)
>  	endif
> 
> -	message('Arm implementer: ' + implementer_config[0])
> +	message('Arm implementer: ' + implementer_config['description'])
>  	message('Arm part number: ' + part_number)
> 
> +	part_number_config = implementer_config['part_number_config']
> +	if part_number_config.has_key(part_number)
> +		# use the specified part_number machine args if found
> +		part_number_config = part_number_config[part_number]
> +	elif not meson.is_cross_build()
> +		# default to generic machine args if part_number is not found
> +		# and not forcing native machine args
> +		# but don't default in cross-builds; if part_number is specified
> +		# incorrectly in a cross-file, it needs to be fixed there
> +		part_number_config = part_number_config['generic']
> +	else
> +		# doing cross build and part number is not in
> part_number_config
> +		error('Cross build part number 0@0 not
> found.'.format(part_number))
> +	endif
> +
>  	# use default flags with implementer flags
> -	dpdk_flags = flags_common + implementer_config[1]
> +	dpdk_flags = flags_common + implementer_config['flags'] +
> +part_number_config.get('flags', [])
> 
> +	# apply supported machine args
>  	machine_args = [] # Clear previous machine args
> -	foreach marg: implementer_config[2]
> -		if marg[0] == part_number
> -			# apply supported machine args
> -			foreach flag: marg[1]
> -				if cc.has_argument(flag)
> -					machine_args += flag
> -				endif
> -			endforeach
> -			if marg.length() > 2
> -				# add extra flags for the part
> -				dpdk_flags += marg[2]
> -			endif
> +	foreach flag: part_number_config['machine_args']
> +		if cc.has_argument(flag)
> +			machine_args += flag
>  		endif
>  	endforeach
> 
> --
> 2.20.1

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds Juraj Linkeš
@ 2021-01-18 13:37                               ` Thomas Monjalon
  2021-01-19 15:35                                 ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-18 13:37 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev

15/01/2021 14:26, Juraj Linkeš:
> A few options that disabled drivers in the old makefiles were improperly
> ported to the meson build system. Fix this by adding a to the list of

"by adding a" what?

> disabled drivers, similarly how the command line option works and remove
> unneeded driver options ported from the old makefile system, since they
> don't work in the current Meson build system.
> Add support for removing drivers for cross builds so that we can disable
> them in cross files.

Why disabling them?
If a driver is not supported it should disable itseld in its meson file.

[...]
> --- a/config/arm/arm64_armada_linux_gcc
> +++ b/config/arm/arm64_armada_linux_gcc
> @@ -18,3 +18,4 @@ implementer_id = '0x56'
>  part_number = '0xd08'
>  max_lcores = 16
>  max_numa_nodes = 1
> +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']

It's removing NXP drivers on Marvell SoC. Fine.
And what about other useless drivers?

> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> +# disable Arm drivers for all builds
> +disabled_drivers += ['net/avp', 'net/fm10k']

Why disabling avp and fm10k? Did they do something wrong to be banned?




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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option Juraj Linkeš
@ 2021-01-18 13:41                               ` Thomas Monjalon
  2021-01-19 14:56                                 ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-18 13:41 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev

15/01/2021 14:26, Juraj Linkeš:
> Add Arm SoC configuration to Arm meson.build and add a meson option to
> enable those options for native builds. This is preferable to
> specifying a cross file when doing aarch64 -> aarch64 builds, since the
> cross file specifies the toolchain as well.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
[...]
> --- a/config/arm/arm64_graviton2_linux_gcc
> +++ b/config/arm/arm64_graviton2_linux_gcc
>  [properties]
> -implementor_id = '0x41'
> -implementor_pn = '0xd0c'
> -max_lcores = 64
> -max_numa_nodes = 1
> -numa = false
> +soc = 'graviton2'
[...]
> --- a/meson_options.txt
> +++ b/meson_options.txt
> +option('arm_soc', type: 'string', value: '',
> +	description: 'Specify if you want to build for a particular aarch64 Arm SoC when building on an aarch64 machine.')

This is more elegant, I like how cross and native share almost the same option.

Why the option is named "arm_soc" and not just "soc"?
The same option could be used by other archs, isn't it?



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

* Re: [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-01-18 13:45                               ` Thomas Monjalon
  2021-01-18 14:02                                 ` [dpdk-dev] [EXT] " Liron Himi
  2021-01-18 15:03                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
       [not found]                               ` <DM6PR12MB3753721F869FE4530C0739EADFA40@DM6PR12MB3753.namprd12.prod.outlook.com>
  2 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-18 13:45 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev, lironh, rasland,
	viacheslavo

15/01/2021 14:26, Juraj Linkeš:
> Fix the implementer and part number of DPAA and ARMADA SoCs.
> The current values of 16 cores and 1 NUMA node don't cover all SoCs from
> the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
> Increase these to 64 and 4 to widen the coverage.
> Add configuration to SoC options where smaller values are needed.
> 
> Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
> Cc: hemant.agrawal@nxp.com
> Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
> Cc: lironh@marvell.com
> Fixes: d97108a33231 ("config: change defaults of armv8")
> Cc: yskoh@mellanox.com
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

We are missing acks for Broacom, Marvell, Nvidia and NXP SoC values.

Repeating clearly: we NEED REVIEW TODAY from all of you!



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

* Re: [dpdk-dev] [EXT] Re: [PATCH v15 12/12] config: fix Arm implementer and its SoCs
  2021-01-18 13:45                               ` Thomas Monjalon
@ 2021-01-18 14:02                                 ` Liron Himi
  0 siblings, 0 replies; 465+ messages in thread
From: Liron Himi @ 2021-01-18 14:02 UTC (permalink / raw)
  To: Thomas Monjalon, Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev, rasland, viacheslavo,
	Liron Himi

Reviewed-by: Liron Himi <lironh@marvell.com>

-----Original Message-----
From: Thomas Monjalon <thomas@monjalon.net> 
Sent: Monday, 18 January 2021 15:45
To: Juraj Linkeš <juraj.linkes@pantheon.tech>
Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com; hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io; dev@dpdk.org; Liron Himi <lironh@marvell.com>; rasland@nvidia.com; viacheslavo@nvidia.com
Subject: [EXT] Re: [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs

External Email

----------------------------------------------------------------------
15/01/2021 14:26, Juraj Linkeš:
> Fix the implementer and part number of DPAA and ARMADA SoCs.
> The current values of 16 cores and 1 NUMA node don't cover all SoCs 
> from the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
> Increase these to 64 and 4 to widen the coverage.
> Add configuration to SoC options where smaller values are needed.
> 
> Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
> Cc: hemant.agrawal@nxp.com
> Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
> Cc: lironh@marvell.com
> Fixes: d97108a33231 ("config: change defaults of armv8")
> Cc: yskoh@mellanox.com
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

We are missing acks for Broacom, Marvell, Nvidia and NXP SoC values.

Repeating clearly: we NEED REVIEW TODAY from all of you!



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

* Re: [dpdk-dev] [EXT] [PATCH v15 12/12] config: fix Arm implementer and its SoCs
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
  2021-01-18 13:45                               ` Thomas Monjalon
@ 2021-01-18 15:03                               ` Pavan Nikhilesh Bhagavatula
       [not found]                               ` <DM6PR12MB3753721F869FE4530C0739EADFA40@DM6PR12MB3753.namprd12.prod.outlook.com>
  2 siblings, 0 replies; 465+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2021-01-18 15:03 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Liron Himi, yskoh



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Juraj Linkeš
>Sent: Friday, January 15, 2021 6:56 PM
>To: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
>Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
>vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
>jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
>ajit.khaparde@broadcom.com; ferruh.yigit@intel.com;
>aboyer@pensando.io
>Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>; Liron
>Himi <lironh@marvell.com>; yskoh@mellanox.com
>Subject: [EXT] [dpdk-dev] [PATCH v15 12/12] config: fix Arm
>implementer and its SoCs
>
>External Email
>
>----------------------------------------------------------------------
>Fix the implementer and part number of DPAA and ARMADA SoCs.
>The current values of 16 cores and 1 NUMA node don't cover all SoCs
>from
>the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA
>nodes.
>Increase these to 64 and 4 to widen the coverage.
>Add configuration to SoC options where smaller values are needed.
>
>Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
>Cc: hemant.agrawal@nxp.com
>Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
>Cc: lironh@marvell.com
>Fixes: d97108a33231 ("config: change defaults of armv8")
>Cc: yskoh@mellanox.com
>
>Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
>Reviewed-by: Honnappa Nagarahalli
><honnappa.nagarahalli@arm.com>

Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

>---
> config/arm/meson.build | 60 +++++++++++++++++++----------------------
>-
> 1 file changed, 27 insertions(+), 33 deletions(-)
>
>diff --git a/config/arm/meson.build b/config/arm/meson.build
>index eb91e80ff..f6cd7a5e0 100644
>--- a/config/arm/meson.build
>+++ b/config/arm/meson.build
>@@ -60,7 +60,8 @@ part_number_config_arm = {
> 			['RTE_MACHINE', '"neoverse-n1"'],
> 			['RTE_ARM_FEATURE_ATOMICS', true],
> 			['RTE_MAX_MEM_MB', 1048576],
>-			['RTE_MAX_LCORE', 80]
>+			['RTE_MAX_LCORE', 80],
>+			['RTE_MAX_NUMA_NODES', 1]
> 		]
> 	},
> 	'0xd49': {
>@@ -68,7 +69,8 @@ part_number_config_arm = {
> 		'flags': [
> 			['RTE_MACHINE', '"neoverse-n2"'],
> 			['RTE_ARM_FEATURE_ATOMICS', true],
>-			['RTE_MAX_LCORE', 64]
>+			['RTE_MAX_LCORE', 64],
>+			['RTE_MAX_NUMA_NODES', 1]
> 		]
> 	}
> }
>@@ -78,8 +80,8 @@ implementer_arm = {
> 		['RTE_MACHINE', '"armv8a"'],
> 		['RTE_USE_C11_MEM_MODEL', true],
> 		['RTE_CACHE_LINE_SIZE', 64],
>-		['RTE_MAX_LCORE', 16],
>-		['RTE_MAX_NUMA_NODES', 1]
>+		['RTE_MAX_LCORE', 64],
>+		['RTE_MAX_NUMA_NODES', 4]
> 	],
> 	'part_number_config': part_number_config_arm
> }
>@@ -147,38 +149,12 @@ implementer_ampere = {
> 	}
> }
>
>-implementer_marvell = {
>-	'description': 'Marvell ARMADA',
>-	'flags': [
>-		['RTE_MACHINE', '"armv8a"'],
>-		['RTE_CACHE_LINE_SIZE', 64],
>-		['RTE_MAX_LCORE', 16],
>-		['RTE_MAX_NUMA_NODES', 1]
>-	],
>-	'part_number_config': part_number_config_arm
>-}
>-
>-implementer_dpaa = {
>-	'description': 'NXP DPAA',
>-	'flags': [
>-		['RTE_MACHINE', '"dpaa"'],
>-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
>-		['RTE_USE_C11_MEM_MODEL', true],
>-		['RTE_CACHE_LINE_SIZE', 64],
>-		['RTE_MAX_LCORE', 16],
>-		['RTE_MAX_NUMA_NODES', 1]
>-	],
>-	'part_number_config': part_number_config_arm
>-}
>-
> ## Arm implementers (ID from MIDR in Arm Architecture Reference
>Manual)
> implementers = {
> 	'generic': implementer_generic,
> 	'0x41': implementer_arm,
> 	'0x43': implementer_cavium,
>-	'0x50': implementer_ampere,
>-	'0x56': implementer_marvell,
>-	'dpaa': implementer_dpaa
>+	'0x50': implementer_ampere
> }
>
> # soc specific aarch64 flags have the highest priority
>@@ -191,8 +167,12 @@ soc_generic = {
>
> soc_armada = {
> 	'description': 'Marvell ARMADA',
>-	'implementer': '0x56',
>+	'implementer': '0x41',
> 	'part_number': '0xd08',
>+	'flags': [
>+		['RTE_MAX_LCORE', 16],
>+		['RTE_MAX_NUMA_NODES', 1]
>+	],
> 	'numa': false,
> 	'disabled_drivers': ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> }
>@@ -201,13 +181,23 @@ soc_bluefield = {
> 	'description': 'NVIDIA BlueField',
> 	'implementer': '0x41',
> 	'part_number': '0xd08',
>+	'flags': [
>+		['RTE_MAX_LCORE', 16],
>+		['RTE_MAX_NUMA_NODES', 1]
>+	],
> 	'numa': false
> }
>
> soc_dpaa = {
> 	'description': 'NXP DPAA',
>-	'implementer': 'dpaa',
>+	'implementer': '0x41',
> 	'part_number': '0xd08',
>+	'flags': [
>+		['RTE_MACHINE', '"dpaa"'],
>+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
>+		['RTE_MAX_LCORE', 16],
>+		['RTE_MAX_NUMA_NODES', 1]
>+	],
> 	'numa': false
> }
>
>@@ -251,6 +241,10 @@ soc_octeontx2 = {
> soc_stingray = {
> 	'description': 'Broadcom Stingray',
> 	'implementer': '0x41',
>+	'flags': [
>+		['RTE_MAX_LCORE', 16],
>+		['RTE_MAX_NUMA_NODES', 1]
>+	],
> 	'part_number': '0xd08',
> 	'numa': false
> }
>--
>2.20.1


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

* Re: [dpdk-dev] [PATCH v15 00/12] Arm build options rework
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (11 preceding siblings ...)
  2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-01-18 21:31                             ` Thomas Monjalon
  2021-01-19 15:10                               ` Juraj Linkeš
  2021-02-03 14:03                             ` [dpdk-dev] [PATCH v16 0/3] " Juraj Linkeš
  13 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-18 21:31 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev

15/01/2021 14:25, Juraj Linkeš:
>   build: rename Arm build variables
>   build: remove unused or superfluous variables
>   build: reformat and move Arm config and comments
>   build: simplify how Arm flags are processed
>   build: organize Arm config into dict
>   build: isolate configuration for Arm generic build
>   build: use native machine args in Arm native build
>   build: add core and NUMA counts to cross files
>   build: disable libnuma in cross builds

These patches look good, thanks for the work.

I consider these patches (9, 11, 12) need more review or rework:

>   build: disable drivers in Arm builds
>   build: add Arm SoC meson option
>   config: fix Arm implementer and its SoCs

I've decided to partially apply the series to have progress in 21.02-rc1.
Please let's continue with these three patches during -rc2.



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

* Re: [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs
       [not found]                               ` <DM6PR12MB3753721F869FE4530C0739EADFA40@DM6PR12MB3753.namprd12.prod.outlook.com>
@ 2021-01-19  8:38                                 ` Slava Ovsiienko
  0 siblings, 0 replies; 465+ messages in thread
From: Slava Ovsiienko @ 2021-01-19  8:38 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, lironh, yskoh

Resend the letter due to SMTP issues.

> Fix the implementer and part number of DPAA and ARMADA SoCs.
> The current values of 16 cores and 1 NUMA node don't cover all SoCs
> from the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA
nodes.
> Increase these to 64 and 4 to widen the coverage.
> Add configuration to SoC options where smaller values are needed.
>
> Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
> Cc: hemant.agrawal@nxp.com
> Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
> Cc: lironh@marvell.com
> Fixes: d97108a33231 ("config: change defaults of armv8")
> Cc: yskoh@mellanox.com
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
 
It seems nVidia Bluefield configuration is preserved, in this part:
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>


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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-18 13:41                               ` Thomas Monjalon
@ 2021-01-19 14:56                                 ` Juraj Linkeš
  2021-01-19 15:52                                   ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-19 14:56 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, January 18, 2021 2:42 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; aboyer@pensando.io; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
> 
> 15/01/2021 14:26, Juraj Linkeš:
> > Add Arm SoC configuration to Arm meson.build and add a meson option to
> > enable those options for native builds. This is preferable to
> > specifying a cross file when doing aarch64 -> aarch64 builds, since
> > the cross file specifies the toolchain as well.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> [...]
> > --- a/config/arm/arm64_graviton2_linux_gcc
> > +++ b/config/arm/arm64_graviton2_linux_gcc
> >  [properties]
> > -implementor_id = '0x41'
> > -implementor_pn = '0xd0c'
> > -max_lcores = 64
> > -max_numa_nodes = 1
> > -numa = false
> > +soc = 'graviton2'
> [...]
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > +option('arm_soc', type: 'string', value: '',
> > +	description: 'Specify if you want to build for a particular aarch64
> > +Arm SoC when building on an aarch64 machine.')
> 
> This is more elegant, I like how cross and native share almost the same option.
> 
> Why the option is named "arm_soc" and not just "soc"?
> The same option could be used by other archs, isn't it?
> 
> 

Agree that a more generic name would be better. I'll change it to "soc" if there are no other suggestions.

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

* Re: [dpdk-dev] [PATCH v15 00/12] Arm build options rework
  2021-01-18 21:31                             ` [dpdk-dev] [PATCH v15 00/12] Arm build options rework Thomas Monjalon
@ 2021-01-19 15:10                               ` Juraj Linkeš
  2021-01-19 15:53                                 ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-19 15:10 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, January 18, 2021 10:31 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; aboyer@pensando.io; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v15 00/12] Arm build options rework
> 
> 15/01/2021 14:25, Juraj Linkeš:
> >   build: rename Arm build variables
> >   build: remove unused or superfluous variables
> >   build: reformat and move Arm config and comments
> >   build: simplify how Arm flags are processed
> >   build: organize Arm config into dict
> >   build: isolate configuration for Arm generic build
> >   build: use native machine args in Arm native build
> >   build: add core and NUMA counts to cross files
> >   build: disable libnuma in cross builds
> 
> These patches look good, thanks for the work.
> 

Thanks, Thomas, this will simplify the review.

> I consider these patches (9, 11, 12) need more review or rework:
> 
> >   build: disable drivers in Arm builds
> >   build: add Arm SoC meson option
> >   config: fix Arm implementer and its SoCs
> 
> I've decided to partially apply the series to have progress in 21.02-rc1.
> Please let's continue with these three patches during -rc2.
> 
> 

Should I submit new version as continuation of this series or should these three patches constitute a new series?

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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-18 13:37                               ` Thomas Monjalon
@ 2021-01-19 15:35                                 ` Juraj Linkeš
  2021-01-19 15:55                                   ` Liron Himi
  2021-01-20  1:11                                   ` Honnappa Nagarahalli
  0 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-19 15:35 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev, lironh, allain.legacy

+ Liron, Allain

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, January 18, 2021 2:37 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com;
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com;
> vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com;
> ferruh.yigit@intel.com; aboyer@pensando.io; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
> 
> 15/01/2021 14:26, Juraj Linkeš:
> > A few options that disabled drivers in the old makefiles were
> > improperly ported to the meson build system. Fix this by adding a to
> > the list of
> 
> "by adding a" what?

This is a typo, the "a" should not be there. Would that be ok wording?

> 
> > disabled drivers, similarly how the command line option works and
> > remove unneeded driver options ported from the old makefile system,
> > since they don't work in the current Meson build system.
> > Add support for removing drivers for cross builds so that we can
> > disable them in cross files.
> 
> Why disabling them?
> If a driver is not supported it should disable itseld in its meson file.
> 

This is helpful when building for an SoC where we don't want to build to build a driver, but the build machine actually supports the driver. I believe in this case the meson build system would find the dependencies and designate the driver to be build, but we don't want to build the driver for that SoC.

There may be other reasons as well - Honnappa or others from the Arm community may shed more light on this.

> [...]
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -18,3 +18,4 @@ implementer_id = '0x56'
> >  part_number = '0xd08'
> >  max_lcores = 16
> >  max_numa_nodes = 1
> > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> 
> It's removing NXP drivers on Marvell SoC. Fine.
> And what about other useless drivers?
> 

I only removed what was in the old Makefiles, so I don't really know. Liron or Jerin may be able to give us some insight.

> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > +# disable Arm drivers for all builds
> > +disabled_drivers += ['net/avp', 'net/fm10k']
> 
> Why disabling avp and fm10k? Did they do something wrong to be banned?
> 
> 
> 

This config is not only in the old Makefiles, but also in the current meson build system. I believe Jerin and Allain are the original authors, so they may be able to answer.

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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-19 14:56                                 ` Juraj Linkeš
@ 2021-01-19 15:52                                   ` Thomas Monjalon
  2021-01-19 16:04                                     ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-19 15:52 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev

19/01/2021 15:56, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 15/01/2021 14:26, Juraj Linkeš:
> > > Add Arm SoC configuration to Arm meson.build and add a meson option to
> > > enable those options for native builds. This is preferable to
> > > specifying a cross file when doing aarch64 -> aarch64 builds, since
> > > the cross file specifies the toolchain as well.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > [...]
> > > --- a/config/arm/arm64_graviton2_linux_gcc
> > > +++ b/config/arm/arm64_graviton2_linux_gcc
> > >  [properties]
> > > -implementor_id = '0x41'
> > > -implementor_pn = '0xd0c'
> > > -max_lcores = 64
> > > -max_numa_nodes = 1
> > > -numa = false
> > > +soc = 'graviton2'
> > [...]
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > +option('arm_soc', type: 'string', value: '',
> > > +	description: 'Specify if you want to build for a particular aarch64
> > > +Arm SoC when building on an aarch64 machine.')
> > 
> > This is more elegant, I like how cross and native share almost the same option.
> > 
> > Why the option is named "arm_soc" and not just "soc"?
> > The same option could be used by other archs, isn't it?
> 
> Agree that a more generic name would be better.
> I'll change it to "soc" if there are no other suggestions.

Another name could be "machine".
Should it be the same mechanism as compiling for a specific x86 CPU
from an x86 machine?




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

* Re: [dpdk-dev] [PATCH v15 00/12] Arm build options rework
  2021-01-19 15:10                               ` Juraj Linkeš
@ 2021-01-19 15:53                                 ` Thomas Monjalon
  0 siblings, 0 replies; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-19 15:53 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev

19/01/2021 16:10, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > I consider these patches (9, 11, 12) need more review or rework:
> > 
> > >   build: disable drivers in Arm builds
> > >   build: add Arm SoC meson option
> > >   config: fix Arm implementer and its SoCs
> > 
> > I've decided to partially apply the series to have progress in 21.02-rc1.
> > Please let's continue with these three patches during -rc2.
> 
> Should I submit new version as continuation of this series or should these three patches constitute a new series?

Continuing the series may help tracking the history.



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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-19 15:35                                 ` Juraj Linkeš
@ 2021-01-19 15:55                                   ` Liron Himi
  2021-01-20  1:11                                   ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Liron Himi @ 2021-01-19 15:55 UTC (permalink / raw)
  To: Juraj Linkeš, Thomas Monjalon
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev, allain.legacy,
	Liron Himi


-----Original Message-----
From: Juraj Linkeš <juraj.linkes@pantheon.tech> 
Sent: Tuesday, 19 January 2021 17:36
To: Thomas Monjalon <thomas@monjalon.net>
Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com; hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io; dev@dpdk.org; Liron Himi <lironh@marvell.com>; allain.legacy@windriver.com
Subject: [EXT] RE: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds

External Email

----------------------------------------------------------------------
+ Liron, Allain

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Monday, January 18, 2021 2:37 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: bruce.richardson@intel.com; Ruifeng.Wang@arm.com; 
> Honnappa.Nagarahalli@arm.com; Phil.Yang@arm.com; vcchunga@amazon.com; 
> Dharmik.Thakkar@arm.com; jerinjacobk@gmail.com; 
> hemant.agrawal@nxp.com; ajit.khaparde@broadcom.com; 
> ferruh.yigit@intel.com; aboyer@pensando.io; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in 
> Arm builds
> 
> 15/01/2021 14:26, Juraj Linkeš:
> > A few options that disabled drivers in the old makefiles were 
> > improperly ported to the meson build system. Fix this by adding a to 
> > the list of
> 
> "by adding a" what?

This is a typo, the "a" should not be there. Would that be ok wording?

> 
> > disabled drivers, similarly how the command line option works and 
> > remove unneeded driver options ported from the old makefile system, 
> > since they don't work in the current Meson build system.
> > Add support for removing drivers for cross builds so that we can 
> > disable them in cross files.
> 
> Why disabling them?
> If a driver is not supported it should disable itseld in its meson file.
> 

This is helpful when building for an SoC where we don't want to build to build a driver, but the build machine actually supports the driver. I believe in this case the meson build system would find the dependencies and designate the driver to be build, but we don't want to build the driver for that SoC.

There may be other reasons as well - Honnappa or others from the Arm community may shed more light on this.

> [...]
> > --- a/config/arm/arm64_armada_linux_gcc
> > +++ b/config/arm/arm64_armada_linux_gcc
> > @@ -18,3 +18,4 @@ implementer_id = '0x56'
> >  part_number = '0xd08'
> >  max_lcores = 16
> >  max_numa_nodes = 1
> > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> 
> It's removing NXP drivers on Marvell SoC. Fine.
> And what about other useless drivers?
> 

I only removed what was in the old Makefiles, so I don't really know. Liron or Jerin may be able to give us some insight.
[L.H.] In the past we had conflict with DPAA drivers, but recently we fixed it.
So no need for that anymore.

> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > +# disable Arm drivers for all builds disabled_drivers += 
> > +['net/avp', 'net/fm10k']
> 
> Why disabling avp and fm10k? Did they do something wrong to be banned?
> 
> 
> 

This config is not only in the old Makefiles, but also in the current meson build system. I believe Jerin and Allain are the original authors, so they may be able to answer.

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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-19 15:52                                   ` Thomas Monjalon
@ 2021-01-19 16:04                                     ` Bruce Richardson
  2021-01-20  1:04                                       ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-01-19 16:04 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Juraj Linkeš,
	Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev

On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> 19/01/2021 15:56, Juraj Linkeš:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 15/01/2021 14:26, Juraj Linkeš:
> > > > Add Arm SoC configuration to Arm meson.build and add a meson option to
> > > > enable those options for native builds. This is preferable to
> > > > specifying a cross file when doing aarch64 -> aarch64 builds, since
> > > > the cross file specifies the toolchain as well.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > [...]
> > > > --- a/config/arm/arm64_graviton2_linux_gcc
> > > > +++ b/config/arm/arm64_graviton2_linux_gcc
> > > >  [properties]
> > > > -implementor_id = '0x41'
> > > > -implementor_pn = '0xd0c'
> > > > -max_lcores = 64
> > > > -max_numa_nodes = 1
> > > > -numa = false
> > > > +soc = 'graviton2'
> > > [...]
> > > > --- a/meson_options.txt
> > > > +++ b/meson_options.txt
> > > > +option('arm_soc', type: 'string', value: '',
> > > > +	description: 'Specify if you want to build for a particular aarch64
> > > > +Arm SoC when building on an aarch64 machine.')
> > > 
> > > This is more elegant, I like how cross and native share almost the same option.
> > > 
> > > Why the option is named "arm_soc" and not just "soc"?
> > > The same option could be used by other archs, isn't it?
> > 
> > Agree that a more generic name would be better.
> > I'll change it to "soc" if there are no other suggestions.
> 
> Another name could be "machine".
> Should it be the same mechanism as compiling for a specific x86 CPU
> from an x86 machine?
> 
I'd rather not re-use the term "machine", for a new use, better to use a
new term IMHO.

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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-19 16:04                                     ` Bruce Richardson
@ 2021-01-20  1:04                                       ` Honnappa Nagarahalli
  2021-01-20  1:08                                         ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-20  1:04 UTC (permalink / raw)
  To: Bruce Richardson, thomas
  Cc: Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd, Honnappa Nagarahalli, nd

<snip>

> 
> On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > 19/01/2021 15:56, Juraj Linkeš:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > Add Arm SoC configuration to Arm meson.build and add a meson
> > > > > option to enable those options for native builds. This is
> > > > > preferable to specifying a cross file when doing aarch64 ->
> > > > > aarch64 builds, since the cross file specifies the toolchain as well.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > Reviewed-by: Honnappa Nagarahalli
> <honnappa.nagarahalli@arm.com>
> > > > [...]
> > > > > --- a/config/arm/arm64_graviton2_linux_gcc
> > > > > +++ b/config/arm/arm64_graviton2_linux_gcc
> > > > >  [properties]
> > > > > -implementor_id = '0x41'
> > > > > -implementor_pn = '0xd0c'
> > > > > -max_lcores = 64
> > > > > -max_numa_nodes = 1
> > > > > -numa = false
> > > > > +soc = 'graviton2'
> > > > [...]
> > > > > --- a/meson_options.txt
> > > > > +++ b/meson_options.txt
> > > > > +option('arm_soc', type: 'string', value: '',
> > > > > +	description: 'Specify if you want to build for a particular
> > > > > +aarch64 Arm SoC when building on an aarch64 machine.')
> > > >
> > > > This is more elegant, I like how cross and native share almost the same
> option.
> > > >
> > > > Why the option is named "arm_soc" and not just "soc"?
> > > > The same option could be used by other archs, isn't it?
> > >
> > > Agree that a more generic name would be better.
> > > I'll change it to "soc" if there are no other suggestions.
> >
> > Another name could be "machine".
> > Should it be the same mechanism as compiling for a specific x86 CPU
> > from an x86 machine?
> >
> I'd rather not re-use the term "machine", for a new use, better to use a new
> term IMHO.
+1, agree. 'soc' sounds good to me.

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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-20  1:04                                       ` Honnappa Nagarahalli
@ 2021-01-20  1:08                                         ` Thomas Monjalon
  2021-01-20  2:20                                           ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-20  1:08 UTC (permalink / raw)
  To: Bruce Richardson, Honnappa Nagarahalli, Juraj Linkeš
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd

20/01/2021 02:04, Honnappa Nagarahalli:
> > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > 19/01/2021 15:56, Juraj Linkeš:
> > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > --- a/meson_options.txt
> > > > > > +++ b/meson_options.txt
> > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > +	description: 'Specify if you want to build for a particular
> > > > > > +aarch64 Arm SoC when building on an aarch64 machine.')
> > > > >
> > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > The same option could be used by other archs, isn't it?
> > > >
> > > > Agree that a more generic name would be better.
> > > > I'll change it to "soc" if there are no other suggestions.
> > >
> > > Another name could be "machine".
> > > Should it be the same mechanism as compiling for a specific x86 CPU
> > > from an x86 machine?
> > >
> > I'd rather not re-use the term "machine", for a new use, better to use a new
> > term IMHO.
> +1, agree. 'soc' sounds good to me.

Another possible word is "platform",
as in http://doc.dpdk.org/guides/platform/index.html



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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-19 15:35                                 ` Juraj Linkeš
  2021-01-19 15:55                                   ` Liron Himi
@ 2021-01-20  1:11                                   ` Honnappa Nagarahalli
  2021-01-22  8:39                                     ` Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-20  1:11 UTC (permalink / raw)
  To: Juraj Linkeš, thomas
  Cc: bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy,
	Honnappa Nagarahalli, nd, nd

<snip>

> > 15/01/2021 14:26, Juraj Linkeš:
> > > A few options that disabled drivers in the old makefiles were
> > > improperly ported to the meson build system. Fix this by adding a to
> > > the list of
> >
> > "by adding a" what?
> 
> This is a typo, the "a" should not be there. Would that be ok wording?
> 
> >
> > > disabled drivers, similarly how the command line option works and
> > > remove unneeded driver options ported from the old makefile system,
> > > since they don't work in the current Meson build system.
> > > Add support for removing drivers for cross builds so that we can
> > > disable them in cross files.
> >
> > Why disabling them?
> > If a driver is not supported it should disable itseld in its meson file.
> >
> 
> This is helpful when building for an SoC where we don't want to build to build
> a driver, but the build machine actually supports the driver. I believe in this
> case the meson build system would find the dependencies and designate
> the driver to be build, but we don't want to build the driver for that SoC.
> 
> There may be other reasons as well - Honnappa or others from the Arm
> community may shed more light on this.
IMO, the assumption should be everything compiles on all the platforms. Hence, the disables should be applied to the platforms where the drivers do not compile.

> 
> > [...]
> > > --- a/config/arm/arm64_armada_linux_gcc
> > > +++ b/config/arm/arm64_armada_linux_gcc
> > > @@ -18,3 +18,4 @@ implementer_id = '0x56'
> > >  part_number = '0xd08'
> > >  max_lcores = 16
> > >  max_numa_nodes = 1
> > > +disabled_drivers = ['bus/dpaa', 'bus/fslmc', 'common/dpaax']
> >
> > It's removing NXP drivers on Marvell SoC. Fine.
> > And what about other useless drivers?
> >
> 
> I only removed what was in the old Makefiles, so I don't really know. Liron or
> Jerin may be able to give us some insight.
> 
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > +# disable Arm drivers for all builds disabled_drivers +=
> > > +['net/avp', 'net/fm10k']
> >
> > Why disabling avp and fm10k? Did they do something wrong to be banned?
> >
> >
> >
> 
> This config is not only in the old Makefiles, but also in the current meson
> build system. I believe Jerin and Allain are the original authors, so they may
> be able to answer.

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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-20  1:08                                         ` Thomas Monjalon
@ 2021-01-20  2:20                                           ` Honnappa Nagarahalli
  2021-01-20  8:41                                             ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-20  2:20 UTC (permalink / raw)
  To: thomas, Bruce Richardson, Juraj Linkeš
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd, Honnappa Nagarahalli, nd

<snip>
> 
> 20/01/2021 02:04, Honnappa Nagarahalli:
> > > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > > 19/01/2021 15:56, Juraj Linkeš:
> > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > > --- a/meson_options.txt
> > > > > > > +++ b/meson_options.txt
> > > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > > +	description: 'Specify if you want to build for a
> > > > > > > +particular
> > > > > > > +aarch64 Arm SoC when building on an aarch64 machine.')
> > > > > >
> > > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > > The same option could be used by other archs, isn't it?
> > > > >
> > > > > Agree that a more generic name would be better.
> > > > > I'll change it to "soc" if there are no other suggestions.
> > > >
> > > > Another name could be "machine".
> > > > Should it be the same mechanism as compiling for a specific x86
> > > > CPU from an x86 machine?
> > > >
> > > I'd rather not re-use the term "machine", for a new use, better to
> > > use a new term IMHO.
> > +1, agree. 'soc' sounds good to me.
> 
> Another possible word is "platform",
> as in http://doc.dpdk.org/guides/platform/index.html
I am fine with 'platform' too.

> 


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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-20  2:20                                           ` Honnappa Nagarahalli
@ 2021-01-20  8:41                                             ` Juraj Linkeš
  2021-01-20 16:10                                               ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-20  8:41 UTC (permalink / raw)
  To: Honnappa Nagarahalli, thomas, Bruce Richardson
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Wednesday, January 20, 2021 3:20 AM
> To: thomas@monjalon.net; Bruce Richardson <bruce.richardson@intel.com>;
> Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com; aboyer@pensando.io;
> dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
> 
> <snip>
> >
> > 20/01/2021 02:04, Honnappa Nagarahalli:
> > > > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > > > 19/01/2021 15:56, Juraj Linkeš:
> > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > > > --- a/meson_options.txt
> > > > > > > > +++ b/meson_options.txt
> > > > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > > > +	description: 'Specify if you want to build for a
> > > > > > > > +particular
> > > > > > > > +aarch64 Arm SoC when building on an aarch64 machine.')
> > > > > > >
> > > > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > > > The same option could be used by other archs, isn't it?
> > > > > >
> > > > > > Agree that a more generic name would be better.
> > > > > > I'll change it to "soc" if there are no other suggestions.
> > > > >
> > > > > Another name could be "machine".
> > > > > Should it be the same mechanism as compiling for a specific x86
> > > > > CPU from an x86 machine?
> > > > >
> > > > I'd rather not re-use the term "machine", for a new use, better to
> > > > use a new term IMHO.
> > > +1, agree. 'soc' sounds good to me.
> >
> > Another possible word is "platform",
> > as in http://doc.dpdk.org/guides/platform/index.html
> I am fine with 'platform' too.
> 

'platform' is likely the best and actually works nicely with http://patches.dpdk.org/patch/85956/. Taken together, 'platform' could be either 'native', 'generic' or an soc, which is, I believe, exactly what we want.

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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-20  8:41                                             ` Juraj Linkeš
@ 2021-01-20 16:10                                               ` Thomas Monjalon
  2021-01-21 15:02                                                 ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-20 16:10 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Bruce Richardson, Juraj Linkeš
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd

20/01/2021 09:41, Juraj Linkeš:
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > 20/01/2021 02:04, Honnappa Nagarahalli:
> > > > > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > > > > 19/01/2021 15:56, Juraj Linkeš:
> > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > > > > --- a/meson_options.txt
> > > > > > > > > +++ b/meson_options.txt
> > > > > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > > > > +	description: 'Specify if you want to build for a
> > > > > > > > > +particular
> > > > > > > > > +aarch64 Arm SoC when building on an aarch64 machine.')
> > > > > > > >
> > > > > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > > > > The same option could be used by other archs, isn't it?
> > > > > > >
> > > > > > > Agree that a more generic name would be better.
> > > > > > > I'll change it to "soc" if there are no other suggestions.
> > > > > >
> > > > > > Another name could be "machine".
> > > > > > Should it be the same mechanism as compiling for a specific x86
> > > > > > CPU from an x86 machine?
> > > > > >
> > > > > I'd rather not re-use the term "machine", for a new use, better to
> > > > > use a new term IMHO.
> > > > +1, agree. 'soc' sounds good to me.
> > >
> > > Another possible word is "platform",
> > > as in http://doc.dpdk.org/guides/platform/index.html
> > I am fine with 'platform' too.
> > 
> 
> 'platform' is likely the best and actually works nicely with http://patches.dpdk.org/patch/85956/. Taken together, 'platform' could be either 'native', 'generic' or an soc, which is, I believe, exactly what we want.

I am not sure what we want :)
We need to specify the instruction set, and the specific target.
We could deduce the instruction set from the target,
but I think it is good to be able to overwrite the instruction set
in case there can be multiple instruction sets for a target.

I think "native" and "generic" should be specified as instruction set,
in the existing option "machine" or renamed as "instruction_set" or "isa".

Let's imagine the first option is "isa" and the new second option is "platform".
We can have a default "isa" per "platform".
The default "platform" would have a default "isa": native or generic?

What else do we need?



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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-20 16:10                                               ` Thomas Monjalon
@ 2021-01-21 15:02                                                 ` Juraj Linkeš
  2021-01-21 15:52                                                   ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-21 15:02 UTC (permalink / raw)
  To: Thomas Monjalon, Honnappa Nagarahalli
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, January 20, 2021 5:10 PM
> To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Bruce
> Richardson <bruce.richardson@intel.com>; Juraj Linkeš
> <juraj.linkes@pantheon.tech>
> Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com; aboyer@pensando.io;
> dev@dpdk.org; nd <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
> 
> 20/01/2021 09:41, Juraj Linkeš:
> > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > > 20/01/2021 02:04, Honnappa Nagarahalli:
> > > > > > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > > > > > 19/01/2021 15:56, Juraj Linkeš:
> > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > > > > > --- a/meson_options.txt
> > > > > > > > > > +++ b/meson_options.txt
> > > > > > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > > > > > +	description: 'Specify if you want to build for a
> > > > > > > > > > +particular
> > > > > > > > > > +aarch64 Arm SoC when building on an aarch64
> > > > > > > > > > +machine.')
> > > > > > > > >
> > > > > > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > > > > > The same option could be used by other archs, isn't it?
> > > > > > > >
> > > > > > > > Agree that a more generic name would be better.
> > > > > > > > I'll change it to "soc" if there are no other suggestions.
> > > > > > >
> > > > > > > Another name could be "machine".
> > > > > > > Should it be the same mechanism as compiling for a specific
> > > > > > > x86 CPU from an x86 machine?
> > > > > > >
> > > > > > I'd rather not re-use the term "machine", for a new use,
> > > > > > better to use a new term IMHO.
> > > > > +1, agree. 'soc' sounds good to me.
> > > >
> > > > Another possible word is "platform", as in
> > > > http://doc.dpdk.org/guides/platform/index.html
> > > I am fine with 'platform' too.
> > >
> >
> > 'platform' is likely the best and actually works nicely with
> http://patches.dpdk.org/patch/85956/. Taken together, 'platform' could be
> either 'native', 'generic' or an soc, which is, I believe, exactly what we want.
> 
> I am not sure what we want :)
> We need to specify the instruction set, and the specific target.
> We could deduce the instruction set from the target, but I think it is good to be
> able to overwrite the instruction set in case there can be multiple instruction
> sets for a target.
> 

I think we had this (or similar) discussion here http://patches.dpdk.org/patch/85956/. I agree with your summary.

> I think "native" and "generic" should be specified as instruction set, in the
> existing option "machine" or renamed as "instruction_set" or "isa".
> 

Agree, but I would add that we also want "native" and "generic" as valid platforms. More below.

> Let's imagine the first option is "isa" and the new second option is "platform".
> We can have a default "isa" per "platform".
> The default "platform" would have a default "isa": native or generic?
> 

In general, yes, but I let me expand the "platform" option a bit.

Let's dig into what "platform" means. I understand it to be a set of configuration options, e.g.:
platform=native: use discovered values for all configuration options (where we can do that)
platform=generic: use predetermined values to produce a "generic" build that would work on most machine of the corresponding type/arch
platform=other: use predetermined values to produce a build tailored to platform "other", such as some arm soc.

In all these cases, leave user the option to specify supported options (i.e. user can specifying "instruction_set" and that value would be used for machine args or "max_lcores" would set max lcores).

The default "instruction_set" would be different per platform:
platform=native => instruction_set=native
platform=generic => the generic instruction_set for the architecture, as specified here: https://github.com/DPDK/dpdk/blob/main/config/meson.build#L79
platform=other => the instruction set of the platform

When "instruction_set" is set to its default value (such as auto), the per-platform instruction set would be used. If the user specifies anything else, that value would be used.

I basically just reworded Bruce's proposal from the other thread, since I agree with it.

Using the "platform" option in this commit just extends the supported platforms (from "native" and "default") by adding the soc platforms. (or the other patch would extend the supported platforms, depending on in which order the patches would be applied)

> What else do we need?
> 
> 

I think the above proposal (actually implemented here: http://patches.dpdk.org/patch/85956/) gives us what we want, which I believe is this (which is basically your summary + maybe some extra thoughts):
1. Arm wants to have the ability to choose a configuration set (i.e. the "platform" option). We also refer to this as the "type" of the build.
2. We also want to keep the current behavior of fine tuning the isa, which the "instruction_set" option does.
3. We don't want to change the default or expected behavior much or not at all, which we can do by choosing the right default values for "platform" and "instruction_set".


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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-21 15:02                                                 ` Juraj Linkeš
@ 2021-01-21 15:52                                                   ` Thomas Monjalon
  2021-01-21 16:12                                                     ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-21 15:52 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Juraj Linkeš
  Cc: Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd

21/01/2021 16:02, Juraj Linkeš:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 20/01/2021 09:41, Juraj Linkeš:
> > > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > > > 20/01/2021 02:04, Honnappa Nagarahalli:
> > > > > > > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > > > > > > 19/01/2021 15:56, Juraj Linkeš:
> > > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > > > > > > --- a/meson_options.txt
> > > > > > > > > > > +++ b/meson_options.txt
> > > > > > > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > > > > > > +	description: 'Specify if you want to build for a
> > > > > > > > > > > +particular
> > > > > > > > > > > +aarch64 Arm SoC when building on an aarch64
> > > > > > > > > > > +machine.')
> > > > > > > > > >
> > > > > > > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > > > > > > The same option could be used by other archs, isn't it?
> > > > > > > > >
> > > > > > > > > Agree that a more generic name would be better.
> > > > > > > > > I'll change it to "soc" if there are no other suggestions.
> > > > > > > >
> > > > > > > > Another name could be "machine".
> > > > > > > > Should it be the same mechanism as compiling for a specific
> > > > > > > > x86 CPU from an x86 machine?
> > > > > > > >
> > > > > > > I'd rather not re-use the term "machine", for a new use,
> > > > > > > better to use a new term IMHO.
> > > > > > +1, agree. 'soc' sounds good to me.
> > > > >
> > > > > Another possible word is "platform", as in
> > > > > http://doc.dpdk.org/guides/platform/index.html
> > > > I am fine with 'platform' too.
> > > >
> > >
> > > 'platform' is likely the best and actually works nicely with
> > http://patches.dpdk.org/patch/85956/. Taken together, 'platform' could be
> > either 'native', 'generic' or an soc, which is, I believe, exactly what we want.
> > 
> > I am not sure what we want :)
> > We need to specify the instruction set, and the specific target.
> > We could deduce the instruction set from the target, but I think it is good to be
> > able to overwrite the instruction set in case there can be multiple instruction
> > sets for a target.
> > 
> 
> I think we had this (or similar) discussion here http://patches.dpdk.org/patch/85956/. I agree with your summary.
> 
> > I think "native" and "generic" should be specified as instruction set, in the
> > existing option "machine" or renamed as "instruction_set" or "isa".
> > 
> 
> Agree, but I would add that we also want "native" and "generic" as valid platforms. More below.
> 
> > Let's imagine the first option is "isa" and the new second option is "platform".
> > We can have a default "isa" per "platform".
> > The default "platform" would have a default "isa": native or generic?
> > 
> 
> In general, yes, but I let me expand the "platform" option a bit.
> 
> Let's dig into what "platform" means. I understand it to be a set of configuration options, e.g.:
> platform=native: use discovered values for all configuration options (where we can do that)
> platform=generic: use predetermined values to produce a "generic" build that would work on most machine of the corresponding type/arch

This is where I was disagreeing:
you propose to have 2 special values of platform (native and generic),
I propose to have only 1 default value for platform.

After more thoughts, I think it's fine.


> platform=other: use predetermined values to produce a build tailored to platform "other", such as some arm soc.
> 
> In all these cases, leave user the option to specify supported options (i.e. user can specifying "instruction_set" and that value would be used for machine args or "max_lcores" would set max lcores).
> 
> The default "instruction_set" would be different per platform:

What do you think about calling this option "isa"?

> platform=native => instruction_set=native
> platform=generic => the generic instruction_set for the architecture, as specified here: https://github.com/DPDK/dpdk/blob/main/config/meson.build#L79
> platform=other => the instruction set of the platform
> 
> When "instruction_set" is set to its default value (such as auto), the per-platform instruction set would be used. If the user specifies anything else, that value would be used.

Why auto? This is what we call native.

> I basically just reworded Bruce's proposal from the other thread, since I agree with it.
> 
> Using the "platform" option in this commit just extends the supported platforms (from "native" and "default") by adding the soc platforms. (or the other patch would extend the supported platforms, depending on in which order the patches would be applied)
> 
> > What else do we need?
> > 
> > 
> 
> I think the above proposal (actually implemented here: http://patches.dpdk.org/patch/85956/) gives us what we want, which I believe is this (which is basically your summary + maybe some extra thoughts):
> 1. Arm wants to have the ability to choose a configuration set (i.e. the "platform" option). We also refer to this as the "type" of the build.
> 2. We also want to keep the current behavior of fine tuning the isa, which the "instruction_set" option does.
> 3. We don't want to change the default or expected behavior much or not at all, which we can do by choosing the right default values for "platform" and "instruction_set".




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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-21 15:52                                                   ` Thomas Monjalon
@ 2021-01-21 16:12                                                     ` Bruce Richardson
  2021-01-21 17:31                                                       ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-01-21 16:12 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Honnappa Nagarahalli, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd

On Thu, Jan 21, 2021 at 04:52:43PM +0100, Thomas Monjalon wrote:
> 21/01/2021 16:02, Juraj Linkeš:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 20/01/2021 09:41, Juraj Linkeš:
> > > > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > > > > 20/01/2021 02:04, Honnappa Nagarahalli:
> > > > > > > > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > > > > > > > 19/01/2021 15:56, Juraj Linkeš:
> > > > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > > > > > > > --- a/meson_options.txt
> > > > > > > > > > > > +++ b/meson_options.txt
> > > > > > > > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > > > > > > > +	description: 'Specify if you want to build for a
> > > > > > > > > > > > +particular
> > > > > > > > > > > > +aarch64 Arm SoC when building on an aarch64
> > > > > > > > > > > > +machine.')
> > > > > > > > > > >
> > > > > > > > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > > > > > > > The same option could be used by other archs, isn't it?
> > > > > > > > > >
> > > > > > > > > > Agree that a more generic name would be better.
> > > > > > > > > > I'll change it to "soc" if there are no other suggestions.
> > > > > > > > >
> > > > > > > > > Another name could be "machine".
> > > > > > > > > Should it be the same mechanism as compiling for a specific
> > > > > > > > > x86 CPU from an x86 machine?
> > > > > > > > >
> > > > > > > > I'd rather not re-use the term "machine", for a new use,
> > > > > > > > better to use a new term IMHO.
> > > > > > > +1, agree. 'soc' sounds good to me.
> > > > > >
> > > > > > Another possible word is "platform", as in
> > > > > > http://doc.dpdk.org/guides/platform/index.html
> > > > > I am fine with 'platform' too.
> > > > >
> > > >
> > > > 'platform' is likely the best and actually works nicely with
> > > http://patches.dpdk.org/patch/85956/. Taken together, 'platform' could be
> > > either 'native', 'generic' or an soc, which is, I believe, exactly what we want.
> > > 
> > > I am not sure what we want :)
> > > We need to specify the instruction set, and the specific target.
> > > We could deduce the instruction set from the target, but I think it is good to be
> > > able to overwrite the instruction set in case there can be multiple instruction
> > > sets for a target.
> > > 
> > 
> > I think we had this (or similar) discussion here http://patches.dpdk.org/patch/85956/. I agree with your summary.
> > 
> > > I think "native" and "generic" should be specified as instruction set, in the
> > > existing option "machine" or renamed as "instruction_set" or "isa".
> > > 
> > 
> > Agree, but I would add that we also want "native" and "generic" as valid platforms. More below.
> > 
> > > Let's imagine the first option is "isa" and the new second option is "platform".
> > > We can have a default "isa" per "platform".
> > > The default "platform" would have a default "isa": native or generic?
> > > 
> > 
> > In general, yes, but I let me expand the "platform" option a bit.
> > 
> > Let's dig into what "platform" means. I understand it to be a set of configuration options, e.g.:
> > platform=native: use discovered values for all configuration options (where we can do that)
> > platform=generic: use predetermined values to produce a "generic" build that would work on most machine of the corresponding type/arch
> 
> This is where I was disagreeing:
> you propose to have 2 special values of platform (native and generic),
> I propose to have only 1 default value for platform.
> 
> After more thoughts, I think it's fine.
> 
> 
> > platform=other: use predetermined values to produce a build tailored to platform "other", such as some arm soc.
> > 
> > In all these cases, leave user the option to specify supported options (i.e. user can specifying "instruction_set" and that value would be used for machine args or "max_lcores" would set max lcores).
> > 
> > The default "instruction_set" would be different per platform:
> 
> What do you think about calling this option "isa"?
> 
> > platform=native => instruction_set=native
> > platform=generic => the generic instruction_set for the architecture, as specified here: https://github.com/DPDK/dpdk/blob/main/config/meson.build#L79
> > platform=other => the instruction set of the platform
> > 
> > When "instruction_set" is set to its default value (such as auto), the per-platform instruction set would be used. If the user specifies anything else, that value would be used.
> 
> Why auto? This is what we call native.
> 

"auto" is a better term. If the platform is selected as "native" then the
default isa will be "native", while if the platform is generic, the default
isa should be something generic too. Since we unfortunately can't have one
option automatically update the value of the other, we need to use a value
of "auto" to allow platform to provide variable defaults for this, while
still allowing explicit overrides. So in this case, "auto" will imply the
isa being the same as the platform in most cases.

In terms of other possible parameters, it makes even more sense. For
example, for max lcores - as I understand it on ARM SoC's "native" is
generally meant to set the max lcores to the detected values, while on x86
we want to allow some flexibility, so that if you compile on a 4-core VM,
you can still run that binary on a 32-core machine of the same or later
micro-architecture. In this case, "auto" again is a good value implying "choose
what you think is best".

/Bruce

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

* Re: [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option
  2021-01-21 16:12                                                     ` Bruce Richardson
@ 2021-01-21 17:31                                                       ` Thomas Monjalon
  0 siblings, 0 replies; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-21 17:31 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Honnappa Nagarahalli, Juraj Linkeš,
	Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, nd

21/01/2021 17:12, Bruce Richardson:
> On Thu, Jan 21, 2021 at 04:52:43PM +0100, Thomas Monjalon wrote:
> > 21/01/2021 16:02, Juraj Linkeš:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > 20/01/2021 09:41, Juraj Linkeš:
> > > > > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > > > > > 20/01/2021 02:04, Honnappa Nagarahalli:
> > > > > > > > > On Tue, Jan 19, 2021 at 04:52:19PM +0100, Thomas Monjalon wrote:
> > > > > > > > > > 19/01/2021 15:56, Juraj Linkeš:
> > > > > > > > > > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > > > > > > > > > 15/01/2021 14:26, Juraj Linkeš:
> > > > > > > > > > > > > --- a/meson_options.txt
> > > > > > > > > > > > > +++ b/meson_options.txt
> > > > > > > > > > > > > +option('arm_soc', type: 'string', value: '',
> > > > > > > > > > > > > +	description: 'Specify if you want to build for a
> > > > > > > > > > > > > +particular
> > > > > > > > > > > > > +aarch64 Arm SoC when building on an aarch64
> > > > > > > > > > > > > +machine.')
> > > > > > > > > > > >
> > > > > > > > > > > > Why the option is named "arm_soc" and not just "soc"?
> > > > > > > > > > > > The same option could be used by other archs, isn't it?
> > > > > > > > > > >
> > > > > > > > > > > Agree that a more generic name would be better.
> > > > > > > > > > > I'll change it to "soc" if there are no other suggestions.
> > > > > > > > > >
> > > > > > > > > > Another name could be "machine".
> > > > > > > > > > Should it be the same mechanism as compiling for a specific
> > > > > > > > > > x86 CPU from an x86 machine?
> > > > > > > > > >
> > > > > > > > > I'd rather not re-use the term "machine", for a new use,
> > > > > > > > > better to use a new term IMHO.
> > > > > > > > +1, agree. 'soc' sounds good to me.
> > > > > > >
> > > > > > > Another possible word is "platform", as in
> > > > > > > http://doc.dpdk.org/guides/platform/index.html
> > > > > > I am fine with 'platform' too.
> > > > > >
> > > > >
> > > > > 'platform' is likely the best and actually works nicely with
> > > > http://patches.dpdk.org/patch/85956/. Taken together, 'platform' could be
> > > > either 'native', 'generic' or an soc, which is, I believe, exactly what we want.
> > > > 
> > > > I am not sure what we want :)
> > > > We need to specify the instruction set, and the specific target.
> > > > We could deduce the instruction set from the target, but I think it is good to be
> > > > able to overwrite the instruction set in case there can be multiple instruction
> > > > sets for a target.
> > > > 
> > > 
> > > I think we had this (or similar) discussion here http://patches.dpdk.org/patch/85956/. I agree with your summary.
> > > 
> > > > I think "native" and "generic" should be specified as instruction set, in the
> > > > existing option "machine" or renamed as "instruction_set" or "isa".
> > > > 
> > > 
> > > Agree, but I would add that we also want "native" and "generic" as valid platforms. More below.
> > > 
> > > > Let's imagine the first option is "isa" and the new second option is "platform".
> > > > We can have a default "isa" per "platform".
> > > > The default "platform" would have a default "isa": native or generic?
> > > > 
> > > 
> > > In general, yes, but I let me expand the "platform" option a bit.
> > > 
> > > Let's dig into what "platform" means. I understand it to be a set of configuration options, e.g.:
> > > platform=native: use discovered values for all configuration options (where we can do that)
> > > platform=generic: use predetermined values to produce a "generic" build that would work on most machine of the corresponding type/arch
> > 
> > This is where I was disagreeing:
> > you propose to have 2 special values of platform (native and generic),
> > I propose to have only 1 default value for platform.
> > 
> > After more thoughts, I think it's fine.
> > 
> > 
> > > platform=other: use predetermined values to produce a build tailored to platform "other", such as some arm soc.
> > > 
> > > In all these cases, leave user the option to specify supported options (i.e. user can specifying "instruction_set" and that value would be used for machine args or "max_lcores" would set max lcores).
> > > 
> > > The default "instruction_set" would be different per platform:
> > 
> > What do you think about calling this option "isa"?
> > 
> > > platform=native => instruction_set=native
> > > platform=generic => the generic instruction_set for the architecture, as specified here: https://github.com/DPDK/dpdk/blob/main/config/meson.build#L79
> > > platform=other => the instruction set of the platform
> > > 
> > > When "instruction_set" is set to its default value (such as auto), the per-platform instruction set would be used. If the user specifies anything else, that value would be used.
> > 
> > Why auto? This is what we call native.
> > 
> 
> "auto" is a better term. If the platform is selected as "native" then the
> default isa will be "native", while if the platform is generic, the default
> isa should be something generic too. Since we unfortunately can't have one
> option automatically update the value of the other, we need to use a value
> of "auto" to allow platform to provide variable defaults for this, while
> still allowing explicit overrides. So in this case, "auto" will imply the
> isa being the same as the platform in most cases.
> 
> In terms of other possible parameters, it makes even more sense. For
> example, for max lcores - as I understand it on ARM SoC's "native" is
> generally meant to set the max lcores to the detected values, while on x86
> we want to allow some flexibility, so that if you compile on a 4-core VM,
> you can still run that binary on a 32-core machine of the same or later
> micro-architecture. In this case, "auto" again is a good value implying "choose
> what you think is best".

OK now I understand all, thanks.





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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-20  1:11                                   ` Honnappa Nagarahalli
@ 2021-01-22  8:39                                     ` Juraj Linkeš
  2021-01-22  8:58                                       ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-22  8:39 UTC (permalink / raw)
  To: Honnappa Nagarahalli, thomas
  Cc: bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy, nd, nd

> > > > disabled drivers, similarly how the command line option works and
> > > > remove unneeded driver options ported from the old makefile
> > > > system, since they don't work in the current Meson build system.
> > > > Add support for removing drivers for cross builds so that we can
> > > > disable them in cross files.
> > >
> > > Why disabling them?
> > > If a driver is not supported it should disable itseld in its meson file.
> > >
> >
> > This is helpful when building for an SoC where we don't want to build
> > to build a driver, but the build machine actually supports the driver.
> > I believe in this case the meson build system would find the
> > dependencies and designate the driver to be build, but we don't want to build
> the driver for that SoC.
> >
> > There may be other reasons as well - Honnappa or others from the Arm
> > community may shed more light on this.
> IMO, the assumption should be everything compiles on all the platforms. Hence,
> the disables should be applied to the platforms where the drivers do not
> compile.
> 

Would it be okay to leave the disabled as they're in this commit and leave the updates to the plaform owners? Thomas, what do you think?

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-05 15:12                             ` Honnappa Nagarahalli
@ 2021-01-22  8:53                               ` Juraj Linkeš
  2021-01-27 13:40                                 ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-22  8:53 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Pavan Nikhilesh Bhagavatula,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, January 5, 2021 4:12 PM
> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Juraj Linkeš
> <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com
> Cc: dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: RE: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
> 
> <snip>
> 
> > >
> > >v14:
> > >Resent for retesting (because of suspected false negative).
> > >
> > >Series Acked-by: Jerin Jacob <jerinj@marvell.com> Series Tested-by:
> > >Jerin Jacob <jerinj@marvell.com> Series Tested-by: Dharmik Thakkar
> > ><dharmik.thakkar@arm.com> Series Tested-by: Vimal Chungath
> > ><vcchunga@amazon.com>
> > >
> >
> > Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Also, I believe we need to take a look at ARCH_SOC_ID support coming
> > up in
> > 5.9 kernel.
> >
> > https://lore.kernel.org/linux-arm-kernel/20200506164411.3284-1-
> > sudeep.holla@arm.com/
> 
> Agree, it can come after this series is merged.
> 
> Note that it requires firmware with SMCCC v1.2 support in the underlying
> platform.
> 

I have a few questions to everyone:
Is there any comprehensive documentation about how to use this? Things like where in Linux can I get the ARCH_SOC_ID and how are the ID's mapped to socs?
If the ID mappings are not public then the plaform owners would need to add the support, right?

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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-22  8:39                                     ` Juraj Linkeš
@ 2021-01-22  8:58                                       ` Thomas Monjalon
  2021-01-22  9:07                                         ` Jerin Jacob
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-22  8:58 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Juraj Linkeš
  Cc: bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy, nd

22/01/2021 09:39, Juraj Linkeš:
> > > > > disabled drivers, similarly how the command line option works and
> > > > > remove unneeded driver options ported from the old makefile
> > > > > system, since they don't work in the current Meson build system.
> > > > > Add support for removing drivers for cross builds so that we can
> > > > > disable them in cross files.
> > > >
> > > > Why disabling them?
> > > > If a driver is not supported it should disable itseld in its meson file.
> > > >
> > >
> > > This is helpful when building for an SoC where we don't want to build
> > > to build a driver, but the build machine actually supports the driver.
> > > I believe in this case the meson build system would find the
> > > dependencies and designate the driver to be build, but we don't want to build
> > the driver for that SoC.
> > >
> > > There may be other reasons as well - Honnappa or others from the Arm
> > > community may shed more light on this.
> > IMO, the assumption should be everything compiles on all the platforms. Hence,
> > the disables should be applied to the platforms where the drivers do not
> > compile.

If a driver does not compile, it can disable itself.
No need for a configuration.

> Would it be okay to leave the disabled as they're in this commit and leave the updates to the plaform owners? Thomas, what do you think?

I think this patch should not disable drivers but just add the infra to do it.



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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-22  8:58                                       ` Thomas Monjalon
@ 2021-01-22  9:07                                         ` Jerin Jacob
  2021-01-22 10:19                                           ` Thomas Monjalon
  0 siblings, 1 reply; 465+ messages in thread
From: Jerin Jacob @ 2021-01-22  9:07 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Honnappa Nagarahalli, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy, nd

On Fri, Jan 22, 2021 at 2:28 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 22/01/2021 09:39, Juraj Linkeš:
> > > > > > disabled drivers, similarly how the command line option works and
> > > > > > remove unneeded driver options ported from the old makefile
> > > > > > system, since they don't work in the current Meson build system.
> > > > > > Add support for removing drivers for cross builds so that we can
> > > > > > disable them in cross files.
> > > > >
> > > > > Why disabling them?
> > > > > If a driver is not supported it should disable itseld in its meson file.
> > > > >
> > > >
> > > > This is helpful when building for an SoC where we don't want to build
> > > > to build a driver, but the build machine actually supports the driver.
> > > > I believe in this case the meson build system would find the
> > > > dependencies and designate the driver to be build, but we don't want to build
> > > the driver for that SoC.
> > > >
> > > > There may be other reasons as well - Honnappa or others from the Arm
> > > > community may shed more light on this.
> > > IMO, the assumption should be everything compiles on all the platforms. Hence,
> > > the disables should be applied to the platforms where the drivers do not
> > > compile.
>
> If a driver does not compile, it can disable itself.
> No need for a configuration.
>
> > Would it be okay to leave the disabled as they're in this commit and leave the updates to the plaform owners? Thomas, what do you think?
>
> I think this patch should not disable drivers but just add the infra to do it.

IMO, If the SOC has "fixed" set of dpdk devices, probably better to
have positive logic to enable only those in config file.
I think, that will be portable and useful.
IMO, We can have infrastructure code enable only specific drivers and
config owners can later enable the required set.

>
>

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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-22  9:07                                         ` Jerin Jacob
@ 2021-01-22 10:19                                           ` Thomas Monjalon
  2021-01-25 14:58                                             ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-22 10:19 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Honnappa Nagarahalli, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy, nd

22/01/2021 10:07, Jerin Jacob:
> On Fri, Jan 22, 2021 at 2:28 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > 22/01/2021 09:39, Juraj Linkeš:
> > > > > > > disabled drivers, similarly how the command line option works and
> > > > > > > remove unneeded driver options ported from the old makefile
> > > > > > > system, since they don't work in the current Meson build system.
> > > > > > > Add support for removing drivers for cross builds so that we can
> > > > > > > disable them in cross files.
> > > > > >
> > > > > > Why disabling them?
> > > > > > If a driver is not supported it should disable itseld in its meson file.
> > > > > >
> > > > >
> > > > > This is helpful when building for an SoC where we don't want to build
> > > > > to build a driver, but the build machine actually supports the driver.
> > > > > I believe in this case the meson build system would find the
> > > > > dependencies and designate the driver to be build, but we don't want to build
> > > > the driver for that SoC.
> > > > >
> > > > > There may be other reasons as well - Honnappa or others from the Arm
> > > > > community may shed more light on this.
> > > > IMO, the assumption should be everything compiles on all the platforms. Hence,
> > > > the disables should be applied to the platforms where the drivers do not
> > > > compile.
> >
> > If a driver does not compile, it can disable itself.
> > No need for a configuration.
> >
> > > Would it be okay to leave the disabled as they're in this commit and leave the updates to the plaform owners? Thomas, what do you think?
> >
> > I think this patch should not disable drivers but just add the infra to do it.
> 
> IMO, If the SOC has "fixed" set of dpdk devices, probably better to
> have positive logic to enable only those in config file.
> I think, that will be portable and useful.
> IMO, We can have infrastructure code enable only specific drivers and
> config owners can later enable the required set.

Yes you're right, enabling makes more sense than disabling for SoCs.



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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-22 10:19                                           ` Thomas Monjalon
@ 2021-01-25 14:58                                             ` Honnappa Nagarahalli
  2021-01-25 15:28                                               ` Thomas Monjalon
  2021-01-25 16:09                                               ` Jerin Jacob
  0 siblings, 2 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-25 14:58 UTC (permalink / raw)
  To: thomas, Jerin Jacob
  Cc: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy, nd,
	Honnappa Nagarahalli, nd

<snip>

> 
> 22/01/2021 10:07, Jerin Jacob:
> > On Fri, Jan 22, 2021 at 2:28 PM Thomas Monjalon <thomas@monjalon.net>
> wrote:
> > > 22/01/2021 09:39, Juraj Linkeš:
> > > > > > > > disabled drivers, similarly how the command line option
> > > > > > > > works and remove unneeded driver options ported from the
> > > > > > > > old makefile system, since they don't work in the current Meson
> build system.
> > > > > > > > Add support for removing drivers for cross builds so that
> > > > > > > > we can disable them in cross files.
> > > > > > >
> > > > > > > Why disabling them?
> > > > > > > If a driver is not supported it should disable itseld in its meson file.
> > > > > > >
> > > > > >
> > > > > > This is helpful when building for an SoC where we don't want
> > > > > > to build to build a driver, but the build machine actually supports
> the driver.
> > > > > > I believe in this case the meson build system would find the
> > > > > > dependencies and designate the driver to be build, but we
> > > > > > don't want to build
> > > > > the driver for that SoC.
> > > > > >
> > > > > > There may be other reasons as well - Honnappa or others from
> > > > > > the Arm community may shed more light on this.
> > > > > IMO, the assumption should be everything compiles on all the
> > > > > platforms. Hence, the disables should be applied to the
> > > > > platforms where the drivers do not compile.
> > >
> > > If a driver does not compile, it can disable itself.
> > > No need for a configuration.
> > >
> > > > Would it be okay to leave the disabled as they're in this commit and
> leave the updates to the plaform owners? Thomas, what do you think?
> > >
> > > I think this patch should not disable drivers but just add the infra to do it.
> >
> > IMO, If the SOC has "fixed" set of dpdk devices, probably better to
> > have positive logic to enable only those in config file.
> > I think, that will be portable and useful.
> > IMO, We can have infrastructure code enable only specific drivers and
> > config owners can later enable the required set.
> 
> Yes you're right, enabling makes more sense than disabling for SoCs.
Every SoC also supports PCIe interfaces. This means, one could use them with a PCIe based NIC (we do use these interfaces internally at Arm, I am not sure from a deployment perspective).

If we use the enable logic, the list will be huge?

> 


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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-25 14:58                                             ` Honnappa Nagarahalli
@ 2021-01-25 15:28                                               ` Thomas Monjalon
  2021-01-25 16:09                                               ` Jerin Jacob
  1 sibling, 0 replies; 465+ messages in thread
From: Thomas Monjalon @ 2021-01-25 15:28 UTC (permalink / raw)
  To: Jerin Jacob, Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy, nd,
	Honnappa Nagarahalli, nd

25/01/2021 15:58, Honnappa Nagarahalli:
> > 22/01/2021 10:07, Jerin Jacob:
> > > On Fri, Jan 22, 2021 at 2:28 PM Thomas Monjalon <thomas@monjalon.net>
> > wrote:
> > > > 22/01/2021 09:39, Juraj Linkeš:
> > > > > > > > > disabled drivers, similarly how the command line option
> > > > > > > > > works and remove unneeded driver options ported from the
> > > > > > > > > old makefile system, since they don't work in the current Meson
> > build system.
> > > > > > > > > Add support for removing drivers for cross builds so that
> > > > > > > > > we can disable them in cross files.
> > > > > > > >
> > > > > > > > Why disabling them?
> > > > > > > > If a driver is not supported it should disable itseld in its meson file.
> > > > > > > >
> > > > > > >
> > > > > > > This is helpful when building for an SoC where we don't want
> > > > > > > to build to build a driver, but the build machine actually supports
> > the driver.
> > > > > > > I believe in this case the meson build system would find the
> > > > > > > dependencies and designate the driver to be build, but we
> > > > > > > don't want to build
> > > > > > the driver for that SoC.
> > > > > > >
> > > > > > > There may be other reasons as well - Honnappa or others from
> > > > > > > the Arm community may shed more light on this.
> > > > > > IMO, the assumption should be everything compiles on all the
> > > > > > platforms. Hence, the disables should be applied to the
> > > > > > platforms where the drivers do not compile.
> > > >
> > > > If a driver does not compile, it can disable itself.
> > > > No need for a configuration.
> > > >
> > > > > Would it be okay to leave the disabled as they're in this commit and
> > leave the updates to the plaform owners? Thomas, what do you think?
> > > >
> > > > I think this patch should not disable drivers but just add the infra to do it.
> > >
> > > IMO, If the SOC has "fixed" set of dpdk devices, probably better to
> > > have positive logic to enable only those in config file.
> > > I think, that will be portable and useful.
> > > IMO, We can have infrastructure code enable only specific drivers and
> > > config owners can later enable the required set.
> > 
> > Yes you're right, enabling makes more sense than disabling for SoCs.
> Every SoC also supports PCIe interfaces. This means, one could use them with a PCIe based NIC (we do use these interfaces internally at Arm, I am not sure from a deployment perspective).
> 
> If we use the enable logic, the list will be huge?

That's also right.
The last to talk will be right :)



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

* Re: [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds
  2021-01-25 14:58                                             ` Honnappa Nagarahalli
  2021-01-25 15:28                                               ` Thomas Monjalon
@ 2021-01-25 16:09                                               ` Jerin Jacob
  1 sibling, 0 replies; 465+ messages in thread
From: Jerin Jacob @ 2021-01-25 16:09 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: thomas, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, dev, lironh, allain.legacy, nd

On Mon, Jan 25, 2021 at 8:28 PM Honnappa Nagarahalli
<Honnappa.Nagarahalli@arm.com> wrote:
>
> <snip>
>
> >
> > 22/01/2021 10:07, Jerin Jacob:
> > > On Fri, Jan 22, 2021 at 2:28 PM Thomas Monjalon <thomas@monjalon.net>
> > wrote:
> > > > 22/01/2021 09:39, Juraj Linkeš:
> > > > > > > > > disabled drivers, similarly how the command line option
> > > > > > > > > works and remove unneeded driver options ported from the
> > > > > > > > > old makefile system, since they don't work in the current Meson
> > build system.
> > > > > > > > > Add support for removing drivers for cross builds so that
> > > > > > > > > we can disable them in cross files.
> > > > > > > >
> > > > > > > > Why disabling them?
> > > > > > > > If a driver is not supported it should disable itseld in its meson file.
> > > > > > > >
> > > > > > >
> > > > > > > This is helpful when building for an SoC where we don't want
> > > > > > > to build to build a driver, but the build machine actually supports
> > the driver.
> > > > > > > I believe in this case the meson build system would find the
> > > > > > > dependencies and designate the driver to be build, but we
> > > > > > > don't want to build
> > > > > > the driver for that SoC.
> > > > > > >
> > > > > > > There may be other reasons as well - Honnappa or others from
> > > > > > > the Arm community may shed more light on this.
> > > > > > IMO, the assumption should be everything compiles on all the
> > > > > > platforms. Hence, the disables should be applied to the
> > > > > > platforms where the drivers do not compile.
> > > >
> > > > If a driver does not compile, it can disable itself.
> > > > No need for a configuration.
> > > >
> > > > > Would it be okay to leave the disabled as they're in this commit and
> > leave the updates to the plaform owners? Thomas, what do you think?
> > > >
> > > > I think this patch should not disable drivers but just add the infra to do it.
> > >
> > > IMO, If the SOC has "fixed" set of dpdk devices, probably better to
> > > have positive logic to enable only those in config file.
> > > I think, that will be portable and useful.
> > > IMO, We can have infrastructure code enable only specific drivers and
> > > config owners can later enable the required set.
> >
> > Yes you're right, enabling makes more sense than disabling for SoCs.
> Every SoC also supports PCIe interfaces. This means, one could use them with a PCIe based NIC (we do use these interfaces internally at Arm, I am not sure from a deployment perspective).

Not every SoC.

>
> If we use the enable logic, the list will be huge?

Yes. I think both support will be useful. IMO, Selecting a small
subset can be achieved via, have a flag in config file to disable all
the drivers and add the selective one as needed.

>
> >
>

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-22  8:53                               ` Juraj Linkeš
@ 2021-01-27 13:40                                 ` Honnappa Nagarahalli
  2021-01-27 15:02                                   ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-27 13:40 UTC (permalink / raw)
  To: Juraj Linkeš,
	Pavan Nikhilesh Bhagavatula, bruce.richardson, Ruifeng Wang,
	Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > > >
> > > >v14:
> > > >Resent for retesting (because of suspected false negative).
> > > >
> > > >Series Acked-by: Jerin Jacob <jerinj@marvell.com> Series Tested-by:
> > > >Jerin Jacob <jerinj@marvell.com> Series Tested-by: Dharmik Thakkar
> > > ><dharmik.thakkar@arm.com> Series Tested-by: Vimal Chungath
> > > ><vcchunga@amazon.com>
> > > >
> > >
> > > Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > >
> > > Also, I believe we need to take a look at ARCH_SOC_ID support coming
> > > up in
> > > 5.9 kernel.
> > >
> > > https://lore.kernel.org/linux-arm-kernel/20200506164411.3284-1-
> > > sudeep.holla@arm.com/
> >
> > Agree, it can come after this series is merged.
> >
> > Note that it requires firmware with SMCCC v1.2 support in the
> > underlying platform.
> >
> 
> I have a few questions to everyone:
> Is there any comprehensive documentation about how to use this? Things
> like where in Linux can I get the ARCH_SOC_ID and how are the ID's mapped
> to socs?
Kernel patch is at [1] - merged in Kernel 5.9 Makes use of SMCCC v1.2, SMCCC_ARCH_SOC_ID call.
SMCCC v1.2 spec is at [2]. 

The SoC ID becomes available at:
/sys/devices/socX/family
/sys/devices/socX/soc_id
/sys/devices/socX/revision

SOC_ID makes use of JEP-106 code [3] for the SiP which makes it unique.

[1] https://lkml.org/lkml/2020/6/25/208
[2] https://developer.arm.com/documentation/den0028/c
[3] https://developer.arm.com/documentation/ka001301/1-0

> If the ID mappings are not public then the plaform owners would need to
> add the support, right?
I agree here. There are firmware changes required and we do not know the IDs as well. It will be good for Marvell/NXP/NVIDIA to do this.
Pavan, is this ok for you?

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-27 13:40                                 ` Honnappa Nagarahalli
@ 2021-01-27 15:02                                   ` Pavan Nikhilesh Bhagavatula
  2021-01-27 15:12                                     ` Hemant Agrawal
  0 siblings, 1 reply; 465+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2021-01-27 15:02 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, nd



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Honnappa
>Nagarahalli
>Sent: Wednesday, January 27, 2021 7:11 PM
>To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Pavan Nikhilesh
>Bhagavatula <pbhagavatula@marvell.com>;
>bruce.richardson@intel.com; Ruifeng Wang
><Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
>vcchunga@amazon.com; Dharmik Thakkar
><Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
>hemant.agrawal@nxp.com; Ajit Khaparde
>(ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
>ferruh.yigit@intel.com
>Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
><Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
>Subject: [EXT] Re: [dpdk-dev] [PATCH v14 00/12] Arm build options
>rework
>
>External Email
>
>----------------------------------------------------------------------
><snip>
>
>> >
>> > > >
>> > > >v14:
>> > > >Resent for retesting (because of suspected false negative).
>> > > >
>> > > >Series Acked-by: Jerin Jacob <jerinj@marvell.com> Series Tested-
>by:
>> > > >Jerin Jacob <jerinj@marvell.com> Series Tested-by: Dharmik
>Thakkar
>> > > ><dharmik.thakkar@arm.com> Series Tested-by: Vimal Chungath
>> > > ><vcchunga@amazon.com>
>> > > >
>> > >
>> > > Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> > >
>> > > Also, I believe we need to take a look at ARCH_SOC_ID support
>coming
>> > > up in
>> > > 5.9 kernel.
>> > >
>> > > https://urldefense.proofpoint.com/v2/url?u=https-
>3A__lore.kernel.org_linux-2Darm-2Dkernel_20200506164411.3284-
>2D1-
>2D&d=DwIGaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNmj
>2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-
>qTVhfo4iSgHBg-
>BTo&s=dslFI0W1qZdDxkbXDMTzPSUzlKMFfMUsE6tllPaF9Oc&e=
>> > > sudeep.holla@arm.com/
>> >
>> > Agree, it can come after this series is merged.
>> >
>> > Note that it requires firmware with SMCCC v1.2 support in the
>> > underlying platform.
>> >
>>
>> I have a few questions to everyone:
>> Is there any comprehensive documentation about how to use this?
>Things
>> like where in Linux can I get the ARCH_SOC_ID and how are the ID's
>mapped
>> to socs?
>Kernel patch is at [1] - merged in Kernel 5.9 Makes use of SMCCC v1.2,
>SMCCC_ARCH_SOC_ID call.
>SMCCC v1.2 spec is at [2].
>
>The SoC ID becomes available at:
>/sys/devices/socX/family
>/sys/devices/socX/soc_id
>/sys/devices/socX/revision
>
>SOC_ID makes use of JEP-106 code [3] for the SiP which makes it
>unique.
>
>[1] https://urldefense.proofpoint.com/v2/url?u=https-
>3A__lkml.org_lkml_2020_6_25_208&d=DwIGaQ&c=nKjWec2b6R0mOy
>Paz7xtfQ&r=1cjuAHrGh745jHNmj2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7k
>On5DYMe_WZiykt8BVATgv7-qTVhfo4iSgHBg-
>BTo&s=5xXdzD7DpbcDeG81JVGZf396EFNbV0rSl00hRLuZJBc&e=
>[2] https://urldefense.proofpoint.com/v2/url?u=https-
>3A__developer.arm.com_documentation_den0028_c&d=DwIGaQ&c=n
>KjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNmj2fD85sUMIJ2IPIDsIJz
>o6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-qTVhfo4iSgHBg-
>BTo&s=DFG7a9oFDFczCcODfR0wVGjkLQXwMU19q_ogaFVw90I&e=
>[3] https://urldefense.proofpoint.com/v2/url?u=https-
>3A__developer.arm.com_documentation_ka001301_1-
>2D0&d=DwIGaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNm
>j2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-
>qTVhfo4iSgHBg-
>BTo&s=GQsJJuft9k1iooO8VNNIM8ZUUgGjCEPB6eRxN3qm62U&e=
>
>> If the ID mappings are not public then the plaform owners would need
>to
>> add the support, right?
>I agree here. There are firmware changes required and we do not know
>the IDs as well. It will be good for Marvell/NXP/NVIDIA to do this.
>Pavan, is this ok for you?

Yeah, I believe we need fallback to the current mechanisms if SOC_ID support 
is not present or platform owners have not updated them.


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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-27 15:02                                   ` Pavan Nikhilesh Bhagavatula
@ 2021-01-27 15:12                                     ` Hemant Agrawal
  2021-01-27 15:18                                       ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Hemant Agrawal @ 2021-01-27 15:12 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, Honnappa Nagarahalli,
	Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, nd

> 
> >-----Original Message-----
> >From: dev <dev-bounces@dpdk.org> On Behalf Of Honnappa Nagarahalli
> >Sent: Wednesday, January 27, 2021 7:11 PM
> >To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Pavan Nikhilesh
> >Bhagavatula <pbhagavatula@marvell.com>; bruce.richardson@intel.com;
> >Ruifeng Wang <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> >vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> >jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> >(ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> >ferruh.yigit@intel.com
> >Cc: dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> ><Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> >Subject: [EXT] Re: [dpdk-dev] [PATCH v14 00/12] Arm build options
> >rework
> >
> >External Email
> >
> >----------------------------------------------------------------------
> ><snip>
> >
> >> >
> >> > > >
> >> > > >v14:
> >> > > >Resent for retesting (because of suspected false negative).
> >> > > >
> >> > > >Series Acked-by: Jerin Jacob <jerinj@marvell.com> Series Tested-
> >by:
> >> > > >Jerin Jacob <jerinj@marvell.com> Series Tested-by: Dharmik
> >Thakkar
> >> > > ><dharmik.thakkar@arm.com> Series Tested-by: Vimal Chungath
> >> > > ><vcchunga@amazon.com>
> >> > > >
> >> > >
> >> > > Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >> > >
> >> > > Also, I believe we need to take a look at ARCH_SOC_ID support
> >coming
> >> > > up in
> >> > > 5.9 kernel.
> >> > >
> >> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2
> >> > > Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> &amp;data=04%7C
> >> > >
> 01%7Chemant.agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896
> c%
> >> > >
> 7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637473565383043785
> %7
> >> > >
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJB
> Ti
> >> > >
> I6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=o7%2BXNileFgI2By08IHv
> EY
> >> > > PWrDjRikXlfFtal1MCdyCM%3D&amp;reserved=0
> >3A__lore.kernel.org_linux-2Darm-2Dkernel_20200506164411.3284-
> >2D1-
> >2D&d=DwIGaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNmj
> >2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-
> >qTVhfo4iSgHBg-
> >BTo&s=dslFI0W1qZdDxkbXDMTzPSUzlKMFfMUsE6tllPaF9Oc&e=
> >> > > sudeep.holla@arm.com/
> >> >
> >> > Agree, it can come after this series is merged.
> >> >
> >> > Note that it requires firmware with SMCCC v1.2 support in the
> >> > underlying platform.
> >> >
> >>
> >> I have a few questions to everyone:
> >> Is there any comprehensive documentation about how to use this?
> >Things
> >> like where in Linux can I get the ARCH_SOC_ID and how are the ID's
> >mapped
> >> to socs?
> >Kernel patch is at [1] - merged in Kernel 5.9 Makes use of SMCCC v1.2,
> >SMCCC_ARCH_SOC_ID call.
> >SMCCC v1.2 spec is at [2].
> >
> >The SoC ID becomes available at:
> >/sys/devices/socX/family
> >/sys/devices/socX/soc_id
> >/sys/devices/socX/revision
> >
> >SOC_ID makes use of JEP-106 code [3] for the SiP which makes it unique.
> >
> >[1]
> >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furld
> e
> >fense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> &amp;data=04%7C01%7Chemant.
> >agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896c%7C686ea1d
> 3bc2b4c6f
> >a92cd99c5c301635%7C0%7C0%7C637473565383043785%7CUnknown%7CT
> WFpbGZsb3d8e
> >yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> D%7C100
> >0&amp;sdata=o7%2BXNileFgI2By08IHvEYPWrDjRikXlfFtal1MCdyCM%3D&a
> mp;reserv
> >ed=0 3A__lkml.org_lkml_2020_6_25_208&d=DwIGaQ&c=nKjWec2b6R0mOy
> >Paz7xtfQ&r=1cjuAHrGh745jHNmj2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7k
> >On5DYMe_WZiykt8BVATgv7-qTVhfo4iSgHBg-
> >BTo&s=5xXdzD7DpbcDeG81JVGZf396EFNbV0rSl00hRLuZJBc&e=
> >[2]
> >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furld
> e
> >fense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> &amp;data=04%7C01%7Chemant.
> >agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896c%7C686ea1d
> 3bc2b4c6f
> >a92cd99c5c301635%7C0%7C0%7C637473565383043785%7CUnknown%7CT
> WFpbGZsb3d8e
> >yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> D%7C100
> >0&amp;sdata=o7%2BXNileFgI2By08IHvEYPWrDjRikXlfFtal1MCdyCM%3D&a
> mp;reserv
> >ed=0
> 3A__developer.arm.com_documentation_den0028_c&d=DwIGaQ&c=n
> >KjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNmj2fD85sUMIJ2IPIDsIJz
> >o6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-qTVhfo4iSgHBg-
> >BTo&s=DFG7a9oFDFczCcODfR0wVGjkLQXwMU19q_ogaFVw90I&e=
> >[3]
> >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furld
> e
> >fense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> &amp;data=04%7C01%7Chemant.
> >agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896c%7C686ea1d
> 3bc2b4c6f
> >a92cd99c5c301635%7C0%7C0%7C637473565383043785%7CUnknown%7CT
> WFpbGZsb3d8e
> >yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> D%7C100
> >0&amp;sdata=o7%2BXNileFgI2By08IHvEYPWrDjRikXlfFtal1MCdyCM%3D&a
> mp;reserv
> >ed=0
> >3A__developer.arm.com_documentation_ka001301_1-
> >2D0&d=DwIGaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNm
> >j2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-
> >qTVhfo4iSgHBg-
> >BTo&s=GQsJJuft9k1iooO8VNNIM8ZUUgGjCEPB6eRxN3qm62U&e=
> >
> >> If the ID mappings are not public then the plaform owners would need
> >to
> >> add the support, right?
> >I agree here. There are firmware changes required and we do not know
> >the IDs as well. It will be good for Marvell/NXP/NVIDIA to do this.
> >Pavan, is this ok for you?
> 
> Yeah, I believe we need fallback to the current mechanisms if SOC_ID
> support is not present or platform owners have not updated them.

[Hemant]  +1
 

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-27 15:12                                     ` Hemant Agrawal
@ 2021-01-27 15:18                                       ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-01-27 15:18 UTC (permalink / raw)
  To: hemant.agrawal, Pavan Nikhilesh Bhagavatula, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit
  Cc: dev, nd, Honnappa Nagarahalli, nd

<snip>

> > >
> > >> >
> > >> > > >
> > >> > > >v14:
> > >> > > >Resent for retesting (because of suspected false negative).
> > >> > > >
> > >> > > >Series Acked-by: Jerin Jacob <jerinj@marvell.com> Series
> > >> > > >Tested-
> > >by:
> > >> > > >Jerin Jacob <jerinj@marvell.com> Series Tested-by: Dharmik
> > >Thakkar
> > >> > > ><dharmik.thakkar@arm.com> Series Tested-by: Vimal Chungath
> > >> > > ><vcchunga@amazon.com>
> > >> > > >
> > >> > >
> > >> > > Series Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > >> > >
> > >> > > Also, I believe we need to take a look at ARCH_SOC_ID support
> > >coming
> > >> > > up in
> > >> > > 5.9 kernel.
> > >> > >
> > >> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F
> > >> > > %2
> > >> > > Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> > &amp;data=04%7C
> > >> > >
> >
> 01%7Chemant.agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896
> > c%
> > >> > >
> > 7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637473565383043785
> > %7
> > >> > >
> >
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJ
> B
> > Ti
> > >> > >
> >
> I6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=o7%2BXNileFgI2By08IHv
> > EY
> > >> > > PWrDjRikXlfFtal1MCdyCM%3D&amp;reserved=0
> > >3A__lore.kernel.org_linux-2Darm-2Dkernel_20200506164411.3284-
> > >2D1-
> > >2D&d=DwIGaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNmj
> > >2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-
> > >qTVhfo4iSgHBg-
> > >BTo&s=dslFI0W1qZdDxkbXDMTzPSUzlKMFfMUsE6tllPaF9Oc&e=
> > >> > > sudeep.holla@arm.com/
> > >> >
> > >> > Agree, it can come after this series is merged.
> > >> >
> > >> > Note that it requires firmware with SMCCC v1.2 support in the
> > >> > underlying platform.
> > >> >
> > >>
> > >> I have a few questions to everyone:
> > >> Is there any comprehensive documentation about how to use this?
> > >Things
> > >> like where in Linux can I get the ARCH_SOC_ID and how are the ID's
> > >mapped
> > >> to socs?
> > >Kernel patch is at [1] - merged in Kernel 5.9 Makes use of SMCCC
> > >v1.2, SMCCC_ARCH_SOC_ID call.
> > >SMCCC v1.2 spec is at [2].
> > >
> > >The SoC ID becomes available at:
> > >/sys/devices/socX/family
> > >/sys/devices/socX/soc_id
> > >/sys/devices/socX/revision
> > >
> > >SOC_ID makes use of JEP-106 code [3] for the SiP which makes it unique.
> > >
> > >[1]
> > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furl
> > >d
> > e
> > >fense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> > &amp;data=04%7C01%7Chemant.
> >
> >agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896c%7C686ea1d
> > 3bc2b4c6f
> > >a92cd99c5c301635%7C0%7C0%7C637473565383043785%7CUnknown%7CT
> > WFpbGZsb3d8e
> >
> >yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> > D%7C100
> >
> >0&amp;sdata=o7%2BXNileFgI2By08IHvEYPWrDjRikXlfFtal1MCdyCM%3D&a
> > mp;reserv
> > >ed=0
> 3A__lkml.org_lkml_2020_6_25_208&d=DwIGaQ&c=nKjWec2b6R0mOy
> > >Paz7xtfQ&r=1cjuAHrGh745jHNmj2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7k
> > >On5DYMe_WZiykt8BVATgv7-qTVhfo4iSgHBg-
> > >BTo&s=5xXdzD7DpbcDeG81JVGZf396EFNbV0rSl00hRLuZJBc&e=
> > >[2]
> > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furl
> > >d
> > e
> > >fense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> > &amp;data=04%7C01%7Chemant.
> >
> >agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896c%7C686ea1d
> > 3bc2b4c6f
> > >a92cd99c5c301635%7C0%7C0%7C637473565383043785%7CUnknown%7CT
> > WFpbGZsb3d8e
> >
> >yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> > D%7C100
> >
> >0&amp;sdata=o7%2BXNileFgI2By08IHvEYPWrDjRikXlfFtal1MCdyCM%3D&a
> > mp;reserv
> > >ed=0
> > 3A__developer.arm.com_documentation_den0028_c&d=DwIGaQ&c=n
> > >KjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNmj2fD85sUMIJ2IPIDsIJz
> > >o6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-qTVhfo4iSgHBg-
> > >BTo&s=DFG7a9oFDFczCcODfR0wVGjkLQXwMU19q_ogaFVw90I&e=
> > >[3]
> > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furl
> > >d
> > e
> > >fense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-
> > &amp;data=04%7C01%7Chemant.
> >
> >agrawal%40nxp.com%7Cf05a2623ec9347bd254708d8c2d4896c%7C686ea1d
> > 3bc2b4c6f
> > >a92cd99c5c301635%7C0%7C0%7C637473565383043785%7CUnknown%7CT
> > WFpbGZsb3d8e
> >
> >yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3
> > D%7C100
> >
> >0&amp;sdata=o7%2BXNileFgI2By08IHvEYPWrDjRikXlfFtal1MCdyCM%3D&a
> > mp;reserv
> > >ed=0
> > >3A__developer.arm.com_documentation_ka001301_1-
> > >2D0&d=DwIGaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=1cjuAHrGh745jHNm
> > >j2fD85sUMIJ2IPIDsIJzo6FN6Z0&m=A7kOn5DYMe_WZiykt8BVATgv7-
> > >qTVhfo4iSgHBg-
> > >BTo&s=GQsJJuft9k1iooO8VNNIM8ZUUgGjCEPB6eRxN3qm62U&e=
> > >
> > >> If the ID mappings are not public then the plaform owners would
> > >> need
> > >to
> > >> add the support, right?
> > >I agree here. There are firmware changes required and we do not know
> > >the IDs as well. It will be good for Marvell/NXP/NVIDIA to do this.
> > >Pavan, is this ok for you?
> >
> > Yeah, I believe we need fallback to the current mechanisms if SOC_ID
> > support is not present or platform owners have not updated them.
> 
> [Hemant]  +1
> 
Agree.
Just to be clear, my ask is, can any of you take this work as Arm will not have all the parts to test this?

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-12  8:28                                   ` Juraj Linkeš
@ 2021-01-29  8:41                                     ` Juraj Linkeš
  2021-01-29  9:45                                       ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-29  8:41 UTC (permalink / raw)
  To: Juraj Linkeš, Andrew Boyer, Honnappa Nagarahalli, Bruce Richardson
  Cc: thomas, Ruifeng Wang, Phil Yang, vcchunga, Dharmik Thakkar,
	jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd

> > 3) We need to build kni against the aarch64 kernel headers, but it
> > fails. It appears that kernel/linux/kni/meson.build doesn’t pass any
> > cross-compile flags in the make command it creates. The diff below
> > shows how I hardcoded it to get it to work for now. Thoughts on how to
> > do this right? meson has the path (in
> > $PATH) and the binary prefixs (in ‘[binaries]’ in the cross file). It
> > must know the arch, too.
> >
> > --- a/kernel/linux/kni/meson.build
> > +++ b/kernel/linux/kni/meson.build
> > @@ -14,6 +14,8 @@ custom_target('rte_kni',
> >         input: kni_sources,
> >         output: 'rte_kni.ko',
> >         command: ['make', '-j4', '-C', kernel_dir + '/build',
> > +
> > + 'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux-
> > gnu-',
> > +               'ARCH=aarch64',
> >                 'M=' + meson.current_build_dir(),
> >                 'src=' + meson.current_source_dir(),
> >                 'MODULE_CFLAGS=-include ' + meson.source_root() +
> > '/config/rte_config.h' +
> >
> 
> Yes, Meson should know these. I'll submit this separately (in a new series), as
> this series is getting pretty big and this fix is actually unrelated.
> 

I tried to figure out how to implement this and I've ran into a brick wall - there's no way to figure out the full name of the cross-compiler. I found only one way to get the cross compiler:
meson.get_compiler('c', native:false).get_id()

But that only retuns 'gcc', not the full binary name (c = 'aarch64-linux-gnu-gcc' in cross file).

Bruce, any ideas on how to get the full name? If I understand the sources right, we aren't able to access arbitrary object attributes, just those, which are specifically exposed.

Maybe we could do a workaround? Either if cross compiling and the compiler is gcc, use the 'aarch64-linux-gnu-' prefix or just put the prefix into the cross file as an additional property?

> > I will try to get to a full review soon.
> >
> > Thank you,
> > Andrew

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-29  8:41                                     ` Juraj Linkeš
@ 2021-01-29  9:45                                       ` Bruce Richardson
  2021-01-29 10:07                                         ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-01-29  9:45 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Andrew Boyer, Honnappa Nagarahalli, thomas, Ruifeng Wang,
	Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd

On Fri, Jan 29, 2021 at 08:41:45AM +0000, Juraj Linkeš wrote:
> > > 3) We need to build kni against the aarch64 kernel headers, but it
> > > fails. It appears that kernel/linux/kni/meson.build doesn’t pass any
> > > cross-compile flags in the make command it creates. The diff below
> > > shows how I hardcoded it to get it to work for now. Thoughts on how
> > > to do this right? meson has the path (in $PATH) and the binary
> > > prefixs (in ‘[binaries]’ in the cross file). It must know the arch,
> > > too.
> > >
> > > --- a/kernel/linux/kni/meson.build +++ b/kernel/linux/kni/meson.build
> > > @@ -14,6 +14,8 @@ custom_target('rte_kni', input: kni_sources,
> > > output: 'rte_kni.ko', command: ['make', '-j4', '-C', kernel_dir +
> > > '/build', + +
> > > 'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux- gnu-',
> > > +               'ARCH=aarch64', 'M=' + meson.current_build_dir(),
> > > 'src=' + meson.current_source_dir(), 'MODULE_CFLAGS=-include ' +
> > > meson.source_root() + '/config/rte_config.h' +
> > >
> > 
> > Yes, Meson should know these. I'll submit this separately (in a new
> > series), as this series is getting pretty big and this fix is actually
> > unrelated.
> > 
> 
> I tried to figure out how to implement this and I've ran into a brick
> wall - there's no way to figure out the full name of the cross-compiler.
> I found only one way to get the cross compiler: meson.get_compiler('c',
> native:false).get_id()
> 
> But that only retuns 'gcc', not the full binary name (c =
> 'aarch64-linux-gnu-gcc' in cross file).
> 
> Bruce, any ideas on how to get the full name? If I understand the sources
> right, we aren't able to access arbitrary object attributes, just those,
> which are specifically exposed.
> 
> Maybe we could do a workaround? Either if cross compiling and the
> compiler is gcc, use the 'aarch64-linux-gnu-' prefix or just put the
> prefix into the cross file as an additional property?
> 
According to the cross-file/native-file documentation[1], the files in the
binaries section can be queried using the "find_program()" call. That then
returns an external program object rather than a compiler one, so the full
path can be got. Unfortunately, find_program('c') doesn't seem to work for
the non-cross-compiled case, so it will need to be conditional on
cross-compilation.

Example I tested:

<code change added>
+myc = find_program('c')
+message('find_program(\'c\') = ' + myc.full_path())
+

<output when run>
~/dpdk.org/__BUILDS/build-arm64-host-clang$ ninja
[0/1] Regenerating build files.
....
Target machine cpu family: aarch64
Target machine cpu: armv8-a
Program aarch64-linux-gnu-gcc found: YES
WARNING: Project targeting '>= 0.47.1' but tried to use feature introduced in '0.55.0': ExternalProgram.full_path.
Message: find_program('c') = /home/bruce/Downloads/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
...

/Bruce


[1] https://mesonbuild.com/Machine-files.html#binaries 

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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-29  9:45                                       ` Bruce Richardson
@ 2021-01-29 10:07                                         ` Juraj Linkeš
  2021-01-29 10:09                                           ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-01-29 10:07 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Andrew Boyer, Honnappa Nagarahalli, thomas, Ruifeng Wang,
	Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday, January 29, 2021 10:46 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Andrew Boyer <aboyer@pensando.io>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; thomas@monjalon.net; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; dev@dpdk.org; nd <nd@arm.com>
> Subject: Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
> 
> On Fri, Jan 29, 2021 at 08:41:45AM +0000, Juraj Linkeš wrote:
> > > > 3) We need to build kni against the aarch64 kernel headers, but it
> > > > fails. It appears that kernel/linux/kni/meson.build doesn’t pass
> > > > any cross-compile flags in the make command it creates. The diff
> > > > below shows how I hardcoded it to get it to work for now. Thoughts
> > > > on how to do this right? meson has the path (in $PATH) and the
> > > > binary prefixs (in ‘[binaries]’ in the cross file). It must know
> > > > the arch, too.
> > > >
> > > > --- a/kernel/linux/kni/meson.build +++
> > > > b/kernel/linux/kni/meson.build @@ -14,6 +14,8 @@
> > > > custom_target('rte_kni', input: kni_sources,
> > > > output: 'rte_kni.ko', command: ['make', '-j4', '-C', kernel_dir +
> > > > '/build', + +
> > > > 'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux-
> > > > gnu-',
> > > > +               'ARCH=aarch64', 'M=' + meson.current_build_dir(),
> > > > 'src=' + meson.current_source_dir(), 'MODULE_CFLAGS=-include ' +
> > > > meson.source_root() + '/config/rte_config.h' +
> > > >
> > >
> > > Yes, Meson should know these. I'll submit this separately (in a new
> > > series), as this series is getting pretty big and this fix is
> > > actually unrelated.
> > >
> >
> > I tried to figure out how to implement this and I've ran into a brick
> > wall - there's no way to figure out the full name of the cross-compiler.
> > I found only one way to get the cross compiler:
> > meson.get_compiler('c',
> > native:false).get_id()
> >
> > But that only retuns 'gcc', not the full binary name (c =
> > 'aarch64-linux-gnu-gcc' in cross file).
> >
> > Bruce, any ideas on how to get the full name? If I understand the
> > sources right, we aren't able to access arbitrary object attributes,
> > just those, which are specifically exposed.
> >
> > Maybe we could do a workaround? Either if cross compiling and the
> > compiler is gcc, use the 'aarch64-linux-gnu-' prefix or just put the
> > prefix into the cross file as an additional property?
> >
> According to the cross-file/native-file documentation[1], the files in the binaries
> section can be queried using the "find_program()" call. That then returns an
> external program object rather than a compiler one, so the full path can be got.
> Unfortunately, find_program('c') doesn't seem to work for the non-cross-
> compiled case, so it will need to be conditional on cross-compilation.
> 

Thanks, this is great, I'll use this.
We don't need it for native builds. But it's strange that it doesn't work for those - the docs say it does.

> Example I tested:
> 
> <code change added>
> +myc = find_program('c')
> +message('find_program(\'c\') = ' + myc.full_path())
> +
> 
> <output when run>
> ~/dpdk.org/__BUILDS/build-arm64-host-clang$ ninja [0/1] Regenerating build
> files.
> ....
> Target machine cpu family: aarch64
> Target machine cpu: armv8-a
> Program aarch64-linux-gnu-gcc found: YES
> WARNING: Project targeting '>= 0.47.1' but tried to use feature introduced in
> '0.55.0': ExternalProgram.full_path.
> Message: find_program('c') = /home/bruce/Downloads/gcc-arm-8.3-2019.03-
> x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
> ...
> 
> /Bruce
> 
> 
> [1] https://mesonbuild.com/Machine-files.html#binaries


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

* Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
  2021-01-29 10:07                                         ` Juraj Linkeš
@ 2021-01-29 10:09                                           ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2021-01-29 10:09 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Andrew Boyer, Honnappa Nagarahalli, thomas, Ruifeng Wang,
	Phil Yang, vcchunga, Dharmik Thakkar, jerinjacobk,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, dev, nd

On Fri, Jan 29, 2021 at 10:07:30AM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Friday, January 29, 2021 10:46 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Andrew Boyer <aboyer@pensando.io>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; thomas@monjalon.net; Ruifeng Wang
> > <Ruifeng.Wang@arm.com>; Phil Yang <Phil.Yang@arm.com>;
> > vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > ferruh.yigit@intel.com; dev@dpdk.org; nd <nd@arm.com>
> > Subject: Re: [dpdk-dev] [PATCH v14 00/12] Arm build options rework
> > 
> > On Fri, Jan 29, 2021 at 08:41:45AM +0000, Juraj Linkeš wrote:
> > > > > 3) We need to build kni against the aarch64 kernel headers, but it
> > > > > fails. It appears that kernel/linux/kni/meson.build doesn’t pass
> > > > > any cross-compile flags in the make command it creates. The diff
> > > > > below shows how I hardcoded it to get it to work for now. Thoughts
> > > > > on how to do this right? meson has the path (in $PATH) and the
> > > > > binary prefixs (in ‘[binaries]’ in the cross file). It must know
> > > > > the arch, too.
> > > > >
> > > > > --- a/kernel/linux/kni/meson.build +++
> > > > > b/kernel/linux/kni/meson.build @@ -14,6 +14,8 @@
> > > > > custom_target('rte_kni', input: kni_sources,
> > > > > output: 'rte_kni.ko', command: ['make', '-j4', '-C', kernel_dir +
> > > > > '/build', + +
> > > > > 'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux-
> > > > > gnu-',
> > > > > +               'ARCH=aarch64', 'M=' + meson.current_build_dir(),
> > > > > 'src=' + meson.current_source_dir(), 'MODULE_CFLAGS=-include ' +
> > > > > meson.source_root() + '/config/rte_config.h' +
> > > > >
> > > >
> > > > Yes, Meson should know these. I'll submit this separately (in a new
> > > > series), as this series is getting pretty big and this fix is
> > > > actually unrelated.
> > > >
> > >
> > > I tried to figure out how to implement this and I've ran into a brick
> > > wall - there's no way to figure out the full name of the cross-compiler.
> > > I found only one way to get the cross compiler:
> > > meson.get_compiler('c',
> > > native:false).get_id()
> > >
> > > But that only retuns 'gcc', not the full binary name (c =
> > > 'aarch64-linux-gnu-gcc' in cross file).
> > >
> > > Bruce, any ideas on how to get the full name? If I understand the
> > > sources right, we aren't able to access arbitrary object attributes,
> > > just those, which are specifically exposed.
> > >
> > > Maybe we could do a workaround? Either if cross compiling and the
> > > compiler is gcc, use the 'aarch64-linux-gnu-' prefix or just put the
> > > prefix into the cross file as an additional property?
> > >
> > According to the cross-file/native-file documentation[1], the files in the binaries
> > section can be queried using the "find_program()" call. That then returns an
> > external program object rather than a compiler one, so the full path can be got.
> > Unfortunately, find_program('c') doesn't seem to work for the non-cross-
> > compiled case, so it will need to be conditional on cross-compilation.
> > 
> 
> Thanks, this is great, I'll use this.
> We don't need it for native builds. But it's strange that it doesn't work for those - the docs say it does.
> 
If probably works if a native-file rather than a cross-file is passed.
Without a native file, meson is probably looking for a program called "c"
on the OS, rather than recognising that it's the C compiler being looked
for.

/Bruce

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

* [dpdk-dev] [PATCH v16 0/3] Arm build options rework
  2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
                                               ` (12 preceding siblings ...)
  2021-01-18 21:31                             ` [dpdk-dev] [PATCH v15 00/12] Arm build options rework Thomas Monjalon
@ 2021-02-03 14:03                             ` Juraj Linkeš
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
                                                 ` (2 more replies)
  13 siblings, 3 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-02-03 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

We also want to be able to enable/disable which drivers are built
without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/enabled or
  disabled drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
  option or using a cross file

v16:
Only three commits remaining - updated the cover letter.
Renamed the 'soc' meson option to 'platform'.
Added the support for enabling a particular set of drivers.
Aligned enabling and disabling with the command line option so that
wildcards can be used.

Juraj Linkeš (3):
  build: disable/enable drivers in Arm builds
  build: add 'platform' meson option and Arm SoC config
  config: fix Arm implementer and its SoCs

 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 178 +++++++++++++++---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
 drivers/meson.build                           |  41 +++-
 meson.build                                   |   2 +
 meson_options.txt                             |   2 +
 18 files changed, 231 insertions(+), 139 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-02-03 14:03                             ` [dpdk-dev] [PATCH v16 0/3] " Juraj Linkeš
@ 2021-02-03 14:03                               ` Juraj Linkeš
  2021-02-19 10:38                                 ` Juraj Linkeš
  2021-03-31 10:26                                 ` [dpdk-dev] [PATCH v17 0/3] Arm build options rework Juraj Linkeš
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
  2 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-02-03 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add support for enabling or disabling drivers for Arm cross build. Do
not implement any enable/disable lists yet.

Enabling drivers is useful when building for an SoC where we only want
to build a few drivers. That way the list won't be too long.

Similarly, disabling drivers is useful when we want to disable only a
few drivers.

Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
same arch) builds, where the build machine may have the required driver
dependencies, yet we don't want to build drivers for a speficic SoC.

By default, build all drivers for which dependencies are found. If
enabled_drivers is a non-empty list, build only those drivers.  If
disabled_drivers is non-empty list, build all drivers except those in
disabled_drivers. Error out if both are specified (i.e. do not support
that case).

Remove the old Makefile arm configutaion options which don't do anything
in Meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build                        |  4 --
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 ++++
 drivers/meson.build                           | 41 ++++++++++++++++---
 meson.build                                   |  2 +
 4 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index f948768578..d279724dec 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -16,9 +16,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -125,7 +122,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 faaf24b95b..1504dbfef0 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
       numa = false        # set to false to force building for a non-NUMA system
          # if not set or set to true, the build system will build for a NUMA
          # system only if libnuma is installed
+
+      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
+
+      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
diff --git a/drivers/meson.build b/drivers/meson.build
index fdf76120ac..70c1aa4e6c 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,8 +18,36 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
-		).stdout().split()
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
+endif
+
+# add cmdline disabled drivers (comma separated string)
+# and meson disabled drivers (list)
+# together into a comma separated string
+disabled_drivers = ','.join([get_option('disable_drivers'), ','.join(disabled_drivers)]).strip(',')
+if disabled_drivers != ''
+	disabled_drivers = run_command(list_dir_globs,
+		disabled_drivers).stdout().split()
+else
+	disabled_drivers = []
+endif
+
+if enabled_drivers != []
+	enabled_drivers = run_command(list_dir_globs,
+		','.join(enabled_drivers)).stdout().split()
+endif
+
+if disabled_drivers != [] and enabled_drivers != []
+	# TODO/QUERY we could support both:
+	# first 'select' only drivers by enabled_drivers
+	# then 'deselect' those in disabled_drivers
+	# this would be useful if a directory is in enabled_drivers
+	# and a driver from that directory is in disabled_drivers
+	error('Simultaneous disabled drivers and enabled drivers ' +
+	      'configuration is not supported.')
+endif
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -48,7 +76,7 @@ foreach subpath:subdirs
 		dpdk_driver_classes += class
 	endif
 	# get already enabled drivers of the same class
-	enabled_drivers = get_variable(class + '_drivers', [])
+	enabled_class_drivers = get_variable(class + '_drivers', [])
 
 	foreach drv:drivers
 		drv_path = join_paths(class, drv)
@@ -76,6 +104,9 @@ foreach subpath:subdirs
 		if disabled_drivers.contains(drv_path)
 			build = false
 			reason = 'explicitly disabled via build config'
+		elif enabled_drivers.length() > 0 and not enabled_drivers.contains(drv_path)
+			build = false
+			reason = 'not in enabled drivers build config'
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
@@ -108,7 +139,7 @@ foreach subpath:subdirs
 						'_disable_reason', reason)
 			endif
 		else
-			enabled_drivers += name
+			enabled_class_drivers += name
 			lib_name = '_'.join(['rte', class, name])
 			dpdk_conf.set(lib_name.to_upper(), 1)
 
@@ -213,5 +244,5 @@ foreach subpath:subdirs
 		endif # build
 	endforeach
 
-	set_variable(class + '_drivers', enabled_drivers)
+	set_variable(class + '_drivers', enabled_class_drivers)
 endforeach
diff --git a/meson.build b/meson.build
index fcc4d4c900..ea7ccfdae3 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,8 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
+enabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
-- 
2.20.1


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

* [dpdk-dev] [PATCH v16 2/3] build: add 'platform' meson option and Arm SoC config
  2021-02-03 14:03                             ` [dpdk-dev] [PATCH v16 0/3] " Juraj Linkeš
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-02-03 14:03                               ` Juraj Linkeš
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
  2 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-02-03 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration sets to Arm meson.build and add an arch
agnostic meson option, 'platform', to select from these SoC
configurations for meson native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 140 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  84 ++++-------
 meson_options.txt                             |   2 +
 16 files changed, 179 insertions(+), 118 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 9958db6692..301418949b 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'armada'
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804 b/config/arm/arm64_armv8_linux_clang_ubuntu1804
index 8d8cc50ea4..db488d75f4 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu1804
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
@@ -14,7 +14,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'generic'
-part_number = 'default'
+platform = 'generic'
 c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-gnu']
 c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da1..5391d35389 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+platform = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd4..248a9f031a 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c7628..e9d5fd31fc 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb055106..9cdd931180 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+platform = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index edacb79497..8016fd236c 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef7..0df283e2f4 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+platform = 'n1sdp'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 817b8ee28e..036aee2b0a 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd49'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'n2'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 5937697098..9156ee5410 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+platform = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd4..319a4a151d 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b3..69c71cbc82 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+platform = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e48..372097ba01 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+platform = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index d279724dec..c85d2ab005 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -25,7 +25,7 @@ flags_common = [
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -177,6 +177,106 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_n2 = {
+	'description': 'Arm Neoverse N2',
+	'implementer': '0x41',
+	'part_number': '0xd49',
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'n2': soc_n2,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -188,11 +288,19 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
+	soc = get_option('platform')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
+			if soc != ''
+				error('Building for a particular platform is ' +
+				      'unsupported with default build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif soc != ''
+			soc_config = socs.get(soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -210,8 +318,30 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		soc = meson.get_cross_property('platform', '')
+		if soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
+		if soc_config.has_key('enabled_drivers')
+			enabled_drivers += soc_config['enabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -237,8 +367,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add/overwrite flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 1504dbfef0..fb01f3020c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -187,58 +187,32 @@ Use the following command to cross-compile DPDK for the target machine::
    meson aarch64-build-clang --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804
    ninja -C aarch64-build-clang
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
-
-      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
-
-      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Dplatform meson
+option::
+
+   meson soc_build -Dplatform=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   platform = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index 5c382487da..3b8efa5a27 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -28,6 +28,8 @@ option('max_lcores', type: 'integer', value: 128,
 	description: 'maximum number of cores/threads supported by EAL')
 option('max_numa_nodes', type: 'integer', value: 4,
 	description: 'maximum number of NUMA nodes supported by EAL')
+option('platform', type: 'string', value: '',
+	description: 'Use configuration for a particular platform (such as an Arm SoC).')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v16 3/3] config: fix Arm implementer and its SoCs
  2021-02-03 14:03                             ` [dpdk-dev] [PATCH v16 0/3] " Juraj Linkeš
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-02-03 14:03                               ` Juraj Linkeš
  2 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-02-03 14:03 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 config/arm/meson.build | 60 +++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 33 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index c85d2ab005..1727c9def7 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -56,7 +56,8 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80]
+			['RTE_MAX_LCORE', 80],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	},
 	'0xd49': {
@@ -64,7 +65,8 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_MAX_LCORE', 64]
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	}
 }
@@ -74,8 +76,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -143,38 +145,12 @@ implementer_ampere = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
-	'0x50': implementer_ampere,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x50': implementer_ampere
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -187,8 +163,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -196,13 +176,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -246,6 +236,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-02-19 10:38                                 ` Juraj Linkeš
  2021-03-09  8:58                                   ` Juraj Linkeš
  2021-03-31 10:26                                 ` [dpdk-dev] [PATCH v17 0/3] Arm build options rework Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-02-19 10:38 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev

I believe this is the last patch in the series that needs some more review. I implemented both an allowlist and a blocklist, so please let me know if this would be usable. There's only the implementation, the actual allow/blocklists would have to be added by maintainers/SoC owners.

There's also an open question of whether we want to have the allow/blocklist be exclusive (only one of them supported at a time) or both could be used at the same time. More in TODO/QUERY below.

> ---
>  config/arm/meson.build                        |  4 --
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 ++++
>  drivers/meson.build                           | 41 ++++++++++++++++---
>  meson.build                                   |  2 +
>  4 files changed, 46 insertions(+), 9 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> f948768578..d279724dec 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -16,9 +16,6 @@ flags_common = [
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> 
> -	['RTE_NET_FM10K', false],
> -	['RTE_NET_AVP', false],
> -
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
>  	['RTE_ARCH_ARM64', true],
> @@ -125,7 +122,6 @@ implementer_cavium = {
>  				['RTE_MACHINE', '"octeontx2"'],
>  				['RTE_ARM_FEATURE_ATOMICS', true],
>  				['RTE_USE_C11_MEM_MODEL', true],
> -				['RTE_EAL_IGB_UIO', false],
>  				['RTE_MAX_LCORE', 36],
>  				['RTE_MAX_NUMA_NODES', 1]
>  			]
> 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 faaf24b95b..1504dbfef0 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -234,3 +234,11 @@ There are other options you may specify in a cross file
> to tailor the build::
>        numa = false        # set to false to force building for a non-NUMA system
>           # if not set or set to true, the build system will build for a NUMA
>           # system only if libnuma is installed
> +
> +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> +
> +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> diff --git a/drivers/meson.build b/drivers/meson.build index
> fdf76120ac..70c1aa4e6c 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -18,8 +18,36 @@ subdirs = [
>  	'baseband', # depends on common and bus.
>  ]
> 
> -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> -		).stdout().split()
> +if meson.is_cross_build()
> +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> +	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
> +endif
> +
> +# add cmdline disabled drivers (comma separated string) # and meson
> +disabled drivers (list) # together into a comma separated string
> +disabled_drivers = ','.join([get_option('disable_drivers'),
> +','.join(disabled_drivers)]).strip(',')
> +if disabled_drivers != ''
> +	disabled_drivers = run_command(list_dir_globs,
> +		disabled_drivers).stdout().split()
> +else
> +	disabled_drivers = []
> +endif
> +
> +if enabled_drivers != []
> +	enabled_drivers = run_command(list_dir_globs,
> +		','.join(enabled_drivers)).stdout().split()
> +endif
> +
> +if disabled_drivers != [] and enabled_drivers != []
> +	# TODO/QUERY we could support both:
> +	# first 'select' only drivers by enabled_drivers
> +	# then 'deselect' those in disabled_drivers
> +	# this would be useful if a directory is in enabled_drivers
> +	# and a driver from that directory is in disabled_drivers
> +	error('Simultaneous disabled drivers and enabled drivers ' +
> +	      'configuration is not supported.') endif
> 
>  default_cflags = machine_args
>  default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -48,7 +76,7 @@
> foreach subpath:subdirs
>  		dpdk_driver_classes += class
>  	endif
>  	# get already enabled drivers of the same class
> -	enabled_drivers = get_variable(class + '_drivers', [])
> +	enabled_class_drivers = get_variable(class + '_drivers', [])
> 
>  	foreach drv:drivers
>  		drv_path = join_paths(class, drv)
> @@ -76,6 +104,9 @@ foreach subpath:subdirs
>  		if disabled_drivers.contains(drv_path)
>  			build = false
>  			reason = 'explicitly disabled via build config'
> +		elif enabled_drivers.length() > 0 and not
> enabled_drivers.contains(drv_path)
> +			build = false
> +			reason = 'not in enabled drivers build config'
>  		else
>  			# pull in driver directory which should update all the
> local variables
>  			subdir(drv_path)
> @@ -108,7 +139,7 @@ foreach subpath:subdirs
>  						'_disable_reason', reason)
>  			endif
>  		else
> -			enabled_drivers += name
> +			enabled_class_drivers += name
>  			lib_name = '_'.join(['rte', class, name])
>  			dpdk_conf.set(lib_name.to_upper(), 1)
> 
> @@ -213,5 +244,5 @@ foreach subpath:subdirs
>  		endif # build
>  	endforeach
> 
> -	set_variable(class + '_drivers', enabled_drivers)
> +	set_variable(class + '_drivers', enabled_class_drivers)
>  endforeach
> diff --git a/meson.build b/meson.build
> index fcc4d4c900..ea7ccfdae3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -22,6 +22,8 @@ dpdk_drivers = []
>  dpdk_extra_ldflags = []
>  dpdk_libs_disabled = []
>  dpdk_drvs_disabled = []
> +disabled_drivers = []
> +enabled_drivers = []
>  abi_version_file = files('ABI_VERSION')
> 
>  if host_machine.cpu_family().startswith('x86')
> --
> 2.20.1


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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-02-19 10:38                                 ` Juraj Linkeš
@ 2021-03-09  8:58                                   ` Juraj Linkeš
  2021-03-09 10:56                                     ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-09  8:58 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, lironh
  Cc: dev

Honnappa, Thomas, Bruce, Jerin, you've comments in the past. Do you have any further input?

I think we just need to agree on the allowlist/blocklist mechanism. The current commit allows specifying either an allowlist or a blocklist, but not both. However, it would possible to implement specifying both - first we'll allow what's in allowlist and then we'll remove from that set what's in blocklist. Thoughts?

Note that among the three commits remaining in this series, this commit is the only one that seems to be lacking in review. Please consider reviewing ASAP so that we can finally finish the series.

Thanks,
Juraj

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, February 19, 2021 11:39 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> 
> I believe this is the last patch in the series that needs some more review. I
> implemented both an allowlist and a blocklist, so please let me know if this
> would be usable. There's only the implementation, the actual allow/blocklists
> would have to be added by maintainers/SoC owners.
> 
> There's also an open question of whether we want to have the allow/blocklist
> be exclusive (only one of them supported at a time) or both could be used at the
> same time. More in TODO/QUERY below.
> 
> > ---
> >  config/arm/meson.build                        |  4 --
> >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 ++++
> >  drivers/meson.build                           | 41 ++++++++++++++++---
> >  meson.build                                   |  2 +
> >  4 files changed, 46 insertions(+), 9 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > f948768578..d279724dec 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -16,9 +16,6 @@ flags_common = [
> >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> >
> > -	['RTE_NET_FM10K', false],
> > -	['RTE_NET_AVP', false],
> > -
> >  	['RTE_SCHED_VECTOR', false],
> >  	['RTE_ARM_USE_WFE', false],
> >  	['RTE_ARCH_ARM64', true],
> > @@ -125,7 +122,6 @@ implementer_cavium = {
> >  				['RTE_MACHINE', '"octeontx2"'],
> >  				['RTE_ARM_FEATURE_ATOMICS', true],
> >  				['RTE_USE_C11_MEM_MODEL', true],
> > -				['RTE_EAL_IGB_UIO', false],
> >  				['RTE_MAX_LCORE', 36],
> >  				['RTE_MAX_NUMA_NODES', 1]
> >  			]
> > 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 faaf24b95b..1504dbfef0 100644
> > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > @@ -234,3 +234,11 @@ There are other options you may specify in a
> > cross file to tailor the build::
> >        numa = false        # set to false to force building for a non-NUMA system
> >           # if not set or set to true, the build system will build for a NUMA
> >           # system only if libnuma is installed
> > +
> > +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> > +         # valid values are dir/subdirs in the drivers directory
> > +         # wildcards are allowed
> > +
> > +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> > +         # valid values are dir/subdirs in the drivers directory
> > +         # wildcards are allowed
> > diff --git a/drivers/meson.build b/drivers/meson.build index
> > fdf76120ac..70c1aa4e6c 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -18,8 +18,36 @@ subdirs = [
> >  	'baseband', # depends on common and bus.
> >  ]
> >
> > -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> > -		).stdout().split()
> > +if meson.is_cross_build()
> > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > +	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
> > +endif
> > +
> > +# add cmdline disabled drivers (comma separated string) # and meson
> > +disabled drivers (list) # together into a comma separated string
> > +disabled_drivers = ','.join([get_option('disable_drivers'),
> > +','.join(disabled_drivers)]).strip(',')
> > +if disabled_drivers != ''
> > +	disabled_drivers = run_command(list_dir_globs,
> > +		disabled_drivers).stdout().split()
> > +else
> > +	disabled_drivers = []
> > +endif
> > +
> > +if enabled_drivers != []
> > +	enabled_drivers = run_command(list_dir_globs,
> > +		','.join(enabled_drivers)).stdout().split()
> > +endif
> > +
> > +if disabled_drivers != [] and enabled_drivers != []
> > +	# TODO/QUERY we could support both:
> > +	# first 'select' only drivers by enabled_drivers
> > +	# then 'deselect' those in disabled_drivers
> > +	# this would be useful if a directory is in enabled_drivers
> > +	# and a driver from that directory is in disabled_drivers
> > +	error('Simultaneous disabled drivers and enabled drivers ' +
> > +	      'configuration is not supported.') endif
> >
> >  default_cflags = machine_args
> >  default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -48,7 +76,7 @@
> > foreach subpath:subdirs
> >  		dpdk_driver_classes += class
> >  	endif
> >  	# get already enabled drivers of the same class
> > -	enabled_drivers = get_variable(class + '_drivers', [])
> > +	enabled_class_drivers = get_variable(class + '_drivers', [])
> >
> >  	foreach drv:drivers
> >  		drv_path = join_paths(class, drv)
> > @@ -76,6 +104,9 @@ foreach subpath:subdirs
> >  		if disabled_drivers.contains(drv_path)
> >  			build = false
> >  			reason = 'explicitly disabled via build config'
> > +		elif enabled_drivers.length() > 0 and not
> > enabled_drivers.contains(drv_path)
> > +			build = false
> > +			reason = 'not in enabled drivers build config'
> >  		else
> >  			# pull in driver directory which should update all the
> local
> > variables
> >  			subdir(drv_path)
> > @@ -108,7 +139,7 @@ foreach subpath:subdirs
> >  						'_disable_reason', reason)
> >  			endif
> >  		else
> > -			enabled_drivers += name
> > +			enabled_class_drivers += name
> >  			lib_name = '_'.join(['rte', class, name])
> >  			dpdk_conf.set(lib_name.to_upper(), 1)
> >
> > @@ -213,5 +244,5 @@ foreach subpath:subdirs
> >  		endif # build
> >  	endforeach
> >
> > -	set_variable(class + '_drivers', enabled_drivers)
> > +	set_variable(class + '_drivers', enabled_class_drivers)
> >  endforeach
> > diff --git a/meson.build b/meson.build index fcc4d4c900..ea7ccfdae3
> > 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -22,6 +22,8 @@ dpdk_drivers = []
> >  dpdk_extra_ldflags = []
> >  dpdk_libs_disabled = []
> >  dpdk_drvs_disabled = []
> > +disabled_drivers = []
> > +enabled_drivers = []
> >  abi_version_file = files('ABI_VERSION')
> >
> >  if host_machine.cpu_family().startswith('x86')
> > --
> > 2.20.1


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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09  8:58                                   ` Juraj Linkeš
@ 2021-03-09 10:56                                     ` Bruce Richardson
  2021-03-09 11:49                                       ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-03-09 10:56 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, lironh, dev

On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> Honnappa, Thomas, Bruce, Jerin, you've comments in the past. Do you have any further input?
> 
> I think we just need to agree on the allowlist/blocklist mechanism. The current commit allows specifying either an allowlist or a blocklist, but not both. However, it would possible to implement specifying both - first we'll allow what's in allowlist and then we'll remove from that set what's in blocklist. Thoughts?
> 

If we have both, I think limiting to only one is by far the sanest option.
I'm not fully convinced by the need to have both, since the blocklist
allows wildcarding and exception cases. For example "net/[!i]*" will
blocklist all net drivers except those starting with an "i". Admittedly,
for usability purposes having an allowlist might work better.

One final thought, if we add a driver allowlist for cross files, should we
also add one as a top-level meson option also for consistency?

/Bruce

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 10:56                                     ` Bruce Richardson
@ 2021-03-09 11:49                                       ` Juraj Linkeš
  2021-03-09 12:57                                         ` Jerin Jacob
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-09 11:49 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, lironh, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, March 9, 2021 11:57 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> lironh@marvell.com; dev@dpdk.org
> Subject: Re: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> 
> On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > Honnappa, Thomas, Bruce, Jerin, you've comments in the past. Do you have
> any further input?
> >
> > I think we just need to agree on the allowlist/blocklist mechanism. The current
> commit allows specifying either an allowlist or a blocklist, but not both.
> However, it would possible to implement specifying both - first we'll allow
> what's in allowlist and then we'll remove from that set what's in blocklist.
> Thoughts?
> >
> 
> If we have both, I think limiting to only one is by far the sanest option.
> I'm not fully convinced by the need to have both, since the blocklist allows
> wildcarding and exception cases. For example "net/[!i]*" will blocklist all net
> drivers except those starting with an "i". Admittedly, for usability purposes
> having an allowlist might work better.
> 

If we only want to build a handful of drivers then the list could be very long (which was the original reason behind having an allowlist), such as here:
https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packages/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD

An allowlist could also help with maintenance - users won't need to add new drivers to their blocklists (if that's what users need, like in the case of VPP).

> One final thought, if we add a driver allowlist for cross files, should we also add
> one as a top-level meson option also for consistency?
> 

This definitely makese sense. I was thinking about this and wasn't sure whether I should put it into this commit or a separate one. The commit evolved a bit and now that it's just an implementation of an allow/blocklist it makes sense to include a meson option in it I think - I'll put it into the next version.

> /Bruce


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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 11:49                                       ` Juraj Linkeš
@ 2021-03-09 12:57                                         ` Jerin Jacob
  2021-03-09 15:08                                           ` Honnappa Nagarahalli
  2021-03-09 15:10                                           ` Honnappa Nagarahalli
  0 siblings, 2 replies; 465+ messages in thread
From: Jerin Jacob @ 2021-03-09 12:57 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Bruce Richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, lironh, dev

On Tue, Mar 9, 2021 at 5:19 PM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
>
>
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Tuesday, March 9, 2021 11:57 AM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> > lironh@marvell.com; dev@dpdk.org
> > Subject: Re: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> >
> > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past. Do you have
> > any further input?
> > >
> > > I think we just need to agree on the allowlist/blocklist mechanism. The current
> > commit allows specifying either an allowlist or a blocklist, but not both.
> > However, it would possible to implement specifying both - first we'll allow
> > what's in allowlist and then we'll remove from that set what's in blocklist.
> > Thoughts?
> > >
> >
> > If we have both, I think limiting to only one is by far the sanest option.
> > I'm not fully convinced by the need to have both, since the blocklist allows
> > wildcarding and exception cases. For example "net/[!i]*" will blocklist all net
> > drivers except those starting with an "i". Admittedly, for usability purposes
> > having an allowlist might work better.
> >
>
> If we only want to build a handful of drivers then the list could be very long (which was the original reason behind having an allowlist), such as here:
> https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packages/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
>
> An allowlist could also help with maintenance - users won't need to add new drivers to their blocklists (if that's what users need, like in the case of VPP).

+1 for allowlist.


>
> > One final thought, if we add a driver allowlist for cross files, should we also add
> > one as a top-level meson option also for consistency?
> >
>
> This definitely makese sense. I was thinking about this and wasn't sure whether I should put it into this commit or a separate one. The commit evolved a bit and now that it's just an implementation of an allow/blocklist it makes sense to include a meson option in it I think - I'll put it into the next version.
>
> > /Bruce
>

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 12:57                                         ` Jerin Jacob
@ 2021-03-09 15:08                                           ` Honnappa Nagarahalli
  2021-03-09 15:49                                             ` Juraj Linkeš
  2021-03-09 15:10                                           ` Honnappa Nagarahalli
  1 sibling, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-03-09 15:08 UTC (permalink / raw)
  To: Jerin Jacob, Juraj Linkeš
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd

<snip>

> > >
> > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past. Do
> > > > you have
> > > any further input?
> > > >
> > > > I think we just need to agree on the allowlist/blocklist
> > > > mechanism. The current
> > > commit allows specifying either an allowlist or a blocklist, but not both.
> > > However, it would possible to implement specifying both - first
> > > we'll allow what's in allowlist and then we'll remove from that set what's
> in blocklist.
> > > Thoughts?
> > > >
> > >
> > > If we have both, I think limiting to only one is by far the sanest option.
+1

> > > I'm not fully convinced by the need to have both, since the
> > > blocklist allows wildcarding and exception cases. For example
> > > "net/[!i]*" will blocklist all net drivers except those starting
> > > with an "i". Admittedly, for usability purposes having an allowlist might
> work better.
> > >
> >
> > If we only want to build a handful of drivers then the list could be very long
> (which was the original reason behind having an allowlist), such as here:
> > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packag
> > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> >
> > An allowlist could also help with maintenance - users won't need to add
> new drivers to their blocklists (if that's what users need, like in the case of
> VPP).
> 
> +1 for allowlist.
May be I am missing something here. By creating an allowlist, does it mean drivers are disabled (from compilation) by default? For a server platform, where almost all the drivers can be compiled, does the allowlist contain all the drivers?

If we assume by default everything should compile on Arm platform, but allow for few exceptions (where things are really painful to fix, for ex: compiler needs to be fixed), having a blocklist should be shorter/better?

By having an allowlist, we will end up with a large part of the code that might not compile on Arm platforms.

> 
> >
> > > One final thought, if we add a driver allowlist for cross files,
> > > should we also add one as a top-level meson option also for consistency?
> > >
> >
> > This definitely makese sense. I was thinking about this and wasn't sure
> whether I should put it into this commit or a separate one. The commit
> evolved a bit and now that it's just an implementation of an allow/blocklist it
> makes sense to include a meson option in it I think - I'll put it into the next
> version.
> >
> > > /Bruce
> >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 12:57                                         ` Jerin Jacob
  2021-03-09 15:08                                           ` Honnappa Nagarahalli
@ 2021-03-09 15:10                                           ` Honnappa Nagarahalli
  1 sibling, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-03-09 15:10 UTC (permalink / raw)
  To: Jerin Jacob, Juraj Linkeš
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd

<snip>

> > >
> > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past. Do
> > > > you have
> > > any further input?
> > > >
> > > > I think we just need to agree on the allowlist/blocklist
> > > > mechanism. The current
> > > commit allows specifying either an allowlist or a blocklist, but not both.
> > > However, it would possible to implement specifying both - first
> > > we'll allow what's in allowlist and then we'll remove from that set what's
> in blocklist.
> > > Thoughts?
> > > >
> > >
> > > If we have both, I think limiting to only one is by far the sanest option.
+1

> > > I'm not fully convinced by the need to have both, since the
> > > blocklist allows wildcarding and exception cases. For example
> > > "net/[!i]*" will blocklist all net drivers except those starting
> > > with an "i". Admittedly, for usability purposes having an allowlist might
> work better.
> > >
> >
> > If we only want to build a handful of drivers then the list could be very long
> (which was the original reason behind having an allowlist), such as here:
> > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packag
> > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> >
> > An allowlist could also help with maintenance - users won't need to add
> new drivers to their blocklists (if that's what users need, like in the case of
> VPP).
> 
> +1 for allowlist.
May be I am missing something here. By creating an allowlist, does it mean drivers are disabled (from compilation) by default? For a server platform, where almost all the drivers can be compiled, does the allowlist contain all the drivers?

If we assume by default everything should compile on Arm platform, but allow for few exceptions (where things are really painful to fix, for ex: compiler needs to be fixed), having a blocklist should be shorter/better?

By having an allowlist, we will end up with a large part of the code that might not compile on Arm platforms.

> 
> >
> > > One final thought, if we add a driver allowlist for cross files,
> > > should we also add one as a top-level meson option also for consistency?
> > >
> >
> > This definitely makese sense. I was thinking about this and wasn't sure
> whether I should put it into this commit or a separate one. The commit
> evolved a bit and now that it's just an implementation of an allow/blocklist it
> makes sense to include a meson option in it I think - I'll put it into the next
> version.
> >
> > > /Bruce
> >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 15:08                                           ` Honnappa Nagarahalli
@ 2021-03-09 15:49                                             ` Juraj Linkeš
  2021-03-09 16:04                                               ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-09 15:49 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Jerin Jacob
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, March 9, 2021 4:09 PM
> To: Jerin Jacob <jerinjacobk@gmail.com>; Juraj Linkeš
> <juraj.linkes@pantheon.tech>
> Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aboyer@pensando.io; lironh@marvell.com;
> dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> 
> <snip>
> 
> > > >
> > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past. Do
> > > > > you have
> > > > any further input?
> > > > >
> > > > > I think we just need to agree on the allowlist/blocklist
> > > > > mechanism. The current
> > > > commit allows specifying either an allowlist or a blocklist, but not both.
> > > > However, it would possible to implement specifying both - first
> > > > we'll allow what's in allowlist and then we'll remove from that
> > > > set what's
> > in blocklist.
> > > > Thoughts?
> > > > >
> > > >
> > > > If we have both, I think limiting to only one is by far the sanest option.
> +1
> 
> > > > I'm not fully convinced by the need to have both, since the
> > > > blocklist allows wildcarding and exception cases. For example
> > > > "net/[!i]*" will blocklist all net drivers except those starting
> > > > with an "i". Admittedly, for usability purposes having an
> > > > allowlist might
> > work better.
> > > >
> > >
> > > If we only want to build a handful of drivers then the list could be
> > > very long
> > (which was the original reason behind having an allowlist), such as here:
> > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/pack
> > > ag es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > >
> > > An allowlist could also help with maintenance - users won't need to
> > > add
> > new drivers to their blocklists (if that's what users need, like in
> > the case of VPP).
> >
> > +1 for allowlist.
> May be I am missing something here. By creating an allowlist, does it mean
> drivers are disabled (from compilation) by default? For a server platform, where
> almost all the drivers can be compiled, does the allowlist contain all the drivers?
> 

If no allowlist is specified, then everythin will be built - nothing will be filtered.

> If we assume by default everything should compile on Arm platform, but allow
> for few exceptions (where things are really painful to fix, for ex: compiler needs
> to be fixed), having a blocklist should be shorter/better?
> 

The blocklist is, I think, agreed upon by everyone. The question is whether we want to support the allowlist alongside it and there seem to be enough reasons to do that.

> By having an allowlist, we will end up with a large part of the code that might
> not compile on Arm platforms.
> 
> >
> > >
> > > > One final thought, if we add a driver allowlist for cross files,
> > > > should we also add one as a top-level meson option also for consistency?
> > > >
> > >
> > > This definitely makese sense. I was thinking about this and wasn't
> > > sure
> > whether I should put it into this commit or a separate one. The commit
> > evolved a bit and now that it's just an implementation of an
> > allow/blocklist it makes sense to include a meson option in it I think
> > - I'll put it into the next version.
> > >
> > > > /Bruce
> > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 15:49                                             ` Juraj Linkeš
@ 2021-03-09 16:04                                               ` Honnappa Nagarahalli
  2021-03-09 18:09                                                 ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-03-09 16:04 UTC (permalink / raw)
  To: Juraj Linkeš, Jerin Jacob
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd

<snip>

> > > > >
> > > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past.
> > > > > > Do you have
> > > > > any further input?
> > > > > >
> > > > > > I think we just need to agree on the allowlist/blocklist
> > > > > > mechanism. The current
> > > > > commit allows specifying either an allowlist or a blocklist, but not
> both.
> > > > > However, it would possible to implement specifying both - first
> > > > > we'll allow what's in allowlist and then we'll remove from that
> > > > > set what's
> > > in blocklist.
> > > > > Thoughts?
> > > > > >
> > > > >
> > > > > If we have both, I think limiting to only one is by far the sanest option.
> > +1
> >
> > > > > I'm not fully convinced by the need to have both, since the
> > > > > blocklist allows wildcarding and exception cases. For example
> > > > > "net/[!i]*" will blocklist all net drivers except those starting
> > > > > with an "i". Admittedly, for usability purposes having an
> > > > > allowlist might
> > > work better.
> > > > >
> > > >
> > > > If we only want to build a handful of drivers then the list could
> > > > be very long
> > > (which was the original reason behind having an allowlist), such as here:
> > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/pa
> > > > ck ag
> > > > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > >
> > > > An allowlist could also help with maintenance - users won't need
> > > > to add
> > > new drivers to their blocklists (if that's what users need, like in
> > > the case of VPP).
> > >
> > > +1 for allowlist.
> > May be I am missing something here. By creating an allowlist, does it
> > mean drivers are disabled (from compilation) by default? For a server
> > platform, where almost all the drivers can be compiled, does the allowlist
> contain all the drivers?
> >
> 
> If no allowlist is specified, then everythin will be built - nothing will be
> filtered.
That's confusing.
If a platform like bluefield has an allow list, a new PMD that gets added will not be compiled for that platform unless someone explicitly adds it to the allow list. Is my understanding correct?
Whereas if the bluefield platform had a block list, then the new PMD would be compiled for bluefield platform.

> 
> > If we assume by default everything should compile on Arm platform, but
> > allow for few exceptions (where things are really painful to fix, for
> > ex: compiler needs to be fixed), having a blocklist should be shorter/better?
> >
> 
> The blocklist is, I think, agreed upon by everyone. The question is whether we
> want to support the allowlist alongside it and there seem to be enough
> reasons to do that.
Sorry, may be this is answered already, but, what additional benefit does allowlist provide over the blocklist?

> 
> > By having an allowlist, we will end up with a large part of the code
> > that might not compile on Arm platforms.
> >
> > >
> > > >
> > > > > One final thought, if we add a driver allowlist for cross files,
> > > > > should we also add one as a top-level meson option also for
> consistency?
> > > > >
> > > >
> > > > This definitely makese sense. I was thinking about this and wasn't
> > > > sure
> > > whether I should put it into this commit or a separate one. The
> > > commit evolved a bit and now that it's just an implementation of an
> > > allow/blocklist it makes sense to include a meson option in it I
> > > think
> > > - I'll put it into the next version.
> > > >
> > > > > /Bruce
> > > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 16:04                                               ` Honnappa Nagarahalli
@ 2021-03-09 18:09                                                 ` Juraj Linkeš
  2021-03-09 19:54                                                   ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-09 18:09 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Jerin Jacob
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, March 9, 2021 5:05 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Jerin Jacob
> <jerinjacobk@gmail.com>
> Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aboyer@pensando.io; lironh@marvell.com;
> dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> 
> <snip>
> 
> > > > > >
> > > > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past.
> > > > > > > Do you have
> > > > > > any further input?
> > > > > > >
> > > > > > > I think we just need to agree on the allowlist/blocklist
> > > > > > > mechanism. The current
> > > > > > commit allows specifying either an allowlist or a blocklist,
> > > > > > but not
> > both.
> > > > > > However, it would possible to implement specifying both -
> > > > > > first we'll allow what's in allowlist and then we'll remove
> > > > > > from that set what's
> > > > in blocklist.
> > > > > > Thoughts?
> > > > > > >
> > > > > >
> > > > > > If we have both, I think limiting to only one is by far the sanest option.
> > > +1
> > >
> > > > > > I'm not fully convinced by the need to have both, since the
> > > > > > blocklist allows wildcarding and exception cases. For example
> > > > > > "net/[!i]*" will blocklist all net drivers except those
> > > > > > starting with an "i". Admittedly, for usability purposes
> > > > > > having an allowlist might
> > > > work better.
> > > > > >
> > > > >
> > > > > If we only want to build a handful of drivers then the list
> > > > > could be very long
> > > > (which was the original reason behind having an allowlist), such as here:
> > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/
> > > > > pa
> > > > > ck ag
> > > > > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > >
> > > > > An allowlist could also help with maintenance - users won't need
> > > > > to add
> > > > new drivers to their blocklists (if that's what users need, like
> > > > in the case of VPP).
> > > >
> > > > +1 for allowlist.
> > > May be I am missing something here. By creating an allowlist, does
> > > it mean drivers are disabled (from compilation) by default? For a
> > > server platform, where almost all the drivers can be compiled, does
> > > the allowlist
> > contain all the drivers?
> > >
> >
> > If no allowlist is specified, then everythin will be built - nothing
> > will be filtered.
> That's confusing.
> If a platform like bluefield has an allow list, a new PMD that gets added will not
> be compiled for that platform unless someone explicitly adds it to the allow list.
> Is my understanding correct?

Yes.

> Whereas if the bluefield platform had a block list, then the new PMD would be
> compiled for bluefield platform.
> 

Again, yes.

Supporting both would give us the option to choose between the two behaviors.

> >
> > > If we assume by default everything should compile on Arm platform,
> > > but allow for few exceptions (where things are really painful to
> > > fix, for
> > > ex: compiler needs to be fixed), having a blocklist should be shorter/better?
> > >
> >
> > The blocklist is, I think, agreed upon by everyone. The question is
> > whether we want to support the allowlist alongside it and there seem
> > to be enough reasons to do that.
> Sorry, may be this is answered already, but, what additional benefit does
> allowlist provide over the blocklist?
> 

VPP could use it:
https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packages/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD

They're disabling almost everything so an allowlist would fit there. And they won't need to update the list when a new driver is added (which they won't need).

I think it was Jerin who suggested the allowlist. I don't know of an Arm usecase for it, but maybe he has an example.

> >
> > > By having an allowlist, we will end up with a large part of the code
> > > that might not compile on Arm platforms.
> > >
> > > >
> > > > >
> > > > > > One final thought, if we add a driver allowlist for cross
> > > > > > files, should we also add one as a top-level meson option also
> > > > > > for
> > consistency?
> > > > > >
> > > > >
> > > > > This definitely makese sense. I was thinking about this and
> > > > > wasn't sure
> > > > whether I should put it into this commit or a separate one. The
> > > > commit evolved a bit and now that it's just an implementation of
> > > > an allow/blocklist it makes sense to include a meson option in it
> > > > I think
> > > > - I'll put it into the next version.
> > > > >
> > > > > > /Bruce
> > > > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 18:09                                                 ` Juraj Linkeš
@ 2021-03-09 19:54                                                   ` Honnappa Nagarahalli
  2021-03-10  7:42                                                     ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-03-09 19:54 UTC (permalink / raw)
  To: Juraj Linkeš, Jerin Jacob
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd

<snip>
> >
> > > > > > >
> > > > > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past.
> > > > > > > > Do you have
> > > > > > > any further input?
> > > > > > > >
> > > > > > > > I think we just need to agree on the allowlist/blocklist
> > > > > > > > mechanism. The current
> > > > > > > commit allows specifying either an allowlist or a blocklist,
> > > > > > > but not
> > > both.
> > > > > > > However, it would possible to implement specifying both -
> > > > > > > first we'll allow what's in allowlist and then we'll remove
> > > > > > > from that set what's
> > > > > in blocklist.
> > > > > > > Thoughts?
> > > > > > > >
> > > > > > >
> > > > > > > If we have both, I think limiting to only one is by far the sanest
> option.
> > > > +1
> > > >
> > > > > > > I'm not fully convinced by the need to have both, since the
> > > > > > > blocklist allows wildcarding and exception cases. For
> > > > > > > example "net/[!i]*" will blocklist all net drivers except
> > > > > > > those starting with an "i". Admittedly, for usability
> > > > > > > purposes having an allowlist might
> > > > > work better.
> > > > > > >
> > > > > >
> > > > > > If we only want to build a handful of drivers then the list
> > > > > > could be very long
> > > > > (which was the original reason behind having an allowlist), such as
> here:
> > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/externa
> > > > > > l/
> > > > > > pa
> > > > > > ck ag
> > > > > >
> es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > >
> > > > > > An allowlist could also help with maintenance - users won't
> > > > > > need to add
> > > > > new drivers to their blocklists (if that's what users need, like
> > > > > in the case of VPP).
> > > > >
> > > > > +1 for allowlist.
> > > > May be I am missing something here. By creating an allowlist, does
> > > > it mean drivers are disabled (from compilation) by default? For a
> > > > server platform, where almost all the drivers can be compiled,
> > > > does the allowlist
> > > contain all the drivers?
> > > >
> > >
> > > If no allowlist is specified, then everythin will be built - nothing
> > > will be filtered.
> > That's confusing.
> > If a platform like bluefield has an allow list, a new PMD that gets
> > added will not be compiled for that platform unless someone explicitly adds
> it to the allow list.
> > Is my understanding correct?
> 
> Yes.
With this it becomes very easy to skip compiling on a platform.

> 
> > Whereas if the bluefield platform had a block list, then the new PMD
> > would be compiled for bluefield platform.
> >
> 
> Again, yes.
> 
> Supporting both would give us the option to choose between the two
> behaviors.
> 
> > >
> > > > If we assume by default everything should compile on Arm platform,
> > > > but allow for few exceptions (where things are really painful to
> > > > fix, for
> > > > ex: compiler needs to be fixed), having a blocklist should be
> shorter/better?
> > > >
> > >
> > > The blocklist is, I think, agreed upon by everyone. The question is
> > > whether we want to support the allowlist alongside it and there seem
> > > to be enough reasons to do that.
> > Sorry, may be this is answered already, but, what additional benefit
> > does allowlist provide over the blocklist?
> >
> 
> VPP could use it:
> https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packages/dpdk
> .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> 
> They're disabling almost everything so an allowlist would fit there. And they
> won't need to update the list when a new driver is added (which they won't
> need).
This is different from how we started this discussion. The current discussion was for DPDK internal use. But the one you are referencing above is for users of DPDK. I am fine for providing the allow list for the users of DPDK. But for DPDK internal, I think block list is enough.

> 
> I think it was Jerin who suggested the allowlist. I don't know of an Arm
> usecase for it, but maybe he has an example.
> 
> > >
> > > > By having an allowlist, we will end up with a large part of the
> > > > code that might not compile on Arm platforms.
> > > >
> > > > >
> > > > > >
> > > > > > > One final thought, if we add a driver allowlist for cross
> > > > > > > files, should we also add one as a top-level meson option
> > > > > > > also for
> > > consistency?
> > > > > > >
> > > > > >
> > > > > > This definitely makese sense. I was thinking about this and
> > > > > > wasn't sure
> > > > > whether I should put it into this commit or a separate one. The
> > > > > commit evolved a bit and now that it's just an implementation of
> > > > > an allow/blocklist it makes sense to include a meson option in
> > > > > it I think
> > > > > - I'll put it into the next version.
> > > > > >
> > > > > > > /Bruce
> > > > > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-09 19:54                                                   ` Honnappa Nagarahalli
@ 2021-03-10  7:42                                                     ` Juraj Linkeš
  2021-03-10  9:12                                                       ` Jerin Jacob
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-10  7:42 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Jerin Jacob
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, March 9, 2021 8:55 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Jerin Jacob
> <jerinjacobk@gmail.com>
> Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aboyer@pensando.io; lironh@marvell.com;
> dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> 
> <snip>
> > >
> > > > > > > >
> > > > > > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > > > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past.
> > > > > > > > > Do you have
> > > > > > > > any further input?
> > > > > > > > >
> > > > > > > > > I think we just need to agree on the allowlist/blocklist
> > > > > > > > > mechanism. The current
> > > > > > > > commit allows specifying either an allowlist or a
> > > > > > > > blocklist, but not
> > > > both.
> > > > > > > > However, it would possible to implement specifying both -
> > > > > > > > first we'll allow what's in allowlist and then we'll
> > > > > > > > remove from that set what's
> > > > > > in blocklist.
> > > > > > > > Thoughts?
> > > > > > > > >
> > > > > > > >
> > > > > > > > If we have both, I think limiting to only one is by far
> > > > > > > > the sanest
> > option.
> > > > > +1
> > > > >
> > > > > > > > I'm not fully convinced by the need to have both, since
> > > > > > > > the blocklist allows wildcarding and exception cases. For
> > > > > > > > example "net/[!i]*" will blocklist all net drivers except
> > > > > > > > those starting with an "i". Admittedly, for usability
> > > > > > > > purposes having an allowlist might
> > > > > > work better.
> > > > > > > >
> > > > > > >
> > > > > > > If we only want to build a handful of drivers then the list
> > > > > > > could be very long
> > > > > > (which was the original reason behind having an allowlist),
> > > > > > such as
> > here:
> > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/exter
> > > > > > > na
> > > > > > > l/
> > > > > > > pa
> > > > > > > ck ag
> > > > > > >
> > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > >
> > > > > > > An allowlist could also help with maintenance - users won't
> > > > > > > need to add
> > > > > > new drivers to their blocklists (if that's what users need,
> > > > > > like in the case of VPP).
> > > > > >
> > > > > > +1 for allowlist.
> > > > > May be I am missing something here. By creating an allowlist,
> > > > > does it mean drivers are disabled (from compilation) by default?
> > > > > For a server platform, where almost all the drivers can be
> > > > > compiled, does the allowlist
> > > > contain all the drivers?
> > > > >
> > > >
> > > > If no allowlist is specified, then everythin will be built -
> > > > nothing will be filtered.
> > > That's confusing.
> > > If a platform like bluefield has an allow list, a new PMD that gets
> > > added will not be compiled for that platform unless someone
> > > explicitly adds
> > it to the allow list.
> > > Is my understanding correct?
> >
> > Yes.
> With this it becomes very easy to skip compiling on a platform.
> 

It wouldn't be mandatory. Maybe I should've said we would be able to choose between three behaviors - the current (where everything is built), with allowlist or with blocklist.

But maybe the worry is that someone will use the allowlist without fully understanding the consequences?

> >
> > > Whereas if the bluefield platform had a block list, then the new PMD
> > > would be compiled for bluefield platform.
> > >
> >
> > Again, yes.
> >
> > Supporting both would give us the option to choose between the two
> > behaviors.
> >
> > > >
> > > > > If we assume by default everything should compile on Arm
> > > > > platform, but allow for few exceptions (where things are really
> > > > > painful to fix, for
> > > > > ex: compiler needs to be fixed), having a blocklist should be
> > shorter/better?
> > > > >
> > > >
> > > > The blocklist is, I think, agreed upon by everyone. The question
> > > > is whether we want to support the allowlist alongside it and there
> > > > seem to be enough reasons to do that.
> > > Sorry, may be this is answered already, but, what additional benefit
> > > does allowlist provide over the blocklist?
> > >
> >
> > VPP could use it:
> > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packag
> > es/dpdk .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> >
> > They're disabling almost everything so an allowlist would fit there.
> > And they won't need to update the list when a new driver is added
> > (which they won't need).
> This is different from how we started this discussion. The current discussion was
> for DPDK internal use. But the one you are referencing above is for users of
> DPDK. I am fine for providing the allow list for the users of DPDK. But for DPDK
> internal, I think block list is enough.
> 

That's an interesting suggestion. Jerin, what do you think? Why did you want to have an allowlist? Would this work?

> >
> > I think it was Jerin who suggested the allowlist. I don't know of an
> > Arm usecase for it, but maybe he has an example.
> >
> > > >
> > > > > By having an allowlist, we will end up with a large part of the
> > > > > code that might not compile on Arm platforms.
> > > > >
> > > > > >
> > > > > > >
> > > > > > > > One final thought, if we add a driver allowlist for cross
> > > > > > > > files, should we also add one as a top-level meson option
> > > > > > > > also for
> > > > consistency?
> > > > > > > >
> > > > > > >
> > > > > > > This definitely makese sense. I was thinking about this and
> > > > > > > wasn't sure
> > > > > > whether I should put it into this commit or a separate one.
> > > > > > The commit evolved a bit and now that it's just an
> > > > > > implementation of an allow/blocklist it makes sense to include
> > > > > > a meson option in it I think
> > > > > > - I'll put it into the next version.
> > > > > > >
> > > > > > > > /Bruce
> > > > > > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-10  7:42                                                     ` Juraj Linkeš
@ 2021-03-10  9:12                                                       ` Jerin Jacob
  2021-03-10 19:36                                                         ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Jerin Jacob @ 2021-03-10  9:12 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Honnappa Nagarahalli, Bruce Richardson, Ruifeng Wang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd

On Wed, Mar 10, 2021 at 1:12 PM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
>
>
> > -----Original Message-----
> > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Sent: Tuesday, March 9, 2021 8:55 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>; Jerin Jacob
> > <jerinjacobk@gmail.com>
> > Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> > <Ruifeng.Wang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > ferruh.yigit@intel.com; aboyer@pensando.io; lironh@marvell.com;
> > dev@dpdk.org; nd <nd@arm.com>; nd <nd@arm.com>
> > Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> >
> > <snip>
> > > >
> > > > > > > > >
> > > > > > > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš wrote:
> > > > > > > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the past.
> > > > > > > > > > Do you have
> > > > > > > > > any further input?
> > > > > > > > > >
> > > > > > > > > > I think we just need to agree on the allowlist/blocklist
> > > > > > > > > > mechanism. The current
> > > > > > > > > commit allows specifying either an allowlist or a
> > > > > > > > > blocklist, but not
> > > > > both.
> > > > > > > > > However, it would possible to implement specifying both -
> > > > > > > > > first we'll allow what's in allowlist and then we'll
> > > > > > > > > remove from that set what's
> > > > > > > in blocklist.
> > > > > > > > > Thoughts?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > If we have both, I think limiting to only one is by far
> > > > > > > > > the sanest
> > > option.
> > > > > > +1
> > > > > >
> > > > > > > > > I'm not fully convinced by the need to have both, since
> > > > > > > > > the blocklist allows wildcarding and exception cases. For
> > > > > > > > > example "net/[!i]*" will blocklist all net drivers except
> > > > > > > > > those starting with an "i". Admittedly, for usability
> > > > > > > > > purposes having an allowlist might
> > > > > > > work better.
> > > > > > > > >
> > > > > > > >
> > > > > > > > If we only want to build a handful of drivers then the list
> > > > > > > > could be very long
> > > > > > > (which was the original reason behind having an allowlist),
> > > > > > > such as
> > > here:
> > > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/exter
> > > > > > > > na
> > > > > > > > l/
> > > > > > > > pa
> > > > > > > > ck ag
> > > > > > > >
> > > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > > >
> > > > > > > > An allowlist could also help with maintenance - users won't
> > > > > > > > need to add
> > > > > > > new drivers to their blocklists (if that's what users need,
> > > > > > > like in the case of VPP).
> > > > > > >
> > > > > > > +1 for allowlist.
> > > > > > May be I am missing something here. By creating an allowlist,
> > > > > > does it mean drivers are disabled (from compilation) by default?
> > > > > > For a server platform, where almost all the drivers can be
> > > > > > compiled, does the allowlist
> > > > > contain all the drivers?
> > > > > >
> > > > >
> > > > > If no allowlist is specified, then everythin will be built -
> > > > > nothing will be filtered.
> > > > That's confusing.
> > > > If a platform like bluefield has an allow list, a new PMD that gets
> > > > added will not be compiled for that platform unless someone
> > > > explicitly adds
> > > it to the allow list.
> > > > Is my understanding correct?
> > >
> > > Yes.
> > With this it becomes very easy to skip compiling on a platform.
> >
>
> It wouldn't be mandatory. Maybe I should've said we would be able to choose between three behaviors - the current (where everything is built), with allowlist or with blocklist.
>
> But maybe the worry is that someone will use the allowlist without fully understanding the consequences?
>
> > >
> > > > Whereas if the bluefield platform had a block list, then the new PMD
> > > > would be compiled for bluefield platform.
> > > >
> > >
> > > Again, yes.
> > >
> > > Supporting both would give us the option to choose between the two
> > > behaviors.
> > >
> > > > >
> > > > > > If we assume by default everything should compile on Arm
> > > > > > platform, but allow for few exceptions (where things are really
> > > > > > painful to fix, for
> > > > > > ex: compiler needs to be fixed), having a blocklist should be
> > > shorter/better?
> > > > > >
> > > > >
> > > > > The blocklist is, I think, agreed upon by everyone. The question
> > > > > is whether we want to support the allowlist alongside it and there
> > > > > seem to be enough reasons to do that.
> > > > Sorry, may be this is answered already, but, what additional benefit
> > > > does allowlist provide over the blocklist?
> > > >
> > >
> > > VPP could use it:
> > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/packag
> > > es/dpdk .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > >
> > > They're disabling almost everything so an allowlist would fit there.
> > > And they won't need to update the list when a new driver is added
> > > (which they won't need).
> > This is different from how we started this discussion. The current discussion was
> > for DPDK internal use. But the one you are referencing above is for users of
> > DPDK. I am fine for providing the allow list for the users of DPDK. But for DPDK
> > internal, I think block list is enough.
> >
>
> That's an interesting suggestion. Jerin, what do you think? Why did you want to have an allowlist? Would this work?

# The very reason why VPP chooses to have allow list so that they can
control what needs to include.
# Another use case is like, in SoCs have fixed internal devices, we
can have optimized build for that can have only allow list
of the drivers that care about
# For server market, block list makes sense
# For embedded SoC, allow list makes sense.
# Ideal situation is if we support both.
# I dont quite understand the above comments for internal use vs
external use. If it is exposed
as a meson option then I think, it does not matter. Right?

>
> > >
> > > I think it was Jerin who suggested the allowlist. I don't know of an
> > > Arm usecase for it, but maybe he has an example.
> > >
> > > > >
> > > > > > By having an allowlist, we will end up with a large part of the
> > > > > > code that might not compile on Arm platforms.
> > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > > One final thought, if we add a driver allowlist for cross
> > > > > > > > > files, should we also add one as a top-level meson option
> > > > > > > > > also for
> > > > > consistency?
> > > > > > > > >
> > > > > > > >
> > > > > > > > This definitely makese sense. I was thinking about this and
> > > > > > > > wasn't sure
> > > > > > > whether I should put it into this commit or a separate one.
> > > > > > > The commit evolved a bit and now that it's just an
> > > > > > > implementation of an allow/blocklist it makes sense to include
> > > > > > > a meson option in it I think
> > > > > > > - I'll put it into the next version.
> > > > > > > >
> > > > > > > > > /Bruce
> > > > > > > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-10  9:12                                                       ` Jerin Jacob
@ 2021-03-10 19:36                                                         ` Honnappa Nagarahalli
  2021-03-11 17:14                                                           ` Jerin Jacob
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-03-10 19:36 UTC (permalink / raw)
  To: Jerin Jacob, Juraj Linkeš
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd

<snip>

> > > > >
> > > > > > > > > >
> > > > > > > > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš
> wrote:
> > > > > > > > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the
> past.
> > > > > > > > > > > Do you have
> > > > > > > > > > any further input?
> > > > > > > > > > >
> > > > > > > > > > > I think we just need to agree on the
> > > > > > > > > > > allowlist/blocklist mechanism. The current
> > > > > > > > > > commit allows specifying either an allowlist or a
> > > > > > > > > > blocklist, but not
> > > > > > both.
> > > > > > > > > > However, it would possible to implement specifying
> > > > > > > > > > both - first we'll allow what's in allowlist and then
> > > > > > > > > > we'll remove from that set what's
> > > > > > > > in blocklist.
> > > > > > > > > > Thoughts?
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > If we have both, I think limiting to only one is by
> > > > > > > > > > far the sanest
> > > > option.
> > > > > > > +1
> > > > > > >
> > > > > > > > > > I'm not fully convinced by the need to have both,
> > > > > > > > > > since the blocklist allows wildcarding and exception
> > > > > > > > > > cases. For example "net/[!i]*" will blocklist all net
> > > > > > > > > > drivers except those starting with an "i". Admittedly,
> > > > > > > > > > for usability purposes having an allowlist might
> > > > > > > > work better.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > If we only want to build a handful of drivers then the
> > > > > > > > > list could be very long
> > > > > > > > (which was the original reason behind having an
> > > > > > > > allowlist), such as
> > > > here:
> > > > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/e
> > > > > > > > > xter
> > > > > > > > > na
> > > > > > > > > l/
> > > > > > > > > pa
> > > > > > > > > ck ag
> > > > > > > > >
> > > > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > > > >
> > > > > > > > > An allowlist could also help with maintenance - users
> > > > > > > > > won't need to add
> > > > > > > > new drivers to their blocklists (if that's what users
> > > > > > > > need, like in the case of VPP).
> > > > > > > >
> > > > > > > > +1 for allowlist.
> > > > > > > May be I am missing something here. By creating an
> > > > > > > allowlist, does it mean drivers are disabled (from compilation) by
> default?
> > > > > > > For a server platform, where almost all the drivers can be
> > > > > > > compiled, does the allowlist
> > > > > > contain all the drivers?
> > > > > > >
> > > > > >
> > > > > > If no allowlist is specified, then everythin will be built -
> > > > > > nothing will be filtered.
> > > > > That's confusing.
> > > > > If a platform like bluefield has an allow list, a new PMD that
> > > > > gets added will not be compiled for that platform unless someone
> > > > > explicitly adds
> > > > it to the allow list.
> > > > > Is my understanding correct?
> > > >
> > > > Yes.
> > > With this it becomes very easy to skip compiling on a platform.
> > >
> >
> > It wouldn't be mandatory. Maybe I should've said we would be able to
> choose between three behaviors - the current (where everything is built),
> with allowlist or with blocklist.
> >
> > But maybe the worry is that someone will use the allowlist without fully
> understanding the consequences?
Yes.

> >
> > > >
> > > > > Whereas if the bluefield platform had a block list, then the new
> > > > > PMD would be compiled for bluefield platform.
> > > > >
> > > >
> > > > Again, yes.
> > > >
> > > > Supporting both would give us the option to choose between the two
> > > > behaviors.
> > > >
> > > > > >
> > > > > > > If we assume by default everything should compile on Arm
> > > > > > > platform, but allow for few exceptions (where things are
> > > > > > > really painful to fix, for
> > > > > > > ex: compiler needs to be fixed), having a blocklist should
> > > > > > > be
> > > > shorter/better?
> > > > > > >
> > > > > >
> > > > > > The blocklist is, I think, agreed upon by everyone. The
> > > > > > question is whether we want to support the allowlist alongside
> > > > > > it and there seem to be enough reasons to do that.
> > > > > Sorry, may be this is answered already, but, what additional
> > > > > benefit does allowlist provide over the blocklist?
> > > > >
> > > >
> > > > VPP could use it:
> > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/pa
> > > > ckag es/dpdk
> > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > >
> > > > They're disabling almost everything so an allowlist would fit there.
> > > > And they won't need to update the list when a new driver is added
> > > > (which they won't need).
> > > This is different from how we started this discussion. The current
> > > discussion was for DPDK internal use. But the one you are
> > > referencing above is for users of DPDK. I am fine for providing the
> > > allow list for the users of DPDK. But for DPDK internal, I think block list is
> enough.
> > >
> >
> > That's an interesting suggestion. Jerin, what do you think? Why did you
> want to have an allowlist? Would this work?
> 
> # The very reason why VPP chooses to have allow list so that they can
> control what needs to include.
> # Another use case is like, in SoCs have fixed internal devices, we can have
> optimized build for that can have only allow list of the drivers that care
> about # For server market, block list makes sense # For embedded SoC, allow
> list makes sense.
For the embedded SoC, IMO, the upstream project could allow the compilation for wider set of PMDs/libs. May be the end customer can use the allow list to compile/use what is required?
For ex: we use PCIe interfaces with external NICs for the embedded SoCs (where there is support).
I think the list of PMDs/libs enabled/disabled on a given platform is another discussion. This should not prevent us from supporting the allowlist.

> # Ideal situation is if we support both.
> # I dont quite understand the above comments for internal use vs external
> use. If it is exposed as a meson option then I think, it does not matter. Right?
> 
> >
> > > >
> > > > I think it was Jerin who suggested the allowlist. I don't know of
> > > > an Arm usecase for it, but maybe he has an example.
> > > >
> > > > > >
> > > > > > > By having an allowlist, we will end up with a large part of
> > > > > > > the code that might not compile on Arm platforms.
> > > > > > >
> > > > > > > >
> > > > > > > > >
> > > > > > > > > > One final thought, if we add a driver allowlist for
> > > > > > > > > > cross files, should we also add one as a top-level
> > > > > > > > > > meson option also for
> > > > > > consistency?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > This definitely makese sense. I was thinking about this
> > > > > > > > > and wasn't sure
> > > > > > > > whether I should put it into this commit or a separate one.
> > > > > > > > The commit evolved a bit and now that it's just an
> > > > > > > > implementation of an allow/blocklist it makes sense to
> > > > > > > > include a meson option in it I think
> > > > > > > > - I'll put it into the next version.
> > > > > > > > >
> > > > > > > > > > /Bruce
> > > > > > > > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-10 19:36                                                         ` Honnappa Nagarahalli
@ 2021-03-11 17:14                                                           ` Jerin Jacob
  2021-03-19 13:21                                                             ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Jerin Jacob @ 2021-03-11 17:14 UTC (permalink / raw)
  To: Honnappa Nagarahalli
  Cc: Juraj Linkeš,
	Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd

On Thu, Mar 11, 2021 at 1:06 AM Honnappa Nagarahalli
<Honnappa.Nagarahalli@arm.com> wrote:
>
> <snip>
>
> > > > > >
> > > > > > > > > > >
> > > > > > > > > > > On Tue, Mar 09, 2021 at 08:58:39AM +0000, Juraj Linkeš
> > wrote:
> > > > > > > > > > > > Honnappa, Thomas, Bruce, Jerin, you've comments in the
> > past.
> > > > > > > > > > > > Do you have
> > > > > > > > > > > any further input?
> > > > > > > > > > > >
> > > > > > > > > > > > I think we just need to agree on the
> > > > > > > > > > > > allowlist/blocklist mechanism. The current
> > > > > > > > > > > commit allows specifying either an allowlist or a
> > > > > > > > > > > blocklist, but not
> > > > > > > both.
> > > > > > > > > > > However, it would possible to implement specifying
> > > > > > > > > > > both - first we'll allow what's in allowlist and then
> > > > > > > > > > > we'll remove from that set what's
> > > > > > > > > in blocklist.
> > > > > > > > > > > Thoughts?
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > If we have both, I think limiting to only one is by
> > > > > > > > > > > far the sanest
> > > > > option.
> > > > > > > > +1
> > > > > > > >
> > > > > > > > > > > I'm not fully convinced by the need to have both,
> > > > > > > > > > > since the blocklist allows wildcarding and exception
> > > > > > > > > > > cases. For example "net/[!i]*" will blocklist all net
> > > > > > > > > > > drivers except those starting with an "i". Admittedly,
> > > > > > > > > > > for usability purposes having an allowlist might
> > > > > > > > > work better.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > If we only want to build a handful of drivers then the
> > > > > > > > > > list could be very long
> > > > > > > > > (which was the original reason behind having an
> > > > > > > > > allowlist), such as
> > > > > here:
> > > > > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/e
> > > > > > > > > > xter
> > > > > > > > > > na
> > > > > > > > > > l/
> > > > > > > > > > pa
> > > > > > > > > > ck ag
> > > > > > > > > >
> > > > > es/dpdk.mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > > > > >
> > > > > > > > > > An allowlist could also help with maintenance - users
> > > > > > > > > > won't need to add
> > > > > > > > > new drivers to their blocklists (if that's what users
> > > > > > > > > need, like in the case of VPP).
> > > > > > > > >
> > > > > > > > > +1 for allowlist.
> > > > > > > > May be I am missing something here. By creating an
> > > > > > > > allowlist, does it mean drivers are disabled (from compilation) by
> > default?
> > > > > > > > For a server platform, where almost all the drivers can be
> > > > > > > > compiled, does the allowlist
> > > > > > > contain all the drivers?
> > > > > > > >
> > > > > > >
> > > > > > > If no allowlist is specified, then everythin will be built -
> > > > > > > nothing will be filtered.
> > > > > > That's confusing.
> > > > > > If a platform like bluefield has an allow list, a new PMD that
> > > > > > gets added will not be compiled for that platform unless someone
> > > > > > explicitly adds
> > > > > it to the allow list.
> > > > > > Is my understanding correct?
> > > > >
> > > > > Yes.
> > > > With this it becomes very easy to skip compiling on a platform.
> > > >
> > >
> > > It wouldn't be mandatory. Maybe I should've said we would be able to
> > choose between three behaviors - the current (where everything is built),
> > with allowlist or with blocklist.
> > >
> > > But maybe the worry is that someone will use the allowlist without fully
> > understanding the consequences?
> Yes.
>
> > >
> > > > >
> > > > > > Whereas if the bluefield platform had a block list, then the new
> > > > > > PMD would be compiled for bluefield platform.
> > > > > >
> > > > >
> > > > > Again, yes.
> > > > >
> > > > > Supporting both would give us the option to choose between the two
> > > > > behaviors.
> > > > >
> > > > > > >
> > > > > > > > If we assume by default everything should compile on Arm
> > > > > > > > platform, but allow for few exceptions (where things are
> > > > > > > > really painful to fix, for
> > > > > > > > ex: compiler needs to be fixed), having a blocklist should
> > > > > > > > be
> > > > > shorter/better?
> > > > > > > >
> > > > > > >
> > > > > > > The blocklist is, I think, agreed upon by everyone. The
> > > > > > > question is whether we want to support the allowlist alongside
> > > > > > > it and there seem to be enough reasons to do that.
> > > > > > Sorry, may be this is answered already, but, what additional
> > > > > > benefit does allowlist provide over the blocklist?
> > > > > >
> > > > >
> > > > > VPP could use it:
> > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/external/pa
> > > > > ckag es/dpdk
> > > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > >
> > > > > They're disabling almost everything so an allowlist would fit there.
> > > > > And they won't need to update the list when a new driver is added
> > > > > (which they won't need).
> > > > This is different from how we started this discussion. The current
> > > > discussion was for DPDK internal use. But the one you are
> > > > referencing above is for users of DPDK. I am fine for providing the
> > > > allow list for the users of DPDK. But for DPDK internal, I think block list is
> > enough.
> > > >
> > >
> > > That's an interesting suggestion. Jerin, what do you think? Why did you
> > want to have an allowlist? Would this work?
> >
> > # The very reason why VPP chooses to have allow list so that they can
> > control what needs to include.
> > # Another use case is like, in SoCs have fixed internal devices, we can have
> > optimized build for that can have only allow list of the drivers that care
> > about # For server market, block list makes sense # For embedded SoC, allow
> > list makes sense.
> For the embedded SoC, IMO, the upstream project could allow the compilation for wider set of PMDs/libs. May be the end customer can use the allow list to compile/use what is required?

Just to understand, how end customer can enable allow list, if DPDK
build system does not support it?
Also to understand, If we are supporting blocklist, why not have
allowlist (I mean, both of them) as both are required as it caters
different use case
as mention above. We can not emulate allowlist with blocklist as each
version of DPDK will have new libraries and PMD's which
end user has no clue. Right?
I think, that is the reason why VPP is doing the allow list.


> For ex: we use PCIe interfaces with external NICs for the embedded SoCs (where there is support).
> I think the list of PMDs/libs enabled/disabled on a given platform is another discussion. This should not prevent us from supporting the allowlist.
>
> > # Ideal situation is if we support both.
> > # I dont quite understand the above comments for internal use vs external
> > use. If it is exposed as a meson option then I think, it does not matter. Right?
> >
> > >
> > > > >
> > > > > I think it was Jerin who suggested the allowlist. I don't know of
> > > > > an Arm usecase for it, but maybe he has an example.
> > > > >
> > > > > > >
> > > > > > > > By having an allowlist, we will end up with a large part of
> > > > > > > > the code that might not compile on Arm platforms.
> > > > > > > >
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > One final thought, if we add a driver allowlist for
> > > > > > > > > > > cross files, should we also add one as a top-level
> > > > > > > > > > > meson option also for
> > > > > > > consistency?
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > This definitely makese sense. I was thinking about this
> > > > > > > > > > and wasn't sure
> > > > > > > > > whether I should put it into this commit or a separate one.
> > > > > > > > > The commit evolved a bit and now that it's just an
> > > > > > > > > implementation of an allow/blocklist it makes sense to
> > > > > > > > > include a meson option in it I think
> > > > > > > > > - I'll put it into the next version.
> > > > > > > > > >
> > > > > > > > > > > /Bruce
> > > > > > > > > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-11 17:14                                                           ` Jerin Jacob
@ 2021-03-19 13:21                                                             ` Juraj Linkeš
  2021-03-19 13:32                                                               ` Jerin Jacob
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-19 13:21 UTC (permalink / raw)
  To: Jerin Jacob, Honnappa Nagarahalli
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd

<removed parts which I think are not that relevant>

> > > > > > > > The blocklist is, I think, agreed upon by everyone. The
> > > > > > > > question is whether we want to support the allowlist
> > > > > > > > alongside it and there seem to be enough reasons to do that.
> > > > > > > Sorry, may be this is answered already, but, what additional
> > > > > > > benefit does allowlist provide over the blocklist?
> > > > > > >
> > > > > >
> > > > > > VPP could use it:
> > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/externa
> > > > > > l/pa
> > > > > > ckag es/dpdk
> > > > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > >
> > > > > > They're disabling almost everything so an allowlist would fit there.
> > > > > > And they won't need to update the list when a new driver is
> > > > > > added (which they won't need).
> > > > > This is different from how we started this discussion. The
> > > > > current discussion was for DPDK internal use. But the one you
> > > > > are referencing above is for users of DPDK. I am fine for
> > > > > providing the allow list for the users of DPDK. But for DPDK
> > > > > internal, I think block list is
> > > enough.
> > > > >
> > > >
> > > > That's an interesting suggestion. Jerin, what do you think? Why
> > > > did you
> > > want to have an allowlist? Would this work?
> > >
> > > # The very reason why VPP chooses to have allow list so that they
> > > can control what needs to include.
> > > # Another use case is like, in SoCs have fixed internal devices, we
> > > can have optimized build for that can have only allow list of the
> > > drivers that care about # For server market, block list makes sense
> > > # For embedded SoC, allow list makes sense.
> > For the embedded SoC, IMO, the upstream project could allow the compilation
> for wider set of PMDs/libs. May be the end customer can use the allow list to
> compile/use what is required?
> 
> Just to understand, how end customer can enable allow list, if DPDK build system
> does not support it?
> Also to understand, If we are supporting blocklist, why not have allowlist (I
> mean, both of them) as both are required as it caters different use case as
> mention above. We can not emulate allowlist with blocklist as each version of
> DPDK will have new libraries and PMD's which end user has no clue. Right?

> I think, that is the reason why VPP is doing the allow list.

I'm not sure what you mean by this, but to clarify, VPP likely would be using the allowlist in this fashion, but that is not an arm specific usecase. I think what Honnappa wanted to see was how the allowlist could be used in an arm usecase (such as using it in an SoC configuration).



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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-19 13:21                                                             ` Juraj Linkeš
@ 2021-03-19 13:32                                                               ` Jerin Jacob
  2021-03-30  0:39                                                                 ` Honnappa Nagarahalli
  0 siblings, 1 reply; 465+ messages in thread
From: Jerin Jacob @ 2021-03-19 13:32 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Honnappa Nagarahalli, Bruce Richardson, Ruifeng Wang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd

On Fri, Mar 19, 2021 at 6:51 PM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
> <removed parts which I think are not that relevant>
>
> > > > > > > > > The blocklist is, I think, agreed upon by everyone. The
> > > > > > > > > question is whether we want to support the allowlist
> > > > > > > > > alongside it and there seem to be enough reasons to do that.
> > > > > > > > Sorry, may be this is answered already, but, what additional
> > > > > > > > benefit does allowlist provide over the blocklist?
> > > > > > > >
> > > > > > >
> > > > > > > VPP could use it:
> > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/externa
> > > > > > > l/pa
> > > > > > > ckag es/dpdk
> > > > > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > >
> > > > > > > They're disabling almost everything so an allowlist would fit there.
> > > > > > > And they won't need to update the list when a new driver is
> > > > > > > added (which they won't need).
> > > > > > This is different from how we started this discussion. The
> > > > > > current discussion was for DPDK internal use. But the one you
> > > > > > are referencing above is for users of DPDK. I am fine for
> > > > > > providing the allow list for the users of DPDK. But for DPDK
> > > > > > internal, I think block list is
> > > > enough.
> > > > > >
> > > > >
> > > > > That's an interesting suggestion. Jerin, what do you think? Why
> > > > > did you
> > > > want to have an allowlist? Would this work?
> > > >
> > > > # The very reason why VPP chooses to have allow list so that they
> > > > can control what needs to include.
> > > > # Another use case is like, in SoCs have fixed internal devices, we
> > > > can have optimized build for that can have only allow list of the
> > > > drivers that care about # For server market, block list makes sense
> > > > # For embedded SoC, allow list makes sense.
> > > For the embedded SoC, IMO, the upstream project could allow the compilation
> > for wider set of PMDs/libs. May be the end customer can use the allow list to
> > compile/use what is required?
> >
> > Just to understand, how end customer can enable allow list, if DPDK build system
> > does not support it?
> > Also to understand, If we are supporting blocklist, why not have allowlist (I
> > mean, both of them) as both are required as it caters different use case as
> > mention above. We can not emulate allowlist with blocklist as each version of
> > DPDK will have new libraries and PMD's which end user has no clue. Right?
>
> > I think, that is the reason why VPP is doing the allow list.
>
> I'm not sure what you mean by this, but to clarify, VPP likely would be using the allowlist in this fashion, but that is not an arm specific usecase. I think what Honnappa wanted to see was how the allowlist could be used in an arm usecase (such as using it in an SoC configuration).

There is nothing arm-specific here. Right? allowlist will be common
and will be used by all architecture. Right?


>
>

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-19 13:32                                                               ` Jerin Jacob
@ 2021-03-30  0:39                                                                 ` Honnappa Nagarahalli
  2021-03-31  8:39                                                                   ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-03-30  0:39 UTC (permalink / raw)
  To: Jerin Jacob, Juraj Linkeš
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, Honnappa Nagarahalli, nd

<snip>

> > <removed parts which I think are not that relevant>
> >
> > > > > > > > > > The blocklist is, I think, agreed upon by everyone.
> > > > > > > > > > The question is whether we want to support the
> > > > > > > > > > allowlist alongside it and there seem to be enough reasons to do
> that.
> > > > > > > > > Sorry, may be this is answered already, but, what
> > > > > > > > > additional benefit does allowlist provide over the blocklist?
> > > > > > > > >
> > > > > > > >
> > > > > > > > VPP could use it:
> > > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/ext
> > > > > > > > erna
> > > > > > > > l/pa
> > > > > > > > ckag es/dpdk
> > > > > > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > > >
> > > > > > > > They're disabling almost everything so an allowlist would fit there.
> > > > > > > > And they won't need to update the list when a new driver
> > > > > > > > is added (which they won't need).
> > > > > > > This is different from how we started this discussion. The
> > > > > > > current discussion was for DPDK internal use. But the one
> > > > > > > you are referencing above is for users of DPDK. I am fine
> > > > > > > for providing the allow list for the users of DPDK. But for
> > > > > > > DPDK internal, I think block list is
> > > > > enough.
> > > > > > >
> > > > > >
> > > > > > That's an interesting suggestion. Jerin, what do you think?
> > > > > > Why did you
> > > > > want to have an allowlist? Would this work?
> > > > >
> > > > > # The very reason why VPP chooses to have allow list so that
> > > > > they can control what needs to include.
> > > > > # Another use case is like, in SoCs have fixed internal devices,
> > > > > we can have optimized build for that can have only allow list of
> > > > > the drivers that care about # For server market, block list
> > > > > makes sense # For embedded SoC, allow list makes sense.
> > > > For the embedded SoC, IMO, the upstream project could allow the
> > > > compilation
> > > for wider set of PMDs/libs. May be the end customer can use the
> > > allow list to compile/use what is required?
> > >
> > > Just to understand, how end customer can enable allow list, if DPDK
> > > build system does not support it?
> > > Also to understand, If we are supporting blocklist, why not have
> > > allowlist (I mean, both of them) as both are required as it caters
> > > different use case as mention above. We can not emulate allowlist
> > > with blocklist as each version of DPDK will have new libraries and PMD's
> which end user has no clue. Right?
> >
> > > I think, that is the reason why VPP is doing the allow list.
> >
> > I'm not sure what you mean by this, but to clarify, VPP likely would be using
> the allowlist in this fashion, but that is not an arm specific usecase. I think what
> Honnappa wanted to see was how the allowlist could be used in an arm usecase
> (such as using it in an SoC configuration).
> 
> There is nothing arm-specific here. Right? allowlist will be common and will be
> used by all architecture. Right?
Nothing Arm specific. I think for generic Arm servers platforms we can make sure that we allow for compilation of all the DPDK code. We can go ahead with implementing the allow list.

> 
> 
> >
> >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-30  0:39                                                                 ` Honnappa Nagarahalli
@ 2021-03-31  8:39                                                                   ` Juraj Linkeš
  2021-03-31  9:07                                                                     ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-31  8:39 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Jerin Jacob
  Cc: Bruce Richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	hemant.agrawal, Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd, nd



> -----Original Message-----
> From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Sent: Tuesday, March 30, 2021 2:39 AM
> To: Jerin Jacob <jerinjacobk@gmail.com>; Juraj Linkeš
> <juraj.linkes@pantheon.tech>
> Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aboyer@pensando.io; lironh@marvell.com;
> dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> 
> <snip>
> 
> > > <removed parts which I think are not that relevant>
> > >
> > > > > > > > > > > The blocklist is, I think, agreed upon by everyone.
> > > > > > > > > > > The question is whether we want to support the
> > > > > > > > > > > allowlist alongside it and there seem to be enough
> > > > > > > > > > > reasons to do
> > that.
> > > > > > > > > > Sorry, may be this is answered already, but, what
> > > > > > > > > > additional benefit does allowlist provide over the blocklist?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > VPP could use it:
> > > > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/e
> > > > > > > > > xt
> > > > > > > > > erna
> > > > > > > > > l/pa
> > > > > > > > > ckag es/dpdk
> > > > > > > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > > > >
> > > > > > > > > They're disabling almost everything so an allowlist would fit there.
> > > > > > > > > And they won't need to update the list when a new driver
> > > > > > > > > is added (which they won't need).
> > > > > > > > This is different from how we started this discussion. The
> > > > > > > > current discussion was for DPDK internal use. But the one
> > > > > > > > you are referencing above is for users of DPDK. I am fine
> > > > > > > > for providing the allow list for the users of DPDK. But
> > > > > > > > for DPDK internal, I think block list is
> > > > > > enough.
> > > > > > > >
> > > > > > >
> > > > > > > That's an interesting suggestion. Jerin, what do you think?
> > > > > > > Why did you
> > > > > > want to have an allowlist? Would this work?
> > > > > >
> > > > > > # The very reason why VPP chooses to have allow list so that
> > > > > > they can control what needs to include.
> > > > > > # Another use case is like, in SoCs have fixed internal
> > > > > > devices, we can have optimized build for that can have only
> > > > > > allow list of the drivers that care about # For server market,
> > > > > > block list makes sense # For embedded SoC, allow list makes sense.
> > > > > For the embedded SoC, IMO, the upstream project could allow the
> > > > > compilation
> > > > for wider set of PMDs/libs. May be the end customer can use the
> > > > allow list to compile/use what is required?
> > > >
> > > > Just to understand, how end customer can enable allow list, if
> > > > DPDK build system does not support it?
> > > > Also to understand, If we are supporting blocklist, why not have
> > > > allowlist (I mean, both of them) as both are required as it caters
> > > > different use case as mention above. We can not emulate allowlist
> > > > with blocklist as each version of DPDK will have new libraries and
> > > > PMD's
> > which end user has no clue. Right?
> > >
> > > > I think, that is the reason why VPP is doing the allow list.
> > >
> > > I'm not sure what you mean by this, but to clarify, VPP likely would
> > > be using
> > the allowlist in this fashion, but that is not an arm specific
> > usecase. I think what Honnappa wanted to see was how the allowlist
> > could be used in an arm usecase (such as using it in an SoC configuration).
> >
> > There is nothing arm-specific here. Right? allowlist will be common
> > and will be used by all architecture. Right?
> Nothing Arm specific. I think for generic Arm servers platforms we can make
> sure that we allow for compilation of all the DPDK code. We can go ahead with
> implementing the allow list.
> 

I tried to actually use an allowlist and there are some problems with building apps and tests. When I tried to enable a random driver, such as common/sfc_efx, I've ran into dependency issues with apps:
app/meson.build:53:3: ERROR:  Tried to get unknown variable "static_rte_bus_vdev".

This is because bus/vdev is not enabled (the allowlist only enabled net/sfc_efx). When I implemented dependency discovery in apps similar to which exists for drivers/libs, I was then unable to build tests (which is a special case app):
app/test/meson.build:427:1: ERROR:  Tried to get unknown variable "static_rte_bus_pci".

This is becasue bus/pci is not enabled. If I understand the code correctly, the test dependencies are not matched to each test, meaning we can't disable the tests for which we don't have dependencies - we can only disable all tests.

In general, this problem also affects the blocklist, i.e. meson build -Ddisable_drivers=bus/pci produces
drivers/net/hinic/base/meson.build:34:0: ERROR:  Unknown variable "static_rte_bus_pci".
For blocklists, this is seldom going to be a problem, since most users won't disable "core" drivers.

I'm not sure what is the best course of action. We can implement the allowlist and then we'll leave it up to implementers to implement allowlists that produce a working build. We could then optionally address the dependency issues brought by disabled drivers in a separate patch.

Maybe we can just have a list of "core" drivers that can never be disabled (either using blocklists or allowlists)?

Bruce, what do you think?

> >
> >
> > >
> > >

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-31  8:39                                                                   ` Juraj Linkeš
@ 2021-03-31  9:07                                                                     ` Bruce Richardson
  2021-03-31  9:14                                                                       ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-03-31  9:07 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Honnappa Nagarahalli, Jerin Jacob, Ruifeng Wang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd

On Wed, Mar 31, 2021 at 08:39:57AM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Sent: Tuesday, March 30, 2021 2:39 AM
> > To: Jerin Jacob <jerinjacobk@gmail.com>; Juraj Linkeš
> > <juraj.linkes@pantheon.tech>
> > Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> > <Ruifeng.Wang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; hemant.agrawal@nxp.com; Ajit Khaparde
> > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > ferruh.yigit@intel.com; aboyer@pensando.io; lironh@marvell.com;
> > dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> > 
> > <snip>
> > 
> > > > <removed parts which I think are not that relevant>
> > > >
> > > > > > > > > > > > The blocklist is, I think, agreed upon by everyone.
> > > > > > > > > > > > The question is whether we want to support the
> > > > > > > > > > > > allowlist alongside it and there seem to be enough
> > > > > > > > > > > > reasons to do
> > > that.
> > > > > > > > > > > Sorry, may be this is answered already, but, what
> > > > > > > > > > > additional benefit does allowlist provide over the blocklist?
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > VPP could use it:
> > > > > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=build/e
> > > > > > > > > > xt
> > > > > > > > > > erna
> > > > > > > > > > l/pa
> > > > > > > > > > ckag es/dpdk
> > > > > > > > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HEAD
> > > > > > > > > >
> > > > > > > > > > They're disabling almost everything so an allowlist would fit there.
> > > > > > > > > > And they won't need to update the list when a new driver
> > > > > > > > > > is added (which they won't need).
> > > > > > > > > This is different from how we started this discussion. The
> > > > > > > > > current discussion was for DPDK internal use. But the one
> > > > > > > > > you are referencing above is for users of DPDK. I am fine
> > > > > > > > > for providing the allow list for the users of DPDK. But
> > > > > > > > > for DPDK internal, I think block list is
> > > > > > > enough.
> > > > > > > > >
> > > > > > > >
> > > > > > > > That's an interesting suggestion. Jerin, what do you think?
> > > > > > > > Why did you
> > > > > > > want to have an allowlist? Would this work?
> > > > > > >
> > > > > > > # The very reason why VPP chooses to have allow list so that
> > > > > > > they can control what needs to include.
> > > > > > > # Another use case is like, in SoCs have fixed internal
> > > > > > > devices, we can have optimized build for that can have only
> > > > > > > allow list of the drivers that care about # For server market,
> > > > > > > block list makes sense # For embedded SoC, allow list makes sense.
> > > > > > For the embedded SoC, IMO, the upstream project could allow the
> > > > > > compilation
> > > > > for wider set of PMDs/libs. May be the end customer can use the
> > > > > allow list to compile/use what is required?
> > > > >
> > > > > Just to understand, how end customer can enable allow list, if
> > > > > DPDK build system does not support it?
> > > > > Also to understand, If we are supporting blocklist, why not have
> > > > > allowlist (I mean, both of them) as both are required as it caters
> > > > > different use case as mention above. We can not emulate allowlist
> > > > > with blocklist as each version of DPDK will have new libraries and
> > > > > PMD's
> > > which end user has no clue. Right?
> > > >
> > > > > I think, that is the reason why VPP is doing the allow list.
> > > >
> > > > I'm not sure what you mean by this, but to clarify, VPP likely would
> > > > be using
> > > the allowlist in this fashion, but that is not an arm specific
> > > usecase. I think what Honnappa wanted to see was how the allowlist
> > > could be used in an arm usecase (such as using it in an SoC configuration).
> > >
> > > There is nothing arm-specific here. Right? allowlist will be common
> > > and will be used by all architecture. Right?
> > Nothing Arm specific. I think for generic Arm servers platforms we can make
> > sure that we allow for compilation of all the DPDK code. We can go ahead with
> > implementing the allow list.
> > 
> 
> I tried to actually use an allowlist and there are some problems with building apps and tests. When I tried to enable a random driver, such as common/sfc_efx, I've ran into dependency issues with apps:
> app/meson.build:53:3: ERROR:  Tried to get unknown variable "static_rte_bus_vdev".
> 
> This is because bus/vdev is not enabled (the allowlist only enabled net/sfc_efx). When I implemented dependency discovery in apps similar to which exists for drivers/libs, I was then unable to build tests (which is a special case app):
> app/test/meson.build:427:1: ERROR:  Tried to get unknown variable "static_rte_bus_pci".
> 
> This is becasue bus/pci is not enabled. If I understand the code correctly, the test dependencies are not matched to each test, meaning we can't disable the tests for which we don't have dependencies - we can only disable all tests.
> 
> In general, this problem also affects the blocklist, i.e. meson build -Ddisable_drivers=bus/pci produces
> drivers/net/hinic/base/meson.build:34:0: ERROR:  Unknown variable "static_rte_bus_pci".
> For blocklists, this is seldom going to be a problem, since most users won't disable "core" drivers.
> 
> I'm not sure what is the best course of action. We can implement the allowlist and then we'll leave it up to implementers to implement allowlists that produce a working build. We could then optionally address the dependency issues brought by disabled drivers in a separate patch.
> 
> Maybe we can just have a list of "core" drivers that can never be disabled (either using blocklists or allowlists)?
> 
> Bruce, what do you think?
> 
Hi,

from my experience this mainly seems to affect the bus drivers,
specifically pci and vdev buses, which seem to be assumed to be always
enabled. I agree it's probably not a real problem right now, though it
would be nice for some testing purposes to have a build possible with
"disable_drivers=*/*". For a solution I am happy for us to have whichever
is easiest to implement - either refusing disabling of bus/pci and
bus/vdev, or fixing the tests and apps to allow them to be built with
reduced functionality.

Apart from those two drivers, I would hope that disabling everything else
works. If not, we should definitely fix it.

/Bruce

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

* Re: [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds
  2021-03-31  9:07                                                                     ` Bruce Richardson
@ 2021-03-31  9:14                                                                       ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-31  9:14 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Honnappa Nagarahalli, Jerin Jacob, Ruifeng Wang, vcchunga,
	Dharmik Thakkar, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, lironh, dev, nd



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, March 31, 2021 11:08 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Jerin Jacob
> <jerinjacobk@gmail.com>; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com; aboyer@pensando.io;
> lironh@marvell.com; dev@dpdk.org; nd <nd@arm.com>
> Subject: Re: [PATCH v16 1/3] build: disable/enable drivers in Arm builds
> 
> On Wed, Mar 31, 2021 at 08:39:57AM +0000, Juraj Linkeš wrote:
> >
> >
> > > -----Original Message-----
> > > From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > > Sent: Tuesday, March 30, 2021 2:39 AM
> > > To: Jerin Jacob <jerinjacobk@gmail.com>; Juraj Linkeš
> > > <juraj.linkes@pantheon.tech>
> > > Cc: Bruce Richardson <bruce.richardson@intel.com>; Ruifeng Wang
> > > <Ruifeng.Wang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > > <Dharmik.Thakkar@arm.com>; hemant.agrawal@nxp.com; Ajit Khaparde
> > > (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> > > ferruh.yigit@intel.com; aboyer@pensando.io; lironh@marvell.com;
> > > dev@dpdk.org; nd <nd@arm.com>; Honnappa Nagarahalli
> > > <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> > > Subject: RE: [PATCH v16 1/3] build: disable/enable drivers in Arm
> > > builds
> > >
> > > <snip>
> > >
> > > > > <removed parts which I think are not that relevant>
> > > > >
> > > > > > > > > > > > > The blocklist is, I think, agreed upon by everyone.
> > > > > > > > > > > > > The question is whether we want to support the
> > > > > > > > > > > > > allowlist alongside it and there seem to be
> > > > > > > > > > > > > enough reasons to do
> > > > that.
> > > > > > > > > > > > Sorry, may be this is answered already, but, what
> > > > > > > > > > > > additional benefit does allowlist provide over the blocklist?
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > VPP could use it:
> > > > > > > > > > > https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blob;f=bui
> > > > > > > > > > > ld/e
> > > > > > > > > > > xt
> > > > > > > > > > > erna
> > > > > > > > > > > l/pa
> > > > > > > > > > > ckag es/dpdk
> > > > > > > > > > > .mk;h=c35ac84c27b19411a0cfdf9a3524fdf36024762c;hb=HE
> > > > > > > > > > > AD
> > > > > > > > > > >
> > > > > > > > > > > They're disabling almost everything so an allowlist would fit
> there.
> > > > > > > > > > > And they won't need to update the list when a new
> > > > > > > > > > > driver is added (which they won't need).
> > > > > > > > > > This is different from how we started this discussion.
> > > > > > > > > > The current discussion was for DPDK internal use. But
> > > > > > > > > > the one you are referencing above is for users of
> > > > > > > > > > DPDK. I am fine for providing the allow list for the
> > > > > > > > > > users of DPDK. But for DPDK internal, I think block
> > > > > > > > > > list is
> > > > > > > > enough.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > That's an interesting suggestion. Jerin, what do you think?
> > > > > > > > > Why did you
> > > > > > > > want to have an allowlist? Would this work?
> > > > > > > >
> > > > > > > > # The very reason why VPP chooses to have allow list so
> > > > > > > > that they can control what needs to include.
> > > > > > > > # Another use case is like, in SoCs have fixed internal
> > > > > > > > devices, we can have optimized build for that can have
> > > > > > > > only allow list of the drivers that care about # For
> > > > > > > > server market, block list makes sense # For embedded SoC, allow
> list makes sense.
> > > > > > > For the embedded SoC, IMO, the upstream project could allow
> > > > > > > the compilation
> > > > > > for wider set of PMDs/libs. May be the end customer can use
> > > > > > the allow list to compile/use what is required?
> > > > > >
> > > > > > Just to understand, how end customer can enable allow list, if
> > > > > > DPDK build system does not support it?
> > > > > > Also to understand, If we are supporting blocklist, why not
> > > > > > have allowlist (I mean, both of them) as both are required as
> > > > > > it caters different use case as mention above. We can not
> > > > > > emulate allowlist with blocklist as each version of DPDK will
> > > > > > have new libraries and PMD's
> > > > which end user has no clue. Right?
> > > > >
> > > > > > I think, that is the reason why VPP is doing the allow list.
> > > > >
> > > > > I'm not sure what you mean by this, but to clarify, VPP likely
> > > > > would be using
> > > > the allowlist in this fashion, but that is not an arm specific
> > > > usecase. I think what Honnappa wanted to see was how the allowlist
> > > > could be used in an arm usecase (such as using it in an SoC configuration).
> > > >
> > > > There is nothing arm-specific here. Right? allowlist will be
> > > > common and will be used by all architecture. Right?
> > > Nothing Arm specific. I think for generic Arm servers platforms we
> > > can make sure that we allow for compilation of all the DPDK code. We
> > > can go ahead with implementing the allow list.
> > >
> >
> > I tried to actually use an allowlist and there are some problems with building
> apps and tests. When I tried to enable a random driver, such as
> common/sfc_efx, I've ran into dependency issues with apps:
> > app/meson.build:53:3: ERROR:  Tried to get unknown variable
> "static_rte_bus_vdev".
> >
> > This is because bus/vdev is not enabled (the allowlist only enabled
> net/sfc_efx). When I implemented dependency discovery in apps similar to
> which exists for drivers/libs, I was then unable to build tests (which is a special
> case app):
> > app/test/meson.build:427:1: ERROR:  Tried to get unknown variable
> "static_rte_bus_pci".
> >
> > This is becasue bus/pci is not enabled. If I understand the code correctly, the
> test dependencies are not matched to each test, meaning we can't disable the
> tests for which we don't have dependencies - we can only disable all tests.
> >
> > In general, this problem also affects the blocklist, i.e. meson build
> > -Ddisable_drivers=bus/pci produces
> > drivers/net/hinic/base/meson.build:34:0: ERROR:  Unknown variable
> "static_rte_bus_pci".
> > For blocklists, this is seldom going to be a problem, since most users won't
> disable "core" drivers.
> >
> > I'm not sure what is the best course of action. We can implement the allowlist
> and then we'll leave it up to implementers to implement allowlists that produce
> a working build. We could then optionally address the dependency issues
> brought by disabled drivers in a separate patch.
> >
> > Maybe we can just have a list of "core" drivers that can never be disabled
> (either using blocklists or allowlists)?
> >
> > Bruce, what do you think?
> >
> Hi,
> 
> from my experience this mainly seems to affect the bus drivers, specifically pci
> and vdev buses, which seem to be assumed to be always enabled. I agree it's
> probably not a real problem right now, though it would be nice for some testing
> purposes to have a build possible with "disable_drivers=*/*". For a solution I am
> happy for us to have whichever is easiest to implement - either refusing disabling
> of bus/pci and bus/vdev, or fixing the tests and apps to allow them to be built
> with reduced functionality.
> 
> Apart from those two drivers, I would hope that disabling everything else works.
> If not, we should definitely fix it.

I tried with just those two enabled and it works. I'll introduce a list of drivers that won't ever be disabled (ther other solution is more complicated and I think out of scope of this patch) and submit a new version.

> 
> /Bruce


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

* [dpdk-dev] [PATCH v17 0/3] Arm build options rework
  2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
  2021-02-19 10:38                                 ` Juraj Linkeš
@ 2021-03-31 10:26                                 ` Juraj Linkeš
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
                                                     ` (3 more replies)
  1 sibling, 4 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-31 10:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

We also want to be able to enable/disable which drivers are built
without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/enabled or
  disabled drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
  option or using a cross file

v16:
Only three commits remaining - updated the cover letter.
Renamed the 'soc' meson option to 'platform'.
Added the support for enabling a particular set of drivers.
Aligned enabling and disabling with the command line option so that
wildcards can be used.

v17:
Removed unnecessary comments in "build: disable/enable drivers in Arm
builds". Also always enabled two drivers which break the build if
disabled.

Juraj Linkeš (3):
  build: disable/enable drivers in Arm builds
  build: add 'platform' meson option and Arm SoC config
  config: fix Arm implementer and its SoCs

 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 180 +++++++++++++++---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
 drivers/meson.build                           |  49 ++++-
 meson.build                                   |   2 +
 meson_options.txt                             |   4 +
 18 files changed, 242 insertions(+), 140 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v17 1/3] build: disable/enable drivers in Arm builds
  2021-03-31 10:26                                 ` [dpdk-dev] [PATCH v17 0/3] Arm build options rework Juraj Linkeš
@ 2021-03-31 10:26                                   ` Juraj Linkeš
  2021-04-09  8:17                                     ` Ruifeng Wang
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
                                                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-31 10:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add support for enabling or disabling drivers for Arm cross build. Do
not implement any enable/disable lists yet.

Enabling drivers is useful when building for an SoC where we only want
to build a few drivers. That way the list won't be too long.

Similarly, disabling drivers is useful when we want to disable only a
few drivers.

Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
same arch) builds, where the build machine may have the required driver
dependencies, yet we don't want to build drivers for a specific SoC.

By default, build all drivers for which dependencies are found. If
enabled_drivers is a non-empty list, build only those drivers.  If
disabled_drivers is non-empty list, build all drivers except those in
disabled_drivers. Error out if both are specified (i.e. do not support
that case).

There are two drivers, bus/pci and bus/vdev, which break the build if
not enabled. Address this by always enabling these if the user disables
them or doesn't specify in their allowlist.

Also remove the old Makefile arm configuration options which don't do
anything in Meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build                        |  4 --
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
 drivers/meson.build                           | 49 +++++++++++++++++--
 meson.build                                   |  2 +
 meson_options.txt                             |  2 +
 5 files changed, 56 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 00bc4610a3..a241c45d13 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -16,9 +16,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -125,7 +122,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 faaf24b95b..1504dbfef0 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
       numa = false        # set to false to force building for a non-NUMA system
          # if not set or set to true, the build system will build for a NUMA
          # system only if libnuma is installed
+
+      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
+
+      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
diff --git a/drivers/meson.build b/drivers/meson.build
index fdf76120ac..2d5c51b326 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -18,8 +18,39 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
-		).stdout().split()
+always_enabled = ['bus/pci', 'bus/vdev']
+
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
+endif
+
+# add cmdline disabled drivers (comma separated string)
+# and meson disabled drivers (list)
+# together into a comma separated string
+disabled_drivers = ','.join([get_option('disable_drivers'), ','.join(disabled_drivers)]).strip(',')
+if disabled_drivers != ''
+	disabled_drivers = run_command(list_dir_globs,
+		disabled_drivers).stdout().split()
+else
+	disabled_drivers = []
+endif
+
+# add cmdline enabled drivers (comma separated string)
+# and meson enabled drivers (list)
+# together into a comma separated string
+enabled_drivers = ','.join([get_option('enable_drivers'), ','.join(enabled_drivers)]).strip(',')
+if enabled_drivers != ''
+	enabled_drivers = run_command(list_dir_globs,
+		enabled_drivers).stdout().split()
+else
+	enabled_drivers = []
+endif
+
+if disabled_drivers != [] and enabled_drivers != []
+	error('Simultaneous disabled drivers and enabled drivers ' +
+	      'configuration is not supported.')
+endif
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -48,7 +79,7 @@ foreach subpath:subdirs
 		dpdk_driver_classes += class
 	endif
 	# get already enabled drivers of the same class
-	enabled_drivers = get_variable(class + '_drivers', [])
+	enabled_class_drivers = get_variable(class + '_drivers', [])
 
 	foreach drv:drivers
 		drv_path = join_paths(class, drv)
@@ -76,11 +107,19 @@ foreach subpath:subdirs
 		if disabled_drivers.contains(drv_path)
 			build = false
 			reason = 'explicitly disabled via build config'
+		elif enabled_drivers.length() > 0 and not enabled_drivers.contains(drv_path)
+			build = false
+			reason = 'not in enabled drivers build config'
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
 		endif
 
+		if not build and always_enabled.contains(drv_path)
+			build = true
+			message('Driver @0@ cannot be disabled, enabling.'.format(drv_path))
+		endif
+
 		if build
 			# get dependency objs from strings
 			shared_deps = ext_deps
@@ -108,7 +147,7 @@ foreach subpath:subdirs
 						'_disable_reason', reason)
 			endif
 		else
-			enabled_drivers += name
+			enabled_class_drivers += name
 			lib_name = '_'.join(['rte', class, name])
 			dpdk_conf.set(lib_name.to_upper(), 1)
 
@@ -213,5 +252,5 @@ foreach subpath:subdirs
 		endif # build
 	endforeach
 
-	set_variable(class + '_drivers', enabled_drivers)
+	set_variable(class + '_drivers', enabled_class_drivers)
 endforeach
diff --git a/meson.build b/meson.build
index fcc4d4c900..ea7ccfdae3 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,8 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
+enabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
diff --git a/meson_options.txt b/meson_options.txt
index 6eff62e47d..db8b2951a4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,6 +8,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
 	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false,
 	description: 'build documentation')
+option('enable_drivers', type: 'string', value: '',
+	description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_kmods', type: 'boolean', value: false,
 	description: 'build kernel modules')
 option('examples', type: 'string', value: '',
-- 
2.20.1


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

* [dpdk-dev] [PATCH v17 2/3] build: add 'platform' meson option and Arm SoC config
  2021-03-31 10:26                                 ` [dpdk-dev] [PATCH v17 0/3] Arm build options rework Juraj Linkeš
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-03-31 10:26                                   ` Juraj Linkeš
  2021-04-09  8:19                                     ` Ruifeng Wang
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
  2021-04-09  6:35                                   ` [dpdk-dev] [PATCH v18 0/3] Arm build options rework Juraj Linkeš
  3 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-31 10:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration sets to Arm meson.build and add an arch
agnostic meson option, 'platform', to select from these SoC
configurations for meson native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 140 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  84 ++++-------
 meson_options.txt                             |   2 +
 16 files changed, 179 insertions(+), 118 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 9958db6692..301418949b 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'armada'
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804 b/config/arm/arm64_armv8_linux_clang_ubuntu1804
index 57095c1304..db488d75f4 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu1804
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
@@ -14,7 +14,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'generic'
-part_number = 'generic'
+platform = 'generic'
 c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-gnu']
 c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da1..5391d35389 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+platform = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd4..248a9f031a 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c7628..e9d5fd31fc 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb055106..9cdd931180 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+platform = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index edacb79497..8016fd236c 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef7..0df283e2f4 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+platform = 'n1sdp'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 817b8ee28e..036aee2b0a 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd49'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'n2'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 5937697098..9156ee5410 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+platform = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd4..319a4a151d 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b3..69c71cbc82 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+platform = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e48..372097ba01 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+platform = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index a241c45d13..6fcbbf2ebc 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -25,7 +25,7 @@ flags_common = [
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -192,6 +192,106 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_n2 = {
+	'description': 'Arm Neoverse N2',
+	'implementer': '0x41',
+	'part_number': '0xd49',
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'n2': soc_n2,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -203,11 +303,19 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
+	soc = get_option('platform')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
+			if soc != ''
+				error('Building for a particular platform is ' +
+				      'unsupported with default build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif soc != ''
+			soc_config = socs.get(soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -225,8 +333,30 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		soc = meson.get_cross_property('platform', '')
+		if soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
+		if soc_config.has_key('enabled_drivers')
+			enabled_drivers += soc_config['enabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -252,8 +382,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add/overwrite flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 1504dbfef0..fb01f3020c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -187,58 +187,32 @@ Use the following command to cross-compile DPDK for the target machine::
    meson aarch64-build-clang --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804
    ninja -C aarch64-build-clang
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
-
-      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
-
-      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Dplatform meson
+option::
+
+   meson soc_build -Dplatform=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   platform = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index db8b2951a4..bdda27310f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -30,6 +30,8 @@ option('max_lcores', type: 'integer', value: 128,
 	description: 'maximum number of cores/threads supported by EAL')
 option('max_numa_nodes', type: 'integer', value: 32,
 	description: 'maximum number of NUMA nodes supported by EAL')
+option('platform', type: 'string', value: '',
+	description: 'Use configuration for a particular platform (such as an Arm SoC).')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v17 3/3] config: fix Arm implementer and its SoCs
  2021-03-31 10:26                                 ` [dpdk-dev] [PATCH v17 0/3] Arm build options rework Juraj Linkeš
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-03-31 10:26                                   ` Juraj Linkeš
  2021-04-09  6:35                                   ` [dpdk-dev] [PATCH v18 0/3] Arm build options rework Juraj Linkeš
  3 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-03-31 10:26 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 config/arm/meson.build | 60 +++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 33 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6fcbbf2ebc..53577267a6 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -56,7 +56,8 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80]
+			['RTE_MAX_LCORE', 80],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	},
 	'0xd49': {
@@ -64,7 +65,8 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_MAX_LCORE', 64]
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	}
 }
@@ -74,8 +76,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -157,39 +159,13 @@ implementer_qualcomm = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
 	'0x50': implementer_ampere,
-	'0x51': implementer_qualcomm,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x51': implementer_qualcomm
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -202,8 +178,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -211,13 +191,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -261,6 +251,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* [dpdk-dev] [PATCH v18 0/3] Arm build options rework
  2021-03-31 10:26                                 ` [dpdk-dev] [PATCH v17 0/3] Arm build options rework Juraj Linkeš
                                                     ` (2 preceding siblings ...)
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-04-09  6:35                                   ` Juraj Linkeš
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
                                                       ` (3 more replies)
  3 siblings, 4 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  6:35 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

We also want to be able to enable/disable which drivers are built
without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/enabled or
  disabled drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
  option or using a cross file

v16:
Only three commits remaining - updated the cover letter.
Renamed the 'soc' meson option to 'platform'.
Added the support for enabling a particular set of drivers.
Aligned enabling and disabling with the command line option so that
wildcards can be used.

v17:
Removed unnecessary comments in "build: disable/enable drivers in Arm
builds". Also always enabled two drivers which break the build if
disabled.

v18:
Rebased.

Juraj Linkeš (3):
  build: disable/enable drivers in Arm builds
  build: add 'platform' meson option and Arm SoC config
  config: fix Arm implementer and its SoCs

 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 180 +++++++++++++++---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
 drivers/meson.build                           |  49 ++++-
 meson.build                                   |   2 +
 meson_options.txt                             |   4 +
 18 files changed, 242 insertions(+), 140 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v18 1/3] build: disable/enable drivers in Arm builds
  2021-04-09  6:35                                   ` [dpdk-dev] [PATCH v18 0/3] Arm build options rework Juraj Linkeš
@ 2021-04-09  6:35                                     ` Juraj Linkeš
  2021-04-09  8:21                                       ` Ruifeng Wang
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
                                                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  6:35 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add support for enabling or disabling drivers for Arm cross build. Do
not implement any enable/disable lists yet.

Enabling drivers is useful when building for an SoC where we only want
to build a few drivers. That way the list won't be too long.

Similarly, disabling drivers is useful when we want to disable only a
few drivers.

Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
same arch) builds, where the build machine may have the required driver
dependencies, yet we don't want to build drivers for a specific SoC.

By default, build all drivers for which dependencies are found. If
enabled_drivers is a non-empty list, build only those drivers.  If
disabled_drivers is non-empty list, build all drivers except those in
disabled_drivers. Error out if both are specified (i.e. do not support
that case).

There are two drivers, bus/pci and bus/vdev, which break the build if
not enabled. Address this by always enabling these if the user disables
them or doesn't specify in their allowlist.

Also remove the old Makefile arm configuration options which don't do
anything in Meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/meson.build                        |  4 --
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
 drivers/meson.build                           | 49 +++++++++++++++++--
 meson.build                                   |  2 +
 meson_options.txt                             |  2 +
 5 files changed, 56 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 00bc4610a3..a241c45d13 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -16,9 +16,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -125,7 +122,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 faaf24b95b..1504dbfef0 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
       numa = false        # set to false to force building for a non-NUMA system
          # if not set or set to true, the build system will build for a NUMA
          # system only if libnuma is installed
+
+      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
+
+      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
diff --git a/drivers/meson.build b/drivers/meson.build
index 9c8eded697..be5fd2df88 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -19,8 +19,39 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
-		).stdout().split()
+always_enabled = ['bus/pci', 'bus/vdev']
+
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
+endif
+
+# add cmdline disabled drivers (comma separated string)
+# and meson disabled drivers (list)
+# together into a comma separated string
+disabled_drivers = ','.join([get_option('disable_drivers'), ','.join(disabled_drivers)]).strip(',')
+if disabled_drivers != ''
+	disabled_drivers = run_command(list_dir_globs,
+		disabled_drivers).stdout().split()
+else
+	disabled_drivers = []
+endif
+
+# add cmdline enabled drivers (comma separated string)
+# and meson enabled drivers (list)
+# together into a comma separated string
+enabled_drivers = ','.join([get_option('enable_drivers'), ','.join(enabled_drivers)]).strip(',')
+if enabled_drivers != ''
+	enabled_drivers = run_command(list_dir_globs,
+		enabled_drivers).stdout().split()
+else
+	enabled_drivers = []
+endif
+
+if disabled_drivers != [] and enabled_drivers != []
+	error('Simultaneous disabled drivers and enabled drivers ' +
+	      'configuration is not supported.')
+endif
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -49,7 +80,7 @@ foreach subpath:subdirs
 		dpdk_driver_classes += class
 	endif
 	# get already enabled drivers of the same class
-	enabled_drivers = get_variable(class + '_drivers', [])
+	enabled_class_drivers = get_variable(class + '_drivers', [])
 
 	foreach drv:drivers
 		drv_path = join_paths(class, drv)
@@ -77,11 +108,19 @@ foreach subpath:subdirs
 		if disabled_drivers.contains(drv_path)
 			build = false
 			reason = 'explicitly disabled via build config'
+		elif enabled_drivers.length() > 0 and not enabled_drivers.contains(drv_path)
+			build = false
+			reason = 'not in enabled drivers build config'
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
 		endif
 
+		if not build and always_enabled.contains(drv_path)
+			build = true
+			message('Driver @0@ cannot be disabled, enabling.'.format(drv_path))
+		endif
+
 		if build
 			# get dependency objs from strings
 			shared_deps = ext_deps
@@ -109,7 +148,7 @@ foreach subpath:subdirs
 						'_disable_reason', reason)
 			endif
 		else
-			enabled_drivers += name
+			enabled_class_drivers += name
 			lib_name = '_'.join(['rte', class, name])
 			dpdk_conf.set(lib_name.to_upper(), 1)
 
@@ -214,5 +253,5 @@ foreach subpath:subdirs
 		endif # build
 	endforeach
 
-	set_variable(class + '_drivers', enabled_drivers)
+	set_variable(class + '_drivers', enabled_class_drivers)
 endforeach
diff --git a/meson.build b/meson.build
index 7778e18200..38a2bd5416 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,8 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
+enabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
diff --git a/meson_options.txt b/meson_options.txt
index 86bc6c88f6..d2d24a1424 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,6 +8,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
 	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false,
 	description: 'build documentation')
+option('enable_drivers', type: 'string', value: '',
+	description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false,
 	description: 'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config
  2021-04-09  6:35                                   ` [dpdk-dev] [PATCH v18 0/3] Arm build options rework Juraj Linkeš
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-09  6:35                                     ` Juraj Linkeš
  2021-04-09  8:06                                       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  2021-04-09  8:22                                       ` [dpdk-dev] " Ruifeng Wang
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
  3 siblings, 2 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  6:35 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration sets to Arm meson.build and add an arch
agnostic meson option, 'platform', to select from these SoC
configurations for meson native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 140 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  84 ++++-------
 meson_options.txt                             |   2 +
 16 files changed, 179 insertions(+), 118 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 9958db6692..301418949b 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'armada'
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804 b/config/arm/arm64_armv8_linux_clang_ubuntu1804
index 57095c1304..db488d75f4 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu1804
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
@@ -14,7 +14,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'generic'
-part_number = 'generic'
+platform = 'generic'
 c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-gnu']
 c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da1..5391d35389 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+platform = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd4..248a9f031a 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c7628..e9d5fd31fc 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb055106..9cdd931180 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+platform = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index edacb79497..8016fd236c 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef7..0df283e2f4 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+platform = 'n1sdp'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 817b8ee28e..036aee2b0a 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd49'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'n2'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 5937697098..9156ee5410 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+platform = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd4..319a4a151d 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b3..69c71cbc82 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+platform = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e48..372097ba01 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+platform = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index a241c45d13..6fcbbf2ebc 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -25,7 +25,7 @@ flags_common = [
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -192,6 +192,106 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_n2 = {
+	'description': 'Arm Neoverse N2',
+	'implementer': '0x41',
+	'part_number': '0xd49',
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'n2': soc_n2,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -203,11 +303,19 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
+	soc = get_option('platform')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
+			if soc != ''
+				error('Building for a particular platform is ' +
+				      'unsupported with default build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif soc != ''
+			soc_config = socs.get(soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -225,8 +333,30 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		soc = meson.get_cross_property('platform', '')
+		if soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
+		if soc_config.has_key('enabled_drivers')
+			enabled_drivers += soc_config['enabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -252,8 +382,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add/overwrite flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 1504dbfef0..fb01f3020c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -187,58 +187,32 @@ Use the following command to cross-compile DPDK for the target machine::
    meson aarch64-build-clang --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804
    ninja -C aarch64-build-clang
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
-
-      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
-
-      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Dplatform meson
+option::
+
+   meson soc_build -Dplatform=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   platform = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index d2d24a1424..d3d9e1ee51 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -32,6 +32,8 @@ option('max_lcores', type: 'integer', value: 128,
 	description: 'maximum number of cores/threads supported by EAL')
 option('max_numa_nodes', type: 'integer', value: 32,
 	description: 'maximum number of NUMA nodes supported by EAL')
+option('platform', type: 'string', value: '',
+	description: 'Use configuration for a particular platform (such as an Arm SoC).')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v18 3/3] config: fix Arm implementer and its SoCs
  2021-04-09  6:35                                   ` [dpdk-dev] [PATCH v18 0/3] Arm build options rework Juraj Linkeš
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-04-09  6:35                                     ` Juraj Linkeš
  2021-04-09  8:26                                       ` Ruifeng Wang
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
  3 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  6:35 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 config/arm/meson.build | 60 +++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 33 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6fcbbf2ebc..53577267a6 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -56,7 +56,8 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80]
+			['RTE_MAX_LCORE', 80],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	},
 	'0xd49': {
@@ -64,7 +65,8 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_MAX_LCORE', 64]
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	}
 }
@@ -74,8 +76,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -157,39 +159,13 @@ implementer_qualcomm = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
 	'0x50': implementer_ampere,
-	'0x51': implementer_qualcomm,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x51': implementer_qualcomm
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -202,8 +178,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -211,13 +191,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -261,6 +251,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [EXT] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-04-09  8:06                                       ` Pavan Nikhilesh Bhagavatula
  2021-04-09  8:22                                       ` [dpdk-dev] " Ruifeng Wang
  1 sibling, 0 replies; 465+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2021-04-09  8:06 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev

>Add Arm SoC configuration sets to Arm meson.build and add an arch
>agnostic meson option, 'platform', to select from these SoC
>configurations for meson native builds. This is preferable to
>specifying a cross file when doing aarch64 -> aarch64 builds, since the
>cross file specifies the toolchain as well.
>
>Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
>Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

For octeontx/thunderx

Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

>---
> config/arm/arm64_armada_linux_gcc             |   6 +-
> config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
> config/arm/arm64_armv8_linux_gcc              |   5 +-
> config/arm/arm64_bluefield_linux_gcc          |   6 +-
> config/arm/arm64_dpaa_linux_gcc               |   6 +-
> config/arm/arm64_emag_linux_gcc               |   5 +-
> config/arm/arm64_graviton2_linux_gcc          |   6 +-
> config/arm/arm64_n1sdp_linux_gcc              |   6 +-
> config/arm/arm64_n2_linux_gcc                 |   6 +-
> config/arm/arm64_octeontx2_linux_gcc          |   6 +-
> config/arm/arm64_stingray_linux_gcc           |   6 +-
> config/arm/arm64_thunderx2_linux_gcc          |   5 +-
> config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
> config/arm/meson.build                        | 140 +++++++++++++++++-
> .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  84 ++++-------
> meson_options.txt                             |   2 +
> 16 files changed, 179 insertions(+), 118 deletions(-)
>
>diff --git a/config/arm/arm64_armada_linux_gcc
>b/config/arm/arm64_armada_linux_gcc
>index 9958db6692..301418949b 100644
>--- a/config/arm/arm64_armada_linux_gcc
>+++ b/config/arm/arm64_armada_linux_gcc
>@@ -14,8 +14,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x56'
>-part_number = '0xd08'
>-max_lcores = 16
>-max_numa_nodes = 1
>-numa = false
>+platform = 'armada'
>diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804
>b/config/arm/arm64_armv8_linux_clang_ubuntu1804
>index 57095c1304..db488d75f4 100644
>--- a/config/arm/arm64_armv8_linux_clang_ubuntu1804
>+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
>@@ -14,7 +14,6 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = 'generic'
>-part_number = 'generic'
>+platform = 'generic'
> c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-
>gnu']
> c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-
>toolchain=/usr']
>diff --git a/config/arm/arm64_armv8_linux_gcc
>b/config/arm/arm64_armv8_linux_gcc
>index 5451a01da1..5391d35389 100644
>--- a/config/arm/arm64_armv8_linux_gcc
>+++ b/config/arm/arm64_armv8_linux_gcc
>@@ -14,7 +14,4 @@ endian = 'little'
>
> [properties]
> # Generate binaries that are portable across all Armv8 machines
>-implementer_id = 'generic'
>-part_number = 'generic'
>-max_lcores = 256
>-max_numa_nodes = 4
>+platform = 'generic'
>diff --git a/config/arm/arm64_bluefield_linux_gcc
>b/config/arm/arm64_bluefield_linux_gcc
>index 6bef87fbd4..248a9f031a 100644
>--- a/config/arm/arm64_bluefield_linux_gcc
>+++ b/config/arm/arm64_bluefield_linux_gcc
>@@ -13,8 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x41'
>-part_number = '0xd08'
>-max_lcores = 16
>-max_numa_nodes = 1
>-numa = false
>+platform = 'bluefield'
>diff --git a/config/arm/arm64_dpaa_linux_gcc
>b/config/arm/arm64_dpaa_linux_gcc
>index 37398c7628..e9d5fd31fc 100644
>--- a/config/arm/arm64_dpaa_linux_gcc
>+++ b/config/arm/arm64_dpaa_linux_gcc
>@@ -14,8 +14,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = 'dpaa'
>-part_number = '0xd08'
>-max_lcores = 16
>-max_numa_nodes = 1
>-numa = false
>+platform = 'dpaa'
>diff --git a/config/arm/arm64_emag_linux_gcc
>b/config/arm/arm64_emag_linux_gcc
>index 7cbb055106..9cdd931180 100644
>--- a/config/arm/arm64_emag_linux_gcc
>+++ b/config/arm/arm64_emag_linux_gcc
>@@ -13,7 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x50'
>-part_number = '0x0'
>-max_lcores = 32
>-max_numa_nodes = 1
>+platform = 'emag'
>diff --git a/config/arm/arm64_graviton2_linux_gcc
>b/config/arm/arm64_graviton2_linux_gcc
>index edacb79497..8016fd236c 100644
>--- a/config/arm/arm64_graviton2_linux_gcc
>+++ b/config/arm/arm64_graviton2_linux_gcc
>@@ -13,8 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x41'
>-part_number = '0xd0c'
>-max_lcores = 64
>-max_numa_nodes = 1
>-numa = false
>+platform = 'graviton2'
>diff --git a/config/arm/arm64_n1sdp_linux_gcc
>b/config/arm/arm64_n1sdp_linux_gcc
>index b00f2d1ef7..0df283e2f4 100644
>--- a/config/arm/arm64_n1sdp_linux_gcc
>+++ b/config/arm/arm64_n1sdp_linux_gcc
>@@ -13,8 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x41'
>-part_number = '0xd0c'
>-max_lcores = 4
>-max_numa_nodes = 1
>-numa = false
>+platform = 'n1sdp'
>diff --git a/config/arm/arm64_n2_linux_gcc
>b/config/arm/arm64_n2_linux_gcc
>index 817b8ee28e..036aee2b0a 100644
>--- a/config/arm/arm64_n2_linux_gcc
>+++ b/config/arm/arm64_n2_linux_gcc
>@@ -13,8 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x41'
>-part_number = '0xd49'
>-max_lcores = 64
>-max_numa_nodes = 1
>-numa = false
>+platform = 'n2'
>diff --git a/config/arm/arm64_octeontx2_linux_gcc
>b/config/arm/arm64_octeontx2_linux_gcc
>index 5937697098..9156ee5410 100644
>--- a/config/arm/arm64_octeontx2_linux_gcc
>+++ b/config/arm/arm64_octeontx2_linux_gcc
>@@ -13,8 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x43'
>-part_number = '0xb2'
>-max_lcores = 36
>-max_numa_nodes = 1
>-numa = false
>+platform = 'octeontx2'
>diff --git a/config/arm/arm64_stingray_linux_gcc
>b/config/arm/arm64_stingray_linux_gcc
>index 6bef87fbd4..319a4a151d 100644
>--- a/config/arm/arm64_stingray_linux_gcc
>+++ b/config/arm/arm64_stingray_linux_gcc
>@@ -13,8 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x41'
>-part_number = '0xd08'
>-max_lcores = 16
>-max_numa_nodes = 1
>-numa = false
>+platform = 'stingray'
>diff --git a/config/arm/arm64_thunderx2_linux_gcc
>b/config/arm/arm64_thunderx2_linux_gcc
>index c06dcdc2b3..69c71cbc82 100644
>--- a/config/arm/arm64_thunderx2_linux_gcc
>+++ b/config/arm/arm64_thunderx2_linux_gcc
>@@ -13,7 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x43'
>-part_number = '0xaf'
>-max_lcores = 256
>-max_numa_nodes = 2
>+platform = 'thunderx2'
>diff --git a/config/arm/arm64_thunderxt88_linux_gcc
>b/config/arm/arm64_thunderxt88_linux_gcc
>index 3ba1528e48..372097ba01 100644
>--- a/config/arm/arm64_thunderxt88_linux_gcc
>+++ b/config/arm/arm64_thunderxt88_linux_gcc
>@@ -13,7 +13,4 @@ cpu = 'armv8-a'
> endian = 'little'
>
> [properties]
>-implementer_id = '0x43'
>-part_number = '0xa1'
>-max_lcores = 96
>-max_numa_nodes = 1
>+platform = 'thunderxt88'
>diff --git a/config/arm/meson.build b/config/arm/meson.build
>index a241c45d13..6fcbbf2ebc 100644
>--- a/config/arm/meson.build
>+++ b/config/arm/meson.build
>@@ -25,7 +25,7 @@ flags_common = [
> ## Part numbers are specific to Arm implementers
> # implementer specific aarch64 flags have middle priority
> #     (will overwrite common flags)
>-# part number specific aarch64 flags have the highest priority
>+# part number specific aarch64 flags have higher priority
> #     (will overwrite both common and implementer specific flags)
> implementer_generic = {
> 	'description': 'Generic armv8',
>@@ -192,6 +192,106 @@ implementers = {
> 	'dpaa': implementer_dpaa
> }
>
>+# soc specific aarch64 flags have the highest priority
>+#     (will overwrite all other flags)
>+soc_generic = {
>+	'description': 'Generic un-optimized build for all aarch64
>machines',
>+	'implementer': 'generic',
>+	'part_number': 'generic'
>+}
>+
>+soc_armada = {
>+	'description': 'Marvell ARMADA',
>+	'implementer': '0x56',
>+	'part_number': '0xd08',
>+	'numa': false
>+}
>+
>+soc_bluefield = {
>+	'description': 'NVIDIA BlueField',
>+	'implementer': '0x41',
>+	'part_number': '0xd08',
>+	'numa': false
>+}
>+
>+soc_dpaa = {
>+	'description': 'NXP DPAA',
>+	'implementer': 'dpaa',
>+	'part_number': '0xd08',
>+	'numa': false
>+}
>+
>+soc_emag = {
>+	'description': 'Ampere eMAG',
>+	'implementer': '0x50',
>+	'part_number': '0x0'
>+}
>+
>+soc_graviton2 = {
>+	'description': 'AWS Graviton2',
>+	'implementer': '0x41',
>+	'part_number': '0xd0c',
>+	'numa': false
>+}
>+
>+soc_n1sdp = {
>+	'description': 'Arm Neoverse N1SDP',
>+	'implementer': '0x41',
>+	'part_number': '0xd0c',
>+	'flags': [
>+		['RTE_MAX_LCORE', 4]
>+	],
>+	'numa': false
>+}
>+
>+soc_n2 = {
>+	'description': 'Arm Neoverse N2',
>+	'implementer': '0x41',
>+	'part_number': '0xd49',
>+	'numa': false
>+}
>+
>+soc_octeontx2 = {
>+	'description': 'Marvell OCTEON TX2',
>+	'implementer': '0x43',
>+	'part_number': '0xb2',
>+	'numa': false
>+}
>+
>+soc_stingray = {
>+	'description': 'Broadcom Stingray',
>+	'implementer': '0x41',
>+	'part_number': '0xd08',
>+	'numa': false
>+}
>+
>+soc_thunderx2 = {
>+	'description': 'Marvell ThunderX2 T99',
>+	'implementer': '0x43',
>+	'part_number': '0xaf'
>+}
>+
>+soc_thunderxt88 = {
>+	'description': 'Marvell ThunderX T88',
>+	'implementer': '0x43',
>+	'part_number': '0xa1'
>+}
>+
>+socs = {
>+	'generic': soc_generic,
>+	'armada': soc_armada,
>+	'bluefield': soc_bluefield,
>+	'dpaa': soc_dpaa,
>+	'emag': soc_emag,
>+	'graviton2': soc_graviton2,
>+	'n1sdp': soc_n1sdp,
>+	'n2': soc_n2,
>+	'octeontx2': soc_octeontx2,
>+	'stingray': soc_stingray,
>+	'thunderx2': soc_thunderx2,
>+	'thunderxt88': soc_thunderxt88
>+}
>+
> dpdk_conf.set('RTE_ARCH_ARM', 1)
> dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
>
>@@ -203,11 +303,19 @@ if dpdk_conf.get('RTE_ARCH_32')
> 	machine_args += '-mfpu=neon'
> else
> 	# aarch64 build
>+	soc = get_option('platform')
>+	soc_config = {}
> 	if not meson.is_cross_build()
> 		if machine == 'default'
> 			# default build
>+			if soc != ''
>+				error('Building for a particular platform is
>' +
>+				      'unsupported with default build.')
>+			endif
> 			implementer_id = 'generic'
> 			part_number = 'generic'
>+		elif soc != ''
>+			soc_config = socs.get(soc, {'not_supported':
>true})
> 		else
> 			# native build
> 			# The script returns ['Implementer', 'Variant',
>'Architecture',
>@@ -225,8 +333,30 @@ else
> 		endif
> 	else
> 		# cross build
>-		implementer_id =
>meson.get_cross_property('implementer_id')
>-		part_number =
>meson.get_cross_property('part_number')
>+		soc = meson.get_cross_property('platform', '')
>+		if soc == ''
>+			error('Arm SoC must be specified in the cross
>file.')
>+		endif
>+		soc_config = socs.get(soc, {'not_supported': true})
>+	endif
>+
>+	soc_flags = []
>+	if soc_config.has_key('not_supported')
>+		error('SoC @0@ not supported.'.format(soc))
>+	elif soc_config != {}
>+		implementer_id = soc_config['implementer']
>+		implementer_config = implementers[implementer_id]
>+		part_number = soc_config['part_number']
>+		soc_flags = soc_config.get('flags', [])
>+		if not soc_config.get('numa', true)
>+			has_libnuma = 0
>+		endif
>+		if soc_config.has_key('disabled_drivers')
>+			disabled_drivers +=
>soc_config['disabled_drivers']
>+		endif
>+		if soc_config.has_key('enabled_drivers')
>+			enabled_drivers +=
>soc_config['enabled_drivers']
>+		endif
> 	endif
>
> 	if implementers.has_key(implementer_id)
>@@ -252,8 +382,8 @@ else
> 		      '(-Dmachine=generic) build.')
> 	endif
>
>-	# use default flags with implementer flags
>-	dpdk_flags = flags_common + implementer_config['flags'] +
>part_number_config.get('flags', [])
>+	# add/overwrite flags in the proper order
>+	dpdk_flags = flags_common + implementer_config['flags'] +
>part_number_config.get('flags', []) + soc_flags
>
> 	# apply supported machine args
> 	machine_args = [] # Clear previous machine args
>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 1504dbfef0..fb01f3020c 100644
>--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
>+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
>@@ -187,58 +187,32 @@ Use the following command to cross-compile
>DPDK for the target machine::
>    meson aarch64-build-clang --cross-file
>config/arm/arm64_armv8_linux_clang_ubuntu1804
>    ninja -C aarch64-build-clang
>
>-Supported cross-compilation targets
>------------------------------------
>-
>-If you wish to build for a target which is not among the current cross-
>files,
>-you may use various combinations of implementer/part number::
>-
>-   Supported implementers:
>-      'generic': Generic armv8
>-      '0x41':    Arm
>-      '0x43':    Cavium
>-      '0x50':    Ampere Computing
>-      '0x56':    Marvell ARMADA
>-      'dpaa':    NXP DPAA
>-
>-   Supported part_numbers for generic:
>-      'generic': valid for all armv8-a architectures (unoptimized portable
>build)
>-
>-   Supported part_numbers for 0x41, 0x56, dpaa:
>-      '0xd03':   cortex-a53
>-      '0xd04':   cortex-a35
>-      '0xd09':   cortex-a73
>-      '0xd0a':   cortex-a75
>-      '0xd0b':   cortex-a76
>-      '0xd0c':   neoverse-n1
>-
>-   Supported part_numbers for 0x43:
>-      '0xa1':    thunderxt88
>-      '0xa2':    thunderxt81
>-      '0xa3':    thunderxt83
>-      '0xaf':    thunderx2t99
>-      '0xb2':    octeontx2
>-
>-   Supported part_numbers for 0x50:
>-      '0x0':     emag
>-
>-Other cross file options
>-------------------------
>-
>-There are other options you may specify in a cross file to tailor the
>build::
>-
>-   Supported extra configuration
>-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
>-      max_lcores = n      # will set RTE_MAX_LCORE
>-
>-      numa = false        # set to false to force building for a non-NUMA
>system
>-         # if not set or set to true, the build system will build for a NUMA
>-         # system only if libnuma is installed
>-
>-      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
>-         # valid values are dir/subdirs in the drivers directory
>-         # wildcards are allowed
>-
>-      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
>-         # valid values are dir/subdirs in the drivers directory
>-         # wildcards are allowed
>+Building for an aarch64 SoC on an aarch64 build machine
>+-------------------------------------------------------
>+
>+If you wish to build on an aarch64 build machine for a different aarch64
>SoC,
>+you don't need a separate cross toolchain, just a different set of
>+configuration options. To build for an aarch64 SoC, use the -Dplatform
>meson
>+option::
>+
>+   meson soc_build -Dplatform=<target_soc>
>+
>+Substitute <target_soc> with one of the supported SoCs::
>+
>+   generic:     Generic un-optimized build for all aarch64 machines.
>+   armada:      Marvell ARMADA
>+   bluefield:   NVIDIA BlueField
>+   dpaa:        NXP DPAA
>+   emag:        Ampere eMAG
>+   graviton2:   AWS Graviton2
>+   n1sdp:       Arm Neoverse N1SDP
>+   octeontx2:   Marvell OCTEON TX2
>+   stingray:    Broadcom Stingray
>+   thunderx2:   Marvell ThunderX2 T99
>+   thunderxt88: Marvell ThunderX T88
>+
>+These SoCs are also used in cross files, e.g.::
>+
>+   [properties]
>+   # Generate binaries that are portable across all Armv8 machines
>+   platform = 'generic'
>diff --git a/meson_options.txt b/meson_options.txt
>index d2d24a1424..d3d9e1ee51 100644
>--- a/meson_options.txt
>+++ b/meson_options.txt
>@@ -32,6 +32,8 @@ option('max_lcores', type: 'integer', value: 128,
> 	description: 'maximum number of cores/threads supported by
>EAL')
> option('max_numa_nodes', type: 'integer', value: 32,
> 	description: 'maximum number of NUMA nodes supported by
>EAL')
>+option('platform', type: 'string', value: '',
>+	description: 'Use configuration for a particular platform (such as
>an Arm SoC).')
> option('enable_trace_fp', type: 'boolean', value: false,
> 	description: 'enable fast path trace points.')
> option('tests', type: 'boolean', value: true,
>--
>2.20.1


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

* Re: [dpdk-dev] [PATCH v17 1/3] build: disable/enable drivers in Arm builds
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-09  8:17                                     ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2021-04-09  8:17 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, March 31, 2021 6:26 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aboyer@pensando.io
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v17 1/3] build: disable/enable drivers in Arm builds
> 
> Add support for enabling or disabling drivers for Arm cross build. Do not
> implement any enable/disable lists yet.
> 
> Enabling drivers is useful when building for an SoC where we only want to
> build a few drivers. That way the list won't be too long.
> 
> Similarly, disabling drivers is useful when we want to disable only a few
> drivers.
> 
> Both of these are advantageous mainly in aarch64 -> aarch64 (or arch -> same
> arch) builds, where the build machine may have the required driver
> dependencies, yet we don't want to build drivers for a specific SoC.
> 
> By default, build all drivers for which dependencies are found. If
> enabled_drivers is a non-empty list, build only those drivers.  If
> disabled_drivers is non-empty list, build all drivers except those in
> disabled_drivers. Error out if both are specified (i.e. do not support that case).
> 
> There are two drivers, bus/pci and bus/vdev, which break the build if not
> enabled. Address this by always enabling these if the user disables them or
> doesn't specify in their allowlist.
> 
> Also remove the old Makefile arm configuration options which don't do
> anything in Meson.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  config/arm/meson.build                        |  4 --
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
>  drivers/meson.build                           | 49 +++++++++++++++++--
>  meson.build                                   |  2 +
>  meson_options.txt                             |  2 +
>  5 files changed, 56 insertions(+), 9 deletions(-)
> 

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v17 2/3] build: add 'platform' meson option and Arm SoC config
  2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-04-09  8:19                                     ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2021-04-09  8:19 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, March 31, 2021 6:26 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aboyer@pensando.io
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v17 2/3] build: add 'platform' meson option and Arm SoC
> config
> 
> Add Arm SoC configuration sets to Arm meson.build and add an arch agnostic
> meson option, 'platform', to select from these SoC configurations for meson
> native builds. This is preferable to specifying a cross file when doing aarch64 ->
> aarch64 builds, since the cross file specifies the toolchain as well.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  config/arm/arm64_armada_linux_gcc             |   6 +-
>  config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
>  config/arm/arm64_armv8_linux_gcc              |   5 +-
>  config/arm/arm64_bluefield_linux_gcc          |   6 +-
>  config/arm/arm64_dpaa_linux_gcc               |   6 +-
>  config/arm/arm64_emag_linux_gcc               |   5 +-
>  config/arm/arm64_graviton2_linux_gcc          |   6 +-
>  config/arm/arm64_n1sdp_linux_gcc              |   6 +-
>  config/arm/arm64_n2_linux_gcc                 |   6 +-
>  config/arm/arm64_octeontx2_linux_gcc          |   6 +-
>  config/arm/arm64_stingray_linux_gcc           |   6 +-
>  config/arm/arm64_thunderx2_linux_gcc          |   5 +-
>  config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
>  config/arm/meson.build                        | 140 +++++++++++++++++-
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  84 ++++-------
>  meson_options.txt                             |   2 +
>  16 files changed, 179 insertions(+), 118 deletions(-)
> 

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v18 1/3] build: disable/enable drivers in Arm builds
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-09  8:21                                       ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2021-04-09  8:21 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, April 9, 2021 2:36 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aboyer@pensando.io
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v18 1/3] build: disable/enable drivers in Arm builds
> 
> Add support for enabling or disabling drivers for Arm cross build. Do not
> implement any enable/disable lists yet.
> 
> Enabling drivers is useful when building for an SoC where we only want to
> build a few drivers. That way the list won't be too long.
> 
> Similarly, disabling drivers is useful when we want to disable only a few
> drivers.
> 
> Both of these are advantageous mainly in aarch64 -> aarch64 (or arch -> same
> arch) builds, where the build machine may have the required driver
> dependencies, yet we don't want to build drivers for a specific SoC.
> 
> By default, build all drivers for which dependencies are found. If
> enabled_drivers is a non-empty list, build only those drivers.  If
> disabled_drivers is non-empty list, build all drivers except those in
> disabled_drivers. Error out if both are specified (i.e. do not support that case).
> 
> There are two drivers, bus/pci and bus/vdev, which break the build if not
> enabled. Address this by always enabling these if the user disables them or
> doesn't specify in their allowlist.
> 
> Also remove the old Makefile arm configuration options which don't do
> anything in Meson.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  config/arm/meson.build                        |  4 --
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
>  drivers/meson.build                           | 49 +++++++++++++++++--
>  meson.build                                   |  2 +
>  meson_options.txt                             |  2 +
>  5 files changed, 56 insertions(+), 9 deletions(-)
> 

Sorry, added tag on an old version.

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
  2021-04-09  8:06                                       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
@ 2021-04-09  8:22                                       ` Ruifeng Wang
  1 sibling, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2021-04-09  8:22 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, Phil Yang, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, April 9, 2021 2:36 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aboyer@pensando.io
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC
> config
> 
> Add Arm SoC configuration sets to Arm meson.build and add an arch agnostic
> meson option, 'platform', to select from these SoC configurations for meson
> native builds. This is preferable to specifying a cross file when doing aarch64 ->
> aarch64 builds, since the cross file specifies the toolchain as well.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
>  config/arm/arm64_armada_linux_gcc             |   6 +-
>  config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
>  config/arm/arm64_armv8_linux_gcc              |   5 +-
>  config/arm/arm64_bluefield_linux_gcc          |   6 +-
>  config/arm/arm64_dpaa_linux_gcc               |   6 +-
>  config/arm/arm64_emag_linux_gcc               |   5 +-
>  config/arm/arm64_graviton2_linux_gcc          |   6 +-
>  config/arm/arm64_n1sdp_linux_gcc              |   6 +-
>  config/arm/arm64_n2_linux_gcc                 |   6 +-
>  config/arm/arm64_octeontx2_linux_gcc          |   6 +-
>  config/arm/arm64_stingray_linux_gcc           |   6 +-
>  config/arm/arm64_thunderx2_linux_gcc          |   5 +-
>  config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
>  config/arm/meson.build                        | 140 +++++++++++++++++-
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  84 ++++-------
>  meson_options.txt                             |   2 +
>  16 files changed, 179 insertions(+), 118 deletions(-)
> 

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v18 3/3] config: fix Arm implementer and its SoCs
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-04-09  8:26                                       ` Ruifeng Wang
  2021-04-09  8:31                                         ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Ruifeng Wang @ 2021-04-09  8:26 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, lironh, yskoh, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, April 9, 2021 2:36 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aboyer@pensando.io
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>;
> lironh@marvell.com; yskoh@mellanox.com
> Subject: [PATCH v18 3/3] config: fix Arm implementer and its SoCs
> 
> Fix the implementer and part number of DPAA and ARMADA SoCs.
> The current values of 16 cores and 1 NUMA node don't cover all SoCs from
> the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
> Increase these to 64 and 4 to widen the coverage.
> Add configuration to SoC options where smaller values are needed.
> 
> Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
> Cc: hemant.agrawal@nxp.com
> Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
> Cc: lironh@marvell.com
> Fixes: d97108a33231 ("config: change defaults of armv8")
> Cc: yskoh@mellanox.com
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Liron Himi <lironh@marvell.com>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  config/arm/meson.build | 60 +++++++++++++++++++-----------------------
>  1 file changed, 27 insertions(+), 33 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 6fcbbf2ebc..53577267a6 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -56,7 +56,8 @@ part_number_config_arm = {
>  			['RTE_MACHINE', '"neoverse-n1"'],
>  			['RTE_ARM_FEATURE_ATOMICS', true],
>  			['RTE_MAX_MEM_MB', 1048576],
> -			['RTE_MAX_LCORE', 80]
> +			['RTE_MAX_LCORE', 80],
> +			['RTE_MAX_NUMA_NODES', 1]

Ampere Altra that based on Neoverse-n1 has 2-socket server.
So MAX_LCORE should be updated to 160, and MAX_NUMA_NODES should be updated to 2.

>  		]
>  	},
>  	'0xd49': {
> @@ -64,7 +65,8 @@ part_number_config_arm = {
>  		'flags': [
>  			['RTE_MACHINE', '"neoverse-n2"'],
>  			['RTE_ARM_FEATURE_ATOMICS', true],
> -			['RTE_MAX_LCORE', 64]
> +			['RTE_MAX_LCORE', 64],
> +			['RTE_MAX_NUMA_NODES', 1]
>  		]
>  	}
>  }


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

* Re: [dpdk-dev] [PATCH v18 3/3] config: fix Arm implementer and its SoCs
  2021-04-09  8:26                                       ` Ruifeng Wang
@ 2021-04-09  8:31                                         ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  8:31 UTC (permalink / raw)
  To: Ruifeng Wang, bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, lironh, yskoh, nd



> -----Original Message-----
> From: Ruifeng Wang <Ruifeng.Wang@arm.com>
> Sent: Friday, April 9, 2021 10:27 AM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>; bruce.richardson@intel.com;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>;
> vcchunga@amazon.com; Dharmik Thakkar <Dharmik.Thakkar@arm.com>;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com; Ajit Khaparde
> (ajit.khaparde@broadcom.com) <ajit.khaparde@broadcom.com>;
> ferruh.yigit@intel.com; aboyer@pensando.io
> Cc: dev@dpdk.org; lironh@marvell.com; yskoh@mellanox.com; nd
> <nd@arm.com>
> Subject: RE: [PATCH v18 3/3] config: fix Arm implementer and its SoCs
> 
> > -----Original Message-----
> > From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Sent: Friday, April 9, 2021 2:36 PM
> > To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> > Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> > <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> > <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> > hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> > <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> > aboyer@pensando.io
> > Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>;
> > lironh@marvell.com; yskoh@mellanox.com
> > Subject: [PATCH v18 3/3] config: fix Arm implementer and its SoCs
> >
> > Fix the implementer and part number of DPAA and ARMADA SoCs.
> > The current values of 16 cores and 1 NUMA node don't cover all SoCs
> > from the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA
> nodes.
> > Increase these to 64 and 4 to widen the coverage.
> > Add configuration to SoC options where smaller values are needed.
> >
> > Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
> > Cc: hemant.agrawal@nxp.com
> > Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
> > Cc: lironh@marvell.com
> > Fixes: d97108a33231 ("config: change defaults of armv8")
> > Cc: yskoh@mellanox.com
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > Reviewed-by: Liron Himi <lironh@marvell.com>
> > Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> > Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > ---
> >  config/arm/meson.build | 60
> > +++++++++++++++++++-----------------------
> >  1 file changed, 27 insertions(+), 33 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 6fcbbf2ebc..53577267a6 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -56,7 +56,8 @@ part_number_config_arm = {
> >  			['RTE_MACHINE', '"neoverse-n1"'],
> >  			['RTE_ARM_FEATURE_ATOMICS', true],
> >  			['RTE_MAX_MEM_MB', 1048576],
> > -			['RTE_MAX_LCORE', 80]
> > +			['RTE_MAX_LCORE', 80],
> > +			['RTE_MAX_NUMA_NODES', 1]
> 
> Ampere Altra that based on Neoverse-n1 has 2-socket server.
> So MAX_LCORE should be updated to 160, and MAX_NUMA_NODES should be
> updated to 2.
> 

Ok, will update.

> >  		]
> >  	},
> >  	'0xd49': {
> > @@ -64,7 +65,8 @@ part_number_config_arm = {
> >  		'flags': [
> >  			['RTE_MACHINE', '"neoverse-n2"'],
> >  			['RTE_ARM_FEATURE_ATOMICS', true],
> > -			['RTE_MAX_LCORE', 64]
> > +			['RTE_MAX_LCORE', 64],
> > +			['RTE_MAX_NUMA_NODES', 1]
> >  		]
> >  	}
> >  }


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

* [dpdk-dev] [PATCH v19 0/3] Arm build options rework
  2021-04-09  6:35                                   ` [dpdk-dev] [PATCH v18 0/3] Arm build options rework Juraj Linkeš
                                                       ` (2 preceding siblings ...)
  2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-04-09  8:41                                     ` Juraj Linkeš
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
                                                         ` (6 more replies)
  3 siblings, 7 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  8:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

We also want to be able to enable/disable which drivers are built
without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/enabled or
  disabled drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
  option or using a cross file

v16:
Only three commits remaining - updated the cover letter.
Renamed the 'soc' meson option to 'platform'.
Added the support for enabling a particular set of drivers.
Aligned enabling and disabling with the command line option so that
wildcards can be used.

v17:
Removed unnecessary comments in "build: disable/enable drivers in Arm
builds". Also always enabled two drivers which break the build if
disabled.

v18:
Rebased.

v19:
Updated 3/3 with more up to date MAX_LCORE and MAX_NUMA_NODES for
neoverse-n1.

Juraj Linkeš (3):
  build: disable/enable drivers in Arm builds
  build: add 'platform' meson option and Arm SoC config
  config: fix Arm implementer and its SoCs

 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 180 +++++++++++++++---
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
 drivers/meson.build                           |  49 ++++-
 meson.build                                   |   2 +
 meson_options.txt                             |   4 +
 18 files changed, 242 insertions(+), 140 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
@ 2021-04-09  8:41                                       ` Juraj Linkeš
  2021-04-09 10:02                                         ` Bruce Richardson
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
                                                         ` (5 subsequent siblings)
  6 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  8:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add support for enabling or disabling drivers for Arm cross build. Do
not implement any enable/disable lists yet.

Enabling drivers is useful when building for an SoC where we only want
to build a few drivers. That way the list won't be too long.

Similarly, disabling drivers is useful when we want to disable only a
few drivers.

Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
same arch) builds, where the build machine may have the required driver
dependencies, yet we don't want to build drivers for a specific SoC.

By default, build all drivers for which dependencies are found. If
enabled_drivers is a non-empty list, build only those drivers.  If
disabled_drivers is non-empty list, build all drivers except those in
disabled_drivers. Error out if both are specified (i.e. do not support
that case).

There are two drivers, bus/pci and bus/vdev, which break the build if
not enabled. Address this by always enabling these if the user disables
them or doesn't specify in their allowlist.

Also remove the old Makefile arm configuration options which don't do
anything in Meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build                        |  4 --
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
 drivers/meson.build                           | 49 +++++++++++++++++--
 meson.build                                   |  2 +
 meson_options.txt                             |  2 +
 5 files changed, 56 insertions(+), 9 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 00bc4610a3..a241c45d13 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -16,9 +16,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -125,7 +122,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
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 faaf24b95b..1504dbfef0 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
       numa = false        # set to false to force building for a non-NUMA system
          # if not set or set to true, the build system will build for a NUMA
          # system only if libnuma is installed
+
+      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
+
+      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
diff --git a/drivers/meson.build b/drivers/meson.build
index 9c8eded697..be5fd2df88 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -19,8 +19,39 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
-		).stdout().split()
+always_enabled = ['bus/pci', 'bus/vdev']
+
+if meson.is_cross_build()
+	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
+	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
+endif
+
+# add cmdline disabled drivers (comma separated string)
+# and meson disabled drivers (list)
+# together into a comma separated string
+disabled_drivers = ','.join([get_option('disable_drivers'), ','.join(disabled_drivers)]).strip(',')
+if disabled_drivers != ''
+	disabled_drivers = run_command(list_dir_globs,
+		disabled_drivers).stdout().split()
+else
+	disabled_drivers = []
+endif
+
+# add cmdline enabled drivers (comma separated string)
+# and meson enabled drivers (list)
+# together into a comma separated string
+enabled_drivers = ','.join([get_option('enable_drivers'), ','.join(enabled_drivers)]).strip(',')
+if enabled_drivers != ''
+	enabled_drivers = run_command(list_dir_globs,
+		enabled_drivers).stdout().split()
+else
+	enabled_drivers = []
+endif
+
+if disabled_drivers != [] and enabled_drivers != []
+	error('Simultaneous disabled drivers and enabled drivers ' +
+	      'configuration is not supported.')
+endif
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -49,7 +80,7 @@ foreach subpath:subdirs
 		dpdk_driver_classes += class
 	endif
 	# get already enabled drivers of the same class
-	enabled_drivers = get_variable(class + '_drivers', [])
+	enabled_class_drivers = get_variable(class + '_drivers', [])
 
 	foreach drv:drivers
 		drv_path = join_paths(class, drv)
@@ -77,11 +108,19 @@ foreach subpath:subdirs
 		if disabled_drivers.contains(drv_path)
 			build = false
 			reason = 'explicitly disabled via build config'
+		elif enabled_drivers.length() > 0 and not enabled_drivers.contains(drv_path)
+			build = false
+			reason = 'not in enabled drivers build config'
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
 		endif
 
+		if not build and always_enabled.contains(drv_path)
+			build = true
+			message('Driver @0@ cannot be disabled, enabling.'.format(drv_path))
+		endif
+
 		if build
 			# get dependency objs from strings
 			shared_deps = ext_deps
@@ -109,7 +148,7 @@ foreach subpath:subdirs
 						'_disable_reason', reason)
 			endif
 		else
-			enabled_drivers += name
+			enabled_class_drivers += name
 			lib_name = '_'.join(['rte', class, name])
 			dpdk_conf.set(lib_name.to_upper(), 1)
 
@@ -214,5 +253,5 @@ foreach subpath:subdirs
 		endif # build
 	endforeach
 
-	set_variable(class + '_drivers', enabled_drivers)
+	set_variable(class + '_drivers', enabled_class_drivers)
 endforeach
diff --git a/meson.build b/meson.build
index 7778e18200..38a2bd5416 100644
--- a/meson.build
+++ b/meson.build
@@ -22,6 +22,8 @@ dpdk_drivers = []
 dpdk_extra_ldflags = []
 dpdk_libs_disabled = []
 dpdk_drvs_disabled = []
+disabled_drivers = []
+enabled_drivers = []
 abi_version_file = files('ABI_VERSION')
 
 if host_machine.cpu_family().startswith('x86')
diff --git a/meson_options.txt b/meson_options.txt
index 86bc6c88f6..d2d24a1424 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,6 +8,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
 	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false,
 	description: 'build documentation')
+option('enable_drivers', type: 'string', value: '',
+	description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false,
 	description: 'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v19 2/3] build: add 'platform' meson option and Arm SoC config
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-09  8:41                                       ` Juraj Linkeš
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
                                                         ` (4 subsequent siblings)
  6 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  8:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration sets to Arm meson.build and add an arch
agnostic meson option, 'platform', to select from these SoC
configurations for meson native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 140 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  84 ++++-------
 meson_options.txt                             |   2 +
 16 files changed, 179 insertions(+), 118 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 9958db6692..301418949b 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'armada'
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804 b/config/arm/arm64_armv8_linux_clang_ubuntu1804
index 57095c1304..db488d75f4 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu1804
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
@@ -14,7 +14,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'generic'
-part_number = 'generic'
+platform = 'generic'
 c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-gnu']
 c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da1..5391d35389 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+platform = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd4..248a9f031a 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c7628..e9d5fd31fc 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb055106..9cdd931180 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+platform = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index edacb79497..8016fd236c 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef7..0df283e2f4 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+platform = 'n1sdp'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 817b8ee28e..036aee2b0a 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd49'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'n2'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 5937697098..9156ee5410 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+platform = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd4..319a4a151d 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b3..69c71cbc82 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+platform = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e48..372097ba01 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+platform = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index a241c45d13..6fcbbf2ebc 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -25,7 +25,7 @@ flags_common = [
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -192,6 +192,106 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_n2 = {
+	'description': 'Arm Neoverse N2',
+	'implementer': '0x41',
+	'part_number': '0xd49',
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'n2': soc_n2,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -203,11 +303,19 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
+	soc = get_option('platform')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'default'
 			# default build
+			if soc != ''
+				error('Building for a particular platform is ' +
+				      'unsupported with default build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif soc != ''
+			soc_config = socs.get(soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -225,8 +333,30 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		soc = meson.get_cross_property('platform', '')
+		if soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+		if soc_config.has_key('disabled_drivers')
+			disabled_drivers += soc_config['disabled_drivers']
+		endif
+		if soc_config.has_key('enabled_drivers')
+			enabled_drivers += soc_config['enabled_drivers']
+		endif
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -252,8 +382,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use default flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add/overwrite flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 1504dbfef0..fb01f3020c 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -187,58 +187,32 @@ Use the following command to cross-compile DPDK for the target machine::
    meson aarch64-build-clang --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804
    ninja -C aarch64-build-clang
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
-
-      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
-
-      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Dplatform meson
+option::
+
+   meson soc_build -Dplatform=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   platform = 'generic'
diff --git a/meson_options.txt b/meson_options.txt
index d2d24a1424..d3d9e1ee51 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -32,6 +32,8 @@ option('max_lcores', type: 'integer', value: 128,
 	description: 'maximum number of cores/threads supported by EAL')
 option('max_numa_nodes', type: 'integer', value: 32,
 	description: 'maximum number of NUMA nodes supported by EAL')
+option('platform', type: 'string', value: '',
+	description: 'Use configuration for a particular platform (such as an Arm SoC).')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v19 3/3] config: fix Arm implementer and its SoCs
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-04-09  8:41                                       ` Juraj Linkeš
  2021-04-09  8:44                                         ` Ruifeng Wang
  2021-04-09  8:54                                       ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Jerin Jacob
                                                         ` (3 subsequent siblings)
  6 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09  8:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Also increase the neoverse-n1 MAX_LCORE and MAX_NUMA_NODES to reflect
new available hardware (Amplere Altra).
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 config/arm/meson.build | 60 +++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 33 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 6fcbbf2ebc..b1c79b8550 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -56,7 +56,8 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80]
+			['RTE_MAX_LCORE', 160],
+			['RTE_MAX_NUMA_NODES', 2]
 		]
 	},
 	'0xd49': {
@@ -64,7 +65,8 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_MAX_LCORE', 64]
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	}
 }
@@ -74,8 +76,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -157,39 +159,13 @@ implementer_qualcomm = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
 	'0x50': implementer_ampere,
-	'0x51': implementer_qualcomm,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x51': implementer_qualcomm
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -202,8 +178,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -211,13 +191,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -261,6 +251,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v19 3/3] config: fix Arm implementer and its SoCs
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-04-09  8:44                                         ` Ruifeng Wang
  0 siblings, 0 replies; 465+ messages in thread
From: Ruifeng Wang @ 2021-04-09  8:44 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Honnappa Nagarahalli, vcchunga,
	Dharmik Thakkar, jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer
  Cc: dev, lironh, nd

> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Friday, April 9, 2021 4:41 PM
> To: bruce.richardson@intel.com; Ruifeng Wang <Ruifeng.Wang@arm.com>;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; vcchunga@amazon.com; Dharmik Thakkar
> <Dharmik.Thakkar@arm.com>; jerinjacobk@gmail.com;
> hemant.agrawal@nxp.com; Ajit Khaparde (ajit.khaparde@broadcom.com)
> <ajit.khaparde@broadcom.com>; ferruh.yigit@intel.com;
> aboyer@pensando.io
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>;
> lironh@marvell.com; yskoh@mellanox.com
> Subject: [PATCH v19 3/3] config: fix Arm implementer and its SoCs
> 
> Fix the implementer and part number of DPAA and ARMADA SoCs.
> The current values of 16 cores and 1 NUMA node don't cover all SoCs from
> the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
> Increase these to 64 and 4 to widen the coverage.
> Also increase the neoverse-n1 MAX_LCORE and MAX_NUMA_NODES to
> reflect new available hardware (Amplere Altra).
> Add configuration to SoC options where smaller values are needed.
> 
> Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
> Cc: hemant.agrawal@nxp.com
> Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
> Cc: lironh@marvell.com
> Fixes: d97108a33231 ("config: change defaults of armv8")
> Cc: yskoh@mellanox.com
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Liron Himi <lironh@marvell.com>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  config/arm/meson.build | 60 +++++++++++++++++++-----------------------
>  1 file changed, 27 insertions(+), 33 deletions(-)
> 

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

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

* Re: [dpdk-dev] [PATCH v19 0/3] Arm build options rework
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
                                                         ` (2 preceding siblings ...)
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-04-09  8:54                                       ` Jerin Jacob
  2021-04-12  3:57                                       ` Chengchang Tang
                                                         ` (2 subsequent siblings)
  6 siblings, 0 replies; 465+ messages in thread
From: Jerin Jacob @ 2021-04-09  8:54 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Richardson, Bruce, Ruifeng Wang (Arm Technology China),
	Honnappa Nagarahalli, Phil Yang, Vimal Chungath, Dharmik Thakkar,
	Hemant Agrawal, Ajit Khaparde, Ferruh Yigit, aboyer, dpdk-dev

On Fri, Apr 9, 2021 at 2:11 PM Juraj Linkeš <juraj.linkes@pantheon.tech> wrote:
>
> The current way of specifying Arm configuration options is insufficient
> since we can't identify the SoC we're building for from the MIDR
> information. For example, we can't distinguish between N1SDP, Graviton2
> or Ampere Altra.
>
> We also want to be able to enable/disable which drivers are built
> without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed
> 2. a cross build on a fast aarch64 machine but with target SoC which
>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in SoC configuration.
>
> The current implementation adds/supports the following:
> * x86 -> aarch64 cross build with added config options/enabled or
>   disabled drivers/libs
> * aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
>   option or using a cross file
>
> v16:
> Only three commits remaining - updated the cover letter.
> Renamed the 'soc' meson option to 'platform'.
> Added the support for enabling a particular set of drivers.
> Aligned enabling and disabling with the command line option so that
> wildcards can be used.
>
> v17:
> Removed unnecessary comments in "build: disable/enable drivers in Arm
> builds". Also always enabled two drivers which break the build if
> disabled.
>
> v18:
> Rebased.
>
> v19:
> Updated 3/3 with more up to date MAX_LCORE and MAX_NUMA_NODES for
> neoverse-n1.

There are other SoC target addition patches are blocked by this series.
This series looks good to me. Request to merge this before RC1.


Tested for octeontx2/Thunderx.

Series-Tested-by: Jerin Jacob <jerinj@marvell.com>


>
> Juraj Linkeš (3):
>   build: disable/enable drivers in Arm builds
>   build: add 'platform' meson option and Arm SoC config
>   config: fix Arm implementer and its SoCs
>
>  config/arm/arm64_armada_linux_gcc             |   6 +-
>  config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
>  config/arm/arm64_armv8_linux_gcc              |   5 +-
>  config/arm/arm64_bluefield_linux_gcc          |   6 +-
>  config/arm/arm64_dpaa_linux_gcc               |   6 +-
>  config/arm/arm64_emag_linux_gcc               |   5 +-
>  config/arm/arm64_graviton2_linux_gcc          |   6 +-
>  config/arm/arm64_n1sdp_linux_gcc              |   6 +-
>  config/arm/arm64_n2_linux_gcc                 |   6 +-
>  config/arm/arm64_octeontx2_linux_gcc          |   6 +-
>  config/arm/arm64_stingray_linux_gcc           |   6 +-
>  config/arm/arm64_thunderx2_linux_gcc          |   5 +-
>  config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
>  config/arm/meson.build                        | 180 +++++++++++++++---
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
>  drivers/meson.build                           |  49 ++++-
>  meson.build                                   |   2 +
>  meson_options.txt                             |   4 +
>  18 files changed, 242 insertions(+), 140 deletions(-)
>
> --
> 2.20.1
>

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

* Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-09 10:02                                         ` Bruce Richardson
  2021-04-09 14:10                                           ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-04-09 10:02 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev

On Fri, Apr 09, 2021 at 10:41:17AM +0200, Juraj Linkeš wrote:
> Add support for enabling or disabling drivers for Arm cross build. Do
> not implement any enable/disable lists yet.
> 
> Enabling drivers is useful when building for an SoC where we only want
> to build a few drivers. That way the list won't be too long.
> 
> Similarly, disabling drivers is useful when we want to disable only a
> few drivers.
> 
> Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
> same arch) builds, where the build machine may have the required driver
> dependencies, yet we don't want to build drivers for a specific SoC.
> 
> By default, build all drivers for which dependencies are found. If
> enabled_drivers is a non-empty list, build only those drivers.  If
> disabled_drivers is non-empty list, build all drivers except those in
> disabled_drivers. Error out if both are specified (i.e. do not support
> that case).
> 
> There are two drivers, bus/pci and bus/vdev, which break the build if
> not enabled. Address this by always enabling these if the user disables
> them or doesn't specify in their allowlist.
> 
> Also remove the old Makefile arm configuration options which don't do
> anything in Meson.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

I think this patch has changed since I last acked it. Further review below.

> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>  config/arm/meson.build                        |  4 --
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
>  drivers/meson.build                           | 49 +++++++++++++++++--
>  meson.build                                   |  2 +
>  meson_options.txt                             |  2 +
>  5 files changed, 56 insertions(+), 9 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index 00bc4610a3..a241c45d13 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -16,9 +16,6 @@ flags_common = [
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
>  
> -	['RTE_NET_FM10K', false],
> -	['RTE_NET_AVP', false],
> -
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
>  	['RTE_ARCH_ARM64', true],
> @@ -125,7 +122,6 @@ implementer_cavium = {
>  				['RTE_MACHINE', '"octeontx2"'],
>  				['RTE_ARM_FEATURE_ATOMICS', true],
>  				['RTE_USE_C11_MEM_MODEL', true],
> -				['RTE_EAL_IGB_UIO', false],
>  				['RTE_MAX_LCORE', 36],
>  				['RTE_MAX_NUMA_NODES', 1]
>  			]
> 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 faaf24b95b..1504dbfef0 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
>        numa = false        # set to false to force building for a non-NUMA system
>           # if not set or set to true, the build system will build for a NUMA
>           # system only if libnuma is installed
> +
> +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> +
> +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 9c8eded697..be5fd2df88 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -19,8 +19,39 @@ subdirs = [
>  	'baseband', # depends on common and bus.
>  ]
>  
> -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> -		).stdout().split()
> +always_enabled = ['bus/pci', 'bus/vdev']
> +
> +if meson.is_cross_build()
> +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> +	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
> +endif

I don't think "+=" is correct here. This is the first use of the
disabled_drivers variable. [Sorry, correction, I see you've added a new
definition of it in the top-level meson.build. I think it's better to move
that to this file]

Also, would it not be better to have the cross-file option the same as that
used in the parameter option? Right now you have the cross-file option as
"disabled_drivers" vs cmdline option "disable_drivers" and the types being
list and string respectively too. Why not have the cross-file option be a
string called "disable_drivers" too? It would save some joining an
array/string conversion below and simplify things.

> +
> +# add cmdline disabled drivers (comma separated string)
> +# and meson disabled drivers (list)
> +# together into a comma separated string
> +disabled_drivers = ','.join([get_option('disable_drivers'), ','.join(disabled_drivers)]).strip(',')

Do we need the string at the end here? I would think that join never adds a
trailing comma? As stated above if these were both strings it might make
things shorter and easier.

> +if disabled_drivers != ''
> +	disabled_drivers = run_command(list_dir_globs,
> +		disabled_drivers).stdout().split()
> +else
> +	disabled_drivers = []
> +endif

Don't think we need the "if/else" here. The existing code works fine with
taking an empty array.

> +
> +# add cmdline enabled drivers (comma separated string)
> +# and meson enabled drivers (list)
> +# together into a comma separated string
> +enabled_drivers = ','.join([get_option('enable_drivers'), ','.join(enabled_drivers)]).strip(',')
> +if enabled_drivers != ''
> +	enabled_drivers = run_command(list_dir_globs,
> +		enabled_drivers).stdout().split()
> +else
> +	enabled_drivers = []
> +endif
> +
> +if disabled_drivers != [] and enabled_drivers != []
> +	error('Simultaneous disabled drivers and enabled drivers ' +
> +	      'configuration is not supported.')
> +endif

For use in cross-files this makes sense, but I'm not sure it's the correct
approach for when a cross-file specifies enable and the user specifies
disable on the cmdline. In that case, the enable list should just have the
disabled values removed from it. Therefore, I suggest having this check
only in the cross-build section.

>  
>  default_cflags = machine_args
>  default_cflags += ['-DALLOW_EXPERIMENTAL_API']
> @@ -49,7 +80,7 @@ foreach subpath:subdirs
>  		dpdk_driver_classes += class
>  	endif
>  	# get already enabled drivers of the same class
> -	enabled_drivers = get_variable(class + '_drivers', [])
> +	enabled_class_drivers = get_variable(class + '_drivers', [])
>  
>  	foreach drv:drivers
>  		drv_path = join_paths(class, drv)
> @@ -77,11 +108,19 @@ foreach subpath:subdirs
>  		if disabled_drivers.contains(drv_path)
>  			build = false
>  			reason = 'explicitly disabled via build config'
> +		elif enabled_drivers.length() > 0 and not enabled_drivers.contains(drv_path)
> +			build = false
> +			reason = 'not in enabled drivers build config'
>  		else
>  			# pull in driver directory which should update all the local variables
>  			subdir(drv_path)
>  		endif
>  
> +		if not build and always_enabled.contains(drv_path)
> +			build = true
> +			message('Driver @0@ cannot be disabled, enabling.'.format(drv_path))
> +		endif
> +
>  		if build
>  			# get dependency objs from strings
>  			shared_deps = ext_deps
> @@ -109,7 +148,7 @@ foreach subpath:subdirs
>  						'_disable_reason', reason)
>  			endif
>  		else
> -			enabled_drivers += name
> +			enabled_class_drivers += name
>  			lib_name = '_'.join(['rte', class, name])
>  			dpdk_conf.set(lib_name.to_upper(), 1)
>  
> @@ -214,5 +253,5 @@ foreach subpath:subdirs
>  		endif # build
>  	endforeach
>  
> -	set_variable(class + '_drivers', enabled_drivers)
> +	set_variable(class + '_drivers', enabled_class_drivers)
>  endforeach
> diff --git a/meson.build b/meson.build
> index 7778e18200..38a2bd5416 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -22,6 +22,8 @@ dpdk_drivers = []
>  dpdk_extra_ldflags = []
>  dpdk_libs_disabled = []
>  dpdk_drvs_disabled = []
> +disabled_drivers = []
> +enabled_drivers = []

These variables don't need to be declared here. They are only used in
drivers/meson.build and nowhere else.

>  abi_version_file = files('ABI_VERSION')
>  
>  if host_machine.cpu_family().startswith('x86')
> diff --git a/meson_options.txt b/meson_options.txt
> index 86bc6c88f6..d2d24a1424 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -8,6 +8,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
>  	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
>  option('enable_docs', type: 'boolean', value: false,
>  	description: 'build documentation')
> +option('enable_drivers', type: 'string', value: '',
> +	description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.')
>  option('enable_driver_sdk', type: 'boolean', value: false,
>  	description: 'Install headers to build drivers.')
>  option('enable_kmods', type: 'boolean', value: false,
> -- 
> 2.20.1
> 

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

* Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-09 10:02                                         ` Bruce Richardson
@ 2021-04-09 14:10                                           ` Juraj Linkeš
  2021-04-09 14:31                                             ` Bruce Richardson
  0 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-09 14:10 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday, April 9, 2021 12:03 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> dev@dpdk.org
> Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm builds
> 
> On Fri, Apr 09, 2021 at 10:41:17AM +0200, Juraj Linkeš wrote:
> > Add support for enabling or disabling drivers for Arm cross build. Do
> > not implement any enable/disable lists yet.
> >
> > Enabling drivers is useful when building for an SoC where we only want
> > to build a few drivers. That way the list won't be too long.
> >
> > Similarly, disabling drivers is useful when we want to disable only a
> > few drivers.
> >
> > Both of these are advantageous mainly in aarch64 -> aarch64 (or arch
> > -> same arch) builds, where the build machine may have the required
> > driver dependencies, yet we don't want to build drivers for a specific SoC.
> >
> > By default, build all drivers for which dependencies are found. If
> > enabled_drivers is a non-empty list, build only those drivers.  If
> > disabled_drivers is non-empty list, build all drivers except those in
> > disabled_drivers. Error out if both are specified (i.e. do not support
> > that case).
> >
> > There are two drivers, bus/pci and bus/vdev, which break the build if
> > not enabled. Address this by always enabling these if the user
> > disables them or doesn't specify in their allowlist.
> >
> > Also remove the old Makefile arm configuration options which don't do
> > anything in Meson.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> I think this patch has changed since I last acked it. Further review below.
> 
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > ---
> >  config/arm/meson.build                        |  4 --
> >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
> >  drivers/meson.build                           | 49 +++++++++++++++++--
> >  meson.build                                   |  2 +
> >  meson_options.txt                             |  2 +
> >  5 files changed, 56 insertions(+), 9 deletions(-)
> >
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > 00bc4610a3..a241c45d13 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -16,9 +16,6 @@ flags_common = [
> >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> >
> > -	['RTE_NET_FM10K', false],
> > -	['RTE_NET_AVP', false],
> > -
> >  	['RTE_SCHED_VECTOR', false],
> >  	['RTE_ARM_USE_WFE', false],
> >  	['RTE_ARCH_ARM64', true],
> > @@ -125,7 +122,6 @@ implementer_cavium = {
> >  				['RTE_MACHINE', '"octeontx2"'],
> >  				['RTE_ARM_FEATURE_ATOMICS', true],
> >  				['RTE_USE_C11_MEM_MODEL', true],
> > -				['RTE_EAL_IGB_UIO', false],
> >  				['RTE_MAX_LCORE', 36],
> >  				['RTE_MAX_NUMA_NODES', 1]
> >  			]
> > 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 faaf24b95b..1504dbfef0 100644
> > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > @@ -234,3 +234,11 @@ There are other options you may specify in a cross
> file to tailor the build::
> >        numa = false        # set to false to force building for a non-NUMA system
> >           # if not set or set to true, the build system will build for a NUMA
> >           # system only if libnuma is installed
> > +
> > +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> > +         # valid values are dir/subdirs in the drivers directory
> > +         # wildcards are allowed
> > +
> > +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> > +         # valid values are dir/subdirs in the drivers directory
> > +         # wildcards are allowed
> > diff --git a/drivers/meson.build b/drivers/meson.build index
> > 9c8eded697..be5fd2df88 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -19,8 +19,39 @@ subdirs = [
> >  	'baseband', # depends on common and bus.
> >  ]
> >
> > -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> > -		).stdout().split()
> > +always_enabled = ['bus/pci', 'bus/vdev']
> > +
> > +if meson.is_cross_build()
> > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > +	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
> > +endif
> 
> I don't think "+=" is correct here. This is the first use of the disabled_drivers
> variable. [Sorry, correction, I see you've added a new definition of it in the top-
> level meson.build. I think it's better to move that to this file]
> 

This need not be true. It's added in config/arm/meson.build in the subsequent patch, which comes before drivers/meson.build, which is why I structured it this way - I don't think there's a reason to move the initialization around in the same series, but I could do that.

> Also, would it not be better to have the cross-file option the same as that used
> in the parameter option? Right now you have the cross-file option as
> "disabled_drivers" vs cmdline option "disable_drivers" and the types being list
> and string respectively too. Why not have the cross-file option be a string called
> "disable_drivers" too? It would save some joining an array/string conversion
> below and simplify things.
> 

The name can be the same. The reason I have two different types is that it struck me as more user friendly - specifying something in code is more intuitive as list as opposed to comma-delimited string, whereas it's more intuitive as comma-delimited string on cmdline. It's possible that having a comma-delimited string everywhere is actually better anyway - I'll change it.

> > +
> > +# add cmdline disabled drivers (comma separated string) # and meson
> > +disabled drivers (list) # together into a comma separated string
> > +disabled_drivers = ','.join([get_option('disable_drivers'),
> > +','.join(disabled_drivers)]).strip(',')
> 
> Do we need the string at the end here? I would think that join never adds a
> trailing comma? As stated above if these were both strings it might make things
> shorter and easier.
> 

If we're joining two empty strings (which happens when neither the cmdline nor the code list is specified), then we'll end up with a singular comma instead of an empty string.

Even then both of these are strings (which I'll change), we'll still need the strip, as the above scenario would still happen.

> > +if disabled_drivers != ''
> > +	disabled_drivers = run_command(list_dir_globs,
> > +		disabled_drivers).stdout().split()
> > +else
> > +	disabled_drivers = []
> > +endif
> 
> Don't think we need the "if/else" here. The existing code works fine with taking
> an empty array.
> 

An empty string results in ['.'], not in []. I ran into problems with allowlists when ['.'] is returned - I'm assuming that the allowlist is either empty or whathever is in the allowlist means something and '.' is meaningless since it's not a driver. This was the most straightforward solution I found. For disabled drivers we don't need this, but I did the same thing for consistency.

> > +
> > +# add cmdline enabled drivers (comma separated string) # and meson
> > +enabled drivers (list) # together into a comma separated string
> > +enabled_drivers = ','.join([get_option('enable_drivers'),
> > +','.join(enabled_drivers)]).strip(',')
> > +if enabled_drivers != ''
> > +	enabled_drivers = run_command(list_dir_globs,
> > +		enabled_drivers).stdout().split()
> > +else
> > +	enabled_drivers = []
> > +endif
> > +
> > +if disabled_drivers != [] and enabled_drivers != []
> > +	error('Simultaneous disabled drivers and enabled drivers ' +
> > +	      'configuration is not supported.') endif
> 
> For use in cross-files this makes sense, but I'm not sure it's the correct approach
> for when a cross-file specifies enable and the user specifies disable on the
> cmdline. In that case, the enable list should just have the disabled values
> removed from it. Therefore, I suggest having this check only in the cross-build
> section.
> 

Do you want to distinguish between enabling/disabling driver when cross compiling and when doing a regular build? From the previous discussion, I thought we didn't want to mix enable/disable lists no matter what the build or source is. The different scenarios in my mind are combinations of:
1. cross/regular build
2. no list, just enable list, just disable list, both lists
3. where a list is specified - cmdline or meson code (soc config or cross file)

These give us quite a number of different scenarios. When do we want to allow the mixing of enable/disable lists and when not? It's not clear to me from your description, but it seems that specifying a list on the cmdline should overwrite or supplement either an enable or disable list specified in code - we would allow just one of these in code and then augment that with cmdline.

> >
> >  default_cflags = machine_args
> >  default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -49,7 +80,7 @@
> > foreach subpath:subdirs
> >  		dpdk_driver_classes += class
> >  	endif
> >  	# get already enabled drivers of the same class
> > -	enabled_drivers = get_variable(class + '_drivers', [])
> > +	enabled_class_drivers = get_variable(class + '_drivers', [])
> >
> >  	foreach drv:drivers
> >  		drv_path = join_paths(class, drv)
> > @@ -77,11 +108,19 @@ foreach subpath:subdirs
> >  		if disabled_drivers.contains(drv_path)
> >  			build = false
> >  			reason = 'explicitly disabled via build config'
> > +		elif enabled_drivers.length() > 0 and not
> enabled_drivers.contains(drv_path)
> > +			build = false
> > +			reason = 'not in enabled drivers build config'
> >  		else
> >  			# pull in driver directory which should update all the
> local variables
> >  			subdir(drv_path)
> >  		endif
> >
> > +		if not build and always_enabled.contains(drv_path)
> > +			build = true
> > +			message('Driver @0@ cannot be disabled,
> enabling.'.format(drv_path))
> > +		endif
> > +
> >  		if build
> >  			# get dependency objs from strings
> >  			shared_deps = ext_deps
> > @@ -109,7 +148,7 @@ foreach subpath:subdirs
> >  						'_disable_reason', reason)
> >  			endif
> >  		else
> > -			enabled_drivers += name
> > +			enabled_class_drivers += name
> >  			lib_name = '_'.join(['rte', class, name])
> >  			dpdk_conf.set(lib_name.to_upper(), 1)
> >
> > @@ -214,5 +253,5 @@ foreach subpath:subdirs
> >  		endif # build
> >  	endforeach
> >
> > -	set_variable(class + '_drivers', enabled_drivers)
> > +	set_variable(class + '_drivers', enabled_class_drivers)
> >  endforeach
> > diff --git a/meson.build b/meson.build index 7778e18200..38a2bd5416
> > 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -22,6 +22,8 @@ dpdk_drivers = []
> >  dpdk_extra_ldflags = []
> >  dpdk_libs_disabled = []
> >  dpdk_drvs_disabled = []
> > +disabled_drivers = []
> > +enabled_drivers = []
> 
> These variables don't need to be declared here. They are only used in
> drivers/meson.build and nowhere else.
> 

As mentioned above, this is in anticipation of the subsequent patch. The other place that makes sense is in config/meson.build. I could put it into drivers/meson.build in this commit and then move it to either the top-level meson.build or to config/meson.build. What do you think?

> >  abi_version_file = files('ABI_VERSION')
> >
> >  if host_machine.cpu_family().startswith('x86')
> > diff --git a/meson_options.txt b/meson_options.txt index
> > 86bc6c88f6..d2d24a1424 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -8,6 +8,8 @@ option('drivers_install_subdir', type: 'string', value:
> 'dpdk/pmds-<VERSION>',
> >  	description: 'Subdirectory of libdir where to install PMDs. Defaults
> > to using a versioned subdirectory.')  option('enable_docs', type: 'boolean',
> value: false,
> >  	description: 'build documentation')
> > +option('enable_drivers', type: 'string', value: '',
> > +	description: 'Comma-separated list of drivers to build. If
> > +unspecified, build all drivers.')
> >  option('enable_driver_sdk', type: 'boolean', value: false,
> >  	description: 'Install headers to build drivers.')
> > option('enable_kmods', type: 'boolean', value: false,
> > --
> > 2.20.1
> >


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

* Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-09 14:10                                           ` Juraj Linkeš
@ 2021-04-09 14:31                                             ` Bruce Richardson
  2021-04-09 15:38                                               ` Bruce Richardson
  2021-04-14  9:02                                               ` Juraj Linkeš
  0 siblings, 2 replies; 465+ messages in thread
From: Bruce Richardson @ 2021-04-09 14:31 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev

On Fri, Apr 09, 2021 at 02:10:08PM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Friday, April 9, 2021 12:03 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> > dev@dpdk.org
> > Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm builds
> > 
> > On Fri, Apr 09, 2021 at 10:41:17AM +0200, Juraj Linkeš wrote:
> > > Add support for enabling or disabling drivers for Arm cross build. Do
> > > not implement any enable/disable lists yet.
> > >
> > > Enabling drivers is useful when building for an SoC where we only want
> > > to build a few drivers. That way the list won't be too long.
> > >
> > > Similarly, disabling drivers is useful when we want to disable only a
> > > few drivers.
> > >
> > > Both of these are advantageous mainly in aarch64 -> aarch64 (or arch
> > > -> same arch) builds, where the build machine may have the required
> > > driver dependencies, yet we don't want to build drivers for a specific SoC.
> > >
> > > By default, build all drivers for which dependencies are found. If
> > > enabled_drivers is a non-empty list, build only those drivers.  If
> > > disabled_drivers is non-empty list, build all drivers except those in
> > > disabled_drivers. Error out if both are specified (i.e. do not support
> > > that case).
> > >
> > > There are two drivers, bus/pci and bus/vdev, which break the build if
> > > not enabled. Address this by always enabling these if the user
> > > disables them or doesn't specify in their allowlist.
> > >
> > > Also remove the old Makefile arm configuration options which don't do
> > > anything in Meson.
> > >
> > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > 
> > I think this patch has changed since I last acked it. Further review below.
> > 
> > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > > ---
> > >  config/arm/meson.build                        |  4 --
> > >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
> > >  drivers/meson.build                           | 49 +++++++++++++++++--
> > >  meson.build                                   |  2 +
> > >  meson_options.txt                             |  2 +
> > >  5 files changed, 56 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > 00bc4610a3..a241c45d13 100644
> > > --- a/config/arm/meson.build
> > > +++ b/config/arm/meson.build
> > > @@ -16,9 +16,6 @@ flags_common = [
> > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > >
> > > -	['RTE_NET_FM10K', false],
> > > -	['RTE_NET_AVP', false],
> > > -
> > >  	['RTE_SCHED_VECTOR', false],
> > >  	['RTE_ARM_USE_WFE', false],
> > >  	['RTE_ARCH_ARM64', true],
> > > @@ -125,7 +122,6 @@ implementer_cavium = {
> > >  				['RTE_MACHINE', '"octeontx2"'],
> > >  				['RTE_ARM_FEATURE_ATOMICS', true],
> > >  				['RTE_USE_C11_MEM_MODEL', true],
> > > -				['RTE_EAL_IGB_UIO', false],
> > >  				['RTE_MAX_LCORE', 36],
> > >  				['RTE_MAX_NUMA_NODES', 1]
> > >  			]
> > > 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 faaf24b95b..1504dbfef0 100644
> > > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > @@ -234,3 +234,11 @@ There are other options you may specify in a cross
> > file to tailor the build::
> > >        numa = false        # set to false to force building for a non-NUMA system
> > >           # if not set or set to true, the build system will build for a NUMA
> > >           # system only if libnuma is installed
> > > +
> > > +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> > > +         # valid values are dir/subdirs in the drivers directory
> > > +         # wildcards are allowed
> > > +
> > > +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> > > +         # valid values are dir/subdirs in the drivers directory
> > > +         # wildcards are allowed
> > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > 9c8eded697..be5fd2df88 100644
> > > --- a/drivers/meson.build
> > > +++ b/drivers/meson.build
> > > @@ -19,8 +19,39 @@ subdirs = [
> > >  	'baseband', # depends on common and bus.
> > >  ]
> > >
> > > -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> > > -		).stdout().split()
> > > +always_enabled = ['bus/pci', 'bus/vdev']
> > > +
> > > +if meson.is_cross_build()
> > > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > > +	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
> > > +endif
> > 
> > I don't think "+=" is correct here. This is the first use of the disabled_drivers
> > variable. [Sorry, correction, I see you've added a new definition of it in the top-
> > level meson.build. I think it's better to move that to this file]
> > 
> 
> This need not be true. It's added in config/arm/meson.build in the subsequent patch, which comes before drivers/meson.build, which is why I structured it this way - I don't think there's a reason to move the initialization around in the same series, but I could do that.

Ok, I did not realise that. I need to look at how they are used in that
file.

> 
> > Also, would it not be better to have the cross-file option the same as that used
> > in the parameter option? Right now you have the cross-file option as
> > "disabled_drivers" vs cmdline option "disable_drivers" and the types being list
> > and string respectively too. Why not have the cross-file option be a string called
> > "disable_drivers" too? It would save some joining an array/string conversion
> > below and simplify things.
> > 
> 
> The name can be the same. The reason I have two different types is that it struck me as more user friendly - specifying something in code is more intuitive as list as opposed to comma-delimited string, whereas it's more intuitive as comma-delimited string on cmdline. It's possible that having a comma-delimited string everywhere is actually better anyway - I'll change it.
> 
> > > +
> > > +# add cmdline disabled drivers (comma separated string) # and meson
> > > +disabled drivers (list) # together into a comma separated string
> > > +disabled_drivers = ','.join([get_option('disable_drivers'),
> > > +','.join(disabled_drivers)]).strip(',')
> > 
> > Do we need the string at the end here? I would think that join never adds a
> > trailing comma? As stated above if these were both strings it might make things
> > shorter and easier.
> > 
> 
> If we're joining two empty strings (which happens when neither the cmdline nor the code list is specified), then we'll end up with a singular comma instead of an empty string.
> 
> Even then both of these are strings (which I'll change), we'll still need the strip, as the above scenario would still happen.

Ok, didn't realise that the trailing "," will still be present. However, I
think a better fix for this, and the issue below with "." being printed in
the empty case is to add the following to buildtools/list-dir-globs.py:

@@ -14,6 +14,8 @@
                     os.getenv('MESON_SUBDIR', '.'))

 for path in sys.argv[1].split(','):
+    if not path:
+        continue
     for p in iglob(os.path.join(root, path)):
         if os.path.isdir(p):
             print(os.path.relpath(p))

With that added, we don't need to worry about null strings or and trailing
commas and can just do:
disabled_drivers += ',' + get_option('disable_drivers')

> 
> > > +if disabled_drivers != ''
> > > +	disabled_drivers = run_command(list_dir_globs,
> > > +		disabled_drivers).stdout().split()
> > > +else
> > > +	disabled_drivers = []
> > > +endif
> > 
> > Don't think we need the "if/else" here. The existing code works fine with taking
> > an empty array.
> > 
> 
> An empty string results in ['.'], not in []. I ran into problems with allowlists when ['.'] is returned - I'm assuming that the allowlist is either empty or whathever is in the allowlist means something and '.' is meaningless since it's not a driver. This was the most straightforward solution I found. For disabled drivers we don't need this, but I did the same thing for consistency.
> 

I think the above two-line change to the globs script should fix this.

> > > +
> > > +# add cmdline enabled drivers (comma separated string) # and meson
> > > +enabled drivers (list) # together into a comma separated string
> > > +enabled_drivers = ','.join([get_option('enable_drivers'),
> > > +','.join(enabled_drivers)]).strip(',')
> > > +if enabled_drivers != ''
> > > +	enabled_drivers = run_command(list_dir_globs,
> > > +		enabled_drivers).stdout().split()
> > > +else
> > > +	enabled_drivers = []
> > > +endif
> > > +
> > > +if disabled_drivers != [] and enabled_drivers != []
> > > +	error('Simultaneous disabled drivers and enabled drivers ' +
> > > +	      'configuration is not supported.') endif
> > 
> > For use in cross-files this makes sense, but I'm not sure it's the correct approach
> > for when a cross-file specifies enable and the user specifies disable on the
> > cmdline. In that case, the enable list should just have the disabled values
> > removed from it. Therefore, I suggest having this check only in the cross-build
> > section.
> > 
> 
> Do you want to distinguish between enabling/disabling driver when cross compiling and when doing a regular build? From the previous discussion, I thought we didn't want to mix enable/disable lists no matter what the build or source is. The different scenarios in my mind are combinations of:
> 1. cross/regular build
> 2. no list, just enable list, just disable list, both lists
> 3. where a list is specified - cmdline or meson code (soc config or cross file)
> 
> These give us quite a number of different scenarios. When do we want to allow the mixing of enable/disable lists and when not? It's not clear to me from your description, but it seems that specifying a list on the cmdline should overwrite or supplement either an enable or disable list specified in code - we would allow just one of these in code and then augment that with cmdline.
> 

It's got quite a complicated number of scenarios, I admit.
One thought, though not sure if it would work, is to always check
enabled_drivers and disabled_drivers. If no enable_drivers option in
cross-file or cmdline, we initialize the value to "list_dir_globs *.*",
i.e. everything enabled. Similarly, if no disable_driver options provided,
we use an empty list.

Thereafter in the main loop we just check for each driver that it is in the
enable list and not in the disabled one.

Does that seem like it would work?
 
/Bruce

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

* Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-09 14:31                                             ` Bruce Richardson
@ 2021-04-09 15:38                                               ` Bruce Richardson
  2021-04-14  9:09                                                 ` Juraj Linkeš
  2021-04-14  9:02                                               ` Juraj Linkeš
  1 sibling, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-04-09 15:38 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev

On Fri, Apr 09, 2021 at 03:31:31PM +0100, Bruce Richardson wrote:
> On Fri, Apr 09, 2021 at 02:10:08PM +0000, Juraj Linkeš wrote:
> > 
> > 
> > > -----Original Message-----
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > Sent: Friday, April 9, 2021 12:03 PM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> > > dev@dpdk.org
> > > Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm builds
> > > 
> > > On Fri, Apr 09, 2021 at 10:41:17AM +0200, Juraj Linkeš wrote:
> > > > Add support for enabling or disabling drivers for Arm cross build. Do
> > > > not implement any enable/disable lists yet.
> > > >
> > > > Enabling drivers is useful when building for an SoC where we only want
> > > > to build a few drivers. That way the list won't be too long.
> > > >
> > > > Similarly, disabling drivers is useful when we want to disable only a
> > > > few drivers.
> > > >
> > > > Both of these are advantageous mainly in aarch64 -> aarch64 (or arch
> > > > -> same arch) builds, where the build machine may have the required
> > > > driver dependencies, yet we don't want to build drivers for a specific SoC.
> > > >
> > > > By default, build all drivers for which dependencies are found. If
> > > > enabled_drivers is a non-empty list, build only those drivers.  If
> > > > disabled_drivers is non-empty list, build all drivers except those in
> > > > disabled_drivers. Error out if both are specified (i.e. do not support
> > > > that case).
> > > >
> > > > There are two drivers, bus/pci and bus/vdev, which break the build if
> > > > not enabled. Address this by always enabling these if the user
> > > > disables them or doesn't specify in their allowlist.
> > > >
> > > > Also remove the old Makefile arm configuration options which don't do
> > > > anything in Meson.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > 
> > > I think this patch has changed since I last acked it. Further review below.
> > > 
> > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > > > ---
> > > >  config/arm/meson.build                        |  4 --
> > > >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
> > > >  drivers/meson.build                           | 49 +++++++++++++++++--
> > > >  meson.build                                   |  2 +
> > > >  meson_options.txt                             |  2 +
> > > >  5 files changed, 56 insertions(+), 9 deletions(-)
> > > >
> > > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > > 00bc4610a3..a241c45d13 100644
> > > > --- a/config/arm/meson.build
> > > > +++ b/config/arm/meson.build
> > > > @@ -16,9 +16,6 @@ flags_common = [
> > > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > >
> > > > -	['RTE_NET_FM10K', false],
> > > > -	['RTE_NET_AVP', false],
> > > > -
> > > >  	['RTE_SCHED_VECTOR', false],
> > > >  	['RTE_ARM_USE_WFE', false],
> > > >  	['RTE_ARCH_ARM64', true],
> > > > @@ -125,7 +122,6 @@ implementer_cavium = {
> > > >  				['RTE_MACHINE', '"octeontx2"'],
> > > >  				['RTE_ARM_FEATURE_ATOMICS', true],
> > > >  				['RTE_USE_C11_MEM_MODEL', true],
> > > > -				['RTE_EAL_IGB_UIO', false],
> > > >  				['RTE_MAX_LCORE', 36],
> > > >  				['RTE_MAX_NUMA_NODES', 1]
> > > >  			]
> > > > 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 faaf24b95b..1504dbfef0 100644
> > > > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > @@ -234,3 +234,11 @@ There are other options you may specify in a cross
> > > file to tailor the build::
> > > >        numa = false        # set to false to force building for a non-NUMA system
> > > >           # if not set or set to true, the build system will build for a NUMA
> > > >           # system only if libnuma is installed
> > > > +
> > > > +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> > > > +         # valid values are dir/subdirs in the drivers directory
> > > > +         # wildcards are allowed
> > > > +
> > > > +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> > > > +         # valid values are dir/subdirs in the drivers directory
> > > > +         # wildcards are allowed
> > > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > > 9c8eded697..be5fd2df88 100644
> > > > --- a/drivers/meson.build
> > > > +++ b/drivers/meson.build
> > > > @@ -19,8 +19,39 @@ subdirs = [
> > > >  	'baseband', # depends on common and bus.
> > > >  ]
> > > >
> > > > -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> > > > -		).stdout().split()
> > > > +always_enabled = ['bus/pci', 'bus/vdev']
> > > > +
> > > > +if meson.is_cross_build()
> > > > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > > > +	enabled_drivers += meson.get_cross_property('enabled_drivers', [])
> > > > +endif
> > > 
> > > I don't think "+=" is correct here. This is the first use of the disabled_drivers
> > > variable. [Sorry, correction, I see you've added a new definition of it in the top-
> > > level meson.build. I think it's better to move that to this file]
> > > 
> > 
> > This need not be true. It's added in config/arm/meson.build in the subsequent patch, which comes before drivers/meson.build, which is why I structured it this way - I don't think there's a reason to move the initialization around in the same series, but I could do that.
> 
> Ok, I did not realise that. I need to look at how they are used in that
> file.
> 
One further minor nit here is that the global array defined in the
top-level meson.build all start with "dpdk_". This seems a good policy to
follow to have consistent naming.

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

* Re: [dpdk-dev] [PATCH v19 0/3] Arm build options rework
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
                                                         ` (3 preceding siblings ...)
  2021-04-09  8:54                                       ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Jerin Jacob
@ 2021-04-12  3:57                                       ` Chengchang Tang
  2021-04-12 14:10                                         ` Honnappa Nagarahalli
  2021-04-12 14:58                                       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  2021-04-14 12:58                                       ` [dpdk-dev] [PATCH v20 " Juraj Linkeš
  6 siblings, 1 reply; 465+ messages in thread
From: Chengchang Tang @ 2021-04-12  3:57 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev

On 2021/4/9 16:41, Juraj Linkeš wrote:
> The current way of specifying Arm configuration options is insufficient
> since we can't identify the SoC we're building for from the MIDR
> information. For example, we can't distinguish between N1SDP, Graviton2
> or Ampere Altra.
> 
> We also want to be able to enable/disable which drivers are built
> without user input. This is useful when building:
> 1. on an SoC that is slow and we want to build only what is necessary
>   without the user having to check which libraries they have installed
> 2. a cross build on a fast aarch64 machine but with target SoC which
>   differs in capabilities or libraries.
> This is achieved by specifying the drivers in SoC configuration.
> 
> The current implementation adds/supports the following:
> * x86 -> aarch64 cross build with added config options/enabled or
>   disabled drivers/libs
> * aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
>   option or using a cross file
> 
> v16:
> Only three commits remaining - updated the cover letter.
> Renamed the 'soc' meson option to 'platform'.
> Added the support for enabling a particular set of drivers.
> Aligned enabling and disabling with the command line option so that
> wildcards can be used.
> 
> v17:
> Removed unnecessary comments in "build: disable/enable drivers in Arm
> builds". Also always enabled two drivers which break the build if
> disabled.
> 
> v18:
> Rebased.
> 
> v19:
> Updated 3/3 with more up to date MAX_LCORE and MAX_NUMA_NODES for
> neoverse-n1.
>
It seems that our SoC configuration patches are block by this series:
https://patchwork.dpdk.org/project/dpdk/list/?series=15918

I reworked our configuration based on this series and then tested it on
our platform (i.e. Kunpeng 920/ Kunpeng 930 SoC).

Tested-by: Chengchang Tang <tangchengchang@huawei.com>

> Juraj Linkeš (3):
>   build: disable/enable drivers in Arm builds
>   build: add 'platform' meson option and Arm SoC config
>   config: fix Arm implementer and its SoCs
> 
>  config/arm/arm64_armada_linux_gcc             |   6 +-
>  config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
>  config/arm/arm64_armv8_linux_gcc              |   5 +-
>  config/arm/arm64_bluefield_linux_gcc          |   6 +-
>  config/arm/arm64_dpaa_linux_gcc               |   6 +-
>  config/arm/arm64_emag_linux_gcc               |   5 +-
>  config/arm/arm64_graviton2_linux_gcc          |   6 +-
>  config/arm/arm64_n1sdp_linux_gcc              |   6 +-
>  config/arm/arm64_n2_linux_gcc                 |   6 +-
>  config/arm/arm64_octeontx2_linux_gcc          |   6 +-
>  config/arm/arm64_stingray_linux_gcc           |   6 +-
>  config/arm/arm64_thunderx2_linux_gcc          |   5 +-
>  config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
>  config/arm/meson.build                        | 180 +++++++++++++++---
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
>  drivers/meson.build                           |  49 ++++-
>  meson.build                                   |   2 +
>  meson_options.txt                             |   4 +
>  18 files changed, 242 insertions(+), 140 deletions(-)
> 


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

* Re: [dpdk-dev] [PATCH v19 0/3] Arm build options rework
  2021-04-12  3:57                                       ` Chengchang Tang
@ 2021-04-12 14:10                                         ` Honnappa Nagarahalli
  0 siblings, 0 replies; 465+ messages in thread
From: Honnappa Nagarahalli @ 2021-04-12 14:10 UTC (permalink / raw)
  To: Chengchang Tang, Juraj Linkeš,
	bruce.richardson, Ruifeng Wang, vcchunga, Dharmik Thakkar,
	jerinjacobk, hemant.agrawal,
	Ajit Khaparde (ajit.khaparde@broadcom.com),
	ferruh.yigit, aboyer, Honnappa Nagarahalli
  Cc: dev, nd, nd

<snip>

> >
> It seems that our SoC configuration patches are block by this series:
> https://patchwork.dpdk.org/project/dpdk/list/?series=15918
Thank you and appreciate your help. Appreciate updating your patch according to this series.

> 
> I reworked our configuration based on this series and then tested it on our
> platform (i.e. Kunpeng 920/ Kunpeng 930 SoC).
> 
> Tested-by: Chengchang Tang <tangchengchang@huawei.com>
> 
> > Juraj Linkeš (3):
> >   build: disable/enable drivers in Arm builds
> >   build: add 'platform' meson option and Arm SoC config
> >   config: fix Arm implementer and its SoCs
> >
> >  config/arm/arm64_armada_linux_gcc             |   6 +-
> >  config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
> >  config/arm/arm64_armv8_linux_gcc              |   5 +-
> >  config/arm/arm64_bluefield_linux_gcc          |   6 +-
> >  config/arm/arm64_dpaa_linux_gcc               |   6 +-
> >  config/arm/arm64_emag_linux_gcc               |   5 +-
> >  config/arm/arm64_graviton2_linux_gcc          |   6 +-
> >  config/arm/arm64_n1sdp_linux_gcc              |   6 +-
> >  config/arm/arm64_n2_linux_gcc                 |   6 +-
> >  config/arm/arm64_octeontx2_linux_gcc          |   6 +-
> >  config/arm/arm64_stingray_linux_gcc           |   6 +-
> >  config/arm/arm64_thunderx2_linux_gcc          |   5 +-
> >  config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
> >  config/arm/meson.build                        | 180 +++++++++++++++---
> >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
> >  drivers/meson.build                           |  49 ++++-
> >  meson.build                                   |   2 +
> >  meson_options.txt                             |   4 +
> >  18 files changed, 242 insertions(+), 140 deletions(-)
> >


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

* Re: [dpdk-dev] [EXT]  [PATCH v19 0/3] Arm build options rework
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
                                                         ` (4 preceding siblings ...)
  2021-04-12  3:57                                       ` Chengchang Tang
@ 2021-04-12 14:58                                       ` Pavan Nikhilesh Bhagavatula
  2021-04-14 12:58                                       ` [dpdk-dev] [PATCH v20 " Juraj Linkeš
  6 siblings, 0 replies; 465+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2021-04-12 14:58 UTC (permalink / raw)
  To: Juraj Linkeš,
	bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev

Hi Juraj,

>The current way of specifying Arm configuration options is insufficient
>since we can't identify the SoC we're building for from the MIDR
>information. For example, we can't distinguish between N1SDP,
>Graviton2
>or Ampere Altra.
>
>We also want to be able to enable/disable which drivers are built
>without user input. This is useful when building:
>1. on an SoC that is slow and we want to build only what is necessary
>  without the user having to check which libraries they have installed
>2. a cross build on a fast aarch64 machine but with target SoC which
>  differs in capabilities or libraries.
>This is achieved by specifying the drivers in SoC configuration.
>
>The current implementation adds/supports the following:
>* x86 -> aarch64 cross build with added config options/enabled or
>  disabled drivers/libs
>* aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
>  option or using a cross file
>

I am unable to apply this series on main branch. I guess it has to be rebased
again?

dpdk.org  git-pw series apply 16235
Applying: build: disable/enable drivers in Arm builds
Applying: build: add 'platform' meson option and Arm SoC config
error: sha1 information is lacking or useless (config/arm/meson.build).
error: could not build fake ancestor
Patch failed at 0002 build: add 'platform' meson option and Arm SoC config
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

commit 83f9be10f237890587fb7639484ea757c20fdad8 (origin/main, origin/HEAD)
Author: Wisam Jaddo <wisamm@nvidia.com>
Date:   Sun Mar 14 11:54:27 2021 +0200

    app/flow-perf: fix encap/decap actions

>v16:
>Only three commits remaining - updated the cover letter.
>Renamed the 'soc' meson option to 'platform'.
>Added the support for enabling a particular set of drivers.
>Aligned enabling and disabling with the command line option so that
>wildcards can be used.
>
>v17:
>Removed unnecessary comments in "build: disable/enable drivers in
>Arm
>builds". Also always enabled two drivers which break the build if
>disabled.
>
>v18:
>Rebased.
>
>v19:
>Updated 3/3 with more up to date MAX_LCORE and
>MAX_NUMA_NODES for
>neoverse-n1.
>
>Juraj Linkeš (3):
>  build: disable/enable drivers in Arm builds
>  build: add 'platform' meson option and Arm SoC config
>  config: fix Arm implementer and its SoCs
>
> config/arm/arm64_armada_linux_gcc             |   6 +-
> config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
> config/arm/arm64_armv8_linux_gcc              |   5 +-
> config/arm/arm64_bluefield_linux_gcc          |   6 +-
> config/arm/arm64_dpaa_linux_gcc               |   6 +-
> config/arm/arm64_emag_linux_gcc               |   5 +-
> config/arm/arm64_graviton2_linux_gcc          |   6 +-
> config/arm/arm64_n1sdp_linux_gcc              |   6 +-
> config/arm/arm64_n2_linux_gcc                 |   6 +-
> config/arm/arm64_octeontx2_linux_gcc          |   6 +-
> config/arm/arm64_stingray_linux_gcc           |   6 +-
> config/arm/arm64_thunderx2_linux_gcc          |   5 +-
> config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
> config/arm/meson.build                        | 180 +++++++++++++++---
> .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  76 +++-----
> drivers/meson.build                           |  49 ++++-
> meson.build                                   |   2 +
> meson_options.txt                             |   4 +
> 18 files changed, 242 insertions(+), 140 deletions(-)
>
>--
>2.20.1


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

* Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-09 14:31                                             ` Bruce Richardson
  2021-04-09 15:38                                               ` Bruce Richardson
@ 2021-04-14  9:02                                               ` Juraj Linkeš
  2021-04-14  9:48                                                 ` Bruce Richardson
  1 sibling, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14  9:02 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday, April 9, 2021 4:32 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> dev@dpdk.org
> Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm builds
> 
> On Fri, Apr 09, 2021 at 02:10:08PM +0000, Juraj Linkeš wrote:
> >
> >
> > > -----Original Message-----
> > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > Sent: Friday, April 9, 2021 12:03 PM
> > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com;
> > > aboyer@pensando.io; dev@dpdk.org
> > > Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm
> > > builds
> > >
> > > On Fri, Apr 09, 2021 at 10:41:17AM +0200, Juraj Linkeš wrote:
> > > > Add support for enabling or disabling drivers for Arm cross build.
> > > > Do not implement any enable/disable lists yet.
> > > >
> > > > Enabling drivers is useful when building for an SoC where we only
> > > > want to build a few drivers. That way the list won't be too long.
> > > >
> > > > Similarly, disabling drivers is useful when we want to disable
> > > > only a few drivers.
> > > >
> > > > Both of these are advantageous mainly in aarch64 -> aarch64 (or
> > > > arch
> > > > -> same arch) builds, where the build machine may have the
> > > > -> required
> > > > driver dependencies, yet we don't want to build drivers for a specific SoC.
> > > >
> > > > By default, build all drivers for which dependencies are found. If
> > > > enabled_drivers is a non-empty list, build only those drivers.  If
> > > > disabled_drivers is non-empty list, build all drivers except those
> > > > in disabled_drivers. Error out if both are specified (i.e. do not
> > > > support that case).
> > > >
> > > > There are two drivers, bus/pci and bus/vdev, which break the build
> > > > if not enabled. Address this by always enabling these if the user
> > > > disables them or doesn't specify in their allowlist.
> > > >
> > > > Also remove the old Makefile arm configuration options which don't
> > > > do anything in Meson.
> > > >
> > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > >
> > > I think this patch has changed since I last acked it. Further review below.
> > >
> > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > > > ---
> > > >  config/arm/meson.build                        |  4 --
> > > >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
> > > >  drivers/meson.build                           | 49 +++++++++++++++++--
> > > >  meson.build                                   |  2 +
> > > >  meson_options.txt                             |  2 +
> > > >  5 files changed, 56 insertions(+), 9 deletions(-)
> > > >
> > > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > > 00bc4610a3..a241c45d13 100644
> > > > --- a/config/arm/meson.build
> > > > +++ b/config/arm/meson.build
> > > > @@ -16,9 +16,6 @@ flags_common = [
> > > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > >
> > > > -	['RTE_NET_FM10K', false],
> > > > -	['RTE_NET_AVP', false],
> > > > -
> > > >  	['RTE_SCHED_VECTOR', false],
> > > >  	['RTE_ARM_USE_WFE', false],
> > > >  	['RTE_ARCH_ARM64', true],
> > > > @@ -125,7 +122,6 @@ implementer_cavium = {
> > > >  				['RTE_MACHINE', '"octeontx2"'],
> > > >  				['RTE_ARM_FEATURE_ATOMICS', true],
> > > >  				['RTE_USE_C11_MEM_MODEL', true],
> > > > -				['RTE_EAL_IGB_UIO', false],
> > > >  				['RTE_MAX_LCORE', 36],
> > > >  				['RTE_MAX_NUMA_NODES', 1]
> > > >  			]
> > > > 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 faaf24b95b..1504dbfef0 100644
> > > > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > @@ -234,3 +234,11 @@ There are other options you may specify in a
> > > > cross
> > > file to tailor the build::
> > > >        numa = false        # set to false to force building for a non-NUMA
> system
> > > >           # if not set or set to true, the build system will build for a NUMA
> > > >           # system only if libnuma is installed
> > > > +
> > > > +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> > > > +         # valid values are dir/subdirs in the drivers directory
> > > > +         # wildcards are allowed
> > > > +
> > > > +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> > > > +         # valid values are dir/subdirs in the drivers directory
> > > > +         # wildcards are allowed
> > > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > > 9c8eded697..be5fd2df88 100644
> > > > --- a/drivers/meson.build
> > > > +++ b/drivers/meson.build
> > > > @@ -19,8 +19,39 @@ subdirs = [
> > > >  	'baseband', # depends on common and bus.
> > > >  ]
> > > >
> > > > -disabled_drivers = run_command(list_dir_globs,
> get_option('disable_drivers'),
> > > > -		).stdout().split()
> > > > +always_enabled = ['bus/pci', 'bus/vdev']
> > > > +
> > > > +if meson.is_cross_build()
> > > > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > > > +	enabled_drivers += meson.get_cross_property('enabled_drivers',
> > > > +[]) endif
> > >
> > > I don't think "+=" is correct here. This is the first use of the
> > > disabled_drivers variable. [Sorry, correction, I see you've added a
> > > new definition of it in the top- level meson.build. I think it's
> > > better to move that to this file]
> > >
> >
> > This need not be true. It's added in config/arm/meson.build in the subsequent
> patch, which comes before drivers/meson.build, which is why I structured it this
> way - I don't think there's a reason to move the initialization around in the same
> series, but I could do that.
> 
> Ok, I did not realise that. I need to look at how they are used in that file.
> 
> >
> > > Also, would it not be better to have the cross-file option the same
> > > as that used in the parameter option? Right now you have the
> > > cross-file option as "disabled_drivers" vs cmdline option
> > > "disable_drivers" and the types being list and string respectively
> > > too. Why not have the cross-file option be a string called
> > > "disable_drivers" too? It would save some joining an array/string conversion
> below and simplify things.
> > >
> >
> > The name can be the same. The reason I have two different types is that it
> struck me as more user friendly - specifying something in code is more intuitive
> as list as opposed to comma-delimited string, whereas it's more intuitive as
> comma-delimited string on cmdline. It's possible that having a comma-delimited
> string everywhere is actually better anyway - I'll change it.
> >
> > > > +
> > > > +# add cmdline disabled drivers (comma separated string) # and
> > > > +meson disabled drivers (list) # together into a comma separated
> > > > +string disabled_drivers =
> > > > +','.join([get_option('disable_drivers'),
> > > > +','.join(disabled_drivers)]).strip(',')
> > >
> > > Do we need the string at the end here? I would think that join never
> > > adds a trailing comma? As stated above if these were both strings it
> > > might make things shorter and easier.
> > >
> >
> > If we're joining two empty strings (which happens when neither the cmdline
> nor the code list is specified), then we'll end up with a singular comma instead of
> an empty string.
> >
> > Even then both of these are strings (which I'll change), we'll still need the strip,
> as the above scenario would still happen.
> 
> Ok, didn't realise that the trailing "," will still be present. However, I think a
> better fix for this, and the issue below with "." being printed in the empty case is
> to add the following to buildtools/list-dir-globs.py:
> 
> @@ -14,6 +14,8 @@
>                      os.getenv('MESON_SUBDIR', '.'))
> 
>  for path in sys.argv[1].split(','):
> +    if not path:
> +        continue
>      for p in iglob(os.path.join(root, path)):
>          if os.path.isdir(p):
>              print(os.path.relpath(p))
> 
> With that added, we don't need to worry about null strings or and trailing
> commas and can just do:
> disabled_drivers += ',' + get_option('disable_drivers')
> 

Great, this is the sort of review I was hoping to get. This is much more elegant.

> >
> > > > +if disabled_drivers != ''
> > > > +	disabled_drivers = run_command(list_dir_globs,
> > > > +		disabled_drivers).stdout().split()
> > > > +else
> > > > +	disabled_drivers = []
> > > > +endif
> > >
> > > Don't think we need the "if/else" here. The existing code works fine
> > > with taking an empty array.
> > >
> >
> > An empty string results in ['.'], not in []. I ran into problems with allowlists
> when ['.'] is returned - I'm assuming that the allowlist is either empty or
> whathever is in the allowlist means something and '.' is meaningless since it's not
> a driver. This was the most straightforward solution I found. For disabled drivers
> we don't need this, but I did the same thing for consistency.
> >
> 
> I think the above two-line change to the globs script should fix this.
> 

Right, it should.

> > > > +
> > > > +# add cmdline enabled drivers (comma separated string) # and
> > > > +meson enabled drivers (list) # together into a comma separated
> > > > +string enabled_drivers = ','.join([get_option('enable_drivers'),
> > > > +','.join(enabled_drivers)]).strip(',')
> > > > +if enabled_drivers != ''
> > > > +	enabled_drivers = run_command(list_dir_globs,
> > > > +		enabled_drivers).stdout().split() else
> > > > +	enabled_drivers = []
> > > > +endif
> > > > +
> > > > +if disabled_drivers != [] and enabled_drivers != []
> > > > +	error('Simultaneous disabled drivers and enabled drivers ' +
> > > > +	      'configuration is not supported.') endif
> > >
> > > For use in cross-files this makes sense, but I'm not sure it's the
> > > correct approach for when a cross-file specifies enable and the user
> > > specifies disable on the cmdline. In that case, the enable list
> > > should just have the disabled values removed from it. Therefore, I
> > > suggest having this check only in the cross-build section.
> > >
> >
> > Do you want to distinguish between enabling/disabling driver when cross
> compiling and when doing a regular build? From the previous discussion, I
> thought we didn't want to mix enable/disable lists no matter what the build or
> source is. The different scenarios in my mind are combinations of:
> > 1. cross/regular build
> > 2. no list, just enable list, just disable list, both lists 3. where a
> > list is specified - cmdline or meson code (soc config or cross file)
> >
> > These give us quite a number of different scenarios. When do we want to
> allow the mixing of enable/disable lists and when not? It's not clear to me from
> your description, but it seems that specifying a list on the cmdline should
> overwrite or supplement either an enable or disable list specified in code - we
> would allow just one of these in code and then augment that with cmdline.
> >
> 
> It's got quite a complicated number of scenarios, I admit.
> One thought, though not sure if it would work, is to always check
> enabled_drivers and disabled_drivers. If no enable_drivers option in cross-file or
> cmdline, we initialize the value to "list_dir_globs *.*", i.e. everything enabled.
> Similarly, if no disable_driver options provided, we use an empty list.
> 
> Thereafter in the main loop we just check for each driver that it is in the enable
> list and not in the disabled one.
> 
> Does that seem like it would work?

I think it would work and it would mean that we'd allow using both enable lists and disable lists for all scenarios. Is that intentional?

> 
> /Bruce


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

* Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-09 15:38                                               ` Bruce Richardson
@ 2021-04-14  9:09                                                 ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14  9:09 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday, April 9, 2021 5:38 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm
> builds
> 
> On Fri, Apr 09, 2021 at 03:31:31PM +0100, Bruce Richardson wrote:
> > On Fri, Apr 09, 2021 at 02:10:08PM +0000, Juraj Linkeš wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > Sent: Friday, April 9, 2021 12:03 PM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > > Phil.Yang@arm.com; vcchunga@amazon.com;
> Dharmik.Thakkar@arm.com;
> > > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > > > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com;
> > > > aboyer@pensando.io; dev@dpdk.org
> > > > Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm
> > > > builds
> > > >
> > > > On Fri, Apr 09, 2021 at 10:41:17AM +0200, Juraj Linkeš wrote:
> > > > > Add support for enabling or disabling drivers for Arm cross
> > > > > build. Do not implement any enable/disable lists yet.
> > > > >
> > > > > Enabling drivers is useful when building for an SoC where we
> > > > > only want to build a few drivers. That way the list won't be too long.
> > > > >
> > > > > Similarly, disabling drivers is useful when we want to disable
> > > > > only a few drivers.
> > > > >
> > > > > Both of these are advantageous mainly in aarch64 -> aarch64 (or
> > > > > arch
> > > > > -> same arch) builds, where the build machine may have the
> > > > > -> required
> > > > > driver dependencies, yet we don't want to build drivers for a specific SoC.
> > > > >
> > > > > By default, build all drivers for which dependencies are found.
> > > > > If enabled_drivers is a non-empty list, build only those
> > > > > drivers.  If disabled_drivers is non-empty list, build all
> > > > > drivers except those in disabled_drivers. Error out if both are
> > > > > specified (i.e. do not support that case).
> > > > >
> > > > > There are two drivers, bus/pci and bus/vdev, which break the
> > > > > build if not enabled. Address this by always enabling these if
> > > > > the user disables them or doesn't specify in their allowlist.
> > > > >
> > > > > Also remove the old Makefile arm configuration options which
> > > > > don't do anything in Meson.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > >
> > > > I think this patch has changed since I last acked it. Further review below.
> > > >
> > > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > > > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > > > > ---
> > > > >  config/arm/meson.build                        |  4 --
> > > > >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
> > > > >  drivers/meson.build                           | 49 +++++++++++++++++--
> > > > >  meson.build                                   |  2 +
> > > > >  meson_options.txt                             |  2 +
> > > > >  5 files changed, 56 insertions(+), 9 deletions(-)
> > > > >
> > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build
> > > > > index
> > > > > 00bc4610a3..a241c45d13 100644
> > > > > --- a/config/arm/meson.build
> > > > > +++ b/config/arm/meson.build
> > > > > @@ -16,9 +16,6 @@ flags_common = [
> > > > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > > > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > > >
> > > > > -	['RTE_NET_FM10K', false],
> > > > > -	['RTE_NET_AVP', false],
> > > > > -
> > > > >  	['RTE_SCHED_VECTOR', false],
> > > > >  	['RTE_ARM_USE_WFE', false],
> > > > >  	['RTE_ARCH_ARM64', true],
> > > > > @@ -125,7 +122,6 @@ implementer_cavium = {
> > > > >  				['RTE_MACHINE', '"octeontx2"'],
> > > > >  				['RTE_ARM_FEATURE_ATOMICS', true],
> > > > >  				['RTE_USE_C11_MEM_MODEL', true],
> > > > > -				['RTE_EAL_IGB_UIO', false],
> > > > >  				['RTE_MAX_LCORE', 36],
> > > > >  				['RTE_MAX_NUMA_NODES', 1]
> > > > >  			]
> > > > > 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 faaf24b95b..1504dbfef0 100644
> > > > > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > > @@ -234,3 +234,11 @@ There are other options you may specify in
> > > > > a cross
> > > > file to tailor the build::
> > > > >        numa = false        # set to false to force building for a non-NUMA
> system
> > > > >           # if not set or set to true, the build system will build for a NUMA
> > > > >           # system only if libnuma is installed
> > > > > +
> > > > > +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> > > > > +         # valid values are dir/subdirs in the drivers directory
> > > > > +         # wildcards are allowed
> > > > > +
> > > > > +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> > > > > +         # valid values are dir/subdirs in the drivers directory
> > > > > +         # wildcards are allowed
> > > > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > > > 9c8eded697..be5fd2df88 100644
> > > > > --- a/drivers/meson.build
> > > > > +++ b/drivers/meson.build
> > > > > @@ -19,8 +19,39 @@ subdirs = [
> > > > >  	'baseband', # depends on common and bus.
> > > > >  ]
> > > > >
> > > > > -disabled_drivers = run_command(list_dir_globs,
> get_option('disable_drivers'),
> > > > > -		).stdout().split()
> > > > > +always_enabled = ['bus/pci', 'bus/vdev']
> > > > > +
> > > > > +if meson.is_cross_build()
> > > > > +	disabled_drivers +=
> meson.get_cross_property('disabled_drivers', [])
> > > > > +	enabled_drivers +=
> meson.get_cross_property('enabled_drivers',
> > > > > +[]) endif
> > > >
> > > > I don't think "+=" is correct here. This is the first use of the
> > > > disabled_drivers variable. [Sorry, correction, I see you've added
> > > > a new definition of it in the top- level meson.build. I think it's
> > > > better to move that to this file]
> > > >
> > >
> > > This need not be true. It's added in config/arm/meson.build in the
> subsequent patch, which comes before drivers/meson.build, which is why I
> structured it this way - I don't think there's a reason to move the initialization
> around in the same series, but I could do that.
> >
> > Ok, I did not realise that. I need to look at how they are used in
> > that file.
> >
> One further minor nit here is that the global array defined in the top-level
> meson.build all start with "dpdk_". This seems a good policy to follow to have
> consistent naming.

I don't really understand why the prefix is there as we're only dealing with dpdk (or not?). Or does the prefix indicate that these are "global" variables? I'll add it so it's consistent, but there's still the question of whether we want the variables in top-level meson.build or in config/meson.build. I don't think we're going to do anything in the buildtools dir with them, so config/meson.build now seems like the best place to me - it is a variable affecting config. And then the vars could be without the prefix and have the same name as the build option.

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

* Re: [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds
  2021-04-14  9:02                                               ` Juraj Linkeš
@ 2021-04-14  9:48                                                 ` Bruce Richardson
  0 siblings, 0 replies; 465+ messages in thread
From: Bruce Richardson @ 2021-04-14  9:48 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev

On Wed, Apr 14, 2021 at 09:02:16AM +0000, Juraj Linkeš wrote:
> 
> 
> > -----Original Message-----
> > From: Bruce Richardson <bruce.richardson@intel.com>
> > Sent: Friday, April 9, 2021 4:32 PM
> > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> > dev@dpdk.org
> > Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm builds
> > 
> > On Fri, Apr 09, 2021 at 02:10:08PM +0000, Juraj Linkeš wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bruce Richardson <bruce.richardson@intel.com>
> > > > Sent: Friday, April 9, 2021 12:03 PM
> > > > To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> > > > Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> > > > jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> > > > ajit.khaparde@broadcom.com; ferruh.yigit@intel.com;
> > > > aboyer@pensando.io; dev@dpdk.org
> > > > Subject: Re: [PATCH v19 1/3] build: disable/enable drivers in Arm
> > > > builds
> > > >
> > > > On Fri, Apr 09, 2021 at 10:41:17AM +0200, Juraj Linkeš wrote:
> > > > > Add support for enabling or disabling drivers for Arm cross build.
> > > > > Do not implement any enable/disable lists yet.
> > > > >
> > > > > Enabling drivers is useful when building for an SoC where we only
> > > > > want to build a few drivers. That way the list won't be too long.
> > > > >
> > > > > Similarly, disabling drivers is useful when we want to disable
> > > > > only a few drivers.
> > > > >
> > > > > Both of these are advantageous mainly in aarch64 -> aarch64 (or
> > > > > arch
> > > > > -> same arch) builds, where the build machine may have the
> > > > > -> required
> > > > > driver dependencies, yet we don't want to build drivers for a specific SoC.
> > > > >
> > > > > By default, build all drivers for which dependencies are found. If
> > > > > enabled_drivers is a non-empty list, build only those drivers.  If
> > > > > disabled_drivers is non-empty list, build all drivers except those
> > > > > in disabled_drivers. Error out if both are specified (i.e. do not
> > > > > support that case).
> > > > >
> > > > > There are two drivers, bus/pci and bus/vdev, which break the build
> > > > > if not enabled. Address this by always enabling these if the user
> > > > > disables them or doesn't specify in their allowlist.
> > > > >
> > > > > Also remove the old Makefile arm configuration options which don't
> > > > > do anything in Meson.
> > > > >
> > > > > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > > > > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > > >
> > > > I think this patch has changed since I last acked it. Further review below.
> > > >
> > > > > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > > > > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > > > > ---
> > > > >  config/arm/meson.build                        |  4 --
> > > > >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++
> > > > >  drivers/meson.build                           | 49 +++++++++++++++++--
> > > > >  meson.build                                   |  2 +
> > > > >  meson_options.txt                             |  2 +
> > > > >  5 files changed, 56 insertions(+), 9 deletions(-)
> > > > >
> > > > > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > > > > 00bc4610a3..a241c45d13 100644
> > > > > --- a/config/arm/meson.build
> > > > > +++ b/config/arm/meson.build
> > > > > @@ -16,9 +16,6 @@ flags_common = [
> > > > >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> > > > >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> > > > >
> > > > > -	['RTE_NET_FM10K', false],
> > > > > -	['RTE_NET_AVP', false],
> > > > > -
> > > > >  	['RTE_SCHED_VECTOR', false],
> > > > >  	['RTE_ARM_USE_WFE', false],
> > > > >  	['RTE_ARCH_ARM64', true],
> > > > > @@ -125,7 +122,6 @@ implementer_cavium = {
> > > > >  				['RTE_MACHINE', '"octeontx2"'],
> > > > >  				['RTE_ARM_FEATURE_ATOMICS', true],
> > > > >  				['RTE_USE_C11_MEM_MODEL', true],
> > > > > -				['RTE_EAL_IGB_UIO', false],
> > > > >  				['RTE_MAX_LCORE', 36],
> > > > >  				['RTE_MAX_NUMA_NODES', 1]
> > > > >  			]
> > > > > 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 faaf24b95b..1504dbfef0 100644
> > > > > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > > > > @@ -234,3 +234,11 @@ There are other options you may specify in a
> > > > > cross
> > > > file to tailor the build::
> > > > >        numa = false        # set to false to force building for a non-NUMA
> > system
> > > > >           # if not set or set to true, the build system will build for a NUMA
> > > > >           # system only if libnuma is installed
> > > > > +
> > > > > +      disabled_drivers = ['bus/dpaa', 'crypto/*']  # add disabled drivers
> > > > > +         # valid values are dir/subdirs in the drivers directory
> > > > > +         # wildcards are allowed
> > > > > +
> > > > > +      enabled_drivers = ['common/*', 'bus/*']  # build only these drivers
> > > > > +         # valid values are dir/subdirs in the drivers directory
> > > > > +         # wildcards are allowed
> > > > > diff --git a/drivers/meson.build b/drivers/meson.build index
> > > > > 9c8eded697..be5fd2df88 100644
> > > > > --- a/drivers/meson.build
> > > > > +++ b/drivers/meson.build
> > > > > @@ -19,8 +19,39 @@ subdirs = [
> > > > >  	'baseband', # depends on common and bus.
> > > > >  ]
> > > > >
> > > > > -disabled_drivers = run_command(list_dir_globs,
> > get_option('disable_drivers'),
> > > > > -		).stdout().split()
> > > > > +always_enabled = ['bus/pci', 'bus/vdev']
> > > > > +
> > > > > +if meson.is_cross_build()
> > > > > +	disabled_drivers += meson.get_cross_property('disabled_drivers', [])
> > > > > +	enabled_drivers += meson.get_cross_property('enabled_drivers',
> > > > > +[]) endif
> > > >
> > > > I don't think "+=" is correct here. This is the first use of the
> > > > disabled_drivers variable. [Sorry, correction, I see you've added a
> > > > new definition of it in the top- level meson.build. I think it's
> > > > better to move that to this file]
> > > >
> > >
> > > This need not be true. It's added in config/arm/meson.build in the subsequent
> > patch, which comes before drivers/meson.build, which is why I structured it this
> > way - I don't think there's a reason to move the initialization around in the same
> > series, but I could do that.
> > 
> > Ok, I did not realise that. I need to look at how they are used in that file.
> > 
> > >
> > > > Also, would it not be better to have the cross-file option the same
> > > > as that used in the parameter option? Right now you have the
> > > > cross-file option as "disabled_drivers" vs cmdline option
> > > > "disable_drivers" and the types being list and string respectively
> > > > too. Why not have the cross-file option be a string called
> > > > "disable_drivers" too? It would save some joining an array/string conversion
> > below and simplify things.
> > > >
> > >
> > > The name can be the same. The reason I have two different types is that it
> > struck me as more user friendly - specifying something in code is more intuitive
> > as list as opposed to comma-delimited string, whereas it's more intuitive as
> > comma-delimited string on cmdline. It's possible that having a comma-delimited
> > string everywhere is actually better anyway - I'll change it.
> > >
> > > > > +
> > > > > +# add cmdline disabled drivers (comma separated string) # and
> > > > > +meson disabled drivers (list) # together into a comma separated
> > > > > +string disabled_drivers =
> > > > > +','.join([get_option('disable_drivers'),
> > > > > +','.join(disabled_drivers)]).strip(',')
> > > >
> > > > Do we need the string at the end here? I would think that join never
> > > > adds a trailing comma? As stated above if these were both strings it
> > > > might make things shorter and easier.
> > > >
> > >
> > > If we're joining two empty strings (which happens when neither the cmdline
> > nor the code list is specified), then we'll end up with a singular comma instead of
> > an empty string.
> > >
> > > Even then both of these are strings (which I'll change), we'll still need the strip,
> > as the above scenario would still happen.
> > 
> > Ok, didn't realise that the trailing "," will still be present. However, I think a
> > better fix for this, and the issue below with "." being printed in the empty case is
> > to add the following to buildtools/list-dir-globs.py:
> > 
> > @@ -14,6 +14,8 @@
> >                      os.getenv('MESON_SUBDIR', '.'))
> > 
> >  for path in sys.argv[1].split(','):
> > +    if not path:
> > +        continue
> >      for p in iglob(os.path.join(root, path)):
> >          if os.path.isdir(p):
> >              print(os.path.relpath(p))
> > 
> > With that added, we don't need to worry about null strings or and trailing
> > commas and can just do:
> > disabled_drivers += ',' + get_option('disable_drivers')
> > 
> 
> Great, this is the sort of review I was hoping to get. This is much more elegant.
> 
> > >
> > > > > +if disabled_drivers != ''
> > > > > +	disabled_drivers = run_command(list_dir_globs,
> > > > > +		disabled_drivers).stdout().split()
> > > > > +else
> > > > > +	disabled_drivers = []
> > > > > +endif
> > > >
> > > > Don't think we need the "if/else" here. The existing code works fine
> > > > with taking an empty array.
> > > >
> > >
> > > An empty string results in ['.'], not in []. I ran into problems with allowlists
> > when ['.'] is returned - I'm assuming that the allowlist is either empty or
> > whathever is in the allowlist means something and '.' is meaningless since it's not
> > a driver. This was the most straightforward solution I found. For disabled drivers
> > we don't need this, but I did the same thing for consistency.
> > >
> > 
> > I think the above two-line change to the globs script should fix this.
> > 
> 
> Right, it should.
> 
> > > > > +
> > > > > +# add cmdline enabled drivers (comma separated string) # and
> > > > > +meson enabled drivers (list) # together into a comma separated
> > > > > +string enabled_drivers = ','.join([get_option('enable_drivers'),
> > > > > +','.join(enabled_drivers)]).strip(',')
> > > > > +if enabled_drivers != ''
> > > > > +	enabled_drivers = run_command(list_dir_globs,
> > > > > +		enabled_drivers).stdout().split() else
> > > > > +	enabled_drivers = []
> > > > > +endif
> > > > > +
> > > > > +if disabled_drivers != [] and enabled_drivers != []
> > > > > +	error('Simultaneous disabled drivers and enabled drivers ' +
> > > > > +	      'configuration is not supported.') endif
> > > >
> > > > For use in cross-files this makes sense, but I'm not sure it's the
> > > > correct approach for when a cross-file specifies enable and the user
> > > > specifies disable on the cmdline. In that case, the enable list
> > > > should just have the disabled values removed from it. Therefore, I
> > > > suggest having this check only in the cross-build section.
> > > >
> > >
> > > Do you want to distinguish between enabling/disabling driver when cross
> > compiling and when doing a regular build? From the previous discussion, I
> > thought we didn't want to mix enable/disable lists no matter what the build or
> > source is. The different scenarios in my mind are combinations of:
> > > 1. cross/regular build
> > > 2. no list, just enable list, just disable list, both lists 3. where a
> > > list is specified - cmdline or meson code (soc config or cross file)
> > >
> > > These give us quite a number of different scenarios. When do we want to
> > allow the mixing of enable/disable lists and when not? It's not clear to me from
> > your description, but it seems that specifying a list on the cmdline should
> > overwrite or supplement either an enable or disable list specified in code - we
> > would allow just one of these in code and then augment that with cmdline.
> > >
> > 
> > It's got quite a complicated number of scenarios, I admit.
> > One thought, though not sure if it would work, is to always check
> > enabled_drivers and disabled_drivers. If no enable_drivers option in cross-file or
> > cmdline, we initialize the value to "list_dir_globs *.*", i.e. everything enabled.
> > Similarly, if no disable_driver options provided, we use an empty list.
> > 
> > Thereafter in the main loop we just check for each driver that it is in the enable
> > list and not in the disabled one.
> > 
> > Does that seem like it would work?
> 
> I think it would work and it would mean that we'd allow using both enable lists and disable lists for all scenarios. Is that intentional?
> 

I think it's necessary to have sane behaviour myself. However, we can still
limit the use to not both together if it causes problems. My main concern
is how to manage overriding via options any values in the cross-files,
ideally without modifying the files, and this seemed a good way.

/Bruce

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

* [dpdk-dev] [PATCH v20 0/3] Arm build options rework
  2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
                                                         ` (5 preceding siblings ...)
  2021-04-12 14:58                                       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
@ 2021-04-14 12:58                                       ` Juraj Linkeš
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
                                                           ` (3 more replies)
  6 siblings, 4 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 12:58 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

We also want to be able to enable/disable which drivers are built
without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/enabled or
  disabled drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
  option or using a cross file

v16:
Only three commits remaining - updated the cover letter.
Renamed the 'soc' meson option to 'platform'.
Added the support for enabling a particular set of drivers.
Aligned enabling and disabling with the command line option so that
wildcards can be used.

v17:
Removed unnecessary comments in "build: disable/enable drivers in Arm
builds". Also always enabled two drivers which break the build if
disabled.

v18:
Rebased.

v19:
Updated 3/3 with more up to date MAX_LCORE and MAX_NUMA_NODES for
neoverse-n1.

v20:
Simplified allowlist and blocklist implementation in 1/3 and updated 2/3
accordingly.

Juraj Linkeš (3):
  build: disable/enable drivers in Arm builds
  build: add 'platform' meson option and Arm SoC config
  config: fix Arm implementer and its SoCs

 buildtools/list-dir-globs.py                  |   7 +-
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 177 +++++++++++++++---
 config/meson.build                            |   4 +
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 104 +++++-----
 drivers/common/qat/meson.build                |   4 +-
 drivers/meson.build                           |  32 +++-
 meson_options.txt                             |   4 +
 20 files changed, 259 insertions(+), 144 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds
  2021-04-14 12:58                                       ` [dpdk-dev] [PATCH v20 " Juraj Linkeš
@ 2021-04-14 12:58                                         ` Juraj Linkeš
  2021-04-14 13:27                                           ` Bruce Richardson
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
                                                           ` (2 subsequent siblings)
  3 siblings, 1 reply; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 12:58 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add support for enabling or disabling drivers for Arm cross build. Do
not implement any enable/disable lists yet.

Enabling drivers is useful when building for an SoC where we only want
to build a few drivers. That way the list won't be too long.

Similarly, disabling drivers is useful when we want to disable only a
few drivers.

Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
same arch) builds, where the build machine may have the required driver
dependencies, yet we don't want to build drivers for a specific SoC.

If enable_drivers is a non-empty list, build only those drivers,
otherwise build all drivers and add them to enable_drivers.  If
disable_drivers is non-empty list, build all drivers specified in
enable_drivers except those in disable_drivers.

There are two drivers, bus/pci and bus/vdev, which break the build if
not enabled. Address this by always enabling these if the user disables
them or doesn't specify in their allowlist.

Also remove the old Makefile arm configuration options which don't do
anything in Meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 buildtools/list-dir-globs.py                  |  7 ++--
 config/arm/meson.build                        |  4 ---
 config/meson.build                            |  4 +++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++++
 drivers/common/qat/meson.build                |  4 +--
 drivers/meson.build                           | 32 ++++++++++++++++---
 meson_options.txt                             |  2 ++
 7 files changed, 48 insertions(+), 13 deletions(-)

diff --git a/buildtools/list-dir-globs.py b/buildtools/list-dir-globs.py
index 80b5e801f2..911e267335 100755
--- a/buildtools/list-dir-globs.py
+++ b/buildtools/list-dir-globs.py
@@ -14,6 +14,7 @@
                     os.getenv('MESON_SUBDIR', '.'))
 
 for path in sys.argv[1].split(','):
-    for p in iglob(os.path.join(root, path)):
-        if os.path.isdir(p):
-            print(os.path.relpath(p))
+    if path:
+        for p in iglob(os.path.join(root, path)):
+            if os.path.isdir(p):
+                print(os.path.relpath(p))
diff --git a/config/arm/meson.build b/config/arm/meson.build
index aaed89bd5b..2984ae2db3 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -17,9 +17,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -126,7 +123,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
diff --git a/config/meson.build b/config/meson.build
index 3268cf6804..6e6ef8c0e1 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -63,6 +63,10 @@ if not is_windows
 			pmd_subdir_opt)
 endif
 
+# init disable/enable driver lists that will be populated in different places
+disable_drivers = ''
+enable_drivers = ''
+
 # set the machine type and cflags for it
 if meson.is_cross_build()
 	machine = host_machine.cpu()
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 faaf24b95b..9b9e8ef704 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
       numa = false        # set to false to force building for a non-NUMA system
          # if not set or set to true, the build system will build for a NUMA
          # system only if libnuma is installed
+
+      disable_drivers = 'bus/dpaa,crypto/*'  # add disabled drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
+
+      enable_drivers = 'common/*,bus/*'  # build only these drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build
index 3ad7dd5017..fe278f734f 100644
--- a/drivers/common/qat/meson.build
+++ b/drivers/common/qat/meson.build
@@ -14,13 +14,13 @@ qat_compress = true
 qat_compress_path = 'compress/qat'
 qat_compress_relpath = '../../' + qat_compress_path
 
-if disabled_drivers.contains(qat_crypto_path)
+if disable_drivers.contains(qat_crypto_path)
 	qat_crypto = false
 	dpdk_drvs_disabled += qat_crypto_path
 	set_variable(qat_crypto_path.underscorify() + '_disable_reason',
 			'Explicitly disabled via build config')
 endif
-if disabled_drivers.contains(qat_compress_path)
+if disable_drivers.contains(qat_compress_path)
 	qat_compress = false
 	dpdk_drvs_disabled += qat_compress_path
 	set_variable(qat_compress_path.underscorify() + '_disable_reason',
diff --git a/drivers/meson.build b/drivers/meson.build
index 45af8749da..00fe70452d 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -20,8 +20,25 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
-		).stdout().split()
+if meson.is_cross_build()
+	disable_drivers += ',' + meson.get_cross_property('disable_drivers', [])
+	enable_drivers += ',' + meson.get_cross_property('enable_drivers', [])
+endif
+
+# add cmdline disabled drivers and meson disabled drivers together
+disable_drivers += ',' + get_option('disable_drivers')
+disable_drivers = run_command(list_dir_globs, disable_drivers).stdout().split()
+
+# add cmdline enabled drivers and meson enabled drivers together
+enable_drivers = ',' + get_option('enable_drivers')
+enable_drivers = run_command(list_dir_globs, enable_drivers).stdout().split()
+if enable_drivers.length() == 0
+	enable_drivers = run_command(list_dir_globs, '*/*').stdout().split()
+endif
+
+# these drivers must always be enabled, otherwise the build breaks
+always_enable = ['bus/pci', 'bus/vdev']
+enable_drivers += always_enable
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -75,9 +92,16 @@ foreach subpath:subdirs
 		ext_deps = []
 		pkgconfig_extra_libs = []
 
-		if disabled_drivers.contains(drv_path)
+		if not enable_drivers.contains(drv_path)
 			build = false
-			reason = 'explicitly disabled via build config'
+			reason = 'not in enabled drivers build config'
+		elif disable_drivers.contains(drv_path)
+			if always_enable.contains(drv_path)
+				message('Driver @0@ cannot be disabled, not disabling.'.format(drv_path))
+			else
+				build = false
+				reason = 'explicitly disabled via build config'
+			endif
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
diff --git a/meson_options.txt b/meson_options.txt
index fa207cbada..e1dc351620 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,6 +10,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
 	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false,
 	description: 'build documentation')
+option('enable_drivers', type: 'string', value: '',
+	description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false,
 	description: 'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v20 2/3] build: add 'platform' meson option and Arm SoC config
  2021-04-14 12:58                                       ` [dpdk-dev] [PATCH v20 " Juraj Linkeš
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-14 12:58                                         ` Juraj Linkeš
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
  2021-04-14 13:41                                         ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Juraj Linkeš
  3 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 12:58 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration sets to Arm meson.build and add an arch
agnostic meson option, 'platform', to select from these SoC
configurations for meson native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 137 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 112 +++++++-------
 meson_options.txt                             |   2 +
 16 files changed, 204 insertions(+), 118 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 9958db6692..301418949b 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'armada'
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804 b/config/arm/arm64_armv8_linux_clang_ubuntu1804
index 57095c1304..db488d75f4 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu1804
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
@@ -14,7 +14,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'generic'
-part_number = 'generic'
+platform = 'generic'
 c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-gnu']
 c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da1..5391d35389 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+platform = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd4..248a9f031a 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c7628..e9d5fd31fc 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb055106..9cdd931180 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+platform = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index edacb79497..8016fd236c 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef7..0df283e2f4 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+platform = 'n1sdp'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 817b8ee28e..036aee2b0a 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd49'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'n2'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 5937697098..9156ee5410 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+platform = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd4..319a4a151d 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b3..69c71cbc82 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+platform = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e48..372097ba01 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+platform = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 2984ae2db3..c484fe26c0 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -26,7 +26,7 @@ flags_common = [
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -193,6 +193,106 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_n2 = {
+	'description': 'Arm Neoverse N2',
+	'implementer': '0x41',
+	'part_number': '0xd49',
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'n2': soc_n2,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -204,11 +304,19 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
+	soc = get_option('platform')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if soc != ''
+				error('Building for a particular platform is ' +
+				      'unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif soc != ''
+			soc_config = socs.get(soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -226,8 +334,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		soc = meson.get_cross_property('platform', '')
+		if soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+
+		disable_drivers += ',' + soc_config.get('disable_drivers', '')
+		enable_drivers += ',' + soc_config.get('enable_drivers', '')
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -253,8 +380,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use common flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add/overwrite flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 9b9e8ef704..b6c1ec4c95 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -187,58 +187,60 @@ Use the following command to cross-compile DPDK for the target machine::
    meson aarch64-build-clang --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804
    ninja -C aarch64-build-clang
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
-
-      disable_drivers = 'bus/dpaa,crypto/*'  # add disabled drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
-
-      enable_drivers = 'common/*,bus/*'  # build only these drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Dplatform meson
+option::
+
+   meson soc_build -Dplatform=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   platform = 'generic'
+
+Supported SoC configuration
+---------------------------
+
+The SoC configuration is a combination of implementer and cpu part number
+configuration and SoC-specific configuration::
+
+   soc_<name> = {
+      'description': 'SoC Description',  # mandatory
+      'implementer': <implementer_id>,   # mandatory
+      'part_number': <part_number>,      # mandatory
+      'numa': false,  # optional, specify for non-NUMA SoCs
+      'enable_drivers': 'common/*,bus/*',  # optional, comma-separated list of
+                              # drivers to build, wildcards are accepted
+      'disable_drivers': 'crypto/*',       # optional, comma-separated list of
+                              # drivers to disable, wildcards are accepted
+      'flags': [
+         ['RTE_MAX_LCORE', '16'],
+         ['RTE_MAX_NUMA_NODES', '1']
+      ]               # optional, list of DPDK options that will be added
+                      # or overwritten
+   }
+
+   Where <implementer_id> if a key defined in the implementers dictionary in
+   config/arm/meson.build (e.g. 0x41) and part_number is a key defined in
+   implementers[<implementer_id>]['part_number_config'] dictionary (i.e. the
+   part number must be defined for the implementer, e.g. for 0x41 a valid value
+   is 0xd49, which is the neoverse-n2 SoC).
diff --git a/meson_options.txt b/meson_options.txt
index e1dc351620..f08dc5322e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -34,6 +34,8 @@ option('max_lcores', type: 'integer', value: 128,
 	description: 'maximum number of cores/threads supported by EAL')
 option('max_numa_nodes', type: 'integer', value: 32,
 	description: 'maximum number of NUMA nodes supported by EAL')
+option('platform', type: 'string', value: '',
+	description: 'Use configuration for a particular platform (such as an Arm SoC).')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v20 3/3] config: fix Arm implementer and its SoCs
  2021-04-14 12:58                                       ` [dpdk-dev] [PATCH v20 " Juraj Linkeš
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-04-14 12:58                                         ` Juraj Linkeš
  2021-04-14 13:41                                         ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Juraj Linkeš
  3 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 12:58 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Also increase the neoverse-n1 MAX_LCORE and MAX_NUMA_NODES to reflect
new available hardware (Amplere Altra).
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 config/arm/meson.build | 60 +++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 33 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index c484fe26c0..1b7c4c1cc6 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -57,7 +57,8 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80]
+			['RTE_MAX_LCORE', 160],
+			['RTE_MAX_NUMA_NODES', 2]
 		]
 	},
 	'0xd49': {
@@ -65,7 +66,8 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_MAX_LCORE', 64]
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	}
 }
@@ -75,8 +77,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -158,39 +160,13 @@ implementer_qualcomm = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
 	'0x50': implementer_ampere,
-	'0x51': implementer_qualcomm,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x51': implementer_qualcomm
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -203,8 +179,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -212,13 +192,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -262,6 +252,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-14 13:27                                           ` Bruce Richardson
  2021-04-14 13:33                                             ` Juraj Linkeš
  0 siblings, 1 reply; 465+ messages in thread
From: Bruce Richardson @ 2021-04-14 13:27 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev

On Wed, Apr 14, 2021 at 02:58:36PM +0200, Juraj Linkeš wrote:
> Add support for enabling or disabling drivers for Arm cross build. Do
> not implement any enable/disable lists yet.
> 
> Enabling drivers is useful when building for an SoC where we only want
> to build a few drivers. That way the list won't be too long.
> 
> Similarly, disabling drivers is useful when we want to disable only a
> few drivers.
> 
> Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
> same arch) builds, where the build machine may have the required driver
> dependencies, yet we don't want to build drivers for a specific SoC.
> 
> If enable_drivers is a non-empty list, build only those drivers,
> otherwise build all drivers and add them to enable_drivers.  If
> disable_drivers is non-empty list, build all drivers specified in
> enable_drivers except those in disable_drivers.
> 
> There are two drivers, bus/pci and bus/vdev, which break the build if
> not enabled. Address this by always enabling these if the user disables
> them or doesn't specify in their allowlist.
> 
> Also remove the old Makefile arm configuration options which don't do
> anything in Meson.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

Please see one comment inline below. Otherwise LGTM.

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

> ---
>  buildtools/list-dir-globs.py                  |  7 ++--
>  config/arm/meson.build                        |  4 ---
>  config/meson.build                            |  4 +++
>  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++++
>  drivers/common/qat/meson.build                |  4 +--
>  drivers/meson.build                           | 32 ++++++++++++++++---
>  meson_options.txt                             |  2 ++
>  7 files changed, 48 insertions(+), 13 deletions(-)
> 
> diff --git a/buildtools/list-dir-globs.py b/buildtools/list-dir-globs.py
> index 80b5e801f2..911e267335 100755
> --- a/buildtools/list-dir-globs.py
> +++ b/buildtools/list-dir-globs.py
> @@ -14,6 +14,7 @@
>                      os.getenv('MESON_SUBDIR', '.'))
>  
>  for path in sys.argv[1].split(','):
> -    for p in iglob(os.path.join(root, path)):
> -        if os.path.isdir(p):
> -            print(os.path.relpath(p))
> +    if path:
> +        for p in iglob(os.path.join(root, path)):
> +            if os.path.isdir(p):
> +                print(os.path.relpath(p))
> diff --git a/config/arm/meson.build b/config/arm/meson.build
> index aaed89bd5b..2984ae2db3 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -17,9 +17,6 @@ flags_common = [
>  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
>  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
>  
> -	['RTE_NET_FM10K', false],
> -	['RTE_NET_AVP', false],
> -
>  	['RTE_SCHED_VECTOR', false],
>  	['RTE_ARM_USE_WFE', false],
>  	['RTE_ARCH_ARM64', true],
> @@ -126,7 +123,6 @@ implementer_cavium = {
>  				['RTE_MACHINE', '"octeontx2"'],
>  				['RTE_ARM_FEATURE_ATOMICS', true],
>  				['RTE_USE_C11_MEM_MODEL', true],
> -				['RTE_EAL_IGB_UIO', false],
>  				['RTE_MAX_LCORE', 36],
>  				['RTE_MAX_NUMA_NODES', 1]
>  			]
> diff --git a/config/meson.build b/config/meson.build
> index 3268cf6804..6e6ef8c0e1 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -63,6 +63,10 @@ if not is_windows
>  			pmd_subdir_opt)
>  endif
>  
> +# init disable/enable driver lists that will be populated in different places
> +disable_drivers = ''
> +enable_drivers = ''
> +
>  # set the machine type and cflags for it
>  if meson.is_cross_build()
>  	machine = host_machine.cpu()
> 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 faaf24b95b..9b9e8ef704 100644
> --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> @@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
>        numa = false        # set to false to force building for a non-NUMA system
>           # if not set or set to true, the build system will build for a NUMA
>           # system only if libnuma is installed
> +
> +      disable_drivers = 'bus/dpaa,crypto/*'  # add disabled drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> +
> +      enable_drivers = 'common/*,bus/*'  # build only these drivers
> +         # valid values are dir/subdirs in the drivers directory
> +         # wildcards are allowed
> diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build
> index 3ad7dd5017..fe278f734f 100644
> --- a/drivers/common/qat/meson.build
> +++ b/drivers/common/qat/meson.build
> @@ -14,13 +14,13 @@ qat_compress = true
>  qat_compress_path = 'compress/qat'
>  qat_compress_relpath = '../../' + qat_compress_path
>  
> -if disabled_drivers.contains(qat_crypto_path)
> +if disable_drivers.contains(qat_crypto_path)
>  	qat_crypto = false
>  	dpdk_drvs_disabled += qat_crypto_path
>  	set_variable(qat_crypto_path.underscorify() + '_disable_reason',
>  			'Explicitly disabled via build config')
>  endif
> -if disabled_drivers.contains(qat_compress_path)
> +if disable_drivers.contains(qat_compress_path)
>  	qat_compress = false
>  	dpdk_drvs_disabled += qat_compress_path
>  	set_variable(qat_compress_path.underscorify() + '_disable_reason',
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 45af8749da..00fe70452d 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -20,8 +20,25 @@ subdirs = [
>  	'baseband', # depends on common and bus.
>  ]
>  
> -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> -		).stdout().split()
> +if meson.is_cross_build()
> +	disable_drivers += ',' + meson.get_cross_property('disable_drivers', [])
> +	enable_drivers += ',' + meson.get_cross_property('enable_drivers', [])

Should the fallbacks here not be empty strings rather than empty values?

> +endif
> +
> +# add cmdline disabled drivers and meson disabled drivers together
> +disable_drivers += ',' + get_option('disable_drivers')
> +disable_drivers = run_command(list_dir_globs, disable_drivers).stdout().split()
> +
> +# add cmdline enabled drivers and meson enabled drivers together
> +enable_drivers = ',' + get_option('enable_drivers')
> +enable_drivers = run_command(list_dir_globs, enable_drivers).stdout().split()
> +if enable_drivers.length() == 0
> +	enable_drivers = run_command(list_dir_globs, '*/*').stdout().split()
> +endif
> +
> +# these drivers must always be enabled, otherwise the build breaks
> +always_enable = ['bus/pci', 'bus/vdev']
> +enable_drivers += always_enable
>  
>  default_cflags = machine_args
>  default_cflags += ['-DALLOW_EXPERIMENTAL_API']
> @@ -75,9 +92,16 @@ foreach subpath:subdirs
>  		ext_deps = []
>  		pkgconfig_extra_libs = []
>  
> -		if disabled_drivers.contains(drv_path)
> +		if not enable_drivers.contains(drv_path)
>  			build = false
> -			reason = 'explicitly disabled via build config'
> +			reason = 'not in enabled drivers build config'
> +		elif disable_drivers.contains(drv_path)
> +			if always_enable.contains(drv_path)
> +				message('Driver @0@ cannot be disabled, not disabling.'.format(drv_path))
> +			else
> +				build = false
> +				reason = 'explicitly disabled via build config'
> +			endif
>  		else
>  			# pull in driver directory which should update all the local variables
>  			subdir(drv_path)
> diff --git a/meson_options.txt b/meson_options.txt
> index fa207cbada..e1dc351620 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -10,6 +10,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
>  	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
>  option('enable_docs', type: 'boolean', value: false,
>  	description: 'build documentation')
> +option('enable_drivers', type: 'string', value: '',
> +	description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.')
>  option('enable_driver_sdk', type: 'boolean', value: false,
>  	description: 'Install headers to build drivers.')
>  option('enable_kmods', type: 'boolean', value: false,
> -- 
> 2.20.1
> 

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

* Re: [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds
  2021-04-14 13:27                                           ` Bruce Richardson
@ 2021-04-14 13:33                                             ` Juraj Linkeš
  0 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 13:33 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang, vcchunga,
	Dharmik.Thakkar, jerinjacobk, hemant.agrawal, ajit.khaparde,
	ferruh.yigit, aboyer, dev



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Wednesday, April 14, 2021 3:28 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: Ruifeng.Wang@arm.com; Honnappa.Nagarahalli@arm.com;
> Phil.Yang@arm.com; vcchunga@amazon.com; Dharmik.Thakkar@arm.com;
> jerinjacobk@gmail.com; hemant.agrawal@nxp.com;
> ajit.khaparde@broadcom.com; ferruh.yigit@intel.com; aboyer@pensando.io;
> dev@dpdk.org
> Subject: Re: [PATCH v20 1/3] build: disable/enable drivers in Arm builds
> 
> On Wed, Apr 14, 2021 at 02:58:36PM +0200, Juraj Linkeš wrote:
> > Add support for enabling or disabling drivers for Arm cross build. Do
> > not implement any enable/disable lists yet.
> >
> > Enabling drivers is useful when building for an SoC where we only want
> > to build a few drivers. That way the list won't be too long.
> >
> > Similarly, disabling drivers is useful when we want to disable only a
> > few drivers.
> >
> > Both of these are advantageous mainly in aarch64 -> aarch64 (or arch
> > -> same arch) builds, where the build machine may have the required
> > driver dependencies, yet we don't want to build drivers for a specific SoC.
> >
> > If enable_drivers is a non-empty list, build only those drivers,
> > otherwise build all drivers and add them to enable_drivers.  If
> > disable_drivers is non-empty list, build all drivers specified in
> > enable_drivers except those in disable_drivers.
> >
> > There are two drivers, bus/pci and bus/vdev, which break the build if
> > not enabled. Address this by always enabling these if the user
> > disables them or doesn't specify in their allowlist.
> >
> > Also remove the old Makefile arm configuration options which don't do
> > anything in Meson.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> 
> Please see one comment inline below. Otherwise LGTM.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> > ---
> >  buildtools/list-dir-globs.py                  |  7 ++--
> >  config/arm/meson.build                        |  4 ---
> >  config/meson.build                            |  4 +++
> >  .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++++
> >  drivers/common/qat/meson.build                |  4 +--
> >  drivers/meson.build                           | 32 ++++++++++++++++---
> >  meson_options.txt                             |  2 ++
> >  7 files changed, 48 insertions(+), 13 deletions(-)
> >
> > diff --git a/buildtools/list-dir-globs.py
> > b/buildtools/list-dir-globs.py index 80b5e801f2..911e267335 100755
> > --- a/buildtools/list-dir-globs.py
> > +++ b/buildtools/list-dir-globs.py
> > @@ -14,6 +14,7 @@
> >                      os.getenv('MESON_SUBDIR', '.'))
> >
> >  for path in sys.argv[1].split(','):
> > -    for p in iglob(os.path.join(root, path)):
> > -        if os.path.isdir(p):
> > -            print(os.path.relpath(p))
> > +    if path:
> > +        for p in iglob(os.path.join(root, path)):
> > +            if os.path.isdir(p):
> > +                print(os.path.relpath(p))
> > diff --git a/config/arm/meson.build b/config/arm/meson.build index
> > aaed89bd5b..2984ae2db3 100644
> > --- a/config/arm/meson.build
> > +++ b/config/arm/meson.build
> > @@ -17,9 +17,6 @@ flags_common = [
> >  	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
> >  	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
> >
> > -	['RTE_NET_FM10K', false],
> > -	['RTE_NET_AVP', false],
> > -
> >  	['RTE_SCHED_VECTOR', false],
> >  	['RTE_ARM_USE_WFE', false],
> >  	['RTE_ARCH_ARM64', true],
> > @@ -126,7 +123,6 @@ implementer_cavium = {
> >  				['RTE_MACHINE', '"octeontx2"'],
> >  				['RTE_ARM_FEATURE_ATOMICS', true],
> >  				['RTE_USE_C11_MEM_MODEL', true],
> > -				['RTE_EAL_IGB_UIO', false],
> >  				['RTE_MAX_LCORE', 36],
> >  				['RTE_MAX_NUMA_NODES', 1]
> >  			]
> > diff --git a/config/meson.build b/config/meson.build index
> > 3268cf6804..6e6ef8c0e1 100644
> > --- a/config/meson.build
> > +++ b/config/meson.build
> > @@ -63,6 +63,10 @@ if not is_windows
> >  			pmd_subdir_opt)
> >  endif
> >
> > +# init disable/enable driver lists that will be populated in
> > +different places disable_drivers = ''
> > +enable_drivers = ''
> > +
> >  # set the machine type and cflags for it  if meson.is_cross_build()
> >  	machine = host_machine.cpu()
> > 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 faaf24b95b..9b9e8ef704 100644
> > --- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > +++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
> > @@ -234,3 +234,11 @@ There are other options you may specify in a cross
> file to tailor the build::
> >        numa = false        # set to false to force building for a non-NUMA system
> >           # if not set or set to true, the build system will build for a NUMA
> >           # system only if libnuma is installed
> > +
> > +      disable_drivers = 'bus/dpaa,crypto/*'  # add disabled drivers
> > +         # valid values are dir/subdirs in the drivers directory
> > +         # wildcards are allowed
> > +
> > +      enable_drivers = 'common/*,bus/*'  # build only these drivers
> > +         # valid values are dir/subdirs in the drivers directory
> > +         # wildcards are allowed
> > diff --git a/drivers/common/qat/meson.build
> > b/drivers/common/qat/meson.build index 3ad7dd5017..fe278f734f 100644
> > --- a/drivers/common/qat/meson.build
> > +++ b/drivers/common/qat/meson.build
> > @@ -14,13 +14,13 @@ qat_compress = true  qat_compress_path =
> > 'compress/qat'
> >  qat_compress_relpath = '../../' + qat_compress_path
> >
> > -if disabled_drivers.contains(qat_crypto_path)
> > +if disable_drivers.contains(qat_crypto_path)
> >  	qat_crypto = false
> >  	dpdk_drvs_disabled += qat_crypto_path
> >  	set_variable(qat_crypto_path.underscorify() + '_disable_reason',
> >  			'Explicitly disabled via build config')  endif -if
> > disabled_drivers.contains(qat_compress_path)
> > +if disable_drivers.contains(qat_compress_path)
> >  	qat_compress = false
> >  	dpdk_drvs_disabled += qat_compress_path
> >  	set_variable(qat_compress_path.underscorify() + '_disable_reason',
> > diff --git a/drivers/meson.build b/drivers/meson.build index
> > 45af8749da..00fe70452d 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -20,8 +20,25 @@ subdirs = [
> >  	'baseband', # depends on common and bus.
> >  ]
> >
> > -disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
> > -		).stdout().split()
> > +if meson.is_cross_build()
> > +	disable_drivers += ',' + meson.get_cross_property('disable_drivers', [])
> > +	enable_drivers += ',' + meson.get_cross_property('enable_drivers',
> > +[])
> 
> Should the fallbacks here not be empty strings rather than empty values?
> 

That's right, I overlooked this, thanks. I'll fix this right away.

> > +endif
> > +
> > +# add cmdline disabled drivers and meson disabled drivers together
> > +disable_drivers += ',' + get_option('disable_drivers')
> > +disable_drivers = run_command(list_dir_globs,
> > +disable_drivers).stdout().split()
> > +
> > +# add cmdline enabled drivers and meson enabled drivers together
> > +enable_drivers = ',' + get_option('enable_drivers') enable_drivers =
> > +run_command(list_dir_globs, enable_drivers).stdout().split() if
> > +enable_drivers.length() == 0
> > +	enable_drivers = run_command(list_dir_globs, '*/*').stdout().split()
> > +endif
> > +
> > +# these drivers must always be enabled, otherwise the build breaks
> > +always_enable = ['bus/pci', 'bus/vdev'] enable_drivers +=
> > +always_enable
> >
> >  default_cflags = machine_args
> >  default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -75,9 +92,16 @@
> > foreach subpath:subdirs
> >  		ext_deps = []
> >  		pkgconfig_extra_libs = []
> >
> > -		if disabled_drivers.contains(drv_path)
> > +		if not enable_drivers.contains(drv_path)
> >  			build = false
> > -			reason = 'explicitly disabled via build config'
> > +			reason = 'not in enabled drivers build config'
> > +		elif disable_drivers.contains(drv_path)
> > +			if always_enable.contains(drv_path)
> > +				message('Driver @0@ cannot be disabled, not
> disabling.'.format(drv_path))
> > +			else
> > +				build = false
> > +				reason = 'explicitly disabled via build config'
> > +			endif
> >  		else
> >  			# pull in driver directory which should update all the
> local variables
> >  			subdir(drv_path)
> > diff --git a/meson_options.txt b/meson_options.txt index
> > fa207cbada..e1dc351620 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -10,6 +10,8 @@ option('drivers_install_subdir', type: 'string', value:
> 'dpdk/pmds-<VERSION>',
> >  	description: 'Subdirectory of libdir where to install PMDs. Defaults
> > to using a versioned subdirectory.')  option('enable_docs', type: 'boolean',
> value: false,
> >  	description: 'build documentation')
> > +option('enable_drivers', type: 'string', value: '',
> > +	description: 'Comma-separated list of drivers to build. If
> > +unspecified, build all drivers.')
> >  option('enable_driver_sdk', type: 'boolean', value: false,
> >  	description: 'Install headers to build drivers.')
> > option('enable_kmods', type: 'boolean', value: false,
> > --
> > 2.20.1
> >


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

* [dpdk-dev] [PATCH v21 0/3] Arm build options rework
  2021-04-14 12:58                                       ` [dpdk-dev] [PATCH v20 " Juraj Linkeš
                                                           ` (2 preceding siblings ...)
  2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-04-14 13:41                                         ` Juraj Linkeš
  2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
                                                             ` (3 more replies)
  3 siblings, 4 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 13:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

The current way of specifying Arm configuration options is insufficient
since we can't identify the SoC we're building for from the MIDR
information. For example, we can't distinguish between N1SDP, Graviton2
or Ampere Altra.

We also want to be able to enable/disable which drivers are built
without user input. This is useful when building:
1. on an SoC that is slow and we want to build only what is necessary
  without the user having to check which libraries they have installed
2. a cross build on a fast aarch64 machine but with target SoC which
  differs in capabilities or libraries.
This is achieved by specifying the drivers in SoC configuration.

The current implementation adds/supports the following:
* x86 -> aarch64 cross build with added config options/enabled or
  disabled drivers/libs
* aarch64 -> aarch64 builds for a different SoCs using meson -Dplatform
  option or using a cross file

v16:
Only three commits remaining - updated the cover letter.
Renamed the 'soc' meson option to 'platform'.
Added the support for enabling a particular set of drivers.
Aligned enabling and disabling with the command line option so that
wildcards can be used.

v17:
Removed unnecessary comments in "build: disable/enable drivers in Arm
builds". Also always enabled two drivers which break the build if
disabled.

v18:
Rebased.

v19:
Updated 3/3 with more up to date MAX_LCORE and MAX_NUMA_NODES for
neoverse-n1.

v20:
Simplified allowlist and blocklist implementation in 1/3 and updated 2/3
accordingly.

v21:
Minor fix in 1/3.

Juraj Linkeš (3):
  build: disable/enable drivers in Arm builds
  build: add 'platform' meson option and Arm SoC config
  config: fix Arm implementer and its SoCs

 buildtools/list-dir-globs.py                  |   7 +-
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 177 +++++++++++++++---
 config/meson.build                            |   4 +
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 104 +++++-----
 drivers/common/qat/meson.build                |   4 +-
 drivers/meson.build                           |  32 +++-
 meson_options.txt                             |   4 +
 20 files changed, 259 insertions(+), 144 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH v21 1/3] build: disable/enable drivers in Arm builds
  2021-04-14 13:41                                         ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Juraj Linkeš
@ 2021-04-14 13:41                                           ` Juraj Linkeš
  2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
                                                             ` (2 subsequent siblings)
  3 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 13:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add support for enabling or disabling drivers for Arm cross build. Do
not implement any enable/disable lists yet.

Enabling drivers is useful when building for an SoC where we only want
to build a few drivers. That way the list won't be too long.

Similarly, disabling drivers is useful when we want to disable only a
few drivers.

Both of these are advantageous mainly in aarch64 -> aarch64 (or arch ->
same arch) builds, where the build machine may have the required driver
dependencies, yet we don't want to build drivers for a specific SoC.

If enable_drivers is a non-empty list, build only those drivers,
otherwise build all drivers and add them to enable_drivers.  If
disable_drivers is non-empty list, build all drivers specified in
enable_drivers except those in disable_drivers.

There are two drivers, bus/pci and bus/vdev, which break the build if
not enabled. Address this by always enabling these if the user disables
them or doesn't specify in their allowlist.

Also remove the old Makefile arm configuration options which don't do
anything in Meson.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/list-dir-globs.py                  |  7 ++--
 config/arm/meson.build                        |  4 ---
 config/meson.build                            |  4 +++
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  |  8 +++++
 drivers/common/qat/meson.build                |  4 +--
 drivers/meson.build                           | 32 ++++++++++++++++---
 meson_options.txt                             |  2 ++
 7 files changed, 48 insertions(+), 13 deletions(-)

diff --git a/buildtools/list-dir-globs.py b/buildtools/list-dir-globs.py
index 80b5e801f2..911e267335 100755
--- a/buildtools/list-dir-globs.py
+++ b/buildtools/list-dir-globs.py
@@ -14,6 +14,7 @@
                     os.getenv('MESON_SUBDIR', '.'))
 
 for path in sys.argv[1].split(','):
-    for p in iglob(os.path.join(root, path)):
-        if os.path.isdir(p):
-            print(os.path.relpath(p))
+    if path:
+        for p in iglob(os.path.join(root, path)):
+            if os.path.isdir(p):
+                print(os.path.relpath(p))
diff --git a/config/arm/meson.build b/config/arm/meson.build
index aaed89bd5b..2984ae2db3 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -17,9 +17,6 @@ flags_common = [
 	#	['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
 	#	['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
 
-	['RTE_NET_FM10K', false],
-	['RTE_NET_AVP', false],
-
 	['RTE_SCHED_VECTOR', false],
 	['RTE_ARM_USE_WFE', false],
 	['RTE_ARCH_ARM64', true],
@@ -126,7 +123,6 @@ implementer_cavium = {
 				['RTE_MACHINE', '"octeontx2"'],
 				['RTE_ARM_FEATURE_ATOMICS', true],
 				['RTE_USE_C11_MEM_MODEL', true],
-				['RTE_EAL_IGB_UIO', false],
 				['RTE_MAX_LCORE', 36],
 				['RTE_MAX_NUMA_NODES', 1]
 			]
diff --git a/config/meson.build b/config/meson.build
index 3268cf6804..6e6ef8c0e1 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -63,6 +63,10 @@ if not is_windows
 			pmd_subdir_opt)
 endif
 
+# init disable/enable driver lists that will be populated in different places
+disable_drivers = ''
+enable_drivers = ''
+
 # set the machine type and cflags for it
 if meson.is_cross_build()
 	machine = host_machine.cpu()
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 faaf24b95b..9b9e8ef704 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -234,3 +234,11 @@ There are other options you may specify in a cross file to tailor the build::
       numa = false        # set to false to force building for a non-NUMA system
          # if not set or set to true, the build system will build for a NUMA
          # system only if libnuma is installed
+
+      disable_drivers = 'bus/dpaa,crypto/*'  # add disabled drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
+
+      enable_drivers = 'common/*,bus/*'  # build only these drivers
+         # valid values are dir/subdirs in the drivers directory
+         # wildcards are allowed
diff --git a/drivers/common/qat/meson.build b/drivers/common/qat/meson.build
index 3ad7dd5017..fe278f734f 100644
--- a/drivers/common/qat/meson.build
+++ b/drivers/common/qat/meson.build
@@ -14,13 +14,13 @@ qat_compress = true
 qat_compress_path = 'compress/qat'
 qat_compress_relpath = '../../' + qat_compress_path
 
-if disabled_drivers.contains(qat_crypto_path)
+if disable_drivers.contains(qat_crypto_path)
 	qat_crypto = false
 	dpdk_drvs_disabled += qat_crypto_path
 	set_variable(qat_crypto_path.underscorify() + '_disable_reason',
 			'Explicitly disabled via build config')
 endif
-if disabled_drivers.contains(qat_compress_path)
+if disable_drivers.contains(qat_compress_path)
 	qat_compress = false
 	dpdk_drvs_disabled += qat_compress_path
 	set_variable(qat_compress_path.underscorify() + '_disable_reason',
diff --git a/drivers/meson.build b/drivers/meson.build
index 45af8749da..9aa86e7ed6 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -20,8 +20,25 @@ subdirs = [
 	'baseband', # depends on common and bus.
 ]
 
-disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
-		).stdout().split()
+if meson.is_cross_build()
+	disable_drivers += ',' + meson.get_cross_property('disable_drivers', '')
+	enable_drivers += ',' + meson.get_cross_property('enable_drivers', '')
+endif
+
+# add cmdline disabled drivers and meson disabled drivers together
+disable_drivers += ',' + get_option('disable_drivers')
+disable_drivers = run_command(list_dir_globs, disable_drivers).stdout().split()
+
+# add cmdline enabled drivers and meson enabled drivers together
+enable_drivers = ',' + get_option('enable_drivers')
+enable_drivers = run_command(list_dir_globs, enable_drivers).stdout().split()
+if enable_drivers.length() == 0
+	enable_drivers = run_command(list_dir_globs, '*/*').stdout().split()
+endif
+
+# these drivers must always be enabled, otherwise the build breaks
+always_enable = ['bus/pci', 'bus/vdev']
+enable_drivers += always_enable
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
@@ -75,9 +92,16 @@ foreach subpath:subdirs
 		ext_deps = []
 		pkgconfig_extra_libs = []
 
-		if disabled_drivers.contains(drv_path)
+		if not enable_drivers.contains(drv_path)
 			build = false
-			reason = 'explicitly disabled via build config'
+			reason = 'not in enabled drivers build config'
+		elif disable_drivers.contains(drv_path)
+			if always_enable.contains(drv_path)
+				message('Driver @0@ cannot be disabled, not disabling.'.format(drv_path))
+			else
+				build = false
+				reason = 'explicitly disabled via build config'
+			endif
 		else
 			# pull in driver directory which should update all the local variables
 			subdir(drv_path)
diff --git a/meson_options.txt b/meson_options.txt
index fa207cbada..e1dc351620 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,6 +10,8 @@ option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
 	description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.')
 option('enable_docs', type: 'boolean', value: false,
 	description: 'build documentation')
+option('enable_drivers', type: 'string', value: '',
+	description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.')
 option('enable_driver_sdk', type: 'boolean', value: false,
 	description: 'Install headers to build drivers.')
 option('enable_kmods', type: 'boolean', value: false,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v21 2/3] build: add 'platform' meson option and Arm SoC config
  2021-04-14 13:41                                         ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Juraj Linkeš
  2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
@ 2021-04-14 13:41                                           ` Juraj Linkeš
  2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
  2021-04-15 20:25                                           ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Thomas Monjalon
  3 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 13:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš

Add Arm SoC configuration sets to Arm meson.build and add an arch
agnostic meson option, 'platform', to select from these SoC
configurations for meson native builds. This is preferable to
specifying a cross file when doing aarch64 -> aarch64 builds, since the
cross file specifies the toolchain as well.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 config/arm/arm64_armada_linux_gcc             |   6 +-
 config/arm/arm64_armv8_linux_clang_ubuntu1804 |   3 +-
 config/arm/arm64_armv8_linux_gcc              |   5 +-
 config/arm/arm64_bluefield_linux_gcc          |   6 +-
 config/arm/arm64_dpaa_linux_gcc               |   6 +-
 config/arm/arm64_emag_linux_gcc               |   5 +-
 config/arm/arm64_graviton2_linux_gcc          |   6 +-
 config/arm/arm64_n1sdp_linux_gcc              |   6 +-
 config/arm/arm64_n2_linux_gcc                 |   6 +-
 config/arm/arm64_octeontx2_linux_gcc          |   6 +-
 config/arm/arm64_stingray_linux_gcc           |   6 +-
 config/arm/arm64_thunderx2_linux_gcc          |   5 +-
 config/arm/arm64_thunderxt88_linux_gcc        |   5 +-
 config/arm/meson.build                        | 137 +++++++++++++++++-
 .../linux_gsg/cross_build_dpdk_for_arm64.rst  | 112 +++++++-------
 meson_options.txt                             |   2 +
 16 files changed, 204 insertions(+), 118 deletions(-)

diff --git a/config/arm/arm64_armada_linux_gcc b/config/arm/arm64_armada_linux_gcc
index 9958db6692..301418949b 100644
--- a/config/arm/arm64_armada_linux_gcc
+++ b/config/arm/arm64_armada_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x56'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'armada'
diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804 b/config/arm/arm64_armv8_linux_clang_ubuntu1804
index 57095c1304..db488d75f4 100644
--- a/config/arm/arm64_armv8_linux_clang_ubuntu1804
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
@@ -14,7 +14,6 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'generic'
-part_number = 'generic'
+platform = 'generic'
 c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-gnu']
 c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
diff --git a/config/arm/arm64_armv8_linux_gcc b/config/arm/arm64_armv8_linux_gcc
index 5451a01da1..5391d35389 100644
--- a/config/arm/arm64_armv8_linux_gcc
+++ b/config/arm/arm64_armv8_linux_gcc
@@ -14,7 +14,4 @@ endian = 'little'
 
 [properties]
 # Generate binaries that are portable across all Armv8 machines
-implementer_id = 'generic'
-part_number = 'generic'
-max_lcores = 256
-max_numa_nodes = 4
+platform = 'generic'
diff --git a/config/arm/arm64_bluefield_linux_gcc b/config/arm/arm64_bluefield_linux_gcc
index 6bef87fbd4..248a9f031a 100644
--- a/config/arm/arm64_bluefield_linux_gcc
+++ b/config/arm/arm64_bluefield_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'bluefield'
diff --git a/config/arm/arm64_dpaa_linux_gcc b/config/arm/arm64_dpaa_linux_gcc
index 37398c7628..e9d5fd31fc 100644
--- a/config/arm/arm64_dpaa_linux_gcc
+++ b/config/arm/arm64_dpaa_linux_gcc
@@ -14,8 +14,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = 'dpaa'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'dpaa'
diff --git a/config/arm/arm64_emag_linux_gcc b/config/arm/arm64_emag_linux_gcc
index 7cbb055106..9cdd931180 100644
--- a/config/arm/arm64_emag_linux_gcc
+++ b/config/arm/arm64_emag_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x50'
-part_number = '0x0'
-max_lcores = 32
-max_numa_nodes = 1
+platform = 'emag'
diff --git a/config/arm/arm64_graviton2_linux_gcc b/config/arm/arm64_graviton2_linux_gcc
index edacb79497..8016fd236c 100644
--- a/config/arm/arm64_graviton2_linux_gcc
+++ b/config/arm/arm64_graviton2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'graviton2'
diff --git a/config/arm/arm64_n1sdp_linux_gcc b/config/arm/arm64_n1sdp_linux_gcc
index b00f2d1ef7..0df283e2f4 100644
--- a/config/arm/arm64_n1sdp_linux_gcc
+++ b/config/arm/arm64_n1sdp_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd0c'
-max_lcores = 4
-max_numa_nodes = 1
-numa = false
+platform = 'n1sdp'
diff --git a/config/arm/arm64_n2_linux_gcc b/config/arm/arm64_n2_linux_gcc
index 817b8ee28e..036aee2b0a 100644
--- a/config/arm/arm64_n2_linux_gcc
+++ b/config/arm/arm64_n2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd49'
-max_lcores = 64
-max_numa_nodes = 1
-numa = false
+platform = 'n2'
diff --git a/config/arm/arm64_octeontx2_linux_gcc b/config/arm/arm64_octeontx2_linux_gcc
index 5937697098..9156ee5410 100644
--- a/config/arm/arm64_octeontx2_linux_gcc
+++ b/config/arm/arm64_octeontx2_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xb2'
-max_lcores = 36
-max_numa_nodes = 1
-numa = false
+platform = 'octeontx2'
diff --git a/config/arm/arm64_stingray_linux_gcc b/config/arm/arm64_stingray_linux_gcc
index 6bef87fbd4..319a4a151d 100644
--- a/config/arm/arm64_stingray_linux_gcc
+++ b/config/arm/arm64_stingray_linux_gcc
@@ -13,8 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x41'
-part_number = '0xd08'
-max_lcores = 16
-max_numa_nodes = 1
-numa = false
+platform = 'stingray'
diff --git a/config/arm/arm64_thunderx2_linux_gcc b/config/arm/arm64_thunderx2_linux_gcc
index c06dcdc2b3..69c71cbc82 100644
--- a/config/arm/arm64_thunderx2_linux_gcc
+++ b/config/arm/arm64_thunderx2_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xaf'
-max_lcores = 256
-max_numa_nodes = 2
+platform = 'thunderx2'
diff --git a/config/arm/arm64_thunderxt88_linux_gcc b/config/arm/arm64_thunderxt88_linux_gcc
index 3ba1528e48..372097ba01 100644
--- a/config/arm/arm64_thunderxt88_linux_gcc
+++ b/config/arm/arm64_thunderxt88_linux_gcc
@@ -13,7 +13,4 @@ cpu = 'armv8-a'
 endian = 'little'
 
 [properties]
-implementer_id = '0x43'
-part_number = '0xa1'
-max_lcores = 96
-max_numa_nodes = 1
+platform = 'thunderxt88'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 2984ae2db3..c484fe26c0 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -26,7 +26,7 @@ flags_common = [
 ## Part numbers are specific to Arm implementers
 # implementer specific aarch64 flags have middle priority
 #     (will overwrite common flags)
-# part number specific aarch64 flags have the highest priority
+# part number specific aarch64 flags have higher priority
 #     (will overwrite both common and implementer specific flags)
 implementer_generic = {
 	'description': 'Generic armv8',
@@ -193,6 +193,106 @@ implementers = {
 	'dpaa': implementer_dpaa
 }
 
+# soc specific aarch64 flags have the highest priority
+#     (will overwrite all other flags)
+soc_generic = {
+	'description': 'Generic un-optimized build for all aarch64 machines',
+	'implementer': 'generic',
+	'part_number': 'generic'
+}
+
+soc_armada = {
+	'description': 'Marvell ARMADA',
+	'implementer': '0x56',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_bluefield = {
+	'description': 'NVIDIA BlueField',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_dpaa = {
+	'description': 'NXP DPAA',
+	'implementer': 'dpaa',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_emag = {
+	'description': 'Ampere eMAG',
+	'implementer': '0x50',
+	'part_number': '0x0'
+}
+
+soc_graviton2 = {
+	'description': 'AWS Graviton2',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'numa': false
+}
+
+soc_n1sdp = {
+	'description': 'Arm Neoverse N1SDP',
+	'implementer': '0x41',
+	'part_number': '0xd0c',
+	'flags': [
+		['RTE_MAX_LCORE', 4]
+	],
+	'numa': false
+}
+
+soc_n2 = {
+	'description': 'Arm Neoverse N2',
+	'implementer': '0x41',
+	'part_number': '0xd49',
+	'numa': false
+}
+
+soc_octeontx2 = {
+	'description': 'Marvell OCTEON TX2',
+	'implementer': '0x43',
+	'part_number': '0xb2',
+	'numa': false
+}
+
+soc_stingray = {
+	'description': 'Broadcom Stingray',
+	'implementer': '0x41',
+	'part_number': '0xd08',
+	'numa': false
+}
+
+soc_thunderx2 = {
+	'description': 'Marvell ThunderX2 T99',
+	'implementer': '0x43',
+	'part_number': '0xaf'
+}
+
+soc_thunderxt88 = {
+	'description': 'Marvell ThunderX T88',
+	'implementer': '0x43',
+	'part_number': '0xa1'
+}
+
+socs = {
+	'generic': soc_generic,
+	'armada': soc_armada,
+	'bluefield': soc_bluefield,
+	'dpaa': soc_dpaa,
+	'emag': soc_emag,
+	'graviton2': soc_graviton2,
+	'n1sdp': soc_n1sdp,
+	'n2': soc_n2,
+	'octeontx2': soc_octeontx2,
+	'stingray': soc_stingray,
+	'thunderx2': soc_thunderx2,
+	'thunderxt88': soc_thunderxt88
+}
+
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
@@ -204,11 +304,19 @@ if dpdk_conf.get('RTE_ARCH_32')
 	machine_args += '-mfpu=neon'
 else
 	# aarch64 build
+	soc = get_option('platform')
+	soc_config = {}
 	if not meson.is_cross_build()
 		if machine == 'generic'
 			# generic build
+			if soc != ''
+				error('Building for a particular platform is ' +
+				      'unsupported with generic build.')
+			endif
 			implementer_id = 'generic'
 			part_number = 'generic'
+		elif soc != ''
+			soc_config = socs.get(soc, {'not_supported': true})
 		else
 			# native build
 			# The script returns ['Implementer', 'Variant', 'Architecture',
@@ -226,8 +334,27 @@ else
 		endif
 	else
 		# cross build
-		implementer_id = meson.get_cross_property('implementer_id')
-		part_number = meson.get_cross_property('part_number')
+		soc = meson.get_cross_property('platform', '')
+		if soc == ''
+			error('Arm SoC must be specified in the cross file.')
+		endif
+		soc_config = socs.get(soc, {'not_supported': true})
+	endif
+
+	soc_flags = []
+	if soc_config.has_key('not_supported')
+		error('SoC @0@ not supported.'.format(soc))
+	elif soc_config != {}
+		implementer_id = soc_config['implementer']
+		implementer_config = implementers[implementer_id]
+		part_number = soc_config['part_number']
+		soc_flags = soc_config.get('flags', [])
+		if not soc_config.get('numa', true)
+			has_libnuma = 0
+		endif
+
+		disable_drivers += ',' + soc_config.get('disable_drivers', '')
+		enable_drivers += ',' + soc_config.get('enable_drivers', '')
 	endif
 
 	if implementers.has_key(implementer_id)
@@ -253,8 +380,8 @@ else
 		      '(-Dmachine=generic) build.')
 	endif
 
-	# use common flags with implementer flags
-	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', [])
+	# add/overwrite flags in the proper order
+	dpdk_flags = flags_common + implementer_config['flags'] + part_number_config.get('flags', []) + soc_flags
 
 	# apply supported machine args
 	machine_args = [] # Clear previous machine args
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 9b9e8ef704..b6c1ec4c95 100644
--- a/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
+++ b/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
@@ -187,58 +187,60 @@ Use the following command to cross-compile DPDK for the target machine::
    meson aarch64-build-clang --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804
    ninja -C aarch64-build-clang
 
-Supported cross-compilation targets
------------------------------------
-
-If you wish to build for a target which is not among the current cross-files,
-you may use various combinations of implementer/part number::
-
-   Supported implementers:
-      'generic': Generic armv8
-      '0x41':    Arm
-      '0x43':    Cavium
-      '0x50':    Ampere Computing
-      '0x56':    Marvell ARMADA
-      'dpaa':    NXP DPAA
-
-   Supported part_numbers for generic:
-      'generic': valid for all armv8-a architectures (unoptimized portable build)
-
-   Supported part_numbers for 0x41, 0x56, dpaa:
-      '0xd03':   cortex-a53
-      '0xd04':   cortex-a35
-      '0xd09':   cortex-a73
-      '0xd0a':   cortex-a75
-      '0xd0b':   cortex-a76
-      '0xd0c':   neoverse-n1
-
-   Supported part_numbers for 0x43:
-      '0xa1':    thunderxt88
-      '0xa2':    thunderxt81
-      '0xa3':    thunderxt83
-      '0xaf':    thunderx2t99
-      '0xb2':    octeontx2
-
-   Supported part_numbers for 0x50:
-      '0x0':     emag
-
-Other cross file options
-------------------------
-
-There are other options you may specify in a cross file to tailor the build::
-
-   Supported extra configuration
-      max_numa_nodes = n  # will set RTE_MAX_NUMA_NODES
-      max_lcores = n      # will set RTE_MAX_LCORE
-
-      numa = false        # set to false to force building for a non-NUMA system
-         # if not set or set to true, the build system will build for a NUMA
-         # system only if libnuma is installed
-
-      disable_drivers = 'bus/dpaa,crypto/*'  # add disabled drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
-
-      enable_drivers = 'common/*,bus/*'  # build only these drivers
-         # valid values are dir/subdirs in the drivers directory
-         # wildcards are allowed
+Building for an aarch64 SoC on an aarch64 build machine
+-------------------------------------------------------
+
+If you wish to build on an aarch64 build machine for a different aarch64 SoC,
+you don't need a separate cross toolchain, just a different set of
+configuration options. To build for an aarch64 SoC, use the -Dplatform meson
+option::
+
+   meson soc_build -Dplatform=<target_soc>
+
+Substitute <target_soc> with one of the supported SoCs::
+
+   generic:     Generic un-optimized build for all aarch64 machines.
+   armada:      Marvell ARMADA
+   bluefield:   NVIDIA BlueField
+   dpaa:        NXP DPAA
+   emag:        Ampere eMAG
+   graviton2:   AWS Graviton2
+   n1sdp:       Arm Neoverse N1SDP
+   octeontx2:   Marvell OCTEON TX2
+   stingray:    Broadcom Stingray
+   thunderx2:   Marvell ThunderX2 T99
+   thunderxt88: Marvell ThunderX T88
+
+These SoCs are also used in cross files, e.g.::
+
+   [properties]
+   # Generate binaries that are portable across all Armv8 machines
+   platform = 'generic'
+
+Supported SoC configuration
+---------------------------
+
+The SoC configuration is a combination of implementer and cpu part number
+configuration and SoC-specific configuration::
+
+   soc_<name> = {
+      'description': 'SoC Description',  # mandatory
+      'implementer': <implementer_id>,   # mandatory
+      'part_number': <part_number>,      # mandatory
+      'numa': false,  # optional, specify for non-NUMA SoCs
+      'enable_drivers': 'common/*,bus/*',  # optional, comma-separated list of
+                              # drivers to build, wildcards are accepted
+      'disable_drivers': 'crypto/*',       # optional, comma-separated list of
+                              # drivers to disable, wildcards are accepted
+      'flags': [
+         ['RTE_MAX_LCORE', '16'],
+         ['RTE_MAX_NUMA_NODES', '1']
+      ]               # optional, list of DPDK options that will be added
+                      # or overwritten
+   }
+
+   Where <implementer_id> if a key defined in the implementers dictionary in
+   config/arm/meson.build (e.g. 0x41) and part_number is a key defined in
+   implementers[<implementer_id>]['part_number_config'] dictionary (i.e. the
+   part number must be defined for the implementer, e.g. for 0x41 a valid value
+   is 0xd49, which is the neoverse-n2 SoC).
diff --git a/meson_options.txt b/meson_options.txt
index e1dc351620..f08dc5322e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -34,6 +34,8 @@ option('max_lcores', type: 'integer', value: 128,
 	description: 'maximum number of cores/threads supported by EAL')
 option('max_numa_nodes', type: 'integer', value: 32,
 	description: 'maximum number of NUMA nodes supported by EAL')
+option('platform', type: 'string', value: '',
+	description: 'Use configuration for a particular platform (such as an Arm SoC).')
 option('enable_trace_fp', type: 'boolean', value: false,
 	description: 'enable fast path trace points.')
 option('tests', type: 'boolean', value: true,
-- 
2.20.1


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

* [dpdk-dev] [PATCH v21 3/3] config: fix Arm implementer and its SoCs
  2021-04-14 13:41                                         ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Juraj Linkeš
  2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
  2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
@ 2021-04-14 13:41                                           ` Juraj Linkeš
  2021-04-15 20:25                                           ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Thomas Monjalon
  3 siblings, 0 replies; 465+ messages in thread
From: Juraj Linkeš @ 2021-04-14 13:41 UTC (permalink / raw)
  To: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer
  Cc: dev, Juraj Linkeš, lironh, yskoh

Fix the implementer and part number of DPAA and ARMADA SoCs.
The current values of 16 cores and 1 NUMA node don't cover all SoCs from
the Arm implementer, e.g. Taishan 2280 has 64 cores and 4 NUMA nodes.
Increase these to 64 and 4 to widen the coverage.
Also increase the neoverse-n1 MAX_LCORE and MAX_NUMA_NODES to reflect
new available hardware (Amplere Altra).
Add configuration to SoC options where smaller values are needed.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")
Cc: hemant.agrawal@nxp.com
Fixes: dd1cd845c102 ("config: add Marvell ARMADA based on armv8-a")
Cc: lironh@marvell.com
Fixes: d97108a33231 ("config: change defaults of armv8")
Cc: yskoh@mellanox.com

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 config/arm/meson.build | 60 +++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 33 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index c484fe26c0..1b7c4c1cc6 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -57,7 +57,8 @@ part_number_config_arm = {
 			['RTE_MACHINE', '"neoverse-n1"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
 			['RTE_MAX_MEM_MB', 1048576],
-			['RTE_MAX_LCORE', 80]
+			['RTE_MAX_LCORE', 160],
+			['RTE_MAX_NUMA_NODES', 2]
 		]
 	},
 	'0xd49': {
@@ -65,7 +66,8 @@ part_number_config_arm = {
 		'flags': [
 			['RTE_MACHINE', '"neoverse-n2"'],
 			['RTE_ARM_FEATURE_ATOMICS', true],
-			['RTE_MAX_LCORE', 64]
+			['RTE_MAX_LCORE', 64],
+			['RTE_MAX_NUMA_NODES', 1]
 		]
 	}
 }
@@ -75,8 +77,8 @@ implementer_arm = {
 		['RTE_MACHINE', '"armv8a"'],
 		['RTE_USE_C11_MEM_MODEL', true],
 		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
+		['RTE_MAX_LCORE', 64],
+		['RTE_MAX_NUMA_NODES', 4]
 	],
 	'part_number_config': part_number_config_arm
 }
@@ -158,39 +160,13 @@ implementer_qualcomm = {
 	}
 }
 
-implementer_marvell = {
-	'description': 'Marvell ARMADA',
-	'flags': [
-		['RTE_MACHINE', '"armv8a"'],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
-implementer_dpaa = {
-	'description': 'NXP DPAA',
-	'flags': [
-		['RTE_MACHINE', '"dpaa"'],
-		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
-		['RTE_USE_C11_MEM_MODEL', true],
-		['RTE_CACHE_LINE_SIZE', 64],
-		['RTE_MAX_LCORE', 16],
-		['RTE_MAX_NUMA_NODES', 1]
-	],
-	'part_number_config': part_number_config_arm
-}
-
 ## Arm implementers (ID from MIDR in Arm Architecture Reference Manual)
 implementers = {
 	'generic': implementer_generic,
 	'0x41': implementer_arm,
 	'0x43': implementer_cavium,
 	'0x50': implementer_ampere,
-	'0x51': implementer_qualcomm,
-	'0x56': implementer_marvell,
-	'dpaa': implementer_dpaa
+	'0x51': implementer_qualcomm
 }
 
 # soc specific aarch64 flags have the highest priority
@@ -203,8 +179,12 @@ soc_generic = {
 
 soc_armada = {
 	'description': 'Marvell ARMADA',
-	'implementer': '0x56',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -212,13 +192,23 @@ soc_bluefield = {
 	'description': 'NVIDIA BlueField',
 	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
 soc_dpaa = {
 	'description': 'NXP DPAA',
-	'implementer': 'dpaa',
+	'implementer': '0x41',
 	'part_number': '0xd08',
+	'flags': [
+		['RTE_MACHINE', '"dpaa"'],
+		['RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', false],
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'numa': false
 }
 
@@ -262,6 +252,10 @@ soc_octeontx2 = {
 soc_stingray = {
 	'description': 'Broadcom Stingray',
 	'implementer': '0x41',
+	'flags': [
+		['RTE_MAX_LCORE', 16],
+		['RTE_MAX_NUMA_NODES', 1]
+	],
 	'part_number': '0xd08',
 	'numa': false
 }
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH v21 0/3] Arm build options rework
  2021-04-14 13:41                                         ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Juraj Linkeš
                                                             ` (2 preceding siblings ...)
  2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
@ 2021-04-15 20:25                                           ` Thomas Monjalon
  3 siblings, 0 replies; 465+ messages in thread
From: Thomas Monjalon @ 2021-04-15 20:25 UTC (permalink / raw)
  To: Juraj Linkeš
  Cc: bruce.richardson, Ruifeng.Wang, Honnappa.Nagarahalli, Phil.Yang,
	vcchunga, Dharmik.Thakkar, jerinjacobk, hemant.agrawal,
	ajit.khaparde, ferruh.yigit, aboyer, dev

14/04/2021 15:41, Juraj Linkeš:
> Juraj Linkeš (3):
>   build: disable/enable drivers in Arm builds
>   build: add 'platform' meson option and Arm SoC config
>   config: fix Arm implementer and its SoCs

Applied, thank you for the patience over the months and revisions.





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

end of thread, other threads:[~2021-04-15 20:25 UTC | newest]

Thread overview: 465+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23 13:19 [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Juraj Linkeš
2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 1/2] build: rework Arm build options Juraj Linkeš
2020-09-24  4:19   ` Honnappa Nagarahalli
2020-09-24 11:08     ` Juraj Linkeš
2020-09-24 19:17       ` Honnappa Nagarahalli
2020-09-24 22:08         ` Ali Saidi
     [not found]         ` <20200924220710.19937-1-alisaidi@amazon.com>
2020-09-28 19:39           ` Honnappa Nagarahalli
2020-09-23 13:19 ` [dpdk-dev] [RFC PATCH 2/2] build: disable drivers from file Juraj Linkeš
2020-09-23 13:58   ` Bruce Richardson
2020-09-24  8:31     ` Juraj Linkeš
2020-09-24  3:03 ` [dpdk-dev] [RFC PATCH 0/2] Arm build options rework Honnappa Nagarahalli
2020-10-13 14:54 ` [dpdk-dev] [RFC PATCH v2 0/6] " Juraj Linkeš
2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 2/6] build: refactor Arm build Juraj Linkeš
2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
2020-10-13 15:47     ` Bruce Richardson
2020-10-14  6:04       ` Juraj Linkeš
2020-10-14  8:16         ` Bruce Richardson
2020-10-14  8:52           ` Juraj Linkeš
2020-10-14  9:22             ` Bruce Richardson
2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 4/6] build: move core and NUMA counts to cross files Juraj Linkeš
2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 5/6] build: disable Arm drivers Juraj Linkeš
2020-10-13 15:49     ` Bruce Richardson
2020-10-13 14:54   ` [dpdk-dev] [RFC PATCH v2 6/6] build: update Arm builds with makefile flags Juraj Linkeš
2020-10-21 11:37   ` [dpdk-dev] [RFC PATCH v3 0/6] Arm build options rework Juraj Linkeš
2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 1/6] build: rename default Arm build to generic-armv8 Juraj Linkeš
2020-10-21 11:52       ` Bruce Richardson
2020-10-21 12:17         ` Juraj Linkeš
2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 2/6] build: refactor Arm build Juraj Linkeš
2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 3/6] build: automatic NUMA and cpu counts detection Juraj Linkeš
2020-10-21 12:02       ` Bruce Richardson
2020-10-21 13:01         ` Juraj Linkeš
2020-10-21 14:13           ` Bruce Richardson
2020-10-21 14:27             ` Bruce Richardson
2020-10-23 10:07               ` Juraj Linkeš
2020-10-27 10:30                 ` Bruce Richardson
2020-10-29  4:31             ` Honnappa Nagarahalli
2020-11-02 13:55               ` Bruce Richardson
2020-11-02 19:01                 ` Honnappa Nagarahalli
2020-11-03  9:44                   ` Bruce Richardson
2020-11-05  9:23                     ` Juraj Linkeš
2020-11-06 23:40                     ` Honnappa Nagarahalli
2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 4/6] build: move core and NUMA counts to cross files Juraj Linkeš
2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 5/6] build: disable Arm drivers Juraj Linkeš
2020-10-21 11:37     ` [dpdk-dev] [RFC PATCH v3 6/6] build: update Arm builds with makefile flags Juraj Linkeš
2020-10-23 14:48     ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Juraj Linkeš
2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 1/6] build: alias default build as generic Juraj Linkeš
2020-10-27  3:53         ` Honnappa Nagarahalli
2020-10-27  7:46           ` Juraj Linkeš
2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 2/6] build: refactor Arm build Juraj Linkeš
2020-10-27  4:56         ` Honnappa Nagarahalli
2020-10-27  8:10           ` Juraj Linkeš
2020-10-27  9:12             ` Juraj Linkeš
2020-10-27 23:17               ` Honnappa Nagarahalli
2020-10-27 23:12             ` Honnappa Nagarahalli
2020-10-28 16:59         ` Honnappa Nagarahalli
2020-10-29  9:12           ` Juraj Linkeš
2020-10-29 20:54             ` Honnappa Nagarahalli
2020-10-30 10:45               ` Juraj Linkeš
2020-11-02 19:32                 ` Honnappa Nagarahalli
2020-11-03 10:54                   ` Juraj Linkeš
2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 3/6] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-10-27 11:20         ` Bruce Richardson
2020-10-27 15:50           ` Juraj Linkeš
2020-10-27 16:04             ` Bruce Richardson
2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 4/6] build: add core and NUMA counts to cross files Juraj Linkeš
2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 5/6] build: disable Arm drivers Juraj Linkeš
2020-10-23 14:48       ` [dpdk-dev] [PATCH v4 6/6] build: update Arm builds with makefile flags Juraj Linkeš
2020-10-27  3:53       ` [dpdk-dev] [PATCH v4 0/6] Arm build options rework Honnappa Nagarahalli
2020-10-27  7:50         ` Juraj Linkeš
2020-10-28 14:03       ` [dpdk-dev] [PATCH v5 00/11] " Juraj Linkeš
2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 01/11] build: alias default build as generic Juraj Linkeš
2020-10-28 14:43           ` Bruce Richardson
2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 02/11] build: rename Arm build variables Juraj Linkeš
2020-11-02  6:50           ` Ruifeng Wang
2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 03/11] build: remove unused or superfluous variables Juraj Linkeš
2020-11-02  7:31           ` Ruifeng Wang
2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 04/11] build: Arm reformat, comments, move config Juraj Linkeš
2020-11-02  8:29           ` Ruifeng Wang
2020-10-28 14:03         ` [dpdk-dev] [PATCH v5 05/11] build: simplify how Arm flags are processed Juraj Linkeš
2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 06/11] build: use dict in Arm part number config Juraj Linkeš
2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 07/11] build: Arm generic and native build setup Juraj Linkeš
2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-10-28 15:04           ` Bruce Richardson
2020-10-30 11:04             ` Juraj Linkeš
2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 09/11] build: add core and NUMA counts to cross files Juraj Linkeš
2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 10/11] build: disable Arm drivers Juraj Linkeš
2020-10-28 14:04         ` [dpdk-dev] [PATCH v5 11/11] build: update Arm builds with makefile flags Juraj Linkeš
2020-10-28 15:08           ` Bruce Richardson
2020-10-30 11:28             ` Juraj Linkeš
2020-10-30 13:38               ` Juraj Linkeš
2020-11-02 13:21         ` [dpdk-dev] [PATCH v6 00/11] Arm build options rework Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 01/11] build: alias default build as generic Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 02/11] build: rename Arm build variables Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 03/11] build: remove unused or superfluous variables Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 04/11] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 05/11] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 06/11] build: use dict in Arm part number config Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 07/11] build: streamline Arm build setup and machine args Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 08/11] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-11-02 14:44             ` Bruce Richardson
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 09/11] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 10/11] build: disable Arm drivers Juraj Linkeš
2020-11-02 13:21           ` [dpdk-dev] [PATCH v6 11/11] build: disable libnuma in cross builds Juraj Linkeš
2020-11-05 13:59           ` [dpdk-dev] [PATCH v7 00/14] Arm build options rework Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 01/14] build: alias default build as generic Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 02/14] build: rename Arm build variables Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 03/14] build: remove unused or superfluous variables Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 04/14] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 05/14] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 06/14] build: organize Arm config into dict Juraj Linkeš
2020-11-05 14:09               ` Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 07/14] build: isolate configuration for generic build Juraj Linkeš
2020-11-05 14:09               ` Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 08/14] build: use native machine args in Arm native build Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 09/14] ci: switch to generic Arm builds Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 10/14] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 11/14] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 12/14] build: disable Arm drivers Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 13/14] build: disable libnuma in cross builds Juraj Linkeš
2020-11-05 13:59             ` [dpdk-dev] [PATCH v7 14/14] build: add Arm SoC meson option Juraj Linkeš
2020-11-06  8:03             ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Juraj Linkeš
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 01/14] build: alias default build as generic Juraj Linkeš
2020-11-06 23:52                 ` Honnappa Nagarahalli
2020-11-09 12:12                   ` Juraj Linkeš
2020-11-09 12:47                     ` Bruce Richardson
2020-11-09 22:54                     ` Honnappa Nagarahalli
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 02/14] build: rename Arm build variables Juraj Linkeš
2020-11-07  0:47                 ` Honnappa Nagarahalli
2020-11-07  0:51                   ` Honnappa Nagarahalli
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 03/14] build: remove unused or superfluous variables Juraj Linkeš
2020-11-07  0:52                 ` Honnappa Nagarahalli
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 04/14] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-08  2:51                 ` Honnappa Nagarahalli
2020-11-09 12:48                   ` Juraj Linkeš
2020-11-10  0:02                     ` Honnappa Nagarahalli
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 05/14] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-08  3:19                 ` Honnappa Nagarahalli
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 06/14] build: organize Arm config into dict Juraj Linkeš
2020-11-08 19:45                 ` Honnappa Nagarahalli
2020-11-09 10:38                   ` Juraj Linkeš
2020-11-09 23:15                     ` Honnappa Nagarahalli
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 07/14] build: isolate configuration for generic build Juraj Linkeš
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 08/14] build: use native machine args in Arm native build Juraj Linkeš
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 09/14] ci: switch to generic Arm builds Juraj Linkeš
2020-11-08 14:42                 ` Honnappa Nagarahalli
2020-11-11 11:45                   ` Juraj Linkeš
2020-11-11 14:52                     ` Ruifeng Wang
2020-11-11 16:19                       ` Juraj Linkeš
2020-11-11 23:47                         ` Honnappa Nagarahalli
2020-11-12 10:36                         ` Ruifeng Wang
2020-11-12 12:43                           ` Juraj Linkeš
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 10/14] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-11-09 22:52                 ` Honnappa Nagarahalli
2020-11-10  8:30                   ` Juraj Linkeš
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 11/14] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 12/14] build: disable Arm drivers Juraj Linkeš
2020-11-08 20:19                 ` Honnappa Nagarahalli
2020-11-09 10:52                   ` Juraj Linkeš
2020-11-09 23:27                     ` Honnappa Nagarahalli
2020-11-10  9:03                       ` Juraj Linkeš
2020-11-10 15:13                         ` Honnappa Nagarahalli
2020-11-11 10:10                         ` Juraj Linkeš
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 13/14] build: disable libnuma in cross builds Juraj Linkeš
2020-11-09  0:24                 ` Honnappa Nagarahalli
2020-11-09 11:10                   ` Juraj Linkeš
2020-11-09 23:29                     ` Honnappa Nagarahalli
2020-11-06  8:03               ` [dpdk-dev] [PATCH v8 14/14] build: add Arm SoC meson option Juraj Linkeš
2020-11-09  2:40                 ` Honnappa Nagarahalli
2020-11-09 11:45                   ` Juraj Linkeš
2020-11-09 23:53                     ` Honnappa Nagarahalli
2020-11-06  8:23               ` [dpdk-dev] [PATCH v8 00/14] Arm build options rework Morten Brørup
2020-11-06  8:39                 ` Juraj Linkeš
2020-11-06  8:56                   ` Morten Brørup
2020-11-06  9:19                     ` Bruce Richardson
2020-11-06  9:14                 ` Bruce Richardson
2020-11-11 13:18               ` [dpdk-dev] [PATCH v9 " Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 01/14] build: alias default build as generic Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 02/14] build: rename Arm build variables Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 03/14] build: remove unused or superfluous variables Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 04/14] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 05/14] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 06/14] build: organize Arm config into dict Juraj Linkeš
2020-11-13  5:48                   ` Honnappa Nagarahalli
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 07/14] build: isolate configuration for generic build Juraj Linkeš
2020-11-13  5:50                   ` Honnappa Nagarahalli
2020-11-13 13:11                   ` Thomas Monjalon
2020-11-13 14:03                     ` Juraj Linkeš
2020-11-13 14:18                       ` Thomas Monjalon
2020-11-13 14:22                         ` Juraj Linkeš
2020-11-13 14:35                           ` Thomas Monjalon
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 08/14] build: use native machine args in Arm native build Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 10/14] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-13  5:53                   ` Honnappa Nagarahalli
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 11/14] build: disable Arm drivers Juraj Linkeš
2020-11-13  5:54                   ` Honnappa Nagarahalli
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 12/14] build: disable libnuma in cross builds Juraj Linkeš
2020-11-13  5:55                   ` Honnappa Nagarahalli
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 13/14] build: add Arm SoC meson option Juraj Linkeš
2020-11-13  5:57                   ` Honnappa Nagarahalli
2020-11-11 13:18                 ` [dpdk-dev] [PATCH v9 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
2020-11-13  6:05                   ` Honnappa Nagarahalli
2020-11-12 17:00                 ` [dpdk-dev] [PATCH v9 00/14] Arm build options rework Jerin Jacob
2020-11-13  6:59                 ` Dharmik Thakkar
2020-11-13 11:09                 ` [dpdk-dev] [PATCH v10 00/15] " Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 01/15] build: alias default build as generic Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 02/15] build: rename Arm build variables Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 03/15] build: remove unused or superfluous variables Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 04/15] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 05/15] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 06/15] build: organize Arm config into dict Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 07/15] build: isolate configuration for generic build Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 08/15] eal/arm: fix clang build of native target Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 09/15] build: use native machine args in Arm native build Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 10/15] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 11/15] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 12/15] build: disable Arm drivers Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 13/15] build: disable libnuma in cross builds Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 14/15] build: add Arm SoC meson option Juraj Linkeš
2020-11-13 11:09                   ` [dpdk-dev] [PATCH v10 15/15] config: fix Arm implementer and its SoCs Juraj Linkeš
2020-11-13 11:37                   ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 01/15] crypto/armv8: replace meson option with pkg-config support Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 02/15] build: alias default build as generic Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 03/15] build: rename Arm build variables Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 04/15] build: remove unused or superfluous variables Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 05/15] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 06/15] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 07/15] build: organize Arm config into dict Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 08/15] build: isolate configuration for generic build Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 09/15] build: use native machine args in Arm native build Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 10/15] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-11-13 11:37                     ` [dpdk-dev] [PATCH v11 11/15] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 12/15] build: disable Arm drivers Juraj Linkeš
2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 13/15] build: disable libnuma in cross builds Juraj Linkeš
2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 14/15] build: add Arm SoC meson option Juraj Linkeš
2020-11-13 11:38                     ` [dpdk-dev] [PATCH v11 15/15] config: fix Arm implementer and its SoCs Juraj Linkeš
2020-11-13 13:51                     ` [dpdk-dev] [PATCH v11 00/15] Arm build options rework Ruifeng Wang
2020-11-13 13:57                       ` Juraj Linkeš
2020-11-13 14:31                     ` [dpdk-dev] [PATCH v12 00/14] " Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 01/14] build: alias default build as generic Juraj Linkeš
2020-11-16  7:32                         ` Thomas Monjalon
2020-11-16 15:50                           ` Juraj Linkeš
2020-11-16 16:16                             ` Bruce Richardson
2020-11-16 20:35                               ` Thomas Monjalon
2020-11-17  2:46                                 ` Honnappa Nagarahalli
2020-11-17  7:49                                   ` Thomas Monjalon
2020-11-17  9:15                                     ` Bruce Richardson
2020-11-17  9:58                                       ` Thomas Monjalon
2020-11-18 14:23                                         ` Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 02/14] build: rename Arm build variables Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 03/14] build: remove unused or superfluous variables Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 04/14] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 05/14] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 06/14] build: organize Arm config into dict Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 07/14] build: isolate configuration for generic build Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 08/14] build: use native machine args in Arm native build Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 09/14] build: optional NUMA and cpu counts detection Juraj Linkeš
2020-11-14 13:16                         ` Thomas Monjalon
2020-11-16  7:15                           ` Juraj Linkeš
2020-11-16  7:19                             ` Thomas Monjalon
2020-11-18 14:20                               ` Juraj Linkeš
2020-11-18 14:32                                 ` Bruce Richardson
2020-11-16  7:37                           ` Thomas Monjalon
2020-11-18 13:24                             ` Juraj Linkeš
2020-11-16  7:24                         ` Thomas Monjalon
2020-11-16  9:13                           ` Bruce Richardson
2020-11-16  9:23                             ` Thomas Monjalon
2020-11-18 14:19                               ` Juraj Linkeš
2020-11-18 14:42                                 ` Thomas Monjalon
2020-11-18 14:54                                   ` Bruce Richardson
2020-11-18 15:04                                     ` Thomas Monjalon
2020-11-18 15:46                                       ` Bruce Richardson
2020-11-18 20:01                                         ` Honnappa Nagarahalli
2020-11-18 15:23                                   ` Juraj Linkeš
2020-11-19 12:19                                     ` Bruce Richardson
2020-11-19 13:57                                       ` Juraj Linkeš
2020-11-19 14:51                                         ` Bruce Richardson
2020-11-20  4:33                                           ` Honnappa Nagarahalli
2020-11-20 10:15                                             ` Bruce Richardson
2020-11-20 10:19                                               ` Bruce Richardson
2020-11-20 11:56                                                 ` Juraj Linkeš
2020-11-20 12:04                                                   ` Bruce Richardson
2020-11-20 15:56                                               ` Honnappa Nagarahalli
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 10/14] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 11/14] build: disable Arm drivers Juraj Linkeš
2020-11-16  7:28                         ` Thomas Monjalon
2020-11-16  7:56                           ` Juraj Linkeš
2020-11-16  8:22                             ` Thomas Monjalon
2020-11-16 15:54                               ` Juraj Linkeš
2020-11-16 20:35                                 ` Thomas Monjalon
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 12/14] build: disable libnuma in cross builds Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 13/14] build: add Arm SoC meson option Juraj Linkeš
2020-11-13 14:31                       ` [dpdk-dev] [PATCH v12 14/14] config: fix Arm implementer and its SoCs Juraj Linkeš
2020-11-14 17:52                         ` [dpdk-dev] [EXT] " Liron Himi
2020-11-13 14:40                       ` [dpdk-dev] [PATCH v12 00/14] Arm build options rework Ruifeng Wang
2020-11-20 12:08                       ` [dpdk-dev] [PATCH v13 00/12] " Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 01/12] build: rename Arm build variables Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 02/12] build: remove unused or superfluous variables Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 03/12] build: reformat and move Arm config and comments Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 04/12] build: simplify how Arm flags are processed Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 05/12] build: organize Arm config into dict Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 07/12] build: use native machine args in Arm native build Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 09/12] build: disable drivers in Arm builds Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 10/12] build: disable libnuma in cross builds Juraj Linkeš
2021-01-11 20:22                           ` Andrew Boyer
2021-01-12  6:54                             ` Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 11/12] build: add Arm SoC meson option Juraj Linkeš
2020-11-20 12:08                         ` [dpdk-dev] [PATCH v13 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
2020-12-16 23:28                         ` [dpdk-dev] [PATCH v13 00/12] Arm build options rework Vimal Chungath
2020-12-23 11:47                         ` [dpdk-dev] [PATCH v14 " Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 01/12] build: rename Arm build variables Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 02/12] build: remove unused or superfluous variables Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 03/12] build: reformat and move Arm config and comments Juraj Linkeš
2021-01-11 20:26                             ` Andrew Boyer
2021-01-12  8:12                               ` Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 04/12] build: simplify how Arm flags are processed Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 05/12] build: organize Arm config into dict Juraj Linkeš
2021-01-15  8:38                             ` Ruifeng Wang
2021-01-15 12:18                               ` Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 07/12] build: use native machine args in Arm native build Juraj Linkeš
2021-01-15  8:39                             ` Ruifeng Wang
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 09/12] build: disable drivers in Arm builds Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 10/12] build: disable libnuma in cross builds Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 11/12] build: add Arm SoC meson option Juraj Linkeš
2020-12-23 11:47                           ` [dpdk-dev] [PATCH v14 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
2020-12-30 19:09                           ` [dpdk-dev] [PATCH v14 00/12] Arm build options rework Andrew Boyer
2020-12-30 20:56                             ` Thomas Monjalon
2021-01-01 17:19                               ` Honnappa Nagarahalli
2021-01-04 22:46                                 ` Andrew Boyer
2021-01-06 13:40                                   ` Bruce Richardson
2021-01-08 17:36                                   ` Bruce Richardson
2021-01-08 20:20                                     ` Honnappa Nagarahalli
2021-01-11  9:38                                       ` Thomas Monjalon
2021-01-11 10:01                                         ` Bruce Richardson
2021-01-11 16:16                                           ` Andrew Boyer
2021-01-11 16:59                                             ` Bruce Richardson
2021-01-12  8:28                                   ` Juraj Linkeš
2021-01-29  8:41                                     ` Juraj Linkeš
2021-01-29  9:45                                       ` Bruce Richardson
2021-01-29 10:07                                         ` Juraj Linkeš
2021-01-29 10:09                                           ` Bruce Richardson
2021-01-05 11:02                           ` Pavan Nikhilesh Bhagavatula
2021-01-05 15:12                             ` Honnappa Nagarahalli
2021-01-22  8:53                               ` Juraj Linkeš
2021-01-27 13:40                                 ` Honnappa Nagarahalli
2021-01-27 15:02                                   ` Pavan Nikhilesh Bhagavatula
2021-01-27 15:12                                     ` Hemant Agrawal
2021-01-27 15:18                                       ` Honnappa Nagarahalli
2021-01-15 13:25                           ` [dpdk-dev] [PATCH v15 " Juraj Linkeš
2021-01-15 13:25                             ` [dpdk-dev] [PATCH v15 01/12] build: rename Arm build variables Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 02/12] build: remove unused or superfluous variables Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 03/12] build: reformat and move Arm config and comments Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 04/12] build: simplify how Arm flags are processed Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 05/12] build: organize Arm config into dict Juraj Linkeš
2021-01-16 14:12                               ` Ruifeng Wang
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 06/12] build: isolate configuration for Arm generic build Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 07/12] build: use native machine args in Arm native build Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 08/12] build: add core and NUMA counts to cross files Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 09/12] build: disable drivers in Arm builds Juraj Linkeš
2021-01-18 13:37                               ` Thomas Monjalon
2021-01-19 15:35                                 ` Juraj Linkeš
2021-01-19 15:55                                   ` Liron Himi
2021-01-20  1:11                                   ` Honnappa Nagarahalli
2021-01-22  8:39                                     ` Juraj Linkeš
2021-01-22  8:58                                       ` Thomas Monjalon
2021-01-22  9:07                                         ` Jerin Jacob
2021-01-22 10:19                                           ` Thomas Monjalon
2021-01-25 14:58                                             ` Honnappa Nagarahalli
2021-01-25 15:28                                               ` Thomas Monjalon
2021-01-25 16:09                                               ` Jerin Jacob
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 10/12] build: disable libnuma in cross builds Juraj Linkeš
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 11/12] build: add Arm SoC meson option Juraj Linkeš
2021-01-18 13:41                               ` Thomas Monjalon
2021-01-19 14:56                                 ` Juraj Linkeš
2021-01-19 15:52                                   ` Thomas Monjalon
2021-01-19 16:04                                     ` Bruce Richardson
2021-01-20  1:04                                       ` Honnappa Nagarahalli
2021-01-20  1:08                                         ` Thomas Monjalon
2021-01-20  2:20                                           ` Honnappa Nagarahalli
2021-01-20  8:41                                             ` Juraj Linkeš
2021-01-20 16:10                                               ` Thomas Monjalon
2021-01-21 15:02                                                 ` Juraj Linkeš
2021-01-21 15:52                                                   ` Thomas Monjalon
2021-01-21 16:12                                                     ` Bruce Richardson
2021-01-21 17:31                                                       ` Thomas Monjalon
2021-01-15 13:26                             ` [dpdk-dev] [PATCH v15 12/12] config: fix Arm implementer and its SoCs Juraj Linkeš
2021-01-18 13:45                               ` Thomas Monjalon
2021-01-18 14:02                                 ` [dpdk-dev] [EXT] " Liron Himi
2021-01-18 15:03                               ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
     [not found]                               ` <DM6PR12MB3753721F869FE4530C0739EADFA40@DM6PR12MB3753.namprd12.prod.outlook.com>
2021-01-19  8:38                                 ` [dpdk-dev] " Slava Ovsiienko
2021-01-18 21:31                             ` [dpdk-dev] [PATCH v15 00/12] Arm build options rework Thomas Monjalon
2021-01-19 15:10                               ` Juraj Linkeš
2021-01-19 15:53                                 ` Thomas Monjalon
2021-02-03 14:03                             ` [dpdk-dev] [PATCH v16 0/3] " Juraj Linkeš
2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
2021-02-19 10:38                                 ` Juraj Linkeš
2021-03-09  8:58                                   ` Juraj Linkeš
2021-03-09 10:56                                     ` Bruce Richardson
2021-03-09 11:49                                       ` Juraj Linkeš
2021-03-09 12:57                                         ` Jerin Jacob
2021-03-09 15:08                                           ` Honnappa Nagarahalli
2021-03-09 15:49                                             ` Juraj Linkeš
2021-03-09 16:04                                               ` Honnappa Nagarahalli
2021-03-09 18:09                                                 ` Juraj Linkeš
2021-03-09 19:54                                                   ` Honnappa Nagarahalli
2021-03-10  7:42                                                     ` Juraj Linkeš
2021-03-10  9:12                                                       ` Jerin Jacob
2021-03-10 19:36                                                         ` Honnappa Nagarahalli
2021-03-11 17:14                                                           ` Jerin Jacob
2021-03-19 13:21                                                             ` Juraj Linkeš
2021-03-19 13:32                                                               ` Jerin Jacob
2021-03-30  0:39                                                                 ` Honnappa Nagarahalli
2021-03-31  8:39                                                                   ` Juraj Linkeš
2021-03-31  9:07                                                                     ` Bruce Richardson
2021-03-31  9:14                                                                       ` Juraj Linkeš
2021-03-09 15:10                                           ` Honnappa Nagarahalli
2021-03-31 10:26                                 ` [dpdk-dev] [PATCH v17 0/3] Arm build options rework Juraj Linkeš
2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
2021-04-09  8:17                                     ` Ruifeng Wang
2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
2021-04-09  8:19                                     ` Ruifeng Wang
2021-03-31 10:26                                   ` [dpdk-dev] [PATCH v17 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
2021-04-09  6:35                                   ` [dpdk-dev] [PATCH v18 0/3] Arm build options rework Juraj Linkeš
2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
2021-04-09  8:21                                       ` Ruifeng Wang
2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
2021-04-09  8:06                                       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-04-09  8:22                                       ` [dpdk-dev] " Ruifeng Wang
2021-04-09  6:35                                     ` [dpdk-dev] [PATCH v18 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
2021-04-09  8:26                                       ` Ruifeng Wang
2021-04-09  8:31                                         ` Juraj Linkeš
2021-04-09  8:41                                     ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Juraj Linkeš
2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
2021-04-09 10:02                                         ` Bruce Richardson
2021-04-09 14:10                                           ` Juraj Linkeš
2021-04-09 14:31                                             ` Bruce Richardson
2021-04-09 15:38                                               ` Bruce Richardson
2021-04-14  9:09                                                 ` Juraj Linkeš
2021-04-14  9:02                                               ` Juraj Linkeš
2021-04-14  9:48                                                 ` Bruce Richardson
2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
2021-04-09  8:41                                       ` [dpdk-dev] [PATCH v19 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
2021-04-09  8:44                                         ` Ruifeng Wang
2021-04-09  8:54                                       ` [dpdk-dev] [PATCH v19 0/3] Arm build options rework Jerin Jacob
2021-04-12  3:57                                       ` Chengchang Tang
2021-04-12 14:10                                         ` Honnappa Nagarahalli
2021-04-12 14:58                                       ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-04-14 12:58                                       ` [dpdk-dev] [PATCH v20 " Juraj Linkeš
2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
2021-04-14 13:27                                           ` Bruce Richardson
2021-04-14 13:33                                             ` Juraj Linkeš
2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
2021-04-14 12:58                                         ` [dpdk-dev] [PATCH v20 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
2021-04-14 13:41                                         ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Juraj Linkeš
2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 1/3] build: disable/enable drivers in Arm builds Juraj Linkeš
2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
2021-04-14 13:41                                           ` [dpdk-dev] [PATCH v21 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš
2021-04-15 20:25                                           ` [dpdk-dev] [PATCH v21 0/3] Arm build options rework Thomas Monjalon
2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 2/3] build: add 'platform' meson option and Arm SoC config Juraj Linkeš
2021-02-03 14:03                               ` [dpdk-dev] [PATCH v16 3/3] config: fix Arm implementer and its SoCs Juraj Linkeš

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).