[spp] [PATCH 6/7] spp: change type of counter to uint16_t

ogawa.yasufumi at lab.ntt.co.jp ogawa.yasufumi at lab.ntt.co.jp
Wed Dec 6 09:18:25 CET 2017


From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>

Counters of uint8_t for ports should be changed to uint16_t. The name
of counter 'i' is also changed to 'count' to be more explicit meaning.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 src/primary/init.c | 9 ++++-----
 src/vm/init.c      | 9 ++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/primary/init.c b/src/primary/init.c
index 7a15e9b..2630783 100644
--- a/src/primary/init.c
+++ b/src/primary/init.c
@@ -134,8 +134,7 @@ init(int argc, char *argv[])
 {
 	int retval;
 	const struct rte_memzone *mz;
-	uint8_t i;
-	uint16_t total_ports;
+	uint16_t count, total_ports;
 
 	/* init EAL, parsing EAL args */
 	retval = rte_eal_init(argc, argv);
@@ -177,11 +176,11 @@ init(int argc, char *argv[])
 
 	/* now initialise the ports we will use */
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		for (i = 0; i < ports->num_ports; i++) {
-			retval = init_port(ports->id[i], pktmbuf_pool);
+		for (count = 0; count < ports->num_ports; count++) {
+			retval = init_port(ports->id[count], pktmbuf_pool);
 			if (retval != 0)
 				rte_exit(EXIT_FAILURE,
-					"Cannot initialise port %d\n", i);
+					"Cannot initialise port %d\n", count);
 		}
 	}
 	check_all_ports_link_status(ports, ports->num_ports, (~0x0));
diff --git a/src/vm/init.c b/src/vm/init.c
index 4405489..fb9b7ec 100644
--- a/src/vm/init.c
+++ b/src/vm/init.c
@@ -91,8 +91,7 @@ init(int argc, char *argv[])
 {
 	int retval;
 	const struct rte_memzone *mz;
-	uint8_t i;
-	uint16_t total_ports;
+	uint16_t count, total_ports;
 
 	/* init EAL, parsing EAL args */
 	retval = rte_eal_init(argc, argv);
@@ -130,11 +129,11 @@ init(int argc, char *argv[])
 
 	/* now initialise the ports we will use */
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		for (i = 0; i < total_ports; i++) {
-			retval = init_port(ports->id[i], pktmbuf_pool);
+		for (count = 0; count < total_ports; count++) {
+			retval = init_port(ports->id[count], pktmbuf_pool);
 			if (retval != 0)
 				rte_exit(EXIT_FAILURE,
-					"Cannot initialise port %d\n", i);
+					"Cannot initialise port %d\n", count);
 		}
 	}
 	check_all_ports_link_status(ports, total_ports, (~0x0));
-- 
2.13.1



More information about the spp mailing list