[v3,12/17] examples: replace use of master with main
diff mbox series

Message ID 20200915151114.12024-13-stephen@networkplumber.org
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series
  • Replace terms master/slave
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Stephen Hemminger Sept. 15, 2020, 3:11 p.m. UTC
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(-)

Patch
diff mbox series

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;