DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/5] small cleanup and fixes
@ 2019-04-09  9:29 Bruce Richardson
  2019-04-09  9:29 ` Bruce Richardson
                   ` (6 more replies)
  0 siblings, 7 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Made some small changes to meson to shorten the code and increase
readability. While testing, found a number of issues on FreeBSD builds,
which are fixed in this set too.

Bruce Richardson (5):
  build: simplify subdirectory detection for EAL
  build: increase readability via shortcut variables
  distributor: skip building if power library not found
  examples/l2fwd-cat: fix build on FreeBSD
  devtools/test-meson-builds: fix support for FreeBSD

 app/meson.build                          |  2 +-
 buildtools/meson.build                   |  2 +-
 config/meson.build                       | 21 +++++++++++++++++----
 config/x86/meson.build                   |  2 +-
 devtools/test-meson-builds.sh            |  5 ++++-
 doc/guides/contributing/coding_style.rst |  2 +-
 drivers/bus/dpaa/meson.build             |  2 +-
 drivers/bus/fslmc/meson.build            |  2 +-
 drivers/bus/pci/meson.build              |  2 +-
 drivers/bus/vmbus/meson.build            |  2 +-
 drivers/common/dpaax/meson.build         |  2 +-
 drivers/crypto/caam_jr/meson.build       |  2 +-
 drivers/crypto/ccp/meson.build           |  2 +-
 drivers/crypto/dpaa2_sec/meson.build     |  2 +-
 drivers/crypto/dpaa_sec/meson.build      |  2 +-
 drivers/crypto/octeontx/meson.build      |  2 +-
 drivers/event/dpaa/meson.build           |  2 +-
 drivers/event/dpaa2/meson.build          |  2 +-
 drivers/mempool/dpaa/meson.build         |  2 +-
 drivers/mempool/dpaa2/meson.build        |  2 +-
 drivers/meson.build                      |  2 +-
 drivers/net/af_packet/meson.build        |  2 +-
 drivers/net/avp/meson.build              |  2 +-
 drivers/net/axgbe/meson.build            |  2 +-
 drivers/net/dpaa/meson.build             |  2 +-
 drivers/net/dpaa2/meson.build            |  2 +-
 drivers/net/enetc/meson.build            |  2 +-
 drivers/net/failsafe/meson.build         |  2 +-
 drivers/net/nfp/meson.build              |  2 +-
 drivers/net/softnic/meson.build          |  2 +-
 drivers/net/tap/meson.build              |  2 +-
 drivers/net/vdev_netvsc/meson.build      |  2 +-
 drivers/net/virtio/meson.build           |  2 +-
 examples/distributor/meson.build         |  3 +++
 examples/l2fwd-cat/cat.c                 |  2 +-
 examples/l3fwd-power/meson.build         |  2 +-
 examples/meson.build                     |  2 +-
 examples/tep_termination/meson.build     |  2 +-
 examples/vdpa/meson.build                |  4 ++--
 examples/vhost/meson.build               |  2 +-
 examples/vhost_scsi/meson.build          |  2 +-
 kernel/meson.build                       |  2 +-
 lib/librte_eal/meson.build               | 17 ++---------------
 lib/librte_eventdev/meson.build          |  2 +-
 lib/librte_kni/meson.build               |  2 +-
 lib/librte_power/meson.build             |  2 +-
 lib/librte_vhost/meson.build             |  2 +-
 lib/meson.build                          |  4 ++--
 48 files changed, 72 insertions(+), 66 deletions(-)

-- 
2.20.1

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

* [dpdk-dev] [PATCH 0/5] small cleanup and fixes
  2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
@ 2019-04-09  9:29 ` Bruce Richardson
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL Bruce Richardson
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Made some small changes to meson to shorten the code and increase
readability. While testing, found a number of issues on FreeBSD builds,
which are fixed in this set too.

Bruce Richardson (5):
  build: simplify subdirectory detection for EAL
  build: increase readability via shortcut variables
  distributor: skip building if power library not found
  examples/l2fwd-cat: fix build on FreeBSD
  devtools/test-meson-builds: fix support for FreeBSD

 app/meson.build                          |  2 +-
 buildtools/meson.build                   |  2 +-
 config/meson.build                       | 21 +++++++++++++++++----
 config/x86/meson.build                   |  2 +-
 devtools/test-meson-builds.sh            |  5 ++++-
 doc/guides/contributing/coding_style.rst |  2 +-
 drivers/bus/dpaa/meson.build             |  2 +-
 drivers/bus/fslmc/meson.build            |  2 +-
 drivers/bus/pci/meson.build              |  2 +-
 drivers/bus/vmbus/meson.build            |  2 +-
 drivers/common/dpaax/meson.build         |  2 +-
 drivers/crypto/caam_jr/meson.build       |  2 +-
 drivers/crypto/ccp/meson.build           |  2 +-
 drivers/crypto/dpaa2_sec/meson.build     |  2 +-
 drivers/crypto/dpaa_sec/meson.build      |  2 +-
 drivers/crypto/octeontx/meson.build      |  2 +-
 drivers/event/dpaa/meson.build           |  2 +-
 drivers/event/dpaa2/meson.build          |  2 +-
 drivers/mempool/dpaa/meson.build         |  2 +-
 drivers/mempool/dpaa2/meson.build        |  2 +-
 drivers/meson.build                      |  2 +-
 drivers/net/af_packet/meson.build        |  2 +-
 drivers/net/avp/meson.build              |  2 +-
 drivers/net/axgbe/meson.build            |  2 +-
 drivers/net/dpaa/meson.build             |  2 +-
 drivers/net/dpaa2/meson.build            |  2 +-
 drivers/net/enetc/meson.build            |  2 +-
 drivers/net/failsafe/meson.build         |  2 +-
 drivers/net/nfp/meson.build              |  2 +-
 drivers/net/softnic/meson.build          |  2 +-
 drivers/net/tap/meson.build              |  2 +-
 drivers/net/vdev_netvsc/meson.build      |  2 +-
 drivers/net/virtio/meson.build           |  2 +-
 examples/distributor/meson.build         |  3 +++
 examples/l2fwd-cat/cat.c                 |  2 +-
 examples/l3fwd-power/meson.build         |  2 +-
 examples/meson.build                     |  2 +-
 examples/tep_termination/meson.build     |  2 +-
 examples/vdpa/meson.build                |  4 ++--
 examples/vhost/meson.build               |  2 +-
 examples/vhost_scsi/meson.build          |  2 +-
 kernel/meson.build                       |  2 +-
 lib/librte_eal/meson.build               | 17 ++---------------
 lib/librte_eventdev/meson.build          |  2 +-
 lib/librte_kni/meson.build               |  2 +-
 lib/librte_power/meson.build             |  2 +-
 lib/librte_vhost/meson.build             |  2 +-
 lib/meson.build                          |  4 ++--
 48 files changed, 72 insertions(+), 66 deletions(-)

-- 
2.20.1


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

* [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
  2019-04-09  9:29 ` Bruce Richardson
@ 2019-04-09  9:29 ` Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
  2019-04-09 10:34   ` Luca Boccassi
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables Bruce Richardson
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Within EAL we had a series of if statements for selecting the EAL directory
to use. Now that the directory names match those of the OS's they are for
we can instead just use a generated subdirectory name, shortening the code.
To avoid strange errors, we still need to check for unsupported OS's, but
do this check up-front in the config meson.build file.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build         |  7 +++++++
 lib/librte_eal/meson.build | 17 ++---------------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 483139b10..ce6af2595 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -1,6 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
+# check the OS is supported, rather than going any further
+supported_exec_envs = ['freebsd', 'linux', 'windows']
+exec_env = host_machine.system()
+if not supported_exec_envs.contains(exec_env)
+	error('unsupported system type "@0@"'.format(exec_env))
+endif
+
 # set the major version, which might be used by drivers and libraries
 # depending on the configuration options
 pver = meson.project_version().split('.')
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index 1863622c0..fa36b20e0 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -9,21 +9,8 @@ subdir('common') # defines common_sources, common_objs, etc.
 
 # Now do OS/exec-env specific settings, including building kernel modules
 # The <exec-env>/eal/meson.build file should define env_sources, etc.
-if host_machine.system() == 'linux'
-	dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1)
-	subdir('linux/eal')
-
-elif host_machine.system() == 'freebsd'
-	dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1)
-	subdir('freebsd/eal')
-
-elif host_machine.system() == 'windows'
-	dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1)
-	subdir('windows/eal')
-
-else
-	error('unsupported system type "@0@"'.format(host_machine.system()))
-endif
+dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
+subdir(exec_env + '/eal')
 
 version = 10  # the version of the EAL API
 allow_experimental_apis = true
-- 
2.20.1

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

* [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL Bruce Richardson
@ 2019-04-09  9:29   ` Bruce Richardson
  2019-04-09 10:34   ` Luca Boccassi
  1 sibling, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Within EAL we had a series of if statements for selecting the EAL directory
to use. Now that the directory names match those of the OS's they are for
we can instead just use a generated subdirectory name, shortening the code.
To avoid strange errors, we still need to check for unsupported OS's, but
do this check up-front in the config meson.build file.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build         |  7 +++++++
 lib/librte_eal/meson.build | 17 ++---------------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 483139b10..ce6af2595 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -1,6 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
+# check the OS is supported, rather than going any further
+supported_exec_envs = ['freebsd', 'linux', 'windows']
+exec_env = host_machine.system()
+if not supported_exec_envs.contains(exec_env)
+	error('unsupported system type "@0@"'.format(exec_env))
+endif
+
 # set the major version, which might be used by drivers and libraries
 # depending on the configuration options
 pver = meson.project_version().split('.')
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
index 1863622c0..fa36b20e0 100644
--- a/lib/librte_eal/meson.build
+++ b/lib/librte_eal/meson.build
@@ -9,21 +9,8 @@ subdir('common') # defines common_sources, common_objs, etc.
 
 # Now do OS/exec-env specific settings, including building kernel modules
 # The <exec-env>/eal/meson.build file should define env_sources, etc.
-if host_machine.system() == 'linux'
-	dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1)
-	subdir('linux/eal')
-
-elif host_machine.system() == 'freebsd'
-	dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1)
-	subdir('freebsd/eal')
-
-elif host_machine.system() == 'windows'
-	dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1)
-	subdir('windows/eal')
-
-else
-	error('unsupported system type "@0@"'.format(host_machine.system()))
-endif
+dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
+subdir(exec_env + '/eal')
 
 version = 10  # the version of the EAL API
 allow_experimental_apis = true
-- 
2.20.1


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

* [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables
  2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
  2019-04-09  9:29 ` Bruce Richardson
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL Bruce Richardson
@ 2019-04-09  9:29 ` Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
  2019-04-09 10:35   ` Luca Boccassi
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found Bruce Richardson
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Define variables for "is_linux", "is_freebsd" and "is_windows"
to make the code shorter for comparisons and more readable.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/meson.build                          |  2 +-
 buildtools/meson.build                   |  2 +-
 config/meson.build                       | 14 ++++++++++----
 config/x86/meson.build                   |  2 +-
 doc/guides/contributing/coding_style.rst |  2 +-
 drivers/bus/dpaa/meson.build             |  2 +-
 drivers/bus/fslmc/meson.build            |  2 +-
 drivers/bus/pci/meson.build              |  2 +-
 drivers/bus/vmbus/meson.build            |  2 +-
 drivers/common/dpaax/meson.build         |  2 +-
 drivers/crypto/caam_jr/meson.build       |  2 +-
 drivers/crypto/ccp/meson.build           |  2 +-
 drivers/crypto/dpaa2_sec/meson.build     |  2 +-
 drivers/crypto/dpaa_sec/meson.build      |  2 +-
 drivers/crypto/octeontx/meson.build      |  2 +-
 drivers/event/dpaa/meson.build           |  2 +-
 drivers/event/dpaa2/meson.build          |  2 +-
 drivers/mempool/dpaa/meson.build         |  2 +-
 drivers/mempool/dpaa2/meson.build        |  2 +-
 drivers/meson.build                      |  2 +-
 drivers/net/af_packet/meson.build        |  2 +-
 drivers/net/avp/meson.build              |  2 +-
 drivers/net/axgbe/meson.build            |  2 +-
 drivers/net/dpaa/meson.build             |  2 +-
 drivers/net/dpaa2/meson.build            |  2 +-
 drivers/net/enetc/meson.build            |  2 +-
 drivers/net/failsafe/meson.build         |  2 +-
 drivers/net/nfp/meson.build              |  2 +-
 drivers/net/softnic/meson.build          |  2 +-
 drivers/net/tap/meson.build              |  2 +-
 drivers/net/vdev_netvsc/meson.build      |  2 +-
 drivers/net/virtio/meson.build           |  2 +-
 examples/l3fwd-power/meson.build         |  2 +-
 examples/meson.build                     |  2 +-
 examples/tep_termination/meson.build     |  2 +-
 examples/vdpa/meson.build                |  4 ++--
 examples/vhost/meson.build               |  2 +-
 examples/vhost_scsi/meson.build          |  2 +-
 kernel/meson.build                       |  2 +-
 lib/librte_eventdev/meson.build          |  2 +-
 lib/librte_kni/meson.build               |  2 +-
 lib/librte_power/meson.build             |  2 +-
 lib/librte_vhost/meson.build             |  2 +-
 lib/meson.build                          |  4 ++--
 44 files changed, 55 insertions(+), 49 deletions(-)

diff --git a/app/meson.build b/app/meson.build
index e949624b7..2b9fdef74 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-if host_machine.system() == 'windows'
+if is_windows
 	subdir_done()
 endif
 
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 0209bec8f..0d3a42c01 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-if host_machine.system() == 'windows'
+if is_windows
 	subdir_done()
 endif
 
diff --git a/config/meson.build b/config/meson.build
index ce6af2595..f8aded6ed 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -8,6 +8,12 @@ if not supported_exec_envs.contains(exec_env)
 	error('unsupported system type "@0@"'.format(exec_env))
 endif
 
+# define a handy variable for checking which OS we have.
+# gives us "is_windows", "is_freebsd" and "is_linux"
+foreach env:supported_exec_envs
+	set_variable('is_' + env, exec_env == env)
+endforeach
+
 # set the major version, which might be used by drivers and libraries
 # depending on the configuration options
 pver = meson.project_version().split('.')
@@ -95,9 +101,9 @@ if cc.find_library('libm', required : false).found()
 endif
 
 # for linux link against dl, for bsd execinfo
-if host_machine.system() == 'linux'
+if is_linux
 	link_lib = 'dl'
-elif host_machine.system() == 'freebsd'
+elif is_freebsd
 	link_lib = 'execinfo'
 else
 	link_lib = ''
@@ -120,7 +126,7 @@ if numa_dep.found() and cc.has_header('numaif.h')
 endif
 
 # check for strlcpy
-if host_machine.system() == 'linux'
+if is_linux
 	libbsd = dependency('libbsd', required: false)
 	if libbsd.found()
 		dpdk_conf.set('RTE_USE_LIBBSD', 1)
@@ -175,4 +181,4 @@ dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 install_headers('rte_config.h', subdir: get_option('include_subdir_arch'))
 
 # enable VFIO only if it is linux OS
-dpdk_conf.set('RTE_EAL_VFIO', host_machine.system() == 'linux')
+dpdk_conf.set('RTE_EAL_VFIO', is_linux)
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 558edfda9..2b2d06281 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -5,7 +5,7 @@
 march_opt = ['-march=@0@'.format(machine)]
 
 # get binutils version for the workaround of Bug 97
-if host_machine.system() != 'windows'
+if not is_windows
 	ldver = run_command('ld', '-v').stdout().strip()
 	if ldver.contains('2.30')
 		if cc.has_argument('-mno-avx512f')
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 656563dde..a5d5897f3 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -856,7 +856,7 @@ build
 
 .. code-block:: python
 
-	if host_machine.system() != 'linux'
+	if not is_linux
 	        build = false
 	endif
 
diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build
index 1fcb4e913..1c8ca8c9a 100644
--- a/drivers/bus/dpaa/meson.build
+++ b/drivers/bus/dpaa/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/bus/fslmc/meson.build b/drivers/bus/fslmc/meson.build
index 4b0521577..04624c363 100644
--- a/drivers/bus/fslmc/meson.build
+++ b/drivers/bus/fslmc/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/bus/pci/meson.build b/drivers/bus/pci/meson.build
index a3140ff97..a312ecc03 100644
--- a/drivers/bus/pci/meson.build
+++ b/drivers/bus/pci/meson.build
@@ -8,7 +8,7 @@ install_headers('rte_bus_pci.h')
 sources = files('pci_common.c',
 	'pci_common_uio.c',
 	'pci_params.c')
-if host_machine.system() == 'linux'
+if is_linux
 	sources += files('linux/pci.c',
 			'linux/pci_uio.c',
 			'linux/pci_vfio.c')
diff --git a/drivers/bus/vmbus/meson.build b/drivers/bus/vmbus/meson.build
index 0e4d058ee..9fd430dae 100644
--- a/drivers/bus/vmbus/meson.build
+++ b/drivers/bus/vmbus/meson.build
@@ -11,7 +11,7 @@ sources = files('vmbus_common.c',
 		'vmbus_bufring.c',
 		'vmbus_common_uio.c')
 
-if host_machine.system() == 'linux'
+if is_linux
 	sources += files('linux/vmbus_bus.c',
 			'linux/vmbus_uio.c')
 	includes += include_directories('linux')
diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build
index 98a1bdd48..78378e2a6 100644
--- a/drivers/common/dpaax/meson.build
+++ b/drivers/common/dpaax/meson.build
@@ -3,7 +3,7 @@
 
 allow_experimental_apis = true
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build
index 99b71aef1..e61a13c25 100644
--- a/drivers/crypto/caam_jr/meson.build
+++ b/drivers/crypto/caam_jr/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/ccp/meson.build b/drivers/crypto/ccp/meson.build
index 915c4c854..071ccc5e7 100644
--- a/drivers/crypto/ccp/meson.build
+++ b/drivers/crypto/ccp/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 dep = dependency('libcrypto', required: false)
diff --git a/drivers/crypto/dpaa2_sec/meson.build b/drivers/crypto/dpaa2_sec/meson.build
index 8fa4827ed..d197cda1a 100644
--- a/drivers/crypto/dpaa2_sec/meson.build
+++ b/drivers/crypto/dpaa2_sec/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build
index 8a5709846..134af88da 100644
--- a/drivers/crypto/dpaa_sec/meson.build
+++ b/drivers/crypto/dpaa_sec/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/octeontx/meson.build b/drivers/crypto/octeontx/meson.build
index 423737ee1..a9f2d3157 100644
--- a/drivers/crypto/octeontx/meson.build
+++ b/drivers/crypto/octeontx/meson.build
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cavium, Inc
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/drivers/event/dpaa/meson.build b/drivers/event/dpaa/meson.build
index 0914f858e..11b1fe669 100644
--- a/drivers/event/dpaa/meson.build
+++ b/drivers/event/dpaa/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['pmd_dpaa']
diff --git a/drivers/event/dpaa2/meson.build b/drivers/event/dpaa2/meson.build
index a0db6fc21..a94bc5643 100644
--- a/drivers/event/dpaa2/meson.build
+++ b/drivers/event/dpaa2/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['bus_vdev', 'pmd_dpaa2', 'pmd_dpaa2_sec']
diff --git a/drivers/mempool/dpaa/meson.build b/drivers/mempool/dpaa/meson.build
index 9163b3db3..c4c8ebc09 100644
--- a/drivers/mempool/dpaa/meson.build
+++ b/drivers/mempool/dpaa/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/mempool/dpaa2/meson.build b/drivers/mempool/dpaa2/meson.build
index 6b6ead617..9a8b28d7c 100644
--- a/drivers/mempool/dpaa2/meson.build
+++ b/drivers/mempool/dpaa2/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/meson.build b/drivers/meson.build
index 7520a16e3..4c444f495 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-if host_machine.system() == 'windows'
+if is_windows
 	subdir_done()
 endif
 
diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
index 92f6a9715..92c306c73 100644
--- a/drivers/net/af_packet/meson.build
+++ b/drivers/net/af_packet/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 sources = files('rte_eth_af_packet.c')
diff --git a/drivers/net/avp/meson.build b/drivers/net/avp/meson.build
index b7ffdfc80..8138cb22d 100644
--- a/drivers/net/avp/meson.build
+++ b/drivers/net/avp/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files('avp_ethdev.c')
diff --git a/drivers/net/axgbe/meson.build b/drivers/net/axgbe/meson.build
index 548ffff7a..6decb25d4 100644
--- a/drivers/net/axgbe/meson.build
+++ b/drivers/net/axgbe/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/drivers/net/dpaa/meson.build b/drivers/net/dpaa/meson.build
index 62dec7b04..8e5418bd6 100644
--- a/drivers/net/dpaa/meson.build
+++ b/drivers/net/dpaa/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['mempool_dpaa']
diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build
index 53e1d8189..a0ea99238 100644
--- a/drivers/net/dpaa2/meson.build
+++ b/drivers/net/dpaa2/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/net/enetc/meson.build b/drivers/net/enetc/meson.build
index 733156bbf..7d0c2ffe7 100644
--- a/drivers/net/enetc/meson.build
+++ b/drivers/net/enetc/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/drivers/net/failsafe/meson.build b/drivers/net/failsafe/meson.build
index a249ff4af..dfd4067cb 100644
--- a/drivers/net/failsafe/meson.build
+++ b/drivers/net/failsafe/meson.build
@@ -5,7 +5,7 @@ cflags += '-std=gnu99'
 cflags += '-D_DEFAULT_SOURCE'
 cflags += '-D_XOPEN_SOURCE=700'
 cflags += '-pedantic'
-if host_machine.system() == 'linux'
+if is_linux
 	cflags += '-DLINUX'
 else
 	cflags += '-DBSD'
diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build
index ba6a22e8b..ea51ac3c3 100644
--- a/drivers/net/nfp/meson.build
+++ b/drivers/net/nfp/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files('nfpcore/nfp_cpp_pcie_ops.c',
diff --git a/drivers/net/softnic/meson.build b/drivers/net/softnic/meson.build
index da249c068..dd1d610ea 100644
--- a/drivers/net/softnic/meson.build
+++ b/drivers/net/softnic/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 allow_experimental_apis = true
diff --git a/drivers/net/tap/meson.build b/drivers/net/tap/meson.build
index 9cb7142a0..c407a1f35 100644
--- a/drivers/net/tap/meson.build
+++ b/drivers/net/tap/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 Luca Boccassi <bluca@debian.org>
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files(
diff --git a/drivers/net/vdev_netvsc/meson.build b/drivers/net/vdev_netvsc/meson.build
index d3ada878a..6655859f8 100644
--- a/drivers/net/vdev_netvsc/meson.build
+++ b/drivers/net/vdev_netvsc/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files('vdev_netvsc.c')
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index e43ce6bbc..794905401 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -15,7 +15,7 @@ elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64')
 	sources += files('virtio_rxtx_simple_neon.c')
 endif
 
-if host_machine.system() == 'linux'
+if is_linux
 	dpdk_conf.set('RTE_VIRTIO_USER', 1)
 
 	sources += files('virtio_user_ethdev.c',
diff --git a/examples/l3fwd-power/meson.build b/examples/l3fwd-power/meson.build
index a3c5c2f14..2c84123b6 100644
--- a/examples/l3fwd-power/meson.build
+++ b/examples/l3fwd-power/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 allow_experimental_apis = true
diff --git a/examples/meson.build b/examples/meson.build
index d72382fca..e4babf6bf 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -36,7 +36,7 @@ foreach example: examples
 	ext_deps = [execinfo]
 	includes = [include_directories(example)]
 	deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
-	if host_machine.system() == 'windows'
+	if is_windows
 		deps = ['eal'] # only supported lib on Windows currently
 	endif
 	subdir(example)
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index 6d3636243..a75cc7100 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['hash', 'vhost']
diff --git a/examples/vdpa/meson.build b/examples/vdpa/meson.build
index 2e38a069f..73f129cd9 100644
--- a/examples/vdpa/meson.build
+++ b/examples/vdpa/meson.build
@@ -6,11 +6,11 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += 'vhost'
 allow_experimental_apis = true
 sources = files(
 	'main.c'
-)
\ No newline at end of file
+)
diff --git a/examples/vhost/meson.build b/examples/vhost/meson.build
index 7b498076c..872d51153 100644
--- a/examples/vhost/meson.build
+++ b/examples/vhost/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += 'vhost'
diff --git a/examples/vhost_scsi/meson.build b/examples/vhost_scsi/meson.build
index ca1248023..2e9339aa7 100644
--- a/examples/vhost_scsi/meson.build
+++ b/examples/vhost_scsi/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/kernel/meson.build b/kernel/meson.build
index 2c8fa76d0..b247e2df4 100644
--- a/kernel/meson.build
+++ b/kernel/meson.build
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-subdir(host_machine.system())
+subdir(exec_env)
diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build
index 6becfe86d..6cfe60e1f 100644
--- a/lib/librte_eventdev/meson.build
+++ b/lib/librte_eventdev/meson.build
@@ -4,7 +4,7 @@
 version = 6
 allow_experimental_apis = true
 
-if host_machine.system() == 'linux'
+if is_linux
 	cflags += '-DLINUX'
 else
 	cflags += '-DBSD'
diff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build
index 055ae1227..400af9a4d 100644
--- a/lib/librte_kni/meson.build
+++ b/lib/librte_kni/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if host_machine.system() != 'linux' or not dpdk_conf.get('RTE_ARCH_64')
+if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
 	build = false
 endif
 version = 2
diff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build
index 02e0337ce..cc6c30075 100644
--- a/lib/librte_power/meson.build
+++ b/lib/librte_power/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 sources = files('rte_power.c', 'power_acpi_cpufreq.c',
diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
index e33e6fc16..3090bbe08 100644
--- a/lib/librte_vhost/meson.build
+++ b/lib/librte_vhost/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 if has_libnuma == 1
diff --git a/lib/meson.build b/lib/meson.build
index 595314d7d..a379dd682 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -30,7 +30,7 @@ libraries = [
 	# flow_classify lib depends on pkt framework table lib
 	'flow_classify', 'bpf', 'telemetry']
 
-if host_machine.system() == 'windows'
+if is_windows
 	libraries = ['kvargs','eal'] # only supported libraries for windows
 endif
 
@@ -123,7 +123,7 @@ foreach l:libraries
 					meson.current_source_dir(), dir_name, name)
 			exports = []
 			implib = dir_name + '.dll.a'
-			if host_machine.system() == 'windows'
+			if is_windows
 				exports = '@0@/@1@/rte_@2@_exports.def'.format(
 					meson.current_source_dir(), dir_name, name)
 				lk_args = ['-Wl,/def:' + exports, '-Wl,/implib:lib\\' + implib]
-- 
2.20.1

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

* [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables Bruce Richardson
@ 2019-04-09  9:29   ` Bruce Richardson
  2019-04-09 10:35   ` Luca Boccassi
  1 sibling, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Define variables for "is_linux", "is_freebsd" and "is_windows"
to make the code shorter for comparisons and more readable.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/meson.build                          |  2 +-
 buildtools/meson.build                   |  2 +-
 config/meson.build                       | 14 ++++++++++----
 config/x86/meson.build                   |  2 +-
 doc/guides/contributing/coding_style.rst |  2 +-
 drivers/bus/dpaa/meson.build             |  2 +-
 drivers/bus/fslmc/meson.build            |  2 +-
 drivers/bus/pci/meson.build              |  2 +-
 drivers/bus/vmbus/meson.build            |  2 +-
 drivers/common/dpaax/meson.build         |  2 +-
 drivers/crypto/caam_jr/meson.build       |  2 +-
 drivers/crypto/ccp/meson.build           |  2 +-
 drivers/crypto/dpaa2_sec/meson.build     |  2 +-
 drivers/crypto/dpaa_sec/meson.build      |  2 +-
 drivers/crypto/octeontx/meson.build      |  2 +-
 drivers/event/dpaa/meson.build           |  2 +-
 drivers/event/dpaa2/meson.build          |  2 +-
 drivers/mempool/dpaa/meson.build         |  2 +-
 drivers/mempool/dpaa2/meson.build        |  2 +-
 drivers/meson.build                      |  2 +-
 drivers/net/af_packet/meson.build        |  2 +-
 drivers/net/avp/meson.build              |  2 +-
 drivers/net/axgbe/meson.build            |  2 +-
 drivers/net/dpaa/meson.build             |  2 +-
 drivers/net/dpaa2/meson.build            |  2 +-
 drivers/net/enetc/meson.build            |  2 +-
 drivers/net/failsafe/meson.build         |  2 +-
 drivers/net/nfp/meson.build              |  2 +-
 drivers/net/softnic/meson.build          |  2 +-
 drivers/net/tap/meson.build              |  2 +-
 drivers/net/vdev_netvsc/meson.build      |  2 +-
 drivers/net/virtio/meson.build           |  2 +-
 examples/l3fwd-power/meson.build         |  2 +-
 examples/meson.build                     |  2 +-
 examples/tep_termination/meson.build     |  2 +-
 examples/vdpa/meson.build                |  4 ++--
 examples/vhost/meson.build               |  2 +-
 examples/vhost_scsi/meson.build          |  2 +-
 kernel/meson.build                       |  2 +-
 lib/librte_eventdev/meson.build          |  2 +-
 lib/librte_kni/meson.build               |  2 +-
 lib/librte_power/meson.build             |  2 +-
 lib/librte_vhost/meson.build             |  2 +-
 lib/meson.build                          |  4 ++--
 44 files changed, 55 insertions(+), 49 deletions(-)

diff --git a/app/meson.build b/app/meson.build
index e949624b7..2b9fdef74 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-if host_machine.system() == 'windows'
+if is_windows
 	subdir_done()
 endif
 
diff --git a/buildtools/meson.build b/buildtools/meson.build
index 0209bec8f..0d3a42c01 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-if host_machine.system() == 'windows'
+if is_windows
 	subdir_done()
 endif
 
diff --git a/config/meson.build b/config/meson.build
index ce6af2595..f8aded6ed 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -8,6 +8,12 @@ if not supported_exec_envs.contains(exec_env)
 	error('unsupported system type "@0@"'.format(exec_env))
 endif
 
+# define a handy variable for checking which OS we have.
+# gives us "is_windows", "is_freebsd" and "is_linux"
+foreach env:supported_exec_envs
+	set_variable('is_' + env, exec_env == env)
+endforeach
+
 # set the major version, which might be used by drivers and libraries
 # depending on the configuration options
 pver = meson.project_version().split('.')
@@ -95,9 +101,9 @@ if cc.find_library('libm', required : false).found()
 endif
 
 # for linux link against dl, for bsd execinfo
-if host_machine.system() == 'linux'
+if is_linux
 	link_lib = 'dl'
-elif host_machine.system() == 'freebsd'
+elif is_freebsd
 	link_lib = 'execinfo'
 else
 	link_lib = ''
@@ -120,7 +126,7 @@ if numa_dep.found() and cc.has_header('numaif.h')
 endif
 
 # check for strlcpy
-if host_machine.system() == 'linux'
+if is_linux
 	libbsd = dependency('libbsd', required: false)
 	if libbsd.found()
 		dpdk_conf.set('RTE_USE_LIBBSD', 1)
@@ -175,4 +181,4 @@ dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 install_headers('rte_config.h', subdir: get_option('include_subdir_arch'))
 
 # enable VFIO only if it is linux OS
-dpdk_conf.set('RTE_EAL_VFIO', host_machine.system() == 'linux')
+dpdk_conf.set('RTE_EAL_VFIO', is_linux)
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 558edfda9..2b2d06281 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -5,7 +5,7 @@
 march_opt = ['-march=@0@'.format(machine)]
 
 # get binutils version for the workaround of Bug 97
-if host_machine.system() != 'windows'
+if not is_windows
 	ldver = run_command('ld', '-v').stdout().strip()
 	if ldver.contains('2.30')
 		if cc.has_argument('-mno-avx512f')
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 656563dde..a5d5897f3 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -856,7 +856,7 @@ build
 
 .. code-block:: python
 
-	if host_machine.system() != 'linux'
+	if not is_linux
 	        build = false
 	endif
 
diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build
index 1fcb4e913..1c8ca8c9a 100644
--- a/drivers/bus/dpaa/meson.build
+++ b/drivers/bus/dpaa/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/bus/fslmc/meson.build b/drivers/bus/fslmc/meson.build
index 4b0521577..04624c363 100644
--- a/drivers/bus/fslmc/meson.build
+++ b/drivers/bus/fslmc/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/bus/pci/meson.build b/drivers/bus/pci/meson.build
index a3140ff97..a312ecc03 100644
--- a/drivers/bus/pci/meson.build
+++ b/drivers/bus/pci/meson.build
@@ -8,7 +8,7 @@ install_headers('rte_bus_pci.h')
 sources = files('pci_common.c',
 	'pci_common_uio.c',
 	'pci_params.c')
-if host_machine.system() == 'linux'
+if is_linux
 	sources += files('linux/pci.c',
 			'linux/pci_uio.c',
 			'linux/pci_vfio.c')
diff --git a/drivers/bus/vmbus/meson.build b/drivers/bus/vmbus/meson.build
index 0e4d058ee..9fd430dae 100644
--- a/drivers/bus/vmbus/meson.build
+++ b/drivers/bus/vmbus/meson.build
@@ -11,7 +11,7 @@ sources = files('vmbus_common.c',
 		'vmbus_bufring.c',
 		'vmbus_common_uio.c')
 
-if host_machine.system() == 'linux'
+if is_linux
 	sources += files('linux/vmbus_bus.c',
 			'linux/vmbus_uio.c')
 	includes += include_directories('linux')
diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build
index 98a1bdd48..78378e2a6 100644
--- a/drivers/common/dpaax/meson.build
+++ b/drivers/common/dpaax/meson.build
@@ -3,7 +3,7 @@
 
 allow_experimental_apis = true
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/caam_jr/meson.build b/drivers/crypto/caam_jr/meson.build
index 99b71aef1..e61a13c25 100644
--- a/drivers/crypto/caam_jr/meson.build
+++ b/drivers/crypto/caam_jr/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/ccp/meson.build b/drivers/crypto/ccp/meson.build
index 915c4c854..071ccc5e7 100644
--- a/drivers/crypto/ccp/meson.build
+++ b/drivers/crypto/ccp/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 dep = dependency('libcrypto', required: false)
diff --git a/drivers/crypto/dpaa2_sec/meson.build b/drivers/crypto/dpaa2_sec/meson.build
index 8fa4827ed..d197cda1a 100644
--- a/drivers/crypto/dpaa2_sec/meson.build
+++ b/drivers/crypto/dpaa2_sec/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/dpaa_sec/meson.build b/drivers/crypto/dpaa_sec/meson.build
index 8a5709846..134af88da 100644
--- a/drivers/crypto/dpaa_sec/meson.build
+++ b/drivers/crypto/dpaa_sec/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/crypto/octeontx/meson.build b/drivers/crypto/octeontx/meson.build
index 423737ee1..a9f2d3157 100644
--- a/drivers/crypto/octeontx/meson.build
+++ b/drivers/crypto/octeontx/meson.build
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Cavium, Inc
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/drivers/event/dpaa/meson.build b/drivers/event/dpaa/meson.build
index 0914f858e..11b1fe669 100644
--- a/drivers/event/dpaa/meson.build
+++ b/drivers/event/dpaa/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['pmd_dpaa']
diff --git a/drivers/event/dpaa2/meson.build b/drivers/event/dpaa2/meson.build
index a0db6fc21..a94bc5643 100644
--- a/drivers/event/dpaa2/meson.build
+++ b/drivers/event/dpaa2/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['bus_vdev', 'pmd_dpaa2', 'pmd_dpaa2_sec']
diff --git a/drivers/mempool/dpaa/meson.build b/drivers/mempool/dpaa/meson.build
index 9163b3db3..c4c8ebc09 100644
--- a/drivers/mempool/dpaa/meson.build
+++ b/drivers/mempool/dpaa/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/mempool/dpaa2/meson.build b/drivers/mempool/dpaa2/meson.build
index 6b6ead617..9a8b28d7c 100644
--- a/drivers/mempool/dpaa2/meson.build
+++ b/drivers/mempool/dpaa2/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/meson.build b/drivers/meson.build
index 7520a16e3..4c444f495 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2019 Intel Corporation
 
-if host_machine.system() == 'windows'
+if is_windows
 	subdir_done()
 endif
 
diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
index 92f6a9715..92c306c73 100644
--- a/drivers/net/af_packet/meson.build
+++ b/drivers/net/af_packet/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 sources = files('rte_eth_af_packet.c')
diff --git a/drivers/net/avp/meson.build b/drivers/net/avp/meson.build
index b7ffdfc80..8138cb22d 100644
--- a/drivers/net/avp/meson.build
+++ b/drivers/net/avp/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files('avp_ethdev.c')
diff --git a/drivers/net/axgbe/meson.build b/drivers/net/axgbe/meson.build
index 548ffff7a..6decb25d4 100644
--- a/drivers/net/axgbe/meson.build
+++ b/drivers/net/axgbe/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/drivers/net/dpaa/meson.build b/drivers/net/dpaa/meson.build
index 62dec7b04..8e5418bd6 100644
--- a/drivers/net/dpaa/meson.build
+++ b/drivers/net/dpaa/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['mempool_dpaa']
diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build
index 53e1d8189..a0ea99238 100644
--- a/drivers/net/dpaa2/meson.build
+++ b/drivers/net/dpaa2/meson.build
@@ -3,7 +3,7 @@
 
 version = 2
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 
diff --git a/drivers/net/enetc/meson.build b/drivers/net/enetc/meson.build
index 733156bbf..7d0c2ffe7 100644
--- a/drivers/net/enetc/meson.build
+++ b/drivers/net/enetc/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/drivers/net/failsafe/meson.build b/drivers/net/failsafe/meson.build
index a249ff4af..dfd4067cb 100644
--- a/drivers/net/failsafe/meson.build
+++ b/drivers/net/failsafe/meson.build
@@ -5,7 +5,7 @@ cflags += '-std=gnu99'
 cflags += '-D_DEFAULT_SOURCE'
 cflags += '-D_XOPEN_SOURCE=700'
 cflags += '-pedantic'
-if host_machine.system() == 'linux'
+if is_linux
 	cflags += '-DLINUX'
 else
 	cflags += '-DBSD'
diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build
index ba6a22e8b..ea51ac3c3 100644
--- a/drivers/net/nfp/meson.build
+++ b/drivers/net/nfp/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files('nfpcore/nfp_cpp_pcie_ops.c',
diff --git a/drivers/net/softnic/meson.build b/drivers/net/softnic/meson.build
index da249c068..dd1d610ea 100644
--- a/drivers/net/softnic/meson.build
+++ b/drivers/net/softnic/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 allow_experimental_apis = true
diff --git a/drivers/net/tap/meson.build b/drivers/net/tap/meson.build
index 9cb7142a0..c407a1f35 100644
--- a/drivers/net/tap/meson.build
+++ b/drivers/net/tap/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 Luca Boccassi <bluca@debian.org>
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files(
diff --git a/drivers/net/vdev_netvsc/meson.build b/drivers/net/vdev_netvsc/meson.build
index d3ada878a..6655859f8 100644
--- a/drivers/net/vdev_netvsc/meson.build
+++ b/drivers/net/vdev_netvsc/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
-if host_machine.system() != 'linux'
+if not is_linux
         build = false
 endif
 sources = files('vdev_netvsc.c')
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index e43ce6bbc..794905401 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -15,7 +15,7 @@ elif arch_subdir == 'arm' and host_machine.cpu_family().startswith('aarch64')
 	sources += files('virtio_rxtx_simple_neon.c')
 endif
 
-if host_machine.system() == 'linux'
+if is_linux
 	dpdk_conf.set('RTE_VIRTIO_USER', 1)
 
 	sources += files('virtio_user_ethdev.c',
diff --git a/examples/l3fwd-power/meson.build b/examples/l3fwd-power/meson.build
index a3c5c2f14..2c84123b6 100644
--- a/examples/l3fwd-power/meson.build
+++ b/examples/l3fwd-power/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 allow_experimental_apis = true
diff --git a/examples/meson.build b/examples/meson.build
index d72382fca..e4babf6bf 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -36,7 +36,7 @@ foreach example: examples
 	ext_deps = [execinfo]
 	includes = [include_directories(example)]
 	deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
-	if host_machine.system() == 'windows'
+	if is_windows
 		deps = ['eal'] # only supported lib on Windows currently
 	endif
 	subdir(example)
diff --git a/examples/tep_termination/meson.build b/examples/tep_termination/meson.build
index 6d3636243..a75cc7100 100644
--- a/examples/tep_termination/meson.build
+++ b/examples/tep_termination/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += ['hash', 'vhost']
diff --git a/examples/vdpa/meson.build b/examples/vdpa/meson.build
index 2e38a069f..73f129cd9 100644
--- a/examples/vdpa/meson.build
+++ b/examples/vdpa/meson.build
@@ -6,11 +6,11 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += 'vhost'
 allow_experimental_apis = true
 sources = files(
 	'main.c'
-)
\ No newline at end of file
+)
diff --git a/examples/vhost/meson.build b/examples/vhost/meson.build
index 7b498076c..872d51153 100644
--- a/examples/vhost/meson.build
+++ b/examples/vhost/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 deps += 'vhost'
diff --git a/examples/vhost_scsi/meson.build b/examples/vhost_scsi/meson.build
index ca1248023..2e9339aa7 100644
--- a/examples/vhost_scsi/meson.build
+++ b/examples/vhost_scsi/meson.build
@@ -6,7 +6,7 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 
diff --git a/kernel/meson.build b/kernel/meson.build
index 2c8fa76d0..b247e2df4 100644
--- a/kernel/meson.build
+++ b/kernel/meson.build
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-subdir(host_machine.system())
+subdir(exec_env)
diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build
index 6becfe86d..6cfe60e1f 100644
--- a/lib/librte_eventdev/meson.build
+++ b/lib/librte_eventdev/meson.build
@@ -4,7 +4,7 @@
 version = 6
 allow_experimental_apis = true
 
-if host_machine.system() == 'linux'
+if is_linux
 	cflags += '-DLINUX'
 else
 	cflags += '-DBSD'
diff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build
index 055ae1227..400af9a4d 100644
--- a/lib/librte_kni/meson.build
+++ b/lib/librte_kni/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if host_machine.system() != 'linux' or not dpdk_conf.get('RTE_ARCH_64')
+if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
 	build = false
 endif
 version = 2
diff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build
index 02e0337ce..cc6c30075 100644
--- a/lib/librte_power/meson.build
+++ b/lib/librte_power/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 sources = files('rte_power.c', 'power_acpi_cpufreq.c',
diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
index e33e6fc16..3090bbe08 100644
--- a/lib/librte_vhost/meson.build
+++ b/lib/librte_vhost/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2018 Intel Corporation
 
-if host_machine.system() != 'linux'
+if not is_linux
 	build = false
 endif
 if has_libnuma == 1
diff --git a/lib/meson.build b/lib/meson.build
index 595314d7d..a379dd682 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -30,7 +30,7 @@ libraries = [
 	# flow_classify lib depends on pkt framework table lib
 	'flow_classify', 'bpf', 'telemetry']
 
-if host_machine.system() == 'windows'
+if is_windows
 	libraries = ['kvargs','eal'] # only supported libraries for windows
 endif
 
@@ -123,7 +123,7 @@ foreach l:libraries
 					meson.current_source_dir(), dir_name, name)
 			exports = []
 			implib = dir_name + '.dll.a'
-			if host_machine.system() == 'windows'
+			if is_windows
 				exports = '@0@/@1@/rte_@2@_exports.def'.format(
 					meson.current_source_dir(), dir_name, name)
 				lk_args = ['-Wl,/def:' + exports, '-Wl,/implib:lib\\' + implib]
-- 
2.20.1


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

* [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found
  2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
                   ` (2 preceding siblings ...)
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables Bruce Richardson
@ 2019-04-09  9:29 ` Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
                     ` (2 more replies)
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD Bruce Richardson
                   ` (2 subsequent siblings)
  6 siblings, 3 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The power library is not built on non-Linux systems, so skip the
distributor sample if it's not found, as it's a mandatory dependency.

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

diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 8cf2ca1da..26f108d65 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -6,6 +6,9 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+# require the power library
+build = dpdk_conf.has('RTE_LIBRTE_POWER')
+
 deps += ['distributor', 'power']
 sources = files(
 	'main.c'
-- 
2.20.1

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

* [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found Bruce Richardson
@ 2019-04-09  9:29   ` Bruce Richardson
  2019-04-09  9:37   ` Hunt, David
  2019-04-09 10:36   ` Luca Boccassi
  2 siblings, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The power library is not built on non-Linux systems, so skip the
distributor sample if it's not found, as it's a mandatory dependency.

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

diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 8cf2ca1da..26f108d65 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -6,6 +6,9 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
+# require the power library
+build = dpdk_conf.has('RTE_LIBRTE_POWER')
+
 deps += ['distributor', 'power']
 sources = files(
 	'main.c'
-- 
2.20.1


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

* [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
                   ` (3 preceding siblings ...)
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found Bruce Richardson
@ 2019-04-09  9:29 ` Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
                     ` (2 more replies)
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD Bruce Richardson
  2019-04-09  9:55 ` [dpdk-dev] [PATCH 0/5] small cleanup and fixes David Marchand
  6 siblings, 3 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable

The definition of CPU_AND differs from Linux to BSD, so we need to use
RTE_CPU_AND instead.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/l2fwd-cat/cat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index a6081e676..502c6b327 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -345,7 +345,7 @@ check_cpus_overlapping(void)
 
 	for (i = 0; i < m_config_count; i++) {
 		for (j = i + 1; j < m_config_count; j++) {
-			CPU_AND(&mask,
+			RTE_CPU_AND(&mask,
 				&m_config[i].cpumask,
 				&m_config[j].cpumask);
 
-- 
2.20.1

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

* [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD Bruce Richardson
@ 2019-04-09  9:29   ` Bruce Richardson
  2019-04-09  9:56   ` David Marchand
  2019-04-09 10:40   ` [dpdk-dev] " Luca Boccassi
  2 siblings, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable

The definition of CPU_AND differs from Linux to BSD, so we need to use
RTE_CPU_AND instead.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/l2fwd-cat/cat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c
index a6081e676..502c6b327 100644
--- a/examples/l2fwd-cat/cat.c
+++ b/examples/l2fwd-cat/cat.c
@@ -345,7 +345,7 @@ check_cpus_overlapping(void)
 
 	for (i = 0; i < m_config_count; i++) {
 		for (j = i + 1; j < m_config_count; j++) {
-			CPU_AND(&mask,
+			RTE_CPU_AND(&mask,
 				&m_config[i].cpumask,
 				&m_config[j].cpumask);
 
-- 
2.20.1


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

* [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
                   ` (4 preceding siblings ...)
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD Bruce Richardson
@ 2019-04-09  9:29 ` Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
                     ` (2 more replies)
  2019-04-09  9:55 ` [dpdk-dev] [PATCH 0/5] small cleanup and fixes David Marchand
  6 siblings, 3 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The pipefile option does not seem to exist on FreeBSD, giving an error
when running the script.

Fixes: 5d9176673008 ("devtools: fix meson build test to exit on failure")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/test-meson-builds.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index b3b5cfbb5..1fd23fac7 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -7,7 +7,10 @@
 # * if a build-directory already exists we assume it was properly configured
 # Run ninja after configuration is done.
 
-set -o pipefail
+# this option gives an error on BSD
+if [ "`uname`" == "Linux" ] ; then
+	set -o pipefail
+fi
 
 srcdir=$(dirname $(readlink -f $0))/..
 MESON=${MESON:-meson}
-- 
2.20.1

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

* [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD Bruce Richardson
@ 2019-04-09  9:29   ` Bruce Richardson
  2019-04-09  9:57   ` David Marchand
  2019-04-09 10:37   ` Luca Boccassi
  2 siblings, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09  9:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The pipefile option does not seem to exist on FreeBSD, giving an error
when running the script.

Fixes: 5d9176673008 ("devtools: fix meson build test to exit on failure")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/test-meson-builds.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index b3b5cfbb5..1fd23fac7 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -7,7 +7,10 @@
 # * if a build-directory already exists we assume it was properly configured
 # Run ninja after configuration is done.
 
-set -o pipefail
+# this option gives an error on BSD
+if [ "`uname`" == "Linux" ] ; then
+	set -o pipefail
+fi
 
 srcdir=$(dirname $(readlink -f $0))/..
 MESON=${MESON:-meson}
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
@ 2019-04-09  9:37   ` Hunt, David
  2019-04-09  9:37     ` Hunt, David
  2019-04-09 10:36   ` Luca Boccassi
  2 siblings, 1 reply; 46+ messages in thread
From: Hunt, David @ 2019-04-09  9:37 UTC (permalink / raw)
  To: Bruce Richardson, dev


On 9/4/2019 10:29 AM, Bruce Richardson wrote:
> The power library is not built on non-Linux systems, so skip the
> distributor sample if it's not found, as it's a mandatory dependency.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   examples/distributor/meson.build | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
> index 8cf2ca1da..26f108d65 100644
> --- a/examples/distributor/meson.build
> +++ b/examples/distributor/meson.build
> @@ -6,6 +6,9 @@
>   # To build this example as a standalone application with an already-installed
>   # DPDK instance, use 'make'
>   
> +# require the power library
> +build = dpdk_conf.has('RTE_LIBRTE_POWER')
> +
>   deps += ['distributor', 'power']
>   sources = files(
>   	'main.c'


Acked-by: David Hunt <david.hunt@intel.com>

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

* Re: [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found
  2019-04-09  9:37   ` Hunt, David
@ 2019-04-09  9:37     ` Hunt, David
  0 siblings, 0 replies; 46+ messages in thread
From: Hunt, David @ 2019-04-09  9:37 UTC (permalink / raw)
  To: Bruce Richardson, dev


On 9/4/2019 10:29 AM, Bruce Richardson wrote:
> The power library is not built on non-Linux systems, so skip the
> distributor sample if it's not found, as it's a mandatory dependency.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   examples/distributor/meson.build | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
> index 8cf2ca1da..26f108d65 100644
> --- a/examples/distributor/meson.build
> +++ b/examples/distributor/meson.build
> @@ -6,6 +6,9 @@
>   # To build this example as a standalone application with an already-installed
>   # DPDK instance, use 'make'
>   
> +# require the power library
> +build = dpdk_conf.has('RTE_LIBRTE_POWER')
> +
>   deps += ['distributor', 'power']
>   sources = files(
>   	'main.c'


Acked-by: David Hunt <david.hunt@intel.com>




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

* Re: [dpdk-dev] [PATCH 0/5] small cleanup and fixes
  2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
                   ` (5 preceding siblings ...)
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD Bruce Richardson
@ 2019-04-09  9:55 ` David Marchand
  2019-04-09  9:55   ` David Marchand
  6 siblings, 1 reply; 46+ messages in thread
From: David Marchand @ 2019-04-09  9:55 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, Apr 9, 2019 at 11:29 AM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> Made some small changes to meson to shorten the code and increase
> readability. While testing, found a number of issues on FreeBSD builds,
> which are fixed in this set too.
>
> Bruce Richardson (5):
>   build: simplify subdirectory detection for EAL
>   build: increase readability via shortcut variables
>   distributor: skip building if power library not found
>   examples/l2fwd-cat: fix build on FreeBSD
>   devtools/test-meson-builds: fix support for FreeBSD
>

I have some small comments in patch 4 and patch 5 (sent separately), but
the rest looks good to me.
Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 0/5] small cleanup and fixes
  2019-04-09  9:55 ` [dpdk-dev] [PATCH 0/5] small cleanup and fixes David Marchand
@ 2019-04-09  9:55   ` David Marchand
  0 siblings, 0 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09  9:55 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, Apr 9, 2019 at 11:29 AM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> Made some small changes to meson to shorten the code and increase
> readability. While testing, found a number of issues on FreeBSD builds,
> which are fixed in this set too.
>
> Bruce Richardson (5):
>   build: simplify subdirectory detection for EAL
>   build: increase readability via shortcut variables
>   distributor: skip building if power library not found
>   examples/l2fwd-cat: fix build on FreeBSD
>   devtools/test-meson-builds: fix support for FreeBSD
>

I have some small comments in patch 4 and patch 5 (sent separately), but
the rest looks good to me.
Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
@ 2019-04-09  9:56   ` David Marchand
  2019-04-09  9:56     ` David Marchand
  2019-04-09 10:03     ` Bruce Richardson
  2019-04-09 10:40   ` [dpdk-dev] " Luca Boccassi
  2 siblings, 2 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09  9:56 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, dpdk stable

On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> The definition of CPU_AND differs from Linux to BSD, so we need to use
> RTE_CPU_AND instead.
>
> Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS
> CAT and CDP")
> Cc: stable@dpdk.org


This creates a dependency on backporting c3568ea37670 ("eal: restrict
control threads to startup CPU affinity") which introduced the RTE_CPU_AND
macro.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09  9:56   ` David Marchand
@ 2019-04-09  9:56     ` David Marchand
  2019-04-09 10:03     ` Bruce Richardson
  1 sibling, 0 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09  9:56 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, dpdk stable

On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> The definition of CPU_AND differs from Linux to BSD, so we need to use
> RTE_CPU_AND instead.
>
> Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS
> CAT and CDP")
> Cc: stable@dpdk.org


This creates a dependency on backporting c3568ea37670 ("eal: restrict
control threads to startup CPU affinity") which introduced the RTE_CPU_AND
macro.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
@ 2019-04-09  9:57   ` David Marchand
  2019-04-09  9:57     ` David Marchand
  2019-04-09 10:02     ` Bruce Richardson
  2019-04-09 10:37   ` Luca Boccassi
  2 siblings, 2 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09  9:57 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> The pipefile option does not seem to exist on FreeBSD, giving an error
> when running the script.
>
> Fixes: 5d9176673008 ("devtools: fix meson build test to exit on failure")
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  devtools/test-meson-builds.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> index b3b5cfbb5..1fd23fac7 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -7,7 +7,10 @@
>  # * if a build-directory already exists we assume it was properly
> configured
>  # Run ninja after configuration is done.
>
> -set -o pipefail
> +# this option gives an error on BSD
> +if [ "`uname`" == "Linux" ] ; then
> +       set -o pipefail
> +fi
>

== is a bashism, can't you just use = ?


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09  9:57   ` David Marchand
@ 2019-04-09  9:57     ` David Marchand
  2019-04-09 10:02     ` Bruce Richardson
  1 sibling, 0 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09  9:57 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> The pipefile option does not seem to exist on FreeBSD, giving an error
> when running the script.
>
> Fixes: 5d9176673008 ("devtools: fix meson build test to exit on failure")
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  devtools/test-meson-builds.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> index b3b5cfbb5..1fd23fac7 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -7,7 +7,10 @@
>  # * if a build-directory already exists we assume it was properly
> configured
>  # Run ninja after configuration is done.
>
> -set -o pipefail
> +# this option gives an error on BSD
> +if [ "`uname`" == "Linux" ] ; then
> +       set -o pipefail
> +fi
>

== is a bashism, can't you just use = ?


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09  9:57   ` David Marchand
  2019-04-09  9:57     ` David Marchand
@ 2019-04-09 10:02     ` Bruce Richardson
  2019-04-09 10:02       ` Bruce Richardson
  1 sibling, 1 reply; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:02 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Tue, Apr 09, 2019 at 11:57:04AM +0200, David Marchand wrote:
>    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
>    <[1]bruce.richardson@intel.com> wrote:
> 
>      The pipefile option does not seem to exist on FreeBSD, giving an
>      error
>      when running the script.
>      Fixes: 5d9176673008 ("devtools: fix meson build test to exit on
>      failure")
>      Signed-off-by: Bruce Richardson <[2]bruce.richardson@intel.com>
>      ---
>       devtools/test-meson-builds.sh | 5 ++++-
>       1 file changed, 4 insertions(+), 1 deletion(-)
>      diff --git a/devtools/test-meson-builds.sh
>      b/devtools/test-meson-builds.sh
>      index b3b5cfbb5..1fd23fac7 100755
>      --- a/devtools/test-meson-builds.sh
>      +++ b/devtools/test-meson-builds.sh
>      @@ -7,7 +7,10 @@
>       # * if a build-directory already exists we assume it was properly
>      configured
>       # Run ninja after configuration is done.
>      -set -o pipefail
>      +# this option gives an error on BSD
>      +if [ "`uname`" == "Linux" ] ; then
>      +       set -o pipefail
>      +fi
> 
>    == is a bashism, can't you just use = ?
>    --
Yes, my bad, I'll do a v2.

/Bruce

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

* Re: [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09 10:02     ` Bruce Richardson
@ 2019-04-09 10:02       ` Bruce Richardson
  0 siblings, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:02 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

On Tue, Apr 09, 2019 at 11:57:04AM +0200, David Marchand wrote:
>    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
>    <[1]bruce.richardson@intel.com> wrote:
> 
>      The pipefile option does not seem to exist on FreeBSD, giving an
>      error
>      when running the script.
>      Fixes: 5d9176673008 ("devtools: fix meson build test to exit on
>      failure")
>      Signed-off-by: Bruce Richardson <[2]bruce.richardson@intel.com>
>      ---
>       devtools/test-meson-builds.sh | 5 ++++-
>       1 file changed, 4 insertions(+), 1 deletion(-)
>      diff --git a/devtools/test-meson-builds.sh
>      b/devtools/test-meson-builds.sh
>      index b3b5cfbb5..1fd23fac7 100755
>      --- a/devtools/test-meson-builds.sh
>      +++ b/devtools/test-meson-builds.sh
>      @@ -7,7 +7,10 @@
>       # * if a build-directory already exists we assume it was properly
>      configured
>       # Run ninja after configuration is done.
>      -set -o pipefail
>      +# this option gives an error on BSD
>      +if [ "`uname`" == "Linux" ] ; then
>      +       set -o pipefail
>      +fi
> 
>    == is a bashism, can't you just use = ?
>    --
Yes, my bad, I'll do a v2.

/Bruce

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09  9:56   ` David Marchand
  2019-04-09  9:56     ` David Marchand
@ 2019-04-09 10:03     ` Bruce Richardson
  2019-04-09 10:03       ` Bruce Richardson
  2019-04-09 10:34       ` David Marchand
  1 sibling, 2 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:03 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, dpdk stable

On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
>    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
>    <[1]bruce.richardson@intel.com> wrote:
> 
>      The definition of CPU_AND differs from Linux to BSD, so we need to
>      use
>      RTE_CPU_AND instead.
>      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for
>      PQoS CAT and CDP")
>      Cc: [2]stable@dpdk.org
> 
>    This creates a dependency on backporting c3568ea37670 ("eal: restrict
>    control threads to startup CPU affinity") which introduced the
>    RTE_CPU_AND macro.
>    --
>    David Marchand
> 
Shall I drop the stable reference from the v2, then?

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:03     ` Bruce Richardson
@ 2019-04-09 10:03       ` Bruce Richardson
  2019-04-09 10:34       ` David Marchand
  1 sibling, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:03 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, dpdk stable

On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
>    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
>    <[1]bruce.richardson@intel.com> wrote:
> 
>      The definition of CPU_AND differs from Linux to BSD, so we need to
>      use
>      RTE_CPU_AND instead.
>      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for
>      PQoS CAT and CDP")
>      Cc: [2]stable@dpdk.org
> 
>    This creates a dependency on backporting c3568ea37670 ("eal: restrict
>    control threads to startup CPU affinity") which introduced the
>    RTE_CPU_AND macro.
>    --
>    David Marchand
> 
Shall I drop the stable reference from the v2, then?

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:03     ` Bruce Richardson
  2019-04-09 10:03       ` Bruce Richardson
@ 2019-04-09 10:34       ` David Marchand
  2019-04-09 10:34         ` David Marchand
                           ` (2 more replies)
  1 sibling, 3 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09 10:34 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, dpdk stable

On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
> >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
> >    <[1]bruce.richardson@intel.com> wrote:
> >
> >      The definition of CPU_AND differs from Linux to BSD, so we need to
> >      use
> >      RTE_CPU_AND instead.
> >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for
> >      PQoS CAT and CDP")
> >      Cc: [2]stable@dpdk.org
> >
> >    This creates a dependency on backporting c3568ea37670 ("eal: restrict
> >    control threads to startup CPU affinity") which introduced the
> >    RTE_CPU_AND macro.
> >    --
> >    David Marchand
> >
> Shall I drop the stable reference from the v2, then?
>

We can backport in 18.11, as I would expect c3568ea37670 to be backported.

The question is more what we want to do with 17.11.
We could backport only the macro bits from this patch if needed.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:34       ` David Marchand
@ 2019-04-09 10:34         ` David Marchand
  2019-04-09 10:40         ` Bruce Richardson
  2019-04-09 10:40         ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
  2 siblings, 0 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09 10:34 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, dpdk stable

On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:

> On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
> >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
> >    <[1]bruce.richardson@intel.com> wrote:
> >
> >      The definition of CPU_AND differs from Linux to BSD, so we need to
> >      use
> >      RTE_CPU_AND instead.
> >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for
> >      PQoS CAT and CDP")
> >      Cc: [2]stable@dpdk.org
> >
> >    This creates a dependency on backporting c3568ea37670 ("eal: restrict
> >    control threads to startup CPU affinity") which introduced the
> >    RTE_CPU_AND macro.
> >    --
> >    David Marchand
> >
> Shall I drop the stable reference from the v2, then?
>

We can backport in 18.11, as I would expect c3568ea37670 to be backported.

The question is more what we want to do with 17.11.
We could backport only the macro bits from this patch if needed.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
@ 2019-04-09 10:34   ` Luca Boccassi
  2019-04-09 10:34     ` Luca Boccassi
  2019-04-09 10:44     ` Bruce Richardson
  1 sibling, 2 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:34 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> Within EAL we had a series of if statements for selecting the EAL
> directory
> to use. Now that the directory names match those of the OS's they are
> for
> we can instead just use a generated subdirectory name, shortening the
> code.
> To avoid strange errors, we still need to check for unsupported OS's,
> but
> do this check up-front in the config meson.build file.
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  config/meson.build         |  7 +++++++
>  lib/librte_eal/meson.build | 17 ++---------------
>  2 files changed, 9 insertions(+), 15 deletions(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 483139b10..ce6af2595 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -1,6 +1,13 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2017-2019 Intel Corporation
>  
> +# check the OS is supported, rather than going any further
> +supported_exec_envs = ['freebsd', 'linux', 'windows']
> +exec_env = host_machine.system()
> +if not supported_exec_envs.contains(exec_env)
> +	error('unsupported system type "@0@"'.format(exec_env))
> +endif
> +
>  # set the major version, which might be used by drivers and
> libraries
>  # depending on the configuration options
>  pver = meson.project_version().split('.')
> diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
> index 1863622c0..fa36b20e0 100644
> --- a/lib/librte_eal/meson.build
> +++ b/lib/librte_eal/meson.build
> @@ -9,21 +9,8 @@ subdir('common') # defines common_sources,
> common_objs, etc.
>  
>  # Now do OS/exec-env specific settings, including building kernel
> modules
>  # The <exec-env>/eal/meson.build file should define env_sources,
> etc.
> -if host_machine.system() == 'linux'
> -	dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1)
> -	subdir('linux/eal')
> -
> -elif host_machine.system() == 'freebsd'
> -	dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1)
> -	subdir('freebsd/eal')
> -
> -elif host_machine.system() == 'windows'
> -	dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1)
> -	subdir('windows/eal')
> -
> -else
> -	error('unsupported system type
> "@0@"'.format(host_machine.system()))
> -endif
> +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
> +subdir(exec_env + '/eal')

Shouldn't this use join_paths() for cross-platform compat? Or does
foo/bar work fine these days in Windows?

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09 10:34   ` Luca Boccassi
@ 2019-04-09 10:34     ` Luca Boccassi
  2019-04-09 10:44     ` Bruce Richardson
  1 sibling, 0 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:34 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> Within EAL we had a series of if statements for selecting the EAL
> directory
> to use. Now that the directory names match those of the OS's they are
> for
> we can instead just use a generated subdirectory name, shortening the
> code.
> To avoid strange errors, we still need to check for unsupported OS's,
> but
> do this check up-front in the config meson.build file.
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  config/meson.build         |  7 +++++++
>  lib/librte_eal/meson.build | 17 ++---------------
>  2 files changed, 9 insertions(+), 15 deletions(-)
> 
> diff --git a/config/meson.build b/config/meson.build
> index 483139b10..ce6af2595 100644
> --- a/config/meson.build
> +++ b/config/meson.build
> @@ -1,6 +1,13 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2017-2019 Intel Corporation
>  
> +# check the OS is supported, rather than going any further
> +supported_exec_envs = ['freebsd', 'linux', 'windows']
> +exec_env = host_machine.system()
> +if not supported_exec_envs.contains(exec_env)
> +	error('unsupported system type "@0@"'.format(exec_env))
> +endif
> +
>  # set the major version, which might be used by drivers and
> libraries
>  # depending on the configuration options
>  pver = meson.project_version().split('.')
> diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
> index 1863622c0..fa36b20e0 100644
> --- a/lib/librte_eal/meson.build
> +++ b/lib/librte_eal/meson.build
> @@ -9,21 +9,8 @@ subdir('common') # defines common_sources,
> common_objs, etc.
>  
>  # Now do OS/exec-env specific settings, including building kernel
> modules
>  # The <exec-env>/eal/meson.build file should define env_sources,
> etc.
> -if host_machine.system() == 'linux'
> -	dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1)
> -	subdir('linux/eal')
> -
> -elif host_machine.system() == 'freebsd'
> -	dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1)
> -	subdir('freebsd/eal')
> -
> -elif host_machine.system() == 'windows'
> -	dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1)
> -	subdir('windows/eal')
> -
> -else
> -	error('unsupported system type
> "@0@"'.format(host_machine.system()))
> -endif
> +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
> +subdir(exec_env + '/eal')

Shouldn't this use join_paths() for cross-platform compat? Or does
foo/bar work fine these days in Windows?

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
@ 2019-04-09 10:35   ` Luca Boccassi
  2019-04-09 10:35     ` Luca Boccassi
  1 sibling, 1 reply; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:35 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> Define variables for "is_linux", "is_freebsd" and "is_windows"
> to make the code shorter for comparisons and more readable.
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  app/meson.build                          |  2 +-
>  buildtools/meson.build                   |  2 +-
>  config/meson.build                       | 14 ++++++++++----
>  config/x86/meson.build                   |  2 +-
>  doc/guides/contributing/coding_style.rst |  2 +-
>  drivers/bus/dpaa/meson.build             |  2 +-
>  drivers/bus/fslmc/meson.build            |  2 +-
>  drivers/bus/pci/meson.build              |  2 +-
>  drivers/bus/vmbus/meson.build            |  2 +-
>  drivers/common/dpaax/meson.build         |  2 +-
>  drivers/crypto/caam_jr/meson.build       |  2 +-
>  drivers/crypto/ccp/meson.build           |  2 +-
>  drivers/crypto/dpaa2_sec/meson.build     |  2 +-
>  drivers/crypto/dpaa_sec/meson.build      |  2 +-
>  drivers/crypto/octeontx/meson.build      |  2 +-
>  drivers/event/dpaa/meson.build           |  2 +-
>  drivers/event/dpaa2/meson.build          |  2 +-
>  drivers/mempool/dpaa/meson.build         |  2 +-
>  drivers/mempool/dpaa2/meson.build        |  2 +-
>  drivers/meson.build                      |  2 +-
>  drivers/net/af_packet/meson.build        |  2 +-
>  drivers/net/avp/meson.build              |  2 +-
>  drivers/net/axgbe/meson.build            |  2 +-
>  drivers/net/dpaa/meson.build             |  2 +-
>  drivers/net/dpaa2/meson.build            |  2 +-
>  drivers/net/enetc/meson.build            |  2 +-
>  drivers/net/failsafe/meson.build         |  2 +-
>  drivers/net/nfp/meson.build              |  2 +-
>  drivers/net/softnic/meson.build          |  2 +-
>  drivers/net/tap/meson.build              |  2 +-
>  drivers/net/vdev_netvsc/meson.build      |  2 +-
>  drivers/net/virtio/meson.build           |  2 +-
>  examples/l3fwd-power/meson.build         |  2 +-
>  examples/meson.build                     |  2 +-
>  examples/tep_termination/meson.build     |  2 +-
>  examples/vdpa/meson.build                |  4 ++--
>  examples/vhost/meson.build               |  2 +-
>  examples/vhost_scsi/meson.build          |  2 +-
>  kernel/meson.build                       |  2 +-
>  lib/librte_eventdev/meson.build          |  2 +-
>  lib/librte_kni/meson.build               |  2 +-
>  lib/librte_power/meson.build             |  2 +-
>  lib/librte_vhost/meson.build             |  2 +-
>  lib/meson.build                          |  4 ++--
>  44 files changed, 55 insertions(+), 49 deletions(-)

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables
  2019-04-09 10:35   ` Luca Boccassi
@ 2019-04-09 10:35     ` Luca Boccassi
  0 siblings, 0 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:35 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> Define variables for "is_linux", "is_freebsd" and "is_windows"
> to make the code shorter for comparisons and more readable.
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  app/meson.build                          |  2 +-
>  buildtools/meson.build                   |  2 +-
>  config/meson.build                       | 14 ++++++++++----
>  config/x86/meson.build                   |  2 +-
>  doc/guides/contributing/coding_style.rst |  2 +-
>  drivers/bus/dpaa/meson.build             |  2 +-
>  drivers/bus/fslmc/meson.build            |  2 +-
>  drivers/bus/pci/meson.build              |  2 +-
>  drivers/bus/vmbus/meson.build            |  2 +-
>  drivers/common/dpaax/meson.build         |  2 +-
>  drivers/crypto/caam_jr/meson.build       |  2 +-
>  drivers/crypto/ccp/meson.build           |  2 +-
>  drivers/crypto/dpaa2_sec/meson.build     |  2 +-
>  drivers/crypto/dpaa_sec/meson.build      |  2 +-
>  drivers/crypto/octeontx/meson.build      |  2 +-
>  drivers/event/dpaa/meson.build           |  2 +-
>  drivers/event/dpaa2/meson.build          |  2 +-
>  drivers/mempool/dpaa/meson.build         |  2 +-
>  drivers/mempool/dpaa2/meson.build        |  2 +-
>  drivers/meson.build                      |  2 +-
>  drivers/net/af_packet/meson.build        |  2 +-
>  drivers/net/avp/meson.build              |  2 +-
>  drivers/net/axgbe/meson.build            |  2 +-
>  drivers/net/dpaa/meson.build             |  2 +-
>  drivers/net/dpaa2/meson.build            |  2 +-
>  drivers/net/enetc/meson.build            |  2 +-
>  drivers/net/failsafe/meson.build         |  2 +-
>  drivers/net/nfp/meson.build              |  2 +-
>  drivers/net/softnic/meson.build          |  2 +-
>  drivers/net/tap/meson.build              |  2 +-
>  drivers/net/vdev_netvsc/meson.build      |  2 +-
>  drivers/net/virtio/meson.build           |  2 +-
>  examples/l3fwd-power/meson.build         |  2 +-
>  examples/meson.build                     |  2 +-
>  examples/tep_termination/meson.build     |  2 +-
>  examples/vdpa/meson.build                |  4 ++--
>  examples/vhost/meson.build               |  2 +-
>  examples/vhost_scsi/meson.build          |  2 +-
>  kernel/meson.build                       |  2 +-
>  lib/librte_eventdev/meson.build          |  2 +-
>  lib/librte_kni/meson.build               |  2 +-
>  lib/librte_power/meson.build             |  2 +-
>  lib/librte_vhost/meson.build             |  2 +-
>  lib/meson.build                          |  4 ++--
>  44 files changed, 55 insertions(+), 49 deletions(-)

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
  2019-04-09  9:37   ` Hunt, David
@ 2019-04-09 10:36   ` Luca Boccassi
  2019-04-09 10:36     ` Luca Boccassi
  2 siblings, 1 reply; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:36 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> The power library is not built on non-Linux systems, so skip the
> distributor sample if it's not found, as it's a mandatory dependency.
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  examples/distributor/meson.build | 3 +++
>  1 file changed, 3 insertions(+)

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found
  2019-04-09 10:36   ` Luca Boccassi
@ 2019-04-09 10:36     ` Luca Boccassi
  0 siblings, 0 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:36 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> The power library is not built on non-Linux systems, so skip the
> distributor sample if it's not found, as it's a mandatory dependency.
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  examples/distributor/meson.build | 3 +++
>  1 file changed, 3 insertions(+)

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
  2019-04-09  9:57   ` David Marchand
@ 2019-04-09 10:37   ` Luca Boccassi
  2019-04-09 10:37     ` Luca Boccassi
  2 siblings, 1 reply; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:37 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> The pipefile option does not seem to exist on FreeBSD, giving an
> error
> when running the script.
> 
> Fixes: 5d9176673008 ("devtools: fix meson build test to exit on
> failure")
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  devtools/test-meson-builds.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-
> builds.sh
> index b3b5cfbb5..1fd23fac7 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -7,7 +7,10 @@
>  # * if a build-directory already exists we assume it was properly
> configured
>  # Run ninja after configuration is done.
>  
> -set -o pipefail
> +# this option gives an error on BSD
> +if [ "`uname`" == "Linux" ] ; then
> +	set -o pipefail
> +fi
>  
>  srcdir=$(dirname $(readlink -f $0))/..
>  MESON=${MESON:-meson}

With the == fix:

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD
  2019-04-09 10:37   ` Luca Boccassi
@ 2019-04-09 10:37     ` Luca Boccassi
  0 siblings, 0 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:37 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> The pipefile option does not seem to exist on FreeBSD, giving an
> error
> when running the script.
> 
> Fixes: 5d9176673008 ("devtools: fix meson build test to exit on
> failure")
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  devtools/test-meson-builds.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-
> builds.sh
> index b3b5cfbb5..1fd23fac7 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -7,7 +7,10 @@
>  # * if a build-directory already exists we assume it was properly
> configured
>  # Run ninja after configuration is done.
>  
> -set -o pipefail
> +# this option gives an error on BSD
> +if [ "`uname`" == "Linux" ] ; then
> +	set -o pipefail
> +fi
>  
>  srcdir=$(dirname $(readlink -f $0))/..
>  MESON=${MESON:-meson}

With the == fix:

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:34       ` David Marchand
  2019-04-09 10:34         ` David Marchand
@ 2019-04-09 10:40         ` Bruce Richardson
  2019-04-09 10:40           ` Bruce Richardson
  2019-04-09 10:40         ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
  2 siblings, 1 reply; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:40 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, dpdk stable

On Tue, Apr 09, 2019 at 12:34:06PM +0200, David Marchand wrote:
>    On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson
>    <[1]bruce.richardson@intel.com> wrote:
> 
>      On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
>      >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
>      >    <[1][2]bruce.richardson@intel.com> wrote:
>      >
>      >      The definition of CPU_AND differs from Linux to BSD, so we
>      need to
>      >      use
>      >      RTE_CPU_AND instead.
>      >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample
>      application for
>      >      PQoS CAT and CDP")
>      >      Cc: [2][3]stable@dpdk.org
>      >
>      >    This creates a dependency on backporting c3568ea37670 ("eal:
>      restrict
>      >    control threads to startup CPU affinity") which introduced the
>      >    RTE_CPU_AND macro.
>      >    --
>      >    David Marchand
>      >
>      Shall I drop the stable reference from the v2, then?
> 
>    We can backport in 18.11, as I would expect c3568ea37670 to be
>    backported.
>    The question is more what we want to do with 17.11.
>    We could backport only the macro bits from this patch if needed.
>    --
Yes. I'll leave the stable cc and then each maintainer can decide
themselves on backport. I'll include note in the patch (below cutline) to
call out dependency explicitly.

/Bruce

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:40         ` Bruce Richardson
@ 2019-04-09 10:40           ` Bruce Richardson
  0 siblings, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:40 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, dpdk stable

On Tue, Apr 09, 2019 at 12:34:06PM +0200, David Marchand wrote:
>    On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson
>    <[1]bruce.richardson@intel.com> wrote:
> 
>      On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
>      >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
>      >    <[1][2]bruce.richardson@intel.com> wrote:
>      >
>      >      The definition of CPU_AND differs from Linux to BSD, so we
>      need to
>      >      use
>      >      RTE_CPU_AND instead.
>      >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample
>      application for
>      >      PQoS CAT and CDP")
>      >      Cc: [2][3]stable@dpdk.org
>      >
>      >    This creates a dependency on backporting c3568ea37670 ("eal:
>      restrict
>      >    control threads to startup CPU affinity") which introduced the
>      >    RTE_CPU_AND macro.
>      >    --
>      >    David Marchand
>      >
>      Shall I drop the stable reference from the v2, then?
> 
>    We can backport in 18.11, as I would expect c3568ea37670 to be
>    backported.
>    The question is more what we want to do with 17.11.
>    We could backport only the macro bits from this patch if needed.
>    --
Yes. I'll leave the stable cc and then each maintainer can decide
themselves on backport. I'll include note in the patch (below cutline) to
call out dependency explicitly.

/Bruce

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:34       ` David Marchand
  2019-04-09 10:34         ` David Marchand
  2019-04-09 10:40         ` Bruce Richardson
@ 2019-04-09 10:40         ` Luca Boccassi
  2019-04-09 10:40           ` Luca Boccassi
  2019-04-09 11:09           ` David Marchand
  2 siblings, 2 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:40 UTC (permalink / raw)
  To: David Marchand, Bruce Richardson; +Cc: dev, dpdk stable

On Tue, 2019-04-09 at 12:34 +0200, David Marchand wrote:
> On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson <
> bruce.richardson@intel.com
> >
> wrote:
> 
> > On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
> > >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
> > >    <[1]
> > > bruce.richardson@intel.com
> > > > wrote:
> > > 
> > >      The definition of CPU_AND differs from Linux to BSD, so we
> > > need to
> > >      use
> > >      RTE_CPU_AND instead.
> > >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample
> > > application for
> > >      PQoS CAT and CDP")
> > >      Cc: [2]
> > > stable@dpdk.org
> > > 
> > > 
> > >    This creates a dependency on backporting c3568ea37670 ("eal:
> > > restrict
> > >    control threads to startup CPU affinity") which introduced the
> > >    RTE_CPU_AND macro.
> > >    --
> > >    David Marchand
> > > 
> > 
> > Shall I drop the stable reference from the v2, then?
> > 
> 
> We can backport in 18.11, as I would expect c3568ea37670 to be
> backported.
> 
> The question is more what we want to do with 17.11.
> We could backport only the macro bits from this patch if needed.

If c3568 is not destined for 17.11.x, if you are up for doing the extra
work you can send the macro-only change as an individual patch to 
stable@dpdk.org (do not cc dev) and use --subject-prefix='PATCH 17.11'
- alternatively, the 17.11 maintainer can simply opt to not pick up
this patch.

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:40         ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
@ 2019-04-09 10:40           ` Luca Boccassi
  2019-04-09 11:09           ` David Marchand
  1 sibling, 0 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:40 UTC (permalink / raw)
  To: David Marchand, Bruce Richardson; +Cc: dev, dpdk stable

On Tue, 2019-04-09 at 12:34 +0200, David Marchand wrote:
> On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson <
> bruce.richardson@intel.com
> >
> wrote:
> 
> > On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
> > >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
> > >    <[1]
> > > bruce.richardson@intel.com
> > > > wrote:
> > > 
> > >      The definition of CPU_AND differs from Linux to BSD, so we
> > > need to
> > >      use
> > >      RTE_CPU_AND instead.
> > >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample
> > > application for
> > >      PQoS CAT and CDP")
> > >      Cc: [2]
> > > stable@dpdk.org
> > > 
> > > 
> > >    This creates a dependency on backporting c3568ea37670 ("eal:
> > > restrict
> > >    control threads to startup CPU affinity") which introduced the
> > >    RTE_CPU_AND macro.
> > >    --
> > >    David Marchand
> > > 
> > 
> > Shall I drop the stable reference from the v2, then?
> > 
> 
> We can backport in 18.11, as I would expect c3568ea37670 to be
> backported.
> 
> The question is more what we want to do with 17.11.
> We could backport only the macro bits from this patch if needed.

If c3568 is not destined for 17.11.x, if you are up for doing the extra
work you can send the macro-only change as an individual patch to 
stable@dpdk.org (do not cc dev) and use --subject-prefix='PATCH 17.11'
- alternatively, the 17.11 maintainer can simply opt to not pick up
this patch.

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09  9:29 ` [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD Bruce Richardson
  2019-04-09  9:29   ` Bruce Richardson
  2019-04-09  9:56   ` David Marchand
@ 2019-04-09 10:40   ` Luca Boccassi
  2019-04-09 10:40     ` Luca Boccassi
  2 siblings, 1 reply; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:40 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: stable

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> The definition of CPU_AND differs from Linux to BSD, so we need to
> use
> RTE_CPU_AND instead.
> 
> Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for
> PQoS CAT and CDP")
> Cc: 
> stable@dpdk.org
> 
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  examples/l2fwd-cat/cat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:40   ` [dpdk-dev] " Luca Boccassi
@ 2019-04-09 10:40     ` Luca Boccassi
  0 siblings, 0 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:40 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: stable

On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> The definition of CPU_AND differs from Linux to BSD, so we need to
> use
> RTE_CPU_AND instead.
> 
> Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for
> PQoS CAT and CDP")
> Cc: 
> stable@dpdk.org
> 
> 
> Signed-off-by: Bruce Richardson <
> bruce.richardson@intel.com
> >
> ---
>  examples/l2fwd-cat/cat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Luca Boccassi <bluca@debian.org>

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09 10:34   ` Luca Boccassi
  2019-04-09 10:34     ` Luca Boccassi
@ 2019-04-09 10:44     ` Bruce Richardson
  2019-04-09 10:44       ` Bruce Richardson
  2019-04-09 10:57       ` Luca Boccassi
  1 sibling, 2 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:44 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev

On Tue, Apr 09, 2019 at 11:34:24AM +0100, Luca Boccassi wrote:
> On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> > Within EAL we had a series of if statements for selecting the EAL
> > directory to use. Now that the directory names match those of the OS's
> > they are for we can instead just use a generated subdirectory name,
> > shortening the code.  To avoid strange errors, we still need to check
> > for unsupported OS's, but do this check up-front in the config
> > meson.build file.
> > 
> > Signed-off-by: Bruce Richardson < bruce.richardson@intel.com
> > >
> > --- config/meson.build         |  7 +++++++ lib/librte_eal/meson.build
> > | 17 ++--------------- 2 files changed, 9 insertions(+), 15
> > deletions(-)
> > 
> > diff --git a/config/meson.build b/config/meson.build index
> > 483139b10..ce6af2595 100644 --- a/config/meson.build +++
> > b/config/meson.build @@ -1,6 +1,13 @@ # SPDX-License-Identifier:
> > BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation
> >  
> > +# check the OS is supported, rather than going any further
> > +supported_exec_envs = ['freebsd', 'linux', 'windows'] +exec_env =
> > host_machine.system() +if not supported_exec_envs.contains(exec_env) +
> > error('unsupported system type "@0@"'.format(exec_env)) +endif + # set
> > the major version, which might be used by drivers and libraries #
> > depending on the configuration options pver =
> > meson.project_version().split('.') diff --git
> > a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index
> > 1863622c0..fa36b20e0 100644 --- a/lib/librte_eal/meson.build +++
> > b/lib/librte_eal/meson.build @@ -9,21 +9,8 @@ subdir('common') #
> > defines common_sources, common_objs, etc.
> >  
> >  # Now do OS/exec-env specific settings, including building kernel
> >  modules # The <exec-env>/eal/meson.build file should define
> >  env_sources, etc.  -if host_machine.system() == 'linux' -
> >  dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1) -	subdir('linux/eal') - -elif
> >  host_machine.system() == 'freebsd' -
> >  dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) -	subdir('freebsd/eal') -
> >  -elif host_machine.system() == 'windows' -
> >  dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) -	subdir('windows/eal') -
> >  -else -	error('unsupported system type
> >  "@0@"'.format(host_machine.system())) -endif
> >  +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
> >  +subdir(exec_env + '/eal')
> 
> Shouldn't this use join_paths() for cross-platform compat? Or does
> foo/bar work fine these days in Windows?
> 
It should work fine on Windows. We have plenty of other places where we use
"/" for separation, e.g. the subdir() function in EAL

/Bruce

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

* Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09 10:44     ` Bruce Richardson
@ 2019-04-09 10:44       ` Bruce Richardson
  2019-04-09 10:57       ` Luca Boccassi
  1 sibling, 0 replies; 46+ messages in thread
From: Bruce Richardson @ 2019-04-09 10:44 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev

On Tue, Apr 09, 2019 at 11:34:24AM +0100, Luca Boccassi wrote:
> On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> > Within EAL we had a series of if statements for selecting the EAL
> > directory to use. Now that the directory names match those of the OS's
> > they are for we can instead just use a generated subdirectory name,
> > shortening the code.  To avoid strange errors, we still need to check
> > for unsupported OS's, but do this check up-front in the config
> > meson.build file.
> > 
> > Signed-off-by: Bruce Richardson < bruce.richardson@intel.com
> > >
> > --- config/meson.build         |  7 +++++++ lib/librte_eal/meson.build
> > | 17 ++--------------- 2 files changed, 9 insertions(+), 15
> > deletions(-)
> > 
> > diff --git a/config/meson.build b/config/meson.build index
> > 483139b10..ce6af2595 100644 --- a/config/meson.build +++
> > b/config/meson.build @@ -1,6 +1,13 @@ # SPDX-License-Identifier:
> > BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation
> >  
> > +# check the OS is supported, rather than going any further
> > +supported_exec_envs = ['freebsd', 'linux', 'windows'] +exec_env =
> > host_machine.system() +if not supported_exec_envs.contains(exec_env) +
> > error('unsupported system type "@0@"'.format(exec_env)) +endif + # set
> > the major version, which might be used by drivers and libraries #
> > depending on the configuration options pver =
> > meson.project_version().split('.') diff --git
> > a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index
> > 1863622c0..fa36b20e0 100644 --- a/lib/librte_eal/meson.build +++
> > b/lib/librte_eal/meson.build @@ -9,21 +9,8 @@ subdir('common') #
> > defines common_sources, common_objs, etc.
> >  
> >  # Now do OS/exec-env specific settings, including building kernel
> >  modules # The <exec-env>/eal/meson.build file should define
> >  env_sources, etc.  -if host_machine.system() == 'linux' -
> >  dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1) -	subdir('linux/eal') - -elif
> >  host_machine.system() == 'freebsd' -
> >  dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) -	subdir('freebsd/eal') -
> >  -elif host_machine.system() == 'windows' -
> >  dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) -	subdir('windows/eal') -
> >  -else -	error('unsupported system type
> >  "@0@"'.format(host_machine.system())) -endif
> >  +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
> >  +subdir(exec_env + '/eal')
> 
> Shouldn't this use join_paths() for cross-platform compat? Or does
> foo/bar work fine these days in Windows?
> 
It should work fine on Windows. We have plenty of other places where we use
"/" for separation, e.g. the subdir() function in EAL

/Bruce

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

* Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09 10:44     ` Bruce Richardson
  2019-04-09 10:44       ` Bruce Richardson
@ 2019-04-09 10:57       ` Luca Boccassi
  2019-04-09 10:57         ` Luca Boccassi
  1 sibling, 1 reply; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:57 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, 2019-04-09 at 11:44 +0100, Bruce Richardson wrote:
> On Tue, Apr 09, 2019 at 11:34:24AM +0100, Luca Boccassi wrote:
> > On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> > > Within EAL we had a series of if statements for selecting the EAL
> > > directory to use. Now that the directory names match those of the
> > > OS's
> > > they are for we can instead just use a generated subdirectory
> > > name,
> > > shortening the code.  To avoid strange errors, we still need to
> > > check
> > > for unsupported OS's, but do this check up-front in the config
> > > meson.build file.
> > > 
> > > Signed-off-by: Bruce Richardson < 
> > > bruce.richardson@intel.com
> > > 
> > > 
> > > --- config/meson.build         |  7 +++++++
> > > lib/librte_eal/meson.build
> > > > 17 ++--------------- 2 files changed, 9 insertions(+), 15
> > > 
> > > deletions(-)
> > > 
> > > diff --git a/config/meson.build b/config/meson.build index
> > > 483139b10..ce6af2595 100644 --- a/config/meson.build +++
> > > b/config/meson.build @@ -1,6 +1,13 @@ # SPDX-License-Identifier:
> > > BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation
> > >  
> > > +# check the OS is supported, rather than going any further
> > > +supported_exec_envs = ['freebsd', 'linux', 'windows'] +exec_env
> > > =
> > > host_machine.system() +if not
> > > supported_exec_envs.contains(exec_env) +
> > > error('unsupported system type "@0@"'.format(exec_env)) +endif +
> > > # set
> > > the major version, which might be used by drivers and libraries #
> > > depending on the configuration options pver =
> > > meson.project_version().split('.') diff --git
> > > a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index
> > > 1863622c0..fa36b20e0 100644 --- a/lib/librte_eal/meson.build +++
> > > b/lib/librte_eal/meson.build @@ -9,21 +9,8 @@ subdir('common') #
> > > defines common_sources, common_objs, etc.
> > >  
> > >  # Now do OS/exec-env specific settings, including building
> > > kernel
> > >  modules # The <exec-env>/eal/meson.build file should define
> > >  env_sources, etc.  -if host_machine.system() == 'linux' -
> > >  dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1) -	subdir('linux/eal') -
> > > -elif
> > >  host_machine.system() == 'freebsd' -
> > >  dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) -	subdir('freebsd
> > > /eal') -
> > >  -elif host_machine.system() == 'windows' -
> > >  dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) -	subdir('windows
> > > /eal') -
> > >  -else -	error('unsupported system type
> > >  "@0@"'.format(host_machine.system())) -endif
> > >  +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
> > >  +subdir(exec_env + '/eal')
> > 
> > Shouldn't this use join_paths() for cross-platform compat? Or does
> > foo/bar work fine these days in Windows?
> > 
> 
> It should work fine on Windows. We have plenty of other places where
> we use
> "/" for separation, e.g. the subdir() function in EAL
> 
> /Bruce

Ah, good to know!

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL
  2019-04-09 10:57       ` Luca Boccassi
@ 2019-04-09 10:57         ` Luca Boccassi
  0 siblings, 0 replies; 46+ messages in thread
From: Luca Boccassi @ 2019-04-09 10:57 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Tue, 2019-04-09 at 11:44 +0100, Bruce Richardson wrote:
> On Tue, Apr 09, 2019 at 11:34:24AM +0100, Luca Boccassi wrote:
> > On Tue, 2019-04-09 at 10:29 +0100, Bruce Richardson wrote:
> > > Within EAL we had a series of if statements for selecting the EAL
> > > directory to use. Now that the directory names match those of the
> > > OS's
> > > they are for we can instead just use a generated subdirectory
> > > name,
> > > shortening the code.  To avoid strange errors, we still need to
> > > check
> > > for unsupported OS's, but do this check up-front in the config
> > > meson.build file.
> > > 
> > > Signed-off-by: Bruce Richardson < 
> > > bruce.richardson@intel.com
> > > 
> > > 
> > > --- config/meson.build         |  7 +++++++
> > > lib/librte_eal/meson.build
> > > > 17 ++--------------- 2 files changed, 9 insertions(+), 15
> > > 
> > > deletions(-)
> > > 
> > > diff --git a/config/meson.build b/config/meson.build index
> > > 483139b10..ce6af2595 100644 --- a/config/meson.build +++
> > > b/config/meson.build @@ -1,6 +1,13 @@ # SPDX-License-Identifier:
> > > BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation
> > >  
> > > +# check the OS is supported, rather than going any further
> > > +supported_exec_envs = ['freebsd', 'linux', 'windows'] +exec_env
> > > =
> > > host_machine.system() +if not
> > > supported_exec_envs.contains(exec_env) +
> > > error('unsupported system type "@0@"'.format(exec_env)) +endif +
> > > # set
> > > the major version, which might be used by drivers and libraries #
> > > depending on the configuration options pver =
> > > meson.project_version().split('.') diff --git
> > > a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build index
> > > 1863622c0..fa36b20e0 100644 --- a/lib/librte_eal/meson.build +++
> > > b/lib/librte_eal/meson.build @@ -9,21 +9,8 @@ subdir('common') #
> > > defines common_sources, common_objs, etc.
> > >  
> > >  # Now do OS/exec-env specific settings, including building
> > > kernel
> > >  modules # The <exec-env>/eal/meson.build file should define
> > >  env_sources, etc.  -if host_machine.system() == 'linux' -
> > >  dpdk_conf.set('RTE_EXEC_ENV_LINUX', 1) -	subdir('linux/eal') -
> > > -elif
> > >  host_machine.system() == 'freebsd' -
> > >  dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1) -	subdir('freebsd
> > > /eal') -
> > >  -elif host_machine.system() == 'windows' -
> > >  dpdk_conf.set('RTE_EXEC_ENV_WINDOWS', 1) -	subdir('windows
> > > /eal') -
> > >  -else -	error('unsupported system type
> > >  "@0@"'.format(host_machine.system())) -endif
> > >  +dpdk_conf.set('RTE_EXEC_ENV_' + exec_env.to_upper(), 1)
> > >  +subdir(exec_env + '/eal')
> > 
> > Shouldn't this use join_paths() for cross-platform compat? Or does
> > foo/bar work fine these days in Windows?
> > 
> 
> It should work fine on Windows. We have plenty of other places where
> we use
> "/" for separation, e.g. the subdir() function in EAL
> 
> /Bruce

Ah, good to know!

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 10:40         ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
  2019-04-09 10:40           ` Luca Boccassi
@ 2019-04-09 11:09           ` David Marchand
  2019-04-09 11:09             ` David Marchand
  1 sibling, 1 reply; 46+ messages in thread
From: David Marchand @ 2019-04-09 11:09 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Bruce Richardson, dev, dpdk stable

On Tue, Apr 9, 2019 at 12:40 PM Luca Boccassi <bluca@debian.org> wrote:

> On Tue, 2019-04-09 at 12:34 +0200, David Marchand wrote:
> > On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson <
> > bruce.richardson@intel.com
> > >
> > wrote:
> >
> > > On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
> > > >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
> > > >    <[1]
> > > > bruce.richardson@intel.com
> > > > > wrote:
> > > >
> > > >      The definition of CPU_AND differs from Linux to BSD, so we
> > > > need to
> > > >      use
> > > >      RTE_CPU_AND instead.
> > > >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample
> > > > application for
> > > >      PQoS CAT and CDP")
> > > >      Cc: [2]
> > > > stable@dpdk.org
> > > >
> > > >
> > > >    This creates a dependency on backporting c3568ea37670 ("eal:
> > > > restrict
> > > >    control threads to startup CPU affinity") which introduced the
> > > >    RTE_CPU_AND macro.
> > > >    --
> > > >    David Marchand
> > > >
> > >
> > > Shall I drop the stable reference from the v2, then?
> > >
> >
> > We can backport in 18.11, as I would expect c3568ea37670 to be
> > backported.
> >
> > The question is more what we want to do with 17.11.
> > We could backport only the macro bits from this patch if needed.
>
> If c3568 is not destined for 17.11.x, if you are up for doing the extra
> work you can send the macro-only change as an individual patch to
> stable@dpdk.org (do not cc dev) and use --subject-prefix='PATCH 17.11'
> - alternatively, the 17.11 maintainer can simply opt to not pick up
> this patch.
>

Not hard to achieve from my pov, the relevant bits are just this, I can
send it if the patch is selected.

@@ -23,10 +23,18 @@
 #define LCORE_ID_ANY     UINT32_MAX       /**< Any lcore. */

 #if defined(__linux__)
-       typedef cpu_set_t rte_cpuset_t;
+typedef        cpu_set_t rte_cpuset_t;
+#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
 #elif defined(__FreeBSD__)
 #include <pthread_np.h>
-       typedef cpuset_t rte_cpuset_t;
+typedef cpuset_t rte_cpuset_t;
+#define RTE_CPU_AND(dst, src1, src2) do \
+{ \
+       cpuset_t tmp; \
+       CPU_COPY(src1, &tmp); \
+       CPU_AND(&tmp, src2); \
+       CPU_COPY(&tmp, dst); \
+} while (0)
 #endif

 /**


-- 
David Marchand

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD
  2019-04-09 11:09           ` David Marchand
@ 2019-04-09 11:09             ` David Marchand
  0 siblings, 0 replies; 46+ messages in thread
From: David Marchand @ 2019-04-09 11:09 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Bruce Richardson, dev, dpdk stable

On Tue, Apr 9, 2019 at 12:40 PM Luca Boccassi <bluca@debian.org> wrote:

> On Tue, 2019-04-09 at 12:34 +0200, David Marchand wrote:
> > On Tue, Apr 9, 2019 at 12:03 PM Bruce Richardson <
> > bruce.richardson@intel.com
> > >
> > wrote:
> >
> > > On Tue, Apr 09, 2019 at 11:56:04AM +0200, David Marchand wrote:
> > > >    On Tue, Apr 9, 2019 at 11:30 AM Bruce Richardson
> > > >    <[1]
> > > > bruce.richardson@intel.com
> > > > > wrote:
> > > >
> > > >      The definition of CPU_AND differs from Linux to BSD, so we
> > > > need to
> > > >      use
> > > >      RTE_CPU_AND instead.
> > > >      Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample
> > > > application for
> > > >      PQoS CAT and CDP")
> > > >      Cc: [2]
> > > > stable@dpdk.org
> > > >
> > > >
> > > >    This creates a dependency on backporting c3568ea37670 ("eal:
> > > > restrict
> > > >    control threads to startup CPU affinity") which introduced the
> > > >    RTE_CPU_AND macro.
> > > >    --
> > > >    David Marchand
> > > >
> > >
> > > Shall I drop the stable reference from the v2, then?
> > >
> >
> > We can backport in 18.11, as I would expect c3568ea37670 to be
> > backported.
> >
> > The question is more what we want to do with 17.11.
> > We could backport only the macro bits from this patch if needed.
>
> If c3568 is not destined for 17.11.x, if you are up for doing the extra
> work you can send the macro-only change as an individual patch to
> stable@dpdk.org (do not cc dev) and use --subject-prefix='PATCH 17.11'
> - alternatively, the 17.11 maintainer can simply opt to not pick up
> this patch.
>

Not hard to achieve from my pov, the relevant bits are just this, I can
send it if the patch is selected.

@@ -23,10 +23,18 @@
 #define LCORE_ID_ANY     UINT32_MAX       /**< Any lcore. */

 #if defined(__linux__)
-       typedef cpu_set_t rte_cpuset_t;
+typedef        cpu_set_t rte_cpuset_t;
+#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
 #elif defined(__FreeBSD__)
 #include <pthread_np.h>
-       typedef cpuset_t rte_cpuset_t;
+typedef cpuset_t rte_cpuset_t;
+#define RTE_CPU_AND(dst, src1, src2) do \
+{ \
+       cpuset_t tmp; \
+       CPU_COPY(src1, &tmp); \
+       CPU_AND(&tmp, src2); \
+       CPU_COPY(&tmp, dst); \
+} while (0)
 #endif

 /**


-- 
David Marchand

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

end of thread, other threads:[~2019-04-09 11:10 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09  9:29 [dpdk-dev] [PATCH 0/5] small cleanup and fixes Bruce Richardson
2019-04-09  9:29 ` Bruce Richardson
2019-04-09  9:29 ` [dpdk-dev] [PATCH 1/5] build: simplify subdirectory detection for EAL Bruce Richardson
2019-04-09  9:29   ` Bruce Richardson
2019-04-09 10:34   ` Luca Boccassi
2019-04-09 10:34     ` Luca Boccassi
2019-04-09 10:44     ` Bruce Richardson
2019-04-09 10:44       ` Bruce Richardson
2019-04-09 10:57       ` Luca Boccassi
2019-04-09 10:57         ` Luca Boccassi
2019-04-09  9:29 ` [dpdk-dev] [PATCH 2/5] build: increase readability via shortcut variables Bruce Richardson
2019-04-09  9:29   ` Bruce Richardson
2019-04-09 10:35   ` Luca Boccassi
2019-04-09 10:35     ` Luca Boccassi
2019-04-09  9:29 ` [dpdk-dev] [PATCH 3/5] distributor: skip building if power library not found Bruce Richardson
2019-04-09  9:29   ` Bruce Richardson
2019-04-09  9:37   ` Hunt, David
2019-04-09  9:37     ` Hunt, David
2019-04-09 10:36   ` Luca Boccassi
2019-04-09 10:36     ` Luca Boccassi
2019-04-09  9:29 ` [dpdk-dev] [PATCH 4/5] examples/l2fwd-cat: fix build on FreeBSD Bruce Richardson
2019-04-09  9:29   ` Bruce Richardson
2019-04-09  9:56   ` David Marchand
2019-04-09  9:56     ` David Marchand
2019-04-09 10:03     ` Bruce Richardson
2019-04-09 10:03       ` Bruce Richardson
2019-04-09 10:34       ` David Marchand
2019-04-09 10:34         ` David Marchand
2019-04-09 10:40         ` Bruce Richardson
2019-04-09 10:40           ` Bruce Richardson
2019-04-09 10:40         ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
2019-04-09 10:40           ` Luca Boccassi
2019-04-09 11:09           ` David Marchand
2019-04-09 11:09             ` David Marchand
2019-04-09 10:40   ` [dpdk-dev] " Luca Boccassi
2019-04-09 10:40     ` Luca Boccassi
2019-04-09  9:29 ` [dpdk-dev] [PATCH 5/5] devtools/test-meson-builds: fix support for FreeBSD Bruce Richardson
2019-04-09  9:29   ` Bruce Richardson
2019-04-09  9:57   ` David Marchand
2019-04-09  9:57     ` David Marchand
2019-04-09 10:02     ` Bruce Richardson
2019-04-09 10:02       ` Bruce Richardson
2019-04-09 10:37   ` Luca Boccassi
2019-04-09 10:37     ` Luca Boccassi
2019-04-09  9:55 ` [dpdk-dev] [PATCH 0/5] small cleanup and fixes David Marchand
2019-04-09  9:55   ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).