Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org
Cc: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp,
	gerald.rogers@intel.com, sy.jong.choi@intel.com
Subject: [spp] [PATCH 6/7] spp: change type of counter to uint16_t
Date: Wed,  6 Dec 2017 17:18:25 +0900	[thread overview]
Message-ID: <20171206081826.67688-6-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <20171206081826.67688-1-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@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@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

  parent reply	other threads:[~2017-12-06  8:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06  8:18 [spp] [PATCH 1/7] spp_nfv: change type of port_id " ogawa.yasufumi
2017-12-06  8:18 ` [spp] [PATCH 2/7] spp_vm: " ogawa.yasufumi
2017-12-06  8:18 ` [spp] [PATCH 3/7] spp_primary: change type of ports_id " ogawa.yasufumi
2017-12-06  8:18 ` [spp] [PATCH 4/7] spp_vm: " ogawa.yasufumi
2017-12-06  8:18 ` [spp] [PATCH 5/7] spp/shared: " ogawa.yasufumi
2017-12-06  8:18 ` ogawa.yasufumi [this message]
2017-12-06  8:18 ` [spp] [PATCH 7/7] spp/shared: refactor printing port status ogawa.yasufumi
2017-12-07 18:08 ` [spp] [PATCH 1/7] spp_nfv: change type of port_id to uint16_t Ferruh Yigit

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=20171206081826.67688-6-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=gerald.rogers@intel.com \
    --cc=spp@dpdk.org \
    --cc=sy.jong.choi@intel.com \
    /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).