DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Abdullah Ömer Yamaç" <omer.yamac@ceng.metu.edu.tr>
To: dev@dpdk.org
Cc: "Abdullah Ömer Yamaç" <omer.yamac@ceng.metu.edu.tr>,
	"Thomas Monjalon" <thomas@monjalon.net>
Subject: [PATCH v4] examples/distributor: remove dead code and renaming Rx,Tx
Date: Thu, 24 Nov 2022 23:05:54 +0300	[thread overview]
Message-ID: <20221124200554.2210007-1-omer.yamac@ceng.metu.edu.tr> (raw)
In-Reply-To: <12443427.VsHLxoZxqI@thomas>

One line of commented code was dead code, this line and releated
comments are removed. Naming of rx,RX and tx,TX are replaced by Rx and
Tx.

Signed-off-by: Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr>
---
CC: Thomas Monjalon <thomas@monjalon.net>
---
 examples/distributor/main.c | 51 +++++++++++++++++--------------------
 1 file changed, 23 insertions(+), 28 deletions(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 21304d6618..d54e241110 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -104,7 +104,7 @@ struct output_buffer {
 static void print_stats(void);
 
 /*
- * Initialises a given port using global settings and with the rx buffers
+ * Initialises a given port using global settings and with the Rx buffers
  * coming from the mbuf_pool passed as parameter
  */
 static inline int
@@ -259,12 +259,7 @@ lcore_rx(struct lcore_params *p)
 		}
 		app_stats.rx.rx_pkts += nb_rx;
 
-		/*
-		 * Swap the following two lines if you want the rx traffic
-		 * to go directly to tx, no distribution.
-		 */
 		struct rte_ring *out_ring = p->rx_dist_ring;
-		/* struct rte_ring *out_ring = p->dist_tx_ring; */
 
 		uint16_t sent = rte_ring_enqueue_burst(out_ring,
 				(void *)bufs, nb_rx, NULL);
@@ -282,7 +277,7 @@ lcore_rx(struct lcore_params *p)
 	}
 	if (power_lib_initialised)
 		rte_power_exit(rte_lcore_id());
-	printf("\nCore %u exiting rx task.\n", rte_lcore_id());
+	printf("\nCore %u exiting Rx task.\n", rte_lcore_id());
 	/* set distributor threads quit flag */
 	quit_signal_dist = 1;
 	return 0;
@@ -305,11 +300,11 @@ lcore_rx_and_distributor(struct lcore_params *p)
 		if (rte_eth_dev_socket_id(port) > 0 &&
 				rte_eth_dev_socket_id(port) != socket_id)
 			printf("WARNING, port %u is on remote NUMA node to "
-					"RX thread.\n\tPerformance will not "
+					"Rx thread.\n\tPerformance will not "
 					"be optimal.\n", port);
 	}
 
-	printf("\nCore %u doing packet RX and Distributor.\n", rte_lcore_id());
+	printf("\nCore %u doing packet Rx and Distributor.\n", rte_lcore_id());
 	port = 0;
 	while (!quit_signal_rx) {
 
@@ -329,8 +324,8 @@ lcore_rx_and_distributor(struct lcore_params *p)
 		app_stats.rx.rx_pkts += nb_rx;
 
 		/*
-		 * Run the distributor on the rx core. Returned
-		 * packets are then send straight to the tx core.
+		 * Run the distributor on the Rx core. Returned
+		 * packets are then send straight to the Tx core.
 		 */
 		rte_distributor_process(d, bufs, nb_rx);
 		const uint16_t nb_ret = rte_distributor_returned_pkts(d,
@@ -360,8 +355,8 @@ lcore_rx_and_distributor(struct lcore_params *p)
 	}
 	if (power_lib_initialised)
 		rte_power_exit(rte_lcore_id());
-	printf("\nCore %u exiting rx task.\n", rte_lcore_id());
-	/* set tx threads quit flag */
+	printf("\nCore %u exiting Rx task.\n", rte_lcore_id());
+	/* set Tx threads quit flag */
 	quit_signal = 1;
 	/* set worker threads quit flag */
 	quit_signal_work = 1;
@@ -448,7 +443,7 @@ lcore_distributor(struct lcore_params *p)
 	if (power_lib_initialised)
 		rte_power_exit(rte_lcore_id());
 	printf("\nCore %u exiting distributor task.\n", rte_lcore_id());
-	/* set tx threads quit flag */
+	/* set Tx threads quit flag */
 	quit_signal = 1;
 	/* set worker threads quit flag */
 	quit_signal_work = 1;
@@ -524,7 +519,7 @@ lcore_tx(struct rte_ring *in_r)
 	}
 	if (power_lib_initialised)
 		rte_power_exit(rte_lcore_id());
-	printf("\nCore %u exiting tx task.\n", rte_lcore_id());
+	printf("\nCore %u exiting Tx task.\n", rte_lcore_id());
 	return 0;
 }
 
@@ -532,7 +527,7 @@ static void
 int_handler(int sig_num)
 {
 	printf("Exiting on signal %d\n", sig_num);
-	/* set quit flag for rx thread to exit */
+	/* set quit flag for Rx thread to exit */
 	quit_signal_rx = 1;
 }
 
@@ -698,7 +693,7 @@ print_usage(const char *prgname)
 {
 	printf("%s [EAL options] -- -p PORTMASK [-c]\n"
 			"  -p PORTMASK: hexadecimal bitmask of ports to configure\n"
-			"  -c: Combines the RX core with the distribution core\n",
+			"  -c: Combines the Rx core with the distribution core\n",
 			prgname);
 }
 
@@ -798,11 +793,11 @@ main(int argc, char *argv[])
 		rte_exit(EXIT_FAILURE, "Invalid distributor parameters\n");
 
 	if (enable_lcore_rx_distributor) {
-	/* RX and distributor combined, 3 fixed function cores (stat, TX, at least 1 worker) */
+	/* Rx and distributor combined, 3 fixed function cores (stat, TX, at least 1 worker) */
 		min_cores = 4;
 		num_workers = rte_lcore_count() - 3;
 	} else {
-	/* separate RX and distributor, 3 fixed function cores (stat, TX, at least 1 worker) */
+	/* separate Rx and distributor, 3 fixed function cores (stat, TX, at least 1 worker) */
 		min_cores = 5;
 		num_workers = rte_lcore_count() - 4;
 	}
@@ -811,8 +806,8 @@ main(int argc, char *argv[])
 		rte_exit(EXIT_FAILURE, "Error, This application needs at "
 				"least 4 logical cores to run:\n"
 				"1 lcore for stats (can be core 0)\n"
-				"1 or 2 lcore for packet RX and distribution\n"
-				"1 lcore for packet TX\n"
+				"1 or 2 lcore for packet Rx and distribution\n"
+				"1 lcore for packet Tx\n"
 				"and at least 1 lcore for worker threads\n");
 
 	if (init_power_library() == 0)
@@ -875,7 +870,7 @@ main(int argc, char *argv[])
 
 	if (power_lib_initialised) {
 		/*
-		 * Here we'll pre-assign lcore ids to the rx, tx and
+		 * Here we'll pre-assign lcore ids to the rx, Tx and
 		 * distributor workloads if there's higher frequency
 		 * on those cores e.g. if Turbo Boost is enabled.
 		 * It's also worth mentioning that it will assign cores in a
@@ -939,18 +934,18 @@ main(int argc, char *argv[])
 	}
 
 	if (enable_lcore_rx_distributor)
-		printf(" tx id %d, rx id %d\n",
+		printf(" Tx id %d, Rx id %d\n",
 			tx_core_id,
 			rx_core_id);
 	else
-		printf(" tx id %d, dist id %d, rx id %d\n",
+		printf(" Tx id %d, dist id %d, Rx id %d\n",
 			tx_core_id,
 			distr_core_id,
 			rx_core_id);
 
 	/*
 	 * Kick off all the worker threads first, avoiding the pre-assigned
-	 * lcore_ids for tx, rx and distributor workloads.
+	 * lcore_ids for Tx, Rx and distributor workloads.
 	 */
 	RTE_LCORE_FOREACH_WORKER(lcore_id) {
 		if (lcore_id == (unsigned int)distr_core_id ||
@@ -970,7 +965,7 @@ main(int argc, char *argv[])
 				p, lcore_id);
 	}
 
-	/* Start tx core */
+	/* Start Tx core */
 	rte_eal_remote_launch((lcore_function_t *)lcore_tx,
 			dist_tx_ring, tx_core_id);
 
@@ -978,7 +973,7 @@ main(int argc, char *argv[])
 	struct lcore_params *pd = NULL;
 	if (!enable_lcore_rx_distributor) {
 		pd = rte_malloc(NULL, sizeof(*pd), 0);
-		if (!pd)
+		if (pd == NULL)
 			rte_panic("malloc failure\n");
 		*pd = (struct lcore_params){worker_id++, d,
 			rx_dist_ring, dist_tx_ring, mbuf_pool};
@@ -986,7 +981,7 @@ main(int argc, char *argv[])
 				pd, distr_core_id);
 	}
 
-	/* Start rx core */
+	/* Start Rx core */
 	struct lcore_params *pr =
 		rte_malloc(NULL, sizeof(*pr), 0);
 	if (!pr)
-- 
2.27.0


  reply	other threads:[~2022-11-24 20:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 21:13 [PATCH] examples/distributor: update dynamic configuration Abdullah Ömer Yamaç
2022-06-28 19:54 ` [PATCH v2] " Abdullah Ömer Yamaç
2022-09-01 10:58   ` Hunt, David
2022-09-02  5:20     ` Omer Yamac
2022-09-02  8:37       ` Hunt, David
2022-09-01 14:09   ` [PATCH v3] " Abdullah Ömer Yamaç
2022-09-02  9:12     ` Hunt, David
2022-10-31 15:03     ` Thomas Monjalon
2022-11-24 20:05       ` Abdullah Ömer Yamaç [this message]
2022-11-24 20:17         ` [PATCH v5] examples/distributor: remove dead code and renaming Rx,Tx Abdullah Ömer Yamaç
2022-11-24 20:22           ` [PATCH v6] " Abdullah Ömer Yamaç
2022-11-24 20:31             ` [PATCH v7] " Abdullah Ömer Yamaç

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221124200554.2210007-1-omer.yamac@ceng.metu.edu.tr \
    --to=omer.yamac@ceng.metu.edu.tr \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).