* [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore
@ 2020-09-11 19:06 Stephen Hemminger
2020-09-11 19:06 ` [dpdk-dev] [PATCH 01/15] eal: add macro to mark macros as deprecated Stephen Hemminger
` (19 more replies)
0 siblings, 20 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
As announced in 20.08 release notes, the terms for lcore role
will change in 20.11 release.
This is a project wide patchset to terminolgy used for DPDK lcore.
The term "master" referring to lcore is replaced with "main" and
"slave" lcore is replaced with "worker" lcore.
This is most visible in API for rte_get_master_lcore() which is
replaced with rte_get_main_lcore(). And the macros for iterating
over lcores are replaced as well.
The first patch introduces a way to mark macro's as deprecated
as well.
Stephen Hemminger (15):
eal: add macro to mark macros as deprecated
eal: rename lcore word choices
rte_power: replace rte_master_lcore with rte_main_lcore
drivers: replace master lcore with main lcore
doc: replace master lcore with main lcore
app/test: replace uses of master/slave
app/test-pmd: replace master lcore with main lcore
app/test-eventdev: replace use of master lcore with main lcore
app: replace references to master/slave
examples: replace use of master with main
examples/multi_process: replace references to master/slave
examples/performance-thread: replace reference to master lcore
examples/qos: replace references to master
examples/ipsec-secgw: replace master lcore with main lcore
examples: replace master lcore with main lcore
app/test-acl/main.c | 2 +-
app/test-bbdev/test_bbdev_perf.c | 8 +-
app/test-compress-perf/main.c | 8 +-
app/test-crypto-perf/main.c | 14 +--
app/test-eventdev/evt_options.c | 2 +-
app/test-eventdev/test_order_common.c | 10 +-
app/test-eventdev/test_perf_common.c | 12 +-
app/test-eventdev/test_pipeline_common.c | 6 +-
app/test-flow-perf/main.c | 2 +-
app/test-pipeline/main.c | 4 +-
app/test-pmd/config.c | 4 +-
app/test-pmd/parameters.c | 2 +-
app/test-pmd/testpmd.c | 2 +-
app/test-sad/main.c | 4 +-
app/test/autotest_test_funcs.py | 2 +-
app/test/meson.build | 2 +-
app/test/test.c | 2 +-
app/test/test_atomic.c | 26 ++---
app/test/test_barrier.c | 2 +-
app/test/test_compressdev_test_buffer.h | 2 +-
app/test/test_cryptodev.c | 12 +-
app/test/test_distributor.c | 8 +-
app/test/test_distributor_perf.c | 10 +-
app/test/test_eal_flags.c | 32 +++---
app/test/test_efd.c | 2 +-
app/test/test_efd_perf.c | 2 +-
app/test/test_func_reentrancy.c | 6 +-
app/test/test_hash_multiwriter.c | 4 +-
app/test/test_hash_readwrite.c | 39 ++++---
app/test/test_kni.c | 16 +--
app/test/test_lpm_perf.c | 4 +-
app/test/test_malloc.c | 12 +-
app/test/test_mbuf.c | 33 +++---
app/test/test_mcslock.c | 28 ++---
app/test/test_mempool_perf.c | 10 +-
app/test/test_mp_secondary.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/test_per_lcore.c | 14 +--
app/test/test_pmd_perf.c | 20 ++--
app/test/test_rcu_qsbr.c | 2 +-
app/test/test_rcu_qsbr_perf.c | 2 +-
app/test/test_ring_perf.c | 14 +--
app/test/test_ring_stress_impl.h | 10 +-
app/test/test_rwlock.c | 28 ++---
app/test/test_service_cores.c | 14 +--
app/test/test_spinlock.c | 34 +++---
app/test/test_stack.c | 2 +-
app/test/test_stack_perf.c | 6 +-
app/test/test_ticketlock.c | 36 +++---
app/test/test_timer.c | 106 +++++++++---------
app/test/test_timer_racecond.c | 26 ++---
app/test/test_timer_secondary.c | 2 +-
app/test/test_trace_perf.c | 4 +-
doc/guides/faq/faq.rst | 2 +-
doc/guides/linux_gsg/eal_args.include.rst | 2 +-
doc/guides/nics/bnxt.rst | 2 +-
.../prog_guide/env_abstraction_layer.rst | 6 +-
.../prog_guide/event_ethernet_rx_adapter.rst | 2 +-
doc/guides/prog_guide/glossary.rst | 10 +-
doc/guides/rel_notes/deprecation.rst | 19 ----
doc/guides/rel_notes/release_20_11.rst | 11 ++
doc/guides/sample_app_ug/bbdev_app.rst | 2 +-
doc/guides/sample_app_ug/ethtool.rst | 2 +-
doc/guides/sample_app_ug/hello_world.rst | 2 +-
doc/guides/sample_app_ug/ioat.rst | 10 +-
doc/guides/sample_app_ug/ip_pipeline.rst | 2 +-
doc/guides/sample_app_ug/l2_forward_event.rst | 2 +-
.../sample_app_ug/l2_forward_real_virtual.rst | 2 +-
.../sample_app_ug/l3_forward_power_man.rst | 2 +-
doc/guides/sample_app_ug/link_status_intr.rst | 2 +-
doc/guides/sample_app_ug/multi_process.rst | 2 +-
doc/guides/sample_app_ug/packet_ordering.rst | 2 +-
.../sample_app_ug/performance_thread.rst | 4 +-
doc/guides/sample_app_ug/ptpclient.rst | 2 +-
doc/guides/sample_app_ug/timer.rst | 8 +-
doc/guides/testpmd_app_ug/run_app.rst | 2 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 4 +-
drivers/net/mvpp2/mrvl_ethdev.c | 6 +-
drivers/net/qede/base/bcm_osal.c | 4 +-
drivers/net/softnic/rte_eth_softnic_thread.c | 4 +-
examples/bbdev_app/main.c | 10 +-
examples/bond/main.c | 32 +++---
examples/ethtool/ethtool-app/main.c | 6 +-
examples/flow_classify/flow_classify.c | 2 +-
examples/helloworld/main.c | 4 +-
examples/ioat/ioatfwd.c | 6 +-
examples/ip_fragmentation/main.c | 2 +-
examples/ip_pipeline/main.c | 2 +-
examples/ip_reassembly/main.c | 2 +-
examples/ipsec-secgw/event_helper.c | 6 +-
examples/ipsec-secgw/ipsec-secgw.c | 2 +-
examples/ipv4_multicast/main.c | 2 +-
examples/kni/main.c | 4 +-
examples/l2fwd-cat/l2fwd-cat.c | 2 +-
examples/l2fwd-crypto/main.c | 6 +-
examples/l2fwd-event/l2fwd_poll.c | 2 +-
examples/l2fwd-event/main.c | 2 +-
examples/l2fwd-jobstats/main.c | 2 +-
examples/l2fwd-keepalive/main.c | 2 +-
examples/l2fwd/main.c | 6 +-
examples/l3fwd-acl/main.c | 2 +-
examples/l3fwd-graph/main.c | 14 +--
examples/l3fwd-power/main.c | 16 +--
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 6 +-
.../client_server_mp/mp_server/main.c | 10 +-
examples/multi_process/simple_mp/main.c | 4 +-
examples/multi_process/symmetric_mp/main.c | 2 +-
examples/ntb/ntb_fwd.c | 4 +-
examples/packet_ordering/main.c | 20 ++--
.../performance-thread/l3fwd-thread/main.c | 14 +--
.../performance-thread/pthread_shim/main.c | 2 +-
examples/ptpclient/ptpclient.c | 4 +-
examples/qos_meter/main.c | 2 +-
examples/qos_sched/args.c | 24 ++--
examples/qos_sched/cmdline.c | 2 +-
examples/qos_sched/main.c | 2 +-
examples/rxtx_callbacks/main.c | 2 +-
examples/server_node_efd/server/main.c | 10 +-
examples/skeleton/basicfwd.c | 2 +-
examples/timer/main.c | 6 +-
examples/vmdq/main.c | 2 +-
examples/vmdq_dcb/main.c | 4 +-
lib/librte_eal/common/eal_common_dynmem.c | 8 +-
lib/librte_eal/common/eal_common_launch.c | 36 +++---
lib/librte_eal/common/eal_common_lcore.c | 8 +-
lib/librte_eal/common/eal_common_options.c | 54 +++++----
lib/librte_eal/common/eal_options.h | 2 +
lib/librte_eal/common/eal_private.h | 6 +-
lib/librte_eal/common/rte_random.c | 2 +-
lib/librte_eal/common/rte_service.c | 2 +-
lib/librte_eal/freebsd/eal.c | 28 ++---
lib/librte_eal/freebsd/eal_thread.c | 32 +++---
lib/librte_eal/include/rte_common.h | 11 ++
lib/librte_eal/include/rte_eal.h | 4 +-
lib/librte_eal/include/rte_eal_trace.h | 4 +-
lib/librte_eal/include/rte_launch.h | 59 +++++-----
lib/librte_eal/include/rte_lcore.h | 36 ++++--
lib/librte_eal/linux/eal.c | 28 ++---
lib/librte_eal/linux/eal_memory.c | 8 +-
lib/librte_eal/linux/eal_thread.c | 32 +++---
lib/librte_eal/rte_eal_version.map | 2 +-
lib/librte_eal/windows/eal.c | 16 +--
lib/librte_eal/windows/eal_thread.c | 30 ++---
lib/librte_power/rte_power_empty_poll.c | 2 +-
147 files changed, 741 insertions(+), 707 deletions(-)
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 01/15] eal: add macro to mark macros as deprecated
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 8:43 ` Bruce Richardson
2020-09-11 19:06 ` [dpdk-dev] [PATCH 02/15] eal: rename lcore word choices Stephen Hemminger
` (18 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Add a macro that causes GCC and CLANG to emit a warning when
a deprecated macro is used.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/include/rte_common.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h
index 8f487a563dfc..1ade136b64e4 100644
--- a/lib/librte_eal/include/rte_common.h
+++ b/lib/librte_eal/include/rte_common.h
@@ -86,6 +86,17 @@ typedef uint16_t unaligned_uint16_t;
/******* Macro to mark functions and fields scheduled for removal *****/
#define __rte_deprecated __attribute__((__deprecated__))
+/**
+ * Macro to mark macros and defines scheduled for removal
+ */
+#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG)
+#define RTE_PRAGMA(x) _Pragma(#x)
+#define RTE_PRAGMA_WARNING(w) RTE_PRAGMA(GCC warning #w)
+#define RTE_DEPRECATED(o, n) RTE_PRAGMA_WARNING(#o is deprecated use #n)
+#else
+#define RTE_DEPRECATED(o, n)
+#endif
+
/**
* Mark a function or variable to a weak reference.
*/
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 02/15] eal: rename lcore word choices
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
2020-09-11 19:06 ` [dpdk-dev] [PATCH 01/15] eal: add macro to mark macros as deprecated Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 14:40 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 03/15] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
` (17 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master lcore with main lcore and
replace slave lcore with worker lcore.
Keep the old functions and macros but mark them as deprecated
for this release.
The "--master-lcore" command line option is also deprecated
and any usage will print a warning and use "--main-lcore"
as replacement.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/rel_notes/deprecation.rst | 19 -------
doc/guides/rel_notes/release_20_11.rst | 11 ++++
lib/librte_eal/common/eal_common_dynmem.c | 8 +--
lib/librte_eal/common/eal_common_launch.c | 36 ++++++-------
lib/librte_eal/common/eal_common_lcore.c | 8 +--
lib/librte_eal/common/eal_common_options.c | 54 +++++++++++---------
lib/librte_eal/common/eal_options.h | 2 +
lib/librte_eal/common/eal_private.h | 6 +--
lib/librte_eal/common/rte_random.c | 2 +-
lib/librte_eal/common/rte_service.c | 2 +-
lib/librte_eal/freebsd/eal.c | 28 +++++-----
lib/librte_eal/freebsd/eal_thread.c | 32 ++++++------
lib/librte_eal/include/rte_eal.h | 4 +-
lib/librte_eal/include/rte_eal_trace.h | 4 +-
lib/librte_eal/include/rte_launch.h | 59 ++++++++++++----------
lib/librte_eal/include/rte_lcore.h | 36 +++++++++----
lib/librte_eal/linux/eal.c | 28 +++++-----
lib/librte_eal/linux/eal_memory.c | 8 +--
lib/librte_eal/linux/eal_thread.c | 32 ++++++------
lib/librte_eal/rte_eal_version.map | 2 +-
lib/librte_eal/windows/eal.c | 16 +++---
lib/librte_eal/windows/eal_thread.c | 30 +++++------
22 files changed, 223 insertions(+), 204 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 88d7d07613c0..9c11bb354e6d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -25,25 +25,6 @@ Deprecation Notices
* kvargs: The function ``rte_kvargs_process`` will get a new parameter
for returning key match count. It will ease handling of no-match case.
-* eal: To be more inclusive in choice of naming, the DPDK project
- will replace uses of master/slave in the API's and command line arguments.
-
- References to master/slave in relation to lcore will be renamed
- to initial/worker. The function ``rte_get_master_lcore()``
- will be renamed to ``rte_get_initial_lcore()``.
- For the 20.11 release, both names will be present and the
- old function will be marked with the deprecated tag.
- The old function will be removed in a future version.
-
- The iterator for worker lcores will also change:
- ``RTE_LCORE_FOREACH_SLAVE`` will be replaced with
- ``RTE_LCORE_FOREACH_WORKER``.
-
- The ``master-lcore`` argument to testpmd will be replaced
- with ``initial-lcore``. The old ``master-lcore`` argument
- will produce a runtime notification in 20.11 release, and
- be removed completely in a future release.
-
* eal: The terms blacklist and whitelist to describe devices used
by DPDK will be replaced in the 20.11 relase.
This will apply to command line arguments as well as macros.
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 667e3d54ad44..4b9f5087c64e 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -93,6 +93,17 @@ API Changes
and the function ``rte_rawdev_queue_conf_get()``
from ``void`` to ``int`` allowing the return of error codes from drivers.
+* eal: Changed the function ``rte_get_master_lcore()`` is
+ replaced to ``rte_get_main_lcore()``. The old function is deprecated.
+
+ The iterator for worker lcores will also change:
+ ``RTE_LCORE_FOREACH_SLAVE`` will be replaced with
+ ``RTE_LCORE_FOREACH_WORKER``.
+
+ The ``master-lcore`` argument to testpmd will be replaced
+ with ``main-lcore``. The old ``master-lcore`` argument
+ will produce a runtime notification in 20.11 release, and
+ be removed completely in a future release.
ABI Changes
-----------
diff --git a/lib/librte_eal/common/eal_common_dynmem.c b/lib/librte_eal/common/eal_common_dynmem.c
index 614648d8a4de..48eca5854ebe 100644
--- a/lib/librte_eal/common/eal_common_dynmem.c
+++ b/lib/librte_eal/common/eal_common_dynmem.c
@@ -434,12 +434,12 @@ eal_dynmem_calc_num_pages_per_socket(
for (socket = 0; socket < RTE_MAX_NUMA_NODES && total_size != 0;
socket++) {
struct rte_config *cfg = rte_eal_get_configuration();
- unsigned int master_lcore_socket;
+ unsigned int main_lcore_socket;
- master_lcore_socket =
- rte_lcore_to_socket_id(cfg->master_lcore);
+ main_lcore_socket =
+ rte_lcore_to_socket_id(cfg->main_lcore);
- if (master_lcore_socket != socket)
+ if (main_lcore_socket != socket)
continue;
/* Update sizes */
diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c
index cf52d717f68e..34f854ad80c8 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -21,55 +21,55 @@
* Wait until a lcore finished its job.
*/
int
-rte_eal_wait_lcore(unsigned slave_id)
+rte_eal_wait_lcore(unsigned worker_id)
{
- if (lcore_config[slave_id].state == WAIT)
+ if (lcore_config[worker_id].state == WAIT)
return 0;
- while (lcore_config[slave_id].state != WAIT &&
- lcore_config[slave_id].state != FINISHED)
+ while (lcore_config[worker_id].state != WAIT &&
+ lcore_config[worker_id].state != FINISHED)
rte_pause();
rte_rmb();
/* we are in finished state, go to wait state */
- lcore_config[slave_id].state = WAIT;
- return lcore_config[slave_id].ret;
+ lcore_config[worker_id].state = WAIT;
+ return lcore_config[worker_id].ret;
}
/*
- * Check that every SLAVE lcores are in WAIT state, then call
- * rte_eal_remote_launch() for all of them. If call_master is true
- * (set to CALL_MASTER), also call the function on the master lcore.
+ * Check that every WORKER lcores are in WAIT state, then call
+ * rte_eal_remote_launch() for all of them. If call_main is true
+ * (set to CALL_MAIN), also call the function on the main lcore.
*/
int
rte_eal_mp_remote_launch(int (*f)(void *), void *arg,
- enum rte_rmt_call_master_t call_master)
+ enum rte_rmt_call_main_t call_main)
{
int lcore_id;
- int master = rte_get_master_lcore();
+ int main_lcore = rte_get_main_lcore();
/* check state of lcores */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (lcore_config[lcore_id].state != WAIT)
return -EBUSY;
}
/* send messages to cores */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(f, arg, lcore_id);
}
- if (call_master == CALL_MASTER) {
- lcore_config[master].ret = f(arg);
- lcore_config[master].state = FINISHED;
+ if (call_main == CALL_MAIN) {
+ lcore_config[main_lcore].ret = f(arg);
+ lcore_config[main_lcore].state = FINISHED;
}
return 0;
}
/*
- * Return the state of the lcore identified by slave_id.
+ * Return the state of the lcore identified by worker_id.
*/
enum rte_lcore_state_t
rte_eal_get_lcore_state(unsigned lcore_id)
@@ -86,7 +86,7 @@ rte_eal_mp_wait_lcore(void)
{
unsigned lcore_id;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_wait_lcore(lcore_id);
}
}
diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index d64569b3c758..66d6bad1a7d7 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -18,9 +18,9 @@
#include "eal_private.h"
#include "eal_thread.h"
-unsigned int rte_get_master_lcore(void)
+unsigned int rte_get_main_lcore(void)
{
- return rte_eal_get_configuration()->master_lcore;
+ return rte_eal_get_configuration()->main_lcore;
}
unsigned int rte_lcore_count(void)
@@ -93,7 +93,7 @@ int rte_lcore_is_enabled(unsigned int lcore_id)
return cfg->lcore_role[lcore_id] == ROLE_RTE;
}
-unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
+unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap)
{
i++;
if (wrap)
@@ -101,7 +101,7 @@ unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
while (i < RTE_MAX_LCORE) {
if (!rte_lcore_is_enabled(i) ||
- (skip_master && (i == rte_get_master_lcore()))) {
+ (skip_main && (i == rte_get_main_lcore()))) {
i++;
if (wrap)
i %= RTE_MAX_LCORE;
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index a5426e12346a..649dc4f63b7b 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -81,6 +81,7 @@ eal_long_options[] = {
{OPT_TRACE_BUF_SIZE, 1, NULL, OPT_TRACE_BUF_SIZE_NUM },
{OPT_TRACE_MODE, 1, NULL, OPT_TRACE_MODE_NUM },
{OPT_MASTER_LCORE, 1, NULL, OPT_MASTER_LCORE_NUM },
+ {OPT_MAIN_LCORE, 1, NULL, OPT_MAIN_LCORE_NUM },
{OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM},
{OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM },
{OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM },
@@ -144,7 +145,7 @@ struct device_option {
static struct device_option_list devopt_list =
TAILQ_HEAD_INITIALIZER(devopt_list);
-static int master_lcore_parsed;
+static int main_lcore_parsed;
static int mem_parsed;
static int core_parsed;
@@ -575,12 +576,12 @@ eal_parse_service_coremask(const char *coremask)
for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE;
j++, idx++) {
if ((1 << j) & val) {
- /* handle master lcore already parsed */
+ /* handle main lcore already parsed */
uint32_t lcore = idx;
- if (master_lcore_parsed &&
- cfg->master_lcore == lcore) {
+ if (main_lcore_parsed &&
+ cfg->main_lcore == lcore) {
RTE_LOG(ERR, EAL,
- "lcore %u is master lcore, cannot use as service core\n",
+ "lcore %u is main lcore, cannot use as service core\n",
idx);
return -1;
}
@@ -748,12 +749,12 @@ eal_parse_service_corelist(const char *corelist)
min = idx;
for (idx = min; idx <= max; idx++) {
if (cfg->lcore_role[idx] != ROLE_SERVICE) {
- /* handle master lcore already parsed */
+ /* handle main lcore already parsed */
uint32_t lcore = idx;
- if (cfg->master_lcore == lcore &&
- master_lcore_parsed) {
+ if (cfg->main_lcore == lcore &&
+ main_lcore_parsed) {
RTE_LOG(ERR, EAL,
- "Error: lcore %u is master lcore, cannot use as service core\n",
+ "Error: lcore %u is main lcore, cannot use as service core\n",
idx);
return -1;
}
@@ -836,23 +837,23 @@ eal_parse_corelist(const char *corelist, int *cores)
return 0;
}
-/* Changes the lcore id of the master thread */
+/* Changes the lcore id of the main thread */
static int
-eal_parse_master_lcore(const char *arg)
+eal_parse_main_lcore(const char *arg)
{
char *parsing_end;
struct rte_config *cfg = rte_eal_get_configuration();
errno = 0;
- cfg->master_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
+ cfg->main_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
if (errno || parsing_end[0] != 0)
return -1;
- if (cfg->master_lcore >= RTE_MAX_LCORE)
+ if (cfg->main_lcore >= RTE_MAX_LCORE)
return -1;
- master_lcore_parsed = 1;
+ main_lcore_parsed = 1;
/* ensure master core is not used as service core */
- if (lcore_config[cfg->master_lcore].core_role == ROLE_SERVICE) {
+ if (lcore_config[cfg->main_lcore].core_role == ROLE_SERVICE) {
RTE_LOG(ERR, EAL,
"Error: Master lcore is used as a service core\n");
return -1;
@@ -1593,7 +1594,12 @@ eal_parse_common_option(int opt, const char *optarg,
break;
case OPT_MASTER_LCORE_NUM:
- if (eal_parse_master_lcore(optarg) < 0) {
+ fprintf(stderr,
+ "option --" OPT_MASTER_LCORE
+ " is deprecated use " OPT_MAIN_LCORE "\n");
+ /* fallthrough */
+ case OPT_MAIN_LCORE_NUM:
+ if (eal_parse_main_lcore(optarg) < 0) {
RTE_LOG(ERR, EAL, "invalid parameter for --"
OPT_MASTER_LCORE "\n");
return -1;
@@ -1763,9 +1769,9 @@ compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
RTE_CPU_AND(cpuset, cpuset, &default_set);
- /* if no remaining cpu, use master lcore cpu affinity */
+ /* if no remaining cpu, use main lcore cpu affinity */
if (!CPU_COUNT(cpuset)) {
- memcpy(cpuset, &lcore_config[rte_get_master_lcore()].cpuset,
+ memcpy(cpuset, &lcore_config[rte_get_main_lcore()].cpuset,
sizeof(*cpuset));
}
}
@@ -1797,12 +1803,12 @@ eal_adjust_config(struct internal_config *internal_cfg)
if (internal_conf->process_type == RTE_PROC_AUTO)
internal_conf->process_type = eal_proc_type_detect();
- /* default master lcore is the first one */
- if (!master_lcore_parsed) {
- cfg->master_lcore = rte_get_next_lcore(-1, 0, 0);
- if (cfg->master_lcore >= RTE_MAX_LCORE)
+ /* default main lcore is the first one */
+ if (!main_lcore_parsed) {
+ cfg->main_lcore = rte_get_next_lcore(-1, 0, 0);
+ if (cfg->main_lcore >= RTE_MAX_LCORE)
return -1;
- lcore_config[cfg->master_lcore].core_role = ROLE_RTE;
+ lcore_config[cfg->main_lcore].core_role = ROLE_RTE;
}
compute_ctrl_threads_cpuset(internal_cfg);
@@ -1822,7 +1828,7 @@ eal_check_common_options(struct internal_config *internal_cfg)
const struct internal_config *internal_conf =
eal_get_internal_configuration();
- if (cfg->lcore_role[cfg->master_lcore] != ROLE_RTE) {
+ if (cfg->lcore_role[cfg->main_lcore] != ROLE_RTE) {
RTE_LOG(ERR, EAL, "Master lcore is not enabled for DPDK\n");
return -1;
}
diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h
index 89769d48b487..d363228a7a25 100644
--- a/lib/librte_eal/common/eal_options.h
+++ b/lib/librte_eal/common/eal_options.h
@@ -43,6 +43,8 @@ enum {
OPT_TRACE_BUF_SIZE_NUM,
#define OPT_TRACE_MODE "trace-mode"
OPT_TRACE_MODE_NUM,
+#define OPT_MAIN_LCORE "main-lcore"
+ OPT_MAIN_LCORE_NUM,
#define OPT_MASTER_LCORE "master-lcore"
OPT_MASTER_LCORE_NUM,
#define OPT_MBUF_POOL_OPS_NAME "mbuf-pool-ops-name"
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index a6a6381567f4..4684c4c7df19 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -20,8 +20,8 @@
*/
struct lcore_config {
pthread_t thread_id; /**< pthread identifier */
- int pipe_master2slave[2]; /**< communication pipe with master */
- int pipe_slave2master[2]; /**< communication pipe with master */
+ int pipe_main2worker[2]; /**< communication pipe with main */
+ int pipe_worker2main[2]; /**< communication pipe with main */
lcore_function_t * volatile f; /**< function to call */
void * volatile arg; /**< argument of function */
@@ -42,7 +42,7 @@ extern struct lcore_config lcore_config[RTE_MAX_LCORE];
* The global RTE configuration structure.
*/
struct rte_config {
- uint32_t master_lcore; /**< Id of the master lcore */
+ uint32_t main_lcore; /**< Id of the main lcore */
uint32_t lcore_count; /**< Number of available logical cores. */
uint32_t numa_node_count; /**< Number of detected NUMA nodes. */
uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */
diff --git a/lib/librte_eal/common/rte_random.c b/lib/librte_eal/common/rte_random.c
index b7a089ac4fe0..8d88aca26299 100644
--- a/lib/librte_eal/common/rte_random.c
+++ b/lib/librte_eal/common/rte_random.c
@@ -122,7 +122,7 @@ struct rte_rand_state *__rte_rand_get_state(void)
lcore_id = rte_lcore_id();
if (unlikely(lcore_id == LCORE_ID_ANY))
- lcore_id = rte_get_master_lcore();
+ lcore_id = rte_get_main_lcore();
return &rand_states[lcore_id];
}
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 6a0e0ff65d14..626d2409ad57 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -106,7 +106,7 @@ rte_service_init(void)
struct rte_config *cfg = rte_eal_get_configuration();
for (i = 0; i < RTE_MAX_LCORE; i++) {
if (lcore_config[i].core_role == ROLE_SERVICE) {
- if ((unsigned int)i == cfg->master_lcore)
+ if ((unsigned int)i == cfg->main_lcore)
continue;
rte_service_lcore_add(i);
count++;
diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
index 798add0b5919..f7bdd8caabc3 100644
--- a/lib/librte_eal/freebsd/eal.c
+++ b/lib/librte_eal/freebsd/eal.c
@@ -626,10 +626,10 @@ eal_check_mem_on_local_socket(void)
int socket_id;
const struct rte_config *config = rte_eal_get_configuration();
- socket_id = rte_lcore_to_socket_id(config->master_lcore);
+ socket_id = rte_lcore_to_socket_id(config->main_lcore);
if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
- RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
+ RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
}
@@ -850,29 +850,29 @@ rte_eal_init(int argc, char **argv)
eal_check_mem_on_local_socket();
if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
- &lcore_config[config->master_lcore].cpuset) != 0) {
+ &lcore_config[config->main_lcore].cpuset) != 0) {
rte_eal_init_alert("Cannot set affinity");
rte_errno = EINVAL;
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
- RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
- config->master_lcore, thread_id, cpuset,
+ RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
+ config->main_lcore, thread_id, cpuset,
ret == 0 ? "" : "...");
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (pipe(lcore_config[i].pipe_master2slave) < 0)
+ if (pipe(lcore_config[i].pipe_main2worker) < 0)
rte_panic("Cannot create pipe\n");
- if (pipe(lcore_config[i].pipe_slave2master) < 0)
+ if (pipe(lcore_config[i].pipe_worker2main) < 0)
rte_panic("Cannot create pipe\n");
lcore_config[i].state = WAIT;
@@ -885,7 +885,7 @@ rte_eal_init(int argc, char **argv)
/* Set thread_name for aid in debugging. */
snprintf(thread_name, sizeof(thread_name),
- "lcore-slave-%d", i);
+ "lcore-worker-%d", i);
rte_thread_setname(lcore_config[i].thread_id, thread_name);
ret = pthread_setaffinity_np(lcore_config[i].thread_id,
@@ -895,10 +895,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
/* initialize services so vdevs register service during bus_probe. */
diff --git a/lib/librte_eal/freebsd/eal_thread.c b/lib/librte_eal/freebsd/eal_thread.c
index 99b5fefc4c5b..1dce9b04f24a 100644
--- a/lib/librte_eal/freebsd/eal_thread.c
+++ b/lib/librte_eal/freebsd/eal_thread.c
@@ -26,35 +26,35 @@
#include "eal_thread.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
+rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
int rc = -EBUSY;
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
goto finish;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(m2s, &c, 1);
+ n = write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = read(s2m, &c, 1);
+ n = read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -62,7 +62,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
rc = 0;
finish:
- rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc);
+ rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
return rc;
}
@@ -74,21 +74,21 @@ eal_thread_loop(__rte_unused void *arg)
int n, ret;
unsigned lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -104,7 +104,7 @@ eal_thread_loop(__rte_unused void *arg)
/* wait command */
do {
- n = read(m2s, &c, 1);
+ n = read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -115,7 +115,7 @@ eal_thread_loop(__rte_unused void *arg)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(s2m, &c, 1);
+ n = write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
diff --git a/lib/librte_eal/include/rte_eal.h b/lib/librte_eal/include/rte_eal.h
index ddcf6a2e7a1a..f8f0d74b476c 100644
--- a/lib/librte_eal/include/rte_eal.h
+++ b/lib/librte_eal/include/rte_eal.h
@@ -65,11 +65,11 @@ int rte_eal_iopl_init(void);
/**
* Initialize the Environment Abstraction Layer (EAL).
*
- * This function is to be executed on the MASTER lcore only, as soon
+ * This function is to be executed on the MAIN lcore only, as soon
* as possible in the application's main() function.
*
* The function finishes the initialization process before main() is called.
- * It puts the SLAVE lcores in the WAIT state.
+ * It puts the WORKER lcores in the WAIT state.
*
* When the multi-partition feature is supported, depending on the
* configuration (if CONFIG_RTE_EAL_MAIN_PARTITION is disabled), this
diff --git a/lib/librte_eal/include/rte_eal_trace.h b/lib/librte_eal/include/rte_eal_trace.h
index 6b1a813c7b1b..dd4e30e7fe5c 100644
--- a/lib/librte_eal/include/rte_eal_trace.h
+++ b/lib/librte_eal/include/rte_eal_trace.h
@@ -258,10 +258,10 @@ RTE_TRACE_POINT(
RTE_TRACE_POINT(
rte_eal_trace_thread_remote_launch,
RTE_TRACE_POINT_ARGS(int (*f)(void *), void *arg,
- unsigned int slave_id, int rc),
+ unsigned int worker_id, int rc),
rte_trace_point_emit_ptr(f);
rte_trace_point_emit_ptr(arg);
- rte_trace_point_emit_u32(slave_id);
+ rte_trace_point_emit_u32(worker_id);
rte_trace_point_emit_int(rc);
)
RTE_TRACE_POINT(
diff --git a/lib/librte_eal/include/rte_launch.h b/lib/librte_eal/include/rte_launch.h
index 06a671752ace..acba8a779faf 100644
--- a/lib/librte_eal/include/rte_launch.h
+++ b/lib/librte_eal/include/rte_launch.h
@@ -32,12 +32,12 @@ typedef int (lcore_function_t)(void *);
/**
* Launch a function on another lcore.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * Sends a message to a slave lcore (identified by the slave_id) that
+ * Sends a message to a worker lcore (identified by the worker_id) that
* is in the WAIT state (this is true after the first call to
* rte_eal_init()). This can be checked by first calling
- * rte_eal_wait_lcore(slave_id).
+ * rte_eal_wait_lcore(worker_id).
*
* When the remote lcore receives the message, it switches to
* the RUNNING state, then calls the function f with argument arg. Once the
@@ -45,7 +45,7 @@ typedef int (lcore_function_t)(void *);
* the return value of f is stored in a local variable to be read using
* rte_eal_wait_lcore().
*
- * The MASTER lcore returns as soon as the message is sent and knows
+ * The MAIN lcore returns as soon as the message is sent and knows
* nothing about the completion of f.
*
* Note: This function is not designed to offer optimum
@@ -56,37 +56,40 @@ typedef int (lcore_function_t)(void *);
* The function to be called.
* @param arg
* The argument for the function.
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore on which the function should be executed.
* @return
* - 0: Success. Execution of function f started on the remote lcore.
* - (-EBUSY): The remote lcore is not in a WAIT state.
*/
-int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned slave_id);
+int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned worker_id);
/**
- * This enum indicates whether the master core must execute the handler
+ * This enum indicates whether the main core must execute the handler
* launched on all logical cores.
*/
-enum rte_rmt_call_master_t {
- SKIP_MASTER = 0, /**< lcore handler not executed by master core. */
- CALL_MASTER, /**< lcore handler executed by master core. */
+enum rte_rmt_call_main_t {
+ SKIP_MAIN = 0, /**< lcore handler not executed by main core. */
+ CALL_MAIN, /**< lcore handler executed by main core. */
};
+#define SKIP_MASTER RTE_DEPRECATED(SKIP_MASTER, SKIP_MAIN) SKIP_MAIN
+#define CALL_MASTER RTE_DEPRECATED(CALL_MASTER, CALL_MAIN) CALL_MAIN
+
/**
* Launch a function on all lcores.
*
- * Check that each SLAVE lcore is in a WAIT state, then call
+ * Check that each WORKER lcore is in a WAIT state, then call
* rte_eal_remote_launch() for each lcore.
*
* @param f
* The function to be called.
* @param arg
* The argument for the function.
- * @param call_master
- * If call_master set to SKIP_MASTER, the MASTER lcore does not call
- * the function. If call_master is set to CALL_MASTER, the function
- * is also called on master before returning. In any case, the master
+ * @param call_main
+ * If call_main set to SKIP_MAIN, the MAIN lcore does not call
+ * the function. If call_main is set to CALL_MAIN, the function
+ * is also called on main before returning. In any case, the main
* lcore returns as soon as it finished its job and knows nothing
* about the completion of f on the other lcores.
* @return
@@ -95,49 +98,49 @@ enum rte_rmt_call_master_t {
* case, no message is sent to any of the lcores.
*/
int rte_eal_mp_remote_launch(lcore_function_t *f, void *arg,
- enum rte_rmt_call_master_t call_master);
+ enum rte_rmt_call_main_t call_main);
/**
- * Get the state of the lcore identified by slave_id.
+ * Get the state of the lcore identified by worker_id.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore.
* @return
* The state of the lcore.
*/
-enum rte_lcore_state_t rte_eal_get_lcore_state(unsigned slave_id);
+enum rte_lcore_state_t rte_eal_get_lcore_state(unsigned worker_id);
/**
* Wait until an lcore finishes its job.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * If the slave lcore identified by the slave_id is in a FINISHED state,
+ * If the worker lcore identified by the worker_id is in a FINISHED state,
* switch to the WAIT state. If the lcore is in RUNNING state, wait until
* the lcore finishes its job and moves to the FINISHED state.
*
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore.
* @return
- * - 0: If the lcore identified by the slave_id is in a WAIT state.
+ * - 0: If the lcore identified by the worker_id is in a WAIT state.
* - The value that was returned by the previous remote launch
- * function call if the lcore identified by the slave_id was in a
+ * function call if the lcore identified by the worker_id was in a
* FINISHED or RUNNING state. In this case, it changes the state
* of the lcore to WAIT.
*/
-int rte_eal_wait_lcore(unsigned slave_id);
+int rte_eal_wait_lcore(unsigned worker_id);
/**
* Wait until all lcores finish their jobs.
*
- * To be executed on the MASTER lcore only. Issue an
+ * To be executed on the MAIN lcore only. Issue an
* rte_eal_wait_lcore() for every lcore. The return values are
* ignored.
*
* After a call to rte_eal_mp_wait_lcore(), the caller can assume
- * that all slave lcores are in a WAIT state.
+ * that all worker lcores are in a WAIT state.
*/
void rte_eal_mp_wait_lcore(void);
diff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h
index b8b64a625200..b0b6f4c643b0 100644
--- a/lib/librte_eal/include/rte_lcore.h
+++ b/lib/librte_eal/include/rte_lcore.h
@@ -78,12 +78,24 @@ rte_lcore_id(void)
}
/**
- * Get the id of the master lcore
+ * Get the id of the main lcore
*
* @return
- * the id of the master lcore
+ * the id of the main lcore
*/
-unsigned int rte_get_master_lcore(void);
+unsigned int rte_get_main_lcore(void);
+
+/**
+ * Deprecated function the id of the main lcore
+ *
+ * @return
+ * the id of the main lcore
+ */
+__rte_deprecated
+static inline unsigned int rte_get_master_lcore(void)
+{
+ return rte_get_main_lcore();
+}
/**
* Return the number of execution units (lcores) on the system.
@@ -203,32 +215,36 @@ int rte_lcore_is_enabled(unsigned int lcore_id);
*
* @param i
* The current lcore (reference).
- * @param skip_master
- * If true, do not return the ID of the master lcore.
+ * @param skip_main
+ * If true, do not return the ID of the main lcore.
* @param wrap
* If true, go back to 0 when RTE_MAX_LCORE is reached; otherwise,
* return RTE_MAX_LCORE.
* @return
* The next lcore_id or RTE_MAX_LCORE if not found.
*/
-unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap);
+unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap);
/**
* Macro to browse all running lcores.
*/
#define RTE_LCORE_FOREACH(i) \
for (i = rte_get_next_lcore(-1, 0, 0); \
- i<RTE_MAX_LCORE; \
+ i < RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 0, 0))
/**
- * Macro to browse all running lcores except the master lcore.
+ * Macro to browse all running lcores except the main lcore.
*/
-#define RTE_LCORE_FOREACH_SLAVE(i) \
+#define RTE_LCORE_FOREACH_WORKER(i) \
for (i = rte_get_next_lcore(-1, 1, 0); \
- i<RTE_MAX_LCORE; \
+ i < RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 1, 0))
+#define RTE_LCORE_FOREACH_SLAVE(l) \
+ RTE_DEPRECATED(RTE_LCORE_FOREACH_SLAVE, RTE_LCORE_FOREACH_WORKER) \
+ RTE_LCORE_FOREACH_WORKER(l)
+
/**
* Callback prototype for initializing lcores.
*
diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c
index 0960f01d0516..d8b1948585dc 100644
--- a/lib/librte_eal/linux/eal.c
+++ b/lib/librte_eal/linux/eal.c
@@ -884,10 +884,10 @@ eal_check_mem_on_local_socket(void)
int socket_id;
const struct rte_config *config = rte_eal_get_configuration();
- socket_id = rte_lcore_to_socket_id(config->master_lcore);
+ socket_id = rte_lcore_to_socket_id(config->main_lcore);
if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
- RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
+ RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
}
static int
@@ -1214,28 +1214,28 @@ rte_eal_init(int argc, char **argv)
eal_check_mem_on_local_socket();
if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
- &lcore_config[config->master_lcore].cpuset) != 0) {
+ &lcore_config[config->main_lcore].cpuset) != 0) {
rte_eal_init_alert("Cannot set affinity");
rte_errno = EINVAL;
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
- RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
- config->master_lcore, (uintptr_t)thread_id, cpuset,
+ RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
+ config->main_lcore, (uintptr_t)thread_id, cpuset,
ret == 0 ? "" : "...");
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (pipe(lcore_config[i].pipe_master2slave) < 0)
+ if (pipe(lcore_config[i].pipe_main2worker) < 0)
rte_panic("Cannot create pipe\n");
- if (pipe(lcore_config[i].pipe_slave2master) < 0)
+ if (pipe(lcore_config[i].pipe_worker2main) < 0)
rte_panic("Cannot create pipe\n");
lcore_config[i].state = WAIT;
@@ -1248,7 +1248,7 @@ rte_eal_init(int argc, char **argv)
/* Set thread_name for aid in debugging. */
snprintf(thread_name, sizeof(thread_name),
- "lcore-slave-%d", i);
+ "lcore-worker-%d", i);
ret = rte_thread_setname(lcore_config[i].thread_id,
thread_name);
if (ret != 0)
@@ -1262,10 +1262,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
/* initialize services so vdevs register service during bus_probe. */
diff --git a/lib/librte_eal/linux/eal_memory.c b/lib/librte_eal/linux/eal_memory.c
index 89725291b0ce..d7349544a13a 100644
--- a/lib/librte_eal/linux/eal_memory.c
+++ b/lib/librte_eal/linux/eal_memory.c
@@ -1751,7 +1751,7 @@ memseg_primary_init_32(void)
for (i = 0; i < rte_socket_count(); i++) {
int hp_sizes = (int) internal_conf->num_hugepage_sizes;
uint64_t max_socket_mem, cur_socket_mem;
- unsigned int master_lcore_socket;
+ unsigned int main_lcore_socket;
struct rte_config *cfg = rte_eal_get_configuration();
bool skip;
@@ -1767,10 +1767,10 @@ memseg_primary_init_32(void)
skip = active_sockets != 0 &&
internal_conf->socket_mem[socket_id] == 0;
/* ...or if we didn't specifically request memory on *any*
- * socket, and this is not master lcore
+ * socket, and this is not main lcore
*/
- master_lcore_socket = rte_lcore_to_socket_id(cfg->master_lcore);
- skip |= active_sockets == 0 && socket_id != master_lcore_socket;
+ main_lcore_socket = rte_lcore_to_socket_id(cfg->main_lcore);
+ skip |= active_sockets == 0 && socket_id != main_lcore_socket;
if (skip) {
RTE_LOG(DEBUG, EAL, "Will not preallocate memory on socket %u\n",
diff --git a/lib/librte_eal/linux/eal_thread.c b/lib/librte_eal/linux/eal_thread.c
index 068de2559555..bed1d513c841 100644
--- a/lib/librte_eal/linux/eal_thread.c
+++ b/lib/librte_eal/linux/eal_thread.c
@@ -26,35 +26,35 @@
#include "eal_thread.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
+rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
int rc = -EBUSY;
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
goto finish;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(m2s, &c, 1);
+ n = write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = read(s2m, &c, 1);
+ n = read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -62,7 +62,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
rc = 0;
finish:
- rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc);
+ rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
return rc;
}
@@ -74,21 +74,21 @@ eal_thread_loop(__rte_unused void *arg)
int n, ret;
unsigned lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -104,7 +104,7 @@ eal_thread_loop(__rte_unused void *arg)
/* wait command */
do {
- n = read(m2s, &c, 1);
+ n = read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -115,7 +115,7 @@ eal_thread_loop(__rte_unused void *arg)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(s2m, &c, 1);
+ n = write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 0b18e2ef85f9..8ff6fe7c3eaf 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -74,7 +74,7 @@ DPDK_21 {
rte_free;
rte_get_hpet_cycles;
rte_get_hpet_hz;
- rte_get_master_lcore;
+ rte_get_main_lcore;
rte_get_next_lcore;
rte_get_tsc_hz;
rte_hexdump;
diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index bc48f27ab39a..cbca20956210 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -350,8 +350,8 @@ rte_eal_init(int argc, char **argv)
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
bscan = rte_bus_scan();
if (bscan < 0) {
@@ -360,16 +360,16 @@ rte_eal_init(int argc, char **argv)
return -1;
}
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (_pipe(lcore_config[i].pipe_master2slave,
+ if (_pipe(lcore_config[i].pipe_main2worker,
sizeof(char), _O_BINARY) < 0)
rte_panic("Cannot create pipe\n");
- if (_pipe(lcore_config[i].pipe_slave2master,
+ if (_pipe(lcore_config[i].pipe_worker2main,
sizeof(char), _O_BINARY) < 0)
rte_panic("Cannot create pipe\n");
@@ -394,10 +394,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
return fctret;
}
diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index 20889b6196c9..908e726d16cc 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -17,34 +17,34 @@
#include "eal_windows.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int slave_id)
+rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
return -EBUSY;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = _write(m2s, &c, 1);
+ n = _write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = _read(s2m, &c, 1);
+ n = _read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -61,21 +61,21 @@ eal_thread_loop(void *arg __rte_unused)
int n, ret;
unsigned int lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -88,7 +88,7 @@ eal_thread_loop(void *arg __rte_unused)
/* wait command */
do {
- n = _read(m2s, &c, 1);
+ n = _read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -99,7 +99,7 @@ eal_thread_loop(void *arg __rte_unused)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = _write(s2m, &c, 1);
+ n = _write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 03/15] rte_power: replace rte_master_lcore with rte_main_lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
2020-09-11 19:06 ` [dpdk-dev] [PATCH 01/15] eal: add macro to mark macros as deprecated Stephen Hemminger
2020-09-11 19:06 ` [dpdk-dev] [PATCH 02/15] eal: rename lcore word choices Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 14:41 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 04/15] drivers: replace master lcore with main lcore Stephen Hemminger
` (16 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Don't use old function.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_power/rte_power_empty_poll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_power/rte_power_empty_poll.c b/lib/librte_power/rte_power_empty_poll.c
index 70c07b1533f3..975aa9299799 100644
--- a/lib/librte_power/rte_power_empty_poll.c
+++ b/lib/librte_power/rte_power_empty_poll.c
@@ -452,7 +452,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,
if (get_freq_index(LOW) > total_avail_freqs[i])
return -1;
- if (rte_get_master_lcore() != i) {
+ if (rte_get_main_lcore() != i) {
w->wrk_stats[i].lcore_id = i;
set_policy(&w->wrk_stats[i], policy);
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 04/15] drivers: replace master lcore with main lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (2 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 03/15] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 14:42 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 05/15] doc: " Stephen Hemminger
` (15 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace use of deprecated rte_master_lcore with rte_main_lcore.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 4 ++--
drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
drivers/net/qede/base/bcm_osal.c | 4 ++--
drivers/net/softnic/rte_eth_softnic_thread.c | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 32e872da5209..c94c72106f2c 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -257,7 +257,7 @@ int rte_dpaa_portal_init(void *arg)
BUS_INIT_FUNC_TRACE();
if ((size_t)arg == 1 || lcore == LCORE_ID_ANY)
- lcore = rte_get_master_lcore();
+ lcore = rte_get_main_lcore();
else
if (lcore >= RTE_MAX_LCORE)
return -1;
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 54f654744259..910fb11c9c38 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -429,7 +429,7 @@ int bnxt_alloc_rxtx_nq_ring(struct bnxt *bp)
if (!BNXT_HAS_NQ(bp) || bp->rxtx_nq_ring)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_main_lcore());
nqr = rte_zmalloc_socket("nqr",
sizeof(struct bnxt_cp_ring_info),
@@ -819,7 +819,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
if (BNXT_NUM_ASYNC_CPR(bp) == 0)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_main_lcore());
cpr = rte_zmalloc_socket("cpr",
sizeof(struct bnxt_cp_ring_info),
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 96b27dfd309d..85deddf120b4 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -814,7 +814,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
hif = mrvl_get_hif(priv, core_id);
@@ -1618,7 +1618,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
hif = mrvl_get_hif(rxq->priv, core_id);
if (!hif)
@@ -1768,7 +1768,7 @@ mrvl_rx_queue_release(void *rxq)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
if (!q)
return;
diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 65837b53d063..4c2706ab4b90 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -112,7 +112,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, RTE_CACHE_LINE_SIZE);
@@ -151,7 +151,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, align);
diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index dcfb5eb82c18..8dbb8886e30e 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -25,7 +25,7 @@ softnic_thread_free(struct pmd_internals *softnic)
{
uint32_t i;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
struct softnic_thread *t = &softnic->thread[i];
/* MSGQs */
@@ -99,7 +99,7 @@ softnic_thread_init(struct pmd_internals *softnic)
static inline int
thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id)
{
- if (thread_id == rte_get_master_lcore())
+ if (thread_id == rte_get_main_lcore())
return 0; /* FALSE */
if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE))
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 05/15] doc: replace master lcore with main lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (3 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 04/15] drivers: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 14:56 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 06/15] app/test: replace uses of master/slave Stephen Hemminger
` (14 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Make sure that master lcore is not used in documentation.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/faq/faq.rst | 2 +-
doc/guides/linux_gsg/eal_args.include.rst | 2 +-
doc/guides/nics/bnxt.rst | 2 +-
doc/guides/prog_guide/env_abstraction_layer.rst | 6 +++---
doc/guides/prog_guide/event_ethernet_rx_adapter.rst | 2 +-
doc/guides/prog_guide/glossary.rst | 10 ++++++++--
doc/guides/sample_app_ug/bbdev_app.rst | 2 +-
doc/guides/sample_app_ug/ethtool.rst | 2 +-
doc/guides/sample_app_ug/hello_world.rst | 2 +-
doc/guides/sample_app_ug/ioat.rst | 10 +++++-----
doc/guides/sample_app_ug/ip_pipeline.rst | 2 +-
doc/guides/sample_app_ug/l2_forward_event.rst | 2 +-
doc/guides/sample_app_ug/l2_forward_real_virtual.rst | 2 +-
doc/guides/sample_app_ug/l3_forward_power_man.rst | 2 +-
doc/guides/sample_app_ug/link_status_intr.rst | 2 +-
doc/guides/sample_app_ug/multi_process.rst | 2 +-
doc/guides/sample_app_ug/packet_ordering.rst | 2 +-
doc/guides/sample_app_ug/performance_thread.rst | 4 ++--
doc/guides/sample_app_ug/ptpclient.rst | 2 +-
doc/guides/sample_app_ug/timer.rst | 8 ++++----
doc/guides/testpmd_app_ug/run_app.rst | 2 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
22 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/doc/guides/faq/faq.rst b/doc/guides/faq/faq.rst
index bb1df7dc8a0f..d517e08a1e1f 100644
--- a/doc/guides/faq/faq.rst
+++ b/doc/guides/faq/faq.rst
@@ -48,7 +48,7 @@ therefore all the hugepages are allocated on the wrong socket.
To avoid this scenario, either lower the amount of hugepage memory available to 1 GB size (or less), or run the application with taskset
affinitizing the application to a would-be master core.
-For example, if your EAL coremask is 0xff0, the master core will usually be the first core in the coremask (0x10); this is what you have to supply to taskset::
+For example, if your EAL coremask is 0xff0, the main core will usually be the first core in the coremask (0x10); this is what you have to supply to taskset::
taskset 0x10 ./l2fwd -l 4-11 -n 2
diff --git a/doc/guides/linux_gsg/eal_args.include.rst b/doc/guides/linux_gsg/eal_args.include.rst
index 0fe44579689b..329d4cdfbfb3 100644
--- a/doc/guides/linux_gsg/eal_args.include.rst
+++ b/doc/guides/linux_gsg/eal_args.include.rst
@@ -33,7 +33,7 @@ Lcore-related options
At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can
be used.
-* ``--master-lcore <core ID>``
+* ``--main-lcore <core ID>``
Core ID that is used as master.
diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst
index 129a16cfc757..b3950579e908 100644
--- a/doc/guides/nics/bnxt.rst
+++ b/doc/guides/nics/bnxt.rst
@@ -385,7 +385,7 @@ The application enables multiple TX and RX queues when it is started.
.. code-block:: console
- testpmd -l 1,3,5 --master-lcore 1 --txq=2 –rxq=2 --nb-cores=2
+ testpmd -l 1,3,5 --main-lcore 1 --txq=2 –rxq=2 --nb-cores=2
**TSS**
diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index f64ae953d106..764a0706caa7 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -64,7 +64,7 @@ It consist of calls to the pthread library (more specifically, pthread_self(), p
.. note::
Initialization of objects, such as memory zones, rings, memory pools, lpm tables and hash tables,
- should be done as part of the overall application initialization on the master lcore.
+ should be done as part of the overall application initialization on the main lcore.
The creation and initialization functions for these objects are not multi-thread safe.
However, once initialized, the objects themselves can safely be used in multiple threads simultaneously.
@@ -186,7 +186,7 @@ very dependent on the memory allocation patterns of the application.
Additional restrictions are present when running in 32-bit mode. In dynamic
memory mode, by default maximum of 2 gigabytes of VA space will be preallocated,
-and all of it will be on master lcore NUMA node unless ``--socket-mem`` flag is
+and all of it will be on main lcore NUMA node unless ``--socket-mem`` flag is
used.
In legacy mode, VA space will only be preallocated for segments that were
@@ -607,7 +607,7 @@ controlled with tools like taskset (Linux) or cpuset (FreeBSD),
- with affinity restricted to 2-4, the Control Threads will end up on
CPU 4.
- with affinity restricted to 2-3, the Control Threads will end up on
- CPU 2 (master lcore, which is the default when no CPU is available).
+ CPU 2 (main lcore, which is the default when no CPU is available).
.. _known_issue_label:
diff --git a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst
index c7dda92215ea..236f43f4557b 100644
--- a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst
+++ b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst
@@ -172,7 +172,7 @@ converts the received packets to events in the same manner as packets
received on a polled Rx queue. The interrupt thread is affinitized to the same
CPUs as the lcores of the Rx adapter service function, if the Rx adapter
service function has not been mapped to any lcores, the interrupt thread
-is mapped to the master lcore.
+is mapped to the main lcore.
Rx Callback for SW Rx Adapter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/guides/prog_guide/glossary.rst b/doc/guides/prog_guide/glossary.rst
index 21063a414729..10b478c9f438 100644
--- a/doc/guides/prog_guide/glossary.rst
+++ b/doc/guides/prog_guide/glossary.rst
@@ -124,10 +124,13 @@ LAN
LPM
Longest Prefix Match
-master lcore
+main lcore
The execution unit that executes the main() function and that launches
other lcores.
+master lcore
+ Deprecated name for *main lcore*. No longer used.
+
mbuf
An mbuf is a data structure used internally to carry messages (mainly
network packets). The name is derived from BSD stacks. To understand the
@@ -185,7 +188,7 @@ Rx
Reception
Slave lcore
- Any *lcore* that is not the *master lcore*.
+ Deprecated name for *worker lcore*. No longer used.
Socket
A physical CPU, that includes several *cores*.
@@ -237,6 +240,9 @@ VLAN
Wr
Write
+Worker lcore
+ Any *lcore* that is not the *main lcore*.
+
WRED
Weighted Random Early Detection
diff --git a/doc/guides/sample_app_ug/bbdev_app.rst b/doc/guides/sample_app_ug/bbdev_app.rst
index 405e706a46e4..54ff6574aed8 100644
--- a/doc/guides/sample_app_ug/bbdev_app.rst
+++ b/doc/guides/sample_app_ug/bbdev_app.rst
@@ -94,7 +94,7 @@ device gets linked to a corresponding ethernet port as whitelisted by
the parameter -w.
3 cores are allocated to the application, and assigned as:
- - core 3 is the master and used to print the stats live on screen,
+ - core 3 is the main and used to print the stats live on screen,
- core 4 is the encoding lcore performing Rx and Turbo Encode operations
diff --git a/doc/guides/sample_app_ug/ethtool.rst b/doc/guides/sample_app_ug/ethtool.rst
index 253004dd0082..03f570f11f69 100644
--- a/doc/guides/sample_app_ug/ethtool.rst
+++ b/doc/guides/sample_app_ug/ethtool.rst
@@ -65,7 +65,7 @@ Explanation
The sample program has two parts: A background `packet reflector`_
that runs on a slave core, and a foreground `Ethtool Shell`_ that
-runs on the master core. These are described below.
+runs on the main core. These are described below.
Packet Reflector
~~~~~~~~~~~~~~~~
diff --git a/doc/guides/sample_app_ug/hello_world.rst b/doc/guides/sample_app_ug/hello_world.rst
index 46f997a7dce3..3504b744844f 100644
--- a/doc/guides/sample_app_ug/hello_world.rst
+++ b/doc/guides/sample_app_ug/hello_world.rst
@@ -81,7 +81,7 @@ The code that launches the function on each lcore is as follows:
rte_eal_remote_launch(lcore_hello, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
lcore_hello(NULL);
diff --git a/doc/guides/sample_app_ug/ioat.rst b/doc/guides/sample_app_ug/ioat.rst
index 3f7d5c34a6c8..0982d2d2f0b4 100644
--- a/doc/guides/sample_app_ug/ioat.rst
+++ b/doc/guides/sample_app_ug/ioat.rst
@@ -69,13 +69,13 @@ provided parameters. The app can use up to 2 lcores: one of them receives
incoming traffic and makes a copy of each packet. The second lcore then
updates MAC address and sends the copy. If one lcore per port is used,
both operations are done sequentially. For each configuration an additional
-lcore is needed since the master lcore does not handle traffic but is
+lcore is needed since the main lcore does not handle traffic but is
responsible for configuration, statistics printing and safe shutdown of
all ports and devices.
The application can use a maximum of 8 ports.
-To run the application in a Linux environment with 3 lcores (the master lcore,
+To run the application in a Linux environment with 3 lcores (the main lcore,
plus two forwarding cores), a single port (port 0), software copying and MAC
updating issue the command:
@@ -83,7 +83,7 @@ updating issue the command:
$ ./build/ioatfwd -l 0-2 -n 2 -- -p 0x1 --mac-updating -c sw
-To run the application in a Linux environment with 2 lcores (the master lcore,
+To run the application in a Linux environment with 2 lcores (the main lcore,
plus one forwarding core), 2 ports (ports 0 and 1), hardware copying and no MAC
updating issue the command:
@@ -310,8 +310,8 @@ If initialization is successful, memory for hardware device
statistics is allocated.
Finally ``main()`` function starts all packet handling lcores and starts
-printing stats in a loop on the master lcore. The application can be
-interrupted and closed using ``Ctrl-C``. The master lcore waits for
+printing stats in a loop on the main lcore. The application can be
+interrupted and closed using ``Ctrl-C``. The main lcore waits for
all slave processes to finish, deallocates resources and exits.
The processing lcores launching function are described below.
diff --git a/doc/guides/sample_app_ug/ip_pipeline.rst b/doc/guides/sample_app_ug/ip_pipeline.rst
index 56014be17458..c497ffc0a6c9 100644
--- a/doc/guides/sample_app_ug/ip_pipeline.rst
+++ b/doc/guides/sample_app_ug/ip_pipeline.rst
@@ -130,7 +130,7 @@ executes two tasks in time-sharing mode:
1. *Packet processing task*: Process bursts of input packets read from the pipeline input ports.
2. *Message handling task*: Periodically, the data plane thread pauses the packet processing task and polls for request
- messages send by the master thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules
+ messages send by the main thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules
to/from given table of a specific pipeline owned by the current data plane thread, read statistics, etc.
Examples
diff --git a/doc/guides/sample_app_ug/l2_forward_event.rst b/doc/guides/sample_app_ug/l2_forward_event.rst
index d536eee819d0..6e2324552f49 100644
--- a/doc/guides/sample_app_ug/l2_forward_event.rst
+++ b/doc/guides/sample_app_ug/l2_forward_event.rst
@@ -631,7 +631,7 @@ not many packets to send, however it improves performance:
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= timer_period)) {
/* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
timer_tsc = 0;
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index c0e8488e7987..06586ed4a822 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -455,7 +455,7 @@ however it improves performance:
if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
/* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst
index 0cc6f2e62e75..f05816d9b24e 100644
--- a/doc/guides/sample_app_ug/l3_forward_power_man.rst
+++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst
@@ -441,7 +441,7 @@ The telemetry mode support for ``l3fwd-power`` is a standalone mode, in this mod
``l3fwd-power`` does simple l3fwding along with calculating empty polls, full polls,
and busy percentage for each forwarding core. The aggregation of these
values of all cores is reported as application level telemetry to metric
-library for every 500ms from the master core.
+library for every 500ms from the main core.
The busy percentage is calculated by recording the poll_count
and when the count reaches a defined value the total
diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
index 04c40f28540d..8ceacc42eb9b 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -403,7 +403,7 @@ However, it improves performance:
if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
/* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
diff --git a/doc/guides/sample_app_ug/multi_process.rst b/doc/guides/sample_app_ug/multi_process.rst
index f2a79a639763..c391c549b9b5 100644
--- a/doc/guides/sample_app_ug/multi_process.rst
+++ b/doc/guides/sample_app_ug/multi_process.rst
@@ -273,7 +273,7 @@ In addition to the EAL parameters, the application- specific parameters are:
.. note::
- In the server process, a single thread, the master thread, that is, the lowest numbered lcore in the coremask/corelist, performs all packet I/O.
+ In the server process, a single thread, the main thread, that is, the lowest numbered lcore in the coremask/corelist, performs all packet I/O.
If a coremask/corelist is specified with more than a single lcore bit set in it,
an additional lcore will be used for a thread to periodically print packet count statistics.
diff --git a/doc/guides/sample_app_ug/packet_ordering.rst b/doc/guides/sample_app_ug/packet_ordering.rst
index 1c8ee5d04071..26bed0136a12 100644
--- a/doc/guides/sample_app_ug/packet_ordering.rst
+++ b/doc/guides/sample_app_ug/packet_ordering.rst
@@ -46,7 +46,7 @@ The application execution command line is:
./packet_ordering [EAL options] -- -p PORTMASK [--disable-reorder] [--insight-worker]
The -c EAL CPU_COREMASK option has to contain at least 3 CPU cores.
-The first CPU core in the core mask is the master core and would be assigned to
+The first CPU core in the core mask is the main core and would be assigned to
RX core, the last to TX core and the rest to Worker cores.
The PORTMASK parameter must contain either 1 or even enabled port numbers.
diff --git a/doc/guides/sample_app_ug/performance_thread.rst b/doc/guides/sample_app_ug/performance_thread.rst
index b04d0ba444af..cfc0676e9210 100644
--- a/doc/guides/sample_app_ug/performance_thread.rst
+++ b/doc/guides/sample_app_ug/performance_thread.rst
@@ -280,8 +280,8 @@ functionality into different threads, and the pairs of RX and TX threads are
interconnected via software rings.
On initialization an L-thread scheduler is started on every EAL thread. On all
-but the master EAL thread only a dummy L-thread is initially started.
-The L-thread started on the master EAL thread then spawns other L-threads on
+but the main EAL thread only a dummy L-thread is initially started.
+The L-thread started on the main EAL thread then spawns other L-threads on
different L-thread schedulers according the command line parameters.
The RX threads poll the network interface queues and post received packets
diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst
index 12b4f13d5bd8..5b51c8526c5a 100644
--- a/doc/guides/sample_app_ug/ptpclient.rst
+++ b/doc/guides/sample_app_ug/ptpclient.rst
@@ -21,7 +21,7 @@ The PTP sample application is intended as a simple reference implementation of
a PTP client using the DPDK IEEE1588 API.
In order to keep the application simple the following assumptions are made:
-* The first discovered master is the master for the session.
+* The first discovered master is the main for the session.
* Only L2 PTP packets are supported.
* Only the PTP v2 protocol is supported.
* Only the slave clock is implemented.
diff --git a/doc/guides/sample_app_ug/timer.rst b/doc/guides/sample_app_ug/timer.rst
index 98d762d2388c..071db764b170 100644
--- a/doc/guides/sample_app_ug/timer.rst
+++ b/doc/guides/sample_app_ug/timer.rst
@@ -49,7 +49,7 @@ In addition to EAL initialization, the timer subsystem must be initialized, by c
rte_timer_subsystem_init();
After timer creation (see the next paragraph),
-the main loop is executed on each slave lcore using the well-known rte_eal_remote_launch() and also on the master.
+the main loop is executed on each slave lcore using the well-known rte_eal_remote_launch() and also on the main.
.. code-block:: c
@@ -59,7 +59,7 @@ the main loop is executed on each slave lcore using the well-known rte_eal_remot
rte_eal_remote_launch(lcore_mainloop, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
(void) lcore_mainloop(NULL);
@@ -105,7 +105,7 @@ This call to rte_timer_init() is necessary before doing any other operation on t
Then, the two timers are configured:
-* The first timer (timer0) is loaded on the master lcore and expires every second.
+* The first timer (timer0) is loaded on the main lcore and expires every second.
Since the PERIODICAL flag is provided, the timer is reloaded automatically by the timer subsystem.
The callback function is timer0_cb().
@@ -115,7 +115,7 @@ Then, the two timers are configured:
.. code-block:: c
- /* load timer0, every second, on master lcore, reloaded automatically */
+ /* load timer0, every second, on main lcore, reloaded automatically */
hz = rte_get_hpet_hz();
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index d1e4ee3e7a46..b080cd9532ba 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -71,7 +71,7 @@ The command line options are:
* ``--coremask=0xXX``
Set the hexadecimal bitmask of the cores running the packet forwarding test.
- The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
+ The main lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
* ``--portmask=0xXX``
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 90cf252df58f..01682508b592 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -699,7 +699,7 @@ This is equivalent to the ``--coremask`` command-line option.
.. note::
- The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
+ The main lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
set portmask
~~~~~~~~~~~~
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 06/15] app/test: replace uses of master/slave
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (4 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 05/15] doc: " Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:02 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 07/15] app/test-pmd: replace master lcore with main lcore Stephen Hemminger
` (13 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master lcore with main lcore and slave lcore with worker lcore.
Mostly automatic replacement.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/autotest_test_funcs.py | 2 +-
app/test/meson.build | 2 +-
app/test/test.c | 2 +-
app/test/test_atomic.c | 26 +++---
app/test/test_barrier.c | 2 +-
app/test/test_compressdev_test_buffer.h | 2 +-
app/test/test_cryptodev.c | 12 +--
app/test/test_distributor.c | 8 +-
app/test/test_distributor_perf.c | 10 +--
app/test/test_eal_flags.c | 32 +++----
app/test/test_efd.c | 2 +-
app/test/test_efd_perf.c | 2 +-
app/test/test_func_reentrancy.c | 6 +-
app/test/test_hash_multiwriter.c | 4 +-
app/test/test_hash_readwrite.c | 39 +++++----
app/test/test_kni.c | 16 ++--
app/test/test_lpm_perf.c | 4 +-
app/test/test_malloc.c | 12 +--
app/test/test_mbuf.c | 33 ++++----
app/test/test_mcslock.c | 28 +++----
app/test/test_mempool_perf.c | 10 +--
app/test/test_mp_secondary.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/test_per_lcore.c | 14 ++--
app/test/test_pmd_perf.c | 20 ++---
app/test/test_rcu_qsbr.c | 2 +-
app/test/test_rcu_qsbr_perf.c | 2 +-
app/test/test_ring_perf.c | 14 ++--
app/test/test_ring_stress_impl.h | 10 +--
app/test/test_rwlock.c | 28 +++----
app/test/test_service_cores.c | 14 ++--
app/test/test_spinlock.c | 34 ++++----
app/test/test_stack.c | 2 +-
app/test/test_stack_perf.c | 6 +-
app/test/test_ticketlock.c | 36 ++++----
app/test/test_timer.c | 106 ++++++++++++------------
app/test/test_timer_racecond.c | 26 +++---
app/test/test_timer_secondary.c | 2 +-
app/test/test_trace_perf.c | 4 +-
39 files changed, 288 insertions(+), 290 deletions(-)
diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py
index 26688b71323e..573bca089997 100644
--- a/app/test/autotest_test_funcs.py
+++ b/app/test/autotest_test_funcs.py
@@ -102,7 +102,7 @@ def rwlock_autotest(child, test_name):
index = child.expect(["Test OK",
"Test Failed",
"Hello from core ([0-9]*) !",
- "Global write lock taken on master "
+ "Global write lock taken on main "
"core ([0-9]*)",
pexpect.TIMEOUT], timeout=10)
# ok
diff --git a/app/test/meson.build b/app/test/meson.build
index 786a21397272..b4bb30a6416a 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -187,7 +187,7 @@ fast_tests = [
['cycles_autotest', true],
['debug_autotest', true],
['eal_flags_c_opt_autotest', false],
- ['eal_flags_master_opt_autotest', false],
+ ['eal_flags_main_opt_autotest', false],
['eal_flags_n_opt_autotest', false],
['eal_flags_hpet_autotest', false],
['eal_flags_no_huge_autotest', false],
diff --git a/app/test/test.c b/app/test/test.c
index 94d26ab1f67c..3b3d172c91fa 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -58,7 +58,7 @@ do_recursive_call(void)
#endif
#endif
{ "test_missing_c_flag", no_action },
- { "test_master_lcore_flag", no_action },
+ { "test_main_lcore_flag", no_action },
{ "test_invalid_n_flag", no_action },
{ "test_no_hpet_flag", no_action },
{ "test_whitelist_flag", no_action },
diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index 214452e54399..f10f555af8b4 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -456,7 +456,7 @@ test_atomic(void)
printf("usual inc/dec/add/sub functions\n");
- rte_eal_mp_remote_launch(test_atomic_usual, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_usual, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
@@ -482,7 +482,7 @@ test_atomic(void)
rte_atomic32_set(&a32, 0);
rte_atomic16_set(&a16, 0);
rte_atomic64_set(&count, 0);
- rte_eal_mp_remote_launch(test_atomic_tas, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_tas, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
@@ -499,7 +499,7 @@ test_atomic(void)
rte_atomic16_set(&a16, 0);
rte_atomic64_set(&count, 0);
rte_eal_mp_remote_launch(test_atomic_addsub_and_return, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
@@ -510,8 +510,8 @@ test_atomic(void)
}
/*
- * Set a64, a32 and a16 with the same value of minus "number of slave
- * lcores", launch all slave lcores to atomically increase by one and
+ * Set a64, a32 and a16 with the same value of minus "number of worker
+ * lcores", launch all worker lcores to atomically increase by one and
* test them respectively.
* Each lcore should have only one chance to increase a64 by one and
* then check if it is equal to 0, but there should be only one lcore
@@ -519,7 +519,7 @@ test_atomic(void)
* Then a variable of "count", initialized to zero, is increased by
* one if a64, a32 or a16 is 0 after being increased and tested
* atomically.
- * We can check if "count" is finally equal to 3 to see if all slave
+ * We can check if "count" is finally equal to 3 to see if all worker
* lcores performed "atomic inc and test" right.
*/
printf("inc and test\n");
@@ -533,7 +533,7 @@ test_atomic(void)
rte_atomic64_set(&a64, (int64_t)(1 - (int64_t)rte_lcore_count()));
rte_atomic32_set(&a32, (int32_t)(1 - (int32_t)rte_lcore_count()));
rte_atomic16_set(&a16, (int16_t)(1 - (int16_t)rte_lcore_count()));
- rte_eal_mp_remote_launch(test_atomic_inc_and_test, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_inc_and_test, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
@@ -544,7 +544,7 @@ test_atomic(void)
}
/*
- * Same as above, but this time we set the values to "number of slave
+ * Same as above, but this time we set the values to "number of worker
* lcores", and decrement instead of increment.
*/
printf("dec and test\n");
@@ -555,7 +555,7 @@ test_atomic(void)
rte_atomic64_set(&a64, (int64_t)(rte_lcore_count() - 1));
rte_atomic32_set(&a32, (int32_t)(rte_lcore_count() - 1));
rte_atomic16_set(&a16, (int16_t)(rte_lcore_count() - 1));
- rte_eal_mp_remote_launch(test_atomic_dec_and_test, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_dec_and_test, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
@@ -569,10 +569,10 @@ test_atomic(void)
/*
* This case tests the functionality of rte_atomic128_cmp_exchange
* API. It calls rte_atomic128_cmp_exchange with four kinds of memory
- * models successively on each slave core. Once each 128-bit atomic
+ * models successively on each worker core. Once each 128-bit atomic
* compare and swap operation is successful, it updates the global
* 128-bit counter by 2 for the first 64-bit and 1 for the second
- * 64-bit. Each slave core iterates this test N times.
+ * 64-bit. Each worker core iterates this test N times.
* At the end of test, verify whether the first 64-bits of the 128-bit
* counter and the second 64bits is differ by the total iterations. If
* it is, the test passes.
@@ -585,7 +585,7 @@ test_atomic(void)
count128.val[1] = 0;
rte_eal_mp_remote_launch(test_atomic128_cmp_exchange, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
@@ -619,7 +619,7 @@ test_atomic(void)
token64 = ((uint64_t)get_crc8(&t.u8[0], sizeof(token64) - 1) << 56)
| (t.u64 & 0x00ffffffffffffff);
- rte_eal_mp_remote_launch(test_atomic_exchange, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_exchange, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c
index 43b5f6232c6d..c27f8a0742f2 100644
--- a/app/test/test_barrier.c
+++ b/app/test/test_barrier.c
@@ -236,7 +236,7 @@ plock_test(uint64_t iter, enum plock_use_type utype)
/* test phase - start and wait for completion on each active lcore */
- rte_eal_mp_remote_launch(plock_test1_lcore, lpt, CALL_MASTER);
+ rte_eal_mp_remote_launch(plock_test1_lcore, lpt, CALL_MAIN);
rte_eal_mp_wait_lcore();
/* validation phase - make sure that shared and local data match */
diff --git a/app/test/test_compressdev_test_buffer.h b/app/test/test_compressdev_test_buffer.h
index 4a16ade150aa..b09a7e99688f 100644
--- a/app/test/test_compressdev_test_buffer.h
+++ b/app/test/test_compressdev_test_buffer.h
@@ -190,7 +190,7 @@ static const char test_buf_shakespeare[] =
" servitude: I will no longer endure it, though yet I\n"
" know no wise remedy how to avoid it.\n"
"\n"
- "ADAM Yonder comes my master, your brother.\n"
+ "ADAM Yonder comes my main, your brother.\n"
"\n"
"ORLANDO Go apart, Adam, and thou shalt hear how he will\n";
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 70bf6fe2c1a6..fc059fe3dcfc 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -479,29 +479,29 @@ testsuite_setup(void)
char vdev_args[VDEV_ARGS_SIZE] = {""};
char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
"ordering=enable,name=cryptodev_test_scheduler,corelist="};
- uint16_t slave_core_count = 0;
+ uint16_t worker_core_count = 0;
uint16_t socket_id = 0;
if (gbl_driver_id == rte_cryptodev_driver_id_get(
RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
/* Identify the Slave Cores
- * Use 2 slave cores for the device args
+ * Use 2 worker cores for the device args
*/
RTE_LCORE_FOREACH_SLAVE(i) {
- if (slave_core_count > 1)
+ if (worker_core_count > 1)
break;
snprintf(vdev_args, sizeof(vdev_args),
"%s%d", temp_str, i);
strcpy(temp_str, vdev_args);
strlcat(temp_str, ";", sizeof(temp_str));
- slave_core_count++;
+ worker_core_count++;
socket_id = rte_lcore_to_socket_id(i);
}
- if (slave_core_count != 2) {
+ if (worker_core_count != 2) {
RTE_LOG(ERR, USER1,
"Cryptodev scheduler test require at least "
- "two slave cores to run. "
+ "two worker cores to run. "
"Please use the correct coremask.\n");
return TEST_FAILED;
}
diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index ba1f81cf8d19..19aa9f90e501 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -654,13 +654,13 @@ test_distributor(void)
sizeof(worker_params.name));
rte_eal_mp_remote_launch(handle_work,
- &worker_params, SKIP_MASTER);
+ &worker_params, SKIP_MAIN);
if (sanity_test(&worker_params, p) < 0)
goto err;
quit_workers(&worker_params, p);
rte_eal_mp_remote_launch(handle_work_with_free_mbufs,
- &worker_params, SKIP_MASTER);
+ &worker_params, SKIP_MAIN);
if (sanity_test_with_mbuf_alloc(&worker_params, p) < 0)
goto err;
quit_workers(&worker_params, p);
@@ -668,7 +668,7 @@ test_distributor(void)
if (rte_lcore_count() > 2) {
rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
&worker_params,
- SKIP_MASTER);
+ SKIP_MAIN);
if (sanity_test_with_worker_shutdown(&worker_params,
p) < 0)
goto err;
@@ -676,7 +676,7 @@ test_distributor(void)
rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
&worker_params,
- SKIP_MASTER);
+ SKIP_MAIN);
if (test_flush_with_worker_shutdown(&worker_params,
p) < 0)
goto err;
diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c
index f153bcf9bd87..9e2b055f7d53 100644
--- a/app/test/test_distributor_perf.c
+++ b/app/test/test_distributor_perf.c
@@ -54,10 +54,10 @@ time_cache_line_switch(void)
/* allocate a full cache line for data, we use only first byte of it */
uint64_t data[RTE_CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
- unsigned i, slaveid = rte_get_next_lcore(rte_lcore_id(), 0, 0);
+ unsigned i, workerid = rte_get_next_lcore(rte_lcore_id(), 0, 0);
volatile uint64_t *pdata = &data[0];
*pdata = 1;
- rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0], slaveid);
+ rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0], workerid);
while (*pdata)
rte_pause();
@@ -72,7 +72,7 @@ time_cache_line_switch(void)
while (*pdata)
rte_pause();
*pdata = 2;
- rte_eal_wait_lcore(slaveid);
+ rte_eal_wait_lcore(workerid);
printf("==== Cache line switch test ===\n");
printf("Time for %u iterations = %"PRIu64" ticks\n", (1<<ITER_POWER_CL),
end_time-start_time);
@@ -251,13 +251,13 @@ test_distributor_perf(void)
}
printf("=== Performance test of distributor (single mode) ===\n");
- rte_eal_mp_remote_launch(handle_work, ds, SKIP_MASTER);
+ rte_eal_mp_remote_launch(handle_work, ds, SKIP_MAIN);
if (perf_test(ds, p) < 0)
return -1;
quit_workers(ds, p);
printf("=== Performance test of distributor (burst mode) ===\n");
- rte_eal_mp_remote_launch(handle_work, db, SKIP_MASTER);
+ rte_eal_mp_remote_launch(handle_work, db, SKIP_MAIN);
if (perf_test(db, p) < 0)
return -1;
quit_workers(db, p);
diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index b019656b29c3..a12836d46d61 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -599,10 +599,10 @@ test_missing_c_flag(void)
}
/*
- * Test --master-lcore option with matching coremask
+ * Test --main-lcore option with matching coremask
*/
static int
-test_master_lcore_flag(void)
+test_main_lcore_flag(void)
{
#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
@@ -619,34 +619,34 @@ test_master_lcore_flag(void)
if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1))
return TEST_SKIPPED;
- /* --master-lcore flag but no value */
+ /* --main-lcore flag but no value */
const char *argv1[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore"};
- /* --master-lcore flag with invalid value */
+ "-c", "3", "--main-lcore"};
+ /* --main-lcore flag with invalid value */
const char *argv2[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "-1"};
+ "-c", "3", "--main-lcore", "-1"};
const char *argv3[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "X"};
- /* master lcore not in coremask */
+ "-c", "3", "--main-lcore", "X"};
+ /* main lcore not in coremask */
const char *argv4[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "2"};
+ "-c", "3", "--main-lcore", "2"};
/* valid value */
const char *argv5[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "1"};
+ "-c", "3", "--main-lcore", "1"};
/* valid value set before coremask */
const char *argv6[] = { prgname, prefix, mp_flag,
- "--master-lcore", "1", "-c", "3"};
+ "--main-lcore", "1", "-c", "3"};
if (launch_proc(argv1) == 0
|| launch_proc(argv2) == 0
|| launch_proc(argv3) == 0
|| launch_proc(argv4) == 0) {
- printf("Error - process ran without error with wrong --master-lcore\n");
+ printf("Error - process ran without error with wrong --main-lcore\n");
return -1;
}
if (launch_proc(argv5) != 0
|| launch_proc(argv6) != 0) {
- printf("Error - process did not run ok with valid --master-lcore\n");
+ printf("Error - process did not run ok with valid --main-lcore\n");
return -1;
}
return 0;
@@ -1468,9 +1468,9 @@ test_eal_flags(void)
return ret;
}
- ret = test_master_lcore_flag();
+ ret = test_main_lcore_flag();
if (ret < 0) {
- printf("Error in test_master_lcore_flag()\n");
+ printf("Error in test_main_lcore_flag()\n");
return ret;
}
@@ -1542,7 +1542,7 @@ REGISTER_TEST_COMMAND(eal_flags_autotest, test_eal_flags);
/* subtests used in meson for CI */
REGISTER_TEST_COMMAND(eal_flags_c_opt_autotest, test_missing_c_flag);
-REGISTER_TEST_COMMAND(eal_flags_master_opt_autotest, test_master_lcore_flag);
+REGISTER_TEST_COMMAND(eal_flags_main_opt_autotest, test_main_lcore_flag);
REGISTER_TEST_COMMAND(eal_flags_n_opt_autotest, test_invalid_n_flag);
REGISTER_TEST_COMMAND(eal_flags_hpet_autotest, test_no_hpet_flag);
REGISTER_TEST_COMMAND(eal_flags_no_huge_autotest, test_no_huge_flag);
diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index e9df46967d61..180dc4748ed0 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -95,7 +95,7 @@ static inline uint8_t efd_get_all_sockets_bitmask(void)
{
uint8_t all_cpu_sockets_bitmask = 0;
unsigned int i;
- unsigned int next_lcore = rte_get_master_lcore();
+ unsigned int next_lcore = rte_get_main_lcore();
const int val_true = 1, val_false = 0;
for (i = 0; i < rte_lcore_count(); i++) {
all_cpu_sockets_bitmask |= 1 << rte_lcore_to_socket_id(next_lcore);
diff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c
index d47622d5cafd..1c4770447526 100644
--- a/app/test/test_efd_perf.c
+++ b/app/test/test_efd_perf.c
@@ -33,7 +33,7 @@ static inline uint8_t efd_get_all_sockets_bitmask(void)
{
uint8_t all_cpu_sockets_bitmask = 0;
unsigned int i;
- unsigned int next_lcore = rte_get_master_lcore();
+ unsigned int next_lcore = rte_get_main_lcore();
const int val_true = 1, val_false = 0;
for (i = 0; i < rte_lcore_count(); i++) {
all_cpu_sockets_bitmask |= 1 << rte_lcore_to_socket_id(next_lcore);
diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c
index f5ddd03d7670..ffa0fd2380a3 100644
--- a/app/test/test_func_reentrancy.c
+++ b/app/test/test_func_reentrancy.c
@@ -58,7 +58,7 @@ static rte_atomic32_t obj_count = RTE_ATOMIC32_INIT(0);
static rte_atomic32_t synchro = RTE_ATOMIC32_INIT(0);
#define WAIT_SYNCHRO_FOR_SLAVES() do{ \
- if (lcore_self != rte_get_master_lcore()) \
+ if (lcore_self != rte_get_main_lcore()) \
while (rte_atomic32_read(&synchro) == 0); \
} while(0)
@@ -430,7 +430,7 @@ launch_test(struct test_case *pt_case)
rte_atomic32_set(&obj_count, 0);
rte_atomic32_set(&synchro, 0);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
@@ -443,7 +443,7 @@ launch_test(struct test_case *pt_case)
ret = -1;
cores = cores_save;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
diff --git a/app/test/test_hash_multiwriter.c b/app/test/test_hash_multiwriter.c
index 46ab45f82a99..afa3c7b93d85 100644
--- a/app/test/test_hash_multiwriter.c
+++ b/app/test/test_hash_multiwriter.c
@@ -64,7 +64,7 @@ test_hash_multiwriter_worker(void *arg)
/*
* Calculate offset for entries based on the position of the
- * logical core, from the master core (not counting not enabled cores)
+ * logical core, from the main core (not counting not enabled cores)
*/
offset = pos_core * tbl_multiwriter_test_params.nb_tsx_insertion;
@@ -194,7 +194,7 @@ test_hash_multiwriter(void)
/* Fire all threads. */
rte_eal_mp_remote_launch(test_hash_multiwriter_worker,
- enabled_core_ids, CALL_MASTER);
+ enabled_core_ids, CALL_MAIN);
rte_eal_mp_wait_lcore();
count = rte_hash_count(handle);
diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c
index 73333dff1392..4860768a6491 100644
--- a/app/test/test_hash_readwrite.c
+++ b/app/test/test_hash_readwrite.c
@@ -25,7 +25,7 @@
#define NUM_TEST 3
unsigned int core_cnt[NUM_TEST] = {2, 4, 8};
-unsigned int slave_core_ids[RTE_MAX_LCORE];
+unsigned int worker_core_ids[RTE_MAX_LCORE];
struct perf {
uint32_t single_read;
uint32_t single_write;
@@ -65,7 +65,7 @@ test_hash_readwrite_worker(__rte_unused void *arg)
ret = rte_malloc(NULL, sizeof(int) *
tbl_rw_test_param.num_insert, 0);
for (i = 0; i < rte_lcore_count(); i++) {
- if (slave_core_ids[i] == lcore_id)
+ if (worker_core_ids[i] == lcore_id)
break;
}
offset = tbl_rw_test_param.num_insert * i;
@@ -206,7 +206,7 @@ test_hash_readwrite_functional(int use_htm, int use_rw_lf, int use_ext)
uint32_t duplicated_keys = 0;
uint32_t lost_keys = 0;
int use_jhash = 1;
- int slave_cnt = rte_lcore_count() - 1;
+ int worker_cnt = rte_lcore_count() - 1;
uint32_t tot_insert = 0;
rte_atomic64_init(&gcycles);
@@ -224,11 +224,10 @@ test_hash_readwrite_functional(int use_htm, int use_rw_lf, int use_ext)
tot_insert = TOTAL_INSERT;
tbl_rw_test_param.num_insert =
- tot_insert / slave_cnt;
+ tot_insert / worker_cnt;
tbl_rw_test_param.rounded_tot_insert =
- tbl_rw_test_param.num_insert
- * slave_cnt;
+ tbl_rw_test_param.num_insert * worker_cnt;
printf("\nHTM = %d, RW-LF = %d, EXT-Table = %d\n",
use_htm, use_rw_lf, use_ext);
@@ -236,7 +235,7 @@ test_hash_readwrite_functional(int use_htm, int use_rw_lf, int use_ext)
/* Fire all threads. */
rte_eal_mp_remote_launch(test_hash_readwrite_worker,
- NULL, SKIP_MASTER);
+ NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
while (rte_hash_iterate(tbl_rw_test_param.h, &next_key,
@@ -330,7 +329,7 @@ test_rw_writer(void *arg)
uint64_t offset;
for (i = 0; i < rte_lcore_count(); i++) {
- if (slave_core_ids[i] == lcore_id)
+ if (worker_core_ids[i] == lcore_id)
break;
}
@@ -433,8 +432,8 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
perf_results->single_read = end / i;
for (n = 0; n < NUM_TEST; n++) {
- unsigned int tot_slave_lcore = rte_lcore_count() - 1;
- if (tot_slave_lcore < core_cnt[n] * 2)
+ unsigned int tot_worker_lcore = rte_lcore_count() - 1;
+ if (tot_worker_lcore < core_cnt[n] * 2)
goto finish;
rte_atomic64_clear(&greads);
@@ -467,7 +466,7 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
for (i = 0; i < core_cnt[n]; i++)
rte_eal_remote_launch(test_rw_reader,
(void *)(uintptr_t)read_cnt,
- slave_core_ids[i]);
+ worker_core_ids[i]);
rte_eal_mp_wait_lcore();
@@ -476,7 +475,7 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
for (; i < core_cnt[n] * 2; i++)
rte_eal_remote_launch(test_rw_writer,
(void *)((uintptr_t)start_coreid),
- slave_core_ids[i]);
+ worker_core_ids[i]);
rte_eal_mp_wait_lcore();
@@ -521,20 +520,20 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
for (i = core_cnt[n]; i < core_cnt[n] * 2; i++)
rte_eal_remote_launch(test_rw_writer,
(void *)((uintptr_t)start_coreid),
- slave_core_ids[i]);
+ worker_core_ids[i]);
for (i = 0; i < core_cnt[n]; i++)
rte_eal_remote_launch(test_rw_reader,
(void *)(uintptr_t)read_cnt,
- slave_core_ids[i]);
+ worker_core_ids[i]);
} else {
for (i = 0; i < core_cnt[n]; i++)
rte_eal_remote_launch(test_rw_reader,
(void *)(uintptr_t)read_cnt,
- slave_core_ids[i]);
+ worker_core_ids[i]);
for (; i < core_cnt[n] * 2; i++)
rte_eal_remote_launch(test_rw_writer,
(void *)((uintptr_t)start_coreid),
- slave_core_ids[i]);
+ worker_core_ids[i]);
}
rte_eal_mp_wait_lcore();
@@ -626,8 +625,8 @@ test_hash_rw_perf_main(void)
return TEST_SKIPPED;
}
- RTE_LCORE_FOREACH_SLAVE(core_id) {
- slave_core_ids[i] = core_id;
+ RTE_LCORE_FOREACH_WORKER(core_id) {
+ worker_core_ids[i] = core_id;
i++;
}
@@ -710,8 +709,8 @@ test_hash_rw_func_main(void)
return TEST_SKIPPED;
}
- RTE_LCORE_FOREACH_SLAVE(core_id) {
- slave_core_ids[i] = core_id;
+ RTE_LCORE_FOREACH_WORKER(core_id) {
+ worker_core_ids[i] = core_id;
i++;
}
diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index e47ab36e0231..79f2929c28ce 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -85,7 +85,7 @@ static struct rte_kni_ops kni_ops = {
.config_promiscusity = NULL,
};
-static unsigned lcore_master, lcore_ingress, lcore_egress;
+static unsigned lcore_main, lcore_ingress, lcore_egress;
static struct rte_kni *test_kni_ctx;
static struct test_kni_stats stats;
@@ -202,7 +202,7 @@ test_kni_link_change(void)
* supported by KNI kernel module. The ingress lcore will allocate mbufs and
* transmit them to kernel space; while the egress lcore will receive the mbufs
* from kernel space and free them.
- * On the master lcore, several commands will be run to check handling the
+ * On the main lcore, several commands will be run to check handling the
* kernel requests. And it will finally set the flag to exit the KNI
* transmitting/receiving to/from the kernel space.
*
@@ -217,7 +217,7 @@ test_kni_loop(__rte_unused void *arg)
const unsigned lcore_id = rte_lcore_id();
struct rte_mbuf *pkts_burst[PKT_BURST_SZ];
- if (lcore_id == lcore_master) {
+ if (lcore_id == lcore_main) {
rte_delay_ms(KNI_TIMEOUT_MS);
/* tests of handling kernel request */
if (system(IFCONFIG TEST_KNI_PORT" up") == -1)
@@ -276,12 +276,12 @@ test_kni_allocate_lcores(void)
{
unsigned i, count = 0;
- lcore_master = rte_get_master_lcore();
- printf("master lcore: %u\n", lcore_master);
+ lcore_main = rte_get_main_lcore();
+ printf("main lcore: %u\n", lcore_main);
for (i = 0; i < RTE_MAX_LCORE; i++) {
if (count >=2 )
break;
- if (rte_lcore_is_enabled(i) && i != lcore_master) {
+ if (rte_lcore_is_enabled(i) && i != lcore_main) {
count ++;
if (count == 1)
lcore_ingress = i;
@@ -487,8 +487,8 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)
if (ret != 0)
goto fail_kni;
- rte_eal_mp_remote_launch(test_kni_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ rte_eal_mp_remote_launch(test_kni_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(i) {
if (rte_eal_wait_lcore(i) < 0) {
ret = -1;
goto fail_kni;
diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index 58076795ec3a..c5a238b9d1e8 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -498,7 +498,7 @@ test_lpm_rcu_perf_multi_writer(void)
}
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
@@ -651,7 +651,7 @@ test_lpm_rcu_perf(void)
}
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index 71b3cfdde5cf..758e6194a852 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -1007,11 +1007,11 @@ test_malloc(void)
else printf("test_realloc() passed\n");
/*----------------------------*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(test_align_overlap_per_lcore, NULL, lcore_id);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
ret = -1;
}
@@ -1022,11 +1022,11 @@ test_malloc(void)
else printf("test_align_overlap_per_lcore() passed\n");
/*----------------------------*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(test_reordered_free_per_lcore, NULL, lcore_id);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
ret = -1;
}
@@ -1037,11 +1037,11 @@ test_malloc(void)
else printf("test_reordered_free_per_lcore() passed\n");
/*----------------------------*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(test_random_alloc_free, NULL, lcore_id);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
ret = -1;
}
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 06e44f0a79f8..8a76e786e4df 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -72,7 +72,7 @@
#ifdef RTE_MBUF_REFCNT_ATOMIC
-static volatile uint32_t refcnt_stop_slaves;
+static volatile uint32_t refcnt_stop_workers;
static unsigned refcnt_lcore[RTE_MAX_LCORE];
#endif
@@ -1000,7 +1000,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)
#ifdef RTE_MBUF_REFCNT_ATOMIC
static int
-test_refcnt_slave(void *arg)
+test_refcnt_worker(void *arg)
{
unsigned lcore, free;
void *mp = 0;
@@ -1010,7 +1010,7 @@ test_refcnt_slave(void *arg)
printf("%s started at lcore %u\n", __func__, lcore);
free = 0;
- while (refcnt_stop_slaves == 0) {
+ while (refcnt_stop_workers == 0) {
if (rte_ring_dequeue(refcnt_mbuf_ring, &mp) == 0) {
free++;
rte_pktmbuf_free(mp);
@@ -1038,7 +1038,7 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
/* For each mbuf in the pool:
* - allocate mbuf,
* - increment it's reference up to N+1,
- * - enqueue it N times into the ring for slave cores to free.
+ * - enqueue it N times into the ring for worker cores to free.
*/
for (i = 0, n = rte_mempool_avail_count(refcnt_pool);
i != n && (m = rte_pktmbuf_alloc(refcnt_pool)) != NULL;
@@ -1062,7 +1062,7 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
rte_panic("(lcore=%u, iter=%u): was able to allocate only "
"%u from %u mbufs\n", lcore, iter, i, n);
- /* wait till slave lcores will consume all mbufs */
+ /* wait till worker lcores will consume all mbufs */
while (!rte_ring_empty(refcnt_mbuf_ring))
;
@@ -1083,7 +1083,7 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
}
static int
-test_refcnt_master(struct rte_mempool *refcnt_pool,
+test_refcnt_main(struct rte_mempool *refcnt_pool,
struct rte_ring *refcnt_mbuf_ring)
{
unsigned i, lcore;
@@ -1094,7 +1094,7 @@ test_refcnt_master(struct rte_mempool *refcnt_pool,
for (i = 0; i != REFCNT_MAX_ITER; i++)
test_refcnt_iter(lcore, i, refcnt_pool, refcnt_mbuf_ring);
- refcnt_stop_slaves = 1;
+ refcnt_stop_workers = 1;
rte_wmb();
printf("%s finished at lcore %u\n", __func__, lcore);
@@ -1107,7 +1107,7 @@ static int
test_refcnt_mbuf(void)
{
#ifdef RTE_MBUF_REFCNT_ATOMIC
- unsigned int master, slave, tref;
+ unsigned int main_lcore, worker, tref;
int ret = -1;
struct rte_mempool *refcnt_pool = NULL;
struct rte_ring *refcnt_mbuf_ring = NULL;
@@ -1139,26 +1139,25 @@ test_refcnt_mbuf(void)
goto err;
}
- refcnt_stop_slaves = 0;
+ refcnt_stop_workers = 0;
memset(refcnt_lcore, 0, sizeof (refcnt_lcore));
- rte_eal_mp_remote_launch(test_refcnt_slave, refcnt_mbuf_ring,
- SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_refcnt_worker, refcnt_mbuf_ring, SKIP_MAIN);
- test_refcnt_master(refcnt_pool, refcnt_mbuf_ring);
+ test_refcnt_main(refcnt_pool, refcnt_mbuf_ring);
rte_eal_mp_wait_lcore();
/* check that we porcessed all references */
tref = 0;
- master = rte_get_master_lcore();
+ main_lcore = rte_get_main_lcore();
- RTE_LCORE_FOREACH_SLAVE(slave)
- tref += refcnt_lcore[slave];
+ RTE_LCORE_FOREACH_WORKER(worker)
+ tref += refcnt_lcore[worker];
- if (tref != refcnt_lcore[master])
+ if (tref != refcnt_lcore[main_lcore])
rte_panic("referenced mbufs: %u, freed mbufs: %u\n",
- tref, refcnt_lcore[master]);
+ tref, refcnt_lcore[main_lcore]);
rte_mempool_dump(stdout, refcnt_pool);
rte_ring_dump(stdout, refcnt_mbuf_ring);
diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index ddccaafa9242..fbca78707d2e 100644
--- a/app/test/test_mcslock.c
+++ b/app/test/test_mcslock.c
@@ -28,7 +28,7 @@
* These tests are derived from spin lock test cases.
*
* - The functional test takes all of these locks and launches the
- * ''test_mcslock_per_core()'' function on each core (except the master).
+ * ''test_mcslock_per_core()'' function on each core (except the main).
*
* - The function takes the global lock, display something, then releases
* the global lock on each core.
@@ -123,9 +123,9 @@ test_mcslock_perf(void)
printf("\nTest with lock on %u cores...\n", (rte_lcore_count()));
rte_atomic32_set(&synchro, 0);
- rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MASTER);
+ rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN);
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(&lock);
@@ -154,8 +154,8 @@ test_mcslock_try(__rte_unused void *arg)
rte_mcslock_t ml_me = RTE_PER_LCORE(_ml_me);
rte_mcslock_t ml_try_me = RTE_PER_LCORE(_ml_try_me);
- /* Locked ml_try in the master lcore, so it should fail
- * when trying to lock it in the slave lcore.
+ /* Locked ml_try in the main lcore, so it should fail
+ * when trying to lock it in the worker lcore.
*/
if (rte_mcslock_trylock(&p_ml_try, &ml_try_me) == 0) {
rte_mcslock_lock(&p_ml, &ml_me);
@@ -185,20 +185,20 @@ test_mcslock(void)
* Test mcs lock & unlock on each core
*/
- /* slave cores should be waiting: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be waiting: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
rte_mcslock_lock(&p_ml, &ml_me);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_mcslock_per_core, NULL, i);
}
- /* slave cores should be busy: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be busy: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
@@ -210,19 +210,19 @@ test_mcslock(void)
/*
* Test if it could return immediately from try-locking a locked object.
* Here it will lock the mcs lock object first, then launch all the
- * slave lcores to trylock the same mcs lock object.
- * All the slave lcores should give up try-locking a locked object and
+ * worker lcores to trylock the same mcs lock object.
+ * All the worker lcores should give up try-locking a locked object and
* return immediately, and then increase the "count" initialized with
* zero by one per times.
* We can check if the "count" is finally equal to the number of all
- * slave lcores to see if the behavior of try-locking a locked
+ * worker lcores to see if the behavior of try-locking a locked
* mcslock object is correct.
*/
if (rte_mcslock_trylock(&p_ml_try, &ml_try_me) == 0)
return -1;
count = 0;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_mcslock_try, NULL, i);
}
rte_eal_mp_wait_lcore();
diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c
index 60bda8aadbe8..d7d0aaa3340c 100644
--- a/app/test/test_mempool_perf.c
+++ b/app/test/test_mempool_perf.c
@@ -143,8 +143,8 @@ per_lcore_mempool_test(void *arg)
stats[lcore_id].enq_count = 0;
- /* wait synchro for slaves */
- if (lcore_id != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore_id != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0);
start_cycles = rte_get_timer_cycles();
@@ -214,7 +214,7 @@ launch_cores(struct rte_mempool *mp, unsigned int cores)
return -1;
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
@@ -222,13 +222,13 @@ launch_cores(struct rte_mempool *mp, unsigned int cores)
mp, lcore_id);
}
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
ret = per_lcore_mempool_test(mp);
cores = cores_save;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c
index 3a655c340041..4fa0dfe9c0b8 100644
--- a/app/test/test_mp_secondary.c
+++ b/app/test/test_mp_secondary.c
@@ -94,7 +94,7 @@ run_secondary_instances(void)
#endif
snprintf(coremask, sizeof(coremask), "%x", \
- (1 << rte_get_master_lcore()));
+ (1 << rte_get_main_lcore()));
ret |= launch_proc(argv1);
printf("### Testing rte_mp_disable() reject:\n");
diff --git a/app/test/test_pdump.c b/app/test/test_pdump.c
index 6a1180bcb78e..21fcc1bc4cba 100644
--- a/app/test/test_pdump.c
+++ b/app/test/test_pdump.c
@@ -184,7 +184,7 @@ run_pdump_server_tests(void)
};
snprintf(coremask, sizeof(coremask), "%x",
- (1 << rte_get_master_lcore()));
+ (1 << rte_get_main_lcore()));
ret = test_pdump_init();
ret |= launch_p(argv1);
diff --git a/app/test/test_per_lcore.c b/app/test/test_per_lcore.c
index fcd00212f1eb..129578d1a30f 100644
--- a/app/test/test_per_lcore.c
+++ b/app/test/test_per_lcore.c
@@ -73,31 +73,31 @@ test_per_lcore(void)
unsigned lcore_id;
int ret;
- rte_eal_mp_remote_launch(assign_vars, NULL, SKIP_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(assign_vars, NULL, SKIP_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
- rte_eal_mp_remote_launch(display_vars, NULL, SKIP_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(display_vars, NULL, SKIP_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
/* test if it could do remote launch twice at the same time or not */
- ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MASTER);
+ ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MAIN);
if (ret < 0) {
printf("It fails to do remote launch but it should able to do\n");
return -1;
}
/* it should not be able to launch a lcore which is running */
- ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MASTER);
+ ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MAIN);
if (ret == 0) {
printf("It does remote launch successfully but it should not at this time\n");
return -1;
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 352cd47156ba..e4a4762b0bbf 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -278,7 +278,7 @@ alloc_lcore(uint16_t socketid)
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
if (LCORE_AVAIL != lcore_conf[lcore_id].status ||
lcore_conf[lcore_id].socketid != socketid ||
- lcore_id == rte_get_master_lcore())
+ lcore_id == rte_get_main_lcore())
continue;
lcore_conf[lcore_id].status = LCORE_USED;
lcore_conf[lcore_id].nb_ports = 0;
@@ -664,7 +664,7 @@ exec_burst(uint32_t flags, int lcore)
static int
test_pmd_perf(void)
{
- uint16_t nb_ports, num, nb_lcores, slave_id = (uint16_t)-1;
+ uint16_t nb_ports, num, nb_lcores, worker_id = (uint16_t)-1;
uint16_t nb_rxd = MAX_TRAFFIC_BURST;
uint16_t nb_txd = MAX_TRAFFIC_BURST;
uint16_t portid;
@@ -702,13 +702,13 @@ test_pmd_perf(void)
RTE_ETH_FOREACH_DEV(portid) {
if (socketid == -1) {
socketid = rte_eth_dev_socket_id(portid);
- slave_id = alloc_lcore(socketid);
- if (slave_id == (uint16_t)-1) {
+ worker_id = alloc_lcore(socketid);
+ if (worker_id == (uint16_t)-1) {
printf("No avail lcore to run test\n");
return -1;
}
printf("Performance test runs on lcore %u socket %u\n",
- slave_id, socketid);
+ worker_id, socketid);
}
if (socketid != rte_eth_dev_socket_id(portid)) {
@@ -765,8 +765,8 @@ test_pmd_perf(void)
"rte_eth_promiscuous_enable: err=%s, port=%d\n",
rte_strerror(-ret), portid);
- lcore_conf[slave_id].portlist[num++] = portid;
- lcore_conf[slave_id].nb_ports++;
+ lcore_conf[worker_id].portlist[num++] = portid;
+ lcore_conf[worker_id].nb_ports++;
}
check_all_ports_link_status(nb_ports, RTE_PORT_ALL);
@@ -791,13 +791,13 @@ test_pmd_perf(void)
if (NULL == do_measure)
do_measure = measure_rxtx;
- rte_eal_remote_launch(main_loop, NULL, slave_id);
+ rte_eal_remote_launch(main_loop, NULL, worker_id);
- if (rte_eal_wait_lcore(slave_id) < 0)
+ if (rte_eal_wait_lcore(worker_id) < 0)
return -1;
} else if (sc_flag == SC_BURST_POLL_FIRST ||
sc_flag == SC_BURST_XMIT_FIRST)
- if (exec_burst(sc_flag, slave_id) < 0)
+ if (exec_burst(sc_flag, worker_id) < 0)
return -1;
/* port tear down */
diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c
index 0a9e5ecd1a44..7ae66e4dfb76 100644
--- a/app/test/test_rcu_qsbr.c
+++ b/app/test/test_rcu_qsbr.c
@@ -1327,7 +1327,7 @@ test_rcu_qsbr_main(void)
}
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
diff --git a/app/test/test_rcu_qsbr_perf.c b/app/test/test_rcu_qsbr_perf.c
index d35a6d089784..3017e71120ad 100644
--- a/app/test/test_rcu_qsbr_perf.c
+++ b/app/test/test_rcu_qsbr_perf.c
@@ -625,7 +625,7 @@ test_rcu_qsbr_main(void)
rte_atomic64_init(&check_cycles);
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c
index ac9bf5608daa..e63e25a867f0 100644
--- a/app/test/test_ring_perf.c
+++ b/app/test/test_ring_perf.c
@@ -297,7 +297,7 @@ run_on_core_pair(struct lcore_pair *cores, struct rte_ring *r, const int esize)
lcore_count = 0;
param1.size = param2.size = bulk_sizes[i];
param1.r = param2.r = r;
- if (cores->c1 == rte_get_master_lcore()) {
+ if (cores->c1 == rte_get_main_lcore()) {
rte_eal_remote_launch(f2, ¶m2, cores->c2);
f1(¶m1);
rte_eal_wait_lcore(cores->c2);
@@ -340,8 +340,8 @@ load_loop_fn_helper(struct thread_params *p, const int esize)
if (burst == NULL)
return -1;
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0)
rte_pause();
@@ -397,12 +397,12 @@ run_on_all_cores(struct rte_ring *r, const int esize)
param.size = bulk_sizes[i];
param.r = r;
- /* clear synchro and start slaves */
+ /* clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- if (rte_eal_mp_remote_launch(lcore_f, ¶m, SKIP_MASTER) < 0)
+ if (rte_eal_mp_remote_launch(lcore_f, ¶m, SKIP_MAIN) < 0)
return -1;
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
lcore_f(¶m);
@@ -553,7 +553,7 @@ test_ring_perf_esize(const int esize)
goto test_fail;
}
- printf("\n### Testing using all slave nodes ###\n");
+ printf("\n### Testing using all worker nodes ###\n");
if (run_on_all_cores(r, esize) < 0)
goto test_fail;
diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h
index 222d62bc4f4d..3b9a480eb9cc 100644
--- a/app/test/test_ring_stress_impl.h
+++ b/app/test/test_ring_stress_impl.h
@@ -6,7 +6,7 @@
/**
* Stress test for ring enqueue/dequeue operations.
- * Performs the following pattern on each slave worker:
+ * Performs the following pattern on each worker:
* dequeue/read-write data from the dequeued objects/enqueue.
* Serves as both functional and performance test of ring
* enqueue/dequeue operations under high contention
@@ -348,8 +348,8 @@ test_mt1(int (*test)(void *))
memset(arg, 0, sizeof(arg));
- /* launch on all slaves */
- RTE_LCORE_FOREACH_SLAVE(lc) {
+ /* launch on all workers */
+ RTE_LCORE_FOREACH_WORKER(lc) {
arg[lc].rng = r;
arg[lc].stats = init_stat;
rte_eal_remote_launch(test, &arg[lc], lc);
@@ -365,12 +365,12 @@ test_mt1(int (*test)(void *))
wrk_cmd = WRK_CMD_STOP;
rte_smp_wmb();
- /* wait for slaves and collect stats. */
+ /* wait for workers and collect stats. */
mc = rte_lcore_id();
arg[mc].stats = init_stat;
rc = 0;
- RTE_LCORE_FOREACH_SLAVE(lc) {
+ RTE_LCORE_FOREACH_WORKER(lc) {
rc |= rte_eal_wait_lcore(lc);
lcore_stat_aggr(&arg[mc].stats, &arg[lc].stats);
if (verbose != 0)
diff --git a/app/test/test_rwlock.c b/app/test/test_rwlock.c
index 61bee7d7c296..701187f39884 100644
--- a/app/test/test_rwlock.c
+++ b/app/test/test_rwlock.c
@@ -99,8 +99,8 @@ load_loop_fn(__rte_unused void *arg)
uint64_t lcount = 0;
const unsigned int lcore = rte_lcore_id();
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0)
;
@@ -134,12 +134,12 @@ test_rwlock_perf(void)
printf("\nRwlock Perf Test on %u cores...\n", rte_lcore_count());
- /* clear synchro and start slaves */
+ /* clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- if (rte_eal_mp_remote_launch(load_loop_fn, NULL, SKIP_MASTER) < 0)
+ if (rte_eal_mp_remote_launch(load_loop_fn, NULL, SKIP_MAIN) < 0)
return -1;
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(NULL);
@@ -161,7 +161,7 @@ test_rwlock_perf(void)
* - There is a global rwlock and a table of rwlocks (one per lcore).
*
* - The test function takes all of these locks and launches the
- * ``test_rwlock_per_core()`` function on each core (except the master).
+ * ``test_rwlock_per_core()`` function on each core (except the main).
*
* - The function takes the global write lock, display something,
* then releases the global lock.
@@ -187,21 +187,21 @@ rwlock_test1(void)
rte_rwlock_write_lock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_rwlock_write_lock(&sl_tab[i]);
rte_eal_remote_launch(test_rwlock_per_core, NULL, i);
}
rte_rwlock_write_unlock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_rwlock_write_unlock(&sl_tab[i]);
rte_delay_ms(100);
}
rte_rwlock_write_lock(&sl);
/* this message should be the last message of test */
- printf("Global write lock taken on master core %u\n", rte_lcore_id());
+ printf("Global write lock taken on main core %u\n", rte_lcore_id());
rte_rwlock_write_unlock(&sl);
rte_eal_mp_wait_lcore();
@@ -462,26 +462,26 @@ try_rwlock_test_rda(void)
try_test_reset();
/* start read test on all avaialble lcores */
- rte_eal_mp_remote_launch(try_read_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(try_read_lcore, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
return process_try_lcore_stats();
}
-/* all slave lcores grab RDLOCK, master one grabs WRLOCK */
+/* all worker lcores grab RDLOCK, main one grabs WRLOCK */
static int
try_rwlock_test_rds_wrm(void)
{
try_test_reset();
- rte_eal_mp_remote_launch(try_read_lcore, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(try_read_lcore, NULL, SKIP_MAIN);
try_write_lcore(NULL);
rte_eal_mp_wait_lcore();
return process_try_lcore_stats();
}
-/* master and even slave lcores grab RDLOCK, odd lcores grab WRLOCK */
+/* main and even worker lcores grab RDLOCK, odd lcores grab WRLOCK */
static int
try_rwlock_test_rde_wro(void)
{
@@ -489,7 +489,7 @@ try_rwlock_test_rde_wro(void)
try_test_reset();
- mlc = rte_get_master_lcore();
+ mlc = rte_get_main_lcore();
RTE_LCORE_FOREACH(lc) {
if (lc != mlc) {
diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index ef1d8fcb9b40..f87c3a8a2b9b 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -30,7 +30,7 @@ static int
testsuite_setup(void)
{
slcore_id = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
return TEST_SUCCESS;
@@ -533,12 +533,12 @@ service_lcore_add_del(void)
TEST_ASSERT_EQUAL(1, rte_service_lcore_count(),
"Service core count not equal to one");
uint32_t slcore_1 = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_1),
"Service core add did not return zero");
uint32_t slcore_2 = rte_get_next_lcore(/* start core */ slcore_1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_2),
"Service core add did not return zero");
@@ -584,12 +584,12 @@ service_threaded_test(int mt_safe)
/* add next 2 cores */
uint32_t slcore_1 = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_1),
"mt safe lcore add fail");
uint32_t slcore_2 = rte_get_next_lcore(/* start core */ slcore_1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_2),
"mt safe lcore add fail");
@@ -923,10 +923,10 @@ service_active_two_cores(void)
int i;
uint32_t lcore = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
uint32_t slcore = rte_get_next_lcore(/* start core */ lcore,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
/* start the service on the second available lcore */
diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c
index 842990ed3b30..054fb43a9fe5 100644
--- a/app/test/test_spinlock.c
+++ b/app/test/test_spinlock.c
@@ -28,7 +28,7 @@
* - There is a global spinlock and a table of spinlocks (one per lcore).
*
* - The test function takes all of these locks and launches the
- * ``test_spinlock_per_core()`` function on each core (except the master).
+ * ``test_spinlock_per_core()`` function on each core (except the main).
*
* - The function takes the global lock, display something, then releases
* the global lock.
@@ -109,8 +109,8 @@ load_loop_fn(void *func_param)
const int use_lock = *(int*)func_param;
const unsigned lcore = rte_lcore_id();
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0);
begin = rte_get_timer_cycles();
@@ -149,11 +149,11 @@ test_spinlock_perf(void)
printf("\nTest with lock on %u cores...\n", rte_lcore_count());
- /* Clear synchro and start slaves */
+ /* Clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MASTER);
+ rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN);
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(&lock);
@@ -200,8 +200,8 @@ test_spinlock(void)
int ret = 0;
int i;
- /* slave cores should be waiting: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be waiting: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
@@ -214,19 +214,19 @@ test_spinlock(void)
rte_spinlock_lock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_spinlock_lock(&sl_tab[i]);
rte_eal_remote_launch(test_spinlock_per_core, NULL, i);
}
- /* slave cores should be busy: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be busy: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
rte_spinlock_unlock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_spinlock_unlock(&sl_tab[i]);
rte_delay_ms(10);
}
@@ -245,7 +245,7 @@ test_spinlock(void)
} else
rte_spinlock_recursive_unlock(&slr);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_spinlock_recursive_per_core, NULL, i);
}
rte_spinlock_recursive_unlock(&slr);
@@ -253,12 +253,12 @@ test_spinlock(void)
/*
* Test if it could return immediately from try-locking a locked object.
- * Here it will lock the spinlock object first, then launch all the slave
+ * Here it will lock the spinlock object first, then launch all the worker
* lcores to trylock the same spinlock object.
- * All the slave lcores should give up try-locking a locked object and
+ * All the worker lcores should give up try-locking a locked object and
* return immediately, and then increase the "count" initialized with zero
* by one per times.
- * We can check if the "count" is finally equal to the number of all slave
+ * We can check if the "count" is finally equal to the number of all worker
* lcores to see if the behavior of try-locking a locked spinlock object
* is correct.
*/
@@ -266,7 +266,7 @@ test_spinlock(void)
return -1;
}
count = 0;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_spinlock_try, NULL, i);
}
rte_eal_mp_wait_lcore();
diff --git a/app/test/test_stack.c b/app/test/test_stack.c
index c8dac1f55cdc..0ef5f47874f2 100644
--- a/app/test/test_stack.c
+++ b/app/test/test_stack.c
@@ -362,7 +362,7 @@ test_stack_multithreaded(uint32_t flags)
rte_atomic64_init(&size);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
args[lcore_id].s = s;
args[lcore_id].sz = &size;
diff --git a/app/test/test_stack_perf.c b/app/test/test_stack_perf.c
index 3ab7267b1b72..3590625c49e7 100644
--- a/app/test/test_stack_perf.c
+++ b/app/test/test_stack_perf.c
@@ -180,7 +180,7 @@ run_on_core_pair(struct lcore_pair *cores, struct rte_stack *s,
args[0].sz = args[1].sz = bulk_sizes[i];
args[0].s = args[1].s = s;
- if (cores->c1 == rte_get_master_lcore()) {
+ if (cores->c1 == rte_get_main_lcore()) {
rte_eal_remote_launch(fn, &args[1], cores->c2);
fn(&args[0]);
rte_eal_wait_lcore(cores->c2);
@@ -210,7 +210,7 @@ run_on_n_cores(struct rte_stack *s, lcore_function_t fn, int n)
rte_atomic32_set(&lcore_barrier, n);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (++cnt >= n)
break;
@@ -235,7 +235,7 @@ run_on_n_cores(struct rte_stack *s, lcore_function_t fn, int n)
avg = args[rte_lcore_id()].avg;
cnt = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (++cnt >= n)
break;
avg += args[lcore_id].avg;
diff --git a/app/test/test_ticketlock.c b/app/test/test_ticketlock.c
index 66ab3d1a0248..7aab8665bc77 100644
--- a/app/test/test_ticketlock.c
+++ b/app/test/test_ticketlock.c
@@ -28,7 +28,7 @@
* - There is a global ticketlock and a table of ticketlocks (one per lcore).
*
* - The test function takes all of these locks and launches the
- * ``test_ticketlock_per_core()`` function on each core (except the master).
+ * ``test_ticketlock_per_core()`` function on each core (except the main).
*
* - The function takes the global lock, display something, then releases
* the global lock.
@@ -110,8 +110,8 @@ load_loop_fn(void *func_param)
const int use_lock = *(int *)func_param;
const unsigned int lcore = rte_lcore_id();
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0)
;
@@ -154,11 +154,11 @@ test_ticketlock_perf(void)
lcount = 0;
printf("\nTest with lock on %u cores...\n", rte_lcore_count());
- /* Clear synchro and start slaves */
+ /* Clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MASTER);
+ rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN);
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(&lock);
@@ -208,8 +208,8 @@ test_ticketlock(void)
int ret = 0;
int i;
- /* slave cores should be waiting: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be waiting: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
@@ -217,25 +217,25 @@ test_ticketlock(void)
rte_ticketlock_init(&tl);
rte_ticketlock_init(&tl_try);
rte_ticketlock_recursive_init(&tlr);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_ticketlock_init(&tl_tab[i]);
}
rte_ticketlock_lock(&tl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_ticketlock_lock(&tl_tab[i]);
rte_eal_remote_launch(test_ticketlock_per_core, NULL, i);
}
- /* slave cores should be busy: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be busy: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
rte_ticketlock_unlock(&tl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_ticketlock_unlock(&tl_tab[i]);
rte_delay_ms(10);
}
@@ -254,7 +254,7 @@ test_ticketlock(void)
} else
rte_ticketlock_recursive_unlock(&tlr);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_ticketlock_recursive_per_core,
NULL, i);
}
@@ -264,19 +264,19 @@ test_ticketlock(void)
/*
* Test if it could return immediately from try-locking a locked object.
* Here it will lock the ticketlock object first, then launch all the
- * slave lcores to trylock the same ticketlock object.
- * All the slave lcores should give up try-locking a locked object and
+ * worker lcores to trylock the same ticketlock object.
+ * All the worker lcores should give up try-locking a locked object and
* return immediately, and then increase the "count" initialized with
* zero by one per times.
* We can check if the "count" is finally equal to the number of all
- * slave lcores to see if the behavior of try-locking a locked
+ * worker lcores to see if the behavior of try-locking a locked
* ticketlock object is correct.
*/
if (rte_ticketlock_trylock(&tl_try) == 0)
return -1;
count = 0;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_ticketlock_try, NULL, i);
}
rte_eal_mp_wait_lcore();
diff --git a/app/test/test_timer.c b/app/test/test_timer.c
index 5933f56ed544..d4f00ada4670 100644
--- a/app/test/test_timer.c
+++ b/app/test/test_timer.c
@@ -37,7 +37,7 @@
* - All cores then simultaneously are set to schedule all the timers at
* the same time, so conflicts should occur.
* - Then there is a delay while we wait for the timers to expire
- * - Then the master lcore calls timer_manage() and we check that all
+ * - Then the main lcore calls timer_manage() and we check that all
* timers have had their callbacks called exactly once - no more no less.
* - Then we repeat the process, except after setting up the timers, we have
* all cores randomly reschedule them.
@@ -58,7 +58,7 @@
*
* - timer0
*
- * - At initialization, timer0 is loaded by the master core, on master core
+ * - At initialization, timer0 is loaded by the main core, on main core
* in "single" mode (time = 1 second).
* - In the first 19 callbacks, timer0 is reloaded on the same core,
* then, it is explicitly stopped at the 20th call.
@@ -66,21 +66,21 @@
*
* - timer1
*
- * - At initialization, timer1 is loaded by the master core, on the
- * master core in "single" mode (time = 2 seconds).
+ * - At initialization, timer1 is loaded by the main core, on the
+ * main core in "single" mode (time = 2 seconds).
* - In the first 9 callbacks, timer1 is reloaded on another
* core. After the 10th callback, timer1 is not reloaded anymore.
*
* - timer2
*
- * - At initialization, timer2 is loaded by the master core, on the
- * master core in "periodical" mode (time = 1 second).
+ * - At initialization, timer2 is loaded by the main core, on the
+ * main core in "periodical" mode (time = 1 second).
* - In the callback, when t=25s, it stops timer3 and reloads timer0
* on the current core.
*
* - timer3
*
- * - At initialization, timer3 is loaded by the master core, on
+ * - At initialization, timer3 is loaded by the main core, on
* another core in "periodical" mode (time = 1 second).
* - It is stopped at t=25s by timer2.
*/
@@ -201,68 +201,68 @@ timer_stress_main_loop(__rte_unused void *arg)
return 0;
}
-/* Need to synchronize slave lcores through multiple steps. */
-enum { SLAVE_WAITING = 1, SLAVE_RUN_SIGNAL, SLAVE_RUNNING, SLAVE_FINISHED };
-static rte_atomic16_t slave_state[RTE_MAX_LCORE];
+/* Need to synchronize worker lcores through multiple steps. */
+enum { WORKER_WAITING = 1, WORKER_RUN_SIGNAL, WORKER_RUNNING, WORKER_FINISHED };
+static rte_atomic16_t lcore_state[RTE_MAX_LCORE];
static void
-master_init_slaves(void)
+main_init_workers(void)
{
unsigned i;
- RTE_LCORE_FOREACH_SLAVE(i) {
- rte_atomic16_set(&slave_state[i], SLAVE_WAITING);
+ RTE_LCORE_FOREACH_WORKER(i) {
+ rte_atomic16_set(&lcore_state[i], WORKER_WAITING);
}
}
static void
-master_start_slaves(void)
+main_start_workers(void)
{
unsigned i;
- RTE_LCORE_FOREACH_SLAVE(i) {
- rte_atomic16_set(&slave_state[i], SLAVE_RUN_SIGNAL);
+ RTE_LCORE_FOREACH_WORKER(i) {
+ rte_atomic16_set(&lcore_state[i], WORKER_RUN_SIGNAL);
}
- RTE_LCORE_FOREACH_SLAVE(i) {
- while (rte_atomic16_read(&slave_state[i]) != SLAVE_RUNNING)
+ RTE_LCORE_FOREACH_WORKER(i) {
+ while (rte_atomic16_read(&lcore_state[i]) != WORKER_RUNNING)
rte_pause();
}
}
static void
-master_wait_for_slaves(void)
+main_wait_for_workers(void)
{
unsigned i;
- RTE_LCORE_FOREACH_SLAVE(i) {
- while (rte_atomic16_read(&slave_state[i]) != SLAVE_FINISHED)
+ RTE_LCORE_FOREACH_WORKER(i) {
+ while (rte_atomic16_read(&lcore_state[i]) != WORKER_FINISHED)
rte_pause();
}
}
static void
-slave_wait_to_start(void)
+worker_wait_to_start(void)
{
unsigned lcore_id = rte_lcore_id();
- while (rte_atomic16_read(&slave_state[lcore_id]) != SLAVE_RUN_SIGNAL)
+ while (rte_atomic16_read(&lcore_state[lcore_id]) != WORKER_RUN_SIGNAL)
rte_pause();
- rte_atomic16_set(&slave_state[lcore_id], SLAVE_RUNNING);
+ rte_atomic16_set(&lcore_state[lcore_id], WORKER_RUNNING);
}
static void
-slave_finish(void)
+worker_finish(void)
{
unsigned lcore_id = rte_lcore_id();
- rte_atomic16_set(&slave_state[lcore_id], SLAVE_FINISHED);
+ rte_atomic16_set(&lcore_state[lcore_id], WORKER_FINISHED);
}
static volatile int cb_count = 0;
/* callback for second stress test. will only be called
- * on master lcore */
+ * on main lcore */
static void
timer_stress2_cb(struct rte_timer *tim __rte_unused, void *arg __rte_unused)
{
@@ -278,35 +278,35 @@ timer_stress2_main_loop(__rte_unused void *arg)
int i, ret;
uint64_t delay = rte_get_timer_hz() / 20;
unsigned lcore_id = rte_lcore_id();
- unsigned master = rte_get_master_lcore();
+ unsigned main_lcore = rte_get_main_lcore();
int32_t my_collisions = 0;
static rte_atomic32_t collisions;
- if (lcore_id == master) {
+ if (lcore_id == main_lcore) {
cb_count = 0;
test_failed = 0;
rte_atomic32_set(&collisions, 0);
- master_init_slaves();
+ main_init_workers();
timers = rte_malloc(NULL, sizeof(*timers) * NB_STRESS2_TIMERS, 0);
if (timers == NULL) {
printf("Test Failed\n");
printf("- Cannot allocate memory for timers\n" );
test_failed = 1;
- master_start_slaves();
+ main_start_workers();
goto cleanup;
}
for (i = 0; i < NB_STRESS2_TIMERS; i++)
rte_timer_init(&timers[i]);
- master_start_slaves();
+ main_start_workers();
} else {
- slave_wait_to_start();
+ worker_wait_to_start();
if (test_failed)
goto cleanup;
}
- /* have all cores schedule all timers on master lcore */
+ /* have all cores schedule all timers on main lcore */
for (i = 0; i < NB_STRESS2_TIMERS; i++) {
- ret = rte_timer_reset(&timers[i], delay, SINGLE, master,
+ ret = rte_timer_reset(&timers[i], delay, SINGLE, main_lcore,
timer_stress2_cb, NULL);
/* there will be collisions when multiple cores simultaneously
* configure the same timers */
@@ -320,14 +320,14 @@ timer_stress2_main_loop(__rte_unused void *arg)
rte_delay_ms(100);
/* all cores rendezvous */
- if (lcore_id == master) {
- master_wait_for_slaves();
+ if (lcore_id == main_lcore) {
+ main_wait_for_workers();
} else {
- slave_finish();
+ worker_finish();
}
/* now check that we get the right number of callbacks */
- if (lcore_id == master) {
+ if (lcore_id == main_lcore) {
my_collisions = rte_atomic32_read(&collisions);
if (my_collisions != 0)
printf("- %d timer reset collisions (OK)\n", my_collisions);
@@ -338,23 +338,23 @@ timer_stress2_main_loop(__rte_unused void *arg)
printf("- Expected %d callbacks, got %d\n", NB_STRESS2_TIMERS,
cb_count);
test_failed = 1;
- master_start_slaves();
+ main_start_workers();
goto cleanup;
}
cb_count = 0;
/* proceed */
- master_start_slaves();
+ main_start_workers();
} else {
/* proceed */
- slave_wait_to_start();
+ worker_wait_to_start();
if (test_failed)
goto cleanup;
}
/* now test again, just stop and restart timers at random after init*/
for (i = 0; i < NB_STRESS2_TIMERS; i++)
- rte_timer_reset(&timers[i], delay, SINGLE, master,
+ rte_timer_reset(&timers[i], delay, SINGLE, main_lcore,
timer_stress2_cb, NULL);
/* pick random timer to reset, stopping them first half the time */
@@ -362,7 +362,7 @@ timer_stress2_main_loop(__rte_unused void *arg)
int r = rand() % NB_STRESS2_TIMERS;
if (i % 2)
rte_timer_stop(&timers[r]);
- rte_timer_reset(&timers[r], delay, SINGLE, master,
+ rte_timer_reset(&timers[r], delay, SINGLE, main_lcore,
timer_stress2_cb, NULL);
}
@@ -370,8 +370,8 @@ timer_stress2_main_loop(__rte_unused void *arg)
rte_delay_ms(100);
/* now check that we get the right number of callbacks */
- if (lcore_id == master) {
- master_wait_for_slaves();
+ if (lcore_id == main_lcore) {
+ main_wait_for_workers();
rte_timer_manage();
if (cb_count != NB_STRESS2_TIMERS) {
@@ -386,14 +386,14 @@ timer_stress2_main_loop(__rte_unused void *arg)
}
cleanup:
- if (lcore_id == master) {
- master_wait_for_slaves();
+ if (lcore_id == main_lcore) {
+ main_wait_for_workers();
if (timers != NULL) {
rte_free(timers);
timers = NULL;
}
} else {
- slave_finish();
+ worker_finish();
}
return 0;
@@ -465,7 +465,7 @@ timer_basic_main_loop(__rte_unused void *arg)
int64_t diff = 0;
/* launch all timers on core 0 */
- if (lcore_id == rte_get_master_lcore()) {
+ if (lcore_id == rte_get_main_lcore()) {
mytimer_reset(&mytiminfo[0], hz/4, SINGLE, lcore_id,
timer_basic_cb);
mytimer_reset(&mytiminfo[1], hz/2, SINGLE, lcore_id,
@@ -563,7 +563,7 @@ test_timer(void)
/* start other cores */
printf("Start timer stress tests\n");
- rte_eal_mp_remote_launch(timer_stress_main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(timer_stress_main_loop, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
/* stop timer 0 used for stress test */
@@ -572,7 +572,7 @@ test_timer(void)
/* run a second, slightly different set of stress tests */
printf("\nStart timer stress tests 2\n");
test_failed = 0;
- rte_eal_mp_remote_launch(timer_stress2_main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(timer_stress2_main_loop, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
if (test_failed)
return TEST_FAILED;
@@ -584,7 +584,7 @@ test_timer(void)
/* start other cores */
printf("\nStart timer basic tests\n");
- rte_eal_mp_remote_launch(timer_basic_main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(timer_basic_main_loop, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
/* stop all timers */
diff --git a/app/test/test_timer_racecond.c b/app/test/test_timer_racecond.c
index 28af9ca765ea..976badc0685d 100644
--- a/app/test/test_timer_racecond.c
+++ b/app/test/test_timer_racecond.c
@@ -56,8 +56,8 @@
static struct rte_timer timer[N_TIMERS];
static unsigned timer_lcore_id[N_TIMERS];
-static unsigned master;
-static volatile unsigned stop_slaves;
+static unsigned main_lcore;
+static volatile unsigned stop_workers;
static int reload_timer(struct rte_timer *tim);
@@ -90,7 +90,7 @@ reload_timer(struct rte_timer *tim)
(tim - timer);
int ret;
- ret = rte_timer_reset(tim, ticks, PERIODICAL, master, timer_cb, NULL);
+ ret = rte_timer_reset(tim, ticks, PERIODICAL, main_lcore, timer_cb, NULL);
if (ret != 0) {
rte_log(RTE_LOG_DEBUG, timer_logtype_test,
"- core %u failed to reset timer %" PRIuPTR " (OK)\n",
@@ -101,7 +101,7 @@ reload_timer(struct rte_timer *tim)
}
static int
-slave_main_loop(__rte_unused void *arg)
+worker_main_loop(__rte_unused void *arg)
{
unsigned lcore_id = rte_lcore_id();
unsigned i;
@@ -110,7 +110,7 @@ slave_main_loop(__rte_unused void *arg)
printf("Starting main loop on core %u\n", lcore_id);
- while (!stop_slaves) {
+ while (!stop_workers) {
/* Wait until the timer manager is running.
* We know it's running when we see timer[0] NOT pending.
*/
@@ -147,7 +147,7 @@ test_timer_racecond(void)
unsigned lcore_id;
unsigned i;
- master = lcore_id = rte_lcore_id();
+ main_lcore = lcore_id = rte_lcore_id();
hz = rte_get_timer_hz();
/* init and start timers */
@@ -156,8 +156,8 @@ test_timer_racecond(void)
ret = reload_timer(&timer[i]);
TEST_ASSERT(ret == 0, "reload_timer failed");
- /* Distribute timers to slaves.
- * Note that we assign timer[0] to the master.
+ /* Distribute timers to workers.
+ * Note that we assign timer[0] to the main.
*/
timer_lcore_id[i] = lcore_id;
lcore_id = rte_get_next_lcore(lcore_id, 1, 1);
@@ -167,11 +167,11 @@ test_timer_racecond(void)
cur_time = rte_get_timer_cycles();
end_time = cur_time + (hz * TEST_DURATION_S);
- /* start slave cores */
- stop_slaves = 0;
+ /* start worker cores */
+ stop_workers = 0;
printf("Start timer manage race condition test (%u seconds)\n",
TEST_DURATION_S);
- rte_eal_mp_remote_launch(slave_main_loop, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(worker_main_loop, NULL, SKIP_MAIN);
while (diff >= 0) {
/* run the timers */
@@ -184,9 +184,9 @@ test_timer_racecond(void)
diff = end_time - cur_time;
}
- /* stop slave cores */
+ /* stop worker cores */
printf("Stopping timer manage race condition test\n");
- stop_slaves = 1;
+ stop_workers = 1;
rte_eal_mp_wait_lcore();
/* stop timers */
diff --git a/app/test/test_timer_secondary.c b/app/test/test_timer_secondary.c
index 7a3bc873b359..7c3f83073ef2 100644
--- a/app/test/test_timer_secondary.c
+++ b/app/test/test_timer_secondary.c
@@ -141,7 +141,7 @@ test_timer_secondary(void)
unsigned int *mgr_lcorep = &test_info->mgr_lcore;
unsigned int *sec_lcorep = &test_info->sec_lcore;
- *mstr_lcorep = rte_get_master_lcore();
+ *mstr_lcorep = rte_get_main_lcore();
*mgr_lcorep = rte_get_next_lcore(*mstr_lcorep, 1, 1);
*sec_lcorep = rte_get_next_lcore(*mgr_lcorep, 1, 1);
diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c
index 50c7381b77e7..e1ad8e6f555c 100644
--- a/app/test/test_trace_perf.c
+++ b/app/test/test_trace_perf.c
@@ -132,7 +132,7 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
memset(data, 0, sz);
data->nb_workers = rte_lcore_count() - 1;
- RTE_LCORE_FOREACH_SLAVE(id)
+ RTE_LCORE_FOREACH_WORKER(id)
rte_eal_remote_launch(f, &data->ldata[worker++], id);
wait_till_workers_are_ready(data);
@@ -140,7 +140,7 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
measure_perf(str, data);
signal_workers_to_finish(data);
- RTE_LCORE_FOREACH_SLAVE(id)
+ RTE_LCORE_FOREACH_WORKER(id)
rte_eal_wait_lcore(id);
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 07/15] app/test-pmd: replace master lcore with main lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (5 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 06/15] app/test: replace uses of master/slave Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:04 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 08/15] app/test-eventdev: replace use of " Stephen Hemminger
` (12 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace wording around main lcore.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/config.c | 4 ++--
app/test-pmd/parameters.c | 2 +-
app/test-pmd/testpmd.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 30bee332481a..1e841f191702 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2683,9 +2683,9 @@ set_fwd_lcores_list(unsigned int *lcorelist, unsigned int nb_lc)
printf("lcore %u not enabled\n", lcore_cpuid);
return -1;
}
- if (lcore_cpuid == rte_get_master_lcore()) {
+ if (lcore_cpuid == rte_get_main_lcore()) {
printf("lcore %u cannot be masked on for running "
- "packet forwarding, which is the master lcore "
+ "packet forwarding, which is the main lcore "
"and reserved for command line parsing only\n",
lcore_cpuid);
return -1;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 7cb0e3d6ec0a..6d10debc317d 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -88,7 +88,7 @@ usage(char* progname)
printf(" --nb-ports=N: set the number of forwarding ports "
"(1 <= N <= %d).\n", nb_ports);
printf(" --coremask=COREMASK: hexadecimal bitmask of cores running "
- "the packet forwarding test. The master lcore is reserved for "
+ "the packet forwarding test. The main lcore is reserved for "
"command line parsing only, and cannot be masked on for "
"packet forwarding.\n");
printf(" --portmask=PORTMASK: hexadecimal bitmask of ports used "
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 7842c3b78120..65c99b6900ae 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -556,7 +556,7 @@ set_default_fwd_lcores_config(void)
}
socket_ids[num_sockets++] = sock_num;
}
- if (i == rte_get_master_lcore())
+ if (i == rte_get_main_lcore())
continue;
fwd_lcores_cpuids[nb_lc++] = i;
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 08/15] app/test-eventdev: replace use of master lcore with main lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (6 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 07/15] app/test-pmd: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:07 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 09/15] app: replace references to master/slave Stephen Hemminger
` (11 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master with main lcore.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-eventdev/evt_options.c | 2 +-
app/test-eventdev/test_order_common.c | 10 +++++-----
app/test-eventdev/test_perf_common.c | 12 ++++++------
app/test-eventdev/test_pipeline_common.c | 6 +++---
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index c60b61a904b0..6994ac453c8c 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -438,7 +438,7 @@ evt_options_dump(struct evt_options *opt)
evt_dump("verbose_level", "%d", opt->verbose_level);
evt_dump("socket_id", "%d", opt->socket_id);
evt_dump("pool_sz", "%d", opt->pool_sz);
- evt_dump("master lcore", "%d", rte_get_master_lcore());
+ evt_dump("main lcore", "%d", rte_get_main_lcore());
evt_dump("nb_pkts", "%"PRIu64, opt->nb_pkts);
evt_dump("nb_timers", "%"PRIu64, opt->nb_timers);
evt_dump_begin("available lcores");
diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c
index 4190f9ade82b..3c72b213fa43 100644
--- a/app/test-eventdev/test_order_common.c
+++ b/app/test-eventdev/test_order_common.c
@@ -81,8 +81,8 @@ order_opt_check(struct evt_options *opt)
}
/* Validate worker lcores */
- if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
- evt_err("worker lcores overlaps with master lcore");
+ if (evt_lcores_has_overlap(opt->wlcores, rte_get_main_lcore())) {
+ evt_err("worker lcores overlaps with main lcore");
return -1;
}
@@ -117,8 +117,8 @@ order_opt_check(struct evt_options *opt)
}
/* Validate producer lcore */
- if (plcore == (int)rte_get_master_lcore()) {
- evt_err("producer lcore and master lcore should be different");
+ if (plcore == (int)rte_get_main_lcore()) {
+ evt_err("producer lcore and main lcore should be different");
return -1;
}
if (!rte_lcore_is_enabled(plcore)) {
@@ -245,7 +245,7 @@ order_launch_lcores(struct evt_test *test, struct evt_options *opt,
int wkr_idx = 0;
/* launch workers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index b3af4bfecaff..81d7f0683d3f 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -254,7 +254,7 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
int port_idx = 0;
/* launch workers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
@@ -268,7 +268,7 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
}
/* launch producers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->plcores[lcore_id]))
continue;
@@ -552,8 +552,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
}
/* Validate worker lcores */
- if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
- evt_err("worker lcores overlaps with master lcore");
+ if (evt_lcores_has_overlap(opt->wlcores, rte_get_main_lcore())) {
+ evt_err("worker lcores overlaps with main lcore");
return -1;
}
if (evt_lcores_has_overlap_multi(opt->wlcores, opt->plcores)) {
@@ -573,8 +573,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) {
/* Validate producer lcores */
if (evt_lcores_has_overlap(opt->plcores,
- rte_get_master_lcore())) {
- evt_err("producer lcores overlaps with master lcore");
+ rte_get_main_lcore())) {
+ evt_err("producer lcores overlaps with main lcore");
return -1;
}
if (evt_has_disabled_lcore(opt->plcores)) {
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 17088b1b48e4..942a01ac89d9 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -60,7 +60,7 @@ pipeline_launch_lcores(struct evt_test *test, struct evt_options *opt,
int port_idx = 0;
/* launch workers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
@@ -129,8 +129,8 @@ pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
}
/* Validate worker lcores */
- if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
- evt_err("worker lcores overlaps with master lcore");
+ if (evt_lcores_has_overlap(opt->wlcores, rte_get_main_lcore())) {
+ evt_err("worker lcores overlaps with main lcore");
return -1;
}
if (evt_has_disabled_lcore(opt->wlcores)) {
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 09/15] app: replace references to master/slave
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (7 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 08/15] app/test-eventdev: replace use of " Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:10 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 10/15] examples: replace use of master with main Stephen Hemminger
` (10 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Stephen Hemminger
For the miscellaneous tests. Replace references to master lcore with
main lcore and slave lcore with worker lcore.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
app/test-acl/main.c | 2 +-
app/test-bbdev/test_bbdev_perf.c | 8 ++++----
app/test-compress-perf/main.c | 8 ++++----
app/test-crypto-perf/main.c | 14 +++++++-------
app/test-flow-perf/main.c | 2 +-
app/test-pipeline/main.c | 4 ++--
app/test-sad/main.c | 4 ++--
7 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/app/test-acl/main.c b/app/test-acl/main.c
index 0a5dfb621d5e..72ff26674dac 100644
--- a/app/test-acl/main.c
+++ b/app/test-acl/main.c
@@ -1085,7 +1085,7 @@ main(int argc, char **argv)
if (config.trace_file != NULL)
tracef_init();
- RTE_LCORE_FOREACH_SLAVE(lcore)
+ RTE_LCORE_FOREACH_WORKER(lcore)
rte_eal_remote_launch(search_ip5tuples, NULL, lcore);
search_ip5tuples(NULL);
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 45c0d62acabc..f82abe959cfe 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3658,7 +3658,7 @@ bler_test(struct active_device *ad,
t_params[0].queue_id = ad->queue_ids[used_cores++];
t_params[0].iter_count = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (used_cores >= num_lcores)
break;
@@ -3776,7 +3776,7 @@ throughput_test(struct active_device *ad,
t_params[0].queue_id = ad->queue_ids[used_cores++];
t_params[0].iter_count = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (used_cores >= num_lcores)
break;
@@ -3817,7 +3817,7 @@ throughput_test(struct active_device *ad,
/* In interrupt TC we need to wait for the interrupt callback to deqeue
* all pending operations. Skip waiting for queues which reported an
* error using processing_status variable.
- * Wait for master lcore operations.
+ * Wait for main lcore operations.
*/
tp = &t_params[0];
while ((rte_atomic16_read(&tp->nb_dequeued) <
@@ -3830,7 +3830,7 @@ throughput_test(struct active_device *ad,
tp->mbps /= TEST_REPETITIONS;
ret |= (int)rte_atomic16_read(&tp->processing_status);
- /* Wait for slave lcores operations */
+ /* Wait for worker lcores operations */
for (used_cores = 1; used_cores < num_lcores; used_cores++) {
tp = &t_params[used_cores];
diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index ed21605d89c2..cc9951a9b107 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -389,7 +389,7 @@ main(int argc, char **argv)
i = 0;
uint8_t qp_id = 0, cdev_index = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -413,7 +413,7 @@ main(int argc, char **argv)
while (test_data->level <= test_data->level_lst.max) {
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -424,7 +424,7 @@ main(int argc, char **argv)
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -449,7 +449,7 @@ main(int argc, char **argv)
case ST_DURING_TEST:
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 8f8e580e4dc6..1b54f0902aee 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -594,7 +594,7 @@ main(int argc, char **argv)
i = 0;
uint8_t qp_id = 0, cdev_index = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -658,7 +658,7 @@ main(int argc, char **argv)
distribution_total[buffer_size_count - 1];
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -668,7 +668,7 @@ main(int argc, char **argv)
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -688,7 +688,7 @@ main(int argc, char **argv)
while (opts.test_buffer_size <= opts.max_buffer_size) {
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -698,7 +698,7 @@ main(int argc, char **argv)
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -722,7 +722,7 @@ main(int argc, char **argv)
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -742,7 +742,7 @@ main(int argc, char **argv)
err:
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 3589b316f9eb..b9fc3c02f744 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -1103,7 +1103,7 @@ main(int argc, char **argv)
if (enable_fwd) {
init_lcore_info();
- rte_eal_mp_remote_launch(start_forwarding, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(start_forwarding, NULL, CALL_MAIN);
}
RTE_ETH_FOREACH_DEV(port) {
diff --git a/app/test-pipeline/main.c b/app/test-pipeline/main.c
index 7f0d6d3f1862..c8ee4e8927a4 100644
--- a/app/test-pipeline/main.c
+++ b/app/test-pipeline/main.c
@@ -66,8 +66,8 @@ main(int argc, char **argv)
app_init();
/* Launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(app_lcore_main_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ rte_eal_mp_remote_launch(app_lcore_main_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore) {
if (rte_eal_wait_lcore(lcore) < 0)
return -1;
}
diff --git a/app/test-sad/main.c b/app/test-sad/main.c
index b01e84c570bb..e9c26e741621 100644
--- a/app/test-sad/main.c
+++ b/app/test-sad/main.c
@@ -657,11 +657,11 @@ main(int argc, char **argv)
add_rules(sad, 10);
if (config.parallel_lookup)
- rte_eal_mp_remote_launch(lookup, sad, SKIP_MASTER);
+ rte_eal_mp_remote_launch(lookup, sad, SKIP_MAIN);
lookup(sad);
if (config.parallel_lookup)
- RTE_LCORE_FOREACH_SLAVE(lcore_id)
+ RTE_LCORE_FOREACH_WORKER(lcore_id)
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 10/15] examples: replace use of master with main
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (8 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 09/15] app: replace references to master/slave Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:14 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 11/15] examples/multi_process: replace references to master/slave Stephen Hemminger
` (9 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Change references to master/slave lcore to main/worker.
For l2fwd, l3fwd and link_status examples.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/l2fwd-cat/l2fwd-cat.c | 2 +-
examples/l2fwd-crypto/main.c | 6 +++---
examples/l2fwd-event/l2fwd_poll.c | 2 +-
examples/l2fwd-event/main.c | 2 +-
examples/l2fwd-jobstats/main.c | 2 +-
examples/l2fwd-keepalive/main.c | 2 +-
examples/l2fwd/main.c | 6 +++---
examples/l3fwd-acl/main.c | 2 +-
examples/l3fwd-graph/main.c | 14 +++++++-------
examples/l3fwd-power/main.c | 16 ++++++++--------
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 6 +++---
12 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 45a497c082da..2e632c5cb6a5 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -198,7 +198,7 @@ main(int argc, char *argv[])
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main();
return 0;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 827da9b3e38b..8b14a153d838 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -874,8 +874,8 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
if (unlikely(timer_tsc >=
(uint64_t)timer_period)) {
- /* do this only on master core */
- if (lcore_id == rte_get_master_lcore()
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()
&& options->refresh_period) {
print_stats();
timer_tsc = 0;
@@ -2802,7 +2802,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, (void *)&options,
- CALL_MASTER);
+ CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/l2fwd-event/l2fwd_poll.c b/examples/l2fwd-event/l2fwd_poll.c
index 2033c65e54b1..f7d8945a129b 100644
--- a/examples/l2fwd-event/l2fwd_poll.c
+++ b/examples/l2fwd-event/l2fwd_poll.c
@@ -116,7 +116,7 @@ l2fwd_poll_lcore_config(struct l2fwd_resources *rsrc)
/* get the lcore_id for this port */
while (rte_lcore_is_enabled(rx_lcore_id) == 0 ||
- rx_lcore_id == rte_get_master_lcore() ||
+ rx_lcore_id == rte_get_main_lcore() ||
poll_rsrc->lcore_queue_conf[rx_lcore_id].n_rx_port ==
rsrc->rx_queue_per_lcore) {
rx_lcore_id++;
diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c
index 6f2076696a93..caa7304912ee 100644
--- a/examples/l2fwd-event/main.c
+++ b/examples/l2fwd-event/main.c
@@ -670,7 +670,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, rsrc,
- SKIP_MASTER);
+ SKIP_MAIN);
l2fwd_event_print_stats(rsrc);
if (rsrc->event_mode) {
struct l2fwd_event_resources *evt_rsrc =
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 29d570584005..08ffd27bc4d8 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -1019,7 +1019,7 @@ main(int argc, char **argv)
RTE_LOG(INFO, L2FWD, "Stats display disabled\n");
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 35d10e5a0ee6..468fe6afdef4 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -789,7 +789,7 @@ main(int argc, char **argv)
) != 0 )
rte_exit(EXIT_FAILURE, "Stats setup failure.\n");
}
- /* launch per-lcore init on every slave lcore */
+ /* launch per-lcore init on every worker lcore */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
struct lcore_queue_conf *qconf = &lcore_queue_conf[lcore_id];
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index b5fb90562447..d5ec1201ba63 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -260,8 +260,8 @@ l2fwd_main_loop(void)
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= timer_period)) {
- /* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
timer_tsc = 0;
@@ -887,7 +887,7 @@ main(int argc, char **argv)
ret = 0;
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0) {
ret = -1;
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 112ec3d2cc98..f9f4542b3371 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2107,7 +2107,7 @@ main(int argc, char **argv)
check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c
index d3fcf411ce5c..6698e916d06c 100644
--- a/examples/l3fwd-graph/main.c
+++ b/examples/l3fwd-graph/main.c
@@ -167,8 +167,8 @@ check_lcore_params(void)
return -1;
}
- if (lcore == rte_get_master_lcore()) {
- printf("Error: lcore %u is master lcore\n", lcore);
+ if (lcore == rte_get_main_lcore()) {
+ printf("Error: lcore %u is main lcore\n", lcore);
return -1;
}
socketid = rte_lcore_to_socket_id(lcore);
@@ -1096,16 +1096,16 @@ main(int argc, char **argv)
route_str, i);
}
- /* Launch per-lcore init on every slave lcore */
- rte_eal_mp_remote_launch(graph_main_loop, NULL, SKIP_MASTER);
+ /* Launch per-lcore init on every worker lcore */
+ rte_eal_mp_remote_launch(graph_main_loop, NULL, SKIP_MAIN);
- /* Accumulate and print stats on master until exit */
+ /* Accumulate and print stats on main until exit */
if (rte_graph_has_stats_feature())
print_stats();
- /* Wait for slave cores to exit */
+ /* Wait for worker cores to exit */
ret = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
ret = rte_eal_wait_lcore(lcore_id);
/* Destroy graph */
if (ret < 0 || rte_graph_destroy(
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index afa38c158c45..00a551d8ace1 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1514,7 +1514,7 @@ check_lcore_params(void)
"off\n", lcore, socketid);
}
if (app_mode == APP_MODE_TELEMETRY && lcore == rte_lcore_id()) {
- printf("cannot enable master core %d in config for telemetry mode\n",
+ printf("cannot enable main core %d in config for telemetry mode\n",
rte_lcore_id());
return -1;
}
@@ -2379,10 +2379,10 @@ launch_timer(unsigned int lcore_id)
RTE_SET_USED(lcore_id);
- if (rte_get_master_lcore() != lcore_id) {
- rte_panic("timer on lcore:%d which is not master core:%d\n",
+ if (rte_get_main_lcore() != lcore_id) {
+ rte_panic("timer on lcore:%d which is not main core:%d\n",
lcore_id,
- rte_get_master_lcore());
+ rte_get_main_lcore());
}
RTE_LOG(INFO, POWER, "Bring up the Timer\n");
@@ -2763,11 +2763,11 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
if (app_mode == APP_MODE_LEGACY) {
- rte_eal_mp_remote_launch(main_legacy_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_legacy_loop, NULL, CALL_MAIN);
} else if (app_mode == APP_MODE_EMPTY_POLL) {
empty_poll_stop = false;
rte_eal_mp_remote_launch(main_empty_poll_loop, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
} else if (app_mode == APP_MODE_TELEMETRY) {
unsigned int i;
@@ -2791,9 +2791,9 @@ main(int argc, char **argv)
handle_app_stats,
"Returns global power stats. Parameters: None");
rte_eal_mp_remote_launch(main_telemetry_loop, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
} else if (app_mode == APP_MODE_INTERRUPT) {
- rte_eal_mp_remote_launch(main_intr_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_intr_loop, NULL, CALL_MAIN);
}
if (app_mode == APP_MODE_EMPTY_POLL || app_mode == APP_MODE_TELEMETRY)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index de6c62293aff..6bdda9fa5f89 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1275,7 +1275,7 @@ main(int argc, char **argv)
ret = 0;
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MAIN);
if (evt_rsrc->enabled) {
for (i = 0; i < evt_rsrc->rx_adptr.nb_rx_adptr; i++)
rte_event_eth_rx_adapter_stop(
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index d1ce6abed5a2..3a920f616c3c 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -255,8 +255,8 @@ lsi_main_loop(void)
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
- /* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
timer_tsc = 0;
@@ -732,7 +732,7 @@ main(int argc, char **argv)
check_all_ports_link_status(nb_ports, lsi_enabled_port_mask);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(lsi_launch_one_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lsi_launch_one_lcore, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 11/15] examples/multi_process: replace references to master/slave
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (9 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 10/15] examples: replace use of master with main Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:16 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 12/15] examples/performance-thread: replace reference to master lcore Stephen Hemminger
` (8 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master with main and slave with worker.
Fix the wording in comments.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
.../multi_process/client_server_mp/mp_server/main.c | 10 +++++-----
examples/multi_process/simple_mp/main.c | 4 ++--
examples/multi_process/symmetric_mp/main.c | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index 280dab867281..ec7f6b11f30e 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -84,7 +84,7 @@ get_printable_mac_addr(uint16_t port)
/*
* This function displays the recorded statistics for each port
* and for each client. It uses ANSI terminal codes to clear
- * screen when called. It is called from a single non-master
+ * screen when called. It is called from a single worker
* thread in the server process, when the process is run with more
* than one lcore enabled.
*/
@@ -146,7 +146,7 @@ do_stats_display(void)
}
/*
- * The function called from each non-master lcore used by the process.
+ * The function called from each worker lcore used by the process.
* The test_and_set function is used to randomly pick a single lcore on which
* the code to display the statistics will run. Otherwise, the code just
* repeatedly sleeps.
@@ -244,7 +244,7 @@ process_packets(uint32_t port_num __rte_unused,
}
/*
- * Function called by the master lcore of the DPDK process.
+ * Function called by the main lcore of the DPDK process.
*/
static void
do_packet_forwarding(void)
@@ -297,8 +297,8 @@ main(int argc, char *argv[])
/* clear statistics */
clear_stats();
- /* put all other cores to sleep bar master */
- rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MASTER);
+ /* put all other cores to sleep except main */
+ rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MAIN);
do_packet_forwarding();
return 0;
diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c
index fc79528462e9..86b7d244a91f 100644
--- a/examples/multi_process/simple_mp/main.c
+++ b/examples/multi_process/simple_mp/main.c
@@ -108,12 +108,12 @@ main(int argc, char **argv)
RTE_LOG(INFO, APP, "Finished Process Init.\n");
- /* call lcore_recv() on every slave lcore */
+ /* call lcore_recv() on every worker lcore */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
rte_eal_remote_launch(lcore_recv, NULL, lcore_id);
}
- /* call cmd prompt on master lcore */
+ /* call cmd prompt on main lcore */
struct cmdline *cl = cmdline_stdin_new(simple_mp_ctx, "\nsimple_mp > ");
if (cl == NULL)
rte_exit(EXIT_FAILURE, "Cannot create cmdline instance\n");
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 9a16e198cbf4..95ef436c56eb 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -473,7 +473,7 @@ main(int argc, char **argv)
RTE_LOG(INFO, APP, "Finished Process Init.\n");
- rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN);
return 0;
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 12/15] examples/performance-thread: replace reference to master lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (10 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 11/15] examples/multi_process: replace references to master/slave Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:17 ` Burakov, Anatoly
2020-09-11 19:06 ` [dpdk-dev] [PATCH 13/15] examples/qos: replace references to master Stephen Hemminger
` (7 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace term master with main here.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/performance-thread/l3fwd-thread/main.c | 14 +++++++-------
examples/performance-thread/pthread_shim/main.c | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index e32802aa9b8b..9b4993e0fd63 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -2211,7 +2211,7 @@ lthread_rx(void *dummy)
/*
* Start scheduler with initial lthread on lcore
*
- * This lthread loop spawns all rx and tx lthreads on master lcore
+ * This lthread loop spawns all rx and tx lthreads on main lcore
*/
static void *
@@ -2261,11 +2261,11 @@ lthread_spawner(__rte_unused void *arg)
}
/*
- * Start master scheduler with initial lthread spawning rx and tx lthreads
- * (main_lthread_master).
+ * Start main scheduler with initial lthread spawning rx and tx lthreads
+ * (main_lthread_main).
*/
static int
-lthread_master_spawner(__rte_unused void *arg) {
+lthread_main_spawner(__rte_unused void *arg) {
struct lthread *lt;
int lcore_id = rte_lcore_id();
@@ -3762,13 +3762,13 @@ main(int argc, char **argv)
#endif
lthread_num_schedulers_set(nb_lcores);
- rte_eal_mp_remote_launch(sched_spawner, NULL, SKIP_MASTER);
- lthread_master_spawner(NULL);
+ rte_eal_mp_remote_launch(sched_spawner, NULL, SKIP_MAIN);
+ lthread_main_spawner(NULL);
} else {
printf("Starting P-Threading Model\n");
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(pthread_run, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(pthread_run, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c
index 18f83059bc17..d5477ef2324d 100644
--- a/examples/performance-thread/pthread_shim/main.c
+++ b/examples/performance-thread/pthread_shim/main.c
@@ -252,7 +252,7 @@ int main(int argc, char **argv)
lthread_num_schedulers_set(num_sched);
/* launch all threads */
- rte_eal_mp_remote_launch(lthread_scheduler, (void *)NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lthread_scheduler, (void *)NULL, CALL_MAIN);
/* wait for threads to stop */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 13/15] examples/qos: replace references to master
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (11 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 12/15] examples/performance-thread: replace reference to master lcore Stephen Hemminger
@ 2020-09-11 19:06 ` Stephen Hemminger
2020-09-14 15:18 ` Burakov, Anatoly
2020-09-11 19:07 ` [dpdk-dev] [PATCH 14/15] examples/ipsec-secgw: replace master lcore with main lcore Stephen Hemminger
` (6 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:06 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Use main instead of master in the QoS examples.
Replace the "mst" command line argument with "mnc"
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/qos_meter/main.c | 2 +-
examples/qos_sched/args.c | 24 ++++++++++++------------
examples/qos_sched/cmdline.c | 2 +-
examples/qos_sched/main.c | 2 +-
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index ce87b2eca262..00d49e651952 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -454,7 +454,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Invalid configure flow table\n");
/* Launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index 7431b29816aa..77f47a8cf63a 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -22,7 +22,7 @@
#define MAX_OPT_VALUES 8
#define SYS_CPU_DIR "/sys/devices/system/cpu/cpu%u/topology/"
-static uint32_t app_master_core = 1;
+static uint32_t app_main_core = 1;
static uint32_t app_numa_mask;
static uint64_t app_used_core_mask = 0;
static uint64_t app_used_port_mask = 0;
@@ -40,7 +40,7 @@ static const char usage[] =
" \n"
"Application optional parameters: \n"
" --i : run in interactive mode (default value is %u) \n"
- " --mst I : master core index (default value is %u) \n"
+ " --mnc I : main core index (default value is %u) \n"
" --rsz \"A, B, C\" : Ring sizes \n"
" A = Size (in number of buffer descriptors) of each of the NIC RX \n"
" rings read by the I/O RX lcores (default value is %u) \n"
@@ -72,7 +72,7 @@ static const char usage[] =
static void
app_usage(const char *prgname)
{
- printf(usage, prgname, APP_INTERACTIVE_DEFAULT, app_master_core,
+ printf(usage, prgname, APP_INTERACTIVE_DEFAULT, app_main_core,
APP_RX_DESC_DEFAULT, APP_RING_SIZE, APP_TX_DESC_DEFAULT,
MAX_PKT_RX_BURST, PKT_ENQUEUE, PKT_DEQUEUE,
MAX_PKT_TX_BURST, NB_MBUF,
@@ -98,7 +98,7 @@ app_eal_core_mask(void)
cm |= (1ULL << i);
}
- cm |= (1ULL << rte_get_master_lcore());
+ cm |= (1ULL << rte_get_main_lcore());
return cm;
}
@@ -312,7 +312,7 @@ app_parse_args(int argc, char **argv)
static struct option lgopts[] = {
{ "pfc", 1, 0, 0 },
- { "mst", 1, 0, 0 },
+ { "mnc", 1, 0, 0 },
{ "rsz", 1, 0, 0 },
{ "bsz", 1, 0, 0 },
{ "msz", 1, 0, 0 },
@@ -352,8 +352,8 @@ app_parse_args(int argc, char **argv)
}
break;
}
- if (str_is(optname, "mst")) {
- app_master_core = (uint32_t)atoi(optarg);
+ if (str_is(optname, "mnc")) {
+ app_main_core = (uint32_t)atoi(optarg);
break;
}
if (str_is(optname, "rsz")) {
@@ -408,18 +408,18 @@ app_parse_args(int argc, char **argv)
}
}
- /* check master core index validity */
- for(i = 0; i <= app_master_core; i++) {
- if (app_used_core_mask & (1u << app_master_core)) {
+ /* check main core index validity */
+ for(i = 0; i <= app_main_core; i++) {
+ if (app_used_core_mask & (1u << app_main_core)) {
RTE_LOG(ERR, APP, "Master core index is not configured properly\n");
app_usage(prgname);
return -1;
}
}
- app_used_core_mask |= 1u << app_master_core;
+ app_used_core_mask |= 1u << app_main_core;
if ((app_used_core_mask != app_eal_core_mask()) ||
- (app_master_core != rte_get_master_lcore())) {
+ (app_main_core != rte_get_main_lcore())) {
RTE_LOG(ERR, APP, "EAL core mask not configured properly, must be %" PRIx64
" instead of %" PRIx64 "\n" , app_used_core_mask, app_eal_core_mask());
return -1;
diff --git a/examples/qos_sched/cmdline.c b/examples/qos_sched/cmdline.c
index ba68e0d02693..1cf7ea97abbf 100644
--- a/examples/qos_sched/cmdline.c
+++ b/examples/qos_sched/cmdline.c
@@ -599,7 +599,7 @@ cmdline_parse_ctx_t main_ctx[] = {
NULL,
};
-/* prompt function, called from main on MASTER lcore */
+/* prompt function, called from main on MAIN lcore */
void
prompt(void)
{
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index 73864d66dbc8..a6071b991c76 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -204,7 +204,7 @@ main(int argc, char **argv)
return -1;
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(app_main_loop, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(app_main_loop, NULL, SKIP_MAIN);
if (interactive) {
sleep(1);
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 14/15] examples/ipsec-secgw: replace master lcore with main lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (12 preceding siblings ...)
2020-09-11 19:06 ` [dpdk-dev] [PATCH 13/15] examples/qos: replace references to master Stephen Hemminger
@ 2020-09-11 19:07 ` Stephen Hemminger
2020-09-14 15:19 ` Burakov, Anatoly
2020-09-11 19:07 ` [dpdk-dev] [PATCH 15/15] examples: " Stephen Hemminger
` (5 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:07 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Simple replacement.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/ipsec-secgw/event_helper.c | 6 +++---
examples/ipsec-secgw/ipsec-secgw.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/examples/ipsec-secgw/event_helper.c b/examples/ipsec-secgw/event_helper.c
index 865dc911b864..bd60f0359b59 100644
--- a/examples/ipsec-secgw/event_helper.c
+++ b/examples/ipsec-secgw/event_helper.c
@@ -1461,16 +1461,16 @@ eh_conf_init(void)
/* Set two cores as eth cores for Rx & Tx */
- /* Use first core other than master core as Rx core */
+ /* Use first core other than main core as Rx core */
eth_core_id = rte_get_next_lcore(0, /* curr core */
- 1, /* skip master core */
+ 1, /* skip main core */
0 /* wrap */);
rte_bitmap_set(em_conf->eth_core_mask, eth_core_id);
/* Use next core as Tx core */
eth_core_id = rte_get_next_lcore(eth_core_id, /* curr core */
- 1, /* skip master core */
+ 1, /* skip main core */
0 /* wrap */);
rte_bitmap_set(em_conf->eth_core_mask, eth_core_id);
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 8ba15d23c7e8..49d8a93a12cc 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2992,7 +2992,7 @@ main(int32_t argc, char **argv)
#endif /* STATS_INTERVAL */
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(ipsec_launch_one_lcore, eh_conf, CALL_MASTER);
+ rte_eal_mp_remote_launch(ipsec_launch_one_lcore, eh_conf, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH 15/15] examples: replace master lcore with main lcore
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (13 preceding siblings ...)
2020-09-11 19:07 ` [dpdk-dev] [PATCH 14/15] examples/ipsec-secgw: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-11 19:07 ` Stephen Hemminger
2020-09-14 15:26 ` Burakov, Anatoly
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (4 subsequent siblings)
19 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-11 19:07 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace use of the term master lcore with main lcore in
the example programs.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/bbdev_app/main.c | 10 ++++----
examples/bond/main.c | 32 +++++++++++++-------------
examples/ethtool/ethtool-app/main.c | 6 ++---
examples/flow_classify/flow_classify.c | 2 +-
examples/helloworld/main.c | 4 ++--
examples/ioat/ioatfwd.c | 6 ++---
examples/ip_fragmentation/main.c | 2 +-
examples/ip_pipeline/main.c | 2 +-
examples/ip_reassembly/main.c | 2 +-
examples/ipv4_multicast/main.c | 2 +-
examples/kni/main.c | 4 ++--
examples/ntb/ntb_fwd.c | 4 ++--
examples/packet_ordering/main.c | 20 ++++++++--------
examples/ptpclient/ptpclient.c | 4 ++--
examples/rxtx_callbacks/main.c | 2 +-
examples/server_node_efd/server/main.c | 10 ++++----
examples/skeleton/basicfwd.c | 2 +-
examples/timer/main.c | 6 ++---
examples/vmdq/main.c | 2 +-
examples/vmdq_dcb/main.c | 4 ++--
20 files changed, 63 insertions(+), 63 deletions(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 68a46050c048..9a872f112f9b 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -1042,7 +1042,7 @@ main(int argc, char **argv)
struct stats_lcore_params stats_lcore;
struct rte_ring *enc_to_dec_ring;
bool stats_thread_started = false;
- unsigned int master_lcore_id = rte_get_master_lcore();
+ unsigned int main_lcore_id = rte_get_main_lcore();
rte_atomic16_init(&global_exit_flag);
@@ -1147,7 +1147,7 @@ main(int argc, char **argv)
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (lcore_conf[lcore_id].core_type != 0)
- /* launch per-lcore processing loop on slave lcores */
+ /* launch per-lcore processing loop on worker lcores */
rte_eal_remote_launch(processing_loop,
&lcore_conf[lcore_id], lcore_id);
else if (!stats_thread_started) {
@@ -1159,11 +1159,11 @@ main(int argc, char **argv)
}
if (!stats_thread_started &&
- lcore_conf[master_lcore_id].core_type != 0)
+ lcore_conf[main_lcore_id].core_type != 0)
rte_exit(EXIT_FAILURE,
"Not enough lcores to run the statistics printing loop!");
- else if (lcore_conf[master_lcore_id].core_type != 0)
- processing_loop(&lcore_conf[master_lcore_id]);
+ else if (lcore_conf[main_lcore_id].core_type != 0)
+ processing_loop(&lcore_conf[main_lcore_id]);
else if (!stats_thread_started)
stats_loop(&stats_lcore);
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 8608285b686e..094cfe2029a0 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -573,7 +573,7 @@ static void cmd_start_parsed(__rte_unused void *parsed_result,
struct cmdline *cl,
__rte_unused void *data)
{
- int slave_core_id = rte_lcore_id();
+ int worker_core_id = rte_lcore_id();
rte_spinlock_trylock(&global_flag_stru_p->lock);
if (global_flag_stru_p->LcoreMainIsRunning == 0) {
@@ -590,9 +590,9 @@ static void cmd_start_parsed(__rte_unused void *parsed_result,
return;
}
- /* start lcore main on core != master_core - ARP response thread */
- slave_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
- if ((slave_core_id >= RTE_MAX_LCORE) || (slave_core_id == 0))
+ /* start lcore main on core != main_core - ARP response thread */
+ worker_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
+ if ((worker_core_id >= RTE_MAX_LCORE) || (worker_core_id == 0))
return;
rte_spinlock_trylock(&global_flag_stru_p->lock);
@@ -601,8 +601,8 @@ static void cmd_start_parsed(__rte_unused void *parsed_result,
cmdline_printf(cl,
"Starting lcore_main on core %d:%d "
"Our IP:%d.%d.%d.%d\n",
- slave_core_id,
- rte_eal_remote_launch(lcore_main, NULL, slave_core_id),
+ worker_core_id,
+ rte_eal_remote_launch(lcore_main, NULL, worker_core_id),
BOND_IP_1,
BOND_IP_2,
BOND_IP_3,
@@ -802,7 +802,7 @@ cmdline_parse_ctx_t main_ctx[] = {
NULL,
};
-/* prompt function, called from main on MASTER lcore */
+/* prompt function, called from main on MAIN lcore */
static void prompt(__rte_unused void *arg1)
{
struct cmdline *cl;
@@ -818,7 +818,7 @@ static void prompt(__rte_unused void *arg1)
int
main(int argc, char *argv[])
{
- int ret, slave_core_id;
+ int ret, worker_core_id;
uint16_t nb_ports, i;
/* init EAL */
@@ -852,23 +852,23 @@ main(int argc, char *argv[])
rte_spinlock_init(&global_flag_stru_p->lock);
/* check state of lcores */
- RTE_LCORE_FOREACH_SLAVE(slave_core_id) {
- if (rte_eal_get_lcore_state(slave_core_id) != WAIT)
+ RTE_LCORE_FOREACH_SLAVE(worker_core_id) {
+ if (rte_eal_get_lcore_state(worker_core_id) != WAIT)
return -EBUSY;
}
- /* start lcore main on core != master_core - ARP response thread */
- slave_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
- if ((slave_core_id >= RTE_MAX_LCORE) || (slave_core_id == 0))
+ /* start lcore main on core != main_core - ARP response thread */
+ worker_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
+ if ((worker_core_id >= RTE_MAX_LCORE) || (worker_core_id == 0))
return -EPERM;
global_flag_stru_p->LcoreMainIsRunning = 1;
- global_flag_stru_p->LcoreMainCore = slave_core_id;
+ global_flag_stru_p->LcoreMainCore = worker_core_id;
printf("Starting lcore_main on core %d:%d Our IP:%d.%d.%d.%d\n",
- slave_core_id,
+ worker_core_id,
rte_eal_remote_launch((lcore_function_t *)lcore_main,
NULL,
- slave_core_id),
+ worker_core_id),
BOND_IP_1,
BOND_IP_2,
BOND_IP_3,
diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index 7383413215d6..a2865a6cbc57 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -176,7 +176,7 @@ static void process_frame(struct app_port *ptr_port,
rte_ether_addr_copy(&ptr_port->mac_addr, &ptr_mac_hdr->s_addr);
}
-static int slave_main(__rte_unused void *ptr_data)
+static int worker_main(__rte_unused void *ptr_data)
{
struct app_port *ptr_port;
struct rte_mbuf *ptr_frame;
@@ -284,11 +284,11 @@ int main(int argc, char **argv)
app_cfg.cnt_ports = cnt_ports;
if (rte_lcore_count() < 2)
- rte_exit(EXIT_FAILURE, "No available slave core!\n");
+ rte_exit(EXIT_FAILURE, "No available worker core!\n");
/* Assume there is an available slave.. */
id_core = rte_lcore_id();
id_core = rte_get_next_lcore(id_core, 1, 1);
- rte_eal_remote_launch(slave_main, NULL, id_core);
+ rte_eal_remote_launch(worker_main, NULL, id_core);
ethapp_main();
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 433e64d3f901..335d7d2ad815 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -850,7 +850,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Failed to add rules\n");
}
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main(cls_app);
return 0;
diff --git a/examples/helloworld/main.c b/examples/helloworld/main.c
index 968045f1b042..3104f1fdf470 100644
--- a/examples/helloworld/main.c
+++ b/examples/helloworld/main.c
@@ -34,12 +34,12 @@ main(int argc, char **argv)
if (ret < 0)
rte_panic("Cannot init EAL\n");
- /* call lcore_hello() on every slave lcore */
+ /* call lcore_hello() on every worker lcore */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
rte_eal_remote_launch(lcore_hello, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
lcore_hello(NULL);
rte_eal_mp_wait_lcore();
diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index 43a19843ee6b..34dd519818b0 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -520,7 +520,7 @@ tx_main_loop(void)
ioat_tx_port(&cfg.ports[i]);
}
-/* Main rx and tx loop if only one slave lcore available */
+/* Main rx and tx loop if only one worker lcore available */
static void
rxtx_main_loop(void)
{
@@ -984,7 +984,7 @@ main(int argc, char **argv)
cfg.nb_lcores = rte_lcore_count() - 1;
if (cfg.nb_lcores < 1)
rte_exit(EXIT_FAILURE,
- "There should be at least one slave lcore.\n");
+ "There should be at least one worker lcore.\n");
if (copy_mode == COPY_MODE_IOAT_NUM)
assign_rawdevs();
@@ -992,7 +992,7 @@ main(int argc, char **argv)
assign_rings();
start_forwarding_cores();
- /* master core prints stats while other cores forward */
+ /* main core prints stats while other cores forward */
print_stats(argv[0]);
/* force_quit is true when we get here */
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 4afb97109fed..5f8ca8ae3966 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -1072,7 +1072,7 @@ main(int argc, char **argv)
check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/ip_pipeline/main.c b/examples/ip_pipeline/main.c
index 97d1e91c2b4b..c4aba394314a 100644
--- a/examples/ip_pipeline/main.c
+++ b/examples/ip_pipeline/main.c
@@ -250,7 +250,7 @@ main(int argc, char **argv)
rte_eal_mp_remote_launch(
thread_main,
NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
/* Script */
if (app.script_name)
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 550fb53becf3..43712784ddbe 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1198,7 +1198,7 @@ main(int argc, char **argv)
signal(SIGINT, signal_handler);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 7e255c35a301..05ca5b2cdce0 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -801,7 +801,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Cannot build the multicast hash\n");
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/kni/main.c b/examples/kni/main.c
index f5d12a5b8676..0bd2cf4ff9ee 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -956,7 +956,7 @@ kni_alloc(uint16_t port_id)
conf.mbuf_size = MAX_PACKET_SZ;
/*
* The first KNI device associated to a port
- * is the master, for multiple kernel thread
+ * is the main, for multiple kernel thread
* environment.
*/
if (i == 0) {
@@ -1105,7 +1105,7 @@ main(int argc, char** argv)
"Could not create link status thread!\n");
/* Launch per-lcore function on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(i) {
if (rte_eal_wait_lcore(i) < 0)
return -1;
diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index 5a8439b8d310..4d6cf69f43a2 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -668,7 +668,7 @@ assign_stream_to_lcores(void)
uint8_t lcore_num, nb_extra;
lcore_num = rte_lcore_count();
- /* Exclude master core */
+ /* Exclude main core */
lcore_num--;
nb_streams = (fwd_mode == IOFWD) ? num_queues * 2 : num_queues;
@@ -1074,7 +1074,7 @@ cmdline_parse_ctx_t main_ctx[] = {
NULL,
};
-/* prompt function, called from main on MASTER lcore */
+/* prompt function, called from main on MAIN lcore */
static void
prompt(void)
{
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index b5fc6c54be56..c7f273f7d0aa 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -345,10 +345,10 @@ print_stats(void)
{
uint16_t i;
struct rte_eth_stats eth_stats;
- unsigned int lcore_id, last_lcore_id, master_lcore_id, end_w_lcore_id;
+ unsigned int lcore_id, last_lcore_id, main_lcore_id, end_w_lcore_id;
last_lcore_id = get_last_lcore_id();
- master_lcore_id = rte_get_master_lcore();
+ main_lcore_id = rte_get_main_lcore();
end_w_lcore_id = get_previous_lcore_id(last_lcore_id);
printf("\nRX thread stats:\n");
@@ -360,7 +360,7 @@ print_stats(void)
for (lcore_id = 0; lcore_id <= end_w_lcore_id; lcore_id++) {
if (insight_worker
&& rte_lcore_is_enabled(lcore_id)
- && lcore_id != master_lcore_id) {
+ && lcore_id != main_lcore_id) {
printf("\nWorker thread stats on core [%u]:\n",
lcore_id);
printf(" - Pkts deqd from workers ring: %"PRIu64"\n",
@@ -658,7 +658,7 @@ main(int argc, char **argv)
{
int ret;
unsigned nb_ports;
- unsigned int lcore_id, last_lcore_id, master_lcore_id;
+ unsigned int lcore_id, last_lcore_id, main_lcore_id;
uint16_t port_id;
uint16_t nb_ports_available;
struct worker_thread_args worker_args = {NULL, NULL};
@@ -745,29 +745,29 @@ main(int argc, char **argv)
}
last_lcore_id = get_last_lcore_id();
- master_lcore_id = rte_get_master_lcore();
+ main_lcore_id = rte_get_main_lcore();
worker_args.ring_in = rx_to_workers;
worker_args.ring_out = workers_to_tx;
- /* Start worker_thread() on all the available slave cores but the last 1 */
+ /* Start worker_thread() on all the available worker cores but the last 1 */
for (lcore_id = 0; lcore_id <= get_previous_lcore_id(last_lcore_id); lcore_id++)
- if (rte_lcore_is_enabled(lcore_id) && lcore_id != master_lcore_id)
+ if (rte_lcore_is_enabled(lcore_id) && lcore_id != main_lcore_id)
rte_eal_remote_launch(worker_thread, (void *)&worker_args,
lcore_id);
if (disable_reorder) {
- /* Start tx_thread() on the last slave core */
+ /* Start tx_thread() on the last worker core */
rte_eal_remote_launch((lcore_function_t *)tx_thread, workers_to_tx,
last_lcore_id);
} else {
send_args.ring_in = workers_to_tx;
- /* Start send_thread() on the last slave core */
+ /* Start send_thread() on the last worker core */
rte_eal_remote_launch((lcore_function_t *)send_thread,
(void *)&send_args, last_lcore_id);
}
- /* Start rx_thread() on the master core */
+ /* Start rx_thread() on the main core */
rx_thread(rx_to_workers);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 20da32517095..09968cdfc7ca 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -372,7 +372,7 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
}
/*
- * Parse the PTP FOLLOWUP message and send DELAY_REQ to the master clock.
+ * Parse the PTP FOLLOWUP message and send DELAY_REQ to the main clock.
*/
static void
parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
@@ -782,7 +782,7 @@ main(int argc, char *argv[])
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main();
return 0;
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 54d124b00bc9..6fe39546dd52 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -302,7 +302,7 @@ main(int argc, char *argv[])
printf("\nWARNING: Too much enabled lcores - "
"App uses only 1 lcore\n");
- /* call lcore_main on master core only */
+ /* call lcore_main on main core only */
lcore_main();
return 0;
}
diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c
index 05f961cff5d0..4728960eaf22 100644
--- a/examples/server_node_efd/server/main.c
+++ b/examples/server_node_efd/server/main.c
@@ -95,7 +95,7 @@ get_printable_mac_addr(uint16_t port)
/*
* This function displays the recorded statistics for each port
* and for each node. It uses ANSI terminal codes to clear
- * screen when called. It is called from a single non-master
+ * screen when called. It is called from a single worker
* thread in the server process, when the process is run with more
* than one lcore enabled.
*/
@@ -168,7 +168,7 @@ do_stats_display(void)
}
/*
- * The function called from each non-master lcore used by the process.
+ * The function called from each non-main lcore used by the process.
* The test_and_set function is used to randomly pick a single lcore on which
* the code to display the statistics will run. Otherwise, the code just
* repeatedly sleeps.
@@ -290,7 +290,7 @@ process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[],
}
/*
- * Function called by the master lcore of the DPDK process.
+ * Function called by the main lcore of the DPDK process.
*/
static void
do_packet_forwarding(void)
@@ -330,8 +330,8 @@ main(int argc, char *argv[])
/* clear statistics */
clear_stats();
- /* put all other cores to sleep bar master */
- rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MASTER);
+ /* put all other cores to sleep except main */
+ rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MAIN);
do_packet_forwarding();
return 0;
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 72ba85fa1fe5..4b2b6ab4ff78 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main();
return 0;
diff --git a/examples/timer/main.c b/examples/timer/main.c
index 0259022f104e..162fc31c4808 100644
--- a/examples/timer/main.c
+++ b/examples/timer/main.c
@@ -100,7 +100,7 @@ main(int argc, char **argv)
rte_timer_init(&timer0);
rte_timer_init(&timer1);
- /* load timer0, every second, on master lcore, reloaded automatically */
+ /* load timer0, every second, on main lcore, reloaded automatically */
hz = rte_get_timer_hz();
lcore_id = rte_lcore_id();
rte_timer_reset(&timer0, hz, PERIODICAL, lcore_id, timer0_cb, NULL);
@@ -109,12 +109,12 @@ main(int argc, char **argv)
lcore_id = rte_get_next_lcore(lcore_id, 0, 1);
rte_timer_reset(&timer1, hz/3, SINGLE, lcore_id, timer1_cb, NULL);
- /* call lcore_mainloop() on every slave lcore */
+ /* call lcore_mainloop() on every worker lcore */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
rte_eal_remote_launch(lcore_mainloop, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
(void) lcore_mainloop(NULL);
return 0;
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 660be4011e16..d73c6898d10b 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -653,7 +653,7 @@ main(int argc, char *argv[])
}
/* call lcore_main() on every lcore */
- rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 83a6843ee5b0..0f8f0cfb41c8 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -699,12 +699,12 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot initialize network ports\n");
}
- /* call lcore_main() on every slave lcore */
+ /* call lcore_main() on every worker lcore */
i = 0;
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
rte_eal_remote_launch(lcore_main, (void*)i++, lcore_id);
}
- /* call on master too */
+ /* call on main too */
(void) lcore_main((void*)i);
return 0;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 01/15] eal: add macro to mark macros as deprecated
2020-09-11 19:06 ` [dpdk-dev] [PATCH 01/15] eal: add macro to mark macros as deprecated Stephen Hemminger
@ 2020-09-14 8:43 ` Bruce Richardson
0 siblings, 0 replies; 157+ messages in thread
From: Bruce Richardson @ 2020-09-14 8:43 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Fri, Sep 11, 2020 at 12:06:47PM -0700, Stephen Hemminger wrote:
> Add a macro that causes GCC and CLANG to emit a warning when
> a deprecated macro is used.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> lib/librte_eal/include/rte_common.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h
> index 8f487a563dfc..1ade136b64e4 100644
> --- a/lib/librte_eal/include/rte_common.h
> +++ b/lib/librte_eal/include/rte_common.h
> @@ -86,6 +86,17 @@ typedef uint16_t unaligned_uint16_t;
> /******* Macro to mark functions and fields scheduled for removal *****/
> #define __rte_deprecated __attribute__((__deprecated__))
>
> +/**
> + * Macro to mark macros and defines scheduled for removal
> + */
> +#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG)
> +#define RTE_PRAGMA(x) _Pragma(#x)
> +#define RTE_PRAGMA_WARNING(w) RTE_PRAGMA(GCC warning #w)
> +#define RTE_DEPRECATED(o, n) RTE_PRAGMA_WARNING(#o is deprecated use #n)
> +#else
> +#define RTE_DEPRECATED(o, n)
> +#endif
> +
> /**
> * Mark a function or variable to a weak reference.
> */
Great to see this, as this is something I was looking for myself recently
too!
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 02/15] eal: rename lcore word choices
2020-09-11 19:06 ` [dpdk-dev] [PATCH 02/15] eal: rename lcore word choices Stephen Hemminger
@ 2020-09-14 14:40 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 14:40 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Replace master lcore with main lcore and
> replace slave lcore with worker lcore.
>
> Keep the old functions and macros but mark them as deprecated
> for this release.
>
> The "--master-lcore" command line option is also deprecated
> and any usage will print a warning and use "--main-lcore"
> as replacement.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> --- > doc/guides/rel_notes/deprecation.rst | 19 -------
> doc/guides/rel_notes/release_20_11.rst | 11 ++++
> lib/librte_eal/common/eal_common_dynmem.c | 8 +--
> lib/librte_eal/common/eal_common_launch.c | 36 ++++++-------
> lib/librte_eal/common/eal_common_lcore.c | 8 +--
> lib/librte_eal/common/eal_common_options.c | 54 +++++++++++---------
> lib/librte_eal/common/eal_options.h | 2 +
> lib/librte_eal/common/eal_private.h | 6 +--
> lib/librte_eal/common/rte_random.c | 2 +-
> lib/librte_eal/common/rte_service.c | 2 +-
> lib/librte_eal/freebsd/eal.c | 28 +++++-----
> lib/librte_eal/freebsd/eal_thread.c | 32 ++++++------
> lib/librte_eal/include/rte_eal.h | 4 +-
> lib/librte_eal/include/rte_eal_trace.h | 4 +-
> lib/librte_eal/include/rte_launch.h | 59 ++++++++++++----------
> lib/librte_eal/include/rte_lcore.h | 36 +++++++++----
> lib/librte_eal/linux/eal.c | 28 +++++-----
> lib/librte_eal/linux/eal_memory.c | 8 +--
> lib/librte_eal/linux/eal_thread.c | 32 ++++++------
> lib/librte_eal/rte_eal_version.map | 2 +-
> lib/librte_eal/windows/eal.c | 16 +++---
> lib/librte_eal/windows/eal_thread.c | 30 +++++------
> 22 files changed, 223 insertions(+), 204 deletions(-)
>
Overall,
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
However, couple of nits below.
> ABI Changes
> -----------
> diff --git a/lib/librte_eal/common/eal_common_dynmem.c b/lib/librte_eal/common/eal_common_dynmem.c
> index 614648d8a4de..48eca5854ebe 100644
> --- a/lib/librte_eal/common/eal_common_dynmem.c
> +++ b/lib/librte_eal/common/eal_common_dynmem.c
Missed comment right above this hunk.
> @@ -434,12 +434,12 @@ eal_dynmem_calc_num_pages_per_socket(
> for (socket = 0; socket < RTE_MAX_NUMA_NODES && total_size != 0;
> socket++) {
> struct rte_config *cfg = rte_eal_get_configuration();
> - unsigned int master_lcore_socket;
> + unsigned int main_lcore_socket;
>
> - master_lcore_socket =
> - rte_lcore_to_socket_id(cfg->master_lcore);
> + main_lcore_socket =
> + rte_lcore_to_socket_id(cfg->main_lcore);
>
> - if (master_lcore_socket != socket)
> + if (main_lcore_socket != socket)
> continue;
>
> /* Update sizes */
<snip>
> }
>
> /*
> - * Launch a dummy function on all slave lcores, so that master lcore
> + * Launch a dummy function on all worker lcores, so that main lcore
> * knows they are all ready when this function returns.
> */
> - rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
> + rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
> rte_eal_mp_wait_lcore();
>
> /* initialize services so vdevs register service during bus_probe. */
> diff --git a/lib/librte_eal/linux/eal_memory.c b/lib/librte_eal/linux/eal_memory.c
> index 89725291b0ce..d7349544a13a 100644
> --- a/lib/librte_eal/linux/eal_memory.c
> +++ b/lib/librte_eal/linux/eal_memory.c
Missed comment right above this hunk.
> @@ -1751,7 +1751,7 @@ memseg_primary_init_32(void)
> for (i = 0; i < rte_socket_count(); i++) {
> int hp_sizes = (int) internal_conf->num_hugepage_sizes;
> uint64_t max_socket_mem, cur_socket_mem;
> - unsigned int master_lcore_socket;
> + unsigned int main_lcore_socket;
> struct rte_config *cfg = rte_eal_get_configuration();
> bool skip;
>
> @@ -1767,10 +1767,10 @@ memseg_primary_init_32(void)
> skip = active_sockets != 0 &&
> internal_conf->socket_mem[socket_id] == 0;
> /* ...or if we didn't specifically request memory on *any*
> - * socket, and this is not master lcore
> + * socket, and this is not main lcore
> */
> - master_lcore_socket = rte_lcore_to_socket_id(cfg->master_lcore);
> - skip |= active_sockets == 0 && socket_id != master_lcore_socket;
> + main_lcore_socket = rte_lcore_to_socket_id(cfg->main_lcore);
> + skip |= active_sockets == 0 && socket_id != main_lcore_socket;
>
> if (skip) {
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 03/15] rte_power: replace rte_master_lcore with rte_main_lcore
2020-09-11 19:06 ` [dpdk-dev] [PATCH 03/15] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
@ 2020-09-14 14:41 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 14:41 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Don't use old function.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Perhaps a more informative commit message would be useful? E.g. "The old
function was deprecated, so use the new one"? Otherwise,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 04/15] drivers: replace master lcore with main lcore
2020-09-11 19:06 ` [dpdk-dev] [PATCH 04/15] drivers: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-14 14:42 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 14:42 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Replace use of deprecated rte_master_lcore with rte_main_lcore.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 05/15] doc: replace master lcore with main lcore
2020-09-11 19:06 ` [dpdk-dev] [PATCH 05/15] doc: " Stephen Hemminger
@ 2020-09-14 14:56 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 14:56 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Make sure that master lcore is not used in documentation.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> doc/guides/faq/faq.rst | 2 +-
> doc/guides/linux_gsg/eal_args.include.rst | 2 +-
> doc/guides/nics/bnxt.rst | 2 +-
> doc/guides/prog_guide/env_abstraction_layer.rst | 6 +++---
> doc/guides/prog_guide/event_ethernet_rx_adapter.rst | 2 +-
> doc/guides/prog_guide/glossary.rst | 10 ++++++++--
> doc/guides/sample_app_ug/bbdev_app.rst | 2 +-
> doc/guides/sample_app_ug/ethtool.rst | 2 +-
> doc/guides/sample_app_ug/hello_world.rst | 2 +-
> doc/guides/sample_app_ug/ioat.rst | 10 +++++-----
> doc/guides/sample_app_ug/ip_pipeline.rst | 2 +-
> doc/guides/sample_app_ug/l2_forward_event.rst | 2 +-
> doc/guides/sample_app_ug/l2_forward_real_virtual.rst | 2 +-
> doc/guides/sample_app_ug/l3_forward_power_man.rst | 2 +-
> doc/guides/sample_app_ug/link_status_intr.rst | 2 +-
> doc/guides/sample_app_ug/multi_process.rst | 2 +-
> doc/guides/sample_app_ug/packet_ordering.rst | 2 +-
> doc/guides/sample_app_ug/performance_thread.rst | 4 ++--
> doc/guides/sample_app_ug/ptpclient.rst | 2 +-
> doc/guides/sample_app_ug/timer.rst | 8 ++++----
> doc/guides/testpmd_app_ug/run_app.rst | 2 +-
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
> 22 files changed, 39 insertions(+), 33 deletions(-)
Missed a few of updates:
- Coding style guide @ line 342
- Debug/troublshooting guide @ line 315
- Logs in quickstart guide @ lines 235 and 297
- QoS scheduler guide @ lines 74 and 332
>
> diff --git a/doc/guides/faq/faq.rst b/doc/guides/faq/faq.rst
> index bb1df7dc8a0f..d517e08a1e1f 100644
> --- a/doc/guides/faq/faq.rst
> +++ b/doc/guides/faq/faq.rst
> @@ -48,7 +48,7 @@ therefore all the hugepages are allocated on the wrong socket.
> To avoid this scenario, either lower the amount of hugepage memory available to 1 GB size (or less), or run the application with taskset
> affinitizing the application to a would-be master core.
>
> -For example, if your EAL coremask is 0xff0, the master core will usually be the first core in the coremask (0x10); this is what you have to supply to taskset::
> +For example, if your EAL coremask is 0xff0, the main core will usually be the first core in the coremask (0x10); this is what you have to supply to taskset::
>
> taskset 0x10 ./l2fwd -l 4-11 -n 2
>
Missed instance right above this hunk (line 45), and right below this
hunk (line 49).
> diff --git a/doc/guides/linux_gsg/eal_args.include.rst b/doc/guides/linux_gsg/eal_args.include.rst
> index 0fe44579689b..329d4cdfbfb3 100644
> --- a/doc/guides/linux_gsg/eal_args.include.rst
> +++ b/doc/guides/linux_gsg/eal_args.include.rst
> @@ -33,7 +33,7 @@ Lcore-related options
> At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can
> be used.
>
> -* ``--master-lcore <core ID>``
> +* ``--main-lcore <core ID>``
>
> Core ID that is used as master.
Missed updating the comment under the flag.
<snip>
> index 46f997a7dce3..3504b744844f 100644
> --- a/doc/guides/sample_app_ug/hello_world.rst
> +++ b/doc/guides/sample_app_ug/hello_world.rst
> @@ -81,7 +81,7 @@ The code that launches the function on each lcore is as follows:
> rte_eal_remote_launch(lcore_hello, NULL, lcore_id);
> }
>
> - /* call it on master lcore too */
> + /* call it on main lcore too */
>
> lcore_hello(NULL);
Missed a couple of instances right above this hunk.
<snip>
> The processing lcores launching function are described below.
> diff --git a/doc/guides/sample_app_ug/ip_pipeline.rst b/doc/guides/sample_app_ug/ip_pipeline.rst
> index 56014be17458..c497ffc0a6c9 100644
> --- a/doc/guides/sample_app_ug/ip_pipeline.rst
> +++ b/doc/guides/sample_app_ug/ip_pipeline.rst
> @@ -130,7 +130,7 @@ executes two tasks in time-sharing mode:
> 1. *Packet processing task*: Process bursts of input packets read from the pipeline input ports.
>
> 2. *Message handling task*: Periodically, the data plane thread pauses the packet processing task and polls for request
> - messages send by the master thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules
> + messages send by the main thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules
> to/from given table of a specific pipeline owned by the current data plane thread, read statistics, etc.
Missed an instance right above this hunk.
>
> Examples
> diff --git a/doc/guides/sample_app_ug/l2_forward_event.rst b/doc/guides/sample_app_ug/l2_forward_event.rst
> index d536eee819d0..6e2324552f49 100644
> --- a/doc/guides/sample_app_ug/l2_forward_event.rst
> +++ b/doc/guides/sample_app_ug/l2_forward_event.rst
> @@ -631,7 +631,7 @@ not many packets to send, however it improves performance:
> /* if timer has reached its timeout */
> if (unlikely(timer_tsc >= timer_period)) {
> /* do this only on master core */
> - if (lcore_id == rte_get_master_lcore()) {
> + if (lcore_id == rte_get_main_lcore()) {
Missed comment above this.
> print_stats();
> /* reset the timer */
> timer_tsc = 0;
> diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
> index c0e8488e7987..06586ed4a822 100644
> --- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
> +++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
> @@ -455,7 +455,7 @@ however it improves performance:
> if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
> /* do this only on master core */
>
> - if (lcore_id == rte_get_master_lcore()) {
> + if (lcore_id == rte_get_main_lcore()) {
Missed comment above this.
> print_stats();
>
> /* reset the timer */
> diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst
> index 0cc6f2e62e75..f05816d9b24e 100644
> --- a/doc/guides/sample_app_ug/l3_forward_power_man.rst
> +++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst
> @@ -441,7 +441,7 @@ The telemetry mode support for ``l3fwd-power`` is a standalone mode, in this mod
> ``l3fwd-power`` does simple l3fwding along with calculating empty polls, full polls,
> and busy percentage for each forwarding core. The aggregation of these
> values of all cores is reported as application level telemetry to metric
> -library for every 500ms from the master core.
> +library for every 500ms from the main core.
>
> The busy percentage is calculated by recording the poll_count
> and when the count reaches a defined value the total
> diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
> index 04c40f28540d..8ceacc42eb9b 100644
> --- a/doc/guides/sample_app_ug/link_status_intr.rst
> +++ b/doc/guides/sample_app_ug/link_status_intr.rst
> @@ -403,7 +403,7 @@ However, it improves performance:
> if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
> /* do this only on master core */
>
> - if (lcore_id == rte_get_master_lcore()) {
> + if (lcore_id == rte_get_main_lcore()) {
Missed comment above this.
> print_stats();
>
> /* reset the timer */
> diff --git a/doc/guides/sample_app_ug/multi_process.rst b/doc/guides/sample_app_ug/multi_process.rst
> index f2a79a639763..c391c549b9b5 100644
> --- a/doc/guides/sample_app_ug/multi_process.rst
> +++ b/doc/guides/sample_app_ug/multi_process.rst
> @@ -273,7 +273,7 @@ In addition to the EAL parameters, the application- specific parameters are:
>
> .. note::
>
> - In the server process, a single thread, the master thread, that is, the lowest numbered lcore in the coremask/corelist, performs all packet I/O.
> + In the server process, a single thread, the main thread, that is, the lowest numbered lcore in the coremask/corelist, performs all packet I/O.
> If a coremask/corelist is specified with more than a single lcore bit set in it,
> an additional lcore will be used for a thread to periodically print packet count statistics.
Missed logs in this file @ lines 69 and 95.
>
> diff --git a/doc/guides/sample_app_ug/packet_ordering.rst b/doc/guides/sample_app_ug/packet_ordering.rst
> index 1c8ee5d04071..26bed0136a12 100644
> --- a/doc/guides/sample_app_ug/packet_ordering.rst
> +++ b/doc/guides/sample_app_ug/packet_ordering.rst
> @@ -46,7 +46,7 @@ The application execution command line is:
> ./packet_ordering [EAL options] -- -p PORTMASK [--disable-reorder] [--insight-worker]
>
> The -c EAL CPU_COREMASK option has to contain at least 3 CPU cores.
> -The first CPU core in the core mask is the master core and would be assigned to
> +The first CPU core in the core mask is the main core and would be assigned to
> RX core, the last to TX core and the rest to Worker cores.
Missed lines 18 and 22 in this file.
>
> The PORTMASK parameter must contain either 1 or even enabled port numbers.
> diff --git a/doc/guides/sample_app_ug/performance_thread.rst b/doc/guides/sample_app_ug/performance_thread.rst
> index b04d0ba444af..cfc0676e9210 100644
> --- a/doc/guides/sample_app_ug/performance_thread.rst
> +++ b/doc/guides/sample_app_ug/performance_thread.rst
> @@ -280,8 +280,8 @@ functionality into different threads, and the pairs of RX and TX threads are
> interconnected via software rings.
>
> On initialization an L-thread scheduler is started on every EAL thread. On all
> -but the master EAL thread only a dummy L-thread is initially started.
> -The L-thread started on the master EAL thread then spawns other L-threads on
> +but the main EAL thread only a dummy L-thread is initially started.
> +The L-thread started on the main EAL thread then spawns other L-threads on
> different L-thread schedulers according the command line parameters.
Missed instances on line 1220 in this file.
>
> The RX threads poll the network interface queues and post received packets
> diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst
> index 12b4f13d5bd8..5b51c8526c5a 100644
> --- a/doc/guides/sample_app_ug/ptpclient.rst
> +++ b/doc/guides/sample_app_ug/ptpclient.rst
> @@ -21,7 +21,7 @@ The PTP sample application is intended as a simple reference implementation of
> a PTP client using the DPDK IEEE1588 API.
> In order to keep the application simple the following assumptions are made:
>
> -* The first discovered master is the master for the session.
> +* The first discovered master is the main for the session.
> * Only L2 PTP packets are supported.
> * Only the PTP v2 protocol is supported.
> * Only the slave clock is implemented.
> diff --git a/doc/guides/sample_app_ug/timer.rst b/doc/guides/sample_app_ug/timer.rst
> index 98d762d2388c..071db764b170 100644
> --- a/doc/guides/sample_app_ug/timer.rst
> +++ b/doc/guides/sample_app_ug/timer.rst
> @@ -49,7 +49,7 @@ In addition to EAL initialization, the timer subsystem must be initialized, by c
> rte_timer_subsystem_init();
>
> After timer creation (see the next paragraph),
> -the main loop is executed on each slave lcore using the well-known rte_eal_remote_launch() and also on the master.
> +the main loop is executed on each slave lcore using the well-known rte_eal_remote_launch() and also on the main.
Replaced master but not slave. Also missed a couple of instances below
this hunk.
>
> .. code-block:: c
>
> @@ -59,7 +59,7 @@ the main loop is executed on each slave lcore using the well-known rte_eal_remot
> rte_eal_remote_launch(lcore_mainloop, NULL, lcore_id);
> }
>
> - /* call it on master lcore too */
> + /* call it on main lcore too */
>
> (void) lcore_mainloop(NULL);
>
> @@ -105,7 +105,7 @@ This call to rte_timer_init() is necessary before doing any other operation on t
>
> Then, the two timers are configured:
>
> -* The first timer (timer0) is loaded on the master lcore and expires every second.
> +* The first timer (timer0) is loaded on the main lcore and expires every second.
> Since the PERIODICAL flag is provided, the timer is reloaded automatically by the timer subsystem.
> The callback function is timer0_cb().
>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 06/15] app/test: replace uses of master/slave
2020-09-11 19:06 ` [dpdk-dev] [PATCH 06/15] app/test: replace uses of master/slave Stephen Hemminger
@ 2020-09-14 15:02 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:02 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Replace master lcore with main lcore and slave lcore with worker lcore.
> Mostly automatic replacement.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> app/test/autotest_test_funcs.py | 2 +-
> app/test/meson.build | 2 +-
> app/test/test.c | 2 +-
> app/test/test_atomic.c | 26 +++---
> app/test/test_barrier.c | 2 +-
> app/test/test_compressdev_test_buffer.h | 2 +-
> app/test/test_cryptodev.c | 12 +--
> app/test/test_distributor.c | 8 +-
> app/test/test_distributor_perf.c | 10 +--
> app/test/test_eal_flags.c | 32 +++----
> app/test/test_efd.c | 2 +-
> app/test/test_efd_perf.c | 2 +-
> app/test/test_func_reentrancy.c | 6 +-
> app/test/test_hash_multiwriter.c | 4 +-
> app/test/test_hash_readwrite.c | 39 +++++----
> app/test/test_kni.c | 16 ++--
> app/test/test_lpm_perf.c | 4 +-
> app/test/test_malloc.c | 12 +--
> app/test/test_mbuf.c | 33 ++++----
> app/test/test_mcslock.c | 28 +++----
> app/test/test_mempool_perf.c | 10 +--
> app/test/test_mp_secondary.c | 2 +-
> app/test/test_pdump.c | 2 +-
> app/test/test_per_lcore.c | 14 ++--
> app/test/test_pmd_perf.c | 20 ++---
> app/test/test_rcu_qsbr.c | 2 +-
> app/test/test_rcu_qsbr_perf.c | 2 +-
> app/test/test_ring_perf.c | 14 ++--
> app/test/test_ring_stress_impl.h | 10 +--
> app/test/test_rwlock.c | 28 +++----
> app/test/test_service_cores.c | 14 ++--
> app/test/test_spinlock.c | 34 ++++----
> app/test/test_stack.c | 2 +-
> app/test/test_stack_perf.c | 6 +-
> app/test/test_ticketlock.c | 36 ++++----
> app/test/test_timer.c | 106 ++++++++++++------------
> app/test/test_timer_racecond.c | 26 +++---
> app/test/test_timer_secondary.c | 2 +-
> app/test/test_trace_perf.c | 4 +-
> 39 files changed, 288 insertions(+), 290 deletions(-)
>
Overall,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
However, couple of missed instances below.
<snip>
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
> index 70bf6fe2c1a6..fc059fe3dcfc 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -479,29 +479,29 @@ testsuite_setup(void)
> char vdev_args[VDEV_ARGS_SIZE] = {""};
> char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
> "ordering=enable,name=cryptodev_test_scheduler,corelist="};
> - uint16_t slave_core_count = 0;
> + uint16_t worker_core_count = 0;
> uint16_t socket_id = 0;
>
> if (gbl_driver_id == rte_cryptodev_driver_id_get(
> RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
>
> /* Identify the Slave Cores
> - * Use 2 slave cores for the device args
> + * Use 2 worker cores for the device args
> */
Missed the beginning of this comment.
<snip>
> index f5ddd03d7670..ffa0fd2380a3 100644
> --- a/app/test/test_func_reentrancy.c
> +++ b/app/test/test_func_reentrancy.c
> @@ -58,7 +58,7 @@ static rte_atomic32_t obj_count = RTE_ATOMIC32_INIT(0);
> static rte_atomic32_t synchro = RTE_ATOMIC32_INIT(0);
>
> #define WAIT_SYNCHRO_FOR_SLAVES() do{ \
> - if (lcore_self != rte_get_master_lcore()) \
> + if (lcore_self != rte_get_main_lcore()) \
> while (rte_atomic32_read(&synchro) == 0); \
Macro should've been renamed too, along with all of its usages.
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 07/15] app/test-pmd: replace master lcore with main lcore
2020-09-11 19:06 ` [dpdk-dev] [PATCH 07/15] app/test-pmd: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-14 15:04 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:04 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Replace wording around main lcore.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
With below fix
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 7842c3b78120..65c99b6900ae 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -556,7 +556,7 @@ set_default_fwd_lcores_config(void)
> }
> socket_ids[num_sockets++] = sock_num;
> }
> - if (i == rte_get_master_lcore())
> + if (i == rte_get_main_lcore())
> continue;
Missed comment in this file @ line 86.
> fwd_lcores_cpuids[nb_lc++] = i;
> }
>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 08/15] app/test-eventdev: replace use of master lcore with main lcore
2020-09-11 19:06 ` [dpdk-dev] [PATCH 08/15] app/test-eventdev: replace use of " Stephen Hemminger
@ 2020-09-14 15:07 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:07 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Replace master with main lcore.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Missed instances:
test_pipeline_common.c:110
test_perf_common.c:544
test_perf_common.c:545
test_order_common.c:77
Once fixed,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 09/15] app: replace references to master/slave
2020-09-11 19:06 ` [dpdk-dev] [PATCH 09/15] app: replace references to master/slave Stephen Hemminger
@ 2020-09-14 15:10 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:10 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: Stephen Hemminger
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> For the miscellaneous tests. Replace references to master lcore with
> main lcore and slave lcore with worker lcore.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
Missed instances:
test_bbdev_perf.c:3654
test_bbdev_perf.c:3678
test_bbdev_perf.c:3772
test_bbdev_perf.c:3796
With above fix,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 10/15] examples: replace use of master with main
2020-09-11 19:06 ` [dpdk-dev] [PATCH 10/15] examples: replace use of master with main Stephen Hemminger
@ 2020-09-14 15:14 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:14 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Change references to master/slave lcore to main/worker.
> For l2fwd, l3fwd and link_status examples.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> examples/l2fwd-cat/l2fwd-cat.c | 2 +-
> examples/l2fwd-crypto/main.c | 6 +++---
> examples/l2fwd-event/l2fwd_poll.c | 2 +-
> examples/l2fwd-event/main.c | 2 +-
> examples/l2fwd-jobstats/main.c | 2 +-
> examples/l2fwd-keepalive/main.c | 2 +-
> examples/l2fwd/main.c | 6 +++---
> examples/l3fwd-acl/main.c | 2 +-
> examples/l3fwd-graph/main.c | 14 +++++++-------
> examples/l3fwd-power/main.c | 16 ++++++++--------
> examples/l3fwd/main.c | 2 +-
> examples/link_status_interrupt/main.c | 6 +++---
> 12 files changed, 31 insertions(+), 31 deletions(-)
Missed updates in:
examples/l2fwd-event/l2fwd_event_generic.c
75,12: /* Ignore Master core and service cores. */
examples/l2fwd-event/l2fwd_event_internal_port.c
74,12: /* Ignore Master core. */
examples/l2fwd-jobstats/main.c
1023,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/l2fwd-keepalive/main.c
793,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
816,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
With above fixed,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 11/15] examples/multi_process: replace references to master/slave
2020-09-11 19:06 ` [dpdk-dev] [PATCH 11/15] examples/multi_process: replace references to master/slave Stephen Hemminger
@ 2020-09-14 15:16 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:16 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Replace master with main and slave with worker.
> Fix the wording in comments.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Missed update:
examples/multi_process/simple_mp/main.c
112,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
With above fixed,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 12/15] examples/performance-thread: replace reference to master lcore
2020-09-11 19:06 ` [dpdk-dev] [PATCH 12/15] examples/performance-thread: replace reference to master lcore Stephen Hemminger
@ 2020-09-14 15:17 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:17 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Replace term master with main here.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Missed instances:
examples/performance-thread/l3fwd-thread/main.c
3772,21: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/performance-thread/pthread_shim/main.c
258,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
With above fixes,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 13/15] examples/qos: replace references to master
2020-09-11 19:06 ` [dpdk-dev] [PATCH 13/15] examples/qos: replace references to master Stephen Hemminger
@ 2020-09-14 15:18 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:18 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:06 PM, Stephen Hemminger wrote:
> Use main instead of master in the QoS examples.
> Replace the "mst" command line argument with "mnc"
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Missed instances:
examples/qos_meter/main.c
458,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/qos_sched/args.c
414,23: RTE_LOG(ERR, APP, "Master core index is not configured
properly\n");
With above fixed,
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 14/15] examples/ipsec-secgw: replace master lcore with main lcore
2020-09-11 19:07 ` [dpdk-dev] [PATCH 14/15] examples/ipsec-secgw: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-14 15:19 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:19 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:07 PM, Stephen Hemminger wrote:
> Simple replacement.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
With below fix
> diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
> index 8ba15d23c7e8..49d8a93a12cc 100644
> --- a/examples/ipsec-secgw/ipsec-secgw.c
> +++ b/examples/ipsec-secgw/ipsec-secgw.c
> @@ -2992,7 +2992,7 @@ main(int32_t argc, char **argv)
> #endif /* STATS_INTERVAL */
>
> /* launch per-lcore init on every lcore */
> - rte_eal_mp_remote_launch(ipsec_launch_one_lcore, eh_conf, CALL_MASTER);
> + rte_eal_mp_remote_launch(ipsec_launch_one_lcore, eh_conf, CALL_MAIN);
> RTE_LCORE_FOREACH_SLAVE(lcore_id) {
Missed updating the macro.
> if (rte_eal_wait_lcore(lcore_id) < 0)
> return -1;
>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH 15/15] examples: replace master lcore with main lcore
2020-09-11 19:07 ` [dpdk-dev] [PATCH 15/15] examples: " Stephen Hemminger
@ 2020-09-14 15:26 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-14 15:26 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 11-Sep-20 8:07 PM, Stephen Hemminger wrote:
> Replace use of the term master lcore with main lcore in
> the example programs.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> examples/bbdev_app/main.c | 10 ++++----
> examples/bond/main.c | 32 +++++++++++++-------------
> examples/ethtool/ethtool-app/main.c | 6 ++---
> examples/flow_classify/flow_classify.c | 2 +-
> examples/helloworld/main.c | 4 ++--
> examples/ioat/ioatfwd.c | 6 ++---
> examples/ip_fragmentation/main.c | 2 +-
> examples/ip_pipeline/main.c | 2 +-
> examples/ip_reassembly/main.c | 2 +-
> examples/ipv4_multicast/main.c | 2 +-
> examples/kni/main.c | 4 ++--
> examples/ntb/ntb_fwd.c | 4 ++--
> examples/packet_ordering/main.c | 20 ++++++++--------
> examples/ptpclient/ptpclient.c | 4 ++--
> examples/rxtx_callbacks/main.c | 2 +-
> examples/server_node_efd/server/main.c | 10 ++++----
> examples/skeleton/basicfwd.c | 2 +-
> examples/timer/main.c | 6 ++---
> examples/vmdq/main.c | 2 +-
> examples/vmdq_dcb/main.c | 4 ++--
> 20 files changed, 63 insertions(+), 63 deletions(-)
Missed instances:
examples/bbdev_app/main.c
1148,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
1170,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/bond/main.c
855,20: RTE_LCORE_FOREACH_SLAVE(worker_core_id) {
examples/ethtool/ethtool-app/main.c
288,34: /* Assume there is an available slave.. */
296,20: RTE_LCORE_FOREACH_SLAVE(id_core) {
examples/helloworld/main.c
38,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/ip_fragmentation/main.c
1076,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/ip_pipeline/thread.c
35,4: * Master thead: data plane thread context
81,4: * Master thread: data plane thread init
108,20: RTE_LCORE_FOREACH_SLAVE(i) {
140,6: /* Master thread records */
182,4: * Master thread & data plane threads: message passing
216,4: * Master thread
559,4: * Master thread & data plane threads: message passing
733,4: * Master thread
examples/ip_reassembly/main.c
1202,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/ipv4_multicast/main.c
805,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/kni/main.c
1109,20: RTE_LCORE_FOREACH_SLAVE(i) {
examples/ntb/ntb_fwd.c
165,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
681,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
700,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
768,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
829,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/packet_ordering/main.c
773,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/timer/main.c
113,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/vmdq/main.c
657,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
examples/vmdq_dcb/main.c
704,20: RTE_LCORE_FOREACH_SLAVE(lcore_id) {
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (14 preceding siblings ...)
2020-09-11 19:07 ` [dpdk-dev] [PATCH 15/15] examples: " Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 01/17] doc/coding_style: add policy about master/slave Stephen Hemminger
` (18 more replies)
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
` (3 subsequent siblings)
19 siblings, 19 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
As announced in 20.08 release notes, the terms for lcore role
will change in 20.11 release.
This is a project wide patchset to terminolgy used for DPDK lcore.
The term "master" referring to lcore is replaced with "main" and
"slave" lcore is replaced with "worker" lcore.
This is most visible in API for rte_get_master_lcore() which is
replaced with rte_get_main_lcore(). And the macros for iterating
over lcores are replaced as well.
The first patch introduces a way to mark macro's as deprecated
as well.
v2
- fix more places found by Anatoly and grep
- add coding style update
- add memif changes
Stephen Hemminger (17):
doc/coding_style: add policy about master/slave
eal: add macro to mark macros as deprecated
eal: rename lcore word choices
rte_power: replace rte_master_lcore with rte_main_lcore
drivers: replace master lcore with main lcore
net/memif: replace master/slave arguments with server/client
doc: replace master lcore with main lcore
app/test: replace uses of master/slave
app/test-pmd: replace master lcore with main lcore
app/test-eventdev: replace use of master lcore with main lcore
app: replace references to master/slave
examples: replace use of master with main
examples/multi_process: replace references to master/slave
examples/performance-thread: replace reference to master lcore
examples/qos: replace references to master
examples/ipsec-secgw: replace master lcore with main lcore
examples: replace master lcore with main lcore
app/pdump/main.c | 2 +-
app/test-acl/main.c | 2 +-
app/test-bbdev/test_bbdev_perf.c | 16 +--
app/test-compress-perf/main.c | 8 +-
app/test-crypto-perf/main.c | 14 +-
app/test-eventdev/evt_options.c | 2 +-
app/test-eventdev/test_order_common.c | 12 +-
app/test-eventdev/test_perf_common.c | 16 +--
app/test-eventdev/test_pipeline_common.c | 11 +-
app/test-flow-perf/main.c | 2 +-
app/test-pipeline/main.c | 4 +-
app/test-pmd/cmdline.c | 2 +-
app/test-pmd/config.c | 4 +-
app/test-pmd/parameters.c | 2 +-
app/test-pmd/testpmd.c | 4 +-
app/test-sad/main.c | 4 +-
app/test/autotest_test_funcs.py | 2 +-
app/test/meson.build | 2 +-
app/test/test.c | 2 +-
app/test/test_atomic.c | 26 ++--
app/test/test_barrier.c | 2 +-
app/test/test_compressdev_test_buffer.h | 2 +-
app/test/test_cryptodev.c | 16 +--
app/test/test_distributor.c | 8 +-
app/test/test_distributor_perf.c | 10 +-
app/test/test_eal_flags.c | 32 ++---
app/test/test_efd.c | 2 +-
app/test/test_efd_perf.c | 2 +-
app/test/test_func_reentrancy.c | 20 +--
app/test/test_hash_multiwriter.c | 4 +-
app/test/test_hash_readwrite.c | 39 +++--
app/test/test_kni.c | 16 +--
app/test/test_lpm_perf.c | 4 +-
app/test/test_malloc.c | 12 +-
app/test/test_mbuf.c | 33 +++--
app/test/test_mcslock.c | 28 ++--
app/test/test_mempool_perf.c | 10 +-
app/test/test_mp_secondary.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/test_per_lcore.c | 14 +-
app/test/test_pmd_perf.c | 20 +--
app/test/test_rcu_qsbr.c | 2 +-
app/test/test_rcu_qsbr_perf.c | 2 +-
app/test/test_ring_perf.c | 14 +-
app/test/test_ring_stress_impl.h | 10 +-
app/test/test_rwlock.c | 28 ++--
app/test/test_service_cores.c | 14 +-
app/test/test_spinlock.c | 34 ++---
app/test/test_stack.c | 2 +-
app/test/test_stack_perf.c | 6 +-
app/test/test_ticketlock.c | 36 ++---
app/test/test_timer.c | 109 +++++++-------
app/test/test_timer_racecond.c | 26 ++--
app/test/test_timer_secondary.c | 8 +-
app/test/test_trace_perf.c | 4 +-
doc/guides/contributing/coding_style.rst | 25 +++-
doc/guides/faq/faq.rst | 6 +-
doc/guides/howto/debug_troubleshoot.rst | 2 +-
doc/guides/linux_gsg/eal_args.include.rst | 4 +-
doc/guides/nics/bnxt.rst | 2 +-
doc/guides/nics/memif.rst | 78 +++++-----
.../prog_guide/env_abstraction_layer.rst | 6 +-
.../prog_guide/event_ethernet_rx_adapter.rst | 2 +-
doc/guides/prog_guide/glossary.rst | 10 +-
doc/guides/rel_notes/deprecation.rst | 19 ---
doc/guides/rel_notes/release_20_11.rst | 11 ++
doc/guides/sample_app_ug/bbdev_app.rst | 2 +-
doc/guides/sample_app_ug/ethtool.rst | 4 +-
doc/guides/sample_app_ug/hello_world.rst | 10 +-
doc/guides/sample_app_ug/ioat.rst | 14 +-
doc/guides/sample_app_ug/ip_pipeline.rst | 4 +-
doc/guides/sample_app_ug/keep_alive.rst | 2 +-
doc/guides/sample_app_ug/l2_forward_event.rst | 4 +-
.../sample_app_ug/l2_forward_real_virtual.rst | 5 +-
doc/guides/sample_app_ug/l3_forward_graph.rst | 6 +-
.../sample_app_ug/l3_forward_power_man.rst | 2 +-
doc/guides/sample_app_ug/link_status_intr.rst | 5 +-
doc/guides/sample_app_ug/multi_process.rst | 6 +-
doc/guides/sample_app_ug/packet_ordering.rst | 8 +-
.../sample_app_ug/performance_thread.rst | 6 +-
doc/guides/sample_app_ug/ptpclient.rst | 2 +-
doc/guides/sample_app_ug/qos_scheduler.rst | 4 +-
doc/guides/sample_app_ug/timer.rst | 16 +--
doc/guides/testpmd_app_ug/run_app.rst | 2 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 4 +-
drivers/net/memif/memif.h | 40 +++---
drivers/net/memif/memif_socket.c | 54 +++----
drivers/net/memif/memif_socket.h | 5 +-
drivers/net/memif/rte_eth_memif.c | 134 +++++++++---------
drivers/net/memif/rte_eth_memif.h | 20 +--
drivers/net/mvpp2/mrvl_ethdev.c | 6 +-
drivers/net/qede/base/bcm_osal.c | 4 +-
drivers/net/softnic/rte_eth_softnic_thread.c | 4 +-
examples/bbdev_app/main.c | 14 +-
examples/bond/main.c | 32 ++---
examples/distributor/main.c | 10 +-
examples/ethtool/ethtool-app/main.c | 11 +-
examples/eventdev_pipeline/main.c | 2 +-
examples/flow_classify/flow_classify.c | 2 +-
examples/helloworld/main.c | 6 +-
examples/ioat/ioatfwd.c | 6 +-
examples/ip_fragmentation/main.c | 4 +-
examples/ip_pipeline/main.c | 2 +-
examples/ip_pipeline/thread.c | 16 +--
examples/ip_reassembly/main.c | 4 +-
examples/ipsec-secgw/event_helper.c | 6 +-
examples/ipsec-secgw/ipsec-secgw.c | 4 +-
examples/ipv4_multicast/main.c | 4 +-
examples/kni/main.c | 6 +-
examples/l2fwd-cat/l2fwd-cat.c | 2 +-
examples/l2fwd-crypto/main.c | 8 +-
examples/l2fwd-event/l2fwd_event_generic.c | 2 +-
.../l2fwd-event/l2fwd_event_internal_port.c | 2 +-
examples/l2fwd-event/l2fwd_poll.c | 2 +-
examples/l2fwd-event/main.c | 2 +-
examples/l2fwd-jobstats/main.c | 4 +-
examples/l2fwd-keepalive/main.c | 6 +-
examples/l2fwd/main.c | 8 +-
examples/l3fwd-acl/main.c | 4 +-
examples/l3fwd-graph/main.c | 14 +-
examples/l3fwd-power/main.c | 22 +--
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 8 +-
.../client_server_mp/mp_server/main.c | 10 +-
examples/multi_process/simple_mp/main.c | 6 +-
examples/multi_process/symmetric_mp/main.c | 2 +-
examples/ntb/ntb_fwd.c | 14 +-
examples/packet_ordering/main.c | 22 +--
.../performance-thread/l3fwd-thread/main.c | 16 +--
.../performance-thread/pthread_shim/main.c | 4 +-
examples/ptpclient/ptpclient.c | 4 +-
examples/qos_meter/main.c | 4 +-
examples/qos_sched/args.c | 26 ++--
examples/qos_sched/cmdline.c | 2 +-
examples/qos_sched/main.c | 2 +-
examples/rxtx_callbacks/main.c | 2 +-
examples/server_node_efd/server/main.c | 10 +-
examples/skeleton/basicfwd.c | 2 +-
examples/tep_termination/main.c | 12 +-
examples/timer/main.c | 8 +-
examples/vhost/main.c | 10 +-
examples/vmdq/main.c | 4 +-
examples/vmdq_dcb/main.c | 6 +-
lib/librte_eal/common/eal_common_dynmem.c | 10 +-
lib/librte_eal/common/eal_common_launch.c | 36 ++---
lib/librte_eal/common/eal_common_lcore.c | 8 +-
lib/librte_eal/common/eal_common_options.c | 56 ++++----
lib/librte_eal/common/eal_options.h | 2 +
lib/librte_eal/common/eal_private.h | 6 +-
lib/librte_eal/common/rte_random.c | 2 +-
lib/librte_eal/common/rte_service.c | 2 +-
lib/librte_eal/freebsd/eal.c | 28 ++--
lib/librte_eal/freebsd/eal_thread.c | 32 ++---
lib/librte_eal/include/rte_common.h | 11 ++
lib/librte_eal/include/rte_eal.h | 4 +-
lib/librte_eal/include/rte_eal_trace.h | 4 +-
lib/librte_eal/include/rte_launch.h | 60 ++++----
lib/librte_eal/include/rte_lcore.h | 35 +++--
lib/librte_eal/linux/eal.c | 28 ++--
lib/librte_eal/linux/eal_memory.c | 8 +-
lib/librte_eal/linux/eal_thread.c | 32 ++---
lib/librte_eal/rte_eal_version.map | 2 +-
lib/librte_eal/windows/eal.c | 16 +--
lib/librte_eal/windows/eal_thread.c | 30 ++--
lib/librte_power/rte_power_empty_poll.c | 2 +-
167 files changed, 1055 insertions(+), 992 deletions(-)
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 01/17] doc/coding_style: add policy about master/slave
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-15 9:46 ` Burakov, Anatoly
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 02/17] eal: add macro to mark macros as deprecated Stephen Hemminger
` (17 subsequent siblings)
18 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Update the coding style document to include a policy against
introducing new master/slave usage. This is taken from the similar
place in the Linux kernel coding style.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/contributing/coding_style.rst | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 0be9546a6aa8..2c915fa38240 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -283,6 +283,29 @@ Thus, the previous example would be better written:
DPDK also provides an optimized way to store elements in lockless rings.
This should be used in all data-path code, when there are several consumer and/or producers to avoid locking for concurrent access.
+Naming
+------
+
+For symbol names and documentation, new usage of
+'master / slave' (or 'slave' independent of 'master') and 'blacklist /
+whitelist' is not allowed.
+
+Recommended replacements for 'master / slave' are:
+ '{primary,main} / {secondary,replica,subordinate}'
+ '{initiator,requester} / {target,responder}'
+ '{controller,host} / {device,worker,proxy}'
+ 'leader / follower'
+ 'director / performer'
+
+Recommended replacements for 'blacklist/whitelist' are:
+ 'denylist / allowlist'
+ 'blocklist / passlist'
+
+Exceptions for introducing new usage is to maintain compatiablity
+with an existing (as of 2020) hardware or protocol
+specification that mandates those terms.
+
+
Typedefs
~~~~~~~~
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 02/17] eal: add macro to mark macros as deprecated
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 01/17] doc/coding_style: add policy about master/slave Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-15 9:48 ` Burakov, Anatoly
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 03/17] eal: rename lcore word choices Stephen Hemminger
` (16 subsequent siblings)
18 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Add a macro that causes GCC and CLANG to emit a warning when
a deprecated macro is used.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/include/rte_common.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h
index 8f487a563dfc..c6714b67b411 100644
--- a/lib/librte_eal/include/rte_common.h
+++ b/lib/librte_eal/include/rte_common.h
@@ -86,6 +86,17 @@ typedef uint16_t unaligned_uint16_t;
/******* Macro to mark functions and fields scheduled for removal *****/
#define __rte_deprecated __attribute__((__deprecated__))
+/**
+ * Macro to mark macros and defines scheduled for removal
+ */
+#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG)
+#define RTE_PRAGMA(x) _Pragma(#x)
+#define RTE_PRAGMA_WARNING(w) RTE_PRAGMA(GCC warning #w)
+#define RTE_DEPRECATED(x) RTE_PRAGMA_WARNING(#x is deprecated)
+#else
+#define RTE_DEPRECATED(x)
+#endif
+
/**
* Mark a function or variable to a weak reference.
*/
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 03/17] eal: rename lcore word choices
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 01/17] doc/coding_style: add policy about master/slave Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 02/17] eal: add macro to mark macros as deprecated Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-15 9:57 ` Burakov, Anatoly
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 04/17] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
` (15 subsequent siblings)
18 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master lcore with main lcore and
replace slave lcore with worker lcore.
Keep the old functions and macros but mark them as deprecated
for this release.
The "--master-lcore" command line option is also deprecated
and any usage will print a warning and use "--main-lcore"
as replacement.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/rel_notes/deprecation.rst | 19 -------
doc/guides/rel_notes/release_20_11.rst | 11 ++++
lib/librte_eal/common/eal_common_dynmem.c | 10 ++--
lib/librte_eal/common/eal_common_launch.c | 36 ++++++-------
lib/librte_eal/common/eal_common_lcore.c | 8 +--
lib/librte_eal/common/eal_common_options.c | 56 +++++++++++---------
lib/librte_eal/common/eal_options.h | 2 +
lib/librte_eal/common/eal_private.h | 6 +--
lib/librte_eal/common/rte_random.c | 2 +-
lib/librte_eal/common/rte_service.c | 2 +-
lib/librte_eal/freebsd/eal.c | 28 +++++-----
lib/librte_eal/freebsd/eal_thread.c | 32 ++++++------
lib/librte_eal/include/rte_eal.h | 4 +-
lib/librte_eal/include/rte_eal_trace.h | 4 +-
lib/librte_eal/include/rte_launch.h | 60 ++++++++++++----------
lib/librte_eal/include/rte_lcore.h | 35 +++++++++----
lib/librte_eal/linux/eal.c | 28 +++++-----
lib/librte_eal/linux/eal_memory.c | 8 +--
lib/librte_eal/linux/eal_thread.c | 32 ++++++------
lib/librte_eal/rte_eal_version.map | 2 +-
lib/librte_eal/windows/eal.c | 16 +++---
lib/librte_eal/windows/eal_thread.c | 30 +++++------
22 files changed, 225 insertions(+), 206 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 52168f775198..4132fb4b7c46 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -25,25 +25,6 @@ Deprecation Notices
* kvargs: The function ``rte_kvargs_process`` will get a new parameter
for returning key match count. It will ease handling of no-match case.
-* eal: To be more inclusive in choice of naming, the DPDK project
- will replace uses of master/slave in the API's and command line arguments.
-
- References to master/slave in relation to lcore will be renamed
- to initial/worker. The function ``rte_get_master_lcore()``
- will be renamed to ``rte_get_initial_lcore()``.
- For the 20.11 release, both names will be present and the
- old function will be marked with the deprecated tag.
- The old function will be removed in a future version.
-
- The iterator for worker lcores will also change:
- ``RTE_LCORE_FOREACH_SLAVE`` will be replaced with
- ``RTE_LCORE_FOREACH_WORKER``.
-
- The ``master-lcore`` argument to testpmd will be replaced
- with ``initial-lcore``. The old ``master-lcore`` argument
- will produce a runtime notification in 20.11 release, and
- be removed completely in a future release.
-
* eal: The terms blacklist and whitelist to describe devices used
by DPDK will be replaced in the 20.11 relase.
This will apply to command line arguments as well as macros.
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index b729bdf20022..08e6fbcb3eb4 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -97,6 +97,17 @@ API Changes
and the function ``rte_rawdev_queue_conf_get()``
from ``void`` to ``int`` allowing the return of error codes from drivers.
+* eal: Changed the function ``rte_get_master_lcore()`` is
+ replaced to ``rte_get_main_lcore()``. The old function is deprecated.
+
+ The iterator for worker lcores will also change:
+ ``RTE_LCORE_FOREACH_SLAVE`` will be replaced with
+ ``RTE_LCORE_FOREACH_WORKER``.
+
+ The ``master-lcore`` argument to testpmd will be replaced
+ with ``main-lcore``. The old ``master-lcore`` argument
+ will produce a runtime notification in 20.11 release, and
+ be removed completely in a future release.
ABI Changes
-----------
diff --git a/lib/librte_eal/common/eal_common_dynmem.c b/lib/librte_eal/common/eal_common_dynmem.c
index 614648d8a4de..1cefe52443c4 100644
--- a/lib/librte_eal/common/eal_common_dynmem.c
+++ b/lib/librte_eal/common/eal_common_dynmem.c
@@ -427,19 +427,19 @@ eal_dynmem_calc_num_pages_per_socket(
total_size -= default_size;
}
#else
- /* in 32-bit mode, allocate all of the memory only on master
+ /* in 32-bit mode, allocate all of the memory only on main
* lcore socket
*/
total_size = internal_conf->memory;
for (socket = 0; socket < RTE_MAX_NUMA_NODES && total_size != 0;
socket++) {
struct rte_config *cfg = rte_eal_get_configuration();
- unsigned int master_lcore_socket;
+ unsigned int main_lcore_socket;
- master_lcore_socket =
- rte_lcore_to_socket_id(cfg->master_lcore);
+ main_lcore_socket =
+ rte_lcore_to_socket_id(cfg->main_lcore);
- if (master_lcore_socket != socket)
+ if (main_lcore_socket != socket)
continue;
/* Update sizes */
diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c
index cf52d717f68e..34f854ad80c8 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -21,55 +21,55 @@
* Wait until a lcore finished its job.
*/
int
-rte_eal_wait_lcore(unsigned slave_id)
+rte_eal_wait_lcore(unsigned worker_id)
{
- if (lcore_config[slave_id].state == WAIT)
+ if (lcore_config[worker_id].state == WAIT)
return 0;
- while (lcore_config[slave_id].state != WAIT &&
- lcore_config[slave_id].state != FINISHED)
+ while (lcore_config[worker_id].state != WAIT &&
+ lcore_config[worker_id].state != FINISHED)
rte_pause();
rte_rmb();
/* we are in finished state, go to wait state */
- lcore_config[slave_id].state = WAIT;
- return lcore_config[slave_id].ret;
+ lcore_config[worker_id].state = WAIT;
+ return lcore_config[worker_id].ret;
}
/*
- * Check that every SLAVE lcores are in WAIT state, then call
- * rte_eal_remote_launch() for all of them. If call_master is true
- * (set to CALL_MASTER), also call the function on the master lcore.
+ * Check that every WORKER lcores are in WAIT state, then call
+ * rte_eal_remote_launch() for all of them. If call_main is true
+ * (set to CALL_MAIN), also call the function on the main lcore.
*/
int
rte_eal_mp_remote_launch(int (*f)(void *), void *arg,
- enum rte_rmt_call_master_t call_master)
+ enum rte_rmt_call_main_t call_main)
{
int lcore_id;
- int master = rte_get_master_lcore();
+ int main_lcore = rte_get_main_lcore();
/* check state of lcores */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (lcore_config[lcore_id].state != WAIT)
return -EBUSY;
}
/* send messages to cores */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(f, arg, lcore_id);
}
- if (call_master == CALL_MASTER) {
- lcore_config[master].ret = f(arg);
- lcore_config[master].state = FINISHED;
+ if (call_main == CALL_MAIN) {
+ lcore_config[main_lcore].ret = f(arg);
+ lcore_config[main_lcore].state = FINISHED;
}
return 0;
}
/*
- * Return the state of the lcore identified by slave_id.
+ * Return the state of the lcore identified by worker_id.
*/
enum rte_lcore_state_t
rte_eal_get_lcore_state(unsigned lcore_id)
@@ -86,7 +86,7 @@ rte_eal_mp_wait_lcore(void)
{
unsigned lcore_id;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_wait_lcore(lcore_id);
}
}
diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index d64569b3c758..66d6bad1a7d7 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -18,9 +18,9 @@
#include "eal_private.h"
#include "eal_thread.h"
-unsigned int rte_get_master_lcore(void)
+unsigned int rte_get_main_lcore(void)
{
- return rte_eal_get_configuration()->master_lcore;
+ return rte_eal_get_configuration()->main_lcore;
}
unsigned int rte_lcore_count(void)
@@ -93,7 +93,7 @@ int rte_lcore_is_enabled(unsigned int lcore_id)
return cfg->lcore_role[lcore_id] == ROLE_RTE;
}
-unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
+unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap)
{
i++;
if (wrap)
@@ -101,7 +101,7 @@ unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
while (i < RTE_MAX_LCORE) {
if (!rte_lcore_is_enabled(i) ||
- (skip_master && (i == rte_get_master_lcore()))) {
+ (skip_main && (i == rte_get_main_lcore()))) {
i++;
if (wrap)
i %= RTE_MAX_LCORE;
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index a5426e12346a..667ba2111c1a 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -81,6 +81,7 @@ eal_long_options[] = {
{OPT_TRACE_BUF_SIZE, 1, NULL, OPT_TRACE_BUF_SIZE_NUM },
{OPT_TRACE_MODE, 1, NULL, OPT_TRACE_MODE_NUM },
{OPT_MASTER_LCORE, 1, NULL, OPT_MASTER_LCORE_NUM },
+ {OPT_MAIN_LCORE, 1, NULL, OPT_MAIN_LCORE_NUM },
{OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM},
{OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM },
{OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM },
@@ -144,7 +145,7 @@ struct device_option {
static struct device_option_list devopt_list =
TAILQ_HEAD_INITIALIZER(devopt_list);
-static int master_lcore_parsed;
+static int main_lcore_parsed;
static int mem_parsed;
static int core_parsed;
@@ -575,12 +576,12 @@ eal_parse_service_coremask(const char *coremask)
for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE;
j++, idx++) {
if ((1 << j) & val) {
- /* handle master lcore already parsed */
+ /* handle main lcore already parsed */
uint32_t lcore = idx;
- if (master_lcore_parsed &&
- cfg->master_lcore == lcore) {
+ if (main_lcore_parsed &&
+ cfg->main_lcore == lcore) {
RTE_LOG(ERR, EAL,
- "lcore %u is master lcore, cannot use as service core\n",
+ "lcore %u is main lcore, cannot use as service core\n",
idx);
return -1;
}
@@ -748,12 +749,12 @@ eal_parse_service_corelist(const char *corelist)
min = idx;
for (idx = min; idx <= max; idx++) {
if (cfg->lcore_role[idx] != ROLE_SERVICE) {
- /* handle master lcore already parsed */
+ /* handle main lcore already parsed */
uint32_t lcore = idx;
- if (cfg->master_lcore == lcore &&
- master_lcore_parsed) {
+ if (cfg->main_lcore == lcore &&
+ main_lcore_parsed) {
RTE_LOG(ERR, EAL,
- "Error: lcore %u is master lcore, cannot use as service core\n",
+ "Error: lcore %u is main lcore, cannot use as service core\n",
idx);
return -1;
}
@@ -836,23 +837,23 @@ eal_parse_corelist(const char *corelist, int *cores)
return 0;
}
-/* Changes the lcore id of the master thread */
+/* Changes the lcore id of the main thread */
static int
-eal_parse_master_lcore(const char *arg)
+eal_parse_main_lcore(const char *arg)
{
char *parsing_end;
struct rte_config *cfg = rte_eal_get_configuration();
errno = 0;
- cfg->master_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
+ cfg->main_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
if (errno || parsing_end[0] != 0)
return -1;
- if (cfg->master_lcore >= RTE_MAX_LCORE)
+ if (cfg->main_lcore >= RTE_MAX_LCORE)
return -1;
- master_lcore_parsed = 1;
+ main_lcore_parsed = 1;
- /* ensure master core is not used as service core */
- if (lcore_config[cfg->master_lcore].core_role == ROLE_SERVICE) {
+ /* ensure main core is not used as service core */
+ if (lcore_config[cfg->main_lcore].core_role == ROLE_SERVICE) {
RTE_LOG(ERR, EAL,
"Error: Master lcore is used as a service core\n");
return -1;
@@ -1593,7 +1594,12 @@ eal_parse_common_option(int opt, const char *optarg,
break;
case OPT_MASTER_LCORE_NUM:
- if (eal_parse_master_lcore(optarg) < 0) {
+ fprintf(stderr,
+ "option --" OPT_MASTER_LCORE
+ " is deprecated use " OPT_MAIN_LCORE "\n");
+ /* fallthrough */
+ case OPT_MAIN_LCORE_NUM:
+ if (eal_parse_main_lcore(optarg) < 0) {
RTE_LOG(ERR, EAL, "invalid parameter for --"
OPT_MASTER_LCORE "\n");
return -1;
@@ -1763,9 +1769,9 @@ compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
RTE_CPU_AND(cpuset, cpuset, &default_set);
- /* if no remaining cpu, use master lcore cpu affinity */
+ /* if no remaining cpu, use main lcore cpu affinity */
if (!CPU_COUNT(cpuset)) {
- memcpy(cpuset, &lcore_config[rte_get_master_lcore()].cpuset,
+ memcpy(cpuset, &lcore_config[rte_get_main_lcore()].cpuset,
sizeof(*cpuset));
}
}
@@ -1797,12 +1803,12 @@ eal_adjust_config(struct internal_config *internal_cfg)
if (internal_conf->process_type == RTE_PROC_AUTO)
internal_conf->process_type = eal_proc_type_detect();
- /* default master lcore is the first one */
- if (!master_lcore_parsed) {
- cfg->master_lcore = rte_get_next_lcore(-1, 0, 0);
- if (cfg->master_lcore >= RTE_MAX_LCORE)
+ /* default main lcore is the first one */
+ if (!main_lcore_parsed) {
+ cfg->main_lcore = rte_get_next_lcore(-1, 0, 0);
+ if (cfg->main_lcore >= RTE_MAX_LCORE)
return -1;
- lcore_config[cfg->master_lcore].core_role = ROLE_RTE;
+ lcore_config[cfg->main_lcore].core_role = ROLE_RTE;
}
compute_ctrl_threads_cpuset(internal_cfg);
@@ -1822,7 +1828,7 @@ eal_check_common_options(struct internal_config *internal_cfg)
const struct internal_config *internal_conf =
eal_get_internal_configuration();
- if (cfg->lcore_role[cfg->master_lcore] != ROLE_RTE) {
+ if (cfg->lcore_role[cfg->main_lcore] != ROLE_RTE) {
RTE_LOG(ERR, EAL, "Master lcore is not enabled for DPDK\n");
return -1;
}
diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h
index 89769d48b487..d363228a7a25 100644
--- a/lib/librte_eal/common/eal_options.h
+++ b/lib/librte_eal/common/eal_options.h
@@ -43,6 +43,8 @@ enum {
OPT_TRACE_BUF_SIZE_NUM,
#define OPT_TRACE_MODE "trace-mode"
OPT_TRACE_MODE_NUM,
+#define OPT_MAIN_LCORE "main-lcore"
+ OPT_MAIN_LCORE_NUM,
#define OPT_MASTER_LCORE "master-lcore"
OPT_MASTER_LCORE_NUM,
#define OPT_MBUF_POOL_OPS_NAME "mbuf-pool-ops-name"
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index a6a6381567f4..4684c4c7df19 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -20,8 +20,8 @@
*/
struct lcore_config {
pthread_t thread_id; /**< pthread identifier */
- int pipe_master2slave[2]; /**< communication pipe with master */
- int pipe_slave2master[2]; /**< communication pipe with master */
+ int pipe_main2worker[2]; /**< communication pipe with main */
+ int pipe_worker2main[2]; /**< communication pipe with main */
lcore_function_t * volatile f; /**< function to call */
void * volatile arg; /**< argument of function */
@@ -42,7 +42,7 @@ extern struct lcore_config lcore_config[RTE_MAX_LCORE];
* The global RTE configuration structure.
*/
struct rte_config {
- uint32_t master_lcore; /**< Id of the master lcore */
+ uint32_t main_lcore; /**< Id of the main lcore */
uint32_t lcore_count; /**< Number of available logical cores. */
uint32_t numa_node_count; /**< Number of detected NUMA nodes. */
uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */
diff --git a/lib/librte_eal/common/rte_random.c b/lib/librte_eal/common/rte_random.c
index b7a089ac4fe0..8d88aca26299 100644
--- a/lib/librte_eal/common/rte_random.c
+++ b/lib/librte_eal/common/rte_random.c
@@ -122,7 +122,7 @@ struct rte_rand_state *__rte_rand_get_state(void)
lcore_id = rte_lcore_id();
if (unlikely(lcore_id == LCORE_ID_ANY))
- lcore_id = rte_get_master_lcore();
+ lcore_id = rte_get_main_lcore();
return &rand_states[lcore_id];
}
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 6a0e0ff65d14..626d2409ad57 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -106,7 +106,7 @@ rte_service_init(void)
struct rte_config *cfg = rte_eal_get_configuration();
for (i = 0; i < RTE_MAX_LCORE; i++) {
if (lcore_config[i].core_role == ROLE_SERVICE) {
- if ((unsigned int)i == cfg->master_lcore)
+ if ((unsigned int)i == cfg->main_lcore)
continue;
rte_service_lcore_add(i);
count++;
diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
index 798add0b5919..f7bdd8caabc3 100644
--- a/lib/librte_eal/freebsd/eal.c
+++ b/lib/librte_eal/freebsd/eal.c
@@ -626,10 +626,10 @@ eal_check_mem_on_local_socket(void)
int socket_id;
const struct rte_config *config = rte_eal_get_configuration();
- socket_id = rte_lcore_to_socket_id(config->master_lcore);
+ socket_id = rte_lcore_to_socket_id(config->main_lcore);
if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
- RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
+ RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
}
@@ -850,29 +850,29 @@ rte_eal_init(int argc, char **argv)
eal_check_mem_on_local_socket();
if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
- &lcore_config[config->master_lcore].cpuset) != 0) {
+ &lcore_config[config->main_lcore].cpuset) != 0) {
rte_eal_init_alert("Cannot set affinity");
rte_errno = EINVAL;
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
- RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
- config->master_lcore, thread_id, cpuset,
+ RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
+ config->main_lcore, thread_id, cpuset,
ret == 0 ? "" : "...");
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (pipe(lcore_config[i].pipe_master2slave) < 0)
+ if (pipe(lcore_config[i].pipe_main2worker) < 0)
rte_panic("Cannot create pipe\n");
- if (pipe(lcore_config[i].pipe_slave2master) < 0)
+ if (pipe(lcore_config[i].pipe_worker2main) < 0)
rte_panic("Cannot create pipe\n");
lcore_config[i].state = WAIT;
@@ -885,7 +885,7 @@ rte_eal_init(int argc, char **argv)
/* Set thread_name for aid in debugging. */
snprintf(thread_name, sizeof(thread_name),
- "lcore-slave-%d", i);
+ "lcore-worker-%d", i);
rte_thread_setname(lcore_config[i].thread_id, thread_name);
ret = pthread_setaffinity_np(lcore_config[i].thread_id,
@@ -895,10 +895,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
/* initialize services so vdevs register service during bus_probe. */
diff --git a/lib/librte_eal/freebsd/eal_thread.c b/lib/librte_eal/freebsd/eal_thread.c
index 99b5fefc4c5b..1dce9b04f24a 100644
--- a/lib/librte_eal/freebsd/eal_thread.c
+++ b/lib/librte_eal/freebsd/eal_thread.c
@@ -26,35 +26,35 @@
#include "eal_thread.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
+rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
int rc = -EBUSY;
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
goto finish;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(m2s, &c, 1);
+ n = write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = read(s2m, &c, 1);
+ n = read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -62,7 +62,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
rc = 0;
finish:
- rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc);
+ rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
return rc;
}
@@ -74,21 +74,21 @@ eal_thread_loop(__rte_unused void *arg)
int n, ret;
unsigned lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -104,7 +104,7 @@ eal_thread_loop(__rte_unused void *arg)
/* wait command */
do {
- n = read(m2s, &c, 1);
+ n = read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -115,7 +115,7 @@ eal_thread_loop(__rte_unused void *arg)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(s2m, &c, 1);
+ n = write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
diff --git a/lib/librte_eal/include/rte_eal.h b/lib/librte_eal/include/rte_eal.h
index ddcf6a2e7a1a..f8f0d74b476c 100644
--- a/lib/librte_eal/include/rte_eal.h
+++ b/lib/librte_eal/include/rte_eal.h
@@ -65,11 +65,11 @@ int rte_eal_iopl_init(void);
/**
* Initialize the Environment Abstraction Layer (EAL).
*
- * This function is to be executed on the MASTER lcore only, as soon
+ * This function is to be executed on the MAIN lcore only, as soon
* as possible in the application's main() function.
*
* The function finishes the initialization process before main() is called.
- * It puts the SLAVE lcores in the WAIT state.
+ * It puts the WORKER lcores in the WAIT state.
*
* When the multi-partition feature is supported, depending on the
* configuration (if CONFIG_RTE_EAL_MAIN_PARTITION is disabled), this
diff --git a/lib/librte_eal/include/rte_eal_trace.h b/lib/librte_eal/include/rte_eal_trace.h
index 6b1a813c7b1b..dd4e30e7fe5c 100644
--- a/lib/librte_eal/include/rte_eal_trace.h
+++ b/lib/librte_eal/include/rte_eal_trace.h
@@ -258,10 +258,10 @@ RTE_TRACE_POINT(
RTE_TRACE_POINT(
rte_eal_trace_thread_remote_launch,
RTE_TRACE_POINT_ARGS(int (*f)(void *), void *arg,
- unsigned int slave_id, int rc),
+ unsigned int worker_id, int rc),
rte_trace_point_emit_ptr(f);
rte_trace_point_emit_ptr(arg);
- rte_trace_point_emit_u32(slave_id);
+ rte_trace_point_emit_u32(worker_id);
rte_trace_point_emit_int(rc);
)
RTE_TRACE_POINT(
diff --git a/lib/librte_eal/include/rte_launch.h b/lib/librte_eal/include/rte_launch.h
index 06a671752ace..2b061c7dea8e 100644
--- a/lib/librte_eal/include/rte_launch.h
+++ b/lib/librte_eal/include/rte_launch.h
@@ -32,12 +32,12 @@ typedef int (lcore_function_t)(void *);
/**
* Launch a function on another lcore.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * Sends a message to a slave lcore (identified by the slave_id) that
+ * Sends a message to a worker lcore (identified by the worker_id) that
* is in the WAIT state (this is true after the first call to
* rte_eal_init()). This can be checked by first calling
- * rte_eal_wait_lcore(slave_id).
+ * rte_eal_wait_lcore(worker_id).
*
* When the remote lcore receives the message, it switches to
* the RUNNING state, then calls the function f with argument arg. Once the
@@ -45,7 +45,7 @@ typedef int (lcore_function_t)(void *);
* the return value of f is stored in a local variable to be read using
* rte_eal_wait_lcore().
*
- * The MASTER lcore returns as soon as the message is sent and knows
+ * The MAIN lcore returns as soon as the message is sent and knows
* nothing about the completion of f.
*
* Note: This function is not designed to offer optimum
@@ -56,37 +56,41 @@ typedef int (lcore_function_t)(void *);
* The function to be called.
* @param arg
* The argument for the function.
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore on which the function should be executed.
* @return
* - 0: Success. Execution of function f started on the remote lcore.
* - (-EBUSY): The remote lcore is not in a WAIT state.
*/
-int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned slave_id);
+int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned worker_id);
/**
- * This enum indicates whether the master core must execute the handler
+ * This enum indicates whether the main core must execute the handler
* launched on all logical cores.
*/
-enum rte_rmt_call_master_t {
- SKIP_MASTER = 0, /**< lcore handler not executed by master core. */
- CALL_MASTER, /**< lcore handler executed by master core. */
+enum rte_rmt_call_main_t {
+ SKIP_MAIN = 0, /**< lcore handler not executed by main core. */
+ CALL_MAIN, /**< lcore handler executed by main core. */
};
+/* These legacy definitions will be removed in future release */
+#define SKIP_MASTER RTE_DEPRECATED(SKIP_MASTER) SKIP_MAIN
+#define CALL_MASTER RTE_DEPRECATED(CALL_MASTER) CALL_MAIN
+
/**
* Launch a function on all lcores.
*
- * Check that each SLAVE lcore is in a WAIT state, then call
+ * Check that each WORKER lcore is in a WAIT state, then call
* rte_eal_remote_launch() for each lcore.
*
* @param f
* The function to be called.
* @param arg
* The argument for the function.
- * @param call_master
- * If call_master set to SKIP_MASTER, the MASTER lcore does not call
- * the function. If call_master is set to CALL_MASTER, the function
- * is also called on master before returning. In any case, the master
+ * @param call_main
+ * If call_main set to SKIP_MAIN, the MAIN lcore does not call
+ * the function. If call_main is set to CALL_MAIN, the function
+ * is also called on main before returning. In any case, the main
* lcore returns as soon as it finished its job and knows nothing
* about the completion of f on the other lcores.
* @return
@@ -95,49 +99,49 @@ enum rte_rmt_call_master_t {
* case, no message is sent to any of the lcores.
*/
int rte_eal_mp_remote_launch(lcore_function_t *f, void *arg,
- enum rte_rmt_call_master_t call_master);
+ enum rte_rmt_call_main_t call_main);
/**
- * Get the state of the lcore identified by slave_id.
+ * Get the state of the lcore identified by worker_id.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore.
* @return
* The state of the lcore.
*/
-enum rte_lcore_state_t rte_eal_get_lcore_state(unsigned slave_id);
+enum rte_lcore_state_t rte_eal_get_lcore_state(unsigned worker_id);
/**
* Wait until an lcore finishes its job.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * If the slave lcore identified by the slave_id is in a FINISHED state,
+ * If the worker lcore identified by the worker_id is in a FINISHED state,
* switch to the WAIT state. If the lcore is in RUNNING state, wait until
* the lcore finishes its job and moves to the FINISHED state.
*
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore.
* @return
- * - 0: If the lcore identified by the slave_id is in a WAIT state.
+ * - 0: If the lcore identified by the worker_id is in a WAIT state.
* - The value that was returned by the previous remote launch
- * function call if the lcore identified by the slave_id was in a
+ * function call if the lcore identified by the worker_id was in a
* FINISHED or RUNNING state. In this case, it changes the state
* of the lcore to WAIT.
*/
-int rte_eal_wait_lcore(unsigned slave_id);
+int rte_eal_wait_lcore(unsigned worker_id);
/**
* Wait until all lcores finish their jobs.
*
- * To be executed on the MASTER lcore only. Issue an
+ * To be executed on the MAIN lcore only. Issue an
* rte_eal_wait_lcore() for every lcore. The return values are
* ignored.
*
* After a call to rte_eal_mp_wait_lcore(), the caller can assume
- * that all slave lcores are in a WAIT state.
+ * that all worker lcores are in a WAIT state.
*/
void rte_eal_mp_wait_lcore(void);
diff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h
index b8b64a625200..48b87e253afa 100644
--- a/lib/librte_eal/include/rte_lcore.h
+++ b/lib/librte_eal/include/rte_lcore.h
@@ -78,12 +78,24 @@ rte_lcore_id(void)
}
/**
- * Get the id of the master lcore
+ * Get the id of the main lcore
*
* @return
- * the id of the master lcore
+ * the id of the main lcore
*/
-unsigned int rte_get_master_lcore(void);
+unsigned int rte_get_main_lcore(void);
+
+/**
+ * Deprecated function the id of the main lcore
+ *
+ * @return
+ * the id of the main lcore
+ */
+__rte_deprecated
+static inline unsigned int rte_get_master_lcore(void)
+{
+ return rte_get_main_lcore();
+}
/**
* Return the number of execution units (lcores) on the system.
@@ -203,32 +215,35 @@ int rte_lcore_is_enabled(unsigned int lcore_id);
*
* @param i
* The current lcore (reference).
- * @param skip_master
- * If true, do not return the ID of the master lcore.
+ * @param skip_main
+ * If true, do not return the ID of the main lcore.
* @param wrap
* If true, go back to 0 when RTE_MAX_LCORE is reached; otherwise,
* return RTE_MAX_LCORE.
* @return
* The next lcore_id or RTE_MAX_LCORE if not found.
*/
-unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap);
+unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap);
/**
* Macro to browse all running lcores.
*/
#define RTE_LCORE_FOREACH(i) \
for (i = rte_get_next_lcore(-1, 0, 0); \
- i<RTE_MAX_LCORE; \
+ i < RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 0, 0))
/**
- * Macro to browse all running lcores except the master lcore.
+ * Macro to browse all running lcores except the main lcore.
*/
-#define RTE_LCORE_FOREACH_SLAVE(i) \
+#define RTE_LCORE_FOREACH_WORKER(i) \
for (i = rte_get_next_lcore(-1, 1, 0); \
- i<RTE_MAX_LCORE; \
+ i < RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 1, 0))
+#define RTE_LCORE_FOREACH_SLAVE(l) \
+ RTE_DEPRECATED(RTE_LCORE_FOREACH_SLAVE) RTE_LCORE_FOREACH_WORKER(l)
+
/**
* Callback prototype for initializing lcores.
*
diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c
index 0960f01d0516..d8b1948585dc 100644
--- a/lib/librte_eal/linux/eal.c
+++ b/lib/librte_eal/linux/eal.c
@@ -884,10 +884,10 @@ eal_check_mem_on_local_socket(void)
int socket_id;
const struct rte_config *config = rte_eal_get_configuration();
- socket_id = rte_lcore_to_socket_id(config->master_lcore);
+ socket_id = rte_lcore_to_socket_id(config->main_lcore);
if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
- RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
+ RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
}
static int
@@ -1214,28 +1214,28 @@ rte_eal_init(int argc, char **argv)
eal_check_mem_on_local_socket();
if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
- &lcore_config[config->master_lcore].cpuset) != 0) {
+ &lcore_config[config->main_lcore].cpuset) != 0) {
rte_eal_init_alert("Cannot set affinity");
rte_errno = EINVAL;
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
- RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
- config->master_lcore, (uintptr_t)thread_id, cpuset,
+ RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
+ config->main_lcore, (uintptr_t)thread_id, cpuset,
ret == 0 ? "" : "...");
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (pipe(lcore_config[i].pipe_master2slave) < 0)
+ if (pipe(lcore_config[i].pipe_main2worker) < 0)
rte_panic("Cannot create pipe\n");
- if (pipe(lcore_config[i].pipe_slave2master) < 0)
+ if (pipe(lcore_config[i].pipe_worker2main) < 0)
rte_panic("Cannot create pipe\n");
lcore_config[i].state = WAIT;
@@ -1248,7 +1248,7 @@ rte_eal_init(int argc, char **argv)
/* Set thread_name for aid in debugging. */
snprintf(thread_name, sizeof(thread_name),
- "lcore-slave-%d", i);
+ "lcore-worker-%d", i);
ret = rte_thread_setname(lcore_config[i].thread_id,
thread_name);
if (ret != 0)
@@ -1262,10 +1262,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
/* initialize services so vdevs register service during bus_probe. */
diff --git a/lib/librte_eal/linux/eal_memory.c b/lib/librte_eal/linux/eal_memory.c
index 89725291b0ce..d7349544a13a 100644
--- a/lib/librte_eal/linux/eal_memory.c
+++ b/lib/librte_eal/linux/eal_memory.c
@@ -1751,7 +1751,7 @@ memseg_primary_init_32(void)
for (i = 0; i < rte_socket_count(); i++) {
int hp_sizes = (int) internal_conf->num_hugepage_sizes;
uint64_t max_socket_mem, cur_socket_mem;
- unsigned int master_lcore_socket;
+ unsigned int main_lcore_socket;
struct rte_config *cfg = rte_eal_get_configuration();
bool skip;
@@ -1767,10 +1767,10 @@ memseg_primary_init_32(void)
skip = active_sockets != 0 &&
internal_conf->socket_mem[socket_id] == 0;
/* ...or if we didn't specifically request memory on *any*
- * socket, and this is not master lcore
+ * socket, and this is not main lcore
*/
- master_lcore_socket = rte_lcore_to_socket_id(cfg->master_lcore);
- skip |= active_sockets == 0 && socket_id != master_lcore_socket;
+ main_lcore_socket = rte_lcore_to_socket_id(cfg->main_lcore);
+ skip |= active_sockets == 0 && socket_id != main_lcore_socket;
if (skip) {
RTE_LOG(DEBUG, EAL, "Will not preallocate memory on socket %u\n",
diff --git a/lib/librte_eal/linux/eal_thread.c b/lib/librte_eal/linux/eal_thread.c
index 068de2559555..bed1d513c841 100644
--- a/lib/librte_eal/linux/eal_thread.c
+++ b/lib/librte_eal/linux/eal_thread.c
@@ -26,35 +26,35 @@
#include "eal_thread.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
+rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
int rc = -EBUSY;
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
goto finish;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(m2s, &c, 1);
+ n = write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = read(s2m, &c, 1);
+ n = read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -62,7 +62,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
rc = 0;
finish:
- rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc);
+ rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
return rc;
}
@@ -74,21 +74,21 @@ eal_thread_loop(__rte_unused void *arg)
int n, ret;
unsigned lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -104,7 +104,7 @@ eal_thread_loop(__rte_unused void *arg)
/* wait command */
do {
- n = read(m2s, &c, 1);
+ n = read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -115,7 +115,7 @@ eal_thread_loop(__rte_unused void *arg)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(s2m, &c, 1);
+ n = write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 0b18e2ef85f9..8ff6fe7c3eaf 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -74,7 +74,7 @@ DPDK_21 {
rte_free;
rte_get_hpet_cycles;
rte_get_hpet_hz;
- rte_get_master_lcore;
+ rte_get_main_lcore;
rte_get_next_lcore;
rte_get_tsc_hz;
rte_hexdump;
diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index bc48f27ab39a..cbca20956210 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -350,8 +350,8 @@ rte_eal_init(int argc, char **argv)
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
bscan = rte_bus_scan();
if (bscan < 0) {
@@ -360,16 +360,16 @@ rte_eal_init(int argc, char **argv)
return -1;
}
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (_pipe(lcore_config[i].pipe_master2slave,
+ if (_pipe(lcore_config[i].pipe_main2worker,
sizeof(char), _O_BINARY) < 0)
rte_panic("Cannot create pipe\n");
- if (_pipe(lcore_config[i].pipe_slave2master,
+ if (_pipe(lcore_config[i].pipe_worker2main,
sizeof(char), _O_BINARY) < 0)
rte_panic("Cannot create pipe\n");
@@ -394,10 +394,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
return fctret;
}
diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index 20889b6196c9..908e726d16cc 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -17,34 +17,34 @@
#include "eal_windows.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int slave_id)
+rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
return -EBUSY;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = _write(m2s, &c, 1);
+ n = _write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = _read(s2m, &c, 1);
+ n = _read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -61,21 +61,21 @@ eal_thread_loop(void *arg __rte_unused)
int n, ret;
unsigned int lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -88,7 +88,7 @@ eal_thread_loop(void *arg __rte_unused)
/* wait command */
do {
- n = _read(m2s, &c, 1);
+ n = _read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -99,7 +99,7 @@ eal_thread_loop(void *arg __rte_unused)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = _write(s2m, &c, 1);
+ n = _write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 04/17] rte_power: replace rte_master_lcore with rte_main_lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (2 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 03/17] eal: rename lcore word choices Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-15 9:57 ` Burakov, Anatoly
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 05/17] drivers: replace master lcore with main lcore Stephen Hemminger
` (14 subsequent siblings)
18 siblings, 1 reply; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
The old rte_master_lcore is now replaced by rte_mail_lcore.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_power/rte_power_empty_poll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_power/rte_power_empty_poll.c b/lib/librte_power/rte_power_empty_poll.c
index 70c07b1533f3..975aa9299799 100644
--- a/lib/librte_power/rte_power_empty_poll.c
+++ b/lib/librte_power/rte_power_empty_poll.c
@@ -452,7 +452,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,
if (get_freq_index(LOW) > total_avail_freqs[i])
return -1;
- if (rte_get_master_lcore() != i) {
+ if (rte_get_main_lcore() != i) {
w->wrk_stats[i].lcore_id = i;
set_policy(&w->wrk_stats[i], policy);
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 05/17] drivers: replace master lcore with main lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (3 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 04/17] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 06/17] net/memif: replace master/slave arguments with server/client Stephen Hemminger
` (13 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Replace use of deprecated rte_master_lcore with rte_main_lcore.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 4 ++--
drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
drivers/net/qede/base/bcm_osal.c | 4 ++--
drivers/net/softnic/rte_eth_softnic_thread.c | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 32e872da5209..c94c72106f2c 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -257,7 +257,7 @@ int rte_dpaa_portal_init(void *arg)
BUS_INIT_FUNC_TRACE();
if ((size_t)arg == 1 || lcore == LCORE_ID_ANY)
- lcore = rte_get_master_lcore();
+ lcore = rte_get_main_lcore();
else
if (lcore >= RTE_MAX_LCORE)
return -1;
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 54f654744259..910fb11c9c38 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -429,7 +429,7 @@ int bnxt_alloc_rxtx_nq_ring(struct bnxt *bp)
if (!BNXT_HAS_NQ(bp) || bp->rxtx_nq_ring)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_main_lcore());
nqr = rte_zmalloc_socket("nqr",
sizeof(struct bnxt_cp_ring_info),
@@ -819,7 +819,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
if (BNXT_NUM_ASYNC_CPR(bp) == 0)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_main_lcore());
cpr = rte_zmalloc_socket("cpr",
sizeof(struct bnxt_cp_ring_info),
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 96b27dfd309d..85deddf120b4 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -814,7 +814,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
hif = mrvl_get_hif(priv, core_id);
@@ -1618,7 +1618,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
hif = mrvl_get_hif(rxq->priv, core_id);
if (!hif)
@@ -1768,7 +1768,7 @@ mrvl_rx_queue_release(void *rxq)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
if (!q)
return;
diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 65837b53d063..4c2706ab4b90 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -112,7 +112,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, RTE_CACHE_LINE_SIZE);
@@ -151,7 +151,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, align);
diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index dcfb5eb82c18..8dbb8886e30e 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -25,7 +25,7 @@ softnic_thread_free(struct pmd_internals *softnic)
{
uint32_t i;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
struct softnic_thread *t = &softnic->thread[i];
/* MSGQs */
@@ -99,7 +99,7 @@ softnic_thread_init(struct pmd_internals *softnic)
static inline int
thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id)
{
- if (thread_id == rte_get_master_lcore())
+ if (thread_id == rte_get_main_lcore())
return 0; /* FALSE */
if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE))
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 06/17] net/memif: replace master/slave arguments with server/client
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (4 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 05/17] drivers: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 07/17] doc: replace master lcore with main lcore Stephen Hemminger
` (12 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master/slave terms in this driver.
The memory interface drivers uses a client/server architecture
so change the variable names and device arguments to that.
The previous devargs are maintained for compatiablity, but if
used cause a notice in the log.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/nics/memif.rst | 78 ++++++++---------
drivers/net/memif/memif.h | 40 ++++-----
drivers/net/memif/memif_socket.c | 54 ++++++------
drivers/net/memif/memif_socket.h | 5 +-
drivers/net/memif/rte_eth_memif.c | 134 ++++++++++++++++--------------
drivers/net/memif/rte_eth_memif.h | 20 ++---
6 files changed, 169 insertions(+), 162 deletions(-)
diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
index ddeebed25ccd..8dca1ff8f4b2 100644
--- a/doc/guides/nics/memif.rst
+++ b/doc/guides/nics/memif.rst
@@ -13,13 +13,13 @@ The created device transmits packets in a raw format. It can be used with
Ethernet mode, IP mode, or Punt/Inject. At this moment, only Ethernet mode is
supported in DPDK memif implementation.
-Memif works in two roles: master and slave. Slave connects to master over an
+Memif works in two roles: server and client. Client connects to server over an
existing socket. It is also a producer of shared memory file and initializes
the shared memory. Each interface can be connected to one peer interface
-at same time. The peer interface is identified by id parameter. Master
-creates the socket and listens for any slave connection requests. The socket
+at same time. The peer interface is identified by id parameter. Server
+creates the socket and listens for any client connection requests. The socket
may already exist on the system. Be sure to remove any such sockets, if you
-are creating a master interface, or you will see an "Address already in use"
+are creating a server interface, or you will see an "Address already in use"
error. Function ``rte_pmd_memif_remove()``, which removes memif interface,
will also remove a listener socket, if it is not being used by any other
interface.
@@ -31,57 +31,57 @@ net_memif1, and so on. Memif uses unix domain socket to transmit control
messages. Each memif has a unique id per socket. This id is used to identify
peer interface. If you are connecting multiple
interfaces using same socket, be sure to specify unique ids ``id=0``, ``id=1``,
-etc. Note that if you assign a socket to a master interface it becomes a
-listener socket. Listener socket can not be used by a slave interface on same
+etc. Note that if you assign a socket to a server interface it becomes a
+listener socket. Listener socket can not be used by a client interface on same
client.
.. csv-table:: **Memif configuration options**
:header: "Option", "Description", "Default", "Valid value"
"id=0", "Used to identify peer interface", "0", "uint32_t"
- "role=master", "Set memif role", "slave", "master|slave"
+ "role=server", "Set memif role", "client", "server|client"
"bsize=1024", "Size of single packet buffer", "2048", "uint16_t"
"rsize=11", "Log2 of ring size. If rsize is 10, actual ring size is 1024", "10", "1-14"
"socket=/tmp/memif.sock", "Socket filename", "/tmp/memif.sock", "string len 108"
"mac=01:23:45:ab:cd:ef", "Mac address", "01:ab:23:cd:45:ef", ""
"secret=abc123", "Secret is an optional security option, which if specified, must be matched by peer", "", "string len 24"
- "zero-copy=yes", "Enable/disable zero-copy slave mode. Only relevant to slave, requires '--single-file-segments' eal argument", "no", "yes|no"
+ "zero-copy=yes", "Enable/disable zero-copy client mode. Only relevant to client, requires '--single-file-segments' eal argument", "no", "yes|no"
**Connection establishment**
In order to create memif connection, two memif interfaces, each in separate
-process, are needed. One interface in ``master`` role and other in
-``slave`` role. It is not possible to connect two interfaces in a single
+process, are needed. One interface in ``server`` role and other in
+``client`` role. It is not possible to connect two interfaces in a single
process. Each interface can be connected to one interface at same time,
identified by matching id parameter.
Memif driver uses unix domain socket to exchange required information between
memif interfaces. Socket file path is specified at interface creation see
-*Memif configuration options* table above. If socket is used by ``master``
+*Memif configuration options* table above. If socket is used by ``server``
interface, it's marked as listener socket (in scope of current process) and
listens to connection requests from other processes. One socket can be used by
-multiple interfaces. One process can have ``slave`` and ``master`` interfaces
+multiple interfaces. One process can have ``client`` and ``server`` interfaces
at the same time, provided each role is assigned unique socket.
For detailed information on memif control messages, see: net/memif/memif.h.
-Slave interface attempts to make a connection on assigned socket. Process
+Client interface attempts to make a connection on assigned socket. Process
listening on this socket will extract the connection request and create a new
connected socket (control channel). Then it sends the 'hello' message
-(``MEMIF_MSG_TYPE_HELLO``), containing configuration boundaries. Slave interface
+(``MEMIF_MSG_TYPE_HELLO``), containing configuration boundaries. Client interface
adjusts its configuration accordingly, and sends 'init' message
(``MEMIF_MSG_TYPE_INIT``). This message among others contains interface id. Driver
-uses this id to find master interface, and assigns the control channel to this
+uses this id to find server interface, and assigns the control channel to this
interface. If such interface is found, 'ack' message (``MEMIF_MSG_TYPE_ACK``) is
-sent. Slave interface sends 'add region' message (``MEMIF_MSG_TYPE_ADD_REGION``) for
-every region allocated. Master responds to each of these messages with 'ack'
-message. Same behavior applies to rings. Slave sends 'add ring' message
-(``MEMIF_MSG_TYPE_ADD_RING``) for every initialized ring. Master again responds to
-each message with 'ack' message. To finalize the connection, slave interface
+sent. Client interface sends 'add region' message (``MEMIF_MSG_TYPE_ADD_REGION``) for
+every region allocated. Server responds to each of these messages with 'ack'
+message. Same behavior applies to rings. Client sends 'add ring' message
+(``MEMIF_MSG_TYPE_ADD_RING``) for every initialized ring. Server again responds to
+each message with 'ack' message. To finalize the connection, client interface
sends 'connect' message (``MEMIF_MSG_TYPE_CONNECT``). Upon receiving this message
-master maps regions to its address space, initializes rings and responds with
+server maps regions to its address space, initializes rings and responds with
'connected' message (``MEMIF_MSG_TYPE_CONNECTED``). Disconnect
-(``MEMIF_MSG_TYPE_DISCONNECT``) can be sent by both master and slave interfaces at
+(``MEMIF_MSG_TYPE_DISCONNECT``) can be sent by both server and client interfaces at
any time, due to driver error or if the interface is being deleted.
Files
@@ -95,8 +95,8 @@ Shared memory
**Shared memory format**
-Slave is producer and master is consumer. Memory regions, are mapped shared memory files,
-created by memif slave and provided to master at connection establishment.
+Client is producer and server is consumer. Memory regions, are mapped shared memory files,
+created by memif client and provided to server at connection establishment.
Regions contain rings and buffers. Rings and buffers can also be separated into multiple
regions. For no-zero-copy, rings and buffers are stored inside single memory
region to reduce the number of opened files.
@@ -171,11 +171,11 @@ Files
- net/memif/memif.h *- descriptor and ring definitions*
- net/memif/rte_eth_memif.c *- eth_memif_rx() eth_memif_tx()*
-Zero-copy slave
+Zero-copy client
~~~~~~~~~~~~~~~
-Zero-copy slave can be enabled with memif configuration option 'zero-copy=yes'. This option
-is only relevant to slave and requires eal argument '--single-file-segments'.
+Zero-copy client can be enabled with memif configuration option 'zero-copy=yes'. This option
+is only relevant to client and requires eal argument '--single-file-segments'.
This limitation is in place, because it is too expensive to identify memseg
for each packet buffer, resulting in worse performance than with zero-copy disabled.
With single file segments we can calculate offset from the beginning of the file
@@ -183,9 +183,9 @@ for each packet buffer.
**Shared memory format**
-Region 0 is created by memif driver and contains rings. Slave interface exposes DPDK memory (memseg).
+Region 0 is created by memif driver and contains rings. Client interface exposes DPDK memory (memseg).
Instead of using memfd_create() to create new shared file, existing memsegs are used.
-Master interface functions the same as with zero-copy disabled.
+Server interface functions the same as with zero-copy disabled.
region 0:
@@ -211,24 +211,24 @@ Example: testpmd
----------------------------
In this example we run two instances of testpmd application and transmit packets over memif.
-First create ``master`` interface::
+First create ``server`` interface::
- #./build/app/testpmd -l 0-1 --proc-type=primary --file-prefix=pmd1 --vdev=net_memif,role=master -- -i
+ #./build/app/testpmd -l 0-1 --proc-type=primary --file-prefix=pmd1 --vdev=net_memif,role=server -- -i
-Now create ``slave`` interface (master must be already running so the slave will connect)::
+Now create ``client`` interface (server must be already running so the client will connect)::
#./build/app/testpmd -l 2-3 --proc-type=primary --file-prefix=pmd2 --vdev=net_memif -- -i
-You can also enable ``zero-copy`` on ``slave`` interface::
+You can also enable ``zero-copy`` on ``client`` interface::
#./build/app/testpmd -l 2-3 --proc-type=primary --file-prefix=pmd2 --vdev=net_memif,zero-copy=yes --single-file-segments -- -i
Start forwarding packets::
- Slave:
+ Client:
testpmd> start
- Master:
+ Server:
testpmd> start tx_first
Show status::
@@ -241,9 +241,9 @@ Example: testpmd and VPP
------------------------
For information on how to get and run VPP please see `<https://wiki.fd.io/view/VPP>`_.
-Start VPP in interactive mode (should be by default). Create memif master interface in VPP::
+Start VPP in interactive mode (should be by default). Create memif server interface in VPP::
- vpp# create interface memif id 0 master no-zero-copy
+ vpp# create interface memif id 0 server no-zero-copy
vpp# set interface state memif0/0 up
vpp# set interface ip address memif0/0 192.168.1.1/24
@@ -259,7 +259,7 @@ Now create memif interface by running testpmd with these command line options::
#./testpmd --vdev=net_memif,socket=/run/vpp/memif.sock -- -i
-Testpmd should now create memif slave interface and try to connect to master.
+Testpmd should now create memif client interface and try to connect to server.
In testpmd set forward option to icmpecho and start forwarding::
testpmd> set fwd icmpecho
@@ -280,7 +280,7 @@ The situation is analogous to cross connecting 2 ports of the NIC by cable.
To set the loopback, just use the same socket and id with different roles::
- #./testpmd --vdev=net_memif0,role=master,id=0 --vdev=net_memif1,role=slave,id=0 -- -i
+ #./testpmd --vdev=net_memif0,role=server,id=0 --vdev=net_memif1,role=client,id=0 -- -i
Then start the communication::
diff --git a/drivers/net/memif/memif.h b/drivers/net/memif/memif.h
index b91230890410..cb72c692ba03 100644
--- a/drivers/net/memif/memif.h
+++ b/drivers/net/memif/memif.h
@@ -12,8 +12,8 @@
#define MEMIF_NAME_SZ 32
/*
- * S2M: direction slave -> master
- * M2S: direction master -> slave
+ * C2S: direction client -> server
+ * S2C: direction server -> client
*/
/*
@@ -33,8 +33,8 @@ typedef enum memif_msg_type {
} memif_msg_type_t;
typedef enum {
- MEMIF_RING_S2M, /**< buffer ring in direction slave -> master */
- MEMIF_RING_M2S, /**< buffer ring in direction master -> slave */
+ MEMIF_RING_C2S, /**< buffer ring in direction client -> server */
+ MEMIF_RING_S2C, /**< buffer ring in direction server -> client */
} memif_ring_type_t;
typedef enum {
@@ -56,23 +56,23 @@ typedef uint8_t memif_log2_ring_size_t;
*/
/**
- * M2S
- * Contains master interfaces configuration.
+ * S2C
+ * Contains server interfaces configuration.
*/
typedef struct __rte_packed {
uint8_t name[MEMIF_NAME_SZ]; /**< Client app name. In this case DPDK version */
memif_version_t min_version; /**< lowest supported memif version */
memif_version_t max_version; /**< highest supported memif version */
memif_region_index_t max_region; /**< maximum num of regions */
- memif_ring_index_t max_m2s_ring; /**< maximum num of M2S ring */
- memif_ring_index_t max_s2m_ring; /**< maximum num of S2M rings */
+ memif_ring_index_t max_s2c_ring; /**< maximum num of S2C ring */
+ memif_ring_index_t max_c2s_ring; /**< maximum num of C2S rings */
memif_log2_ring_size_t max_log2_ring_size; /**< maximum ring size (as log2) */
} memif_msg_hello_t;
/**
- * S2M
+ * C2S
* Contains information required to identify interface
- * to which the slave wants to connect.
+ * to which the client wants to connect.
*/
typedef struct __rte_packed {
memif_version_t version; /**< memif version */
@@ -83,8 +83,8 @@ typedef struct __rte_packed {
} memif_msg_init_t;
/**
- * S2M
- * Request master to add new shared memory region to master interface.
+ * C2S
+ * Request server to add new shared memory region to server interface.
* Shared files file descriptor is passed in cmsghdr.
*/
typedef struct __rte_packed {
@@ -93,12 +93,12 @@ typedef struct __rte_packed {
} memif_msg_add_region_t;
/**
- * S2M
- * Request master to add new ring to master interface.
+ * C2S
+ * Request server to add new ring to server interface.
*/
typedef struct __rte_packed {
uint16_t flags; /**< flags */
-#define MEMIF_MSG_ADD_RING_FLAG_S2M 1 /**< ring is in S2M direction */
+#define MEMIF_MSG_ADD_RING_FLAG_C2S 1 /**< ring is in C2S direction */
memif_ring_index_t index; /**< ring index */
memif_region_index_t region; /**< region index on which this ring is located */
memif_region_offset_t offset; /**< buffer start offset */
@@ -107,23 +107,23 @@ typedef struct __rte_packed {
} memif_msg_add_ring_t;
/**
- * S2M
+ * C2S
* Finalize connection establishment.
*/
typedef struct __rte_packed {
- uint8_t if_name[MEMIF_NAME_SZ]; /**< slave interface name */
+ uint8_t if_name[MEMIF_NAME_SZ]; /**< client interface name */
} memif_msg_connect_t;
/**
- * M2S
+ * S2C
* Finalize connection establishment.
*/
typedef struct __rte_packed {
- uint8_t if_name[MEMIF_NAME_SZ]; /**< master interface name */
+ uint8_t if_name[MEMIF_NAME_SZ]; /**< server interface name */
} memif_msg_connected_t;
/**
- * S2M & M2S
+ * C2S & S2C
* Disconnect interfaces.
*/
typedef struct __rte_packed {
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 67794cb6fa8c..b1475374910e 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -143,8 +143,8 @@ memif_msg_enq_hello(struct memif_control_channel *cc)
e->msg.type = MEMIF_MSG_TYPE_HELLO;
h->min_version = MEMIF_VERSION;
h->max_version = MEMIF_VERSION;
- h->max_s2m_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
- h->max_m2s_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
+ h->max_c2s_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
+ h->max_s2c_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
h->max_region = ETH_MEMIF_MAX_REGION_NUM - 1;
h->max_log2_ring_size = ETH_MEMIF_MAX_LOG2_RING_SIZE;
@@ -165,10 +165,10 @@ memif_msg_receive_hello(struct rte_eth_dev *dev, memif_msg_t *msg)
}
/* Set parameters for active connection */
- pmd->run.num_s2m_rings = RTE_MIN(h->max_s2m_ring + 1,
- pmd->cfg.num_s2m_rings);
- pmd->run.num_m2s_rings = RTE_MIN(h->max_m2s_ring + 1,
- pmd->cfg.num_m2s_rings);
+ pmd->run.num_c2s_rings = RTE_MIN(h->max_c2s_ring + 1,
+ pmd->cfg.num_c2s_rings);
+ pmd->run.num_s2c_rings = RTE_MIN(h->max_s2c_ring + 1,
+ pmd->cfg.num_s2c_rings);
pmd->run.log2_ring_size = RTE_MIN(h->max_log2_ring_size,
pmd->cfg.log2_ring_size);
pmd->run.pkt_buffer_size = pmd->cfg.pkt_buffer_size;
@@ -203,7 +203,7 @@ memif_msg_receive_init(struct memif_control_channel *cc, memif_msg_t *msg)
dev = elt->dev;
pmd = dev->data->dev_private;
if (((pmd->flags & ETH_MEMIF_FLAG_DISABLED) == 0) &&
- (pmd->id == i->id) && (pmd->role == MEMIF_ROLE_MASTER)) {
+ (pmd->id == i->id) && (pmd->role == MEMIF_ROLE_SERVER)) {
if (pmd->flags & (ETH_MEMIF_FLAG_CONNECTING |
ETH_MEMIF_FLAG_CONNECTED)) {
memif_msg_enq_disconnect(cc,
@@ -300,21 +300,21 @@ memif_msg_receive_add_ring(struct rte_eth_dev *dev, memif_msg_t *msg, int fd)
}
/* check if we have enough queues */
- if (ar->flags & MEMIF_MSG_ADD_RING_FLAG_S2M) {
- if (ar->index >= pmd->cfg.num_s2m_rings) {
+ if (ar->flags & MEMIF_MSG_ADD_RING_FLAG_C2S) {
+ if (ar->index >= pmd->cfg.num_c2s_rings) {
memif_msg_enq_disconnect(pmd->cc, "Invalid ring index", 0);
return -1;
}
- pmd->run.num_s2m_rings++;
+ pmd->run.num_c2s_rings++;
} else {
- if (ar->index >= pmd->cfg.num_m2s_rings) {
+ if (ar->index >= pmd->cfg.num_s2c_rings) {
memif_msg_enq_disconnect(pmd->cc, "Invalid ring index", 0);
return -1;
}
- pmd->run.num_m2s_rings++;
+ pmd->run.num_s2c_rings++;
}
- mq = (ar->flags & MEMIF_MSG_ADD_RING_FLAG_S2M) ?
+ mq = (ar->flags & MEMIF_MSG_ADD_RING_FLAG_C2S) ?
dev->data->rx_queues[ar->index] : dev->data->tx_queues[ar->index];
mq->intr_handle.fd = fd;
@@ -449,7 +449,7 @@ memif_msg_enq_add_ring(struct rte_eth_dev *dev, uint8_t idx,
return -1;
ar = &e->msg.add_ring;
- mq = (type == MEMIF_RING_S2M) ? dev->data->tx_queues[idx] :
+ mq = (type == MEMIF_RING_C2S) ? dev->data->tx_queues[idx] :
dev->data->rx_queues[idx];
e->msg.type = MEMIF_MSG_TYPE_ADD_RING;
@@ -458,7 +458,7 @@ memif_msg_enq_add_ring(struct rte_eth_dev *dev, uint8_t idx,
ar->offset = mq->ring_offset;
ar->region = mq->region;
ar->log2_ring_size = mq->log2_ring_size;
- ar->flags = (type == MEMIF_RING_S2M) ? MEMIF_MSG_ADD_RING_FLAG_S2M : 0;
+ ar->flags = (type == MEMIF_RING_C2S) ? MEMIF_MSG_ADD_RING_FLAG_C2S : 0;
ar->private_hdr_size = 0;
return 0;
@@ -575,8 +575,8 @@ memif_disconnect(struct rte_eth_dev *dev)
rte_spinlock_unlock(&pmd->cc_lock);
/* unconfig interrupts */
- for (i = 0; i < pmd->cfg.num_s2m_rings; i++) {
- if (pmd->role == MEMIF_ROLE_SLAVE) {
+ for (i = 0; i < pmd->cfg.num_c2s_rings; i++) {
+ if (pmd->role == MEMIF_ROLE_CLIENT) {
if (dev->data->tx_queues != NULL)
mq = dev->data->tx_queues[i];
else
@@ -592,8 +592,8 @@ memif_disconnect(struct rte_eth_dev *dev)
mq->intr_handle.fd = -1;
}
}
- for (i = 0; i < pmd->cfg.num_m2s_rings; i++) {
- if (pmd->role == MEMIF_ROLE_MASTER) {
+ for (i = 0; i < pmd->cfg.num_s2c_rings; i++) {
+ if (pmd->role == MEMIF_ROLE_SERVER) {
if (dev->data->tx_queues != NULL)
mq = dev->data->tx_queues[i];
else
@@ -616,7 +616,7 @@ memif_disconnect(struct rte_eth_dev *dev)
memset(&pmd->run, 0, sizeof(pmd->run));
MIF_LOG(DEBUG, "Disconnected, id: %d, role: %s.", pmd->id,
- (pmd->role == MEMIF_ROLE_MASTER) ? "master" : "slave");
+ (pmd->role == MEMIF_ROLE_SERVER) ? "server" : "client");
}
static int
@@ -694,15 +694,15 @@ memif_msg_receive(struct memif_control_channel *cc)
if (ret < 0)
goto exit;
}
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
ret = memif_msg_enq_add_ring(cc->dev, i,
- MEMIF_RING_S2M);
+ MEMIF_RING_C2S);
if (ret < 0)
goto exit;
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
ret = memif_msg_enq_add_ring(cc->dev, i,
- MEMIF_RING_M2S);
+ MEMIF_RING_S2C);
if (ret < 0)
goto exit;
}
@@ -963,7 +963,7 @@ memif_socket_init(struct rte_eth_dev *dev, const char *socket_filename)
ret = rte_hash_lookup_data(hash, key, (void **)&socket);
if (ret < 0) {
socket = memif_socket_create(key,
- (pmd->role == MEMIF_ROLE_SLAVE) ? 0 : 1);
+ (pmd->role == MEMIF_ROLE_CLIENT) ? 0 : 1);
if (socket == NULL)
return -1;
ret = rte_hash_add_key_data(hash, key, socket);
@@ -1039,7 +1039,7 @@ memif_socket_remove_device(struct rte_eth_dev *dev)
}
int
-memif_connect_master(struct rte_eth_dev *dev)
+memif_connect_server(struct rte_eth_dev *dev)
{
struct pmd_internals *pmd = dev->data->dev_private;
@@ -1050,7 +1050,7 @@ memif_connect_master(struct rte_eth_dev *dev)
}
int
-memif_connect_slave(struct rte_eth_dev *dev)
+memif_connect_client(struct rte_eth_dev *dev)
{
int sockfd;
int ret;
diff --git a/drivers/net/memif/memif_socket.h b/drivers/net/memif/memif_socket.h
index 5c49ec24ecbc..b9b8a151782f 100644
--- a/drivers/net/memif/memif_socket.h
+++ b/drivers/net/memif/memif_socket.h
@@ -60,7 +60,8 @@ void memif_disconnect(struct rte_eth_dev *dev);
* - On success, zero.
* - On failure, a negative value.
*/
-int memif_connect_master(struct rte_eth_dev *dev);
+int memif_connect_server(struct rte_eth_dev *dev);
+
/**
* If device is properly configured, send connection request.
@@ -71,7 +72,7 @@ int memif_connect_master(struct rte_eth_dev *dev);
* - On success, zero.
* - On failure, a negative value.
*/
-int memif_connect_slave(struct rte_eth_dev *dev);
+int memif_connect_client(struct rte_eth_dev *dev);
struct memif_socket_dev_list_elt {
TAILQ_ENTRY(memif_socket_dev_list_elt) next;
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index c1c7e9f8d8b6..83bfc316917a 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -132,7 +132,7 @@ memif_mp_request_regions(struct rte_eth_dev *dev)
struct memif_region *r;
struct pmd_process_private *proc_private = dev->process_private;
struct pmd_internals *pmd = dev->data->dev_private;
- /* in case of zero-copy slave, only request region 0 */
+ /* in case of zero-copy client, only request region 0 */
uint16_t max_region_num = (pmd->flags & ETH_MEMIF_FLAG_ZERO_COPY) ?
1 : ETH_MEMIF_MAX_REGION_NUM;
@@ -210,7 +210,7 @@ memif_get_ring(struct pmd_internals *pmd, struct pmd_process_private *proc_priva
int ring_size = sizeof(memif_ring_t) + sizeof(memif_desc_t) *
(1 << pmd->run.log2_ring_size);
- p = (uint8_t *)p + (ring_num + type * pmd->run.num_s2m_rings) * ring_size;
+ p = (uint8_t *)p + (ring_num + type * pmd->run.num_c2s_rings) * ring_size;
return (memif_ring_t *)p;
}
@@ -245,7 +245,7 @@ memif_get_buffer(struct pmd_process_private *proc_private, memif_desc_t *d)
return ((uint8_t *)proc_private->regions[d->region]->addr + d->offset);
}
-/* Free mbufs received by master */
+/* Free mbufs received by server */
static void
memif_free_stored_mbufs(struct pmd_process_private *proc_private, struct memif_queue *mq)
{
@@ -322,7 +322,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
ring_size = 1 << mq->log2_ring_size;
mask = ring_size - 1;
- if (type == MEMIF_RING_S2M) {
+ if (type == MEMIF_RING_C2S) {
cur_slot = mq->last_head;
last_slot = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE);
} else {
@@ -396,7 +396,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
no_free_bufs:
- if (type == MEMIF_RING_S2M) {
+ if (type == MEMIF_RING_C2S) {
__atomic_store_n(&ring->tail, cur_slot, __ATOMIC_RELEASE);
mq->last_head = cur_slot;
} else {
@@ -404,7 +404,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
refill:
- if (type == MEMIF_RING_M2S) {
+ if (type == MEMIF_RING_S2C) {
head = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE);
n_slots = ring_size - head + mq->last_tail;
@@ -499,7 +499,7 @@ eth_memif_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
mq->last_tail = cur_slot;
-/* Supply master with new buffers */
+/* Supply server with new buffers */
refill:
head = ring->head;
n_slots = ring_size - head + mq->last_tail;
@@ -571,7 +571,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
n_free = __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE) - mq->last_tail;
mq->last_tail += n_free;
- if (type == MEMIF_RING_S2M) {
+ if (type == MEMIF_RING_C2S) {
slot = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE);
n_free = ring_size - slot + mq->last_tail;
} else {
@@ -586,7 +586,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
saved_slot = slot;
d0 = &ring->desc[slot & mask];
dst_off = 0;
- dst_len = (type == MEMIF_RING_S2M) ?
+ dst_len = (type == MEMIF_RING_C2S) ?
pmd->run.pkt_buffer_size : d0->length;
next_in_chain:
@@ -601,7 +601,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
d0->flags |= MEMIF_DESC_FLAG_NEXT;
d0 = &ring->desc[slot & mask];
dst_off = 0;
- dst_len = (type == MEMIF_RING_S2M) ?
+ dst_len = (type == MEMIF_RING_C2S) ?
pmd->run.pkt_buffer_size : d0->length;
d0->flags = 0;
} else {
@@ -636,7 +636,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
no_free_slots:
- if (type == MEMIF_RING_S2M)
+ if (type == MEMIF_RING_C2S)
__atomic_store_n(&ring->head, slot, __ATOMIC_RELEASE);
else
__atomic_store_n(&ring->tail, slot, __ATOMIC_RELEASE);
@@ -666,7 +666,7 @@ memif_tx_one_zc(struct pmd_process_private *proc_private, struct memif_queue *mq
next_in_chain:
/* store pointer to mbuf to free it later */
mq->buffers[slot & mask] = mbuf;
- /* Increment refcnt to make sure the buffer is not freed before master
+ /* Increment refcnt to make sure the buffer is not freed before server
* receives it. (current segment)
*/
rte_mbuf_refcnt_update(mbuf, 1);
@@ -719,10 +719,10 @@ eth_memif_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
ring_size = 1 << mq->log2_ring_size;
mask = ring_size - 1;
- /* free mbufs received by master */
+ /* free mbufs received by server */
memif_free_stored_mbufs(proc_private, mq);
- /* ring type always MEMIF_RING_S2M */
+ /* ring type always MEMIF_RING_C2S */
slot = ring->head;
n_free = ring_size - ring->head + mq->last_tail;
@@ -780,7 +780,7 @@ eth_memif_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
no_free_slots:
rte_mb();
/* update ring pointers */
- if (type == MEMIF_RING_S2M)
+ if (type == MEMIF_RING_C2S)
ring->head = slot;
else
ring->tail = slot;
@@ -895,7 +895,7 @@ memif_region_init_shm(struct rte_eth_dev *dev, uint8_t has_buffers)
}
/* calculate buffer offset */
- r->pkt_buffer_offset = (pmd->run.num_s2m_rings + pmd->run.num_m2s_rings) *
+ r->pkt_buffer_offset = (pmd->run.num_c2s_rings + pmd->run.num_s2c_rings) *
(sizeof(memif_ring_t) + sizeof(memif_desc_t) *
(1 << pmd->run.log2_ring_size));
@@ -904,8 +904,8 @@ memif_region_init_shm(struct rte_eth_dev *dev, uint8_t has_buffers)
if (has_buffers == 1)
r->region_size += (uint32_t)(pmd->run.pkt_buffer_size *
(1 << pmd->run.log2_ring_size) *
- (pmd->run.num_s2m_rings +
- pmd->run.num_m2s_rings));
+ (pmd->run.num_c2s_rings +
+ pmd->run.num_s2c_rings));
memset(shm_name, 0, sizeof(char) * ETH_MEMIF_SHM_NAME_SIZE);
snprintf(shm_name, ETH_MEMIF_SHM_NAME_SIZE, "memif_region_%d",
@@ -990,8 +990,8 @@ memif_init_rings(struct rte_eth_dev *dev)
int i, j;
uint16_t slot;
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
- ring = memif_get_ring(pmd, proc_private, MEMIF_RING_S2M, i);
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
+ ring = memif_get_ring(pmd, proc_private, MEMIF_RING_C2S, i);
__atomic_store_n(&ring->head, 0, __ATOMIC_RELAXED);
__atomic_store_n(&ring->tail, 0, __ATOMIC_RELAXED);
ring->cookie = MEMIF_COOKIE;
@@ -1010,8 +1010,8 @@ memif_init_rings(struct rte_eth_dev *dev)
}
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
- ring = memif_get_ring(pmd, proc_private, MEMIF_RING_M2S, i);
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
+ ring = memif_get_ring(pmd, proc_private, MEMIF_RING_S2C, i);
__atomic_store_n(&ring->head, 0, __ATOMIC_RELAXED);
__atomic_store_n(&ring->tail, 0, __ATOMIC_RELAXED);
ring->cookie = MEMIF_COOKIE;
@@ -1021,7 +1021,7 @@ memif_init_rings(struct rte_eth_dev *dev)
continue;
for (j = 0; j < (1 << pmd->run.log2_ring_size); j++) {
- slot = (i + pmd->run.num_s2m_rings) *
+ slot = (i + pmd->run.num_c2s_rings) *
(1 << pmd->run.log2_ring_size) + j;
ring->desc[j].region = 0;
ring->desc[j].offset =
@@ -1032,7 +1032,7 @@ memif_init_rings(struct rte_eth_dev *dev)
}
}
-/* called only by slave */
+/* called only by client */
static int
memif_init_queues(struct rte_eth_dev *dev)
{
@@ -1040,12 +1040,12 @@ memif_init_queues(struct rte_eth_dev *dev)
struct memif_queue *mq;
int i;
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
mq = dev->data->tx_queues[i];
mq->log2_ring_size = pmd->run.log2_ring_size;
/* queues located only in region 0 */
mq->region = 0;
- mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_S2M, i);
+ mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_C2S, i);
mq->last_head = 0;
mq->last_tail = 0;
mq->intr_handle.fd = eventfd(0, EFD_NONBLOCK);
@@ -1063,12 +1063,12 @@ memif_init_queues(struct rte_eth_dev *dev)
}
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
mq = dev->data->rx_queues[i];
mq->log2_ring_size = pmd->run.log2_ring_size;
/* queues located only in region 0 */
mq->region = 0;
- mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_M2S, i);
+ mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_S2C, i);
mq->last_head = 0;
mq->last_tail = 0;
mq->intr_handle.fd = eventfd(0, EFD_NONBLOCK);
@@ -1140,8 +1140,8 @@ memif_connect(struct rte_eth_dev *dev)
}
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->tx_queues[i] : dev->data->rx_queues[i];
ring = memif_get_ring_from_queue(proc_private, mq);
if (ring == NULL || ring->cookie != MEMIF_COOKIE) {
@@ -1153,11 +1153,11 @@ memif_connect(struct rte_eth_dev *dev)
mq->last_head = 0;
mq->last_tail = 0;
/* enable polling mode */
- if (pmd->role == MEMIF_ROLE_MASTER)
+ if (pmd->role == MEMIF_ROLE_SERVER)
ring->flags = MEMIF_RING_FLAG_MASK_INT;
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->rx_queues[i] : dev->data->tx_queues[i];
ring = memif_get_ring_from_queue(proc_private, mq);
if (ring == NULL || ring->cookie != MEMIF_COOKIE) {
@@ -1169,7 +1169,7 @@ memif_connect(struct rte_eth_dev *dev)
mq->last_head = 0;
mq->last_tail = 0;
/* enable polling mode */
- if (pmd->role == MEMIF_ROLE_SLAVE)
+ if (pmd->role == MEMIF_ROLE_CLIENT)
ring->flags = MEMIF_RING_FLAG_MASK_INT;
}
@@ -1188,11 +1188,11 @@ memif_dev_start(struct rte_eth_dev *dev)
int ret = 0;
switch (pmd->role) {
- case MEMIF_ROLE_SLAVE:
- ret = memif_connect_slave(dev);
+ case MEMIF_ROLE_CLIENT:
+ ret = memif_connect_client(dev);
break;
- case MEMIF_ROLE_MASTER:
- ret = memif_connect_master(dev);
+ case MEMIF_ROLE_SERVER:
+ ret = memif_connect_server(dev);
break;
default:
MIF_LOG(ERR, "Unknown role: %d.", pmd->role);
@@ -1232,17 +1232,17 @@ memif_dev_configure(struct rte_eth_dev *dev)
struct pmd_internals *pmd = dev->data->dev_private;
/*
- * SLAVE - TXQ
- * MASTER - RXQ
+ * CLIENT - TXQ
+ * SERVER - RXQ
*/
- pmd->cfg.num_s2m_rings = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ pmd->cfg.num_c2s_rings = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->nb_tx_queues : dev->data->nb_rx_queues;
/*
- * SLAVE - RXQ
- * MASTER - TXQ
+ * CLIENT - RXQ
+ * SERVER - TXQ
*/
- pmd->cfg.num_m2s_rings = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ pmd->cfg.num_s2c_rings = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->nb_rx_queues : dev->data->nb_tx_queues;
return 0;
@@ -1265,7 +1265,7 @@ memif_tx_queue_setup(struct rte_eth_dev *dev,
}
mq->type =
- (pmd->role == MEMIF_ROLE_SLAVE) ? MEMIF_RING_S2M : MEMIF_RING_M2S;
+ (pmd->role == MEMIF_ROLE_CLIENT) ? MEMIF_RING_C2S : MEMIF_RING_S2C;
mq->n_pkts = 0;
mq->n_bytes = 0;
mq->intr_handle.fd = -1;
@@ -1293,7 +1293,7 @@ memif_rx_queue_setup(struct rte_eth_dev *dev,
return -ENOMEM;
}
- mq->type = (pmd->role == MEMIF_ROLE_SLAVE) ? MEMIF_RING_M2S : MEMIF_RING_S2M;
+ mq->type = (pmd->role == MEMIF_ROLE_CLIENT) ? MEMIF_RING_S2C : MEMIF_RING_C2S;
mq->n_pkts = 0;
mq->n_bytes = 0;
mq->intr_handle.fd = -1;
@@ -1348,8 +1348,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->opackets = 0;
stats->obytes = 0;
- tmp = (pmd->role == MEMIF_ROLE_SLAVE) ? pmd->run.num_s2m_rings :
- pmd->run.num_m2s_rings;
+ tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_c2s_rings :
+ pmd->run.num_s2c_rings;
nq = (tmp < RTE_ETHDEV_QUEUE_STAT_CNTRS) ? tmp :
RTE_ETHDEV_QUEUE_STAT_CNTRS;
@@ -1362,8 +1362,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->ibytes += mq->n_bytes;
}
- tmp = (pmd->role == MEMIF_ROLE_SLAVE) ? pmd->run.num_m2s_rings :
- pmd->run.num_s2m_rings;
+ tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_s2c_rings :
+ pmd->run.num_c2s_rings;
nq = (tmp < RTE_ETHDEV_QUEUE_STAT_CNTRS) ? tmp :
RTE_ETHDEV_QUEUE_STAT_CNTRS;
@@ -1385,14 +1385,14 @@ memif_stats_reset(struct rte_eth_dev *dev)
int i;
struct memif_queue *mq;
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ? dev->data->tx_queues[i] :
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ? dev->data->tx_queues[i] :
dev->data->rx_queues[i];
mq->n_pkts = 0;
mq->n_bytes = 0;
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ? dev->data->rx_queues[i] :
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ? dev->data->rx_queues[i] :
dev->data->tx_queues[i];
mq->n_pkts = 0;
mq->n_bytes = 0;
@@ -1473,8 +1473,8 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
pmd->flags = flags;
pmd->flags |= ETH_MEMIF_FLAG_DISABLED;
pmd->role = role;
- /* Zero-copy flag irelevant to master. */
- if (pmd->role == MEMIF_ROLE_MASTER)
+ /* Zero-copy flag irelevant to server. */
+ if (pmd->role == MEMIF_ROLE_SERVER)
pmd->flags &= ~ETH_MEMIF_FLAG_ZERO_COPY;
ret = memif_socket_init(eth_dev, socket_filename);
@@ -1487,8 +1487,8 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
pmd->cfg.log2_ring_size = log2_ring_size;
/* set in .dev_configure() */
- pmd->cfg.num_s2m_rings = 0;
- pmd->cfg.num_m2s_rings = 0;
+ pmd->cfg.num_c2s_rings = 0;
+ pmd->cfg.num_s2c_rings = 0;
pmd->cfg.pkt_buffer_size = pkt_buffer_size;
rte_spinlock_init(&pmd->cc_lock);
@@ -1523,11 +1523,17 @@ memif_set_role(const char *key __rte_unused, const char *value,
void *extra_args)
{
enum memif_role_t *role = (enum memif_role_t *)extra_args;
-
- if (strstr(value, "master") != NULL) {
- *role = MEMIF_ROLE_MASTER;
+
+ if (strstr(value, "server") != NULL) {
+ *role = MEMIF_ROLE_SERVER;
+ } else if (strstr(value, "client") != NULL) {
+ *role = MEMIF_ROLE_CLIENT;
+ } else if (strstr(value, "master") != NULL) {
+ MIF_LOG(NOTICE, "Role argument \"master\" is deprecated, use \"server\"");
+ *role = MEMIF_ROLE_SERVER;
} else if (strstr(value, "slave") != NULL) {
- *role = MEMIF_ROLE_SLAVE;
+ MIF_LOG(NOTICE, "Role argument \"slave\" is deprecated, use \"client\"");
+ *role = MEMIF_ROLE_CLIENT;
} else {
MIF_LOG(ERR, "Unknown role: %s.", value);
return -EINVAL;
@@ -1670,7 +1676,7 @@ rte_pmd_memif_probe(struct rte_vdev_device *vdev)
int ret = 0;
struct rte_kvargs *kvlist;
const char *name = rte_vdev_device_name(vdev);
- enum memif_role_t role = MEMIF_ROLE_SLAVE;
+ enum memif_role_t role = MEMIF_ROLE_CLIENT;
memif_interface_id_t id = 0;
uint16_t pkt_buffer_size = ETH_MEMIF_DEFAULT_PKT_BUFFER_SIZE;
memif_log2_ring_size_t log2_ring_size = ETH_MEMIF_DEFAULT_RING_SIZE;
@@ -1798,7 +1804,7 @@ RTE_PMD_REGISTER_VDEV(net_memif, pmd_memif_drv);
RTE_PMD_REGISTER_PARAM_STRING(net_memif,
ETH_MEMIF_ID_ARG "=<int>"
- ETH_MEMIF_ROLE_ARG "=master|slave"
+ ETH_MEMIF_ROLE_ARG "=server|client"
ETH_MEMIF_PKT_BUFFER_SIZE_ARG "=<int>"
ETH_MEMIF_RING_SIZE_ARG "=<int>"
ETH_MEMIF_SOCKET_ARG "=<string>"
diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h
index 6f45b7072c69..d45dfdd172b7 100644
--- a/drivers/net/memif/rte_eth_memif.h
+++ b/drivers/net/memif/rte_eth_memif.h
@@ -36,8 +36,8 @@ extern int memif_logtype;
"%s(): " fmt "\n", __func__, ##args)
enum memif_role_t {
- MEMIF_ROLE_MASTER,
- MEMIF_ROLE_SLAVE,
+ MEMIF_ROLE_SERVER,
+ MEMIF_ROLE_CLIENT,
};
struct memif_region {
@@ -64,8 +64,8 @@ struct memif_queue {
uint16_t last_tail; /**< last ring tail */
struct rte_mbuf **buffers;
- /**< Stored mbufs. Used in zero-copy tx. Slave stores transmitted
- * mbufs to free them once master has received them.
+ /**< Stored mbufs. Used in zero-copy tx. Client stores transmitted
+ * mbufs to free them once server has received them.
*/
/* rx/tx info */
@@ -102,15 +102,15 @@ struct pmd_internals {
struct {
memif_log2_ring_size_t log2_ring_size; /**< log2 of ring size */
- uint8_t num_s2m_rings; /**< number of slave to master rings */
- uint8_t num_m2s_rings; /**< number of master to slave rings */
+ uint8_t num_c2s_rings; /**< number of client to server rings */
+ uint8_t num_s2c_rings; /**< number of server to client rings */
uint16_t pkt_buffer_size; /**< buffer size */
} cfg; /**< Configured parameters (max values) */
struct {
memif_log2_ring_size_t log2_ring_size; /**< log2 of ring size */
- uint8_t num_s2m_rings; /**< number of slave to master rings */
- uint8_t num_m2s_rings; /**< number of master to slave rings */
+ uint8_t num_c2s_rings; /**< number of client to server rings */
+ uint8_t num_s2c_rings; /**< number of server to client rings */
uint16_t pkt_buffer_size; /**< buffer size */
} run;
/**< Parameters used in active connection */
@@ -137,7 +137,7 @@ void memif_free_regions(struct rte_eth_dev *dev);
/**
* Finalize connection establishment process. Map shared memory file
- * (master role), initialize ring queue, set link status up.
+ * (server role), initialize ring queue, set link status up.
*
* @param dev
* memif device
@@ -149,7 +149,7 @@ int memif_connect(struct rte_eth_dev *dev);
/**
* Create shared memory file and initialize ring queue.
- * Only called by slave when establishing connection
+ * Only called by client when establishing connection
*
* @param dev
* memif device
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 07/17] doc: replace master lcore with main lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (5 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 06/17] net/memif: replace master/slave arguments with server/client Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 08/17] app/test: replace uses of master/slave Stephen Hemminger
` (11 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Make sure that master lcore is not used in documentation.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/contributing/coding_style.rst | 2 +-
doc/guides/faq/faq.rst | 6 +++---
doc/guides/howto/debug_troubleshoot.rst | 2 +-
doc/guides/linux_gsg/eal_args.include.rst | 4 ++--
doc/guides/nics/bnxt.rst | 2 +-
doc/guides/prog_guide/env_abstraction_layer.rst | 6 +++---
.../prog_guide/event_ethernet_rx_adapter.rst | 2 +-
doc/guides/prog_guide/glossary.rst | 10 ++++++++--
doc/guides/sample_app_ug/bbdev_app.rst | 2 +-
doc/guides/sample_app_ug/ethtool.rst | 4 ++--
doc/guides/sample_app_ug/hello_world.rst | 10 +++++-----
doc/guides/sample_app_ug/ioat.rst | 14 +++++++-------
doc/guides/sample_app_ug/ip_pipeline.rst | 4 ++--
doc/guides/sample_app_ug/keep_alive.rst | 2 +-
doc/guides/sample_app_ug/l2_forward_event.rst | 4 ++--
.../sample_app_ug/l2_forward_real_virtual.rst | 5 ++---
doc/guides/sample_app_ug/l3_forward_graph.rst | 6 +++---
.../sample_app_ug/l3_forward_power_man.rst | 2 +-
doc/guides/sample_app_ug/link_status_intr.rst | 5 ++---
doc/guides/sample_app_ug/multi_process.rst | 6 +++---
doc/guides/sample_app_ug/packet_ordering.rst | 8 ++++----
doc/guides/sample_app_ug/performance_thread.rst | 6 +++---
doc/guides/sample_app_ug/ptpclient.rst | 2 +-
doc/guides/sample_app_ug/qos_scheduler.rst | 4 ++--
doc/guides/sample_app_ug/timer.rst | 16 ++++++++--------
doc/guides/testpmd_app_ug/run_app.rst | 2 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
27 files changed, 71 insertions(+), 67 deletions(-)
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 2c915fa38240..fb266e4b0b5a 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -362,7 +362,7 @@ For example:
typedef int (lcore_function_t)(void *);
/* launch a function of lcore_function_t type */
- int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned slave_id);
+ int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned worker_id);
C Indentation
diff --git a/doc/guides/faq/faq.rst b/doc/guides/faq/faq.rst
index bb1df7dc8a0f..ee8c1697b4ad 100644
--- a/doc/guides/faq/faq.rst
+++ b/doc/guides/faq/faq.rst
@@ -42,13 +42,13 @@ I am running a 32-bit DPDK application on a NUMA system, and sometimes the appli
If your system has a lot (>1 GB size) of hugepage memory, not all of it will be allocated.
Due to hugepages typically being allocated on a local NUMA node, the hugepages allocation the application gets during the initialization depends on which
NUMA node it is running on (the EAL does not affinitize cores until much later in the initialization process).
-Sometimes, the Linux OS runs the DPDK application on a core that is located on a different NUMA node from DPDK master core and
+Sometimes, the Linux OS runs the DPDK application on a core that is located on a different NUMA node from DPDK main core and
therefore all the hugepages are allocated on the wrong socket.
To avoid this scenario, either lower the amount of hugepage memory available to 1 GB size (or less), or run the application with taskset
-affinitizing the application to a would-be master core.
+affinitizing the application to a would-be main core.
-For example, if your EAL coremask is 0xff0, the master core will usually be the first core in the coremask (0x10); this is what you have to supply to taskset::
+For example, if your EAL coremask is 0xff0, the main core will usually be the first core in the coremask (0x10); this is what you have to supply to taskset::
taskset 0x10 ./l2fwd -l 4-11 -n 2
diff --git a/doc/guides/howto/debug_troubleshoot.rst b/doc/guides/howto/debug_troubleshoot.rst
index 5a46f5fba38a..29f2deac45be 100644
--- a/doc/guides/howto/debug_troubleshoot.rst
+++ b/doc/guides/howto/debug_troubleshoot.rst
@@ -312,7 +312,7 @@ Custom worker function :numref:`dtg_distributor_worker`.
cores.
* For high-performance execution logic ensure running it on correct NUMA
- and non-master core.
+ and worker core.
* Analyze run logic with ``rte_dump_stack``, ``rte_dump_registers`` and
``rte_memdump`` for more insights.
diff --git a/doc/guides/linux_gsg/eal_args.include.rst b/doc/guides/linux_gsg/eal_args.include.rst
index 0fe44579689b..957aeb235da8 100644
--- a/doc/guides/linux_gsg/eal_args.include.rst
+++ b/doc/guides/linux_gsg/eal_args.include.rst
@@ -33,9 +33,9 @@ Lcore-related options
At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can
be used.
-* ``--master-lcore <core ID>``
+* ``--main-lcore <core ID>``
- Core ID that is used as master.
+ Core ID that is used as main.
* ``-s <service core mask>``
diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst
index 129a16cfc757..b3950579e908 100644
--- a/doc/guides/nics/bnxt.rst
+++ b/doc/guides/nics/bnxt.rst
@@ -385,7 +385,7 @@ The application enables multiple TX and RX queues when it is started.
.. code-block:: console
- testpmd -l 1,3,5 --master-lcore 1 --txq=2 –rxq=2 --nb-cores=2
+ testpmd -l 1,3,5 --main-lcore 1 --txq=2 –rxq=2 --nb-cores=2
**TSS**
diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index f64ae953d106..764a0706caa7 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -64,7 +64,7 @@ It consist of calls to the pthread library (more specifically, pthread_self(), p
.. note::
Initialization of objects, such as memory zones, rings, memory pools, lpm tables and hash tables,
- should be done as part of the overall application initialization on the master lcore.
+ should be done as part of the overall application initialization on the main lcore.
The creation and initialization functions for these objects are not multi-thread safe.
However, once initialized, the objects themselves can safely be used in multiple threads simultaneously.
@@ -186,7 +186,7 @@ very dependent on the memory allocation patterns of the application.
Additional restrictions are present when running in 32-bit mode. In dynamic
memory mode, by default maximum of 2 gigabytes of VA space will be preallocated,
-and all of it will be on master lcore NUMA node unless ``--socket-mem`` flag is
+and all of it will be on main lcore NUMA node unless ``--socket-mem`` flag is
used.
In legacy mode, VA space will only be preallocated for segments that were
@@ -607,7 +607,7 @@ controlled with tools like taskset (Linux) or cpuset (FreeBSD),
- with affinity restricted to 2-4, the Control Threads will end up on
CPU 4.
- with affinity restricted to 2-3, the Control Threads will end up on
- CPU 2 (master lcore, which is the default when no CPU is available).
+ CPU 2 (main lcore, which is the default when no CPU is available).
.. _known_issue_label:
diff --git a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst
index c7dda92215ea..236f43f4557b 100644
--- a/doc/guides/prog_guide/event_ethernet_rx_adapter.rst
+++ b/doc/guides/prog_guide/event_ethernet_rx_adapter.rst
@@ -172,7 +172,7 @@ converts the received packets to events in the same manner as packets
received on a polled Rx queue. The interrupt thread is affinitized to the same
CPUs as the lcores of the Rx adapter service function, if the Rx adapter
service function has not been mapped to any lcores, the interrupt thread
-is mapped to the master lcore.
+is mapped to the main lcore.
Rx Callback for SW Rx Adapter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/guides/prog_guide/glossary.rst b/doc/guides/prog_guide/glossary.rst
index 21063a414729..7044a7df2ab9 100644
--- a/doc/guides/prog_guide/glossary.rst
+++ b/doc/guides/prog_guide/glossary.rst
@@ -124,10 +124,13 @@ LAN
LPM
Longest Prefix Match
-master lcore
+main lcore
The execution unit that executes the main() function and that launches
other lcores.
+master lcore
+ Deprecated name for *main lcore*. No longer used.
+
mbuf
An mbuf is a data structure used internally to carry messages (mainly
network packets). The name is derived from BSD stacks. To understand the
@@ -185,7 +188,7 @@ Rx
Reception
Slave lcore
- Any *lcore* that is not the *master lcore*.
+ Deprecated name for *worker lcore*. No longer used.
Socket
A physical CPU, that includes several *cores*.
@@ -237,6 +240,9 @@ VLAN
Wr
Write
+Worker lcore
+ Any *lcore* that is not the *main lcore*.
+
WRED
Weighted Random Early Detection
diff --git a/doc/guides/sample_app_ug/bbdev_app.rst b/doc/guides/sample_app_ug/bbdev_app.rst
index 405e706a46e4..54ff6574aed8 100644
--- a/doc/guides/sample_app_ug/bbdev_app.rst
+++ b/doc/guides/sample_app_ug/bbdev_app.rst
@@ -94,7 +94,7 @@ device gets linked to a corresponding ethernet port as whitelisted by
the parameter -w.
3 cores are allocated to the application, and assigned as:
- - core 3 is the master and used to print the stats live on screen,
+ - core 3 is the main and used to print the stats live on screen,
- core 4 is the encoding lcore performing Rx and Turbo Encode operations
diff --git a/doc/guides/sample_app_ug/ethtool.rst b/doc/guides/sample_app_ug/ethtool.rst
index 253004dd0082..23258d794cf4 100644
--- a/doc/guides/sample_app_ug/ethtool.rst
+++ b/doc/guides/sample_app_ug/ethtool.rst
@@ -64,8 +64,8 @@ Explanation
-----------
The sample program has two parts: A background `packet reflector`_
-that runs on a slave core, and a foreground `Ethtool Shell`_ that
-runs on the master core. These are described below.
+that runs on a worker core, and a foreground `Ethtool Shell`_ that
+runs on the main core. These are described below.
Packet Reflector
~~~~~~~~~~~~~~~~
diff --git a/doc/guides/sample_app_ug/hello_world.rst b/doc/guides/sample_app_ug/hello_world.rst
index 46f997a7dce3..4d5e41c5cb38 100644
--- a/doc/guides/sample_app_ug/hello_world.rst
+++ b/doc/guides/sample_app_ug/hello_world.rst
@@ -1,4 +1,4 @@
-.. SPDX-License-Identifier: BSD-3-Clause
+o.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2010-2014 Intel Corporation.
Hello World Sample Application
@@ -75,13 +75,13 @@ The code that launches the function on each lcore is as follows:
.. code-block:: c
- /* call lcore_hello() on every slave lcore */
+ /* call lcore_hello() on every worker lcore */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(lcore_hello, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
lcore_hello(NULL);
@@ -89,6 +89,6 @@ The following code is equivalent and simpler:
.. code-block:: c
- rte_eal_mp_remote_launch(lcore_hello, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lcore_hello, NULL, CALL_MAIN);
Refer to the *DPDK API Reference* for detailed information on the rte_eal_mp_remote_launch() function.
diff --git a/doc/guides/sample_app_ug/ioat.rst b/doc/guides/sample_app_ug/ioat.rst
index 3f7d5c34a6c8..bd21ea3abce6 100644
--- a/doc/guides/sample_app_ug/ioat.rst
+++ b/doc/guides/sample_app_ug/ioat.rst
@@ -69,13 +69,13 @@ provided parameters. The app can use up to 2 lcores: one of them receives
incoming traffic and makes a copy of each packet. The second lcore then
updates MAC address and sends the copy. If one lcore per port is used,
both operations are done sequentially. For each configuration an additional
-lcore is needed since the master lcore does not handle traffic but is
+lcore is needed since the main lcore does not handle traffic but is
responsible for configuration, statistics printing and safe shutdown of
all ports and devices.
The application can use a maximum of 8 ports.
-To run the application in a Linux environment with 3 lcores (the master lcore,
+To run the application in a Linux environment with 3 lcores (the main lcore,
plus two forwarding cores), a single port (port 0), software copying and MAC
updating issue the command:
@@ -83,7 +83,7 @@ updating issue the command:
$ ./build/ioatfwd -l 0-2 -n 2 -- -p 0x1 --mac-updating -c sw
-To run the application in a Linux environment with 2 lcores (the master lcore,
+To run the application in a Linux environment with 2 lcores (the main lcore,
plus one forwarding core), 2 ports (ports 0 and 1), hardware copying and no MAC
updating issue the command:
@@ -208,7 +208,7 @@ After that each port application assigns resources needed.
cfg.nb_lcores = rte_lcore_count() - 1;
if (cfg.nb_lcores < 1)
rte_exit(EXIT_FAILURE,
- "There should be at least one slave lcore.\n");
+ "There should be at least one worker lcore.\n");
ret = 0;
@@ -310,9 +310,9 @@ If initialization is successful, memory for hardware device
statistics is allocated.
Finally ``main()`` function starts all packet handling lcores and starts
-printing stats in a loop on the master lcore. The application can be
-interrupted and closed using ``Ctrl-C``. The master lcore waits for
-all slave processes to finish, deallocates resources and exits.
+printing stats in a loop on the main lcore. The application can be
+interrupted and closed using ``Ctrl-C``. The main lcore waits for
+all worker lcores to finish, deallocates resources and exits.
The processing lcores launching function are described below.
diff --git a/doc/guides/sample_app_ug/ip_pipeline.rst b/doc/guides/sample_app_ug/ip_pipeline.rst
index 56014be17458..7e3643cb53a4 100644
--- a/doc/guides/sample_app_ug/ip_pipeline.rst
+++ b/doc/guides/sample_app_ug/ip_pipeline.rst
@@ -122,7 +122,7 @@ is displayed and the application is terminated.
Run-time
~~~~~~~~
-The master thread is creating and managing all the application objects based on CLI input.
+The main thread is creating and managing all the application objects based on CLI input.
Each data plane thread runs one or several pipelines previously assigned to it in round-robin order. Each data plane thread
executes two tasks in time-sharing mode:
@@ -130,7 +130,7 @@ executes two tasks in time-sharing mode:
1. *Packet processing task*: Process bursts of input packets read from the pipeline input ports.
2. *Message handling task*: Periodically, the data plane thread pauses the packet processing task and polls for request
- messages send by the master thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules
+ messages send by the main thread. Examples: add/remove pipeline to/from current data plane thread, add/delete rules
to/from given table of a specific pipeline owned by the current data plane thread, read statistics, etc.
Examples
diff --git a/doc/guides/sample_app_ug/keep_alive.rst b/doc/guides/sample_app_ug/keep_alive.rst
index 865ba69e5c47..6e5716aaba24 100644
--- a/doc/guides/sample_app_ug/keep_alive.rst
+++ b/doc/guides/sample_app_ug/keep_alive.rst
@@ -16,7 +16,7 @@ Overview
--------
The application demonstrates how to protect against 'silent outages'
-on packet processing cores. A Keep Alive Monitor Agent Core (master)
+on packet processing cores. A Keep Alive Monitor Agent Core (main)
monitors the state of packet processing cores (worker cores) by
dispatching pings at a regular time interval (default is 5ms) and
monitoring the state of the cores. Cores states are: Alive, MIA, Dead
diff --git a/doc/guides/sample_app_ug/l2_forward_event.rst b/doc/guides/sample_app_ug/l2_forward_event.rst
index d536eee819d0..34c53a36cfe9 100644
--- a/doc/guides/sample_app_ug/l2_forward_event.rst
+++ b/doc/guides/sample_app_ug/l2_forward_event.rst
@@ -630,8 +630,8 @@ not many packets to send, however it improves performance:
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= timer_period)) {
- /* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
timer_tsc = 0;
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index c0e8488e7987..f3be6cf03c44 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -453,9 +453,8 @@ however it improves performance:
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
- /* do this only on master core */
-
- if (lcore_id == rte_get_master_lcore()) {
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
diff --git a/doc/guides/sample_app_ug/l3_forward_graph.rst b/doc/guides/sample_app_ug/l3_forward_graph.rst
index df50827bab86..4ac96fc0c2f7 100644
--- a/doc/guides/sample_app_ug/l3_forward_graph.rst
+++ b/doc/guides/sample_app_ug/l3_forward_graph.rst
@@ -22,7 +22,7 @@ Run-time path is main thing that differs from L3 forwarding sample application.
Difference is that forwarding logic starting from Rx, followed by LPM lookup,
TTL update and finally Tx is implemented inside graph nodes. These nodes are
interconnected in graph framework. Application main loop needs to walk over
-graph using ``rte_graph_walk()`` with graph objects created one per slave lcore.
+graph using ``rte_graph_walk()`` with graph objects created one per worker lcore.
The lookup method is as per implementation of ``ip4_lookup`` graph node.
The ID of the output interface for the input packet is the next hop returned by
@@ -265,7 +265,7 @@ headers will be provided run-time using ``rte_node_ip4_route_add()`` and
Since currently ``ip4_lookup`` and ``ip4_rewrite`` nodes don't support
lock-less mechanisms(RCU, etc) to add run-time forwarding data like route and
rewrite data, forwarding data is added before packet processing loop is
- launched on slave lcore.
+ launched on worker lcore.
.. code-block:: c
@@ -297,7 +297,7 @@ Packet Forwarding using Graph Walk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now that all the device configurations are done, graph creations are done and
-forwarding data is updated with nodes, slave lcores will be launched with graph
+forwarding data is updated with nodes, worker lcores will be launched with graph
main loop. Graph main loop is very simple in the sense that it needs to
continuously call a non-blocking API ``rte_graph_walk()`` with it's lcore
specific graph object that was already created.
diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst
index 0cc6f2e62e75..f05816d9b24e 100644
--- a/doc/guides/sample_app_ug/l3_forward_power_man.rst
+++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst
@@ -441,7 +441,7 @@ The telemetry mode support for ``l3fwd-power`` is a standalone mode, in this mod
``l3fwd-power`` does simple l3fwding along with calculating empty polls, full polls,
and busy percentage for each forwarding core. The aggregation of these
values of all cores is reported as application level telemetry to metric
-library for every 500ms from the master core.
+library for every 500ms from the main core.
The busy percentage is calculated by recording the poll_count
and when the count reaches a defined value the total
diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
index 04c40f28540d..61f021279918 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -401,9 +401,8 @@ However, it improves performance:
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
- /* do this only on master core */
-
- if (lcore_id == rte_get_master_lcore()) {
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
diff --git a/doc/guides/sample_app_ug/multi_process.rst b/doc/guides/sample_app_ug/multi_process.rst
index f2a79a639763..e0a10544fa71 100644
--- a/doc/guides/sample_app_ug/multi_process.rst
+++ b/doc/guides/sample_app_ug/multi_process.rst
@@ -66,7 +66,7 @@ The process should start successfully and display a command prompt as follows:
EAL: check igb_uio module
EAL: check module finished
- EAL: Master core 0 is ready (tid=54e41820)
+ EAL: Main core 0 is ready (tid=54e41820)
EAL: Core 1 is ready (tid=53b32700)
Starting core 1
@@ -92,7 +92,7 @@ At any stage, either process can be terminated using the quit command.
.. code-block:: console
- EAL: Master core 10 is ready (tid=b5f89820) EAL: Master core 8 is ready (tid=864a3820)
+ EAL: Main core 10 is ready (tid=b5f89820) EAL: Main core 8 is ready (tid=864a3820)
EAL: Core 11 is ready (tid=84ffe700) EAL: Core 9 is ready (tid=85995700)
Starting core 11 Starting core 9
simple_mp > send hello_secondary simple_mp > core 9: Received 'hello_secondary'
@@ -273,7 +273,7 @@ In addition to the EAL parameters, the application- specific parameters are:
.. note::
- In the server process, a single thread, the master thread, that is, the lowest numbered lcore in the coremask/corelist, performs all packet I/O.
+ In the server process, a single thread, the main thread, that is, the lowest numbered lcore in the coremask/corelist, performs all packet I/O.
If a coremask/corelist is specified with more than a single lcore bit set in it,
an additional lcore will be used for a thread to periodically print packet count statistics.
diff --git a/doc/guides/sample_app_ug/packet_ordering.rst b/doc/guides/sample_app_ug/packet_ordering.rst
index 1c8ee5d04071..e3e844328b44 100644
--- a/doc/guides/sample_app_ug/packet_ordering.rst
+++ b/doc/guides/sample_app_ug/packet_ordering.rst
@@ -12,14 +12,14 @@ Overview
The application uses at least three CPU cores:
-* RX core (maser core) receives traffic from the NIC ports and feeds Worker
+* RX core (main core) receives traffic from the NIC ports and feeds Worker
cores with traffic through SW queues.
-* Worker core (slave core) basically do some light work on the packet.
+* Worker (worker core) basically do some light work on the packet.
Currently it modifies the output port of the packet for configurations with
more than one port enabled.
-* TX Core (slave core) receives traffic from Worker cores through software queues,
+* TX Core (worker core) receives traffic from Worker cores through software queues,
inserts out-of-order packets into reorder buffer, extracts ordered packets
from the reorder buffer and sends them to the NIC ports for transmission.
@@ -46,7 +46,7 @@ The application execution command line is:
./packet_ordering [EAL options] -- -p PORTMASK [--disable-reorder] [--insight-worker]
The -c EAL CPU_COREMASK option has to contain at least 3 CPU cores.
-The first CPU core in the core mask is the master core and would be assigned to
+The first CPU core in the core mask is the main core and would be assigned to
RX core, the last to TX core and the rest to Worker cores.
The PORTMASK parameter must contain either 1 or even enabled port numbers.
diff --git a/doc/guides/sample_app_ug/performance_thread.rst b/doc/guides/sample_app_ug/performance_thread.rst
index b04d0ba444af..b1e6e7627ee9 100644
--- a/doc/guides/sample_app_ug/performance_thread.rst
+++ b/doc/guides/sample_app_ug/performance_thread.rst
@@ -280,8 +280,8 @@ functionality into different threads, and the pairs of RX and TX threads are
interconnected via software rings.
On initialization an L-thread scheduler is started on every EAL thread. On all
-but the master EAL thread only a dummy L-thread is initially started.
-The L-thread started on the master EAL thread then spawns other L-threads on
+but the main EAL thread only a dummy L-thread is initially started.
+The L-thread started on the main EAL thread then spawns other L-threads on
different L-thread schedulers according the command line parameters.
The RX threads poll the network interface queues and post received packets
@@ -1217,5 +1217,5 @@ Setting ``LTHREAD_DIAG`` also enables counting of statistics about cache and
queue usage, and these statistics can be displayed by calling the function
``lthread_diag_stats_display()``. This function also performs a consistency
check on the caches and queues. The function should only be called from the
-master EAL thread after all slave threads have stopped and returned to the C
+main EAL thread after all slave threads have stopped and returned to the C
main program, otherwise the consistency check will fail.
diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst
index 12b4f13d5bd8..5b51c8526c5a 100644
--- a/doc/guides/sample_app_ug/ptpclient.rst
+++ b/doc/guides/sample_app_ug/ptpclient.rst
@@ -21,7 +21,7 @@ The PTP sample application is intended as a simple reference implementation of
a PTP client using the DPDK IEEE1588 API.
In order to keep the application simple the following assumptions are made:
-* The first discovered master is the master for the session.
+* The first discovered master is the main for the session.
* Only L2 PTP packets are supported.
* Only the PTP v2 protocol is supported.
* Only the slave clock is implemented.
diff --git a/doc/guides/sample_app_ug/qos_scheduler.rst b/doc/guides/sample_app_ug/qos_scheduler.rst
index b5010657a7d8..922931612cee 100644
--- a/doc/guides/sample_app_ug/qos_scheduler.rst
+++ b/doc/guides/sample_app_ug/qos_scheduler.rst
@@ -71,7 +71,7 @@ Optional application parameters include:
In this mode, the application shows a command line that can be used for obtaining statistics while
scheduling is taking place (see interactive mode below for more information).
-* --mst n: Master core index (the default value is 1).
+* --mnc n: Main core index (the default value is 1).
* --rsz "A, B, C": Ring sizes:
@@ -329,7 +329,7 @@ Another example with 2 packet flow configurations using different ports but shar
Note that independent cores for the packet flow configurations for each of the RX, WT and TX thread are also supported,
providing flexibility to balance the work.
-The EAL coremask/corelist is constrained to contain the default mastercore 1 and the RX, WT and TX cores only.
+The EAL coremask/corelist is constrained to contain the default main core 1 and the RX, WT and TX cores only.
Explanation
-----------
diff --git a/doc/guides/sample_app_ug/timer.rst b/doc/guides/sample_app_ug/timer.rst
index 98d762d2388c..c572db580034 100644
--- a/doc/guides/sample_app_ug/timer.rst
+++ b/doc/guides/sample_app_ug/timer.rst
@@ -48,18 +48,18 @@ In addition to EAL initialization, the timer subsystem must be initialized, by c
rte_timer_subsystem_init();
-After timer creation (see the next paragraph),
-the main loop is executed on each slave lcore using the well-known rte_eal_remote_launch() and also on the master.
+After timer creation (see the next paragraph), the main loop is
+executed on each worker lcore using the well-known
+rte_eal_remote_launch() and also on the main.
.. code-block:: c
- /* call lcore_mainloop() on every slave lcore */
-
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ /* call lcore_mainloop() on every worker lcore */
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(lcore_mainloop, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
(void) lcore_mainloop(NULL);
@@ -105,7 +105,7 @@ This call to rte_timer_init() is necessary before doing any other operation on t
Then, the two timers are configured:
-* The first timer (timer0) is loaded on the master lcore and expires every second.
+* The first timer (timer0) is loaded on the main lcore and expires every second.
Since the PERIODICAL flag is provided, the timer is reloaded automatically by the timer subsystem.
The callback function is timer0_cb().
@@ -115,7 +115,7 @@ Then, the two timers are configured:
.. code-block:: c
- /* load timer0, every second, on master lcore, reloaded automatically */
+ /* load timer0, every second, on main lcore, reloaded automatically */
hz = rte_get_hpet_hz();
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index d1e4ee3e7a46..b080cd9532ba 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -71,7 +71,7 @@ The command line options are:
* ``--coremask=0xXX``
Set the hexadecimal bitmask of the cores running the packet forwarding test.
- The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
+ The main lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
* ``--portmask=0xXX``
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 90cf252df58f..01682508b592 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -699,7 +699,7 @@ This is equivalent to the ``--coremask`` command-line option.
.. note::
- The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
+ The main lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
set portmask
~~~~~~~~~~~~
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 08/17] app/test: replace uses of master/slave
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (6 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 07/17] doc: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 09/17] app/test-pmd: replace master lcore with main lcore Stephen Hemminger
` (10 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Replace master lcore with main lcore and slave lcore with worker lcore.
Mostly automatic replacement.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/autotest_test_funcs.py | 2 +-
app/test/meson.build | 2 +-
app/test/test.c | 2 +-
app/test/test_atomic.c | 26 +++---
app/test/test_barrier.c | 2 +-
app/test/test_compressdev_test_buffer.h | 2 +-
app/test/test_cryptodev.c | 16 ++--
app/test/test_distributor.c | 8 +-
app/test/test_distributor_perf.c | 10 +--
app/test/test_eal_flags.c | 32 +++----
app/test/test_efd.c | 2 +-
app/test/test_efd_perf.c | 2 +-
app/test/test_func_reentrancy.c | 20 ++---
app/test/test_hash_multiwriter.c | 4 +-
app/test/test_hash_readwrite.c | 39 +++++----
app/test/test_kni.c | 16 ++--
app/test/test_lpm_perf.c | 4 +-
app/test/test_malloc.c | 12 +--
app/test/test_mbuf.c | 33 ++++---
app/test/test_mcslock.c | 28 +++---
app/test/test_mempool_perf.c | 10 +--
app/test/test_mp_secondary.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/test_per_lcore.c | 14 +--
app/test/test_pmd_perf.c | 20 ++---
app/test/test_rcu_qsbr.c | 2 +-
app/test/test_rcu_qsbr_perf.c | 2 +-
app/test/test_ring_perf.c | 14 +--
app/test/test_ring_stress_impl.h | 10 +--
app/test/test_rwlock.c | 28 +++---
app/test/test_service_cores.c | 14 +--
app/test/test_spinlock.c | 34 ++++----
app/test/test_stack.c | 2 +-
app/test/test_stack_perf.c | 6 +-
app/test/test_ticketlock.c | 36 ++++----
app/test/test_timer.c | 109 ++++++++++++------------
app/test/test_timer_racecond.c | 26 +++---
app/test/test_timer_secondary.c | 8 +-
app/test/test_trace_perf.c | 4 +-
39 files changed, 302 insertions(+), 303 deletions(-)
diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py
index 26688b71323e..573bca089997 100644
--- a/app/test/autotest_test_funcs.py
+++ b/app/test/autotest_test_funcs.py
@@ -102,7 +102,7 @@ def rwlock_autotest(child, test_name):
index = child.expect(["Test OK",
"Test Failed",
"Hello from core ([0-9]*) !",
- "Global write lock taken on master "
+ "Global write lock taken on main "
"core ([0-9]*)",
pexpect.TIMEOUT], timeout=10)
# ok
diff --git a/app/test/meson.build b/app/test/meson.build
index 786a21397272..b4bb30a6416a 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -187,7 +187,7 @@ fast_tests = [
['cycles_autotest', true],
['debug_autotest', true],
['eal_flags_c_opt_autotest', false],
- ['eal_flags_master_opt_autotest', false],
+ ['eal_flags_main_opt_autotest', false],
['eal_flags_n_opt_autotest', false],
['eal_flags_hpet_autotest', false],
['eal_flags_no_huge_autotest', false],
diff --git a/app/test/test.c b/app/test/test.c
index 94d26ab1f67c..3b3d172c91fa 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -58,7 +58,7 @@ do_recursive_call(void)
#endif
#endif
{ "test_missing_c_flag", no_action },
- { "test_master_lcore_flag", no_action },
+ { "test_main_lcore_flag", no_action },
{ "test_invalid_n_flag", no_action },
{ "test_no_hpet_flag", no_action },
{ "test_whitelist_flag", no_action },
diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index 214452e54399..f10f555af8b4 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -456,7 +456,7 @@ test_atomic(void)
printf("usual inc/dec/add/sub functions\n");
- rte_eal_mp_remote_launch(test_atomic_usual, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_usual, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
@@ -482,7 +482,7 @@ test_atomic(void)
rte_atomic32_set(&a32, 0);
rte_atomic16_set(&a16, 0);
rte_atomic64_set(&count, 0);
- rte_eal_mp_remote_launch(test_atomic_tas, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_tas, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
@@ -499,7 +499,7 @@ test_atomic(void)
rte_atomic16_set(&a16, 0);
rte_atomic64_set(&count, 0);
rte_eal_mp_remote_launch(test_atomic_addsub_and_return, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_set(&synchro, 0);
@@ -510,8 +510,8 @@ test_atomic(void)
}
/*
- * Set a64, a32 and a16 with the same value of minus "number of slave
- * lcores", launch all slave lcores to atomically increase by one and
+ * Set a64, a32 and a16 with the same value of minus "number of worker
+ * lcores", launch all worker lcores to atomically increase by one and
* test them respectively.
* Each lcore should have only one chance to increase a64 by one and
* then check if it is equal to 0, but there should be only one lcore
@@ -519,7 +519,7 @@ test_atomic(void)
* Then a variable of "count", initialized to zero, is increased by
* one if a64, a32 or a16 is 0 after being increased and tested
* atomically.
- * We can check if "count" is finally equal to 3 to see if all slave
+ * We can check if "count" is finally equal to 3 to see if all worker
* lcores performed "atomic inc and test" right.
*/
printf("inc and test\n");
@@ -533,7 +533,7 @@ test_atomic(void)
rte_atomic64_set(&a64, (int64_t)(1 - (int64_t)rte_lcore_count()));
rte_atomic32_set(&a32, (int32_t)(1 - (int32_t)rte_lcore_count()));
rte_atomic16_set(&a16, (int16_t)(1 - (int16_t)rte_lcore_count()));
- rte_eal_mp_remote_launch(test_atomic_inc_and_test, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_inc_and_test, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
@@ -544,7 +544,7 @@ test_atomic(void)
}
/*
- * Same as above, but this time we set the values to "number of slave
+ * Same as above, but this time we set the values to "number of worker
* lcores", and decrement instead of increment.
*/
printf("dec and test\n");
@@ -555,7 +555,7 @@ test_atomic(void)
rte_atomic64_set(&a64, (int64_t)(rte_lcore_count() - 1));
rte_atomic32_set(&a32, (int32_t)(rte_lcore_count() - 1));
rte_atomic16_set(&a16, (int16_t)(rte_lcore_count() - 1));
- rte_eal_mp_remote_launch(test_atomic_dec_and_test, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_dec_and_test, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
@@ -569,10 +569,10 @@ test_atomic(void)
/*
* This case tests the functionality of rte_atomic128_cmp_exchange
* API. It calls rte_atomic128_cmp_exchange with four kinds of memory
- * models successively on each slave core. Once each 128-bit atomic
+ * models successively on each worker core. Once each 128-bit atomic
* compare and swap operation is successful, it updates the global
* 128-bit counter by 2 for the first 64-bit and 1 for the second
- * 64-bit. Each slave core iterates this test N times.
+ * 64-bit. Each worker core iterates this test N times.
* At the end of test, verify whether the first 64-bits of the 128-bit
* counter and the second 64bits is differ by the total iterations. If
* it is, the test passes.
@@ -585,7 +585,7 @@ test_atomic(void)
count128.val[1] = 0;
rte_eal_mp_remote_launch(test_atomic128_cmp_exchange, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
@@ -619,7 +619,7 @@ test_atomic(void)
token64 = ((uint64_t)get_crc8(&t.u8[0], sizeof(token64) - 1) << 56)
| (t.u64 & 0x00ffffffffffffff);
- rte_eal_mp_remote_launch(test_atomic_exchange, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_atomic_exchange, NULL, SKIP_MAIN);
rte_atomic32_set(&synchro, 1);
rte_eal_mp_wait_lcore();
rte_atomic32_clear(&synchro);
diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c
index 43b5f6232c6d..c27f8a0742f2 100644
--- a/app/test/test_barrier.c
+++ b/app/test/test_barrier.c
@@ -236,7 +236,7 @@ plock_test(uint64_t iter, enum plock_use_type utype)
/* test phase - start and wait for completion on each active lcore */
- rte_eal_mp_remote_launch(plock_test1_lcore, lpt, CALL_MASTER);
+ rte_eal_mp_remote_launch(plock_test1_lcore, lpt, CALL_MAIN);
rte_eal_mp_wait_lcore();
/* validation phase - make sure that shared and local data match */
diff --git a/app/test/test_compressdev_test_buffer.h b/app/test/test_compressdev_test_buffer.h
index 4a16ade150aa..b09a7e99688f 100644
--- a/app/test/test_compressdev_test_buffer.h
+++ b/app/test/test_compressdev_test_buffer.h
@@ -190,7 +190,7 @@ static const char test_buf_shakespeare[] =
" servitude: I will no longer endure it, though yet I\n"
" know no wise remedy how to avoid it.\n"
"\n"
- "ADAM Yonder comes my master, your brother.\n"
+ "ADAM Yonder comes my main, your brother.\n"
"\n"
"ORLANDO Go apart, Adam, and thou shalt hear how he will\n";
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 70bf6fe2c1a6..161030a31a7b 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -479,29 +479,29 @@ testsuite_setup(void)
char vdev_args[VDEV_ARGS_SIZE] = {""};
char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
"ordering=enable,name=cryptodev_test_scheduler,corelist="};
- uint16_t slave_core_count = 0;
+ uint16_t worker_core_count = 0;
uint16_t socket_id = 0;
if (gbl_driver_id == rte_cryptodev_driver_id_get(
RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
- /* Identify the Slave Cores
- * Use 2 slave cores for the device args
+ /* Identify the Worker Cores
+ * Use 2 worker cores for the device args
*/
- RTE_LCORE_FOREACH_SLAVE(i) {
- if (slave_core_count > 1)
+ RTE_LCORE_FOREACH_WORKER(i) {
+ if (worker_core_count > 1)
break;
snprintf(vdev_args, sizeof(vdev_args),
"%s%d", temp_str, i);
strcpy(temp_str, vdev_args);
strlcat(temp_str, ";", sizeof(temp_str));
- slave_core_count++;
+ worker_core_count++;
socket_id = rte_lcore_to_socket_id(i);
}
- if (slave_core_count != 2) {
+ if (worker_core_count != 2) {
RTE_LOG(ERR, USER1,
"Cryptodev scheduler test require at least "
- "two slave cores to run. "
+ "two worker cores to run. "
"Please use the correct coremask.\n");
return TEST_FAILED;
}
diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index ba1f81cf8d19..19aa9f90e501 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -654,13 +654,13 @@ test_distributor(void)
sizeof(worker_params.name));
rte_eal_mp_remote_launch(handle_work,
- &worker_params, SKIP_MASTER);
+ &worker_params, SKIP_MAIN);
if (sanity_test(&worker_params, p) < 0)
goto err;
quit_workers(&worker_params, p);
rte_eal_mp_remote_launch(handle_work_with_free_mbufs,
- &worker_params, SKIP_MASTER);
+ &worker_params, SKIP_MAIN);
if (sanity_test_with_mbuf_alloc(&worker_params, p) < 0)
goto err;
quit_workers(&worker_params, p);
@@ -668,7 +668,7 @@ test_distributor(void)
if (rte_lcore_count() > 2) {
rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
&worker_params,
- SKIP_MASTER);
+ SKIP_MAIN);
if (sanity_test_with_worker_shutdown(&worker_params,
p) < 0)
goto err;
@@ -676,7 +676,7 @@ test_distributor(void)
rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
&worker_params,
- SKIP_MASTER);
+ SKIP_MAIN);
if (test_flush_with_worker_shutdown(&worker_params,
p) < 0)
goto err;
diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c
index f153bcf9bd87..b25f79a3486c 100644
--- a/app/test/test_distributor_perf.c
+++ b/app/test/test_distributor_perf.c
@@ -54,10 +54,10 @@ time_cache_line_switch(void)
/* allocate a full cache line for data, we use only first byte of it */
uint64_t data[RTE_CACHE_LINE_SIZE*3 / sizeof(uint64_t)];
- unsigned i, slaveid = rte_get_next_lcore(rte_lcore_id(), 0, 0);
+ unsigned int i, workerid = rte_get_next_lcore(rte_lcore_id(), 0, 0);
volatile uint64_t *pdata = &data[0];
*pdata = 1;
- rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0], slaveid);
+ rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0], workerid);
while (*pdata)
rte_pause();
@@ -72,7 +72,7 @@ time_cache_line_switch(void)
while (*pdata)
rte_pause();
*pdata = 2;
- rte_eal_wait_lcore(slaveid);
+ rte_eal_wait_lcore(workerid);
printf("==== Cache line switch test ===\n");
printf("Time for %u iterations = %"PRIu64" ticks\n", (1<<ITER_POWER_CL),
end_time-start_time);
@@ -251,13 +251,13 @@ test_distributor_perf(void)
}
printf("=== Performance test of distributor (single mode) ===\n");
- rte_eal_mp_remote_launch(handle_work, ds, SKIP_MASTER);
+ rte_eal_mp_remote_launch(handle_work, ds, SKIP_MAIN);
if (perf_test(ds, p) < 0)
return -1;
quit_workers(ds, p);
printf("=== Performance test of distributor (burst mode) ===\n");
- rte_eal_mp_remote_launch(handle_work, db, SKIP_MASTER);
+ rte_eal_mp_remote_launch(handle_work, db, SKIP_MAIN);
if (perf_test(db, p) < 0)
return -1;
quit_workers(db, p);
diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index b019656b29c3..a12836d46d61 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -599,10 +599,10 @@ test_missing_c_flag(void)
}
/*
- * Test --master-lcore option with matching coremask
+ * Test --main-lcore option with matching coremask
*/
static int
-test_master_lcore_flag(void)
+test_main_lcore_flag(void)
{
#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
@@ -619,34 +619,34 @@ test_master_lcore_flag(void)
if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1))
return TEST_SKIPPED;
- /* --master-lcore flag but no value */
+ /* --main-lcore flag but no value */
const char *argv1[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore"};
- /* --master-lcore flag with invalid value */
+ "-c", "3", "--main-lcore"};
+ /* --main-lcore flag with invalid value */
const char *argv2[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "-1"};
+ "-c", "3", "--main-lcore", "-1"};
const char *argv3[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "X"};
- /* master lcore not in coremask */
+ "-c", "3", "--main-lcore", "X"};
+ /* main lcore not in coremask */
const char *argv4[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "2"};
+ "-c", "3", "--main-lcore", "2"};
/* valid value */
const char *argv5[] = { prgname, prefix, mp_flag,
- "-c", "3", "--master-lcore", "1"};
+ "-c", "3", "--main-lcore", "1"};
/* valid value set before coremask */
const char *argv6[] = { prgname, prefix, mp_flag,
- "--master-lcore", "1", "-c", "3"};
+ "--main-lcore", "1", "-c", "3"};
if (launch_proc(argv1) == 0
|| launch_proc(argv2) == 0
|| launch_proc(argv3) == 0
|| launch_proc(argv4) == 0) {
- printf("Error - process ran without error with wrong --master-lcore\n");
+ printf("Error - process ran without error with wrong --main-lcore\n");
return -1;
}
if (launch_proc(argv5) != 0
|| launch_proc(argv6) != 0) {
- printf("Error - process did not run ok with valid --master-lcore\n");
+ printf("Error - process did not run ok with valid --main-lcore\n");
return -1;
}
return 0;
@@ -1468,9 +1468,9 @@ test_eal_flags(void)
return ret;
}
- ret = test_master_lcore_flag();
+ ret = test_main_lcore_flag();
if (ret < 0) {
- printf("Error in test_master_lcore_flag()\n");
+ printf("Error in test_main_lcore_flag()\n");
return ret;
}
@@ -1542,7 +1542,7 @@ REGISTER_TEST_COMMAND(eal_flags_autotest, test_eal_flags);
/* subtests used in meson for CI */
REGISTER_TEST_COMMAND(eal_flags_c_opt_autotest, test_missing_c_flag);
-REGISTER_TEST_COMMAND(eal_flags_master_opt_autotest, test_master_lcore_flag);
+REGISTER_TEST_COMMAND(eal_flags_main_opt_autotest, test_main_lcore_flag);
REGISTER_TEST_COMMAND(eal_flags_n_opt_autotest, test_invalid_n_flag);
REGISTER_TEST_COMMAND(eal_flags_hpet_autotest, test_no_hpet_flag);
REGISTER_TEST_COMMAND(eal_flags_no_huge_autotest, test_no_huge_flag);
diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index e9df46967d61..180dc4748ed0 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -95,7 +95,7 @@ static inline uint8_t efd_get_all_sockets_bitmask(void)
{
uint8_t all_cpu_sockets_bitmask = 0;
unsigned int i;
- unsigned int next_lcore = rte_get_master_lcore();
+ unsigned int next_lcore = rte_get_main_lcore();
const int val_true = 1, val_false = 0;
for (i = 0; i < rte_lcore_count(); i++) {
all_cpu_sockets_bitmask |= 1 << rte_lcore_to_socket_id(next_lcore);
diff --git a/app/test/test_efd_perf.c b/app/test/test_efd_perf.c
index d47622d5cafd..1c4770447526 100644
--- a/app/test/test_efd_perf.c
+++ b/app/test/test_efd_perf.c
@@ -33,7 +33,7 @@ static inline uint8_t efd_get_all_sockets_bitmask(void)
{
uint8_t all_cpu_sockets_bitmask = 0;
unsigned int i;
- unsigned int next_lcore = rte_get_master_lcore();
+ unsigned int next_lcore = rte_get_main_lcore();
const int val_true = 1, val_false = 0;
for (i = 0; i < rte_lcore_count(); i++) {
all_cpu_sockets_bitmask |= 1 << rte_lcore_to_socket_id(next_lcore);
diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c
index f5ddd03d7670..4ceec3e57d67 100644
--- a/app/test/test_func_reentrancy.c
+++ b/app/test/test_func_reentrancy.c
@@ -57,8 +57,8 @@ typedef void (*case_clean_t)(unsigned lcore_id);
static rte_atomic32_t obj_count = RTE_ATOMIC32_INIT(0);
static rte_atomic32_t synchro = RTE_ATOMIC32_INIT(0);
-#define WAIT_SYNCHRO_FOR_SLAVES() do{ \
- if (lcore_self != rte_get_master_lcore()) \
+#define WAIT_SYNCHRO_FOR_WORKERS() do{ \
+ if (lcore_self != rte_get_main_lcore()) \
while (rte_atomic32_read(&synchro) == 0); \
} while(0)
@@ -70,7 +70,7 @@ test_eal_init_once(__rte_unused void *arg)
{
unsigned lcore_self = rte_lcore_id();
- WAIT_SYNCHRO_FOR_SLAVES();
+ WAIT_SYNCHRO_FOR_WORKERS();
rte_atomic32_set(&obj_count, 1); /* silent the check in the caller */
if (rte_eal_init(0, NULL) != -1)
@@ -106,7 +106,7 @@ ring_create_lookup(__rte_unused void *arg)
char ring_name[MAX_STRING_SIZE];
int i;
- WAIT_SYNCHRO_FOR_SLAVES();
+ WAIT_SYNCHRO_FOR_WORKERS();
/* create the same ring simultaneously on all threads */
for (i = 0; i < MAX_ITER_ONCE; i++) {
@@ -166,7 +166,7 @@ mempool_create_lookup(__rte_unused void *arg)
char mempool_name[MAX_STRING_SIZE];
int i;
- WAIT_SYNCHRO_FOR_SLAVES();
+ WAIT_SYNCHRO_FOR_WORKERS();
/* create the same mempool simultaneously on all threads */
for (i = 0; i < MAX_ITER_ONCE; i++) {
@@ -232,7 +232,7 @@ hash_create_free(__rte_unused void *arg)
.socket_id = 0,
};
- WAIT_SYNCHRO_FOR_SLAVES();
+ WAIT_SYNCHRO_FOR_WORKERS();
/* create the same hash simultaneously on all threads */
hash_params.name = "fr_test_once";
@@ -296,7 +296,7 @@ fbk_create_free(__rte_unused void *arg)
.init_val = RTE_FBK_HASH_INIT_VAL_DEFAULT,
};
- WAIT_SYNCHRO_FOR_SLAVES();
+ WAIT_SYNCHRO_FOR_WORKERS();
/* create the same fbk hash table simultaneously on all threads */
fbk_params.name = "fr_test_once";
@@ -359,7 +359,7 @@ lpm_create_free(__rte_unused void *arg)
char lpm_name[MAX_STRING_SIZE];
int i;
- WAIT_SYNCHRO_FOR_SLAVES();
+ WAIT_SYNCHRO_FOR_WORKERS();
/* create the same lpm simultaneously on all threads */
for (i = 0; i < MAX_ITER_ONCE; i++) {
@@ -430,7 +430,7 @@ launch_test(struct test_case *pt_case)
rte_atomic32_set(&obj_count, 0);
rte_atomic32_set(&synchro, 0);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
@@ -443,7 +443,7 @@ launch_test(struct test_case *pt_case)
ret = -1;
cores = cores_save;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
diff --git a/app/test/test_hash_multiwriter.c b/app/test/test_hash_multiwriter.c
index 46ab45f82a99..afa3c7b93d85 100644
--- a/app/test/test_hash_multiwriter.c
+++ b/app/test/test_hash_multiwriter.c
@@ -64,7 +64,7 @@ test_hash_multiwriter_worker(void *arg)
/*
* Calculate offset for entries based on the position of the
- * logical core, from the master core (not counting not enabled cores)
+ * logical core, from the main core (not counting not enabled cores)
*/
offset = pos_core * tbl_multiwriter_test_params.nb_tsx_insertion;
@@ -194,7 +194,7 @@ test_hash_multiwriter(void)
/* Fire all threads. */
rte_eal_mp_remote_launch(test_hash_multiwriter_worker,
- enabled_core_ids, CALL_MASTER);
+ enabled_core_ids, CALL_MAIN);
rte_eal_mp_wait_lcore();
count = rte_hash_count(handle);
diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c
index 73333dff1392..4860768a6491 100644
--- a/app/test/test_hash_readwrite.c
+++ b/app/test/test_hash_readwrite.c
@@ -25,7 +25,7 @@
#define NUM_TEST 3
unsigned int core_cnt[NUM_TEST] = {2, 4, 8};
-unsigned int slave_core_ids[RTE_MAX_LCORE];
+unsigned int worker_core_ids[RTE_MAX_LCORE];
struct perf {
uint32_t single_read;
uint32_t single_write;
@@ -65,7 +65,7 @@ test_hash_readwrite_worker(__rte_unused void *arg)
ret = rte_malloc(NULL, sizeof(int) *
tbl_rw_test_param.num_insert, 0);
for (i = 0; i < rte_lcore_count(); i++) {
- if (slave_core_ids[i] == lcore_id)
+ if (worker_core_ids[i] == lcore_id)
break;
}
offset = tbl_rw_test_param.num_insert * i;
@@ -206,7 +206,7 @@ test_hash_readwrite_functional(int use_htm, int use_rw_lf, int use_ext)
uint32_t duplicated_keys = 0;
uint32_t lost_keys = 0;
int use_jhash = 1;
- int slave_cnt = rte_lcore_count() - 1;
+ int worker_cnt = rte_lcore_count() - 1;
uint32_t tot_insert = 0;
rte_atomic64_init(&gcycles);
@@ -224,11 +224,10 @@ test_hash_readwrite_functional(int use_htm, int use_rw_lf, int use_ext)
tot_insert = TOTAL_INSERT;
tbl_rw_test_param.num_insert =
- tot_insert / slave_cnt;
+ tot_insert / worker_cnt;
tbl_rw_test_param.rounded_tot_insert =
- tbl_rw_test_param.num_insert
- * slave_cnt;
+ tbl_rw_test_param.num_insert * worker_cnt;
printf("\nHTM = %d, RW-LF = %d, EXT-Table = %d\n",
use_htm, use_rw_lf, use_ext);
@@ -236,7 +235,7 @@ test_hash_readwrite_functional(int use_htm, int use_rw_lf, int use_ext)
/* Fire all threads. */
rte_eal_mp_remote_launch(test_hash_readwrite_worker,
- NULL, SKIP_MASTER);
+ NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
while (rte_hash_iterate(tbl_rw_test_param.h, &next_key,
@@ -330,7 +329,7 @@ test_rw_writer(void *arg)
uint64_t offset;
for (i = 0; i < rte_lcore_count(); i++) {
- if (slave_core_ids[i] == lcore_id)
+ if (worker_core_ids[i] == lcore_id)
break;
}
@@ -433,8 +432,8 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
perf_results->single_read = end / i;
for (n = 0; n < NUM_TEST; n++) {
- unsigned int tot_slave_lcore = rte_lcore_count() - 1;
- if (tot_slave_lcore < core_cnt[n] * 2)
+ unsigned int tot_worker_lcore = rte_lcore_count() - 1;
+ if (tot_worker_lcore < core_cnt[n] * 2)
goto finish;
rte_atomic64_clear(&greads);
@@ -467,7 +466,7 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
for (i = 0; i < core_cnt[n]; i++)
rte_eal_remote_launch(test_rw_reader,
(void *)(uintptr_t)read_cnt,
- slave_core_ids[i]);
+ worker_core_ids[i]);
rte_eal_mp_wait_lcore();
@@ -476,7 +475,7 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
for (; i < core_cnt[n] * 2; i++)
rte_eal_remote_launch(test_rw_writer,
(void *)((uintptr_t)start_coreid),
- slave_core_ids[i]);
+ worker_core_ids[i]);
rte_eal_mp_wait_lcore();
@@ -521,20 +520,20 @@ test_hash_readwrite_perf(struct perf *perf_results, int use_htm,
for (i = core_cnt[n]; i < core_cnt[n] * 2; i++)
rte_eal_remote_launch(test_rw_writer,
(void *)((uintptr_t)start_coreid),
- slave_core_ids[i]);
+ worker_core_ids[i]);
for (i = 0; i < core_cnt[n]; i++)
rte_eal_remote_launch(test_rw_reader,
(void *)(uintptr_t)read_cnt,
- slave_core_ids[i]);
+ worker_core_ids[i]);
} else {
for (i = 0; i < core_cnt[n]; i++)
rte_eal_remote_launch(test_rw_reader,
(void *)(uintptr_t)read_cnt,
- slave_core_ids[i]);
+ worker_core_ids[i]);
for (; i < core_cnt[n] * 2; i++)
rte_eal_remote_launch(test_rw_writer,
(void *)((uintptr_t)start_coreid),
- slave_core_ids[i]);
+ worker_core_ids[i]);
}
rte_eal_mp_wait_lcore();
@@ -626,8 +625,8 @@ test_hash_rw_perf_main(void)
return TEST_SKIPPED;
}
- RTE_LCORE_FOREACH_SLAVE(core_id) {
- slave_core_ids[i] = core_id;
+ RTE_LCORE_FOREACH_WORKER(core_id) {
+ worker_core_ids[i] = core_id;
i++;
}
@@ -710,8 +709,8 @@ test_hash_rw_func_main(void)
return TEST_SKIPPED;
}
- RTE_LCORE_FOREACH_SLAVE(core_id) {
- slave_core_ids[i] = core_id;
+ RTE_LCORE_FOREACH_WORKER(core_id) {
+ worker_core_ids[i] = core_id;
i++;
}
diff --git a/app/test/test_kni.c b/app/test/test_kni.c
index e47ab36e0231..d4e31e4ae13d 100644
--- a/app/test/test_kni.c
+++ b/app/test/test_kni.c
@@ -85,7 +85,7 @@ static struct rte_kni_ops kni_ops = {
.config_promiscusity = NULL,
};
-static unsigned lcore_master, lcore_ingress, lcore_egress;
+static unsigned int lcore_main, lcore_ingress, lcore_egress;
static struct rte_kni *test_kni_ctx;
static struct test_kni_stats stats;
@@ -202,7 +202,7 @@ test_kni_link_change(void)
* supported by KNI kernel module. The ingress lcore will allocate mbufs and
* transmit them to kernel space; while the egress lcore will receive the mbufs
* from kernel space and free them.
- * On the master lcore, several commands will be run to check handling the
+ * On the main lcore, several commands will be run to check handling the
* kernel requests. And it will finally set the flag to exit the KNI
* transmitting/receiving to/from the kernel space.
*
@@ -217,7 +217,7 @@ test_kni_loop(__rte_unused void *arg)
const unsigned lcore_id = rte_lcore_id();
struct rte_mbuf *pkts_burst[PKT_BURST_SZ];
- if (lcore_id == lcore_master) {
+ if (lcore_id == lcore_main) {
rte_delay_ms(KNI_TIMEOUT_MS);
/* tests of handling kernel request */
if (system(IFCONFIG TEST_KNI_PORT" up") == -1)
@@ -276,12 +276,12 @@ test_kni_allocate_lcores(void)
{
unsigned i, count = 0;
- lcore_master = rte_get_master_lcore();
- printf("master lcore: %u\n", lcore_master);
+ lcore_main = rte_get_main_lcore();
+ printf("main lcore: %u\n", lcore_main);
for (i = 0; i < RTE_MAX_LCORE; i++) {
if (count >=2 )
break;
- if (rte_lcore_is_enabled(i) && i != lcore_master) {
+ if (rte_lcore_is_enabled(i) && i != lcore_main) {
count ++;
if (count == 1)
lcore_ingress = i;
@@ -487,8 +487,8 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)
if (ret != 0)
goto fail_kni;
- rte_eal_mp_remote_launch(test_kni_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ rte_eal_mp_remote_launch(test_kni_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(i) {
if (rte_eal_wait_lcore(i) < 0) {
ret = -1;
goto fail_kni;
diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index 58076795ec3a..c5a238b9d1e8 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -498,7 +498,7 @@ test_lpm_rcu_perf_multi_writer(void)
}
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
@@ -651,7 +651,7 @@ test_lpm_rcu_perf(void)
}
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index 71b3cfdde5cf..758e6194a852 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -1007,11 +1007,11 @@ test_malloc(void)
else printf("test_realloc() passed\n");
/*----------------------------*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(test_align_overlap_per_lcore, NULL, lcore_id);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
ret = -1;
}
@@ -1022,11 +1022,11 @@ test_malloc(void)
else printf("test_align_overlap_per_lcore() passed\n");
/*----------------------------*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(test_reordered_free_per_lcore, NULL, lcore_id);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
ret = -1;
}
@@ -1037,11 +1037,11 @@ test_malloc(void)
else printf("test_reordered_free_per_lcore() passed\n");
/*----------------------------*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(test_random_alloc_free, NULL, lcore_id);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
ret = -1;
}
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 06e44f0a79f8..8a76e786e4df 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -72,7 +72,7 @@
#ifdef RTE_MBUF_REFCNT_ATOMIC
-static volatile uint32_t refcnt_stop_slaves;
+static volatile uint32_t refcnt_stop_workers;
static unsigned refcnt_lcore[RTE_MAX_LCORE];
#endif
@@ -1000,7 +1000,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)
#ifdef RTE_MBUF_REFCNT_ATOMIC
static int
-test_refcnt_slave(void *arg)
+test_refcnt_worker(void *arg)
{
unsigned lcore, free;
void *mp = 0;
@@ -1010,7 +1010,7 @@ test_refcnt_slave(void *arg)
printf("%s started at lcore %u\n", __func__, lcore);
free = 0;
- while (refcnt_stop_slaves == 0) {
+ while (refcnt_stop_workers == 0) {
if (rte_ring_dequeue(refcnt_mbuf_ring, &mp) == 0) {
free++;
rte_pktmbuf_free(mp);
@@ -1038,7 +1038,7 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
/* For each mbuf in the pool:
* - allocate mbuf,
* - increment it's reference up to N+1,
- * - enqueue it N times into the ring for slave cores to free.
+ * - enqueue it N times into the ring for worker cores to free.
*/
for (i = 0, n = rte_mempool_avail_count(refcnt_pool);
i != n && (m = rte_pktmbuf_alloc(refcnt_pool)) != NULL;
@@ -1062,7 +1062,7 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
rte_panic("(lcore=%u, iter=%u): was able to allocate only "
"%u from %u mbufs\n", lcore, iter, i, n);
- /* wait till slave lcores will consume all mbufs */
+ /* wait till worker lcores will consume all mbufs */
while (!rte_ring_empty(refcnt_mbuf_ring))
;
@@ -1083,7 +1083,7 @@ test_refcnt_iter(unsigned int lcore, unsigned int iter,
}
static int
-test_refcnt_master(struct rte_mempool *refcnt_pool,
+test_refcnt_main(struct rte_mempool *refcnt_pool,
struct rte_ring *refcnt_mbuf_ring)
{
unsigned i, lcore;
@@ -1094,7 +1094,7 @@ test_refcnt_master(struct rte_mempool *refcnt_pool,
for (i = 0; i != REFCNT_MAX_ITER; i++)
test_refcnt_iter(lcore, i, refcnt_pool, refcnt_mbuf_ring);
- refcnt_stop_slaves = 1;
+ refcnt_stop_workers = 1;
rte_wmb();
printf("%s finished at lcore %u\n", __func__, lcore);
@@ -1107,7 +1107,7 @@ static int
test_refcnt_mbuf(void)
{
#ifdef RTE_MBUF_REFCNT_ATOMIC
- unsigned int master, slave, tref;
+ unsigned int main_lcore, worker, tref;
int ret = -1;
struct rte_mempool *refcnt_pool = NULL;
struct rte_ring *refcnt_mbuf_ring = NULL;
@@ -1139,26 +1139,25 @@ test_refcnt_mbuf(void)
goto err;
}
- refcnt_stop_slaves = 0;
+ refcnt_stop_workers = 0;
memset(refcnt_lcore, 0, sizeof (refcnt_lcore));
- rte_eal_mp_remote_launch(test_refcnt_slave, refcnt_mbuf_ring,
- SKIP_MASTER);
+ rte_eal_mp_remote_launch(test_refcnt_worker, refcnt_mbuf_ring, SKIP_MAIN);
- test_refcnt_master(refcnt_pool, refcnt_mbuf_ring);
+ test_refcnt_main(refcnt_pool, refcnt_mbuf_ring);
rte_eal_mp_wait_lcore();
/* check that we porcessed all references */
tref = 0;
- master = rte_get_master_lcore();
+ main_lcore = rte_get_main_lcore();
- RTE_LCORE_FOREACH_SLAVE(slave)
- tref += refcnt_lcore[slave];
+ RTE_LCORE_FOREACH_WORKER(worker)
+ tref += refcnt_lcore[worker];
- if (tref != refcnt_lcore[master])
+ if (tref != refcnt_lcore[main_lcore])
rte_panic("referenced mbufs: %u, freed mbufs: %u\n",
- tref, refcnt_lcore[master]);
+ tref, refcnt_lcore[main_lcore]);
rte_mempool_dump(stdout, refcnt_pool);
rte_ring_dump(stdout, refcnt_mbuf_ring);
diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index ddccaafa9242..fbca78707d2e 100644
--- a/app/test/test_mcslock.c
+++ b/app/test/test_mcslock.c
@@ -28,7 +28,7 @@
* These tests are derived from spin lock test cases.
*
* - The functional test takes all of these locks and launches the
- * ''test_mcslock_per_core()'' function on each core (except the master).
+ * ''test_mcslock_per_core()'' function on each core (except the main).
*
* - The function takes the global lock, display something, then releases
* the global lock on each core.
@@ -123,9 +123,9 @@ test_mcslock_perf(void)
printf("\nTest with lock on %u cores...\n", (rte_lcore_count()));
rte_atomic32_set(&synchro, 0);
- rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MASTER);
+ rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN);
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(&lock);
@@ -154,8 +154,8 @@ test_mcslock_try(__rte_unused void *arg)
rte_mcslock_t ml_me = RTE_PER_LCORE(_ml_me);
rte_mcslock_t ml_try_me = RTE_PER_LCORE(_ml_try_me);
- /* Locked ml_try in the master lcore, so it should fail
- * when trying to lock it in the slave lcore.
+ /* Locked ml_try in the main lcore, so it should fail
+ * when trying to lock it in the worker lcore.
*/
if (rte_mcslock_trylock(&p_ml_try, &ml_try_me) == 0) {
rte_mcslock_lock(&p_ml, &ml_me);
@@ -185,20 +185,20 @@ test_mcslock(void)
* Test mcs lock & unlock on each core
*/
- /* slave cores should be waiting: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be waiting: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
rte_mcslock_lock(&p_ml, &ml_me);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_mcslock_per_core, NULL, i);
}
- /* slave cores should be busy: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be busy: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
@@ -210,19 +210,19 @@ test_mcslock(void)
/*
* Test if it could return immediately from try-locking a locked object.
* Here it will lock the mcs lock object first, then launch all the
- * slave lcores to trylock the same mcs lock object.
- * All the slave lcores should give up try-locking a locked object and
+ * worker lcores to trylock the same mcs lock object.
+ * All the worker lcores should give up try-locking a locked object and
* return immediately, and then increase the "count" initialized with
* zero by one per times.
* We can check if the "count" is finally equal to the number of all
- * slave lcores to see if the behavior of try-locking a locked
+ * worker lcores to see if the behavior of try-locking a locked
* mcslock object is correct.
*/
if (rte_mcslock_trylock(&p_ml_try, &ml_try_me) == 0)
return -1;
count = 0;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_mcslock_try, NULL, i);
}
rte_eal_mp_wait_lcore();
diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c
index 60bda8aadbe8..d7d0aaa3340c 100644
--- a/app/test/test_mempool_perf.c
+++ b/app/test/test_mempool_perf.c
@@ -143,8 +143,8 @@ per_lcore_mempool_test(void *arg)
stats[lcore_id].enq_count = 0;
- /* wait synchro for slaves */
- if (lcore_id != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore_id != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0);
start_cycles = rte_get_timer_cycles();
@@ -214,7 +214,7 @@ launch_cores(struct rte_mempool *mp, unsigned int cores)
return -1;
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
@@ -222,13 +222,13 @@ launch_cores(struct rte_mempool *mp, unsigned int cores)
mp, lcore_id);
}
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
ret = per_lcore_mempool_test(mp);
cores = cores_save;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (cores == 1)
break;
cores--;
diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c
index 3a655c340041..4fa0dfe9c0b8 100644
--- a/app/test/test_mp_secondary.c
+++ b/app/test/test_mp_secondary.c
@@ -94,7 +94,7 @@ run_secondary_instances(void)
#endif
snprintf(coremask, sizeof(coremask), "%x", \
- (1 << rte_get_master_lcore()));
+ (1 << rte_get_main_lcore()));
ret |= launch_proc(argv1);
printf("### Testing rte_mp_disable() reject:\n");
diff --git a/app/test/test_pdump.c b/app/test/test_pdump.c
index 6a1180bcb78e..21fcc1bc4cba 100644
--- a/app/test/test_pdump.c
+++ b/app/test/test_pdump.c
@@ -184,7 +184,7 @@ run_pdump_server_tests(void)
};
snprintf(coremask, sizeof(coremask), "%x",
- (1 << rte_get_master_lcore()));
+ (1 << rte_get_main_lcore()));
ret = test_pdump_init();
ret |= launch_p(argv1);
diff --git a/app/test/test_per_lcore.c b/app/test/test_per_lcore.c
index fcd00212f1eb..129578d1a30f 100644
--- a/app/test/test_per_lcore.c
+++ b/app/test/test_per_lcore.c
@@ -73,31 +73,31 @@ test_per_lcore(void)
unsigned lcore_id;
int ret;
- rte_eal_mp_remote_launch(assign_vars, NULL, SKIP_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(assign_vars, NULL, SKIP_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
- rte_eal_mp_remote_launch(display_vars, NULL, SKIP_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(display_vars, NULL, SKIP_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
/* test if it could do remote launch twice at the same time or not */
- ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MASTER);
+ ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MAIN);
if (ret < 0) {
printf("It fails to do remote launch but it should able to do\n");
return -1;
}
/* it should not be able to launch a lcore which is running */
- ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MASTER);
+ ret = rte_eal_mp_remote_launch(test_per_lcore_delay, NULL, SKIP_MAIN);
if (ret == 0) {
printf("It does remote launch successfully but it should not at this time\n");
return -1;
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index 352cd47156ba..e4a4762b0bbf 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -278,7 +278,7 @@ alloc_lcore(uint16_t socketid)
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
if (LCORE_AVAIL != lcore_conf[lcore_id].status ||
lcore_conf[lcore_id].socketid != socketid ||
- lcore_id == rte_get_master_lcore())
+ lcore_id == rte_get_main_lcore())
continue;
lcore_conf[lcore_id].status = LCORE_USED;
lcore_conf[lcore_id].nb_ports = 0;
@@ -664,7 +664,7 @@ exec_burst(uint32_t flags, int lcore)
static int
test_pmd_perf(void)
{
- uint16_t nb_ports, num, nb_lcores, slave_id = (uint16_t)-1;
+ uint16_t nb_ports, num, nb_lcores, worker_id = (uint16_t)-1;
uint16_t nb_rxd = MAX_TRAFFIC_BURST;
uint16_t nb_txd = MAX_TRAFFIC_BURST;
uint16_t portid;
@@ -702,13 +702,13 @@ test_pmd_perf(void)
RTE_ETH_FOREACH_DEV(portid) {
if (socketid == -1) {
socketid = rte_eth_dev_socket_id(portid);
- slave_id = alloc_lcore(socketid);
- if (slave_id == (uint16_t)-1) {
+ worker_id = alloc_lcore(socketid);
+ if (worker_id == (uint16_t)-1) {
printf("No avail lcore to run test\n");
return -1;
}
printf("Performance test runs on lcore %u socket %u\n",
- slave_id, socketid);
+ worker_id, socketid);
}
if (socketid != rte_eth_dev_socket_id(portid)) {
@@ -765,8 +765,8 @@ test_pmd_perf(void)
"rte_eth_promiscuous_enable: err=%s, port=%d\n",
rte_strerror(-ret), portid);
- lcore_conf[slave_id].portlist[num++] = portid;
- lcore_conf[slave_id].nb_ports++;
+ lcore_conf[worker_id].portlist[num++] = portid;
+ lcore_conf[worker_id].nb_ports++;
}
check_all_ports_link_status(nb_ports, RTE_PORT_ALL);
@@ -791,13 +791,13 @@ test_pmd_perf(void)
if (NULL == do_measure)
do_measure = measure_rxtx;
- rte_eal_remote_launch(main_loop, NULL, slave_id);
+ rte_eal_remote_launch(main_loop, NULL, worker_id);
- if (rte_eal_wait_lcore(slave_id) < 0)
+ if (rte_eal_wait_lcore(worker_id) < 0)
return -1;
} else if (sc_flag == SC_BURST_POLL_FIRST ||
sc_flag == SC_BURST_XMIT_FIRST)
- if (exec_burst(sc_flag, slave_id) < 0)
+ if (exec_burst(sc_flag, worker_id) < 0)
return -1;
/* port tear down */
diff --git a/app/test/test_rcu_qsbr.c b/app/test/test_rcu_qsbr.c
index 0a9e5ecd1a44..7ae66e4dfb76 100644
--- a/app/test/test_rcu_qsbr.c
+++ b/app/test/test_rcu_qsbr.c
@@ -1327,7 +1327,7 @@ test_rcu_qsbr_main(void)
}
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
diff --git a/app/test/test_rcu_qsbr_perf.c b/app/test/test_rcu_qsbr_perf.c
index d35a6d089784..3017e71120ad 100644
--- a/app/test/test_rcu_qsbr_perf.c
+++ b/app/test/test_rcu_qsbr_perf.c
@@ -625,7 +625,7 @@ test_rcu_qsbr_main(void)
rte_atomic64_init(&check_cycles);
num_cores = 0;
- RTE_LCORE_FOREACH_SLAVE(core_id) {
+ RTE_LCORE_FOREACH_WORKER(core_id) {
enabled_core_ids[num_cores] = core_id;
num_cores++;
}
diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c
index ac9bf5608daa..e63e25a867f0 100644
--- a/app/test/test_ring_perf.c
+++ b/app/test/test_ring_perf.c
@@ -297,7 +297,7 @@ run_on_core_pair(struct lcore_pair *cores, struct rte_ring *r, const int esize)
lcore_count = 0;
param1.size = param2.size = bulk_sizes[i];
param1.r = param2.r = r;
- if (cores->c1 == rte_get_master_lcore()) {
+ if (cores->c1 == rte_get_main_lcore()) {
rte_eal_remote_launch(f2, ¶m2, cores->c2);
f1(¶m1);
rte_eal_wait_lcore(cores->c2);
@@ -340,8 +340,8 @@ load_loop_fn_helper(struct thread_params *p, const int esize)
if (burst == NULL)
return -1;
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0)
rte_pause();
@@ -397,12 +397,12 @@ run_on_all_cores(struct rte_ring *r, const int esize)
param.size = bulk_sizes[i];
param.r = r;
- /* clear synchro and start slaves */
+ /* clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- if (rte_eal_mp_remote_launch(lcore_f, ¶m, SKIP_MASTER) < 0)
+ if (rte_eal_mp_remote_launch(lcore_f, ¶m, SKIP_MAIN) < 0)
return -1;
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
lcore_f(¶m);
@@ -553,7 +553,7 @@ test_ring_perf_esize(const int esize)
goto test_fail;
}
- printf("\n### Testing using all slave nodes ###\n");
+ printf("\n### Testing using all worker nodes ###\n");
if (run_on_all_cores(r, esize) < 0)
goto test_fail;
diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h
index 222d62bc4f4d..3b9a480eb9cc 100644
--- a/app/test/test_ring_stress_impl.h
+++ b/app/test/test_ring_stress_impl.h
@@ -6,7 +6,7 @@
/**
* Stress test for ring enqueue/dequeue operations.
- * Performs the following pattern on each slave worker:
+ * Performs the following pattern on each worker:
* dequeue/read-write data from the dequeued objects/enqueue.
* Serves as both functional and performance test of ring
* enqueue/dequeue operations under high contention
@@ -348,8 +348,8 @@ test_mt1(int (*test)(void *))
memset(arg, 0, sizeof(arg));
- /* launch on all slaves */
- RTE_LCORE_FOREACH_SLAVE(lc) {
+ /* launch on all workers */
+ RTE_LCORE_FOREACH_WORKER(lc) {
arg[lc].rng = r;
arg[lc].stats = init_stat;
rte_eal_remote_launch(test, &arg[lc], lc);
@@ -365,12 +365,12 @@ test_mt1(int (*test)(void *))
wrk_cmd = WRK_CMD_STOP;
rte_smp_wmb();
- /* wait for slaves and collect stats. */
+ /* wait for workers and collect stats. */
mc = rte_lcore_id();
arg[mc].stats = init_stat;
rc = 0;
- RTE_LCORE_FOREACH_SLAVE(lc) {
+ RTE_LCORE_FOREACH_WORKER(lc) {
rc |= rte_eal_wait_lcore(lc);
lcore_stat_aggr(&arg[mc].stats, &arg[lc].stats);
if (verbose != 0)
diff --git a/app/test/test_rwlock.c b/app/test/test_rwlock.c
index 61bee7d7c296..701187f39884 100644
--- a/app/test/test_rwlock.c
+++ b/app/test/test_rwlock.c
@@ -99,8 +99,8 @@ load_loop_fn(__rte_unused void *arg)
uint64_t lcount = 0;
const unsigned int lcore = rte_lcore_id();
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0)
;
@@ -134,12 +134,12 @@ test_rwlock_perf(void)
printf("\nRwlock Perf Test on %u cores...\n", rte_lcore_count());
- /* clear synchro and start slaves */
+ /* clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- if (rte_eal_mp_remote_launch(load_loop_fn, NULL, SKIP_MASTER) < 0)
+ if (rte_eal_mp_remote_launch(load_loop_fn, NULL, SKIP_MAIN) < 0)
return -1;
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(NULL);
@@ -161,7 +161,7 @@ test_rwlock_perf(void)
* - There is a global rwlock and a table of rwlocks (one per lcore).
*
* - The test function takes all of these locks and launches the
- * ``test_rwlock_per_core()`` function on each core (except the master).
+ * ``test_rwlock_per_core()`` function on each core (except the main).
*
* - The function takes the global write lock, display something,
* then releases the global lock.
@@ -187,21 +187,21 @@ rwlock_test1(void)
rte_rwlock_write_lock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_rwlock_write_lock(&sl_tab[i]);
rte_eal_remote_launch(test_rwlock_per_core, NULL, i);
}
rte_rwlock_write_unlock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_rwlock_write_unlock(&sl_tab[i]);
rte_delay_ms(100);
}
rte_rwlock_write_lock(&sl);
/* this message should be the last message of test */
- printf("Global write lock taken on master core %u\n", rte_lcore_id());
+ printf("Global write lock taken on main core %u\n", rte_lcore_id());
rte_rwlock_write_unlock(&sl);
rte_eal_mp_wait_lcore();
@@ -462,26 +462,26 @@ try_rwlock_test_rda(void)
try_test_reset();
/* start read test on all avaialble lcores */
- rte_eal_mp_remote_launch(try_read_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(try_read_lcore, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
return process_try_lcore_stats();
}
-/* all slave lcores grab RDLOCK, master one grabs WRLOCK */
+/* all worker lcores grab RDLOCK, main one grabs WRLOCK */
static int
try_rwlock_test_rds_wrm(void)
{
try_test_reset();
- rte_eal_mp_remote_launch(try_read_lcore, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(try_read_lcore, NULL, SKIP_MAIN);
try_write_lcore(NULL);
rte_eal_mp_wait_lcore();
return process_try_lcore_stats();
}
-/* master and even slave lcores grab RDLOCK, odd lcores grab WRLOCK */
+/* main and even worker lcores grab RDLOCK, odd lcores grab WRLOCK */
static int
try_rwlock_test_rde_wro(void)
{
@@ -489,7 +489,7 @@ try_rwlock_test_rde_wro(void)
try_test_reset();
- mlc = rte_get_master_lcore();
+ mlc = rte_get_main_lcore();
RTE_LCORE_FOREACH(lc) {
if (lc != mlc) {
diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index ef1d8fcb9b40..f87c3a8a2b9b 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -30,7 +30,7 @@ static int
testsuite_setup(void)
{
slcore_id = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
return TEST_SUCCESS;
@@ -533,12 +533,12 @@ service_lcore_add_del(void)
TEST_ASSERT_EQUAL(1, rte_service_lcore_count(),
"Service core count not equal to one");
uint32_t slcore_1 = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_1),
"Service core add did not return zero");
uint32_t slcore_2 = rte_get_next_lcore(/* start core */ slcore_1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_2),
"Service core add did not return zero");
@@ -584,12 +584,12 @@ service_threaded_test(int mt_safe)
/* add next 2 cores */
uint32_t slcore_1 = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_1),
"mt safe lcore add fail");
uint32_t slcore_2 = rte_get_next_lcore(/* start core */ slcore_1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_2),
"mt safe lcore add fail");
@@ -923,10 +923,10 @@ service_active_two_cores(void)
int i;
uint32_t lcore = rte_get_next_lcore(/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
uint32_t slcore = rte_get_next_lcore(/* start core */ lcore,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
/* start the service on the second available lcore */
diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c
index 842990ed3b30..054fb43a9fe5 100644
--- a/app/test/test_spinlock.c
+++ b/app/test/test_spinlock.c
@@ -28,7 +28,7 @@
* - There is a global spinlock and a table of spinlocks (one per lcore).
*
* - The test function takes all of these locks and launches the
- * ``test_spinlock_per_core()`` function on each core (except the master).
+ * ``test_spinlock_per_core()`` function on each core (except the main).
*
* - The function takes the global lock, display something, then releases
* the global lock.
@@ -109,8 +109,8 @@ load_loop_fn(void *func_param)
const int use_lock = *(int*)func_param;
const unsigned lcore = rte_lcore_id();
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0);
begin = rte_get_timer_cycles();
@@ -149,11 +149,11 @@ test_spinlock_perf(void)
printf("\nTest with lock on %u cores...\n", rte_lcore_count());
- /* Clear synchro and start slaves */
+ /* Clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MASTER);
+ rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN);
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(&lock);
@@ -200,8 +200,8 @@ test_spinlock(void)
int ret = 0;
int i;
- /* slave cores should be waiting: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be waiting: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
@@ -214,19 +214,19 @@ test_spinlock(void)
rte_spinlock_lock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_spinlock_lock(&sl_tab[i]);
rte_eal_remote_launch(test_spinlock_per_core, NULL, i);
}
- /* slave cores should be busy: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be busy: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
rte_spinlock_unlock(&sl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_spinlock_unlock(&sl_tab[i]);
rte_delay_ms(10);
}
@@ -245,7 +245,7 @@ test_spinlock(void)
} else
rte_spinlock_recursive_unlock(&slr);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_spinlock_recursive_per_core, NULL, i);
}
rte_spinlock_recursive_unlock(&slr);
@@ -253,12 +253,12 @@ test_spinlock(void)
/*
* Test if it could return immediately from try-locking a locked object.
- * Here it will lock the spinlock object first, then launch all the slave
+ * Here it will lock the spinlock object first, then launch all the worker
* lcores to trylock the same spinlock object.
- * All the slave lcores should give up try-locking a locked object and
+ * All the worker lcores should give up try-locking a locked object and
* return immediately, and then increase the "count" initialized with zero
* by one per times.
- * We can check if the "count" is finally equal to the number of all slave
+ * We can check if the "count" is finally equal to the number of all worker
* lcores to see if the behavior of try-locking a locked spinlock object
* is correct.
*/
@@ -266,7 +266,7 @@ test_spinlock(void)
return -1;
}
count = 0;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_spinlock_try, NULL, i);
}
rte_eal_mp_wait_lcore();
diff --git a/app/test/test_stack.c b/app/test/test_stack.c
index c8dac1f55cdc..0ef5f47874f2 100644
--- a/app/test/test_stack.c
+++ b/app/test/test_stack.c
@@ -362,7 +362,7 @@ test_stack_multithreaded(uint32_t flags)
rte_atomic64_init(&size);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
args[lcore_id].s = s;
args[lcore_id].sz = &size;
diff --git a/app/test/test_stack_perf.c b/app/test/test_stack_perf.c
index 3ab7267b1b72..3590625c49e7 100644
--- a/app/test/test_stack_perf.c
+++ b/app/test/test_stack_perf.c
@@ -180,7 +180,7 @@ run_on_core_pair(struct lcore_pair *cores, struct rte_stack *s,
args[0].sz = args[1].sz = bulk_sizes[i];
args[0].s = args[1].s = s;
- if (cores->c1 == rte_get_master_lcore()) {
+ if (cores->c1 == rte_get_main_lcore()) {
rte_eal_remote_launch(fn, &args[1], cores->c2);
fn(&args[0]);
rte_eal_wait_lcore(cores->c2);
@@ -210,7 +210,7 @@ run_on_n_cores(struct rte_stack *s, lcore_function_t fn, int n)
rte_atomic32_set(&lcore_barrier, n);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (++cnt >= n)
break;
@@ -235,7 +235,7 @@ run_on_n_cores(struct rte_stack *s, lcore_function_t fn, int n)
avg = args[rte_lcore_id()].avg;
cnt = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (++cnt >= n)
break;
avg += args[lcore_id].avg;
diff --git a/app/test/test_ticketlock.c b/app/test/test_ticketlock.c
index 66ab3d1a0248..7aab8665bc77 100644
--- a/app/test/test_ticketlock.c
+++ b/app/test/test_ticketlock.c
@@ -28,7 +28,7 @@
* - There is a global ticketlock and a table of ticketlocks (one per lcore).
*
* - The test function takes all of these locks and launches the
- * ``test_ticketlock_per_core()`` function on each core (except the master).
+ * ``test_ticketlock_per_core()`` function on each core (except the main).
*
* - The function takes the global lock, display something, then releases
* the global lock.
@@ -110,8 +110,8 @@ load_loop_fn(void *func_param)
const int use_lock = *(int *)func_param;
const unsigned int lcore = rte_lcore_id();
- /* wait synchro for slaves */
- if (lcore != rte_get_master_lcore())
+ /* wait synchro for workers */
+ if (lcore != rte_get_main_lcore())
while (rte_atomic32_read(&synchro) == 0)
;
@@ -154,11 +154,11 @@ test_ticketlock_perf(void)
lcount = 0;
printf("\nTest with lock on %u cores...\n", rte_lcore_count());
- /* Clear synchro and start slaves */
+ /* Clear synchro and start workers */
rte_atomic32_set(&synchro, 0);
- rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MASTER);
+ rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN);
- /* start synchro and launch test on master */
+ /* start synchro and launch test on main */
rte_atomic32_set(&synchro, 1);
load_loop_fn(&lock);
@@ -208,8 +208,8 @@ test_ticketlock(void)
int ret = 0;
int i;
- /* slave cores should be waiting: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be waiting: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
@@ -217,25 +217,25 @@ test_ticketlock(void)
rte_ticketlock_init(&tl);
rte_ticketlock_init(&tl_try);
rte_ticketlock_recursive_init(&tlr);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_ticketlock_init(&tl_tab[i]);
}
rte_ticketlock_lock(&tl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_ticketlock_lock(&tl_tab[i]);
rte_eal_remote_launch(test_ticketlock_per_core, NULL, i);
}
- /* slave cores should be busy: print it */
- RTE_LCORE_FOREACH_SLAVE(i) {
+ /* worker cores should be busy: print it */
+ RTE_LCORE_FOREACH_WORKER(i) {
printf("lcore %d state: %d\n", i,
(int) rte_eal_get_lcore_state(i));
}
rte_ticketlock_unlock(&tl);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_ticketlock_unlock(&tl_tab[i]);
rte_delay_ms(10);
}
@@ -254,7 +254,7 @@ test_ticketlock(void)
} else
rte_ticketlock_recursive_unlock(&tlr);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_ticketlock_recursive_per_core,
NULL, i);
}
@@ -264,19 +264,19 @@ test_ticketlock(void)
/*
* Test if it could return immediately from try-locking a locked object.
* Here it will lock the ticketlock object first, then launch all the
- * slave lcores to trylock the same ticketlock object.
- * All the slave lcores should give up try-locking a locked object and
+ * worker lcores to trylock the same ticketlock object.
+ * All the worker lcores should give up try-locking a locked object and
* return immediately, and then increase the "count" initialized with
* zero by one per times.
* We can check if the "count" is finally equal to the number of all
- * slave lcores to see if the behavior of try-locking a locked
+ * worker lcores to see if the behavior of try-locking a locked
* ticketlock object is correct.
*/
if (rte_ticketlock_trylock(&tl_try) == 0)
return -1;
count = 0;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
rte_eal_remote_launch(test_ticketlock_try, NULL, i);
}
rte_eal_mp_wait_lcore();
diff --git a/app/test/test_timer.c b/app/test/test_timer.c
index 5933f56ed544..a10b2fe9daf4 100644
--- a/app/test/test_timer.c
+++ b/app/test/test_timer.c
@@ -37,7 +37,7 @@
* - All cores then simultaneously are set to schedule all the timers at
* the same time, so conflicts should occur.
* - Then there is a delay while we wait for the timers to expire
- * - Then the master lcore calls timer_manage() and we check that all
+ * - Then the main lcore calls timer_manage() and we check that all
* timers have had their callbacks called exactly once - no more no less.
* - Then we repeat the process, except after setting up the timers, we have
* all cores randomly reschedule them.
@@ -58,7 +58,7 @@
*
* - timer0
*
- * - At initialization, timer0 is loaded by the master core, on master core
+ * - At initialization, timer0 is loaded by the main core, on main core
* in "single" mode (time = 1 second).
* - In the first 19 callbacks, timer0 is reloaded on the same core,
* then, it is explicitly stopped at the 20th call.
@@ -66,21 +66,21 @@
*
* - timer1
*
- * - At initialization, timer1 is loaded by the master core, on the
- * master core in "single" mode (time = 2 seconds).
+ * - At initialization, timer1 is loaded by the main core, on the
+ * main core in "single" mode (time = 2 seconds).
* - In the first 9 callbacks, timer1 is reloaded on another
* core. After the 10th callback, timer1 is not reloaded anymore.
*
* - timer2
*
- * - At initialization, timer2 is loaded by the master core, on the
- * master core in "periodical" mode (time = 1 second).
+ * - At initialization, timer2 is loaded by the main core, on the
+ * main core in "periodical" mode (time = 1 second).
* - In the callback, when t=25s, it stops timer3 and reloads timer0
* on the current core.
*
* - timer3
*
- * - At initialization, timer3 is loaded by the master core, on
+ * - At initialization, timer3 is loaded by the main core, on
* another core in "periodical" mode (time = 1 second).
* - It is stopped at t=25s by timer2.
*/
@@ -201,68 +201,69 @@ timer_stress_main_loop(__rte_unused void *arg)
return 0;
}
-/* Need to synchronize slave lcores through multiple steps. */
-enum { SLAVE_WAITING = 1, SLAVE_RUN_SIGNAL, SLAVE_RUNNING, SLAVE_FINISHED };
-static rte_atomic16_t slave_state[RTE_MAX_LCORE];
+/* Need to synchronize worker lcores through multiple steps. */
+enum { WORKER_WAITING = 1, WORKER_RUN_SIGNAL, WORKER_RUNNING, WORKER_FINISHED };
+static rte_atomic16_t lcore_state[RTE_MAX_LCORE];
static void
-master_init_slaves(void)
+main_init_workers(void)
{
unsigned i;
- RTE_LCORE_FOREACH_SLAVE(i) {
- rte_atomic16_set(&slave_state[i], SLAVE_WAITING);
+ RTE_LCORE_FOREACH_WORKER(i) {
+ rte_atomic16_set(&lcore_state[i], WORKER_WAITING);
}
}
static void
-master_start_slaves(void)
+main_start_workers(void)
{
unsigned i;
- RTE_LCORE_FOREACH_SLAVE(i) {
- rte_atomic16_set(&slave_state[i], SLAVE_RUN_SIGNAL);
+ RTE_LCORE_FOREACH_WORKER(i) {
+ rte_atomic16_set(&lcore_state[i], WORKER_RUN_SIGNAL);
}
- RTE_LCORE_FOREACH_SLAVE(i) {
- while (rte_atomic16_read(&slave_state[i]) != SLAVE_RUNNING)
+ RTE_LCORE_FOREACH_WORKER(i) {
+ while (rte_atomic16_read(&lcore_state[i]) != WORKER_RUNNING)
rte_pause();
}
}
static void
-master_wait_for_slaves(void)
+main_wait_for_workers(void)
{
unsigned i;
- RTE_LCORE_FOREACH_SLAVE(i) {
- while (rte_atomic16_read(&slave_state[i]) != SLAVE_FINISHED)
+ RTE_LCORE_FOREACH_WORKER(i) {
+ while (rte_atomic16_read(&lcore_state[i]) != WORKER_FINISHED)
rte_pause();
}
}
static void
-slave_wait_to_start(void)
+worker_wait_to_start(void)
{
unsigned lcore_id = rte_lcore_id();
- while (rte_atomic16_read(&slave_state[lcore_id]) != SLAVE_RUN_SIGNAL)
+ while (rte_atomic16_read(&lcore_state[lcore_id]) != WORKER_RUN_SIGNAL)
rte_pause();
- rte_atomic16_set(&slave_state[lcore_id], SLAVE_RUNNING);
+ rte_atomic16_set(&lcore_state[lcore_id], WORKER_RUNNING);
}
static void
-slave_finish(void)
+worker_finish(void)
{
unsigned lcore_id = rte_lcore_id();
- rte_atomic16_set(&slave_state[lcore_id], SLAVE_FINISHED);
+ rte_atomic16_set(&lcore_state[lcore_id], WORKER_FINISHED);
}
static volatile int cb_count = 0;
/* callback for second stress test. will only be called
- * on master lcore */
+ * on main lcore
+ */
static void
timer_stress2_cb(struct rte_timer *tim __rte_unused, void *arg __rte_unused)
{
@@ -277,36 +278,36 @@ timer_stress2_main_loop(__rte_unused void *arg)
static struct rte_timer *timers;
int i, ret;
uint64_t delay = rte_get_timer_hz() / 20;
- unsigned lcore_id = rte_lcore_id();
- unsigned master = rte_get_master_lcore();
+ unsigned int lcore_id = rte_lcore_id();
+ unsigned int main_lcore = rte_get_main_lcore();
int32_t my_collisions = 0;
static rte_atomic32_t collisions;
- if (lcore_id == master) {
+ if (lcore_id == main_lcore) {
cb_count = 0;
test_failed = 0;
rte_atomic32_set(&collisions, 0);
- master_init_slaves();
+ main_init_workers();
timers = rte_malloc(NULL, sizeof(*timers) * NB_STRESS2_TIMERS, 0);
if (timers == NULL) {
printf("Test Failed\n");
printf("- Cannot allocate memory for timers\n" );
test_failed = 1;
- master_start_slaves();
+ main_start_workers();
goto cleanup;
}
for (i = 0; i < NB_STRESS2_TIMERS; i++)
rte_timer_init(&timers[i]);
- master_start_slaves();
+ main_start_workers();
} else {
- slave_wait_to_start();
+ worker_wait_to_start();
if (test_failed)
goto cleanup;
}
- /* have all cores schedule all timers on master lcore */
+ /* have all cores schedule all timers on main lcore */
for (i = 0; i < NB_STRESS2_TIMERS; i++) {
- ret = rte_timer_reset(&timers[i], delay, SINGLE, master,
+ ret = rte_timer_reset(&timers[i], delay, SINGLE, main_lcore,
timer_stress2_cb, NULL);
/* there will be collisions when multiple cores simultaneously
* configure the same timers */
@@ -320,14 +321,14 @@ timer_stress2_main_loop(__rte_unused void *arg)
rte_delay_ms(100);
/* all cores rendezvous */
- if (lcore_id == master) {
- master_wait_for_slaves();
+ if (lcore_id == main_lcore) {
+ main_wait_for_workers();
} else {
- slave_finish();
+ worker_finish();
}
/* now check that we get the right number of callbacks */
- if (lcore_id == master) {
+ if (lcore_id == main_lcore) {
my_collisions = rte_atomic32_read(&collisions);
if (my_collisions != 0)
printf("- %d timer reset collisions (OK)\n", my_collisions);
@@ -338,23 +339,23 @@ timer_stress2_main_loop(__rte_unused void *arg)
printf("- Expected %d callbacks, got %d\n", NB_STRESS2_TIMERS,
cb_count);
test_failed = 1;
- master_start_slaves();
+ main_start_workers();
goto cleanup;
}
cb_count = 0;
/* proceed */
- master_start_slaves();
+ main_start_workers();
} else {
/* proceed */
- slave_wait_to_start();
+ worker_wait_to_start();
if (test_failed)
goto cleanup;
}
/* now test again, just stop and restart timers at random after init*/
for (i = 0; i < NB_STRESS2_TIMERS; i++)
- rte_timer_reset(&timers[i], delay, SINGLE, master,
+ rte_timer_reset(&timers[i], delay, SINGLE, main_lcore,
timer_stress2_cb, NULL);
/* pick random timer to reset, stopping them first half the time */
@@ -362,7 +363,7 @@ timer_stress2_main_loop(__rte_unused void *arg)
int r = rand() % NB_STRESS2_TIMERS;
if (i % 2)
rte_timer_stop(&timers[r]);
- rte_timer_reset(&timers[r], delay, SINGLE, master,
+ rte_timer_reset(&timers[r], delay, SINGLE, main_lcore,
timer_stress2_cb, NULL);
}
@@ -370,8 +371,8 @@ timer_stress2_main_loop(__rte_unused void *arg)
rte_delay_ms(100);
/* now check that we get the right number of callbacks */
- if (lcore_id == master) {
- master_wait_for_slaves();
+ if (lcore_id == main_lcore) {
+ main_wait_for_workers();
rte_timer_manage();
if (cb_count != NB_STRESS2_TIMERS) {
@@ -386,14 +387,14 @@ timer_stress2_main_loop(__rte_unused void *arg)
}
cleanup:
- if (lcore_id == master) {
- master_wait_for_slaves();
+ if (lcore_id == main_lcore) {
+ main_wait_for_workers();
if (timers != NULL) {
rte_free(timers);
timers = NULL;
}
} else {
- slave_finish();
+ worker_finish();
}
return 0;
@@ -465,7 +466,7 @@ timer_basic_main_loop(__rte_unused void *arg)
int64_t diff = 0;
/* launch all timers on core 0 */
- if (lcore_id == rte_get_master_lcore()) {
+ if (lcore_id == rte_get_main_lcore()) {
mytimer_reset(&mytiminfo[0], hz/4, SINGLE, lcore_id,
timer_basic_cb);
mytimer_reset(&mytiminfo[1], hz/2, SINGLE, lcore_id,
@@ -563,7 +564,7 @@ test_timer(void)
/* start other cores */
printf("Start timer stress tests\n");
- rte_eal_mp_remote_launch(timer_stress_main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(timer_stress_main_loop, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
/* stop timer 0 used for stress test */
@@ -572,7 +573,7 @@ test_timer(void)
/* run a second, slightly different set of stress tests */
printf("\nStart timer stress tests 2\n");
test_failed = 0;
- rte_eal_mp_remote_launch(timer_stress2_main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(timer_stress2_main_loop, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
if (test_failed)
return TEST_FAILED;
@@ -584,7 +585,7 @@ test_timer(void)
/* start other cores */
printf("\nStart timer basic tests\n");
- rte_eal_mp_remote_launch(timer_basic_main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(timer_basic_main_loop, NULL, CALL_MAIN);
rte_eal_mp_wait_lcore();
/* stop all timers */
diff --git a/app/test/test_timer_racecond.c b/app/test/test_timer_racecond.c
index 28af9ca765ea..976badc0685d 100644
--- a/app/test/test_timer_racecond.c
+++ b/app/test/test_timer_racecond.c
@@ -56,8 +56,8 @@
static struct rte_timer timer[N_TIMERS];
static unsigned timer_lcore_id[N_TIMERS];
-static unsigned master;
-static volatile unsigned stop_slaves;
+static unsigned main_lcore;
+static volatile unsigned stop_workers;
static int reload_timer(struct rte_timer *tim);
@@ -90,7 +90,7 @@ reload_timer(struct rte_timer *tim)
(tim - timer);
int ret;
- ret = rte_timer_reset(tim, ticks, PERIODICAL, master, timer_cb, NULL);
+ ret = rte_timer_reset(tim, ticks, PERIODICAL, main_lcore, timer_cb, NULL);
if (ret != 0) {
rte_log(RTE_LOG_DEBUG, timer_logtype_test,
"- core %u failed to reset timer %" PRIuPTR " (OK)\n",
@@ -101,7 +101,7 @@ reload_timer(struct rte_timer *tim)
}
static int
-slave_main_loop(__rte_unused void *arg)
+worker_main_loop(__rte_unused void *arg)
{
unsigned lcore_id = rte_lcore_id();
unsigned i;
@@ -110,7 +110,7 @@ slave_main_loop(__rte_unused void *arg)
printf("Starting main loop on core %u\n", lcore_id);
- while (!stop_slaves) {
+ while (!stop_workers) {
/* Wait until the timer manager is running.
* We know it's running when we see timer[0] NOT pending.
*/
@@ -147,7 +147,7 @@ test_timer_racecond(void)
unsigned lcore_id;
unsigned i;
- master = lcore_id = rte_lcore_id();
+ main_lcore = lcore_id = rte_lcore_id();
hz = rte_get_timer_hz();
/* init and start timers */
@@ -156,8 +156,8 @@ test_timer_racecond(void)
ret = reload_timer(&timer[i]);
TEST_ASSERT(ret == 0, "reload_timer failed");
- /* Distribute timers to slaves.
- * Note that we assign timer[0] to the master.
+ /* Distribute timers to workers.
+ * Note that we assign timer[0] to the main.
*/
timer_lcore_id[i] = lcore_id;
lcore_id = rte_get_next_lcore(lcore_id, 1, 1);
@@ -167,11 +167,11 @@ test_timer_racecond(void)
cur_time = rte_get_timer_cycles();
end_time = cur_time + (hz * TEST_DURATION_S);
- /* start slave cores */
- stop_slaves = 0;
+ /* start worker cores */
+ stop_workers = 0;
printf("Start timer manage race condition test (%u seconds)\n",
TEST_DURATION_S);
- rte_eal_mp_remote_launch(slave_main_loop, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(worker_main_loop, NULL, SKIP_MAIN);
while (diff >= 0) {
/* run the timers */
@@ -184,9 +184,9 @@ test_timer_racecond(void)
diff = end_time - cur_time;
}
- /* stop slave cores */
+ /* stop worker cores */
printf("Stopping timer manage race condition test\n");
- stop_slaves = 1;
+ stop_workers = 1;
rte_eal_mp_wait_lcore();
/* stop timers */
diff --git a/app/test/test_timer_secondary.c b/app/test/test_timer_secondary.c
index 7a3bc873b359..1e8f1d45499a 100644
--- a/app/test/test_timer_secondary.c
+++ b/app/test/test_timer_secondary.c
@@ -26,7 +26,7 @@
#define launch_proc(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__)
struct test_info {
- unsigned int mstr_lcore;
+ unsigned int main_lcore;
unsigned int mgr_lcore;
unsigned int sec_lcore;
uint32_t timer_data_id;
@@ -137,12 +137,12 @@ test_timer_secondary(void)
TEST_ASSERT_SUCCESS(ret, "Failed to allocate timer data "
"instance");
- unsigned int *mstr_lcorep = &test_info->mstr_lcore;
+ unsigned int *main_lcorep = &test_info->main_lcore;
unsigned int *mgr_lcorep = &test_info->mgr_lcore;
unsigned int *sec_lcorep = &test_info->sec_lcore;
- *mstr_lcorep = rte_get_master_lcore();
- *mgr_lcorep = rte_get_next_lcore(*mstr_lcorep, 1, 1);
+ *main_lcorep = rte_get_main_lcore();
+ *mgr_lcorep = rte_get_next_lcore(*main_lcorep, 1, 1);
*sec_lcorep = rte_get_next_lcore(*mgr_lcorep, 1, 1);
ret = rte_eal_remote_launch(timer_manage_loop,
diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c
index 50c7381b77e7..e1ad8e6f555c 100644
--- a/app/test/test_trace_perf.c
+++ b/app/test/test_trace_perf.c
@@ -132,7 +132,7 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
memset(data, 0, sz);
data->nb_workers = rte_lcore_count() - 1;
- RTE_LCORE_FOREACH_SLAVE(id)
+ RTE_LCORE_FOREACH_WORKER(id)
rte_eal_remote_launch(f, &data->ldata[worker++], id);
wait_till_workers_are_ready(data);
@@ -140,7 +140,7 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
measure_perf(str, data);
signal_workers_to_finish(data);
- RTE_LCORE_FOREACH_SLAVE(id)
+ RTE_LCORE_FOREACH_WORKER(id)
rte_eal_wait_lcore(id);
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 09/17] app/test-pmd: replace master lcore with main lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (7 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 08/17] app/test: replace uses of master/slave Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 10/17] app/test-eventdev: replace use of " Stephen Hemminger
` (9 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Replace wording around main lcore.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-pmd/cmdline.c | 2 +-
app/test-pmd/config.c | 4 ++--
app/test-pmd/parameters.c | 2 +-
app/test-pmd/testpmd.c | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0a6ed85f3395..966dbb41c667 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -19709,7 +19709,7 @@ cmdline_read_from_file(const char *filename)
printf("Read CLI commands from %s\n", filename);
}
-/* prompt function, called from main on MASTER lcore */
+/* prompt function, called from main on MAIN lcore */
void
prompt(void)
{
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 30bee332481a..1e841f191702 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2683,9 +2683,9 @@ set_fwd_lcores_list(unsigned int *lcorelist, unsigned int nb_lc)
printf("lcore %u not enabled\n", lcore_cpuid);
return -1;
}
- if (lcore_cpuid == rte_get_master_lcore()) {
+ if (lcore_cpuid == rte_get_main_lcore()) {
printf("lcore %u cannot be masked on for running "
- "packet forwarding, which is the master lcore "
+ "packet forwarding, which is the main lcore "
"and reserved for command line parsing only\n",
lcore_cpuid);
return -1;
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 7cb0e3d6ec0a..6d10debc317d 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -88,7 +88,7 @@ usage(char* progname)
printf(" --nb-ports=N: set the number of forwarding ports "
"(1 <= N <= %d).\n", nb_ports);
printf(" --coremask=COREMASK: hexadecimal bitmask of cores running "
- "the packet forwarding test. The master lcore is reserved for "
+ "the packet forwarding test. The main lcore is reserved for "
"command line parsing only, and cannot be masked on for "
"packet forwarding.\n");
printf(" --portmask=PORTMASK: hexadecimal bitmask of ports used "
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 7842c3b78120..165e35f7e8a4 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -83,7 +83,7 @@
uint16_t verbose_level = 0; /**< Silent by default. */
int testpmd_logtype; /**< Log type for testpmd logs */
-/* use master core for command line ? */
+/* use main core for command line ? */
uint8_t interactive = 0;
uint8_t auto_start = 0;
uint8_t tx_first;
@@ -556,7 +556,7 @@ set_default_fwd_lcores_config(void)
}
socket_ids[num_sockets++] = sock_num;
}
- if (i == rte_get_master_lcore())
+ if (i == rte_get_main_lcore())
continue;
fwd_lcores_cpuids[nb_lc++] = i;
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 10/17] app/test-eventdev: replace use of master lcore with main lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (8 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 09/17] app/test-pmd: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 11/17] app: replace references to master/slave Stephen Hemminger
` (8 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Replace master with main lcore.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-eventdev/evt_options.c | 2 +-
app/test-eventdev/test_order_common.c | 12 ++++++------
app/test-eventdev/test_perf_common.c | 16 ++++++++--------
app/test-eventdev/test_pipeline_common.c | 11 +++++------
4 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index c60b61a904b0..6994ac453c8c 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -438,7 +438,7 @@ evt_options_dump(struct evt_options *opt)
evt_dump("verbose_level", "%d", opt->verbose_level);
evt_dump("socket_id", "%d", opt->socket_id);
evt_dump("pool_sz", "%d", opt->pool_sz);
- evt_dump("master lcore", "%d", rte_get_master_lcore());
+ evt_dump("main lcore", "%d", rte_get_main_lcore());
evt_dump("nb_pkts", "%"PRIu64, opt->nb_pkts);
evt_dump("nb_timers", "%"PRIu64, opt->nb_timers);
evt_dump_begin("available lcores");
diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c
index 4190f9ade82b..24ee6957bf9e 100644
--- a/app/test-eventdev/test_order_common.c
+++ b/app/test-eventdev/test_order_common.c
@@ -74,15 +74,15 @@ order_opt_check(struct evt_options *opt)
return -1;
}
- /* 1 producer + N workers + 1 master */
+ /* 1 producer + N workers + main */
if (rte_lcore_count() < 3) {
evt_err("test need minimum 3 lcores");
return -1;
}
/* Validate worker lcores */
- if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
- evt_err("worker lcores overlaps with master lcore");
+ if (evt_lcores_has_overlap(opt->wlcores, rte_get_main_lcore())) {
+ evt_err("worker lcores overlaps with main lcore");
return -1;
}
@@ -117,8 +117,8 @@ order_opt_check(struct evt_options *opt)
}
/* Validate producer lcore */
- if (plcore == (int)rte_get_master_lcore()) {
- evt_err("producer lcore and master lcore should be different");
+ if (plcore == (int)rte_get_main_lcore()) {
+ evt_err("producer lcore and main lcore should be different");
return -1;
}
if (!rte_lcore_is_enabled(plcore)) {
@@ -245,7 +245,7 @@ order_launch_lcores(struct evt_test *test, struct evt_options *opt,
int wkr_idx = 0;
/* launch workers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index b3af4bfecaff..955edb752671 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -254,7 +254,7 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
int port_idx = 0;
/* launch workers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
@@ -268,7 +268,7 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
}
/* launch producers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->plcores[lcore_id]))
continue;
@@ -541,8 +541,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
{
unsigned int lcores;
- /* N producer + N worker + 1 master when producer cores are used
- * Else N worker + 1 master when Rx adapter is used
+ /* N producer + N worker + main when producer cores are used
+ * Else N worker + main when Rx adapter is used
*/
lcores = opt->prod_type == EVT_PROD_TYPE_SYNT ? 3 : 2;
@@ -552,8 +552,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
}
/* Validate worker lcores */
- if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
- evt_err("worker lcores overlaps with master lcore");
+ if (evt_lcores_has_overlap(opt->wlcores, rte_get_main_lcore())) {
+ evt_err("worker lcores overlaps with main lcore");
return -1;
}
if (evt_lcores_has_overlap_multi(opt->wlcores, opt->plcores)) {
@@ -573,8 +573,8 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) {
/* Validate producer lcores */
if (evt_lcores_has_overlap(opt->plcores,
- rte_get_master_lcore())) {
- evt_err("producer lcores overlaps with master lcore");
+ rte_get_main_lcore())) {
+ evt_err("producer lcores overlaps with main lcore");
return -1;
}
if (evt_has_disabled_lcore(opt->plcores)) {
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 17088b1b48e4..4ac41a9ad1e3 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -60,7 +60,7 @@ pipeline_launch_lcores(struct evt_test *test, struct evt_options *opt,
int port_idx = 0;
/* launch workers */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (!(opt->wlcores[lcore_id]))
continue;
@@ -106,9 +106,8 @@ int
pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
{
unsigned int lcores;
- /*
- * N worker + 1 master
- */
+
+ /* N worker + main */
lcores = 2;
if (opt->prod_type != EVT_PROD_TYPE_ETH_RX_ADPTR) {
@@ -129,8 +128,8 @@ pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues)
}
/* Validate worker lcores */
- if (evt_lcores_has_overlap(opt->wlcores, rte_get_master_lcore())) {
- evt_err("worker lcores overlaps with master lcore");
+ if (evt_lcores_has_overlap(opt->wlcores, rte_get_main_lcore())) {
+ evt_err("worker lcores overlaps with main lcore");
return -1;
}
if (evt_has_disabled_lcore(opt->wlcores)) {
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 11/17] app: replace references to master/slave
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (9 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 10/17] app/test-eventdev: replace use of " Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 12/17] examples: replace use of master with main Stephen Hemminger
` (7 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
For the miscellaneous tests. Replace references to master lcore with
main lcore and slave lcore with worker lcore.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test-acl/main.c | 2 +-
app/test-bbdev/test_bbdev_perf.c | 16 ++++++++--------
app/test-compress-perf/main.c | 8 ++++----
app/test-crypto-perf/main.c | 14 +++++++-------
app/test-flow-perf/main.c | 2 +-
app/test-pipeline/main.c | 4 ++--
app/test-sad/main.c | 4 ++--
7 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/app/test-acl/main.c b/app/test-acl/main.c
index 0a5dfb621d5e..72ff26674dac 100644
--- a/app/test-acl/main.c
+++ b/app/test-acl/main.c
@@ -1085,7 +1085,7 @@ main(int argc, char **argv)
if (config.trace_file != NULL)
tracef_init();
- RTE_LCORE_FOREACH_SLAVE(lcore)
+ RTE_LCORE_FOREACH_WORKER(lcore)
rte_eal_remote_launch(search_ip5tuples, NULL, lcore);
search_ip5tuples(NULL);
diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 45c0d62acabc..da0c60dd9054 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3651,14 +3651,14 @@ bler_test(struct active_device *ad,
rte_atomic16_set(&op_params->sync, SYNC_WAIT);
- /* Master core is set at first entry */
+ /* Main core is set at first entry */
t_params[0].dev_id = ad->dev_id;
t_params[0].lcore_id = rte_lcore_id();
t_params[0].op_params = op_params;
t_params[0].queue_id = ad->queue_ids[used_cores++];
t_params[0].iter_count = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (used_cores >= num_lcores)
break;
@@ -3675,7 +3675,7 @@ bler_test(struct active_device *ad,
rte_atomic16_set(&op_params->sync, SYNC_START);
ret = bler_function(&t_params[0]);
- /* Master core is always used */
+ /* Main core is always used */
for (used_cores = 1; used_cores < num_lcores; used_cores++)
ret |= rte_eal_wait_lcore(t_params[used_cores].lcore_id);
@@ -3769,14 +3769,14 @@ throughput_test(struct active_device *ad,
rte_atomic16_set(&op_params->sync, SYNC_WAIT);
- /* Master core is set at first entry */
+ /* Main core is set at first entry */
t_params[0].dev_id = ad->dev_id;
t_params[0].lcore_id = rte_lcore_id();
t_params[0].op_params = op_params;
t_params[0].queue_id = ad->queue_ids[used_cores++];
t_params[0].iter_count = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (used_cores >= num_lcores)
break;
@@ -3793,7 +3793,7 @@ throughput_test(struct active_device *ad,
rte_atomic16_set(&op_params->sync, SYNC_START);
ret = throughput_function(&t_params[0]);
- /* Master core is always used */
+ /* Main core is always used */
for (used_cores = 1; used_cores < num_lcores; used_cores++)
ret |= rte_eal_wait_lcore(t_params[used_cores].lcore_id);
@@ -3817,7 +3817,7 @@ throughput_test(struct active_device *ad,
/* In interrupt TC we need to wait for the interrupt callback to deqeue
* all pending operations. Skip waiting for queues which reported an
* error using processing_status variable.
- * Wait for master lcore operations.
+ * Wait for main lcore operations.
*/
tp = &t_params[0];
while ((rte_atomic16_read(&tp->nb_dequeued) <
@@ -3830,7 +3830,7 @@ throughput_test(struct active_device *ad,
tp->mbps /= TEST_REPETITIONS;
ret |= (int)rte_atomic16_read(&tp->processing_status);
- /* Wait for slave lcores operations */
+ /* Wait for worker lcores operations */
for (used_cores = 1; used_cores < num_lcores; used_cores++) {
tp = &t_params[used_cores];
diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c
index ed21605d89c2..cc9951a9b107 100644
--- a/app/test-compress-perf/main.c
+++ b/app/test-compress-perf/main.c
@@ -389,7 +389,7 @@ main(int argc, char **argv)
i = 0;
uint8_t qp_id = 0, cdev_index = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -413,7 +413,7 @@ main(int argc, char **argv)
while (test_data->level <= test_data->level_lst.max) {
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -424,7 +424,7 @@ main(int argc, char **argv)
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -449,7 +449,7 @@ main(int argc, char **argv)
case ST_DURING_TEST:
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 8f8e580e4dc6..1b54f0902aee 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -594,7 +594,7 @@ main(int argc, char **argv)
i = 0;
uint8_t qp_id = 0, cdev_index = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -658,7 +658,7 @@ main(int argc, char **argv)
distribution_total[buffer_size_count - 1];
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -668,7 +668,7 @@ main(int argc, char **argv)
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -688,7 +688,7 @@ main(int argc, char **argv)
while (opts.test_buffer_size <= opts.max_buffer_size) {
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -698,7 +698,7 @@ main(int argc, char **argv)
i++;
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -722,7 +722,7 @@ main(int argc, char **argv)
}
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
@@ -742,7 +742,7 @@ main(int argc, char **argv)
err:
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (i == total_nb_qps)
break;
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 3589b316f9eb..b9fc3c02f744 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -1103,7 +1103,7 @@ main(int argc, char **argv)
if (enable_fwd) {
init_lcore_info();
- rte_eal_mp_remote_launch(start_forwarding, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(start_forwarding, NULL, CALL_MAIN);
}
RTE_ETH_FOREACH_DEV(port) {
diff --git a/app/test-pipeline/main.c b/app/test-pipeline/main.c
index 7f0d6d3f1862..c8ee4e8927a4 100644
--- a/app/test-pipeline/main.c
+++ b/app/test-pipeline/main.c
@@ -66,8 +66,8 @@ main(int argc, char **argv)
app_init();
/* Launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(app_lcore_main_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ rte_eal_mp_remote_launch(app_lcore_main_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore) {
if (rte_eal_wait_lcore(lcore) < 0)
return -1;
}
diff --git a/app/test-sad/main.c b/app/test-sad/main.c
index b01e84c570bb..e9c26e741621 100644
--- a/app/test-sad/main.c
+++ b/app/test-sad/main.c
@@ -657,11 +657,11 @@ main(int argc, char **argv)
add_rules(sad, 10);
if (config.parallel_lookup)
- rte_eal_mp_remote_launch(lookup, sad, SKIP_MASTER);
+ rte_eal_mp_remote_launch(lookup, sad, SKIP_MAIN);
lookup(sad);
if (config.parallel_lookup)
- RTE_LCORE_FOREACH_SLAVE(lcore_id)
+ RTE_LCORE_FOREACH_WORKER(lcore_id)
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 12/17] examples: replace use of master with main
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (10 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 11/17] app: replace references to master/slave Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 13/17] examples/multi_process: replace references to master/slave Stephen Hemminger
` (6 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Change references to master/slave lcore to main/worker.
For l2fwd, l3fwd and link_status examples.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/pdump/main.c | 2 +-
examples/ip_pipeline/thread.c | 14 +++++++-------
examples/l2fwd-cat/l2fwd-cat.c | 2 +-
examples/l2fwd-crypto/main.c | 6 +++---
examples/l2fwd-event/l2fwd_event_generic.c | 2 +-
examples/l2fwd-event/l2fwd_event_internal_port.c | 2 +-
examples/l2fwd-event/l2fwd_poll.c | 2 +-
examples/l2fwd-event/main.c | 2 +-
examples/l2fwd-jobstats/main.c | 2 +-
examples/l2fwd-keepalive/main.c | 2 +-
examples/l2fwd/main.c | 6 +++---
examples/l3fwd-acl/main.c | 2 +-
examples/l3fwd-graph/main.c | 14 +++++++-------
examples/l3fwd-power/main.c | 16 ++++++++--------
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 6 +++---
16 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index c38c53719e7d..b34bf335317b 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -947,7 +947,7 @@ dump_packets(void)
rte_exit(EXIT_FAILURE, "failed to wait\n");
}
- /* master core */
+ /* main core */
while (!quit_signal)
;
}
diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c
index adb83167cd84..46006f9d0265 100644
--- a/examples/ip_pipeline/thread.c
+++ b/examples/ip_pipeline/thread.c
@@ -32,7 +32,7 @@
#endif
/**
- * Master thead: data plane thread context
+ * Main thead: data plane thread context
*/
struct thread {
struct rte_ring *msgq_req;
@@ -78,7 +78,7 @@ struct thread_data {
static struct thread_data thread_data[RTE_MAX_LCORE];
/**
- * Master thread: data plane thread init
+ * Main thread: data plane thread init
*/
static void
thread_free(void)
@@ -137,7 +137,7 @@ thread_init(void)
return -1;
}
- /* Master thread records */
+ /* Main thread records */
t->msgq_req = msgq_req;
t->msgq_rsp = msgq_rsp;
t->enabled = 1;
@@ -179,7 +179,7 @@ pipeline_is_running(struct pipeline *p)
}
/**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
*/
enum thread_req_type {
THREAD_REQ_PIPELINE_ENABLE = 0,
@@ -213,7 +213,7 @@ struct thread_msg_rsp {
};
/**
- * Master thread
+ * Main thread
*/
static struct thread_msg_req *
thread_msg_alloc(void)
@@ -556,7 +556,7 @@ thread_msg_handle(struct thread_data *t)
}
/**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
*/
enum pipeline_req_type {
/* Port IN */
@@ -730,7 +730,7 @@ struct pipeline_msg_rsp {
};
/**
- * Master thread
+ * Main thread
*/
static struct pipeline_msg_req *
pipeline_msg_alloc(void)
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 45a497c082da..2e632c5cb6a5 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -198,7 +198,7 @@ main(int argc, char *argv[])
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main();
return 0;
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 827da9b3e38b..8b14a153d838 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -874,8 +874,8 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)
if (unlikely(timer_tsc >=
(uint64_t)timer_period)) {
- /* do this only on master core */
- if (lcore_id == rte_get_master_lcore()
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()
&& options->refresh_period) {
print_stats();
timer_tsc = 0;
@@ -2802,7 +2802,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, (void *)&options,
- CALL_MASTER);
+ CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/l2fwd-event/l2fwd_event_generic.c b/examples/l2fwd-event/l2fwd_event_generic.c
index 2dc95e5f7d1a..fda52680d8a0 100644
--- a/examples/l2fwd-event/l2fwd_event_generic.c
+++ b/examples/l2fwd-event/l2fwd_event_generic.c
@@ -72,7 +72,7 @@ l2fwd_event_device_setup_generic(struct l2fwd_resources *rsrc)
event_d_conf.nb_event_port_enqueue_depth =
dev_info.max_event_port_enqueue_depth;
- /* Ignore Master core and service cores. */
+ /* Ignore Main core and service cores. */
num_workers = rte_lcore_count() - 1 - rte_service_lcore_count();
if (dev_info.max_event_ports < num_workers)
num_workers = dev_info.max_event_ports;
diff --git a/examples/l2fwd-event/l2fwd_event_internal_port.c b/examples/l2fwd-event/l2fwd_event_internal_port.c
index 63d57b46c2da..84ed1c41158f 100644
--- a/examples/l2fwd-event/l2fwd_event_internal_port.c
+++ b/examples/l2fwd-event/l2fwd_event_internal_port.c
@@ -71,7 +71,7 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc)
event_d_conf.nb_event_port_enqueue_depth =
dev_info.max_event_port_enqueue_depth;
- /* Ignore Master core. */
+ /* Ignore Main core. */
num_workers = rte_lcore_count() - 1;
if (dev_info.max_event_ports < num_workers)
num_workers = dev_info.max_event_ports;
diff --git a/examples/l2fwd-event/l2fwd_poll.c b/examples/l2fwd-event/l2fwd_poll.c
index 2033c65e54b1..f7d8945a129b 100644
--- a/examples/l2fwd-event/l2fwd_poll.c
+++ b/examples/l2fwd-event/l2fwd_poll.c
@@ -116,7 +116,7 @@ l2fwd_poll_lcore_config(struct l2fwd_resources *rsrc)
/* get the lcore_id for this port */
while (rte_lcore_is_enabled(rx_lcore_id) == 0 ||
- rx_lcore_id == rte_get_master_lcore() ||
+ rx_lcore_id == rte_get_main_lcore() ||
poll_rsrc->lcore_queue_conf[rx_lcore_id].n_rx_port ==
rsrc->rx_queue_per_lcore) {
rx_lcore_id++;
diff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c
index 6f2076696a93..caa7304912ee 100644
--- a/examples/l2fwd-event/main.c
+++ b/examples/l2fwd-event/main.c
@@ -670,7 +670,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, rsrc,
- SKIP_MASTER);
+ SKIP_MAIN);
l2fwd_event_print_stats(rsrc);
if (rsrc->event_mode) {
struct l2fwd_event_resources *evt_rsrc =
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 29d570584005..08ffd27bc4d8 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -1019,7 +1019,7 @@ main(int argc, char **argv)
RTE_LOG(INFO, L2FWD, "Stats display disabled\n");
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 35d10e5a0ee6..468fe6afdef4 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -789,7 +789,7 @@ main(int argc, char **argv)
) != 0 )
rte_exit(EXIT_FAILURE, "Stats setup failure.\n");
}
- /* launch per-lcore init on every slave lcore */
+ /* launch per-lcore init on every worker lcore */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
struct lcore_queue_conf *qconf = &lcore_queue_conf[lcore_id];
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index b5fb90562447..d5ec1201ba63 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -260,8 +260,8 @@ l2fwd_main_loop(void)
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= timer_period)) {
- /* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
timer_tsc = 0;
@@ -887,7 +887,7 @@ main(int argc, char **argv)
ret = 0;
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0) {
ret = -1;
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 112ec3d2cc98..f9f4542b3371 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2107,7 +2107,7 @@ main(int argc, char **argv)
check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c
index d3fcf411ce5c..6698e916d06c 100644
--- a/examples/l3fwd-graph/main.c
+++ b/examples/l3fwd-graph/main.c
@@ -167,8 +167,8 @@ check_lcore_params(void)
return -1;
}
- if (lcore == rte_get_master_lcore()) {
- printf("Error: lcore %u is master lcore\n", lcore);
+ if (lcore == rte_get_main_lcore()) {
+ printf("Error: lcore %u is main lcore\n", lcore);
return -1;
}
socketid = rte_lcore_to_socket_id(lcore);
@@ -1096,16 +1096,16 @@ main(int argc, char **argv)
route_str, i);
}
- /* Launch per-lcore init on every slave lcore */
- rte_eal_mp_remote_launch(graph_main_loop, NULL, SKIP_MASTER);
+ /* Launch per-lcore init on every worker lcore */
+ rte_eal_mp_remote_launch(graph_main_loop, NULL, SKIP_MAIN);
- /* Accumulate and print stats on master until exit */
+ /* Accumulate and print stats on main until exit */
if (rte_graph_has_stats_feature())
print_stats();
- /* Wait for slave cores to exit */
+ /* Wait for worker cores to exit */
ret = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
ret = rte_eal_wait_lcore(lcore_id);
/* Destroy graph */
if (ret < 0 || rte_graph_destroy(
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index afa38c158c45..00a551d8ace1 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1514,7 +1514,7 @@ check_lcore_params(void)
"off\n", lcore, socketid);
}
if (app_mode == APP_MODE_TELEMETRY && lcore == rte_lcore_id()) {
- printf("cannot enable master core %d in config for telemetry mode\n",
+ printf("cannot enable main core %d in config for telemetry mode\n",
rte_lcore_id());
return -1;
}
@@ -2379,10 +2379,10 @@ launch_timer(unsigned int lcore_id)
RTE_SET_USED(lcore_id);
- if (rte_get_master_lcore() != lcore_id) {
- rte_panic("timer on lcore:%d which is not master core:%d\n",
+ if (rte_get_main_lcore() != lcore_id) {
+ rte_panic("timer on lcore:%d which is not main core:%d\n",
lcore_id,
- rte_get_master_lcore());
+ rte_get_main_lcore());
}
RTE_LOG(INFO, POWER, "Bring up the Timer\n");
@@ -2763,11 +2763,11 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
if (app_mode == APP_MODE_LEGACY) {
- rte_eal_mp_remote_launch(main_legacy_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_legacy_loop, NULL, CALL_MAIN);
} else if (app_mode == APP_MODE_EMPTY_POLL) {
empty_poll_stop = false;
rte_eal_mp_remote_launch(main_empty_poll_loop, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
} else if (app_mode == APP_MODE_TELEMETRY) {
unsigned int i;
@@ -2791,9 +2791,9 @@ main(int argc, char **argv)
handle_app_stats,
"Returns global power stats. Parameters: None");
rte_eal_mp_remote_launch(main_telemetry_loop, NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
} else if (app_mode == APP_MODE_INTERRUPT) {
- rte_eal_mp_remote_launch(main_intr_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(main_intr_loop, NULL, CALL_MAIN);
}
if (app_mode == APP_MODE_EMPTY_POLL || app_mode == APP_MODE_TELEMETRY)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index de6c62293aff..6bdda9fa5f89 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1275,7 +1275,7 @@ main(int argc, char **argv)
ret = 0;
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MAIN);
if (evt_rsrc->enabled) {
for (i = 0; i < evt_rsrc->rx_adptr.nb_rx_adptr; i++)
rte_event_eth_rx_adapter_stop(
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index d1ce6abed5a2..3a920f616c3c 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -255,8 +255,8 @@ lsi_main_loop(void)
/* if timer has reached its timeout */
if (unlikely(timer_tsc >= (uint64_t) timer_period)) {
- /* do this only on master core */
- if (lcore_id == rte_get_master_lcore()) {
+ /* do this only on main core */
+ if (lcore_id == rte_get_main_lcore()) {
print_stats();
/* reset the timer */
timer_tsc = 0;
@@ -732,7 +732,7 @@ main(int argc, char **argv)
check_all_ports_link_status(nb_ports, lsi_enabled_port_mask);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(lsi_launch_one_lcore, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lsi_launch_one_lcore, NULL, CALL_MAIN);
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 13/17] examples/multi_process: replace references to master/slave
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (11 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 12/17] examples: replace use of master with main Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 14/17] examples/performance-thread: replace reference to master lcore Stephen Hemminger
` (5 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Replace master with main and slave with worker.
Fix the wording in comments.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
.../multi_process/client_server_mp/mp_server/main.c | 10 +++++-----
examples/multi_process/simple_mp/main.c | 4 ++--
examples/multi_process/symmetric_mp/main.c | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index 280dab867281..ec7f6b11f30e 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -84,7 +84,7 @@ get_printable_mac_addr(uint16_t port)
/*
* This function displays the recorded statistics for each port
* and for each client. It uses ANSI terminal codes to clear
- * screen when called. It is called from a single non-master
+ * screen when called. It is called from a single worker
* thread in the server process, when the process is run with more
* than one lcore enabled.
*/
@@ -146,7 +146,7 @@ do_stats_display(void)
}
/*
- * The function called from each non-master lcore used by the process.
+ * The function called from each worker lcore used by the process.
* The test_and_set function is used to randomly pick a single lcore on which
* the code to display the statistics will run. Otherwise, the code just
* repeatedly sleeps.
@@ -244,7 +244,7 @@ process_packets(uint32_t port_num __rte_unused,
}
/*
- * Function called by the master lcore of the DPDK process.
+ * Function called by the main lcore of the DPDK process.
*/
static void
do_packet_forwarding(void)
@@ -297,8 +297,8 @@ main(int argc, char *argv[])
/* clear statistics */
clear_stats();
- /* put all other cores to sleep bar master */
- rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MASTER);
+ /* put all other cores to sleep except main */
+ rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MAIN);
do_packet_forwarding();
return 0;
diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c
index fc79528462e9..86b7d244a91f 100644
--- a/examples/multi_process/simple_mp/main.c
+++ b/examples/multi_process/simple_mp/main.c
@@ -108,12 +108,12 @@ main(int argc, char **argv)
RTE_LOG(INFO, APP, "Finished Process Init.\n");
- /* call lcore_recv() on every slave lcore */
+ /* call lcore_recv() on every worker lcore */
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
rte_eal_remote_launch(lcore_recv, NULL, lcore_id);
}
- /* call cmd prompt on master lcore */
+ /* call cmd prompt on main lcore */
struct cmdline *cl = cmdline_stdin_new(simple_mp_ctx, "\nsimple_mp > ");
if (cl == NULL)
rte_exit(EXIT_FAILURE, "Cannot create cmdline instance\n");
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 9a16e198cbf4..95ef436c56eb 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -473,7 +473,7 @@ main(int argc, char **argv)
RTE_LOG(INFO, APP, "Finished Process Init.\n");
- rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN);
return 0;
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 14/17] examples/performance-thread: replace reference to master lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (12 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 13/17] examples/multi_process: replace references to master/slave Stephen Hemminger
@ 2020-09-14 18:19 ` Stephen Hemminger
2020-09-14 18:20 ` [dpdk-dev] [PATCH v2 15/17] examples/qos: replace references to master Stephen Hemminger
` (4 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:19 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Replace term master with main here.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/performance-thread/l3fwd-thread/main.c | 16 ++++++++--------
examples/performance-thread/pthread_shim/main.c | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index e32802aa9b8b..c0060fd79421 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -2211,7 +2211,7 @@ lthread_rx(void *dummy)
/*
* Start scheduler with initial lthread on lcore
*
- * This lthread loop spawns all rx and tx lthreads on master lcore
+ * This lthread loop spawns all rx and tx lthreads on main lcore
*/
static void *
@@ -2261,11 +2261,11 @@ lthread_spawner(__rte_unused void *arg)
}
/*
- * Start master scheduler with initial lthread spawning rx and tx lthreads
- * (main_lthread_master).
+ * Start main scheduler with initial lthread spawning rx and tx lthreads
+ * (main_lthread_main).
*/
static int
-lthread_master_spawner(__rte_unused void *arg) {
+lthread_main_spawner(__rte_unused void *arg) {
struct lthread *lt;
int lcore_id = rte_lcore_id();
@@ -3762,14 +3762,14 @@ main(int argc, char **argv)
#endif
lthread_num_schedulers_set(nb_lcores);
- rte_eal_mp_remote_launch(sched_spawner, NULL, SKIP_MASTER);
- lthread_master_spawner(NULL);
+ rte_eal_mp_remote_launch(sched_spawner, NULL, SKIP_MAIN);
+ lthread_main_spawner(NULL);
} else {
printf("Starting P-Threading Model\n");
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(pthread_run, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(pthread_run, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c
index 18f83059bc17..23e3b5e311cd 100644
--- a/examples/performance-thread/pthread_shim/main.c
+++ b/examples/performance-thread/pthread_shim/main.c
@@ -252,10 +252,10 @@ int main(int argc, char **argv)
lthread_num_schedulers_set(num_sched);
/* launch all threads */
- rte_eal_mp_remote_launch(lthread_scheduler, (void *)NULL, CALL_MASTER);
+ rte_eal_mp_remote_launch(lthread_scheduler, (void *)NULL, CALL_MAIN);
/* wait for threads to stop */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_wait_lcore(lcore_id);
}
return 0;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 15/17] examples/qos: replace references to master
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (13 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 14/17] examples/performance-thread: replace reference to master lcore Stephen Hemminger
@ 2020-09-14 18:20 ` Stephen Hemminger
2020-09-14 18:20 ` [dpdk-dev] [PATCH v2 16/17] examples/ipsec-secgw: replace master lcore with main lcore Stephen Hemminger
` (3 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:20 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Use main instead of master in the QoS examples.
Replace the "mst" command line argument with "mnc"
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/qos_meter/main.c | 4 ++--
examples/qos_sched/args.c | 26 +++++++++++++-------------
examples/qos_sched/cmdline.c | 2 +-
examples/qos_sched/main.c | 2 +-
4 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index ce87b2eca262..f2d9c28828ab 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -454,8 +454,8 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Invalid configure flow table\n");
/* Launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index 7431b29816aa..c627196230b6 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -22,7 +22,7 @@
#define MAX_OPT_VALUES 8
#define SYS_CPU_DIR "/sys/devices/system/cpu/cpu%u/topology/"
-static uint32_t app_master_core = 1;
+static uint32_t app_main_core = 1;
static uint32_t app_numa_mask;
static uint64_t app_used_core_mask = 0;
static uint64_t app_used_port_mask = 0;
@@ -40,7 +40,7 @@ static const char usage[] =
" \n"
"Application optional parameters: \n"
" --i : run in interactive mode (default value is %u) \n"
- " --mst I : master core index (default value is %u) \n"
+ " --mnc I : main core index (default value is %u) \n"
" --rsz \"A, B, C\" : Ring sizes \n"
" A = Size (in number of buffer descriptors) of each of the NIC RX \n"
" rings read by the I/O RX lcores (default value is %u) \n"
@@ -72,7 +72,7 @@ static const char usage[] =
static void
app_usage(const char *prgname)
{
- printf(usage, prgname, APP_INTERACTIVE_DEFAULT, app_master_core,
+ printf(usage, prgname, APP_INTERACTIVE_DEFAULT, app_main_core,
APP_RX_DESC_DEFAULT, APP_RING_SIZE, APP_TX_DESC_DEFAULT,
MAX_PKT_RX_BURST, PKT_ENQUEUE, PKT_DEQUEUE,
MAX_PKT_TX_BURST, NB_MBUF,
@@ -98,7 +98,7 @@ app_eal_core_mask(void)
cm |= (1ULL << i);
}
- cm |= (1ULL << rte_get_master_lcore());
+ cm |= (1ULL << rte_get_main_lcore());
return cm;
}
@@ -312,7 +312,7 @@ app_parse_args(int argc, char **argv)
static struct option lgopts[] = {
{ "pfc", 1, 0, 0 },
- { "mst", 1, 0, 0 },
+ { "mnc", 1, 0, 0 },
{ "rsz", 1, 0, 0 },
{ "bsz", 1, 0, 0 },
{ "msz", 1, 0, 0 },
@@ -352,8 +352,8 @@ app_parse_args(int argc, char **argv)
}
break;
}
- if (str_is(optname, "mst")) {
- app_master_core = (uint32_t)atoi(optarg);
+ if (str_is(optname, "mnc")) {
+ app_main_core = (uint32_t)atoi(optarg);
break;
}
if (str_is(optname, "rsz")) {
@@ -408,18 +408,18 @@ app_parse_args(int argc, char **argv)
}
}
- /* check master core index validity */
- for(i = 0; i <= app_master_core; i++) {
- if (app_used_core_mask & (1u << app_master_core)) {
- RTE_LOG(ERR, APP, "Master core index is not configured properly\n");
+ /* check main core index validity */
+ for (i = 0; i <= app_main_core; i++) {
+ if (app_used_core_mask & (1u << app_main_core)) {
+ RTE_LOG(ERR, APP, "Main core index is not configured properly\n");
app_usage(prgname);
return -1;
}
}
- app_used_core_mask |= 1u << app_master_core;
+ app_used_core_mask |= 1u << app_main_core;
if ((app_used_core_mask != app_eal_core_mask()) ||
- (app_master_core != rte_get_master_lcore())) {
+ (app_main_core != rte_get_main_lcore())) {
RTE_LOG(ERR, APP, "EAL core mask not configured properly, must be %" PRIx64
" instead of %" PRIx64 "\n" , app_used_core_mask, app_eal_core_mask());
return -1;
diff --git a/examples/qos_sched/cmdline.c b/examples/qos_sched/cmdline.c
index ba68e0d02693..1cf7ea97abbf 100644
--- a/examples/qos_sched/cmdline.c
+++ b/examples/qos_sched/cmdline.c
@@ -599,7 +599,7 @@ cmdline_parse_ctx_t main_ctx[] = {
NULL,
};
-/* prompt function, called from main on MASTER lcore */
+/* prompt function, called from main on MAIN lcore */
void
prompt(void)
{
diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c
index 73864d66dbc8..a6071b991c76 100644
--- a/examples/qos_sched/main.c
+++ b/examples/qos_sched/main.c
@@ -204,7 +204,7 @@ main(int argc, char **argv)
return -1;
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(app_main_loop, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(app_main_loop, NULL, SKIP_MAIN);
if (interactive) {
sleep(1);
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 16/17] examples/ipsec-secgw: replace master lcore with main lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (14 preceding siblings ...)
2020-09-14 18:20 ` [dpdk-dev] [PATCH v2 15/17] examples/qos: replace references to master Stephen Hemminger
@ 2020-09-14 18:20 ` Stephen Hemminger
2020-09-14 18:20 ` [dpdk-dev] [PATCH v2 17/17] examples: " Stephen Hemminger
` (2 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:20 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Simple replacement.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/ipsec-secgw/event_helper.c | 6 +++---
examples/ipsec-secgw/ipsec-secgw.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/examples/ipsec-secgw/event_helper.c b/examples/ipsec-secgw/event_helper.c
index 865dc911b864..bd60f0359b59 100644
--- a/examples/ipsec-secgw/event_helper.c
+++ b/examples/ipsec-secgw/event_helper.c
@@ -1461,16 +1461,16 @@ eh_conf_init(void)
/* Set two cores as eth cores for Rx & Tx */
- /* Use first core other than master core as Rx core */
+ /* Use first core other than main core as Rx core */
eth_core_id = rte_get_next_lcore(0, /* curr core */
- 1, /* skip master core */
+ 1, /* skip main core */
0 /* wrap */);
rte_bitmap_set(em_conf->eth_core_mask, eth_core_id);
/* Use next core as Tx core */
eth_core_id = rte_get_next_lcore(eth_core_id, /* curr core */
- 1, /* skip master core */
+ 1, /* skip main core */
0 /* wrap */);
rte_bitmap_set(em_conf->eth_core_mask, eth_core_id);
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 8ba15d23c7e8..339221eecf55 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -2992,8 +2992,8 @@ main(int32_t argc, char **argv)
#endif /* STATS_INTERVAL */
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(ipsec_launch_one_lcore, eh_conf, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(ipsec_launch_one_lcore, eh_conf, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v2 17/17] examples: replace master lcore with main lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (15 preceding siblings ...)
2020-09-14 18:20 ` [dpdk-dev] [PATCH v2 16/17] examples/ipsec-secgw: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-14 18:20 ` Stephen Hemminger
2020-09-15 10:09 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Burakov, Anatoly
2020-10-13 15:25 ` [dpdk-dev] [PATCH v5 00/18] " Stephen Hemminger
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-14 18:20 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace use of the term master lcore with main lcore in
the example programs.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/bbdev_app/main.c | 14 +++++------
examples/bond/main.c | 32 ++++++++++++-------------
examples/distributor/main.c | 10 ++++----
examples/ethtool/ethtool-app/main.c | 11 +++++----
examples/eventdev_pipeline/main.c | 2 +-
examples/flow_classify/flow_classify.c | 2 +-
examples/helloworld/main.c | 6 ++---
examples/ioat/ioatfwd.c | 6 ++---
examples/ip_fragmentation/main.c | 4 ++--
examples/ip_pipeline/main.c | 2 +-
examples/ip_pipeline/thread.c | 2 +-
examples/ip_reassembly/main.c | 4 ++--
examples/ipv4_multicast/main.c | 4 ++--
examples/kni/main.c | 6 ++---
examples/l2fwd-crypto/main.c | 2 +-
examples/l2fwd-jobstats/main.c | 2 +-
examples/l2fwd-keepalive/main.c | 4 ++--
examples/l2fwd/main.c | 2 +-
examples/l3fwd-acl/main.c | 2 +-
examples/l3fwd-power/main.c | 6 ++---
examples/link_status_interrupt/main.c | 2 +-
examples/multi_process/simple_mp/main.c | 2 +-
examples/ntb/ntb_fwd.c | 14 +++++------
examples/packet_ordering/main.c | 22 ++++++++---------
examples/ptpclient/ptpclient.c | 4 ++--
examples/rxtx_callbacks/main.c | 2 +-
examples/server_node_efd/server/main.c | 10 ++++----
examples/skeleton/basicfwd.c | 2 +-
examples/tep_termination/main.c | 12 +++++-----
examples/timer/main.c | 8 +++----
examples/vhost/main.c | 10 ++++----
examples/vmdq/main.c | 4 ++--
examples/vmdq_dcb/main.c | 6 ++---
33 files changed, 111 insertions(+), 110 deletions(-)
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 68a46050c048..8bbb41dd3fb4 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -1042,7 +1042,7 @@ main(int argc, char **argv)
struct stats_lcore_params stats_lcore;
struct rte_ring *enc_to_dec_ring;
bool stats_thread_started = false;
- unsigned int master_lcore_id = rte_get_master_lcore();
+ unsigned int main_lcore_id = rte_get_main_lcore();
rte_atomic16_init(&global_exit_flag);
@@ -1145,9 +1145,9 @@ main(int argc, char **argv)
stats_lcore.app_params = &app_params;
stats_lcore.lconf = lcore_conf;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (lcore_conf[lcore_id].core_type != 0)
- /* launch per-lcore processing loop on slave lcores */
+ /* launch per-lcore processing loop on worker lcores */
rte_eal_remote_launch(processing_loop,
&lcore_conf[lcore_id], lcore_id);
else if (!stats_thread_started) {
@@ -1159,15 +1159,15 @@ main(int argc, char **argv)
}
if (!stats_thread_started &&
- lcore_conf[master_lcore_id].core_type != 0)
+ lcore_conf[main_lcore_id].core_type != 0)
rte_exit(EXIT_FAILURE,
"Not enough lcores to run the statistics printing loop!");
- else if (lcore_conf[master_lcore_id].core_type != 0)
- processing_loop(&lcore_conf[master_lcore_id]);
+ else if (lcore_conf[main_lcore_id].core_type != 0)
+ processing_loop(&lcore_conf[main_lcore_id]);
else if (!stats_thread_started)
stats_loop(&stats_lcore);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
ret |= rte_eal_wait_lcore(lcore_id);
}
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 8608285b686e..398553b7853f 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -573,7 +573,7 @@ static void cmd_start_parsed(__rte_unused void *parsed_result,
struct cmdline *cl,
__rte_unused void *data)
{
- int slave_core_id = rte_lcore_id();
+ int worker_core_id = rte_lcore_id();
rte_spinlock_trylock(&global_flag_stru_p->lock);
if (global_flag_stru_p->LcoreMainIsRunning == 0) {
@@ -590,9 +590,9 @@ static void cmd_start_parsed(__rte_unused void *parsed_result,
return;
}
- /* start lcore main on core != master_core - ARP response thread */
- slave_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
- if ((slave_core_id >= RTE_MAX_LCORE) || (slave_core_id == 0))
+ /* start lcore main on core != main_core - ARP response thread */
+ worker_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
+ if ((worker_core_id >= RTE_MAX_LCORE) || (worker_core_id == 0))
return;
rte_spinlock_trylock(&global_flag_stru_p->lock);
@@ -601,8 +601,8 @@ static void cmd_start_parsed(__rte_unused void *parsed_result,
cmdline_printf(cl,
"Starting lcore_main on core %d:%d "
"Our IP:%d.%d.%d.%d\n",
- slave_core_id,
- rte_eal_remote_launch(lcore_main, NULL, slave_core_id),
+ worker_core_id,
+ rte_eal_remote_launch(lcore_main, NULL, worker_core_id),
BOND_IP_1,
BOND_IP_2,
BOND_IP_3,
@@ -802,7 +802,7 @@ cmdline_parse_ctx_t main_ctx[] = {
NULL,
};
-/* prompt function, called from main on MASTER lcore */
+/* prompt function, called from main on MAIN lcore */
static void prompt(__rte_unused void *arg1)
{
struct cmdline *cl;
@@ -818,7 +818,7 @@ static void prompt(__rte_unused void *arg1)
int
main(int argc, char *argv[])
{
- int ret, slave_core_id;
+ int ret, worker_core_id;
uint16_t nb_ports, i;
/* init EAL */
@@ -852,23 +852,23 @@ main(int argc, char *argv[])
rte_spinlock_init(&global_flag_stru_p->lock);
/* check state of lcores */
- RTE_LCORE_FOREACH_SLAVE(slave_core_id) {
- if (rte_eal_get_lcore_state(slave_core_id) != WAIT)
+ RTE_LCORE_FOREACH_WORKER(worker_core_id) {
+ if (rte_eal_get_lcore_state(worker_core_id) != WAIT)
return -EBUSY;
}
- /* start lcore main on core != master_core - ARP response thread */
- slave_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
- if ((slave_core_id >= RTE_MAX_LCORE) || (slave_core_id == 0))
+ /* start lcore main on core != main_core - ARP response thread */
+ worker_core_id = rte_get_next_lcore(rte_lcore_id(), 1, 0);
+ if ((worker_core_id >= RTE_MAX_LCORE) || (worker_core_id == 0))
return -EPERM;
global_flag_stru_p->LcoreMainIsRunning = 1;
- global_flag_stru_p->LcoreMainCore = slave_core_id;
+ global_flag_stru_p->LcoreMainCore = worker_core_id;
printf("Starting lcore_main on core %d:%d Our IP:%d.%d.%d.%d\n",
- slave_core_id,
+ worker_core_id,
rte_eal_remote_launch((lcore_function_t *)lcore_main,
NULL,
- slave_core_id),
+ worker_core_id),
BOND_IP_1,
BOND_IP_2,
BOND_IP_3,
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index dca48c2abd7d..caa7c46cb1e8 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -612,7 +612,7 @@ static int
init_power_library(void)
{
int ret = 0, lcore_id;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
/* init power management library */
ret = rte_power_init(lcore_id);
if (ret) {
@@ -805,7 +805,7 @@ main(int argc, char *argv[])
* available, the higher frequency cores will go to the
* distributor first, then rx, then tx.
*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_power_get_capabilities(lcore_id, &lcore_cap);
@@ -838,7 +838,7 @@ main(int argc, char *argv[])
* after the high performing core assignment above, pre-assign
* them here.
*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (lcore_id == (unsigned int)distr_core_id ||
lcore_id == (unsigned int)rx_core_id ||
lcore_id == (unsigned int)tx_core_id)
@@ -869,7 +869,7 @@ main(int argc, char *argv[])
* Kick off all the worker threads first, avoiding the pre-assigned
* lcore_ids for tx, rx and distributor workloads.
*/
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (lcore_id == (unsigned int)distr_core_id ||
lcore_id == (unsigned int)rx_core_id ||
lcore_id == (unsigned int)tx_core_id)
@@ -922,7 +922,7 @@ main(int argc, char *argv[])
usleep(1000);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index 7383413215d6..c6023a1d41bd 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -176,7 +176,7 @@ static void process_frame(struct app_port *ptr_port,
rte_ether_addr_copy(&ptr_port->mac_addr, &ptr_mac_hdr->s_addr);
}
-static int slave_main(__rte_unused void *ptr_data)
+static int worker_main(__rte_unused void *ptr_data)
{
struct app_port *ptr_port;
struct rte_mbuf *ptr_frame;
@@ -284,16 +284,17 @@ int main(int argc, char **argv)
app_cfg.cnt_ports = cnt_ports;
if (rte_lcore_count() < 2)
- rte_exit(EXIT_FAILURE, "No available slave core!\n");
- /* Assume there is an available slave.. */
+ rte_exit(EXIT_FAILURE, "No available worker core!\n");
+
+ /* Assume there is an available worker.. */
id_core = rte_lcore_id();
id_core = rte_get_next_lcore(id_core, 1, 1);
- rte_eal_remote_launch(slave_main, NULL, id_core);
+ rte_eal_remote_launch(worker_main, NULL, id_core);
ethapp_main();
app_cfg.exit_now = 1;
- RTE_LCORE_FOREACH_SLAVE(id_core) {
+ RTE_LCORE_FOREACH_WORKER(id_core) {
if (rte_eal_wait_lcore(id_core) < 0)
return -1;
}
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 4ac5821539f4..08edc6782e16 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -395,7 +395,7 @@ main(int argc, char **argv)
}
int worker_idx = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (lcore_id >= MAX_NUM_CORE)
break;
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 433e64d3f901..335d7d2ad815 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -850,7 +850,7 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Failed to add rules\n");
}
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main(cls_app);
return 0;
diff --git a/examples/helloworld/main.c b/examples/helloworld/main.c
index 968045f1b042..8a4cee60ff07 100644
--- a/examples/helloworld/main.c
+++ b/examples/helloworld/main.c
@@ -34,12 +34,12 @@ main(int argc, char **argv)
if (ret < 0)
rte_panic("Cannot init EAL\n");
- /* call lcore_hello() on every slave lcore */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ /* call lcore_hello() on every worker lcore */
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(lcore_hello, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
lcore_hello(NULL);
rte_eal_mp_wait_lcore();
diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index 43a19843ee6b..34dd519818b0 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -520,7 +520,7 @@ tx_main_loop(void)
ioat_tx_port(&cfg.ports[i]);
}
-/* Main rx and tx loop if only one slave lcore available */
+/* Main rx and tx loop if only one worker lcore available */
static void
rxtx_main_loop(void)
{
@@ -984,7 +984,7 @@ main(int argc, char **argv)
cfg.nb_lcores = rte_lcore_count() - 1;
if (cfg.nb_lcores < 1)
rte_exit(EXIT_FAILURE,
- "There should be at least one slave lcore.\n");
+ "There should be at least one worker lcore.\n");
if (copy_mode == COPY_MODE_IOAT_NUM)
assign_rawdevs();
@@ -992,7 +992,7 @@ main(int argc, char **argv)
assign_rings();
start_forwarding_cores();
- /* master core prints stats while other cores forward */
+ /* main core prints stats while other cores forward */
print_stats(argv[0]);
/* force_quit is true when we get here */
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 4afb97109fed..fdba37cea013 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -1072,8 +1072,8 @@ main(int argc, char **argv)
check_all_ports_link_status(enabled_port_mask);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/ip_pipeline/main.c b/examples/ip_pipeline/main.c
index 97d1e91c2b4b..c4aba394314a 100644
--- a/examples/ip_pipeline/main.c
+++ b/examples/ip_pipeline/main.c
@@ -250,7 +250,7 @@ main(int argc, char **argv)
rte_eal_mp_remote_launch(
thread_main,
NULL,
- SKIP_MASTER);
+ SKIP_MAIN);
/* Script */
if (app.script_name)
diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c
index 46006f9d0265..df1045ee7a70 100644
--- a/examples/ip_pipeline/thread.c
+++ b/examples/ip_pipeline/thread.c
@@ -105,7 +105,7 @@ thread_init(void)
{
uint32_t i;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
char name[NAME_MAX];
struct rte_ring *msgq_req, *msgq_rsp;
struct thread *t = &thread[i];
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 550fb53becf3..23470cb8aedc 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -1198,8 +1198,8 @@ main(int argc, char **argv)
signal(SIGINT, signal_handler);
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 7e255c35a301..10b5ef27ef57 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -801,8 +801,8 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Cannot build the multicast hash\n");
/* launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/kni/main.c b/examples/kni/main.c
index f5d12a5b8676..6b7449b7039b 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -956,7 +956,7 @@ kni_alloc(uint16_t port_id)
conf.mbuf_size = MAX_PACKET_SZ;
/*
* The first KNI device associated to a port
- * is the master, for multiple kernel thread
+ * is the main, for multiple kernel thread
* environment.
*/
if (i == 0) {
@@ -1105,8 +1105,8 @@ main(int argc, char** argv)
"Could not create link status thread!\n");
/* Launch per-lcore function on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(i) {
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(i) {
if (rte_eal_wait_lcore(i) < 0)
return -1;
}
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 8b14a153d838..693fd554fdbc 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -2803,7 +2803,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, (void *)&options,
CALL_MAIN);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 08ffd27bc4d8..4e682bb8d558 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -1020,7 +1020,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MAIN);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 468fe6afdef4..ca2cc1c62a22 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -790,7 +790,7 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Stats setup failure.\n");
}
/* launch per-lcore init on every worker lcore */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
struct lcore_queue_conf *qconf = &lcore_queue_conf[lcore_id];
if (qconf->n_rx_port == 0)
@@ -813,7 +813,7 @@ main(int argc, char **argv)
rte_delay_ms(5);
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index d5ec1201ba63..1ee95ad8a9fb 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -888,7 +888,7 @@ main(int argc, char **argv)
ret = 0;
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(l2fwd_launch_one_lcore, NULL, CALL_MAIN);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0) {
ret = -1;
break;
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index f9f4542b3371..56e7dcbcfd58 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -2108,7 +2108,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 00a551d8ace1..6c64c5037232 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2287,7 +2287,7 @@ get_current_stat_values(uint64_t *values)
uint64_t app_eps = 0, app_fps = 0, app_br = 0;
uint64_t count = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
qconf = &lcore_conf[lcore_id];
if (qconf->n_rx_queue == 0)
continue;
@@ -2783,7 +2783,7 @@ main(int argc, char **argv)
else
rte_exit(EXIT_FAILURE, "failed to register metrics names");
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_spinlock_init(&stats[lcore_id].telemetry_lock);
}
rte_timer_init(&telemetry_timer);
@@ -2799,7 +2799,7 @@ main(int argc, char **argv)
if (app_mode == APP_MODE_EMPTY_POLL || app_mode == APP_MODE_TELEMETRY)
launch_timer(rte_lcore_id());
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 3a920f616c3c..a8b03e231ab0 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -733,7 +733,7 @@ main(int argc, char **argv)
/* launch per-lcore init on every lcore */
rte_eal_mp_remote_launch(lsi_launch_one_lcore, NULL, CALL_MAIN);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c
index 86b7d244a91f..109b8bb45dcc 100644
--- a/examples/multi_process/simple_mp/main.c
+++ b/examples/multi_process/simple_mp/main.c
@@ -109,7 +109,7 @@ main(int argc, char **argv)
RTE_LOG(INFO, APP, "Finished Process Init.\n");
/* call lcore_recv() on every worker lcore */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(lcore_recv, NULL, lcore_id);
}
diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index 5a8439b8d310..f333f451c896 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -162,7 +162,7 @@ cmd_quit_parsed(__rte_unused void *parsed_result,
uint32_t lcore_id;
/* Stop transmission first. */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
conf = &fwd_lcore_conf[lcore_id];
if (!conf->nb_stream)
@@ -668,7 +668,7 @@ assign_stream_to_lcores(void)
uint8_t lcore_num, nb_extra;
lcore_num = rte_lcore_count();
- /* Exclude master core */
+ /* Exclude main core */
lcore_num--;
nb_streams = (fwd_mode == IOFWD) ? num_queues * 2 : num_queues;
@@ -678,7 +678,7 @@ assign_stream_to_lcores(void)
sm_id = 0;
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
conf = &fwd_lcore_conf[lcore_id];
if (i < nb_extra) {
@@ -697,7 +697,7 @@ assign_stream_to_lcores(void)
}
/* Print packet forwading config. */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
conf = &fwd_lcore_conf[lcore_id];
if (!conf->nb_stream)
@@ -765,7 +765,7 @@ start_pkt_fwd(void)
assign_stream_to_lcores();
in_test = 1;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
conf = &fwd_lcore_conf[lcore_id];
if (!conf->nb_stream)
@@ -826,7 +826,7 @@ cmd_stop_parsed(__rte_unused void *parsed_result,
struct ntb_fwd_lcore_conf *conf;
uint32_t lcore_id;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
conf = &fwd_lcore_conf[lcore_id];
if (!conf->nb_stream)
@@ -1074,7 +1074,7 @@ cmdline_parse_ctx_t main_ctx[] = {
NULL,
};
-/* prompt function, called from main on MASTER lcore */
+/* prompt function, called from main on MAIN lcore */
static void
prompt(void)
{
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index b5fc6c54be56..a79d77a321ef 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -345,10 +345,10 @@ print_stats(void)
{
uint16_t i;
struct rte_eth_stats eth_stats;
- unsigned int lcore_id, last_lcore_id, master_lcore_id, end_w_lcore_id;
+ unsigned int lcore_id, last_lcore_id, main_lcore_id, end_w_lcore_id;
last_lcore_id = get_last_lcore_id();
- master_lcore_id = rte_get_master_lcore();
+ main_lcore_id = rte_get_main_lcore();
end_w_lcore_id = get_previous_lcore_id(last_lcore_id);
printf("\nRX thread stats:\n");
@@ -360,7 +360,7 @@ print_stats(void)
for (lcore_id = 0; lcore_id <= end_w_lcore_id; lcore_id++) {
if (insight_worker
&& rte_lcore_is_enabled(lcore_id)
- && lcore_id != master_lcore_id) {
+ && lcore_id != main_lcore_id) {
printf("\nWorker thread stats on core [%u]:\n",
lcore_id);
printf(" - Pkts deqd from workers ring: %"PRIu64"\n",
@@ -658,7 +658,7 @@ main(int argc, char **argv)
{
int ret;
unsigned nb_ports;
- unsigned int lcore_id, last_lcore_id, master_lcore_id;
+ unsigned int lcore_id, last_lcore_id, main_lcore_id;
uint16_t port_id;
uint16_t nb_ports_available;
struct worker_thread_args worker_args = {NULL, NULL};
@@ -745,32 +745,32 @@ main(int argc, char **argv)
}
last_lcore_id = get_last_lcore_id();
- master_lcore_id = rte_get_master_lcore();
+ main_lcore_id = rte_get_main_lcore();
worker_args.ring_in = rx_to_workers;
worker_args.ring_out = workers_to_tx;
- /* Start worker_thread() on all the available slave cores but the last 1 */
+ /* Start worker_thread() on all the available worker cores but the last 1 */
for (lcore_id = 0; lcore_id <= get_previous_lcore_id(last_lcore_id); lcore_id++)
- if (rte_lcore_is_enabled(lcore_id) && lcore_id != master_lcore_id)
+ if (rte_lcore_is_enabled(lcore_id) && lcore_id != main_lcore_id)
rte_eal_remote_launch(worker_thread, (void *)&worker_args,
lcore_id);
if (disable_reorder) {
- /* Start tx_thread() on the last slave core */
+ /* Start tx_thread() on the last worker core */
rte_eal_remote_launch((lcore_function_t *)tx_thread, workers_to_tx,
last_lcore_id);
} else {
send_args.ring_in = workers_to_tx;
- /* Start send_thread() on the last slave core */
+ /* Start send_thread() on the last worker core */
rte_eal_remote_launch((lcore_function_t *)send_thread,
(void *)&send_args, last_lcore_id);
}
- /* Start rx_thread() on the master core */
+ /* Start rx_thread() on the main core */
rx_thread(rx_to_workers);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 20da32517095..09968cdfc7ca 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -372,7 +372,7 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
}
/*
- * Parse the PTP FOLLOWUP message and send DELAY_REQ to the master clock.
+ * Parse the PTP FOLLOWUP message and send DELAY_REQ to the main clock.
*/
static void
parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
@@ -782,7 +782,7 @@ main(int argc, char *argv[])
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main();
return 0;
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 54d124b00bc9..6fe39546dd52 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -302,7 +302,7 @@ main(int argc, char *argv[])
printf("\nWARNING: Too much enabled lcores - "
"App uses only 1 lcore\n");
- /* call lcore_main on master core only */
+ /* call lcore_main on main core only */
lcore_main();
return 0;
}
diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c
index 05f961cff5d0..4728960eaf22 100644
--- a/examples/server_node_efd/server/main.c
+++ b/examples/server_node_efd/server/main.c
@@ -95,7 +95,7 @@ get_printable_mac_addr(uint16_t port)
/*
* This function displays the recorded statistics for each port
* and for each node. It uses ANSI terminal codes to clear
- * screen when called. It is called from a single non-master
+ * screen when called. It is called from a single worker
* thread in the server process, when the process is run with more
* than one lcore enabled.
*/
@@ -168,7 +168,7 @@ do_stats_display(void)
}
/*
- * The function called from each non-master lcore used by the process.
+ * The function called from each non-main lcore used by the process.
* The test_and_set function is used to randomly pick a single lcore on which
* the code to display the statistics will run. Otherwise, the code just
* repeatedly sleeps.
@@ -290,7 +290,7 @@ process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[],
}
/*
- * Function called by the master lcore of the DPDK process.
+ * Function called by the main lcore of the DPDK process.
*/
static void
do_packet_forwarding(void)
@@ -330,8 +330,8 @@ main(int argc, char *argv[])
/* clear statistics */
clear_stats();
- /* put all other cores to sleep bar master */
- rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MASTER);
+ /* put all other cores to sleep except main */
+ rte_eal_mp_remote_launch(sleep_lcore, NULL, SKIP_MAIN);
do_packet_forwarding();
return 0;
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 72ba85fa1fe5..4b2b6ab4ff78 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
if (rte_lcore_count() > 1)
printf("\nWARNING: Too many lcores enabled. Only 1 used.\n");
- /* Call lcore_main on the master core only. */
+ /* Call lcore_main on the main core only. */
lcore_main();
return 0;
diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c
index 232ed59b6ec6..15bf8bbf7f77 100644
--- a/examples/tep_termination/main.c
+++ b/examples/tep_termination/main.c
@@ -835,7 +835,7 @@ init_data_ll(void)
{
int lcore;
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ RTE_LCORE_FOREACH_WORKER(lcore) {
lcore_info[lcore].lcore_ll =
malloc(sizeof(struct lcore_ll_info));
if (lcore_info[lcore].lcore_ll == NULL) {
@@ -927,7 +927,7 @@ destroy_device(int vid)
rm_data_ll_entry(&ll_root_used, ll_main_dev_cur, ll_main_dev_last);
/* Set the dev_removal_flag on each lcore. */
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ RTE_LCORE_FOREACH_WORKER(lcore) {
lcore_info[lcore].lcore_ll->dev_removal_flag =
REQUEST_DEV_REMOVAL;
}
@@ -938,7 +938,7 @@ destroy_device(int vid)
* the device removed from the linked lists and that the devices
* are no longer in use.
*/
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ RTE_LCORE_FOREACH_WORKER(lcore) {
while (lcore_info[lcore].lcore_ll->dev_removal_flag
!= ACK_DEV_REMOVAL)
rte_pause();
@@ -998,7 +998,7 @@ new_device(int vid)
vdev->remove = 0;
/* Find a suitable lcore to add the device. */
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ RTE_LCORE_FOREACH_WORKER(lcore) {
if (lcore_info[lcore].lcore_ll->device_num < device_num_min) {
device_num_min = lcore_info[lcore].lcore_ll->device_num;
core_add = lcore;
@@ -1204,7 +1204,7 @@ main(int argc, char *argv[])
}
/* Launch all data cores. */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(switch_worker,
mbuf_pool, lcore_id);
}
@@ -1228,7 +1228,7 @@ main(int argc, char *argv[])
"failed to start vhost driver.\n");
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id)
+ RTE_LCORE_FOREACH_WORKER(lcore_id)
rte_eal_wait_lcore(lcore_id);
return 0;
diff --git a/examples/timer/main.c b/examples/timer/main.c
index 0259022f104e..5a57e482909f 100644
--- a/examples/timer/main.c
+++ b/examples/timer/main.c
@@ -100,7 +100,7 @@ main(int argc, char **argv)
rte_timer_init(&timer0);
rte_timer_init(&timer1);
- /* load timer0, every second, on master lcore, reloaded automatically */
+ /* load timer0, every second, on main lcore, reloaded automatically */
hz = rte_get_timer_hz();
lcore_id = rte_lcore_id();
rte_timer_reset(&timer0, hz, PERIODICAL, lcore_id, timer0_cb, NULL);
@@ -109,12 +109,12 @@ main(int argc, char **argv)
lcore_id = rte_get_next_lcore(lcore_id, 0, 1);
rte_timer_reset(&timer1, hz/3, SINGLE, lcore_id, timer1_cb, NULL);
- /* call lcore_mainloop() on every slave lcore */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ /* call lcore_mainloop() on every worker lcore */
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(lcore_mainloop, NULL, lcore_id);
}
- /* call it on master lcore too */
+ /* call it on main lcore too */
(void) lcore_mainloop(NULL);
return 0;
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index e1578e79569a..7ef77deb0eb5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1202,7 +1202,7 @@ destroy_device(int vid)
/* Set the dev_removal_flag on each lcore. */
- RTE_LCORE_FOREACH_SLAVE(lcore)
+ RTE_LCORE_FOREACH_WORKER(lcore)
lcore_info[lcore].dev_removal_flag = REQUEST_DEV_REMOVAL;
/*
@@ -1210,7 +1210,7 @@ destroy_device(int vid)
* we can be sure that they can no longer access the device removed
* from the linked lists and that the devices are no longer in use.
*/
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ RTE_LCORE_FOREACH_WORKER(lcore) {
while (lcore_info[lcore].dev_removal_flag != ACK_DEV_REMOVAL)
rte_pause();
}
@@ -1255,7 +1255,7 @@ new_device(int vid)
vdev->remove = 0;
/* Find a suitable lcore to add the device. */
- RTE_LCORE_FOREACH_SLAVE(lcore) {
+ RTE_LCORE_FOREACH_WORKER(lcore) {
if (lcore_info[lcore].device_num < device_num_min) {
device_num_min = lcore_info[lcore].device_num;
core_add = lcore;
@@ -1504,7 +1504,7 @@ main(int argc, char *argv[])
}
/* Launch all data cores. */
- RTE_LCORE_FOREACH_SLAVE(lcore_id)
+ RTE_LCORE_FOREACH_WORKER(lcore_id)
rte_eal_remote_launch(switch_worker, NULL, lcore_id);
if (client_mode)
@@ -1565,7 +1565,7 @@ main(int argc, char *argv[])
}
}
- RTE_LCORE_FOREACH_SLAVE(lcore_id)
+ RTE_LCORE_FOREACH_WORKER(lcore_id)
rte_eal_wait_lcore(lcore_id);
return 0;
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 660be4011e16..3cb890fa2b2b 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -653,8 +653,8 @@ main(int argc, char *argv[])
}
/* call lcore_main() on every lcore */
- rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MASTER);
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN);
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 83a6843ee5b0..1a7436463806 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -699,12 +699,12 @@ main(int argc, char *argv[])
rte_exit(EXIT_FAILURE, "Cannot initialize network ports\n");
}
- /* call lcore_main() on every slave lcore */
+ /* call lcore_main() on every worker lcore */
i = 0;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(lcore_main, (void*)i++, lcore_id);
}
- /* call on master too */
+ /* call on main too */
(void) lcore_main((void*)i);
return 0;
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH v2 01/17] doc/coding_style: add policy about master/slave
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 01/17] doc/coding_style: add policy about master/slave Stephen Hemminger
@ 2020-09-15 9:46 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-15 9:46 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 14-Sep-20 7:19 PM, Stephen Hemminger wrote:
> Update the coding style document to include a policy against
> introducing new master/slave usage. This is taken from the similar
> place in the Linux kernel coding style.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH v2 02/17] eal: add macro to mark macros as deprecated
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 02/17] eal: add macro to mark macros as deprecated Stephen Hemminger
@ 2020-09-15 9:48 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-15 9:48 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 14-Sep-20 7:19 PM, Stephen Hemminger wrote:
> Add a macro that causes GCC and CLANG to emit a warning when
> a deprecated macro is used.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH v2 03/17] eal: rename lcore word choices
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 03/17] eal: rename lcore word choices Stephen Hemminger
@ 2020-09-15 9:57 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-15 9:57 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 14-Sep-20 7:19 PM, Stephen Hemminger wrote:
> Replace master lcore with main lcore and
> replace slave lcore with worker lcore.
>
> Keep the old functions and macros but mark them as deprecated
> for this release.
>
> The "--master-lcore" command line option is also deprecated
> and any usage will print a warning and use "--main-lcore"
> as replacement.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Doesn't apply cleanly due to changes in 20.11 release notes, but otherwise
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH v2 04/17] rte_power: replace rte_master_lcore with rte_main_lcore
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 04/17] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
@ 2020-09-15 9:57 ` Burakov, Anatoly
0 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-15 9:57 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 14-Sep-20 7:19 PM, Stephen Hemminger wrote:
> The old rte_master_lcore is now replaced by rte_mail_lcore.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
I've acked most of these patches, please don't forget to put in acks
next time :)
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* Re: [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
` (16 preceding siblings ...)
2020-09-14 18:20 ` [dpdk-dev] [PATCH v2 17/17] examples: " Stephen Hemminger
@ 2020-09-15 10:09 ` Burakov, Anatoly
2020-10-13 15:25 ` [dpdk-dev] [PATCH v5 00/18] " Stephen Hemminger
18 siblings, 0 replies; 157+ messages in thread
From: Burakov, Anatoly @ 2020-09-15 10:09 UTC (permalink / raw)
To: Stephen Hemminger, dev
On 14-Sep-20 7:19 PM, Stephen Hemminger wrote:
> As announced in 20.08 release notes, the terms for lcore role
> will change in 20.11 release.
>
> This is a project wide patchset to terminolgy used for DPDK lcore.
> The term "master" referring to lcore is replaced with "main" and
> "slave" lcore is replaced with "worker" lcore.
>
> This is most visible in API for rte_get_master_lcore() which is
> replaced with rte_get_main_lcore(). And the macros for iterating
> over lcores are replaced as well.
>
> The first patch introduces a way to mark macro's as deprecated
> as well.
>
> v2
> - fix more places found by Anatoly and grep
> - add coding style update
> - add memif changes
>
More missed places:
doc/guides/linux_gsg/quick_start.rst
235,10: EAL: Master core 0 is ready (tid=1b2ad720)
297,10: EAL: Master core 0 is ready (tid=de25b700)
doc/guides/sample_app_ug/performance_thread.rst
1220,27: main EAL thread after all slave threads have stopped and
returned to the C
drivers/bus/pci/pci_common_uio.c
54,27: /* fd is not needed in slave process, close it */
drivers/bus/vmbus/vmbus_common_uio.c
88,25: /* fd is not needed in slave process, close it */
drivers/event/dpaa2/dpaa2_eventdev_selftest.c
504,31: launch_workers_and_wait(int (*master_worker)(void *),
505,10: int (*slave_workers)(void *), uint32_t total_events,
540,12: /* skip master */ 1,
542,24: rte_eal_remote_launch(master_worker, ¶m[0], w_lcore);
551,25: rte_eal_remote_launch(slave_workers, ¶m[port], w_lcore);
drivers/event/octeontx/ssovf_evdev_selftest.c
604,31: launch_workers_and_wait(int (*master_worker)(void *),
605,10: int (*slave_workers)(void *), uint32_t total_events,
640,12: /* skip master */ 1,
642,24: rte_eal_remote_launch(master_worker, ¶m[0], w_lcore);
651,25: rte_eal_remote_launch(slave_workers, ¶m[port], w_lcore);
drivers/event/sw/sw_evdev_selftest.c
3111,12: /* skip master */ 1,
drivers/net/softnic/rte_eth_softnic_internals.h
550,4: * Master thead: data plane thread context
drivers/net/softnic/rte_eth_softnic_thread.c
21,4: * Master thread: data plane thread init
81,6: /* Master thread records */
212,4: * Master thread & data plane threads: message passing
246,4: * Master thread
590,4: * Master thread & data plane threads: message passing
756,4: * Master thread
lib/librte_eal/linux/eal_memory.c
1740,55: * --socket-mem, we allocate all of our memory on master
core socket.
lib/librte_kni/rte_kni.h
83,43: * This function is to be executed on the MASTER lcore only,
after EAL
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave
2020-09-11 19:06 [dpdk-dev] [PATCH 00/15] Replace terms master/slave lcore with main/worker lcore Stephen Hemminger
` (15 preceding siblings ...)
2020-09-14 18:19 ` [dpdk-dev] [PATCH v2 00/17] Replace terms master/slave Stephen Hemminger
@ 2020-09-15 15:10 ` Stephen Hemminger
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 01/17] doc/coding_style: add policy about master/slave Stephen Hemminger
` (18 more replies)
2020-10-09 21:38 ` [dpdk-dev] [PATCH v4 " Stephen Hemminger
` (2 subsequent siblings)
19 siblings, 19 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:10 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
As announced in 20.08 release notes, the terms for lcore role
will change in 20.11 release.
This is a project wide patchset to terminolgy used for DPDK lcore.
The term "master" referring to lcore is replaced with "main" and
"slave" lcore is replaced with "worker" lcore.
This is most visible in API for rte_get_master_lcore() which is
replaced with rte_get_main_lcore(). And the macros for iterating
over lcores are replaced as well.
The first patch introduces a way to mark macro's as deprecated
as well.
Note: this patch will fail checkpatch because current versions
of checkpatch flag use of master/slave as an error. Also,
until the whole patch series is applied, the build will generate
non-fatal warnings.
v3
- incorporate still more places where master/slave was still used
v2
- fix more places found by Anatoly and grep
- add coding style update
- add memif changes
Stephen Hemminger (17):
doc/coding_style: add policy about master/slave
eal: add macro to mark macros as deprecated
eal: rename lcore word choices
rte_power: replace rte_master_lcore with rte_main_lcore
drivers: replace master lcore with main lcore
net/memif: replace master/slave arguments with server/client
doc: replace master lcore with main lcore
app/test: replace uses of master/slave
app/test-pmd: replace master lcore with main lcore
app/test-eventdev: replace use of master lcore with main lcore
app: replace references to master/slave
examples: replace use of master with main
examples/multi_process: replace references to master/slave
examples/performance-thread: replace reference to master lcore
examples/qos: replace references to master
examples/ipsec-secgw: replace master lcore with main lcore
examples: replace master lcore with main lcore
app/pdump/main.c | 2 +-
app/test-acl/main.c | 2 +-
app/test-bbdev/test_bbdev_perf.c | 16 +--
app/test-compress-perf/main.c | 8 +-
app/test-crypto-perf/main.c | 14 +-
app/test-eventdev/evt_options.c | 2 +-
app/test-eventdev/test_order_common.c | 12 +-
app/test-eventdev/test_perf_common.c | 16 +--
app/test-eventdev/test_pipeline_common.c | 11 +-
app/test-flow-perf/main.c | 2 +-
app/test-pipeline/main.c | 4 +-
app/test-pmd/cmdline.c | 2 +-
app/test-pmd/config.c | 4 +-
app/test-pmd/parameters.c | 2 +-
app/test-pmd/testpmd.c | 4 +-
app/test-sad/main.c | 4 +-
app/test/autotest_test_funcs.py | 2 +-
app/test/meson.build | 2 +-
app/test/test.c | 2 +-
app/test/test_atomic.c | 26 ++--
app/test/test_barrier.c | 2 +-
app/test/test_compressdev_test_buffer.h | 2 +-
app/test/test_cryptodev.c | 16 +--
app/test/test_distributor.c | 8 +-
app/test/test_distributor_perf.c | 10 +-
app/test/test_eal_flags.c | 32 ++---
app/test/test_efd.c | 2 +-
app/test/test_efd_perf.c | 2 +-
app/test/test_func_reentrancy.c | 20 +--
app/test/test_hash_multiwriter.c | 4 +-
app/test/test_hash_readwrite.c | 39 +++--
app/test/test_kni.c | 16 +--
app/test/test_lpm_perf.c | 4 +-
app/test/test_malloc.c | 12 +-
app/test/test_mbuf.c | 33 +++--
app/test/test_mcslock.c | 28 ++--
app/test/test_mempool_perf.c | 10 +-
app/test/test_mp_secondary.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/test_per_lcore.c | 14 +-
app/test/test_pmd_perf.c | 20 +--
app/test/test_rcu_qsbr.c | 2 +-
app/test/test_rcu_qsbr_perf.c | 2 +-
app/test/test_ring_perf.c | 14 +-
app/test/test_ring_stress_impl.h | 10 +-
app/test/test_rwlock.c | 28 ++--
app/test/test_service_cores.c | 14 +-
app/test/test_spinlock.c | 34 ++---
app/test/test_stack.c | 2 +-
app/test/test_stack_perf.c | 6 +-
app/test/test_ticketlock.c | 36 ++---
app/test/test_timer.c | 109 +++++++-------
app/test/test_timer_racecond.c | 26 ++--
app/test/test_timer_secondary.c | 8 +-
app/test/test_trace_perf.c | 4 +-
doc/guides/contributing/coding_style.rst | 25 +++-
doc/guides/faq/faq.rst | 6 +-
doc/guides/howto/debug_troubleshoot.rst | 2 +-
doc/guides/linux_gsg/eal_args.include.rst | 4 +-
doc/guides/linux_gsg/quick_start.rst | 4 +-
doc/guides/nics/bnxt.rst | 2 +-
doc/guides/nics/memif.rst | 78 +++++-----
.../prog_guide/env_abstraction_layer.rst | 6 +-
.../prog_guide/event_ethernet_rx_adapter.rst | 2 +-
doc/guides/prog_guide/glossary.rst | 10 +-
doc/guides/rel_notes/deprecation.rst | 19 ---
doc/guides/rel_notes/release_20_11.rst | 11 ++
doc/guides/sample_app_ug/bbdev_app.rst | 2 +-
doc/guides/sample_app_ug/ethtool.rst | 4 +-
doc/guides/sample_app_ug/hello_world.rst | 10 +-
doc/guides/sample_app_ug/ioat.rst | 14 +-
doc/guides/sample_app_ug/ip_pipeline.rst | 4 +-
doc/guides/sample_app_ug/keep_alive.rst | 2 +-
doc/guides/sample_app_ug/l2_forward_event.rst | 4 +-
.../sample_app_ug/l2_forward_real_virtual.rst | 5 +-
doc/guides/sample_app_ug/l3_forward_graph.rst | 6 +-
.../sample_app_ug/l3_forward_power_man.rst | 2 +-
doc/guides/sample_app_ug/link_status_intr.rst | 5 +-
doc/guides/sample_app_ug/multi_process.rst | 6 +-
doc/guides/sample_app_ug/packet_ordering.rst | 8 +-
.../sample_app_ug/performance_thread.rst | 6 +-
doc/guides/sample_app_ug/ptpclient.rst | 2 +-
doc/guides/sample_app_ug/qos_scheduler.rst | 4 +-
doc/guides/sample_app_ug/timer.rst | 16 +--
doc/guides/testpmd_app_ug/run_app.rst | 2 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/pci/pci_common_uio.c | 3 +-
drivers/bus/vmbus/vmbus_common_uio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 10 +-
drivers/event/octeontx/ssovf_evdev_selftest.c | 10 +-
drivers/event/sw/sw_evdev_selftest.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 4 +-
drivers/net/memif/memif.h | 40 +++---
drivers/net/memif/memif_socket.c | 54 +++----
drivers/net/memif/memif_socket.h | 5 +-
drivers/net/memif/rte_eth_memif.c | 134 +++++++++---------
drivers/net/memif/rte_eth_memif.h | 20 +--
drivers/net/mvpp2/mrvl_ethdev.c | 6 +-
drivers/net/qede/base/bcm_osal.c | 4 +-
.../net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/softnic/rte_eth_softnic_thread.c | 16 +--
examples/bbdev_app/main.c | 14 +-
examples/bond/main.c | 32 ++---
examples/distributor/main.c | 10 +-
examples/ethtool/ethtool-app/main.c | 11 +-
examples/eventdev_pipeline/main.c | 2 +-
examples/flow_classify/flow_classify.c | 2 +-
examples/helloworld/main.c | 6 +-
examples/ioat/ioatfwd.c | 6 +-
examples/ip_fragmentation/main.c | 4 +-
examples/ip_pipeline/main.c | 2 +-
examples/ip_pipeline/thread.c | 16 +--
examples/ip_reassembly/main.c | 4 +-
examples/ipsec-secgw/event_helper.c | 6 +-
examples/ipsec-secgw/ipsec-secgw.c | 4 +-
examples/ipv4_multicast/main.c | 4 +-
examples/kni/main.c | 6 +-
examples/l2fwd-cat/l2fwd-cat.c | 2 +-
examples/l2fwd-crypto/main.c | 8 +-
examples/l2fwd-event/l2fwd_event_generic.c | 2 +-
.../l2fwd-event/l2fwd_event_internal_port.c | 2 +-
examples/l2fwd-event/l2fwd_poll.c | 2 +-
examples/l2fwd-event/main.c | 2 +-
examples/l2fwd-jobstats/main.c | 4 +-
examples/l2fwd-keepalive/main.c | 6 +-
examples/l2fwd/main.c | 8 +-
examples/l3fwd-acl/main.c | 4 +-
examples/l3fwd-graph/main.c | 14 +-
examples/l3fwd-power/main.c | 22 +--
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 8 +-
.../client_server_mp/mp_server/main.c | 10 +-
examples/multi_process/simple_mp/main.c | 6 +-
examples/multi_process/symmetric_mp/main.c | 2 +-
examples/ntb/ntb_fwd.c | 14 +-
examples/packet_ordering/main.c | 22 +--
.../performance-thread/l3fwd-thread/main.c | 16 +--
.../performance-thread/pthread_shim/main.c | 4 +-
examples/ptpclient/ptpclient.c | 4 +-
examples/qos_meter/main.c | 4 +-
examples/qos_sched/args.c | 26 ++--
examples/qos_sched/cmdline.c | 2 +-
examples/qos_sched/main.c | 2 +-
examples/rxtx_callbacks/main.c | 2 +-
examples/server_node_efd/server/main.c | 10 +-
examples/skeleton/basicfwd.c | 2 +-
examples/tep_termination/main.c | 12 +-
examples/timer/main.c | 8 +-
examples/vhost/main.c | 10 +-
examples/vmdq/main.c | 4 +-
examples/vmdq_dcb/main.c | 6 +-
lib/librte_eal/common/eal_common_dynmem.c | 10 +-
lib/librte_eal/common/eal_common_launch.c | 36 ++---
lib/librte_eal/common/eal_common_lcore.c | 8 +-
lib/librte_eal/common/eal_common_options.c | 56 ++++----
lib/librte_eal/common/eal_options.h | 2 +
lib/librte_eal/common/eal_private.h | 6 +-
lib/librte_eal/common/rte_random.c | 2 +-
lib/librte_eal/common/rte_service.c | 2 +-
lib/librte_eal/freebsd/eal.c | 28 ++--
lib/librte_eal/freebsd/eal_thread.c | 32 ++---
lib/librte_eal/include/rte_common.h | 11 ++
lib/librte_eal/include/rte_eal.h | 4 +-
lib/librte_eal/include/rte_eal_trace.h | 4 +-
lib/librte_eal/include/rte_launch.h | 60 ++++----
lib/librte_eal/include/rte_lcore.h | 35 +++--
lib/librte_eal/linux/eal.c | 28 ++--
lib/librte_eal/linux/eal_memory.c | 10 +-
lib/librte_eal/linux/eal_thread.c | 32 ++---
lib/librte_eal/rte_eal_version.map | 2 +-
lib/librte_eal/windows/eal.c | 16 +--
lib/librte_eal/windows/eal_thread.c | 30 ++--
lib/librte_power/rte_power_empty_poll.c | 2 +-
174 files changed, 1079 insertions(+), 1015 deletions(-)
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 01/17] doc/coding_style: add policy about master/slave
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
@ 2020-09-15 15:10 ` Stephen Hemminger
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 02/17] eal: add macro to mark macros as deprecated Stephen Hemminger
` (17 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:10 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Update the coding style document to include a policy against
introducing new master/slave usage. This is taken from the similar
place in the Linux kernel coding style.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/contributing/coding_style.rst | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 0be9546a6aa8..2c915fa38240 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -283,6 +283,29 @@ Thus, the previous example would be better written:
DPDK also provides an optimized way to store elements in lockless rings.
This should be used in all data-path code, when there are several consumer and/or producers to avoid locking for concurrent access.
+Naming
+------
+
+For symbol names and documentation, new usage of
+'master / slave' (or 'slave' independent of 'master') and 'blacklist /
+whitelist' is not allowed.
+
+Recommended replacements for 'master / slave' are:
+ '{primary,main} / {secondary,replica,subordinate}'
+ '{initiator,requester} / {target,responder}'
+ '{controller,host} / {device,worker,proxy}'
+ 'leader / follower'
+ 'director / performer'
+
+Recommended replacements for 'blacklist/whitelist' are:
+ 'denylist / allowlist'
+ 'blocklist / passlist'
+
+Exceptions for introducing new usage is to maintain compatiablity
+with an existing (as of 2020) hardware or protocol
+specification that mandates those terms.
+
+
Typedefs
~~~~~~~~
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 02/17] eal: add macro to mark macros as deprecated
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 01/17] doc/coding_style: add policy about master/slave Stephen Hemminger
@ 2020-09-15 15:10 ` Stephen Hemminger
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 03/17] eal: rename lcore word choices Stephen Hemminger
` (16 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:10 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Add a macro that causes GCC and CLANG to emit a warning when
a deprecated macro is used.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/include/rte_common.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h
index 8f487a563dfc..c6714b67b411 100644
--- a/lib/librte_eal/include/rte_common.h
+++ b/lib/librte_eal/include/rte_common.h
@@ -86,6 +86,17 @@ typedef uint16_t unaligned_uint16_t;
/******* Macro to mark functions and fields scheduled for removal *****/
#define __rte_deprecated __attribute__((__deprecated__))
+/**
+ * Macro to mark macros and defines scheduled for removal
+ */
+#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG)
+#define RTE_PRAGMA(x) _Pragma(#x)
+#define RTE_PRAGMA_WARNING(w) RTE_PRAGMA(GCC warning #w)
+#define RTE_DEPRECATED(x) RTE_PRAGMA_WARNING(#x is deprecated)
+#else
+#define RTE_DEPRECATED(x)
+#endif
+
/**
* Mark a function or variable to a weak reference.
*/
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 03/17] eal: rename lcore word choices
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 01/17] doc/coding_style: add policy about master/slave Stephen Hemminger
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 02/17] eal: add macro to mark macros as deprecated Stephen Hemminger
@ 2020-09-15 15:11 ` Stephen Hemminger
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 04/17] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
` (15 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:11 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master lcore with main lcore and
replace slave lcore with worker lcore.
Keep the old functions and macros but mark them as deprecated
for this release.
The "--master-lcore" command line option is also deprecated
and any usage will print a warning and use "--main-lcore"
as replacement.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/rel_notes/deprecation.rst | 19 -------
doc/guides/rel_notes/release_20_11.rst | 11 ++++
lib/librte_eal/common/eal_common_dynmem.c | 10 ++--
lib/librte_eal/common/eal_common_launch.c | 36 ++++++-------
lib/librte_eal/common/eal_common_lcore.c | 8 +--
lib/librte_eal/common/eal_common_options.c | 56 +++++++++++---------
lib/librte_eal/common/eal_options.h | 2 +
lib/librte_eal/common/eal_private.h | 6 +--
lib/librte_eal/common/rte_random.c | 2 +-
lib/librte_eal/common/rte_service.c | 2 +-
lib/librte_eal/freebsd/eal.c | 28 +++++-----
lib/librte_eal/freebsd/eal_thread.c | 32 ++++++------
lib/librte_eal/include/rte_eal.h | 4 +-
lib/librte_eal/include/rte_eal_trace.h | 4 +-
lib/librte_eal/include/rte_launch.h | 60 ++++++++++++----------
lib/librte_eal/include/rte_lcore.h | 35 +++++++++----
lib/librte_eal/linux/eal.c | 28 +++++-----
lib/librte_eal/linux/eal_memory.c | 10 ++--
lib/librte_eal/linux/eal_thread.c | 32 ++++++------
lib/librte_eal/rte_eal_version.map | 2 +-
lib/librte_eal/windows/eal.c | 16 +++---
lib/librte_eal/windows/eal_thread.c | 30 +++++------
22 files changed, 226 insertions(+), 207 deletions(-)
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 52168f775198..4132fb4b7c46 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -25,25 +25,6 @@ Deprecation Notices
* kvargs: The function ``rte_kvargs_process`` will get a new parameter
for returning key match count. It will ease handling of no-match case.
-* eal: To be more inclusive in choice of naming, the DPDK project
- will replace uses of master/slave in the API's and command line arguments.
-
- References to master/slave in relation to lcore will be renamed
- to initial/worker. The function ``rte_get_master_lcore()``
- will be renamed to ``rte_get_initial_lcore()``.
- For the 20.11 release, both names will be present and the
- old function will be marked with the deprecated tag.
- The old function will be removed in a future version.
-
- The iterator for worker lcores will also change:
- ``RTE_LCORE_FOREACH_SLAVE`` will be replaced with
- ``RTE_LCORE_FOREACH_WORKER``.
-
- The ``master-lcore`` argument to testpmd will be replaced
- with ``initial-lcore``. The old ``master-lcore`` argument
- will produce a runtime notification in 20.11 release, and
- be removed completely in a future release.
-
* eal: The terms blacklist and whitelist to describe devices used
by DPDK will be replaced in the 20.11 relase.
This will apply to command line arguments as well as macros.
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index b729bdf20022..08e6fbcb3eb4 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -97,6 +97,17 @@ API Changes
and the function ``rte_rawdev_queue_conf_get()``
from ``void`` to ``int`` allowing the return of error codes from drivers.
+* eal: Changed the function ``rte_get_master_lcore()`` is
+ replaced to ``rte_get_main_lcore()``. The old function is deprecated.
+
+ The iterator for worker lcores will also change:
+ ``RTE_LCORE_FOREACH_SLAVE`` will be replaced with
+ ``RTE_LCORE_FOREACH_WORKER``.
+
+ The ``master-lcore`` argument to testpmd will be replaced
+ with ``main-lcore``. The old ``master-lcore`` argument
+ will produce a runtime notification in 20.11 release, and
+ be removed completely in a future release.
ABI Changes
-----------
diff --git a/lib/librte_eal/common/eal_common_dynmem.c b/lib/librte_eal/common/eal_common_dynmem.c
index 614648d8a4de..1cefe52443c4 100644
--- a/lib/librte_eal/common/eal_common_dynmem.c
+++ b/lib/librte_eal/common/eal_common_dynmem.c
@@ -427,19 +427,19 @@ eal_dynmem_calc_num_pages_per_socket(
total_size -= default_size;
}
#else
- /* in 32-bit mode, allocate all of the memory only on master
+ /* in 32-bit mode, allocate all of the memory only on main
* lcore socket
*/
total_size = internal_conf->memory;
for (socket = 0; socket < RTE_MAX_NUMA_NODES && total_size != 0;
socket++) {
struct rte_config *cfg = rte_eal_get_configuration();
- unsigned int master_lcore_socket;
+ unsigned int main_lcore_socket;
- master_lcore_socket =
- rte_lcore_to_socket_id(cfg->master_lcore);
+ main_lcore_socket =
+ rte_lcore_to_socket_id(cfg->main_lcore);
- if (master_lcore_socket != socket)
+ if (main_lcore_socket != socket)
continue;
/* Update sizes */
diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c
index cf52d717f68e..34f854ad80c8 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -21,55 +21,55 @@
* Wait until a lcore finished its job.
*/
int
-rte_eal_wait_lcore(unsigned slave_id)
+rte_eal_wait_lcore(unsigned worker_id)
{
- if (lcore_config[slave_id].state == WAIT)
+ if (lcore_config[worker_id].state == WAIT)
return 0;
- while (lcore_config[slave_id].state != WAIT &&
- lcore_config[slave_id].state != FINISHED)
+ while (lcore_config[worker_id].state != WAIT &&
+ lcore_config[worker_id].state != FINISHED)
rte_pause();
rte_rmb();
/* we are in finished state, go to wait state */
- lcore_config[slave_id].state = WAIT;
- return lcore_config[slave_id].ret;
+ lcore_config[worker_id].state = WAIT;
+ return lcore_config[worker_id].ret;
}
/*
- * Check that every SLAVE lcores are in WAIT state, then call
- * rte_eal_remote_launch() for all of them. If call_master is true
- * (set to CALL_MASTER), also call the function on the master lcore.
+ * Check that every WORKER lcores are in WAIT state, then call
+ * rte_eal_remote_launch() for all of them. If call_main is true
+ * (set to CALL_MAIN), also call the function on the main lcore.
*/
int
rte_eal_mp_remote_launch(int (*f)(void *), void *arg,
- enum rte_rmt_call_master_t call_master)
+ enum rte_rmt_call_main_t call_main)
{
int lcore_id;
- int master = rte_get_master_lcore();
+ int main_lcore = rte_get_main_lcore();
/* check state of lcores */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (lcore_config[lcore_id].state != WAIT)
return -EBUSY;
}
/* send messages to cores */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_remote_launch(f, arg, lcore_id);
}
- if (call_master == CALL_MASTER) {
- lcore_config[master].ret = f(arg);
- lcore_config[master].state = FINISHED;
+ if (call_main == CALL_MAIN) {
+ lcore_config[main_lcore].ret = f(arg);
+ lcore_config[main_lcore].state = FINISHED;
}
return 0;
}
/*
- * Return the state of the lcore identified by slave_id.
+ * Return the state of the lcore identified by worker_id.
*/
enum rte_lcore_state_t
rte_eal_get_lcore_state(unsigned lcore_id)
@@ -86,7 +86,7 @@ rte_eal_mp_wait_lcore(void)
{
unsigned lcore_id;
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
rte_eal_wait_lcore(lcore_id);
}
}
diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c
index d64569b3c758..66d6bad1a7d7 100644
--- a/lib/librte_eal/common/eal_common_lcore.c
+++ b/lib/librte_eal/common/eal_common_lcore.c
@@ -18,9 +18,9 @@
#include "eal_private.h"
#include "eal_thread.h"
-unsigned int rte_get_master_lcore(void)
+unsigned int rte_get_main_lcore(void)
{
- return rte_eal_get_configuration()->master_lcore;
+ return rte_eal_get_configuration()->main_lcore;
}
unsigned int rte_lcore_count(void)
@@ -93,7 +93,7 @@ int rte_lcore_is_enabled(unsigned int lcore_id)
return cfg->lcore_role[lcore_id] == ROLE_RTE;
}
-unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
+unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap)
{
i++;
if (wrap)
@@ -101,7 +101,7 @@ unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap)
while (i < RTE_MAX_LCORE) {
if (!rte_lcore_is_enabled(i) ||
- (skip_master && (i == rte_get_master_lcore()))) {
+ (skip_main && (i == rte_get_main_lcore()))) {
i++;
if (wrap)
i %= RTE_MAX_LCORE;
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index a5426e12346a..667ba2111c1a 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -81,6 +81,7 @@ eal_long_options[] = {
{OPT_TRACE_BUF_SIZE, 1, NULL, OPT_TRACE_BUF_SIZE_NUM },
{OPT_TRACE_MODE, 1, NULL, OPT_TRACE_MODE_NUM },
{OPT_MASTER_LCORE, 1, NULL, OPT_MASTER_LCORE_NUM },
+ {OPT_MAIN_LCORE, 1, NULL, OPT_MAIN_LCORE_NUM },
{OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM},
{OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM },
{OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM },
@@ -144,7 +145,7 @@ struct device_option {
static struct device_option_list devopt_list =
TAILQ_HEAD_INITIALIZER(devopt_list);
-static int master_lcore_parsed;
+static int main_lcore_parsed;
static int mem_parsed;
static int core_parsed;
@@ -575,12 +576,12 @@ eal_parse_service_coremask(const char *coremask)
for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE;
j++, idx++) {
if ((1 << j) & val) {
- /* handle master lcore already parsed */
+ /* handle main lcore already parsed */
uint32_t lcore = idx;
- if (master_lcore_parsed &&
- cfg->master_lcore == lcore) {
+ if (main_lcore_parsed &&
+ cfg->main_lcore == lcore) {
RTE_LOG(ERR, EAL,
- "lcore %u is master lcore, cannot use as service core\n",
+ "lcore %u is main lcore, cannot use as service core\n",
idx);
return -1;
}
@@ -748,12 +749,12 @@ eal_parse_service_corelist(const char *corelist)
min = idx;
for (idx = min; idx <= max; idx++) {
if (cfg->lcore_role[idx] != ROLE_SERVICE) {
- /* handle master lcore already parsed */
+ /* handle main lcore already parsed */
uint32_t lcore = idx;
- if (cfg->master_lcore == lcore &&
- master_lcore_parsed) {
+ if (cfg->main_lcore == lcore &&
+ main_lcore_parsed) {
RTE_LOG(ERR, EAL,
- "Error: lcore %u is master lcore, cannot use as service core\n",
+ "Error: lcore %u is main lcore, cannot use as service core\n",
idx);
return -1;
}
@@ -836,23 +837,23 @@ eal_parse_corelist(const char *corelist, int *cores)
return 0;
}
-/* Changes the lcore id of the master thread */
+/* Changes the lcore id of the main thread */
static int
-eal_parse_master_lcore(const char *arg)
+eal_parse_main_lcore(const char *arg)
{
char *parsing_end;
struct rte_config *cfg = rte_eal_get_configuration();
errno = 0;
- cfg->master_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
+ cfg->main_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
if (errno || parsing_end[0] != 0)
return -1;
- if (cfg->master_lcore >= RTE_MAX_LCORE)
+ if (cfg->main_lcore >= RTE_MAX_LCORE)
return -1;
- master_lcore_parsed = 1;
+ main_lcore_parsed = 1;
- /* ensure master core is not used as service core */
- if (lcore_config[cfg->master_lcore].core_role == ROLE_SERVICE) {
+ /* ensure main core is not used as service core */
+ if (lcore_config[cfg->main_lcore].core_role == ROLE_SERVICE) {
RTE_LOG(ERR, EAL,
"Error: Master lcore is used as a service core\n");
return -1;
@@ -1593,7 +1594,12 @@ eal_parse_common_option(int opt, const char *optarg,
break;
case OPT_MASTER_LCORE_NUM:
- if (eal_parse_master_lcore(optarg) < 0) {
+ fprintf(stderr,
+ "option --" OPT_MASTER_LCORE
+ " is deprecated use " OPT_MAIN_LCORE "\n");
+ /* fallthrough */
+ case OPT_MAIN_LCORE_NUM:
+ if (eal_parse_main_lcore(optarg) < 0) {
RTE_LOG(ERR, EAL, "invalid parameter for --"
OPT_MASTER_LCORE "\n");
return -1;
@@ -1763,9 +1769,9 @@ compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
RTE_CPU_AND(cpuset, cpuset, &default_set);
- /* if no remaining cpu, use master lcore cpu affinity */
+ /* if no remaining cpu, use main lcore cpu affinity */
if (!CPU_COUNT(cpuset)) {
- memcpy(cpuset, &lcore_config[rte_get_master_lcore()].cpuset,
+ memcpy(cpuset, &lcore_config[rte_get_main_lcore()].cpuset,
sizeof(*cpuset));
}
}
@@ -1797,12 +1803,12 @@ eal_adjust_config(struct internal_config *internal_cfg)
if (internal_conf->process_type == RTE_PROC_AUTO)
internal_conf->process_type = eal_proc_type_detect();
- /* default master lcore is the first one */
- if (!master_lcore_parsed) {
- cfg->master_lcore = rte_get_next_lcore(-1, 0, 0);
- if (cfg->master_lcore >= RTE_MAX_LCORE)
+ /* default main lcore is the first one */
+ if (!main_lcore_parsed) {
+ cfg->main_lcore = rte_get_next_lcore(-1, 0, 0);
+ if (cfg->main_lcore >= RTE_MAX_LCORE)
return -1;
- lcore_config[cfg->master_lcore].core_role = ROLE_RTE;
+ lcore_config[cfg->main_lcore].core_role = ROLE_RTE;
}
compute_ctrl_threads_cpuset(internal_cfg);
@@ -1822,7 +1828,7 @@ eal_check_common_options(struct internal_config *internal_cfg)
const struct internal_config *internal_conf =
eal_get_internal_configuration();
- if (cfg->lcore_role[cfg->master_lcore] != ROLE_RTE) {
+ if (cfg->lcore_role[cfg->main_lcore] != ROLE_RTE) {
RTE_LOG(ERR, EAL, "Master lcore is not enabled for DPDK\n");
return -1;
}
diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h
index 89769d48b487..d363228a7a25 100644
--- a/lib/librte_eal/common/eal_options.h
+++ b/lib/librte_eal/common/eal_options.h
@@ -43,6 +43,8 @@ enum {
OPT_TRACE_BUF_SIZE_NUM,
#define OPT_TRACE_MODE "trace-mode"
OPT_TRACE_MODE_NUM,
+#define OPT_MAIN_LCORE "main-lcore"
+ OPT_MAIN_LCORE_NUM,
#define OPT_MASTER_LCORE "master-lcore"
OPT_MASTER_LCORE_NUM,
#define OPT_MBUF_POOL_OPS_NAME "mbuf-pool-ops-name"
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index a6a6381567f4..4684c4c7df19 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -20,8 +20,8 @@
*/
struct lcore_config {
pthread_t thread_id; /**< pthread identifier */
- int pipe_master2slave[2]; /**< communication pipe with master */
- int pipe_slave2master[2]; /**< communication pipe with master */
+ int pipe_main2worker[2]; /**< communication pipe with main */
+ int pipe_worker2main[2]; /**< communication pipe with main */
lcore_function_t * volatile f; /**< function to call */
void * volatile arg; /**< argument of function */
@@ -42,7 +42,7 @@ extern struct lcore_config lcore_config[RTE_MAX_LCORE];
* The global RTE configuration structure.
*/
struct rte_config {
- uint32_t master_lcore; /**< Id of the master lcore */
+ uint32_t main_lcore; /**< Id of the main lcore */
uint32_t lcore_count; /**< Number of available logical cores. */
uint32_t numa_node_count; /**< Number of detected NUMA nodes. */
uint32_t numa_nodes[RTE_MAX_NUMA_NODES]; /**< List of detected NUMA nodes. */
diff --git a/lib/librte_eal/common/rte_random.c b/lib/librte_eal/common/rte_random.c
index b7a089ac4fe0..8d88aca26299 100644
--- a/lib/librte_eal/common/rte_random.c
+++ b/lib/librte_eal/common/rte_random.c
@@ -122,7 +122,7 @@ struct rte_rand_state *__rte_rand_get_state(void)
lcore_id = rte_lcore_id();
if (unlikely(lcore_id == LCORE_ID_ANY))
- lcore_id = rte_get_master_lcore();
+ lcore_id = rte_get_main_lcore();
return &rand_states[lcore_id];
}
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 6a0e0ff65d14..626d2409ad57 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -106,7 +106,7 @@ rte_service_init(void)
struct rte_config *cfg = rte_eal_get_configuration();
for (i = 0; i < RTE_MAX_LCORE; i++) {
if (lcore_config[i].core_role == ROLE_SERVICE) {
- if ((unsigned int)i == cfg->master_lcore)
+ if ((unsigned int)i == cfg->main_lcore)
continue;
rte_service_lcore_add(i);
count++;
diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
index 798add0b5919..f7bdd8caabc3 100644
--- a/lib/librte_eal/freebsd/eal.c
+++ b/lib/librte_eal/freebsd/eal.c
@@ -626,10 +626,10 @@ eal_check_mem_on_local_socket(void)
int socket_id;
const struct rte_config *config = rte_eal_get_configuration();
- socket_id = rte_lcore_to_socket_id(config->master_lcore);
+ socket_id = rte_lcore_to_socket_id(config->main_lcore);
if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
- RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
+ RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
}
@@ -850,29 +850,29 @@ rte_eal_init(int argc, char **argv)
eal_check_mem_on_local_socket();
if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
- &lcore_config[config->master_lcore].cpuset) != 0) {
+ &lcore_config[config->main_lcore].cpuset) != 0) {
rte_eal_init_alert("Cannot set affinity");
rte_errno = EINVAL;
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
- RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
- config->master_lcore, thread_id, cpuset,
+ RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%p;cpuset=[%s%s])\n",
+ config->main_lcore, thread_id, cpuset,
ret == 0 ? "" : "...");
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (pipe(lcore_config[i].pipe_master2slave) < 0)
+ if (pipe(lcore_config[i].pipe_main2worker) < 0)
rte_panic("Cannot create pipe\n");
- if (pipe(lcore_config[i].pipe_slave2master) < 0)
+ if (pipe(lcore_config[i].pipe_worker2main) < 0)
rte_panic("Cannot create pipe\n");
lcore_config[i].state = WAIT;
@@ -885,7 +885,7 @@ rte_eal_init(int argc, char **argv)
/* Set thread_name for aid in debugging. */
snprintf(thread_name, sizeof(thread_name),
- "lcore-slave-%d", i);
+ "lcore-worker-%d", i);
rte_thread_setname(lcore_config[i].thread_id, thread_name);
ret = pthread_setaffinity_np(lcore_config[i].thread_id,
@@ -895,10 +895,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
/* initialize services so vdevs register service during bus_probe. */
diff --git a/lib/librte_eal/freebsd/eal_thread.c b/lib/librte_eal/freebsd/eal_thread.c
index 99b5fefc4c5b..1dce9b04f24a 100644
--- a/lib/librte_eal/freebsd/eal_thread.c
+++ b/lib/librte_eal/freebsd/eal_thread.c
@@ -26,35 +26,35 @@
#include "eal_thread.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
+rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
int rc = -EBUSY;
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
goto finish;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(m2s, &c, 1);
+ n = write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = read(s2m, &c, 1);
+ n = read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -62,7 +62,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
rc = 0;
finish:
- rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc);
+ rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
return rc;
}
@@ -74,21 +74,21 @@ eal_thread_loop(__rte_unused void *arg)
int n, ret;
unsigned lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -104,7 +104,7 @@ eal_thread_loop(__rte_unused void *arg)
/* wait command */
do {
- n = read(m2s, &c, 1);
+ n = read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -115,7 +115,7 @@ eal_thread_loop(__rte_unused void *arg)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(s2m, &c, 1);
+ n = write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
diff --git a/lib/librte_eal/include/rte_eal.h b/lib/librte_eal/include/rte_eal.h
index ddcf6a2e7a1a..f8f0d74b476c 100644
--- a/lib/librte_eal/include/rte_eal.h
+++ b/lib/librte_eal/include/rte_eal.h
@@ -65,11 +65,11 @@ int rte_eal_iopl_init(void);
/**
* Initialize the Environment Abstraction Layer (EAL).
*
- * This function is to be executed on the MASTER lcore only, as soon
+ * This function is to be executed on the MAIN lcore only, as soon
* as possible in the application's main() function.
*
* The function finishes the initialization process before main() is called.
- * It puts the SLAVE lcores in the WAIT state.
+ * It puts the WORKER lcores in the WAIT state.
*
* When the multi-partition feature is supported, depending on the
* configuration (if CONFIG_RTE_EAL_MAIN_PARTITION is disabled), this
diff --git a/lib/librte_eal/include/rte_eal_trace.h b/lib/librte_eal/include/rte_eal_trace.h
index 6b1a813c7b1b..dd4e30e7fe5c 100644
--- a/lib/librte_eal/include/rte_eal_trace.h
+++ b/lib/librte_eal/include/rte_eal_trace.h
@@ -258,10 +258,10 @@ RTE_TRACE_POINT(
RTE_TRACE_POINT(
rte_eal_trace_thread_remote_launch,
RTE_TRACE_POINT_ARGS(int (*f)(void *), void *arg,
- unsigned int slave_id, int rc),
+ unsigned int worker_id, int rc),
rte_trace_point_emit_ptr(f);
rte_trace_point_emit_ptr(arg);
- rte_trace_point_emit_u32(slave_id);
+ rte_trace_point_emit_u32(worker_id);
rte_trace_point_emit_int(rc);
)
RTE_TRACE_POINT(
diff --git a/lib/librte_eal/include/rte_launch.h b/lib/librte_eal/include/rte_launch.h
index 06a671752ace..2b061c7dea8e 100644
--- a/lib/librte_eal/include/rte_launch.h
+++ b/lib/librte_eal/include/rte_launch.h
@@ -32,12 +32,12 @@ typedef int (lcore_function_t)(void *);
/**
* Launch a function on another lcore.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * Sends a message to a slave lcore (identified by the slave_id) that
+ * Sends a message to a worker lcore (identified by the worker_id) that
* is in the WAIT state (this is true after the first call to
* rte_eal_init()). This can be checked by first calling
- * rte_eal_wait_lcore(slave_id).
+ * rte_eal_wait_lcore(worker_id).
*
* When the remote lcore receives the message, it switches to
* the RUNNING state, then calls the function f with argument arg. Once the
@@ -45,7 +45,7 @@ typedef int (lcore_function_t)(void *);
* the return value of f is stored in a local variable to be read using
* rte_eal_wait_lcore().
*
- * The MASTER lcore returns as soon as the message is sent and knows
+ * The MAIN lcore returns as soon as the message is sent and knows
* nothing about the completion of f.
*
* Note: This function is not designed to offer optimum
@@ -56,37 +56,41 @@ typedef int (lcore_function_t)(void *);
* The function to be called.
* @param arg
* The argument for the function.
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore on which the function should be executed.
* @return
* - 0: Success. Execution of function f started on the remote lcore.
* - (-EBUSY): The remote lcore is not in a WAIT state.
*/
-int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned slave_id);
+int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned worker_id);
/**
- * This enum indicates whether the master core must execute the handler
+ * This enum indicates whether the main core must execute the handler
* launched on all logical cores.
*/
-enum rte_rmt_call_master_t {
- SKIP_MASTER = 0, /**< lcore handler not executed by master core. */
- CALL_MASTER, /**< lcore handler executed by master core. */
+enum rte_rmt_call_main_t {
+ SKIP_MAIN = 0, /**< lcore handler not executed by main core. */
+ CALL_MAIN, /**< lcore handler executed by main core. */
};
+/* These legacy definitions will be removed in future release */
+#define SKIP_MASTER RTE_DEPRECATED(SKIP_MASTER) SKIP_MAIN
+#define CALL_MASTER RTE_DEPRECATED(CALL_MASTER) CALL_MAIN
+
/**
* Launch a function on all lcores.
*
- * Check that each SLAVE lcore is in a WAIT state, then call
+ * Check that each WORKER lcore is in a WAIT state, then call
* rte_eal_remote_launch() for each lcore.
*
* @param f
* The function to be called.
* @param arg
* The argument for the function.
- * @param call_master
- * If call_master set to SKIP_MASTER, the MASTER lcore does not call
- * the function. If call_master is set to CALL_MASTER, the function
- * is also called on master before returning. In any case, the master
+ * @param call_main
+ * If call_main set to SKIP_MAIN, the MAIN lcore does not call
+ * the function. If call_main is set to CALL_MAIN, the function
+ * is also called on main before returning. In any case, the main
* lcore returns as soon as it finished its job and knows nothing
* about the completion of f on the other lcores.
* @return
@@ -95,49 +99,49 @@ enum rte_rmt_call_master_t {
* case, no message is sent to any of the lcores.
*/
int rte_eal_mp_remote_launch(lcore_function_t *f, void *arg,
- enum rte_rmt_call_master_t call_master);
+ enum rte_rmt_call_main_t call_main);
/**
- * Get the state of the lcore identified by slave_id.
+ * Get the state of the lcore identified by worker_id.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore.
* @return
* The state of the lcore.
*/
-enum rte_lcore_state_t rte_eal_get_lcore_state(unsigned slave_id);
+enum rte_lcore_state_t rte_eal_get_lcore_state(unsigned worker_id);
/**
* Wait until an lcore finishes its job.
*
- * To be executed on the MASTER lcore only.
+ * To be executed on the MAIN lcore only.
*
- * If the slave lcore identified by the slave_id is in a FINISHED state,
+ * If the worker lcore identified by the worker_id is in a FINISHED state,
* switch to the WAIT state. If the lcore is in RUNNING state, wait until
* the lcore finishes its job and moves to the FINISHED state.
*
- * @param slave_id
+ * @param worker_id
* The identifier of the lcore.
* @return
- * - 0: If the lcore identified by the slave_id is in a WAIT state.
+ * - 0: If the lcore identified by the worker_id is in a WAIT state.
* - The value that was returned by the previous remote launch
- * function call if the lcore identified by the slave_id was in a
+ * function call if the lcore identified by the worker_id was in a
* FINISHED or RUNNING state. In this case, it changes the state
* of the lcore to WAIT.
*/
-int rte_eal_wait_lcore(unsigned slave_id);
+int rte_eal_wait_lcore(unsigned worker_id);
/**
* Wait until all lcores finish their jobs.
*
- * To be executed on the MASTER lcore only. Issue an
+ * To be executed on the MAIN lcore only. Issue an
* rte_eal_wait_lcore() for every lcore. The return values are
* ignored.
*
* After a call to rte_eal_mp_wait_lcore(), the caller can assume
- * that all slave lcores are in a WAIT state.
+ * that all worker lcores are in a WAIT state.
*/
void rte_eal_mp_wait_lcore(void);
diff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h
index b8b64a625200..48b87e253afa 100644
--- a/lib/librte_eal/include/rte_lcore.h
+++ b/lib/librte_eal/include/rte_lcore.h
@@ -78,12 +78,24 @@ rte_lcore_id(void)
}
/**
- * Get the id of the master lcore
+ * Get the id of the main lcore
*
* @return
- * the id of the master lcore
+ * the id of the main lcore
*/
-unsigned int rte_get_master_lcore(void);
+unsigned int rte_get_main_lcore(void);
+
+/**
+ * Deprecated function the id of the main lcore
+ *
+ * @return
+ * the id of the main lcore
+ */
+__rte_deprecated
+static inline unsigned int rte_get_master_lcore(void)
+{
+ return rte_get_main_lcore();
+}
/**
* Return the number of execution units (lcores) on the system.
@@ -203,32 +215,35 @@ int rte_lcore_is_enabled(unsigned int lcore_id);
*
* @param i
* The current lcore (reference).
- * @param skip_master
- * If true, do not return the ID of the master lcore.
+ * @param skip_main
+ * If true, do not return the ID of the main lcore.
* @param wrap
* If true, go back to 0 when RTE_MAX_LCORE is reached; otherwise,
* return RTE_MAX_LCORE.
* @return
* The next lcore_id or RTE_MAX_LCORE if not found.
*/
-unsigned int rte_get_next_lcore(unsigned int i, int skip_master, int wrap);
+unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap);
/**
* Macro to browse all running lcores.
*/
#define RTE_LCORE_FOREACH(i) \
for (i = rte_get_next_lcore(-1, 0, 0); \
- i<RTE_MAX_LCORE; \
+ i < RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 0, 0))
/**
- * Macro to browse all running lcores except the master lcore.
+ * Macro to browse all running lcores except the main lcore.
*/
-#define RTE_LCORE_FOREACH_SLAVE(i) \
+#define RTE_LCORE_FOREACH_WORKER(i) \
for (i = rte_get_next_lcore(-1, 1, 0); \
- i<RTE_MAX_LCORE; \
+ i < RTE_MAX_LCORE; \
i = rte_get_next_lcore(i, 1, 0))
+#define RTE_LCORE_FOREACH_SLAVE(l) \
+ RTE_DEPRECATED(RTE_LCORE_FOREACH_SLAVE) RTE_LCORE_FOREACH_WORKER(l)
+
/**
* Callback prototype for initializing lcores.
*
diff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c
index 0960f01d0516..d8b1948585dc 100644
--- a/lib/librte_eal/linux/eal.c
+++ b/lib/librte_eal/linux/eal.c
@@ -884,10 +884,10 @@ eal_check_mem_on_local_socket(void)
int socket_id;
const struct rte_config *config = rte_eal_get_configuration();
- socket_id = rte_lcore_to_socket_id(config->master_lcore);
+ socket_id = rte_lcore_to_socket_id(config->main_lcore);
if (rte_memseg_list_walk(check_socket, &socket_id) == 0)
- RTE_LOG(WARNING, EAL, "WARNING: Master core has no memory on local socket!\n");
+ RTE_LOG(WARNING, EAL, "WARNING: Main core has no memory on local socket!\n");
}
static int
@@ -1214,28 +1214,28 @@ rte_eal_init(int argc, char **argv)
eal_check_mem_on_local_socket();
if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
- &lcore_config[config->master_lcore].cpuset) != 0) {
+ &lcore_config[config->main_lcore].cpuset) != 0) {
rte_eal_init_alert("Cannot set affinity");
rte_errno = EINVAL;
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset));
- RTE_LOG(DEBUG, EAL, "Master lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
- config->master_lcore, (uintptr_t)thread_id, cpuset,
+ RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%zx;cpuset=[%s%s])\n",
+ config->main_lcore, (uintptr_t)thread_id, cpuset,
ret == 0 ? "" : "...");
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (pipe(lcore_config[i].pipe_master2slave) < 0)
+ if (pipe(lcore_config[i].pipe_main2worker) < 0)
rte_panic("Cannot create pipe\n");
- if (pipe(lcore_config[i].pipe_slave2master) < 0)
+ if (pipe(lcore_config[i].pipe_worker2main) < 0)
rte_panic("Cannot create pipe\n");
lcore_config[i].state = WAIT;
@@ -1248,7 +1248,7 @@ rte_eal_init(int argc, char **argv)
/* Set thread_name for aid in debugging. */
snprintf(thread_name, sizeof(thread_name),
- "lcore-slave-%d", i);
+ "lcore-worker-%d", i);
ret = rte_thread_setname(lcore_config[i].thread_id,
thread_name);
if (ret != 0)
@@ -1262,10 +1262,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
/* initialize services so vdevs register service during bus_probe. */
diff --git a/lib/librte_eal/linux/eal_memory.c b/lib/librte_eal/linux/eal_memory.c
index 89725291b0ce..3e47efe58212 100644
--- a/lib/librte_eal/linux/eal_memory.c
+++ b/lib/librte_eal/linux/eal_memory.c
@@ -1737,7 +1737,7 @@ memseg_primary_init_32(void)
/* the allocation logic is a little bit convoluted, but here's how it
* works, in a nutshell:
* - if user hasn't specified on which sockets to allocate memory via
- * --socket-mem, we allocate all of our memory on master core socket.
+ * --socket-mem, we allocate all of our memory on main core socket.
* - if user has specified sockets to allocate memory on, there may be
* some "unused" memory left (e.g. if user has specified --socket-mem
* such that not all memory adds up to 2 gigabytes), so add it to all
@@ -1751,7 +1751,7 @@ memseg_primary_init_32(void)
for (i = 0; i < rte_socket_count(); i++) {
int hp_sizes = (int) internal_conf->num_hugepage_sizes;
uint64_t max_socket_mem, cur_socket_mem;
- unsigned int master_lcore_socket;
+ unsigned int main_lcore_socket;
struct rte_config *cfg = rte_eal_get_configuration();
bool skip;
@@ -1767,10 +1767,10 @@ memseg_primary_init_32(void)
skip = active_sockets != 0 &&
internal_conf->socket_mem[socket_id] == 0;
/* ...or if we didn't specifically request memory on *any*
- * socket, and this is not master lcore
+ * socket, and this is not main lcore
*/
- master_lcore_socket = rte_lcore_to_socket_id(cfg->master_lcore);
- skip |= active_sockets == 0 && socket_id != master_lcore_socket;
+ main_lcore_socket = rte_lcore_to_socket_id(cfg->main_lcore);
+ skip |= active_sockets == 0 && socket_id != main_lcore_socket;
if (skip) {
RTE_LOG(DEBUG, EAL, "Will not preallocate memory on socket %u\n",
diff --git a/lib/librte_eal/linux/eal_thread.c b/lib/librte_eal/linux/eal_thread.c
index 068de2559555..bed1d513c841 100644
--- a/lib/librte_eal/linux/eal_thread.c
+++ b/lib/librte_eal/linux/eal_thread.c
@@ -26,35 +26,35 @@
#include "eal_thread.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
+rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
int rc = -EBUSY;
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
goto finish;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(m2s, &c, 1);
+ n = write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = read(s2m, &c, 1);
+ n = read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -62,7 +62,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)
rc = 0;
finish:
- rte_eal_trace_thread_remote_launch(f, arg, slave_id, rc);
+ rte_eal_trace_thread_remote_launch(f, arg, worker_id, rc);
return rc;
}
@@ -74,21 +74,21 @@ eal_thread_loop(__rte_unused void *arg)
int n, ret;
unsigned lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -104,7 +104,7 @@ eal_thread_loop(__rte_unused void *arg)
/* wait command */
do {
- n = read(m2s, &c, 1);
+ n = read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -115,7 +115,7 @@ eal_thread_loop(__rte_unused void *arg)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = write(s2m, &c, 1);
+ n = write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 0b18e2ef85f9..8ff6fe7c3eaf 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -74,7 +74,7 @@ DPDK_21 {
rte_free;
rte_get_hpet_cycles;
rte_get_hpet_hz;
- rte_get_master_lcore;
+ rte_get_main_lcore;
rte_get_next_lcore;
rte_get_tsc_hz;
rte_hexdump;
diff --git a/lib/librte_eal/windows/eal.c b/lib/librte_eal/windows/eal.c
index bc48f27ab39a..cbca20956210 100644
--- a/lib/librte_eal/windows/eal.c
+++ b/lib/librte_eal/windows/eal.c
@@ -350,8 +350,8 @@ rte_eal_init(int argc, char **argv)
return -1;
}
- __rte_thread_init(config->master_lcore,
- &lcore_config[config->master_lcore].cpuset);
+ __rte_thread_init(config->main_lcore,
+ &lcore_config[config->main_lcore].cpuset);
bscan = rte_bus_scan();
if (bscan < 0) {
@@ -360,16 +360,16 @@ rte_eal_init(int argc, char **argv)
return -1;
}
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
/*
- * create communication pipes between master thread
+ * create communication pipes between main thread
* and children
*/
- if (_pipe(lcore_config[i].pipe_master2slave,
+ if (_pipe(lcore_config[i].pipe_main2worker,
sizeof(char), _O_BINARY) < 0)
rte_panic("Cannot create pipe\n");
- if (_pipe(lcore_config[i].pipe_slave2master,
+ if (_pipe(lcore_config[i].pipe_worker2main,
sizeof(char), _O_BINARY) < 0)
rte_panic("Cannot create pipe\n");
@@ -394,10 +394,10 @@ rte_eal_init(int argc, char **argv)
}
/*
- * Launch a dummy function on all slave lcores, so that master lcore
+ * Launch a dummy function on all worker lcores, so that main lcore
* knows they are all ready when this function returns.
*/
- rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
+ rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MAIN);
rte_eal_mp_wait_lcore();
return fctret;
}
diff --git a/lib/librte_eal/windows/eal_thread.c b/lib/librte_eal/windows/eal_thread.c
index 20889b6196c9..908e726d16cc 100644
--- a/lib/librte_eal/windows/eal_thread.c
+++ b/lib/librte_eal/windows/eal_thread.c
@@ -17,34 +17,34 @@
#include "eal_windows.h"
/*
- * Send a message to a slave lcore identified by slave_id to call a
+ * Send a message to a worker lcore identified by worker_id to call a
* function f with argument arg. Once the execution is done, the
* remote lcore switch in FINISHED state.
*/
int
-rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int slave_id)
+rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned int worker_id)
{
int n;
char c = 0;
- int m2s = lcore_config[slave_id].pipe_master2slave[1];
- int s2m = lcore_config[slave_id].pipe_slave2master[0];
+ int m2w = lcore_config[worker_id].pipe_main2worker[1];
+ int w2m = lcore_config[worker_id].pipe_worker2main[0];
- if (lcore_config[slave_id].state != WAIT)
+ if (lcore_config[worker_id].state != WAIT)
return -EBUSY;
- lcore_config[slave_id].f = f;
- lcore_config[slave_id].arg = arg;
+ lcore_config[worker_id].f = f;
+ lcore_config[worker_id].arg = arg;
/* send message */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = _write(m2s, &c, 1);
+ n = _write(m2w, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
/* wait ack */
do {
- n = _read(s2m, &c, 1);
+ n = _read(w2m, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -61,21 +61,21 @@ eal_thread_loop(void *arg __rte_unused)
int n, ret;
unsigned int lcore_id;
pthread_t thread_id;
- int m2s, s2m;
+ int m2w, w2m;
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
thread_id = pthread_self();
/* retrieve our lcore_id from the configuration structure */
- RTE_LCORE_FOREACH_SLAVE(lcore_id) {
+ RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (thread_id == lcore_config[lcore_id].thread_id)
break;
}
if (lcore_id == RTE_MAX_LCORE)
rte_panic("cannot retrieve lcore id\n");
- m2s = lcore_config[lcore_id].pipe_master2slave[0];
- s2m = lcore_config[lcore_id].pipe_slave2master[1];
+ m2w = lcore_config[lcore_id].pipe_main2worker[0];
+ w2m = lcore_config[lcore_id].pipe_worker2main[1];
__rte_thread_init(lcore_id, &lcore_config[lcore_id].cpuset);
@@ -88,7 +88,7 @@ eal_thread_loop(void *arg __rte_unused)
/* wait command */
do {
- n = _read(m2s, &c, 1);
+ n = _read(m2w, &c, 1);
} while (n < 0 && errno == EINTR);
if (n <= 0)
@@ -99,7 +99,7 @@ eal_thread_loop(void *arg __rte_unused)
/* send ack */
n = 0;
while (n == 0 || (n < 0 && errno == EINTR))
- n = _write(s2m, &c, 1);
+ n = _write(w2m, &c, 1);
if (n < 0)
rte_panic("cannot write on configuration pipe\n");
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 04/17] rte_power: replace rte_master_lcore with rte_main_lcore
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
` (2 preceding siblings ...)
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 03/17] eal: rename lcore word choices Stephen Hemminger
@ 2020-09-15 15:11 ` Stephen Hemminger
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 05/17] drivers: replace master lcore with main lcore Stephen Hemminger
` (14 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:11 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
The old rte_master_lcore is now replaced by rte_main_lcore.
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_power/rte_power_empty_poll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_power/rte_power_empty_poll.c b/lib/librte_power/rte_power_empty_poll.c
index 70c07b1533f3..975aa9299799 100644
--- a/lib/librte_power/rte_power_empty_poll.c
+++ b/lib/librte_power/rte_power_empty_poll.c
@@ -452,7 +452,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,
if (get_freq_index(LOW) > total_avail_freqs[i])
return -1;
- if (rte_get_master_lcore() != i) {
+ if (rte_get_main_lcore() != i) {
w->wrk_stats[i].lcore_id = i;
set_policy(&w->wrk_stats[i], policy);
}
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 05/17] drivers: replace master lcore with main lcore
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
` (3 preceding siblings ...)
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 04/17] rte_power: replace rte_master_lcore with rte_main_lcore Stephen Hemminger
@ 2020-09-15 15:11 ` Stephen Hemminger
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 06/17] net/memif: replace master/slave arguments with server/client Stephen Hemminger
` (13 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:11 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Anatoly Burakov
Replace use of deprecated rte_master_lcore with rte_main_lcore.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/pci/pci_common_uio.c | 3 ++-
drivers/bus/vmbus/vmbus_common_uio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 10 +++++-----
drivers/event/octeontx/ssovf_evdev_selftest.c | 10 +++++-----
drivers/event/sw/sw_evdev_selftest.c | 2 +-
drivers/net/bnxt/bnxt_ring.c | 4 ++--
drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
drivers/net/qede/base/bcm_osal.c | 4 ++--
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/softnic/rte_eth_softnic_thread.c | 16 ++++++++--------
11 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 32e872da5209..c94c72106f2c 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -257,7 +257,7 @@ int rte_dpaa_portal_init(void *arg)
BUS_INIT_FUNC_TRACE();
if ((size_t)arg == 1 || lcore == LCORE_ID_ANY)
- lcore = rte_get_master_lcore();
+ lcore = rte_get_main_lcore();
else
if (lcore >= RTE_MAX_LCORE)
return -1;
diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
index f4dca9da9133..ca2073e1dd2b 100644
--- a/drivers/bus/pci/pci_common_uio.c
+++ b/drivers/bus/pci/pci_common_uio.c
@@ -51,7 +51,8 @@ pci_uio_map_secondary(struct rte_pci_device *dev)
void *mapaddr = pci_map_resource(uio_res->maps[i].addr,
fd, (off_t)uio_res->maps[i].offset,
(size_t)uio_res->maps[i].size, 0);
- /* fd is not needed in slave process, close it */
+
+ /* fd is not needed in secondary process, close it */
close(fd);
if (mapaddr != uio_res->maps[i].addr) {
RTE_LOG(ERR, EAL,
diff --git a/drivers/bus/vmbus/vmbus_common_uio.c b/drivers/bus/vmbus/vmbus_common_uio.c
index 8e476f2eaf8b..a689bf11b3f6 100644
--- a/drivers/bus/vmbus/vmbus_common_uio.c
+++ b/drivers/bus/vmbus/vmbus_common_uio.c
@@ -85,7 +85,7 @@ vmbus_uio_map_secondary(struct rte_vmbus_device *dev)
return -1;
}
- /* fd is not needed in slave process, close it */
+ /* fd is not needed in secondary process, close it */
close(fd);
dev->primary = uio_res->primary;
diff --git a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
index ba4f4bd23447..b1f38914841d 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c
@@ -501,8 +501,8 @@ wait_workers_to_join(int lcore, const rte_atomic32_t *count)
static int
-launch_workers_and_wait(int (*master_worker)(void *),
- int (*slave_workers)(void *), uint32_t total_events,
+launch_workers_and_wait(int (*main_worker)(void *),
+ int (*workers)(void *), uint32_t total_events,
uint8_t nb_workers, uint8_t sched_type)
{
uint8_t port = 0;
@@ -537,9 +537,9 @@ launch_workers_and_wait(int (*master_worker)(void *),
w_lcore = rte_get_next_lcore(
/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
- rte_eal_remote_launch(master_worker, ¶m[0], w_lcore);
+ rte_eal_remote_launch(main_worker, ¶m[0], w_lcore);
for (port = 1; port < nb_workers; port++) {
param[port].total_events = &atomic_total_events;
@@ -548,7 +548,7 @@ launch_workers_and_wait(int (*master_worker)(void *),
param[port].dequeue_tmo_ticks = dequeue_tmo_ticks;
rte_smp_wmb();
w_lcore = rte_get_next_lcore(w_lcore, 1, 0);
- rte_eal_remote_launch(slave_workers, ¶m[port], w_lcore);
+ rte_eal_remote_launch(workers, ¶m[port], w_lcore);
}
ret = wait_workers_to_join(w_lcore, &atomic_total_events);
diff --git a/drivers/event/octeontx/ssovf_evdev_selftest.c b/drivers/event/octeontx/ssovf_evdev_selftest.c
index 239362fcf549..7a2b7ded259c 100644
--- a/drivers/event/octeontx/ssovf_evdev_selftest.c
+++ b/drivers/event/octeontx/ssovf_evdev_selftest.c
@@ -601,8 +601,8 @@ wait_workers_to_join(int lcore, const rte_atomic32_t *count)
static inline int
-launch_workers_and_wait(int (*master_worker)(void *),
- int (*slave_workers)(void *), uint32_t total_events,
+launch_workers_and_wait(int (*main_worker)(void *),
+ int (*worker)(void *), uint32_t total_events,
uint8_t nb_workers, uint8_t sched_type)
{
uint8_t port = 0;
@@ -637,9 +637,9 @@ launch_workers_and_wait(int (*master_worker)(void *),
w_lcore = rte_get_next_lcore(
/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
- rte_eal_remote_launch(master_worker, ¶m[0], w_lcore);
+ rte_eal_remote_launch(main_worker, ¶m[0], w_lcore);
for (port = 1; port < nb_workers; port++) {
param[port].total_events = &atomic_total_events;
@@ -648,7 +648,7 @@ launch_workers_and_wait(int (*master_worker)(void *),
param[port].dequeue_tmo_ticks = dequeue_tmo_ticks;
rte_smp_wmb();
w_lcore = rte_get_next_lcore(w_lcore, 1, 0);
- rte_eal_remote_launch(slave_workers, ¶m[port], w_lcore);
+ rte_eal_remote_launch(worker, ¶m[port], w_lcore);
}
ret = wait_workers_to_join(w_lcore, &atomic_total_events);
diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c
index 38c21fa0fa3d..6dfbdd308310 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -3108,7 +3108,7 @@ worker_loopback(struct test *t, uint8_t disable_implicit_release)
p_lcore = rte_get_next_lcore(
/* start core */ -1,
- /* skip master */ 1,
+ /* skip main */ 1,
/* wrap */ 0);
w_lcore = rte_get_next_lcore(p_lcore, 1, 0);
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 54f654744259..910fb11c9c38 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -429,7 +429,7 @@ int bnxt_alloc_rxtx_nq_ring(struct bnxt *bp)
if (!BNXT_HAS_NQ(bp) || bp->rxtx_nq_ring)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_main_lcore());
nqr = rte_zmalloc_socket("nqr",
sizeof(struct bnxt_cp_ring_info),
@@ -819,7 +819,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
if (BNXT_NUM_ASYNC_CPR(bp) == 0)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_main_lcore());
cpr = rte_zmalloc_socket("cpr",
sizeof(struct bnxt_cp_ring_info),
diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 96b27dfd309d..85deddf120b4 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -814,7 +814,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
hif = mrvl_get_hif(priv, core_id);
@@ -1618,7 +1618,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
hif = mrvl_get_hif(rxq->priv, core_id);
if (!hif)
@@ -1768,7 +1768,7 @@ mrvl_rx_queue_release(void *rxq)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
if (!q)
return;
diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 65837b53d063..4c2706ab4b90 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -112,7 +112,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, RTE_CACHE_LINE_SIZE);
@@ -151,7 +151,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_main_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, align);
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index 6eec43b22b13..d95160ab21f6 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -547,7 +547,7 @@ TAILQ_HEAD(pipeline_list, pipeline);
#endif
/**
- * Master thead: data plane thread context
+ * Main thead: data plane thread context
*/
struct softnic_thread {
struct rte_ring *msgq_req;
diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index dcfb5eb82c18..a8c26a5b2377 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -18,14 +18,14 @@
#include "rte_eth_softnic_internals.h"
/**
- * Master thread: data plane thread init
+ * Main thread: data plane thread init
*/
void
softnic_thread_free(struct pmd_internals *softnic)
{
uint32_t i;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
struct softnic_thread *t = &softnic->thread[i];
/* MSGQs */
@@ -78,7 +78,7 @@ softnic_thread_init(struct pmd_internals *softnic)
return -1;
}
- /* Master thread records */
+ /* Main thread records */
t->msgq_req = msgq_req;
t->msgq_rsp = msgq_rsp;
t->service_id = UINT32_MAX;
@@ -99,7 +99,7 @@ softnic_thread_init(struct pmd_internals *softnic)
static inline int
thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id)
{
- if (thread_id == rte_get_master_lcore())
+ if (thread_id == rte_get_main_lcore())
return 0; /* FALSE */
if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE))
@@ -209,7 +209,7 @@ pipeline_is_running(struct pipeline *p)
}
/**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
*/
enum thread_req_type {
THREAD_REQ_PIPELINE_ENABLE = 0,
@@ -243,7 +243,7 @@ struct thread_msg_rsp {
};
/**
- * Master thread
+ * Main thread
*/
static struct thread_msg_req *
thread_msg_alloc(void)
@@ -587,7 +587,7 @@ thread_msg_handle(struct softnic_thread_data *t)
}
/**
- * Master thread & data plane threads: message passing
+ * Main thread & data plane threads: message passing
*/
enum pipeline_req_type {
/* Port IN */
@@ -753,7 +753,7 @@ struct pipeline_msg_rsp {
};
/**
- * Master thread
+ * Main thread
*/
static struct pipeline_msg_req *
pipeline_msg_alloc(void)
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 06/17] net/memif: replace master/slave arguments with server/client
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
` (4 preceding siblings ...)
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 05/17] drivers: replace master lcore with main lcore Stephen Hemminger
@ 2020-09-15 15:11 ` Stephen Hemminger
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 07/17] doc: replace master lcore with main lcore Stephen Hemminger
` (12 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:11 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Replace master/slave terms in this driver.
The memory interface drivers uses a client/server architecture
so change the variable names and device arguments to that.
The previous devargs are maintained for compatiablity, but if
used cause a notice in the log.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/nics/memif.rst | 78 ++++++++---------
drivers/net/memif/memif.h | 40 ++++-----
drivers/net/memif/memif_socket.c | 54 ++++++------
drivers/net/memif/memif_socket.h | 5 +-
drivers/net/memif/rte_eth_memif.c | 134 ++++++++++++++++--------------
drivers/net/memif/rte_eth_memif.h | 20 ++---
6 files changed, 169 insertions(+), 162 deletions(-)
diff --git a/doc/guides/nics/memif.rst b/doc/guides/nics/memif.rst
index ddeebed25ccd..8dca1ff8f4b2 100644
--- a/doc/guides/nics/memif.rst
+++ b/doc/guides/nics/memif.rst
@@ -13,13 +13,13 @@ The created device transmits packets in a raw format. It can be used with
Ethernet mode, IP mode, or Punt/Inject. At this moment, only Ethernet mode is
supported in DPDK memif implementation.
-Memif works in two roles: master and slave. Slave connects to master over an
+Memif works in two roles: server and client. Client connects to server over an
existing socket. It is also a producer of shared memory file and initializes
the shared memory. Each interface can be connected to one peer interface
-at same time. The peer interface is identified by id parameter. Master
-creates the socket and listens for any slave connection requests. The socket
+at same time. The peer interface is identified by id parameter. Server
+creates the socket and listens for any client connection requests. The socket
may already exist on the system. Be sure to remove any such sockets, if you
-are creating a master interface, or you will see an "Address already in use"
+are creating a server interface, or you will see an "Address already in use"
error. Function ``rte_pmd_memif_remove()``, which removes memif interface,
will also remove a listener socket, if it is not being used by any other
interface.
@@ -31,57 +31,57 @@ net_memif1, and so on. Memif uses unix domain socket to transmit control
messages. Each memif has a unique id per socket. This id is used to identify
peer interface. If you are connecting multiple
interfaces using same socket, be sure to specify unique ids ``id=0``, ``id=1``,
-etc. Note that if you assign a socket to a master interface it becomes a
-listener socket. Listener socket can not be used by a slave interface on same
+etc. Note that if you assign a socket to a server interface it becomes a
+listener socket. Listener socket can not be used by a client interface on same
client.
.. csv-table:: **Memif configuration options**
:header: "Option", "Description", "Default", "Valid value"
"id=0", "Used to identify peer interface", "0", "uint32_t"
- "role=master", "Set memif role", "slave", "master|slave"
+ "role=server", "Set memif role", "client", "server|client"
"bsize=1024", "Size of single packet buffer", "2048", "uint16_t"
"rsize=11", "Log2 of ring size. If rsize is 10, actual ring size is 1024", "10", "1-14"
"socket=/tmp/memif.sock", "Socket filename", "/tmp/memif.sock", "string len 108"
"mac=01:23:45:ab:cd:ef", "Mac address", "01:ab:23:cd:45:ef", ""
"secret=abc123", "Secret is an optional security option, which if specified, must be matched by peer", "", "string len 24"
- "zero-copy=yes", "Enable/disable zero-copy slave mode. Only relevant to slave, requires '--single-file-segments' eal argument", "no", "yes|no"
+ "zero-copy=yes", "Enable/disable zero-copy client mode. Only relevant to client, requires '--single-file-segments' eal argument", "no", "yes|no"
**Connection establishment**
In order to create memif connection, two memif interfaces, each in separate
-process, are needed. One interface in ``master`` role and other in
-``slave`` role. It is not possible to connect two interfaces in a single
+process, are needed. One interface in ``server`` role and other in
+``client`` role. It is not possible to connect two interfaces in a single
process. Each interface can be connected to one interface at same time,
identified by matching id parameter.
Memif driver uses unix domain socket to exchange required information between
memif interfaces. Socket file path is specified at interface creation see
-*Memif configuration options* table above. If socket is used by ``master``
+*Memif configuration options* table above. If socket is used by ``server``
interface, it's marked as listener socket (in scope of current process) and
listens to connection requests from other processes. One socket can be used by
-multiple interfaces. One process can have ``slave`` and ``master`` interfaces
+multiple interfaces. One process can have ``client`` and ``server`` interfaces
at the same time, provided each role is assigned unique socket.
For detailed information on memif control messages, see: net/memif/memif.h.
-Slave interface attempts to make a connection on assigned socket. Process
+Client interface attempts to make a connection on assigned socket. Process
listening on this socket will extract the connection request and create a new
connected socket (control channel). Then it sends the 'hello' message
-(``MEMIF_MSG_TYPE_HELLO``), containing configuration boundaries. Slave interface
+(``MEMIF_MSG_TYPE_HELLO``), containing configuration boundaries. Client interface
adjusts its configuration accordingly, and sends 'init' message
(``MEMIF_MSG_TYPE_INIT``). This message among others contains interface id. Driver
-uses this id to find master interface, and assigns the control channel to this
+uses this id to find server interface, and assigns the control channel to this
interface. If such interface is found, 'ack' message (``MEMIF_MSG_TYPE_ACK``) is
-sent. Slave interface sends 'add region' message (``MEMIF_MSG_TYPE_ADD_REGION``) for
-every region allocated. Master responds to each of these messages with 'ack'
-message. Same behavior applies to rings. Slave sends 'add ring' message
-(``MEMIF_MSG_TYPE_ADD_RING``) for every initialized ring. Master again responds to
-each message with 'ack' message. To finalize the connection, slave interface
+sent. Client interface sends 'add region' message (``MEMIF_MSG_TYPE_ADD_REGION``) for
+every region allocated. Server responds to each of these messages with 'ack'
+message. Same behavior applies to rings. Client sends 'add ring' message
+(``MEMIF_MSG_TYPE_ADD_RING``) for every initialized ring. Server again responds to
+each message with 'ack' message. To finalize the connection, client interface
sends 'connect' message (``MEMIF_MSG_TYPE_CONNECT``). Upon receiving this message
-master maps regions to its address space, initializes rings and responds with
+server maps regions to its address space, initializes rings and responds with
'connected' message (``MEMIF_MSG_TYPE_CONNECTED``). Disconnect
-(``MEMIF_MSG_TYPE_DISCONNECT``) can be sent by both master and slave interfaces at
+(``MEMIF_MSG_TYPE_DISCONNECT``) can be sent by both server and client interfaces at
any time, due to driver error or if the interface is being deleted.
Files
@@ -95,8 +95,8 @@ Shared memory
**Shared memory format**
-Slave is producer and master is consumer. Memory regions, are mapped shared memory files,
-created by memif slave and provided to master at connection establishment.
+Client is producer and server is consumer. Memory regions, are mapped shared memory files,
+created by memif client and provided to server at connection establishment.
Regions contain rings and buffers. Rings and buffers can also be separated into multiple
regions. For no-zero-copy, rings and buffers are stored inside single memory
region to reduce the number of opened files.
@@ -171,11 +171,11 @@ Files
- net/memif/memif.h *- descriptor and ring definitions*
- net/memif/rte_eth_memif.c *- eth_memif_rx() eth_memif_tx()*
-Zero-copy slave
+Zero-copy client
~~~~~~~~~~~~~~~
-Zero-copy slave can be enabled with memif configuration option 'zero-copy=yes'. This option
-is only relevant to slave and requires eal argument '--single-file-segments'.
+Zero-copy client can be enabled with memif configuration option 'zero-copy=yes'. This option
+is only relevant to client and requires eal argument '--single-file-segments'.
This limitation is in place, because it is too expensive to identify memseg
for each packet buffer, resulting in worse performance than with zero-copy disabled.
With single file segments we can calculate offset from the beginning of the file
@@ -183,9 +183,9 @@ for each packet buffer.
**Shared memory format**
-Region 0 is created by memif driver and contains rings. Slave interface exposes DPDK memory (memseg).
+Region 0 is created by memif driver and contains rings. Client interface exposes DPDK memory (memseg).
Instead of using memfd_create() to create new shared file, existing memsegs are used.
-Master interface functions the same as with zero-copy disabled.
+Server interface functions the same as with zero-copy disabled.
region 0:
@@ -211,24 +211,24 @@ Example: testpmd
----------------------------
In this example we run two instances of testpmd application and transmit packets over memif.
-First create ``master`` interface::
+First create ``server`` interface::
- #./build/app/testpmd -l 0-1 --proc-type=primary --file-prefix=pmd1 --vdev=net_memif,role=master -- -i
+ #./build/app/testpmd -l 0-1 --proc-type=primary --file-prefix=pmd1 --vdev=net_memif,role=server -- -i
-Now create ``slave`` interface (master must be already running so the slave will connect)::
+Now create ``client`` interface (server must be already running so the client will connect)::
#./build/app/testpmd -l 2-3 --proc-type=primary --file-prefix=pmd2 --vdev=net_memif -- -i
-You can also enable ``zero-copy`` on ``slave`` interface::
+You can also enable ``zero-copy`` on ``client`` interface::
#./build/app/testpmd -l 2-3 --proc-type=primary --file-prefix=pmd2 --vdev=net_memif,zero-copy=yes --single-file-segments -- -i
Start forwarding packets::
- Slave:
+ Client:
testpmd> start
- Master:
+ Server:
testpmd> start tx_first
Show status::
@@ -241,9 +241,9 @@ Example: testpmd and VPP
------------------------
For information on how to get and run VPP please see `<https://wiki.fd.io/view/VPP>`_.
-Start VPP in interactive mode (should be by default). Create memif master interface in VPP::
+Start VPP in interactive mode (should be by default). Create memif server interface in VPP::
- vpp# create interface memif id 0 master no-zero-copy
+ vpp# create interface memif id 0 server no-zero-copy
vpp# set interface state memif0/0 up
vpp# set interface ip address memif0/0 192.168.1.1/24
@@ -259,7 +259,7 @@ Now create memif interface by running testpmd with these command line options::
#./testpmd --vdev=net_memif,socket=/run/vpp/memif.sock -- -i
-Testpmd should now create memif slave interface and try to connect to master.
+Testpmd should now create memif client interface and try to connect to server.
In testpmd set forward option to icmpecho and start forwarding::
testpmd> set fwd icmpecho
@@ -280,7 +280,7 @@ The situation is analogous to cross connecting 2 ports of the NIC by cable.
To set the loopback, just use the same socket and id with different roles::
- #./testpmd --vdev=net_memif0,role=master,id=0 --vdev=net_memif1,role=slave,id=0 -- -i
+ #./testpmd --vdev=net_memif0,role=server,id=0 --vdev=net_memif1,role=client,id=0 -- -i
Then start the communication::
diff --git a/drivers/net/memif/memif.h b/drivers/net/memif/memif.h
index b91230890410..cb72c692ba03 100644
--- a/drivers/net/memif/memif.h
+++ b/drivers/net/memif/memif.h
@@ -12,8 +12,8 @@
#define MEMIF_NAME_SZ 32
/*
- * S2M: direction slave -> master
- * M2S: direction master -> slave
+ * C2S: direction client -> server
+ * S2C: direction server -> client
*/
/*
@@ -33,8 +33,8 @@ typedef enum memif_msg_type {
} memif_msg_type_t;
typedef enum {
- MEMIF_RING_S2M, /**< buffer ring in direction slave -> master */
- MEMIF_RING_M2S, /**< buffer ring in direction master -> slave */
+ MEMIF_RING_C2S, /**< buffer ring in direction client -> server */
+ MEMIF_RING_S2C, /**< buffer ring in direction server -> client */
} memif_ring_type_t;
typedef enum {
@@ -56,23 +56,23 @@ typedef uint8_t memif_log2_ring_size_t;
*/
/**
- * M2S
- * Contains master interfaces configuration.
+ * S2C
+ * Contains server interfaces configuration.
*/
typedef struct __rte_packed {
uint8_t name[MEMIF_NAME_SZ]; /**< Client app name. In this case DPDK version */
memif_version_t min_version; /**< lowest supported memif version */
memif_version_t max_version; /**< highest supported memif version */
memif_region_index_t max_region; /**< maximum num of regions */
- memif_ring_index_t max_m2s_ring; /**< maximum num of M2S ring */
- memif_ring_index_t max_s2m_ring; /**< maximum num of S2M rings */
+ memif_ring_index_t max_s2c_ring; /**< maximum num of S2C ring */
+ memif_ring_index_t max_c2s_ring; /**< maximum num of C2S rings */
memif_log2_ring_size_t max_log2_ring_size; /**< maximum ring size (as log2) */
} memif_msg_hello_t;
/**
- * S2M
+ * C2S
* Contains information required to identify interface
- * to which the slave wants to connect.
+ * to which the client wants to connect.
*/
typedef struct __rte_packed {
memif_version_t version; /**< memif version */
@@ -83,8 +83,8 @@ typedef struct __rte_packed {
} memif_msg_init_t;
/**
- * S2M
- * Request master to add new shared memory region to master interface.
+ * C2S
+ * Request server to add new shared memory region to server interface.
* Shared files file descriptor is passed in cmsghdr.
*/
typedef struct __rte_packed {
@@ -93,12 +93,12 @@ typedef struct __rte_packed {
} memif_msg_add_region_t;
/**
- * S2M
- * Request master to add new ring to master interface.
+ * C2S
+ * Request server to add new ring to server interface.
*/
typedef struct __rte_packed {
uint16_t flags; /**< flags */
-#define MEMIF_MSG_ADD_RING_FLAG_S2M 1 /**< ring is in S2M direction */
+#define MEMIF_MSG_ADD_RING_FLAG_C2S 1 /**< ring is in C2S direction */
memif_ring_index_t index; /**< ring index */
memif_region_index_t region; /**< region index on which this ring is located */
memif_region_offset_t offset; /**< buffer start offset */
@@ -107,23 +107,23 @@ typedef struct __rte_packed {
} memif_msg_add_ring_t;
/**
- * S2M
+ * C2S
* Finalize connection establishment.
*/
typedef struct __rte_packed {
- uint8_t if_name[MEMIF_NAME_SZ]; /**< slave interface name */
+ uint8_t if_name[MEMIF_NAME_SZ]; /**< client interface name */
} memif_msg_connect_t;
/**
- * M2S
+ * S2C
* Finalize connection establishment.
*/
typedef struct __rte_packed {
- uint8_t if_name[MEMIF_NAME_SZ]; /**< master interface name */
+ uint8_t if_name[MEMIF_NAME_SZ]; /**< server interface name */
} memif_msg_connected_t;
/**
- * S2M & M2S
+ * C2S & S2C
* Disconnect interfaces.
*/
typedef struct __rte_packed {
diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 67794cb6fa8c..b1475374910e 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -143,8 +143,8 @@ memif_msg_enq_hello(struct memif_control_channel *cc)
e->msg.type = MEMIF_MSG_TYPE_HELLO;
h->min_version = MEMIF_VERSION;
h->max_version = MEMIF_VERSION;
- h->max_s2m_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
- h->max_m2s_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
+ h->max_c2s_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
+ h->max_s2c_ring = ETH_MEMIF_MAX_NUM_Q_PAIRS;
h->max_region = ETH_MEMIF_MAX_REGION_NUM - 1;
h->max_log2_ring_size = ETH_MEMIF_MAX_LOG2_RING_SIZE;
@@ -165,10 +165,10 @@ memif_msg_receive_hello(struct rte_eth_dev *dev, memif_msg_t *msg)
}
/* Set parameters for active connection */
- pmd->run.num_s2m_rings = RTE_MIN(h->max_s2m_ring + 1,
- pmd->cfg.num_s2m_rings);
- pmd->run.num_m2s_rings = RTE_MIN(h->max_m2s_ring + 1,
- pmd->cfg.num_m2s_rings);
+ pmd->run.num_c2s_rings = RTE_MIN(h->max_c2s_ring + 1,
+ pmd->cfg.num_c2s_rings);
+ pmd->run.num_s2c_rings = RTE_MIN(h->max_s2c_ring + 1,
+ pmd->cfg.num_s2c_rings);
pmd->run.log2_ring_size = RTE_MIN(h->max_log2_ring_size,
pmd->cfg.log2_ring_size);
pmd->run.pkt_buffer_size = pmd->cfg.pkt_buffer_size;
@@ -203,7 +203,7 @@ memif_msg_receive_init(struct memif_control_channel *cc, memif_msg_t *msg)
dev = elt->dev;
pmd = dev->data->dev_private;
if (((pmd->flags & ETH_MEMIF_FLAG_DISABLED) == 0) &&
- (pmd->id == i->id) && (pmd->role == MEMIF_ROLE_MASTER)) {
+ (pmd->id == i->id) && (pmd->role == MEMIF_ROLE_SERVER)) {
if (pmd->flags & (ETH_MEMIF_FLAG_CONNECTING |
ETH_MEMIF_FLAG_CONNECTED)) {
memif_msg_enq_disconnect(cc,
@@ -300,21 +300,21 @@ memif_msg_receive_add_ring(struct rte_eth_dev *dev, memif_msg_t *msg, int fd)
}
/* check if we have enough queues */
- if (ar->flags & MEMIF_MSG_ADD_RING_FLAG_S2M) {
- if (ar->index >= pmd->cfg.num_s2m_rings) {
+ if (ar->flags & MEMIF_MSG_ADD_RING_FLAG_C2S) {
+ if (ar->index >= pmd->cfg.num_c2s_rings) {
memif_msg_enq_disconnect(pmd->cc, "Invalid ring index", 0);
return -1;
}
- pmd->run.num_s2m_rings++;
+ pmd->run.num_c2s_rings++;
} else {
- if (ar->index >= pmd->cfg.num_m2s_rings) {
+ if (ar->index >= pmd->cfg.num_s2c_rings) {
memif_msg_enq_disconnect(pmd->cc, "Invalid ring index", 0);
return -1;
}
- pmd->run.num_m2s_rings++;
+ pmd->run.num_s2c_rings++;
}
- mq = (ar->flags & MEMIF_MSG_ADD_RING_FLAG_S2M) ?
+ mq = (ar->flags & MEMIF_MSG_ADD_RING_FLAG_C2S) ?
dev->data->rx_queues[ar->index] : dev->data->tx_queues[ar->index];
mq->intr_handle.fd = fd;
@@ -449,7 +449,7 @@ memif_msg_enq_add_ring(struct rte_eth_dev *dev, uint8_t idx,
return -1;
ar = &e->msg.add_ring;
- mq = (type == MEMIF_RING_S2M) ? dev->data->tx_queues[idx] :
+ mq = (type == MEMIF_RING_C2S) ? dev->data->tx_queues[idx] :
dev->data->rx_queues[idx];
e->msg.type = MEMIF_MSG_TYPE_ADD_RING;
@@ -458,7 +458,7 @@ memif_msg_enq_add_ring(struct rte_eth_dev *dev, uint8_t idx,
ar->offset = mq->ring_offset;
ar->region = mq->region;
ar->log2_ring_size = mq->log2_ring_size;
- ar->flags = (type == MEMIF_RING_S2M) ? MEMIF_MSG_ADD_RING_FLAG_S2M : 0;
+ ar->flags = (type == MEMIF_RING_C2S) ? MEMIF_MSG_ADD_RING_FLAG_C2S : 0;
ar->private_hdr_size = 0;
return 0;
@@ -575,8 +575,8 @@ memif_disconnect(struct rte_eth_dev *dev)
rte_spinlock_unlock(&pmd->cc_lock);
/* unconfig interrupts */
- for (i = 0; i < pmd->cfg.num_s2m_rings; i++) {
- if (pmd->role == MEMIF_ROLE_SLAVE) {
+ for (i = 0; i < pmd->cfg.num_c2s_rings; i++) {
+ if (pmd->role == MEMIF_ROLE_CLIENT) {
if (dev->data->tx_queues != NULL)
mq = dev->data->tx_queues[i];
else
@@ -592,8 +592,8 @@ memif_disconnect(struct rte_eth_dev *dev)
mq->intr_handle.fd = -1;
}
}
- for (i = 0; i < pmd->cfg.num_m2s_rings; i++) {
- if (pmd->role == MEMIF_ROLE_MASTER) {
+ for (i = 0; i < pmd->cfg.num_s2c_rings; i++) {
+ if (pmd->role == MEMIF_ROLE_SERVER) {
if (dev->data->tx_queues != NULL)
mq = dev->data->tx_queues[i];
else
@@ -616,7 +616,7 @@ memif_disconnect(struct rte_eth_dev *dev)
memset(&pmd->run, 0, sizeof(pmd->run));
MIF_LOG(DEBUG, "Disconnected, id: %d, role: %s.", pmd->id,
- (pmd->role == MEMIF_ROLE_MASTER) ? "master" : "slave");
+ (pmd->role == MEMIF_ROLE_SERVER) ? "server" : "client");
}
static int
@@ -694,15 +694,15 @@ memif_msg_receive(struct memif_control_channel *cc)
if (ret < 0)
goto exit;
}
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
ret = memif_msg_enq_add_ring(cc->dev, i,
- MEMIF_RING_S2M);
+ MEMIF_RING_C2S);
if (ret < 0)
goto exit;
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
ret = memif_msg_enq_add_ring(cc->dev, i,
- MEMIF_RING_M2S);
+ MEMIF_RING_S2C);
if (ret < 0)
goto exit;
}
@@ -963,7 +963,7 @@ memif_socket_init(struct rte_eth_dev *dev, const char *socket_filename)
ret = rte_hash_lookup_data(hash, key, (void **)&socket);
if (ret < 0) {
socket = memif_socket_create(key,
- (pmd->role == MEMIF_ROLE_SLAVE) ? 0 : 1);
+ (pmd->role == MEMIF_ROLE_CLIENT) ? 0 : 1);
if (socket == NULL)
return -1;
ret = rte_hash_add_key_data(hash, key, socket);
@@ -1039,7 +1039,7 @@ memif_socket_remove_device(struct rte_eth_dev *dev)
}
int
-memif_connect_master(struct rte_eth_dev *dev)
+memif_connect_server(struct rte_eth_dev *dev)
{
struct pmd_internals *pmd = dev->data->dev_private;
@@ -1050,7 +1050,7 @@ memif_connect_master(struct rte_eth_dev *dev)
}
int
-memif_connect_slave(struct rte_eth_dev *dev)
+memif_connect_client(struct rte_eth_dev *dev)
{
int sockfd;
int ret;
diff --git a/drivers/net/memif/memif_socket.h b/drivers/net/memif/memif_socket.h
index 5c49ec24ecbc..b9b8a151782f 100644
--- a/drivers/net/memif/memif_socket.h
+++ b/drivers/net/memif/memif_socket.h
@@ -60,7 +60,8 @@ void memif_disconnect(struct rte_eth_dev *dev);
* - On success, zero.
* - On failure, a negative value.
*/
-int memif_connect_master(struct rte_eth_dev *dev);
+int memif_connect_server(struct rte_eth_dev *dev);
+
/**
* If device is properly configured, send connection request.
@@ -71,7 +72,7 @@ int memif_connect_master(struct rte_eth_dev *dev);
* - On success, zero.
* - On failure, a negative value.
*/
-int memif_connect_slave(struct rte_eth_dev *dev);
+int memif_connect_client(struct rte_eth_dev *dev);
struct memif_socket_dev_list_elt {
TAILQ_ENTRY(memif_socket_dev_list_elt) next;
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index c1c7e9f8d8b6..83bfc316917a 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -132,7 +132,7 @@ memif_mp_request_regions(struct rte_eth_dev *dev)
struct memif_region *r;
struct pmd_process_private *proc_private = dev->process_private;
struct pmd_internals *pmd = dev->data->dev_private;
- /* in case of zero-copy slave, only request region 0 */
+ /* in case of zero-copy client, only request region 0 */
uint16_t max_region_num = (pmd->flags & ETH_MEMIF_FLAG_ZERO_COPY) ?
1 : ETH_MEMIF_MAX_REGION_NUM;
@@ -210,7 +210,7 @@ memif_get_ring(struct pmd_internals *pmd, struct pmd_process_private *proc_priva
int ring_size = sizeof(memif_ring_t) + sizeof(memif_desc_t) *
(1 << pmd->run.log2_ring_size);
- p = (uint8_t *)p + (ring_num + type * pmd->run.num_s2m_rings) * ring_size;
+ p = (uint8_t *)p + (ring_num + type * pmd->run.num_c2s_rings) * ring_size;
return (memif_ring_t *)p;
}
@@ -245,7 +245,7 @@ memif_get_buffer(struct pmd_process_private *proc_private, memif_desc_t *d)
return ((uint8_t *)proc_private->regions[d->region]->addr + d->offset);
}
-/* Free mbufs received by master */
+/* Free mbufs received by server */
static void
memif_free_stored_mbufs(struct pmd_process_private *proc_private, struct memif_queue *mq)
{
@@ -322,7 +322,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
ring_size = 1 << mq->log2_ring_size;
mask = ring_size - 1;
- if (type == MEMIF_RING_S2M) {
+ if (type == MEMIF_RING_C2S) {
cur_slot = mq->last_head;
last_slot = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE);
} else {
@@ -396,7 +396,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
no_free_bufs:
- if (type == MEMIF_RING_S2M) {
+ if (type == MEMIF_RING_C2S) {
__atomic_store_n(&ring->tail, cur_slot, __ATOMIC_RELEASE);
mq->last_head = cur_slot;
} else {
@@ -404,7 +404,7 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
refill:
- if (type == MEMIF_RING_M2S) {
+ if (type == MEMIF_RING_S2C) {
head = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE);
n_slots = ring_size - head + mq->last_tail;
@@ -499,7 +499,7 @@ eth_memif_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
mq->last_tail = cur_slot;
-/* Supply master with new buffers */
+/* Supply server with new buffers */
refill:
head = ring->head;
n_slots = ring_size - head + mq->last_tail;
@@ -571,7 +571,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
n_free = __atomic_load_n(&ring->tail, __ATOMIC_ACQUIRE) - mq->last_tail;
mq->last_tail += n_free;
- if (type == MEMIF_RING_S2M) {
+ if (type == MEMIF_RING_C2S) {
slot = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE);
n_free = ring_size - slot + mq->last_tail;
} else {
@@ -586,7 +586,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
saved_slot = slot;
d0 = &ring->desc[slot & mask];
dst_off = 0;
- dst_len = (type == MEMIF_RING_S2M) ?
+ dst_len = (type == MEMIF_RING_C2S) ?
pmd->run.pkt_buffer_size : d0->length;
next_in_chain:
@@ -601,7 +601,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
d0->flags |= MEMIF_DESC_FLAG_NEXT;
d0 = &ring->desc[slot & mask];
dst_off = 0;
- dst_len = (type == MEMIF_RING_S2M) ?
+ dst_len = (type == MEMIF_RING_C2S) ?
pmd->run.pkt_buffer_size : d0->length;
d0->flags = 0;
} else {
@@ -636,7 +636,7 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
}
no_free_slots:
- if (type == MEMIF_RING_S2M)
+ if (type == MEMIF_RING_C2S)
__atomic_store_n(&ring->head, slot, __ATOMIC_RELEASE);
else
__atomic_store_n(&ring->tail, slot, __ATOMIC_RELEASE);
@@ -666,7 +666,7 @@ memif_tx_one_zc(struct pmd_process_private *proc_private, struct memif_queue *mq
next_in_chain:
/* store pointer to mbuf to free it later */
mq->buffers[slot & mask] = mbuf;
- /* Increment refcnt to make sure the buffer is not freed before master
+ /* Increment refcnt to make sure the buffer is not freed before server
* receives it. (current segment)
*/
rte_mbuf_refcnt_update(mbuf, 1);
@@ -719,10 +719,10 @@ eth_memif_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
ring_size = 1 << mq->log2_ring_size;
mask = ring_size - 1;
- /* free mbufs received by master */
+ /* free mbufs received by server */
memif_free_stored_mbufs(proc_private, mq);
- /* ring type always MEMIF_RING_S2M */
+ /* ring type always MEMIF_RING_C2S */
slot = ring->head;
n_free = ring_size - ring->head + mq->last_tail;
@@ -780,7 +780,7 @@ eth_memif_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
no_free_slots:
rte_mb();
/* update ring pointers */
- if (type == MEMIF_RING_S2M)
+ if (type == MEMIF_RING_C2S)
ring->head = slot;
else
ring->tail = slot;
@@ -895,7 +895,7 @@ memif_region_init_shm(struct rte_eth_dev *dev, uint8_t has_buffers)
}
/* calculate buffer offset */
- r->pkt_buffer_offset = (pmd->run.num_s2m_rings + pmd->run.num_m2s_rings) *
+ r->pkt_buffer_offset = (pmd->run.num_c2s_rings + pmd->run.num_s2c_rings) *
(sizeof(memif_ring_t) + sizeof(memif_desc_t) *
(1 << pmd->run.log2_ring_size));
@@ -904,8 +904,8 @@ memif_region_init_shm(struct rte_eth_dev *dev, uint8_t has_buffers)
if (has_buffers == 1)
r->region_size += (uint32_t)(pmd->run.pkt_buffer_size *
(1 << pmd->run.log2_ring_size) *
- (pmd->run.num_s2m_rings +
- pmd->run.num_m2s_rings));
+ (pmd->run.num_c2s_rings +
+ pmd->run.num_s2c_rings));
memset(shm_name, 0, sizeof(char) * ETH_MEMIF_SHM_NAME_SIZE);
snprintf(shm_name, ETH_MEMIF_SHM_NAME_SIZE, "memif_region_%d",
@@ -990,8 +990,8 @@ memif_init_rings(struct rte_eth_dev *dev)
int i, j;
uint16_t slot;
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
- ring = memif_get_ring(pmd, proc_private, MEMIF_RING_S2M, i);
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
+ ring = memif_get_ring(pmd, proc_private, MEMIF_RING_C2S, i);
__atomic_store_n(&ring->head, 0, __ATOMIC_RELAXED);
__atomic_store_n(&ring->tail, 0, __ATOMIC_RELAXED);
ring->cookie = MEMIF_COOKIE;
@@ -1010,8 +1010,8 @@ memif_init_rings(struct rte_eth_dev *dev)
}
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
- ring = memif_get_ring(pmd, proc_private, MEMIF_RING_M2S, i);
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
+ ring = memif_get_ring(pmd, proc_private, MEMIF_RING_S2C, i);
__atomic_store_n(&ring->head, 0, __ATOMIC_RELAXED);
__atomic_store_n(&ring->tail, 0, __ATOMIC_RELAXED);
ring->cookie = MEMIF_COOKIE;
@@ -1021,7 +1021,7 @@ memif_init_rings(struct rte_eth_dev *dev)
continue;
for (j = 0; j < (1 << pmd->run.log2_ring_size); j++) {
- slot = (i + pmd->run.num_s2m_rings) *
+ slot = (i + pmd->run.num_c2s_rings) *
(1 << pmd->run.log2_ring_size) + j;
ring->desc[j].region = 0;
ring->desc[j].offset =
@@ -1032,7 +1032,7 @@ memif_init_rings(struct rte_eth_dev *dev)
}
}
-/* called only by slave */
+/* called only by client */
static int
memif_init_queues(struct rte_eth_dev *dev)
{
@@ -1040,12 +1040,12 @@ memif_init_queues(struct rte_eth_dev *dev)
struct memif_queue *mq;
int i;
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
mq = dev->data->tx_queues[i];
mq->log2_ring_size = pmd->run.log2_ring_size;
/* queues located only in region 0 */
mq->region = 0;
- mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_S2M, i);
+ mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_C2S, i);
mq->last_head = 0;
mq->last_tail = 0;
mq->intr_handle.fd = eventfd(0, EFD_NONBLOCK);
@@ -1063,12 +1063,12 @@ memif_init_queues(struct rte_eth_dev *dev)
}
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
mq = dev->data->rx_queues[i];
mq->log2_ring_size = pmd->run.log2_ring_size;
/* queues located only in region 0 */
mq->region = 0;
- mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_M2S, i);
+ mq->ring_offset = memif_get_ring_offset(dev, mq, MEMIF_RING_S2C, i);
mq->last_head = 0;
mq->last_tail = 0;
mq->intr_handle.fd = eventfd(0, EFD_NONBLOCK);
@@ -1140,8 +1140,8 @@ memif_connect(struct rte_eth_dev *dev)
}
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->tx_queues[i] : dev->data->rx_queues[i];
ring = memif_get_ring_from_queue(proc_private, mq);
if (ring == NULL || ring->cookie != MEMIF_COOKIE) {
@@ -1153,11 +1153,11 @@ memif_connect(struct rte_eth_dev *dev)
mq->last_head = 0;
mq->last_tail = 0;
/* enable polling mode */
- if (pmd->role == MEMIF_ROLE_MASTER)
+ if (pmd->role == MEMIF_ROLE_SERVER)
ring->flags = MEMIF_RING_FLAG_MASK_INT;
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->rx_queues[i] : dev->data->tx_queues[i];
ring = memif_get_ring_from_queue(proc_private, mq);
if (ring == NULL || ring->cookie != MEMIF_COOKIE) {
@@ -1169,7 +1169,7 @@ memif_connect(struct rte_eth_dev *dev)
mq->last_head = 0;
mq->last_tail = 0;
/* enable polling mode */
- if (pmd->role == MEMIF_ROLE_SLAVE)
+ if (pmd->role == MEMIF_ROLE_CLIENT)
ring->flags = MEMIF_RING_FLAG_MASK_INT;
}
@@ -1188,11 +1188,11 @@ memif_dev_start(struct rte_eth_dev *dev)
int ret = 0;
switch (pmd->role) {
- case MEMIF_ROLE_SLAVE:
- ret = memif_connect_slave(dev);
+ case MEMIF_ROLE_CLIENT:
+ ret = memif_connect_client(dev);
break;
- case MEMIF_ROLE_MASTER:
- ret = memif_connect_master(dev);
+ case MEMIF_ROLE_SERVER:
+ ret = memif_connect_server(dev);
break;
default:
MIF_LOG(ERR, "Unknown role: %d.", pmd->role);
@@ -1232,17 +1232,17 @@ memif_dev_configure(struct rte_eth_dev *dev)
struct pmd_internals *pmd = dev->data->dev_private;
/*
- * SLAVE - TXQ
- * MASTER - RXQ
+ * CLIENT - TXQ
+ * SERVER - RXQ
*/
- pmd->cfg.num_s2m_rings = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ pmd->cfg.num_c2s_rings = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->nb_tx_queues : dev->data->nb_rx_queues;
/*
- * SLAVE - RXQ
- * MASTER - TXQ
+ * CLIENT - RXQ
+ * SERVER - TXQ
*/
- pmd->cfg.num_m2s_rings = (pmd->role == MEMIF_ROLE_SLAVE) ?
+ pmd->cfg.num_s2c_rings = (pmd->role == MEMIF_ROLE_CLIENT) ?
dev->data->nb_rx_queues : dev->data->nb_tx_queues;
return 0;
@@ -1265,7 +1265,7 @@ memif_tx_queue_setup(struct rte_eth_dev *dev,
}
mq->type =
- (pmd->role == MEMIF_ROLE_SLAVE) ? MEMIF_RING_S2M : MEMIF_RING_M2S;
+ (pmd->role == MEMIF_ROLE_CLIENT) ? MEMIF_RING_C2S : MEMIF_RING_S2C;
mq->n_pkts = 0;
mq->n_bytes = 0;
mq->intr_handle.fd = -1;
@@ -1293,7 +1293,7 @@ memif_rx_queue_setup(struct rte_eth_dev *dev,
return -ENOMEM;
}
- mq->type = (pmd->role == MEMIF_ROLE_SLAVE) ? MEMIF_RING_M2S : MEMIF_RING_S2M;
+ mq->type = (pmd->role == MEMIF_ROLE_CLIENT) ? MEMIF_RING_S2C : MEMIF_RING_C2S;
mq->n_pkts = 0;
mq->n_bytes = 0;
mq->intr_handle.fd = -1;
@@ -1348,8 +1348,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->opackets = 0;
stats->obytes = 0;
- tmp = (pmd->role == MEMIF_ROLE_SLAVE) ? pmd->run.num_s2m_rings :
- pmd->run.num_m2s_rings;
+ tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_c2s_rings :
+ pmd->run.num_s2c_rings;
nq = (tmp < RTE_ETHDEV_QUEUE_STAT_CNTRS) ? tmp :
RTE_ETHDEV_QUEUE_STAT_CNTRS;
@@ -1362,8 +1362,8 @@ memif_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->ibytes += mq->n_bytes;
}
- tmp = (pmd->role == MEMIF_ROLE_SLAVE) ? pmd->run.num_m2s_rings :
- pmd->run.num_s2m_rings;
+ tmp = (pmd->role == MEMIF_ROLE_CLIENT) ? pmd->run.num_s2c_rings :
+ pmd->run.num_c2s_rings;
nq = (tmp < RTE_ETHDEV_QUEUE_STAT_CNTRS) ? tmp :
RTE_ETHDEV_QUEUE_STAT_CNTRS;
@@ -1385,14 +1385,14 @@ memif_stats_reset(struct rte_eth_dev *dev)
int i;
struct memif_queue *mq;
- for (i = 0; i < pmd->run.num_s2m_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ? dev->data->tx_queues[i] :
+ for (i = 0; i < pmd->run.num_c2s_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ? dev->data->tx_queues[i] :
dev->data->rx_queues[i];
mq->n_pkts = 0;
mq->n_bytes = 0;
}
- for (i = 0; i < pmd->run.num_m2s_rings; i++) {
- mq = (pmd->role == MEMIF_ROLE_SLAVE) ? dev->data->rx_queues[i] :
+ for (i = 0; i < pmd->run.num_s2c_rings; i++) {
+ mq = (pmd->role == MEMIF_ROLE_CLIENT) ? dev->data->rx_queues[i] :
dev->data->tx_queues[i];
mq->n_pkts = 0;
mq->n_bytes = 0;
@@ -1473,8 +1473,8 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
pmd->flags = flags;
pmd->flags |= ETH_MEMIF_FLAG_DISABLED;
pmd->role = role;
- /* Zero-copy flag irelevant to master. */
- if (pmd->role == MEMIF_ROLE_MASTER)
+ /* Zero-copy flag irelevant to server. */
+ if (pmd->role == MEMIF_ROLE_SERVER)
pmd->flags &= ~ETH_MEMIF_FLAG_ZERO_COPY;
ret = memif_socket_init(eth_dev, socket_filename);
@@ -1487,8 +1487,8 @@ memif_create(struct rte_vdev_device *vdev, enum memif_role_t role,
pmd->cfg.log2_ring_size = log2_ring_size;
/* set in .dev_configure() */
- pmd->cfg.num_s2m_rings = 0;
- pmd->cfg.num_m2s_rings = 0;
+ pmd->cfg.num_c2s_rings = 0;
+ pmd->cfg.num_s2c_rings = 0;
pmd->cfg.pkt_buffer_size = pkt_buffer_size;
rte_spinlock_init(&pmd->cc_lock);
@@ -1523,11 +1523,17 @@ memif_set_role(const char *key __rte_unused, const char *value,
void *extra_args)
{
enum memif_role_t *role = (enum memif_role_t *)extra_args;
-
- if (strstr(value, "master") != NULL) {
- *role = MEMIF_ROLE_MASTER;
+
+ if (strstr(value, "server") != NULL) {
+ *role = MEMIF_ROLE_SERVER;
+ } else if (strstr(value, "client") != NULL) {
+ *role = MEMIF_ROLE_CLIENT;
+ } else if (strstr(value, "master") != NULL) {
+ MIF_LOG(NOTICE, "Role argument \"master\" is deprecated, use \"server\"");
+ *role = MEMIF_ROLE_SERVER;
} else if (strstr(value, "slave") != NULL) {
- *role = MEMIF_ROLE_SLAVE;
+ MIF_LOG(NOTICE, "Role argument \"slave\" is deprecated, use \"client\"");
+ *role = MEMIF_ROLE_CLIENT;
} else {
MIF_LOG(ERR, "Unknown role: %s.", value);
return -EINVAL;
@@ -1670,7 +1676,7 @@ rte_pmd_memif_probe(struct rte_vdev_device *vdev)
int ret = 0;
struct rte_kvargs *kvlist;
const char *name = rte_vdev_device_name(vdev);
- enum memif_role_t role = MEMIF_ROLE_SLAVE;
+ enum memif_role_t role = MEMIF_ROLE_CLIENT;
memif_interface_id_t id = 0;
uint16_t pkt_buffer_size = ETH_MEMIF_DEFAULT_PKT_BUFFER_SIZE;
memif_log2_ring_size_t log2_ring_size = ETH_MEMIF_DEFAULT_RING_SIZE;
@@ -1798,7 +1804,7 @@ RTE_PMD_REGISTER_VDEV(net_memif, pmd_memif_drv);
RTE_PMD_REGISTER_PARAM_STRING(net_memif,
ETH_MEMIF_ID_ARG "=<int>"
- ETH_MEMIF_ROLE_ARG "=master|slave"
+ ETH_MEMIF_ROLE_ARG "=server|client"
ETH_MEMIF_PKT_BUFFER_SIZE_ARG "=<int>"
ETH_MEMIF_RING_SIZE_ARG "=<int>"
ETH_MEMIF_SOCKET_ARG "=<string>"
diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h
index 6f45b7072c69..d45dfdd172b7 100644
--- a/drivers/net/memif/rte_eth_memif.h
+++ b/drivers/net/memif/rte_eth_memif.h
@@ -36,8 +36,8 @@ extern int memif_logtype;
"%s(): " fmt "\n", __func__, ##args)
enum memif_role_t {
- MEMIF_ROLE_MASTER,
- MEMIF_ROLE_SLAVE,
+ MEMIF_ROLE_SERVER,
+ MEMIF_ROLE_CLIENT,
};
struct memif_region {
@@ -64,8 +64,8 @@ struct memif_queue {
uint16_t last_tail; /**< last ring tail */
struct rte_mbuf **buffers;
- /**< Stored mbufs. Used in zero-copy tx. Slave stores transmitted
- * mbufs to free them once master has received them.
+ /**< Stored mbufs. Used in zero-copy tx. Client stores transmitted
+ * mbufs to free them once server has received them.
*/
/* rx/tx info */
@@ -102,15 +102,15 @@ struct pmd_internals {
struct {
memif_log2_ring_size_t log2_ring_size; /**< log2 of ring size */
- uint8_t num_s2m_rings; /**< number of slave to master rings */
- uint8_t num_m2s_rings; /**< number of master to slave rings */
+ uint8_t num_c2s_rings; /**< number of client to server rings */
+ uint8_t num_s2c_rings; /**< number of server to client rings */
uint16_t pkt_buffer_size; /**< buffer size */
} cfg; /**< Configured parameters (max values) */
struct {
memif_log2_ring_size_t log2_ring_size; /**< log2 of ring size */
- uint8_t num_s2m_rings; /**< number of slave to master rings */
- uint8_t num_m2s_rings; /**< number of master to slave rings */
+ uint8_t num_c2s_rings; /**< number of client to server rings */
+ uint8_t num_s2c_rings; /**< number of server to client rings */
uint16_t pkt_buffer_size; /**< buffer size */
} run;
/**< Parameters used in active connection */
@@ -137,7 +137,7 @@ void memif_free_regions(struct rte_eth_dev *dev);
/**
* Finalize connection establishment process. Map shared memory file
- * (master role), initialize ring queue, set link status up.
+ * (server role), initialize ring queue, set link status up.
*
* @param dev
* memif device
@@ -149,7 +149,7 @@ int memif_connect(struct rte_eth_dev *dev);
/**
* Create shared memory file and initialize ring queue.
- * Only called by slave when establishing connection
+ * Only called by client when establishing connection
*
* @param dev
* memif device
--
2.27.0
^ permalink raw reply [flat|nested] 157+ messages in thread
* [dpdk-dev] [PATCH v3 07/17] doc: replace master lcore with main lcore
2020-09-15 15:10 ` [dpdk-dev] [PATCH v3 00/17] Replace terms master/slave Stephen Hemminger
` (5 preceding siblings ...)
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 06/17] net/memif: replace master/slave arguments with server/client Stephen Hemminger
@ 2020-09-15 15:11 ` Stephen Hemminger
2020-09-15 15:11 ` [dpdk-dev] [PATCH v3 08/17] app/test: replace uses of master/slave Stephen Hemminger
` (11 subsequent siblings)
18 siblings, 0 replies; 157+ messages in thread
From: Stephen Hemminger @ 2020-09-15 15:11 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
Make sure that master lcore is not used in documentation.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
doc/guides/contributing/coding_style.rst | 2 +-
doc/guides/faq/faq.rst | 6 +++---
doc/guides/howto/debug_troubleshoot.rst | 2 +-
doc/guides/linux_gsg/eal_args.include.rst | 4 ++--
doc/guides/linux_gsg/quick_start.rst | 4 ++--
doc/guides/nics/bnxt.rst | 2 +-
doc/guides/prog_guide/env_abstraction_layer.rst | 6 +++---
.../prog_guide/event_ethernet_rx_adapter.rst | 2 +-
doc/guides/prog_guide/glossary.rst | 10 ++++++++--
doc/guides/sample_app_ug/bbdev_app.rst | 2 +-
doc/guides/sample_app_ug/ethtool.rst | 4 ++--
doc/guides/sample_app_ug/hello_world.rst | 10 +++++-----
doc/guides/sample_app_ug/ioat.rst | 14 +++++++-------
doc/guides/sample_app_ug/ip_pipeline.rst | 4 ++--
doc/guides/sample_app_ug/keep_alive.rst | 2 +-
doc/guides/sample_app_ug/l2_forward_event.rst | 4 ++--
.../sample_app_ug/l2_forward_real_virtual.rst | 5 ++---
doc/guides/sample_app_ug/l3_forward_graph.rst | 6 +++---
.../sample_app_ug/l3_forward_power_man.rst | 2 +-
doc/guides/sample_app_ug/link_status_intr.rst | 5 ++---
doc/guides/sample_app_ug/multi_process.rst | 6 +++---
doc/guides/sample_app_ug/packet_ordering.rst | 8 ++++----
doc/guides/sample_app_ug/performance_thread.rst | 6 +++---
doc/guides/sample_app_ug/ptpclient.rst | 2 +-
doc/guides/sample_app_ug/qos_scheduler.rst | 4 ++--
doc/guides/sample_app_ug/timer.rst | 16 ++++++++--------
doc/guides/testpmd_app_ug/run_app.rst | 2 +-
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 2 +-
28 files changed, 73 insertions(+), 69 deletions(-)
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 2c915fa38240..fb266e4b0b5a 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -362,7 +362,7 @@ For example:
typedef int (lcore_function_t)(void *);
/* launch a function of lcore_function_t type */
- int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned slave_id);
+ int rte_eal_remote_launch(lcore_function_t *f, void *arg, unsigned worker_id);
C Indentation
diff --git a/doc/guides/faq/faq.rst b/doc/guides/faq/faq.rst
index bb1df7dc8a0f..ee8c1697b4ad 100644
--- a/doc/guides/faq/faq.rst
+++ b/doc/guides/faq/faq.rst
@@ -42,13 +42,13 @@ I am running a 32-bit DPDK application on a NUMA system, and sometimes the appli
If your system has a lot (>1 GB size) of hugepage memory, not all o