[dpdk-dev] [PATCH 10/15] examples: replace use of master with main

Stephen Hemminger stephen at networkplumber.org
Fri Sep 11 21:06:56 CEST 2020


Change references to master/slave lcore to main/worker.
For l2fwd, l3fwd and link_status examples.

Signed-off-by: Stephen Hemminger <stephen at 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



More information about the dev mailing list