Skip to contentSkip to conversation

support all examples in a meson build

PATCH Superseded Bruce Richardson 5 participants 33 messages Oct 14, 2019 – Oct 27, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover support all examples in a meson build

When build with meson, some examples were skipped when "-Dexamples=all" parameter was passed. Ignoring examples slated for removal by other patches[1], this set adds support for building the rest of the examples. The only exception is "bpf" which is a set of code snippets rather than code to be natively run.

[1] http://patches.dpdk.org/project/dpdk/list/?series=6683

Bruce Richardson (8):
examples/bpf: remove from list of examples to build examples/ethtool: allow building as part of meson build examples/performance-thread: remove warning disabling examples/performance-thread: rename directory to standard examples/performance-thread: add l3fwd-thread to meson examples/performance-thread: add pthread shim to meson examples/server_node_efd: add node binary to meson build examples/server_node_efd: add server binary to meson build

 examples/bpf/meson.build                      |  6 -----
 examples/ethtool/meson.build                  | 13 +++++++++--
 examples/meson.build                          | 10 +++++---
 .../common/arch/{arm64 => arm}/ctx.c          |  0
 .../common/arch/{arm64 => arm}/ctx.h          |  0
 .../common/arch/{arm64 => arm}/stack.h        |  0
 examples/performance-thread/common/common.mk  |  2 +-
 .../performance-thread/l3fwd-thread/Makefile  |  6 -----
 .../performance-thread/l3fwd-thread/main.c    |  4 ++--
 .../l3fwd-thread/meson.build                  | 22 ++++++++++++++++++
 .../pthread_shim/meson.build                  | 23 +++++++++++++++++++
 .../node}/meson.build                         |  9 +++++---
 .../server_node_efd/{ => server}/meson.build  |  9 +++++---
 13 files changed, 78 insertions(+), 26 deletions(-)
 delete mode 100644 examples/bpf/meson.build
 rename examples/performance-thread/common/arch/{arm64 => arm}/ctx.c (100%)
 rename examples/performance-thread/common/arch/{arm64 => arm}/ctx.h (100%)
 rename examples/performance-thread/common/arch/{arm64 => arm}/stack.h (100%)
 create mode 100644 examples/performance-thread/l3fwd-thread/meson.build
 create mode 100644 examples/performance-thread/pthread_shim/meson.build
 rename examples/{performance-thread => server_node_efd/node}/meson.build (60%)
 rename examples/server_node_efd/{ => server}/meson.build (57%)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/8 examples/bpf: remove from list of examples to build

The examples/bpf directory does not contain an example app, but rather example code for use with testpmd's BPF support. Therefore, we should not attempt to build it when the user requests "examples=all". This also synchronises the meson behaviour with make which similarly doesn't compile up the code.

---
 examples/bpf/meson.build | 6 ------
 examples/meson.build     | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)
 delete mode 100644 examples/bpf/meson.build
examples/bpf/meson.build deleted +0 -6
deleted file mode 100644
index 0a817aaea..000000000
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2019 Intel Corporation
-
-# This contains BPF example code for use in testing BPF with testpmd,
-# therefore it should not be built as part of a meson build.
-build=false
examples/meson.build +1 -1
index e4580f74a..9de6618ef 100644
@@ -11,7 +11,7 @@ execinfo = cc.find_library('execinfo', required: false)
 # list of all example apps. Keep 1-3 per line, in alphabetical order.
 all_examples = [
 	'bbdev_app', 'bond',
-	'bpf', 'cmdline',
+	'cmdline',
 	'distributor', 'ethtool',
 	'eventdev_pipeline',
 	'fips_validation', 'flow_classify',
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/8 examples/ethtool: allow building as part of meson build

In reply to Bruce Richardson

Since the code for the ethtool example was contained in subdirectories the compilation of this example is different from most of the other apps, and it had not been abled when the user requests a build with "-Dexamples=all".

To simplify the build with meson, the separate ethtool library is not build separately, rather the app is built as a single entity.

---
 examples/ethtool/meson.build | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
examples/ethtool/meson.build +11 -2
index c370d7476..603396bae 100644
@@ -6,5 +6,14 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+sources = files('lib/rte_ethtool.c',
+	'ethtool-app/ethapp.c',
+	'ethtool-app/main.c')
+includes = include_directories('lib', 'ethtool-app')
+
+deps += 'bus_pci'
+if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
+	deps += 'pmd_ixgbe'
+endif
+
+allow_experimental_apis = true
Signature · 1 line
2.21.0
#3 lore raw

PATCH 3/8 examples/performance-thread: remove warning disabling

In reply to Bruce Richardson

The warnings about functions not returning values can be removed from the code by just adding an attribute to the function to specify it doesn't return. The GCC bug referenced in the makefile which prevents this from working has been fixed for >10 years according to bugzilla.

---
 examples/performance-thread/l3fwd-thread/Makefile | 6 ------
 examples/performance-thread/l3fwd-thread/main.c   | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)
examples/performance-thread/l3fwd-thread/Makefile +0 -6
index 1a1c95829..b14b21e30 100644
@@ -20,10 +20,4 @@ include $(RTE_SDK)/examples/performance-thread/common/common.mk
 
 CFLAGS += -O3 -g $(USER_FLAGS) $(INCLUDES) $(WERROR_FLAGS)
 
-# workaround for a gcc bug with noreturn attribute
-# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
-#ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_main.o += -Wno-return-type
-#endif
-
 include $(RTE_SDK)/mk/rte.extapp.mk
examples/performance-thread/l3fwd-thread/main.c +2 -2
index 00f535053..d9af5c78d 100644
@@ -1877,7 +1877,7 @@ process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx,
 /*
  * CPU-load stats collector
  */
-static int
+static int __attribute__((noreturn))
 cpu_load_collector(__rte_unused void *arg) {
 	unsigned i, j, k;
 	uint64_t hits;
@@ -2299,7 +2299,7 @@ sched_spawner(__rte_unused void *arg) {
 }
 
 /* main processing loop */
-static int
+static int __attribute__((noreturn))
 pthread_tx(void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
Signature · 1 line
2.21.0
#4 lore raw

PATCH 4/8 examples/performance-thread: rename directory to standard

In reply to Bruce Richardson

In other places in DPDK, e.g. EAL, the architecture-specific files for arm are just stored in a folder called "arm". Rename the "arm64" folder for performance thread example to align to this naming.

---
 examples/performance-thread/common/arch/{arm64 => arm}/ctx.c   | 0
 examples/performance-thread/common/arch/{arm64 => arm}/ctx.h   | 0
 examples/performance-thread/common/arch/{arm64 => arm}/stack.h | 0
 examples/performance-thread/common/common.mk                   | 2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
 rename examples/performance-thread/common/arch/{arm64 => arm}/ctx.c (100%)
 rename examples/performance-thread/common/arch/{arm64 => arm}/ctx.h (100%)
 rename examples/performance-thread/common/arch/{arm64 => arm}/stack.h (100%)
examples/performance-thread/common/arch/arm/ctx.c renamed from examples/performance-thread/common/arch/arm64/ctx.c +0 -0
similarity index 100%
rename from examples/performance-thread/common/arch/arm64/ctx.c
rename to examples/performance-thread/common/arch/arm/ctx.c
examples/performance-thread/common/arch/arm/ctx.h renamed from examples/performance-thread/common/arch/arm64/ctx.h +0 -0
similarity index 100%
rename from examples/performance-thread/common/arch/arm64/ctx.h
rename to examples/performance-thread/common/arch/arm/ctx.h
examples/performance-thread/common/arch/arm/stack.h renamed from examples/performance-thread/common/arch/arm64/stack.h +0 -0
similarity index 100%
rename from examples/performance-thread/common/arch/arm64/stack.h
rename to examples/performance-thread/common/arch/arm/stack.h
examples/performance-thread/common/common.mk +1 -1
index 5e2b18a9f..021e61aea 100644
@@ -11,7 +11,7 @@ MKFILE_PATH=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
 ifeq ($(CONFIG_RTE_ARCH_X86_64),y)
 ARCH_PATH += $(MKFILE_PATH)/arch/x86
 else ifeq ($(CONFIG_RTE_ARCH_ARM64),y)
-ARCH_PATH += $(MKFILE_PATH)/arch/arm64
+ARCH_PATH += $(MKFILE_PATH)/arch/arm
 endif
 
 VPATH := $(MKFILE_PATH) $(ARCH_PATH)
Signature · 1 line
2.21.0
#5 lore raw

Re: [dpdk-dev] [PATCH 4/8] examples/performance-thread: rename directory to standard

Quoted 5 lines · Bruce Richardson

In other places in DPDK, e.g. EAL, the architecture-specific files for arm are just stored in a folder called "arm". Rename the "arm64" folder for performance thread example to align to this naming.

Quoted 8 lines
---
 examples/performance-thread/common/arch/{arm64 => arm}/ctx.c   | 0
 examples/performance-thread/common/arch/{arm64 => arm}/ctx.h   | 0
 examples/performance-thread/common/arch/{arm64 => arm}/stack.h | 0
 examples/performance-thread/common/common.mk                   | 2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
 rename examples/performance-thread/common/arch/{arm64 => arm}/ctx.c (100%)

This code only works for arm64 as it is storing and restoring arm64 registers. armv7 registers are different so this code does not work for the generic arm.

arm64 specific code, we always named as arm64

F: lib/librte_hash/rte*_arm64.h
F: lib/librte_efd/rte*_arm64.h
F: lib/librte_table/rte*_arm64.h

IMO, If armv7 support adds in future then we can change the directory as arch/arm
and have ctx_64.c and ctx_32.c etc. I think, for now, technically it is correct to call the directory as arm64

#6 lore raw

Re: [dpdk-dev] [PATCH 4/8] examples/performance-thread: rename directory to standard

Quoted 21 lines · Jerin Jacob
Quoted 5 lines · Bruce Richardson

In other places in DPDK, e.g. EAL, the architecture-specific files for arm are just stored in a folder called "arm". Rename the "arm64" folder for performance thread example to align to this naming.

Quoted 8 lines
---
 examples/performance-thread/common/arch/{arm64 => arm}/ctx.c   | 0
 examples/performance-thread/common/arch/{arm64 => arm}/ctx.h   | 0
 examples/performance-thread/common/arch/{arm64 => arm}/stack.h | 0
 examples/performance-thread/common/common.mk                   | 2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
 rename examples/performance-thread/common/arch/{arm64 => arm}/ctx.c (100%)

This code only works for arm64 as it is storing and restoring arm64 registers. armv7 registers are different so this code does not work for the generic arm.

arm64 specific code, we always named as arm64

Quoted 8 lines

F: lib/librte_hash/rte*_arm64.h
F: lib/librte_efd/rte*_arm64.h
F: lib/librte_table/rte*_arm64.h

IMO, If armv7 support adds in future then we can change the directory as arch/arm
and have ctx_64.c and ctx_32.c etc. I think, for now, technically it is correct to call the directory as arm64

Ok, fair enough. The code isn't meant to build for ARMv7 so I thought I'd save some logic by just using x86 and arm, rather than having to compute the directory names individually.

I'll rework the patch.

/Bruce

#7 lore raw

PATCH 5/8 examples/performance-thread: add l3fwd-thread to meson

In reply to Bruce Richardson

Limited to x86_64 systems, as it fails to compile on any others and is disabled in the examples makefile for non-x86_64 systems.

---
 examples/meson.build                          |  3 ++-
 .../l3fwd-thread/meson.build                  | 22 +++++++++++++++++++
 examples/performance-thread/meson.build       | 10 ---------
 3 files changed, 24 insertions(+), 11 deletions(-)
 create mode 100644 examples/performance-thread/l3fwd-thread/meson.build
 delete mode 100644 examples/performance-thread/meson.build
examples/meson.build +2 -1
index 9de6618ef..7dedc787d 100644
@@ -30,7 +30,8 @@ all_examples = [
 	'multi_process/simple_mp',
 	'multi_process/symmetric_mp',
 	'ntb', 'packet_ordering',
-	'performance-thread', 'ptpclient',
+	'performance-thread/l3fwd-thread',
+	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'rxtx_callbacks',
 	'server_node_efd', 'service_cores',
examples/performance-thread/l3fwd-thread/meson.build new file +22 -0
new file mode 100644
index 000000000..f25f201ce
@@ -0,0 +1,22 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+build = dpdk_conf.has('RTE_ARCH_X86_64')
+deps += ['timer', 'lpm']
+
+sources += files('main.c',
+	'../common/lthread.c',
+	'../common/lthread_cond.c',
+	'../common/lthread_diag.c',
+	'../common/lthread_mutex.c',
+	'../common/lthread_sched.c',
+	'../common/lthread_tls.c',
+	'../common/arch/@0@/ctx.c'.format(arch_subdir))
+
+includes += include_directories('../common',
+	'../common/arch/@0@'.format(arch_subdir))
examples/performance-thread/meson.build deleted +0 -10
deleted file mode 100644
index c370d7476..000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2018 Intel Corporation
-
-# meson file, for building this example as part of a main DPDK build.
-#
-# To build this example as a standalone application with an already-installed
-# DPDK instance, use 'make'
-
-# Example app currently unsupported by meson build
-build = false
Signature · 1 line
2.21.0
#8 lore raw

PATCH 6/8 examples/performance-thread: add pthread shim to meson

In reply to Bruce Richardson
---
 examples/meson.build                          |  1 +
 .../pthread_shim/meson.build                  | 23 +++++++++++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 examples/performance-thread/pthread_shim/meson.build
examples/meson.build +1 -0
index 7dedc787d..ff4e8608c 100644
@@ -31,6 +31,7 @@ all_examples = [
 	'multi_process/symmetric_mp',
 	'ntb', 'packet_ordering',
 	'performance-thread/l3fwd-thread',
+	'performance-thread/pthread_shim',
 	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'rxtx_callbacks',
examples/performance-thread/pthread_shim/meson.build new file +23 -0
new file mode 100644
index 000000000..4feec05a7
@@ -0,0 +1,23 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+build = dpdk_conf.has('RTE_ARCH_X86_64') or dpdk_conf.has('RTE_ARCH_ARM64')
+deps += ['timer']
+
+sources += files('main.c',
+	'pthread_shim.c',
+	'../common/lthread.c',
+	'../common/lthread_cond.c',
+	'../common/lthread_diag.c',
+	'../common/lthread_mutex.c',
+	'../common/lthread_sched.c',
+	'../common/lthread_tls.c',
+	'../common/arch/@0@/ctx.c'.format(arch_subdir))
+
+includes += include_directories('../common',
+	'../common/arch/@0@'.format(arch_subdir))
Signature · 1 line
2.21.0
#9 lore raw

PATCH 7/8 examples/server_node_efd: add node binary to meson build

In reply to Bruce Richardson
---
 examples/meson.build                            | 3 ++-
 examples/server_node_efd/{ => node}/meson.build | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
 rename examples/server_node_efd/{ => node}/meson.build (60%)
examples/meson.build +2 -1
index ff4e8608c..352921ea8 100644
@@ -35,7 +35,8 @@ all_examples = [
 	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'rxtx_callbacks',
-	'server_node_efd', 'service_cores',
+	'server_node_efd/node',
+	'service_cores',
 	'skeleton', 'tep_termination',
 	'timer', 'vdpa',
 	'vhost', 'vhost_crypto',
examples/server_node_efd/node/meson.build renamed from examples/server_node_efd/meson.build +6 -3
similarity index 60%
rename from examples/server_node_efd/meson.build
rename to examples/server_node_efd/node/meson.build
index c370d7476..30f28761f 100644
@@ -1,10 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2018 Intel Corporation
+# Copyright(c) 2019 Intel Corporation
 
 # meson file, for building this example as part of a main DPDK build.
 #
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+name = 'efd_node'
+
+deps += ['hash']
+sources += files('node.c')
+includes += include_directories('../shared')
Signature · 1 line
2.21.0
#10 lore raw

PATCH 8/8 examples/server_node_efd: add server binary to meson build

In reply to Bruce Richardson
---
 examples/meson.build                        |  1 +
 examples/server_node_efd/server/meson.build | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 examples/server_node_efd/server/meson.build
examples/meson.build +1 -0
index 352921ea8..4bc1e17af 100644
@@ -36,6 +36,7 @@ all_examples = [
 	'qos_meter', 'qos_sched',
 	'rxtx_callbacks',
 	'server_node_efd/node',
+	'server_node_efd/server',
 	'service_cores',
 	'skeleton', 'tep_termination',
 	'timer', 'vdpa',
examples/server_node_efd/server/meson.build new file +13 -0
new file mode 100644
index 000000000..23e08d1ae
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+name = 'efd_server'
+
+deps += 'efd'
+sources += files('args.c', 'init.c', 'main.c')
+includes += include_directories('../shared')
Signature · 1 line
2.21.0
#11 lore raw

v2 cover support all examples in a meson build

In reply to Bruce Richardson

When build with meson, some examples were skipped when "-Dexamples=all" parameter was passed. Ignoring examples slated for removal by other patches[1], this set adds support for building the rest of the examples. The only exception is "bpf" which is a set of code snippets rather than code to be natively run.

V2: drop patch 4 renaming the arm64 directory.

[1] http://patches.dpdk.org/project/dpdk/list/?series=6683

Bruce Richardson (7):
examples/bpf: remove from list of examples to build examples/ethtool: allow building as part of meson build examples/performance-thread: remove warning disabling examples/performance-thread: add l3fwd-thread to meson examples/performance-thread: add pthread shim to meson examples/server_node_efd: add node binary to meson build examples/server_node_efd: add server binary to meson build

 examples/bpf/meson.build                      |  6 ----
 examples/ethtool/meson.build                  | 13 +++++++--
 examples/meson.build                          | 10 +++++--
 .../performance-thread/l3fwd-thread/Makefile  |  6 ----
 .../performance-thread/l3fwd-thread/main.c    |  4 +--
 .../l3fwd-thread/meson.build                  | 27 ++++++++++++++++++
 .../pthread_shim/meson.build                  | 28 +++++++++++++++++++
 .../node}/meson.build                         |  9 ++++--
 .../server_node_efd/{ => server}/meson.build  |  9 ++++--
 9 files changed, 87 insertions(+), 25 deletions(-)
 delete mode 100644 examples/bpf/meson.build
 create mode 100644 examples/performance-thread/l3fwd-thread/meson.build
 create mode 100644 examples/performance-thread/pthread_shim/meson.build
 rename examples/{performance-thread => server_node_efd/node}/meson.build (60%)
 rename examples/server_node_efd/{ => server}/meson.build (57%)
Signature · 1 line
2.21.0
#12 lore raw

PATCH v2 1/7 examples/bpf: remove from list of examples to build

The examples/bpf directory does not contain an example app, but rather example code for use with testpmd's BPF support. Therefore, we should not attempt to build it when the user requests "examples=all". This also synchronises the meson behaviour with make which similarly doesn't compile up the code.

---
 examples/bpf/meson.build | 6 ------
 examples/meson.build     | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)
 delete mode 100644 examples/bpf/meson.build
examples/bpf/meson.build deleted +0 -6
deleted file mode 100644
index 0a817aaea..000000000
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2019 Intel Corporation
-
-# This contains BPF example code for use in testing BPF with testpmd,
-# therefore it should not be built as part of a meson build.
-build=false
examples/meson.build +1 -1
index a046b74ad..e40ab68da 100644
@@ -11,7 +11,7 @@ execinfo = cc.find_library('execinfo', required: false)
 # list of all example apps. Keep 1-3 per line, in alphabetical order.
 all_examples = [
 	'bbdev_app', 'bond',
-	'bpf', 'cmdline',
+	'cmdline',
 	'distributor', 'ethtool',
 	'eventdev_pipeline', 'exception_path',
 	'fips_validation', 'flow_classify',
Signature · 1 line
2.21.0
#13 lore raw

PATCH v2 2/7 examples/ethtool: allow building as part of meson build

In reply to Bruce Richardson

Since the code for the ethtool example was contained in subdirectories the compilation of this example is different from most of the other apps, and it had not been abled when the user requests a build with "-Dexamples=all".

To simplify the build with meson, the separate ethtool library is not build separately, rather the app is built as a single entity.

---
 examples/ethtool/meson.build | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
examples/ethtool/meson.build +11 -2
index c370d7476..603396bae 100644
@@ -6,5 +6,14 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+sources = files('lib/rte_ethtool.c',
+	'ethtool-app/ethapp.c',
+	'ethtool-app/main.c')
+includes = include_directories('lib', 'ethtool-app')
+
+deps += 'bus_pci'
+if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
+	deps += 'pmd_ixgbe'
+endif
+
+allow_experimental_apis = true
Signature · 1 line
2.21.0
#14 lore raw

PATCH v2 3/7 examples/performance-thread: remove warning disabling

In reply to Bruce Richardson

The warnings about functions not returning values can be removed from the code by just adding an attribute to the function to specifies it doesn't return. The GCC bug referenced in the makefile which prevents this from working has been fixed for >10 years according to bugzilla.

---
 examples/performance-thread/l3fwd-thread/Makefile | 6 ------
 examples/performance-thread/l3fwd-thread/main.c   | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)
examples/performance-thread/l3fwd-thread/Makefile +0 -6
index 1a1c95829..b14b21e30 100644
@@ -20,10 +20,4 @@ include $(RTE_SDK)/examples/performance-thread/common/common.mk
 
 CFLAGS += -O3 -g $(USER_FLAGS) $(INCLUDES) $(WERROR_FLAGS)
 
-# workaround for a gcc bug with noreturn attribute
-# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
-#ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_main.o += -Wno-return-type
-#endif
-
 include $(RTE_SDK)/mk/rte.extapp.mk
examples/performance-thread/l3fwd-thread/main.c +2 -2
index 122c63244..ad540fd84 100644
@@ -1877,7 +1877,7 @@ process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx,
 /*
  * CPU-load stats collector
  */
-static int
+static int __attribute__((noreturn))
 cpu_load_collector(__rte_unused void *arg) {
 	unsigned i, j, k;
 	uint64_t hits;
@@ -2299,7 +2299,7 @@ sched_spawner(__rte_unused void *arg) {
 }
 
 /* main processing loop */
-static int
+static int __attribute__((noreturn))
 pthread_tx(void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
Signature · 1 line
2.21.0
#15 lore raw

PATCH v2 4/7 examples/performance-thread: add l3fwd-thread to meson

In reply to Bruce Richardson

Limited to x86_64 systems, as it fails to compile on any others and is disabled in the examples makefile for non-x86_64 systems.

---
 examples/meson.build                          |  3 ++-
 .../l3fwd-thread/meson.build                  | 27 +++++++++++++++++++
 examples/performance-thread/meson.build       | 10 -------
 3 files changed, 29 insertions(+), 11 deletions(-)
 create mode 100644 examples/performance-thread/l3fwd-thread/meson.build
 delete mode 100644 examples/performance-thread/meson.build
examples/meson.build +2 -1
index e40ab68da..889bb6b2c 100644
@@ -31,7 +31,8 @@ all_examples = [
 	'multi_process/simple_mp',
 	'multi_process/symmetric_mp',
 	'netmap_compat', 'ntb', 'packet_ordering',
-	'performance-thread', 'ptpclient',
+	'performance-thread/l3fwd-thread',
+	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
 	'server_node_efd', 'service_cores',
examples/performance-thread/l3fwd-thread/meson.build new file +27 -0
new file mode 100644
index 000000000..185fa59a4
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+build = dpdk_conf.has('RTE_ARCH_X86_64')
+deps += ['timer', 'lpm']
+
+# get the performance thread (pt) architecture subdir
+if dpdk_conf.has('RTE_ARCH_ARM64')
+	pt_arch_dir = '../common/arch/arm64'
+else
+	pt_arch_dir = '../common/arch/x86'
+endif
+sources += files('main.c',
+	'../common/lthread.c',
+	'../common/lthread_cond.c',
+	'../common/lthread_diag.c',
+	'../common/lthread_mutex.c',
+	'../common/lthread_sched.c',
+	'../common/lthread_tls.c',
+	pt_arch_dir + '/ctx.c')
+
+includes += include_directories('../common', pt_arch_dir)
examples/performance-thread/meson.build deleted +0 -10
deleted file mode 100644
index c370d7476..000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2018 Intel Corporation
-
-# meson file, for building this example as part of a main DPDK build.
-#
-# To build this example as a standalone application with an already-installed
-# DPDK instance, use 'make'
-
-# Example app currently unsupported by meson build
-build = false
Signature · 1 line
2.21.0
#16 lore raw

PATCH v2 5/7 examples/performance-thread: add pthread shim to meson

In reply to Bruce Richardson
---
 examples/meson.build                          |  1 +
 .../pthread_shim/meson.build                  | 28 +++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 examples/performance-thread/pthread_shim/meson.build
examples/meson.build +1 -0
index 889bb6b2c..8ef81446f 100644
@@ -32,6 +32,7 @@ all_examples = [
 	'multi_process/symmetric_mp',
 	'netmap_compat', 'ntb', 'packet_ordering',
 	'performance-thread/l3fwd-thread',
+	'performance-thread/pthread_shim',
 	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
examples/performance-thread/pthread_shim/meson.build new file +28 -0
new file mode 100644
index 000000000..393fbd122
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+build = dpdk_conf.has('RTE_ARCH_X86_64') or dpdk_conf.has('RTE_ARCH_ARM64')
+deps += ['timer']
+
+# get the performance thread (pt) architecture subdir
+if dpdk_conf.has('RTE_ARCH_ARM64')
+	pt_arch_dir = '../common/arch/arm64'
+else
+	pt_arch_dir = '../common/arch/x86'
+endif
+sources += files('main.c',
+	'pthread_shim.c',
+	'../common/lthread.c',
+	'../common/lthread_cond.c',
+	'../common/lthread_diag.c',
+	'../common/lthread_mutex.c',
+	'../common/lthread_sched.c',
+	'../common/lthread_tls.c',
+	pt_arch_dir + '/ctx.c')
+
+includes += include_directories('../common', pt_arch_dir)
Signature · 1 line
2.21.0
#17 lore raw

PATCH v2 6/7 examples/server_node_efd: add node binary to meson build

In reply to Bruce Richardson
---
 examples/meson.build                            | 3 ++-
 examples/server_node_efd/{ => node}/meson.build | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
 rename examples/server_node_efd/{ => node}/meson.build (60%)
examples/meson.build +2 -1
index 8ef81446f..6f5f00ec7 100644
@@ -36,7 +36,8 @@ all_examples = [
 	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
-	'server_node_efd', 'service_cores',
+	'server_node_efd/node',
+	'service_cores',
 	'skeleton', 'tep_termination',
 	'timer', 'vdpa',
 	'vhost', 'vhost_crypto',
examples/server_node_efd/node/meson.build renamed from examples/server_node_efd/meson.build +6 -3
similarity index 60%
rename from examples/server_node_efd/meson.build
rename to examples/server_node_efd/node/meson.build
index c370d7476..30f28761f 100644
@@ -1,10 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2018 Intel Corporation
+# Copyright(c) 2019 Intel Corporation
 
 # meson file, for building this example as part of a main DPDK build.
 #
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+name = 'efd_node'
+
+deps += ['hash']
+sources += files('node.c')
+includes += include_directories('../shared')
Signature · 1 line
2.21.0
#18 lore raw

PATCH v2 7/7 examples/server_node_efd: add server binary to meson build

In reply to Bruce Richardson
---
 examples/meson.build                        |  1 +
 examples/server_node_efd/server/meson.build | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 examples/server_node_efd/server/meson.build
examples/meson.build +1 -0
index 6f5f00ec7..8a15dafcf 100644
@@ -37,6 +37,7 @@ all_examples = [
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
 	'server_node_efd/node',
+	'server_node_efd/server',
 	'service_cores',
 	'skeleton', 'tep_termination',
 	'timer', 'vdpa',
examples/server_node_efd/server/meson.build new file +13 -0
new file mode 100644
index 000000000..23e08d1ae
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+name = 'efd_server'
+
+deps += 'efd'
+sources += files('args.c', 'init.c', 'main.c')
+includes += include_directories('../shared')
Signature · 1 line
2.21.0
#19 lore raw
In reply to Bruce Richardson
Quoted 16 lines · Bruce Richardson

When build with meson, some examples were skipped when "- Dexamples=all"
parameter was passed. Ignoring examples slated for removal by other patches[1], this set adds support for building the rest of the examples.
The only exception is "bpf" which is a set of code snippets rather than
code to be natively run.

V2: drop patch 4 renaming the arm64 directory.

[1]
http://patches.dpdk.org/project/dpdk/list/?series=6683

Quoted 8 lines

Bruce Richardson (7):
examples/bpf: remove from list of examples to build examples/ethtool: allow building as part of meson build examples/performance-thread: remove warning disabling examples/performance-thread: add l3fwd-thread to meson examples/performance-thread: add pthread shim to meson examples/server_node_efd: add node binary to meson build examples/server_node_efd: add server binary to meson build

Signature · 2 lines
Kind regards,
Luca Boccassi
#20 lore raw

v3 cover support all examples in a meson build

In reply to Bruce Richardson

When build with meson, some examples were skipped when "-Dexamples=all" parameter was passed. Ignoring examples slated for removal by other patches[1], this set adds support for building the rest of the examples. The only exception is "bpf" which is a set of code snippets rather than code to be natively run.

V3: add missing guest_cli example subdirectory
disable ethtool on FreeBSD builds
fix errors building server_node_efd/server on FreeBSD

V2: drop patch 4 renaming the arm64 directory.

[1] http://patches.dpdk.org/project/dpdk/list/?series=6683

Bruce Richardson (9):
examples/bpf: remove from list of examples to build examples/ethtool: allow building as part of meson build examples/performance-thread: remove warning disabling examples/performance-thread: add l3fwd-thread to meson examples/performance-thread: add pthread shim to meson examples/server_node_efd: add node binary to meson build examples/server_node_efd: add server binary to meson build examples/guest_cli: fix type of cmdline token examples/guest_cli: add power manager guest cli to meson

 examples/bpf/meson.build                      |  6 ----
 examples/ethtool/meson.build                  | 14 ++++++++--
 examples/meson.build                          | 11 ++++++--
 .../performance-thread/l3fwd-thread/Makefile  |  6 ----
 .../performance-thread/l3fwd-thread/main.c    |  4 +--
 .../l3fwd-thread/meson.build                  | 27 ++++++++++++++++++
 .../pthread_shim/meson.build                  | 28 +++++++++++++++++++
 .../node}/meson.build                         |  9 ++++--
 examples/server_node_efd/server/main.c        |  2 ++
 .../server_node_efd/{ => server}/meson.build  |  9 ++++--
 .../vm_power_manager/guest_cli/meson.build    |  4 ---
 .../guest_cli/vm_power_cli_guest.c            |  2 +-
 12 files changed, 92 insertions(+), 30 deletions(-)
 delete mode 100644 examples/bpf/meson.build
 create mode 100644 examples/performance-thread/l3fwd-thread/meson.build
 create mode 100644 examples/performance-thread/pthread_shim/meson.build
 rename examples/{performance-thread => server_node_efd/node}/meson.build (60%)
 rename examples/server_node_efd/{ => server}/meson.build (57%)
Signature · 1 line
2.21.0
#21 lore raw

PATCH v3 1/9 examples/bpf: remove from list of examples to build

The examples/bpf directory does not contain an example app, but rather example code for use with testpmd's BPF support. Therefore, we should not attempt to build it when the user requests "examples=all". This also synchronises the meson behaviour with make which similarly doesn't compile up the code.

---
 examples/bpf/meson.build | 6 ------
 examples/meson.build     | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)
 delete mode 100644 examples/bpf/meson.build
examples/bpf/meson.build deleted +0 -6
deleted file mode 100644
index 0a817aaea..000000000
@@ -1,6 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2019 Intel Corporation
-
-# This contains BPF example code for use in testing BPF with testpmd,
-# therefore it should not be built as part of a meson build.
-build=false
examples/meson.build +1 -1
index a046b74ad..e40ab68da 100644
@@ -11,7 +11,7 @@ execinfo = cc.find_library('execinfo', required: false)
 # list of all example apps. Keep 1-3 per line, in alphabetical order.
 all_examples = [
 	'bbdev_app', 'bond',
-	'bpf', 'cmdline',
+	'cmdline',
 	'distributor', 'ethtool',
 	'eventdev_pipeline', 'exception_path',
 	'fips_validation', 'flow_classify',
Signature · 1 line
2.21.0
#22 lore raw

PATCH v3 2/9 examples/ethtool: allow building as part of meson build

In reply to Bruce Richardson

Since the code for the ethtool example was contained in subdirectories the compilation of this example is different from most of the other apps, and it had not been abled when the user requests a build with "-Dexamples=all".

To simplify the build with meson, the separate ethtool library is not build separately, rather the app is built as a single entity.

---
V3: disable on non-linux

---
 examples/ethtool/meson.build | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
examples/ethtool/meson.build +12 -2
index c370d7476..bc7a35514 100644
@@ -6,5 +6,15 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+build = is_linux
+sources = files('lib/rte_ethtool.c',
+	'ethtool-app/ethapp.c',
+	'ethtool-app/main.c')
+includes = include_directories('lib', 'ethtool-app')
+
+deps += 'bus_pci'
+if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
+	deps += 'pmd_ixgbe'
+endif
+
+allow_experimental_apis = true
Signature · 1 line
2.21.0
#23 lore raw

PATCH v3 3/9 examples/performance-thread: remove warning disabling

In reply to Bruce Richardson

The warnings about functions not returning values can be removed from the code by just adding an attribute to the function to specifies it doesn't return. The GCC bug referenced in the makefile which prevents this from working has been fixed for >10 years according to bugzilla.

---
 examples/performance-thread/l3fwd-thread/Makefile | 6 ------
 examples/performance-thread/l3fwd-thread/main.c   | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)
examples/performance-thread/l3fwd-thread/Makefile +0 -6
index 1a1c95829..b14b21e30 100644
@@ -20,10 +20,4 @@ include $(RTE_SDK)/examples/performance-thread/common/common.mk
 
 CFLAGS += -O3 -g $(USER_FLAGS) $(INCLUDES) $(WERROR_FLAGS)
 
-# workaround for a gcc bug with noreturn attribute
-# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
-#ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_main.o += -Wno-return-type
-#endif
-
 include $(RTE_SDK)/mk/rte.extapp.mk
examples/performance-thread/l3fwd-thread/main.c +2 -2
index 122c63244..ad540fd84 100644
@@ -1877,7 +1877,7 @@ process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx,
 /*
  * CPU-load stats collector
  */
-static int
+static int __attribute__((noreturn))
 cpu_load_collector(__rte_unused void *arg) {
 	unsigned i, j, k;
 	uint64_t hits;
@@ -2299,7 +2299,7 @@ sched_spawner(__rte_unused void *arg) {
 }
 
 /* main processing loop */
-static int
+static int __attribute__((noreturn))
 pthread_tx(void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
Signature · 1 line
2.21.0
#24 lore raw

PATCH v3 4/9 examples/performance-thread: add l3fwd-thread to meson

In reply to Bruce Richardson

Limited to x86_64 systems, as it fails to compile on any others and is disabled in the examples makefile for non-x86_64 systems.

---
 examples/meson.build                          |  3 ++-
 .../l3fwd-thread/meson.build                  | 27 +++++++++++++++++++
 examples/performance-thread/meson.build       | 10 -------
 3 files changed, 29 insertions(+), 11 deletions(-)
 create mode 100644 examples/performance-thread/l3fwd-thread/meson.build
 delete mode 100644 examples/performance-thread/meson.build
examples/meson.build +2 -1
index e40ab68da..889bb6b2c 100644
@@ -31,7 +31,8 @@ all_examples = [
 	'multi_process/simple_mp',
 	'multi_process/symmetric_mp',
 	'netmap_compat', 'ntb', 'packet_ordering',
-	'performance-thread', 'ptpclient',
+	'performance-thread/l3fwd-thread',
+	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
 	'server_node_efd', 'service_cores',
examples/performance-thread/l3fwd-thread/meson.build new file +27 -0
new file mode 100644
index 000000000..185fa59a4
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+build = dpdk_conf.has('RTE_ARCH_X86_64')
+deps += ['timer', 'lpm']
+
+# get the performance thread (pt) architecture subdir
+if dpdk_conf.has('RTE_ARCH_ARM64')
+	pt_arch_dir = '../common/arch/arm64'
+else
+	pt_arch_dir = '../common/arch/x86'
+endif
+sources += files('main.c',
+	'../common/lthread.c',
+	'../common/lthread_cond.c',
+	'../common/lthread_diag.c',
+	'../common/lthread_mutex.c',
+	'../common/lthread_sched.c',
+	'../common/lthread_tls.c',
+	pt_arch_dir + '/ctx.c')
+
+includes += include_directories('../common', pt_arch_dir)
examples/performance-thread/meson.build deleted +0 -10
deleted file mode 100644
index c370d7476..000000000
@@ -1,10 +0,0 @@
-# SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2018 Intel Corporation
-
-# meson file, for building this example as part of a main DPDK build.
-#
-# To build this example as a standalone application with an already-installed
-# DPDK instance, use 'make'
-
-# Example app currently unsupported by meson build
-build = false
Signature · 1 line
2.21.0
#25 lore raw

PATCH v3 5/9 examples/performance-thread: add pthread shim to meson

In reply to Bruce Richardson
---
 examples/meson.build                          |  1 +
 .../pthread_shim/meson.build                  | 28 +++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 examples/performance-thread/pthread_shim/meson.build
examples/meson.build +1 -0
index 889bb6b2c..8ef81446f 100644
@@ -32,6 +32,7 @@ all_examples = [
 	'multi_process/symmetric_mp',
 	'netmap_compat', 'ntb', 'packet_ordering',
 	'performance-thread/l3fwd-thread',
+	'performance-thread/pthread_shim',
 	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
examples/performance-thread/pthread_shim/meson.build new file +28 -0
new file mode 100644
index 000000000..393fbd122
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+build = dpdk_conf.has('RTE_ARCH_X86_64') or dpdk_conf.has('RTE_ARCH_ARM64')
+deps += ['timer']
+
+# get the performance thread (pt) architecture subdir
+if dpdk_conf.has('RTE_ARCH_ARM64')
+	pt_arch_dir = '../common/arch/arm64'
+else
+	pt_arch_dir = '../common/arch/x86'
+endif
+sources += files('main.c',
+	'pthread_shim.c',
+	'../common/lthread.c',
+	'../common/lthread_cond.c',
+	'../common/lthread_diag.c',
+	'../common/lthread_mutex.c',
+	'../common/lthread_sched.c',
+	'../common/lthread_tls.c',
+	pt_arch_dir + '/ctx.c')
+
+includes += include_directories('../common', pt_arch_dir)
Signature · 1 line
2.21.0
#26 lore raw

PATCH v3 6/9 examples/server_node_efd: add node binary to meson build

In reply to Bruce Richardson
---
 examples/meson.build                            | 3 ++-
 examples/server_node_efd/{ => node}/meson.build | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
 rename examples/server_node_efd/{ => node}/meson.build (60%)
examples/meson.build +2 -1
index 8ef81446f..6f5f00ec7 100644
@@ -36,7 +36,8 @@ all_examples = [
 	'ptpclient',
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
-	'server_node_efd', 'service_cores',
+	'server_node_efd/node',
+	'service_cores',
 	'skeleton', 'tep_termination',
 	'timer', 'vdpa',
 	'vhost', 'vhost_crypto',
examples/server_node_efd/node/meson.build renamed from examples/server_node_efd/meson.build +6 -3
similarity index 60%
rename from examples/server_node_efd/meson.build
rename to examples/server_node_efd/node/meson.build
index c370d7476..30f28761f 100644
@@ -1,10 +1,13 @@
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2018 Intel Corporation
+# Copyright(c) 2019 Intel Corporation
 
 # meson file, for building this example as part of a main DPDK build.
 #
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+name = 'efd_node'
+
+deps += ['hash']
+sources += files('node.c')
+includes += include_directories('../shared')
Signature · 1 line
2.21.0
#27 lore raw

PATCH v3 7/9 examples/server_node_efd: add server binary to meson build

In reply to Bruce Richardson

When adding to the build, add in two missing includes that prevented build on freebsd, rather than just duplicating the makefile restriction.

---
V3: add in missing headers for build compilation

---
 examples/meson.build                        |  1 +
 examples/server_node_efd/server/main.c      |  2 ++
 examples/server_node_efd/server/meson.build | 13 +++++++++++++
 3 files changed, 16 insertions(+)
 create mode 100644 examples/server_node_efd/server/meson.build
examples/meson.build +1 -0
index 6f5f00ec7..8a15dafcf 100644
@@ -37,6 +37,7 @@ all_examples = [
 	'qos_meter', 'qos_sched',
 	'quota_watermark', 'rxtx_callbacks',
 	'server_node_efd/node',
+	'server_node_efd/server',
 	'service_cores',
 	'skeleton', 'tep_termination',
 	'timer', 'vdpa',
examples/server_node_efd/server/main.c +2 -0
index 455bdc063..21c72acda 100644
@@ -11,6 +11,8 @@
 #include <inttypes.h>
 #include <sys/queue.h>
 #include <errno.h>
+#include <sys/types.h>
+#include <netinet/in.h>
 #include <netinet/ip.h>
 
 #include <rte_common.h>
examples/server_node_efd/server/meson.build new file +13 -0
new file mode 100644
index 000000000..23e08d1ae
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+# meson file, for building this example as part of a main DPDK build.
+#
+# To build this example as a standalone application with an already-installed
+# DPDK instance, use 'make'
+
+name = 'efd_server'
+
+deps += 'efd'
+sources += files('args.c', 'init.c', 'main.c')
+includes += include_directories('../shared')
Signature · 1 line
2.21.0
#28 lore raw

PATCH v3 8/9 examples/guest_cli: fix type of cmdline token

In reply to Bruce Richardson

Building the example with clang gives the error:

error: expression which evaluates to zero treated as a null pointer constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]

                        lcore_id, UINT8);
                                  ^~~~~

This error is due to the wrong data type being given for the cmd_set_cpu_freq_core_num value - it was specified as string rather than numeric type.

Fixes f5e5c3347ae3 ("examples/vm_power: cli in guest")
---
 examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +1 -1
index fe09b0778..610d9aeac 100644
@@ -171,7 +171,7 @@ cmd_set_cpu_freq_parsed(void *parsed_result, struct cmdline *cl,
 cmdline_parse_token_string_t cmd_set_cpu_freq =
 	TOKEN_STRING_INITIALIZER(struct cmd_set_cpu_freq_result,
 			set_cpu_freq, "set_cpu_freq");
-cmdline_parse_token_string_t cmd_set_cpu_freq_core_num =
+cmdline_parse_token_num_t cmd_set_cpu_freq_core_num =
 	TOKEN_NUM_INITIALIZER(struct cmd_set_cpu_freq_result,
 			lcore_id, UINT8);
 cmdline_parse_token_string_t cmd_set_cpu_freq_cmd_cmd =
Signature · 1 line
2.21.0
Acked-by on v3 8/9
#29 lore raw

Re: [dpdk-dev] [PATCH v3 8/9] examples/guest_cli: fix type of cmdline token

Quoted 11 lines · Bruce Richardson

Building the example with clang gives the error:

error: expression which evaluates to zero treated as a null pointer constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]

                         lcore_id, UINT8);
                                   ^~~~~

This error is due to the wrong data type being given for the cmd_set_cpu_freq_core_num value - it was specified as string rather than numeric type.

Quoted 5 lines
Fixes f5e5c3347ae3 ("examples/vm_power: cli in guest")

---

#30 lore raw

PATCH v3 9/9 examples/guest_cli: add power manager guest cli to meson

In reply to Bruce Richardson
---
 examples/meson.build                            | 1 +
 examples/vm_power_manager/guest_cli/meson.build | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)
examples/meson.build +1 -0
index 8a15dafcf..5a235545a 100644
@@ -43,6 +43,7 @@ all_examples = [
 	'timer', 'vdpa',
 	'vhost', 'vhost_crypto',
 	'vhost_scsi', 'vm_power_manager',
+	'vm_power_manager/guest_cli',
 	'vmdq', 'vmdq_dcb',
 ]
 # install all example code on install - irrespective of whether the example in
examples/vm_power_manager/guest_cli/meson.build +0 -4
index 38bd8d837..2b490424f 100644
@@ -6,10 +6,6 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Setting the name here because the default name will conflict with the
-# vm_power_manager app because of the way the directories are parsed.
-name = 'guest_cli'
-
 if not dpdk_conf.has('RTE_LIBRTE_POWER')
         build = false
         subdir_done()
Signature · 1 line
2.21.0
#32 lore raw
In reply to Bruce Richardson
Quoted 10 lines

Bruce Richardson (9):
examples/bpf: remove from list of examples to build examples/ethtool: allow building as part of meson build examples/performance-thread: remove warning disabling examples/performance-thread: add l3fwd-thread to meson examples/performance-thread: add pthread shim to meson examples/server_node_efd: add node binary to meson build examples/server_node_efd: add server binary to meson build examples/guest_cli: fix type of cmdline token examples/guest_cli: add power manager guest cli to meson

Applied, thanks