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 2/7] spp_vm: change type of port_id to uint16_t
Date: Wed,  6 Dec 2017 17:18:21 +0900	[thread overview]
Message-ID: <20171206081826.67688-2-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>

This patch is similar to previous commit for updating spp_nfv.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/vm/main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/vm/main.c b/src/vm/main.c
index a1c4fac..7095446 100644
--- a/src/vm/main.c
+++ b/src/vm/main.c
@@ -63,10 +63,10 @@ forward(void)
 	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
 		struct rte_mbuf *bufs[MAX_PKT_BURST];
 
-		if (ports_fwd_array[i].in_port_id < 0)
+		if (ports_fwd_array[i].in_port_id == PORT_RESET)
 			continue;
 
-		if (ports_fwd_array[i].out_port_id < 0)
+		if (ports_fwd_array[i].out_port_id == PORT_RESET)
 			continue;
 
 		/* if status active, i count is in port */
@@ -182,7 +182,7 @@ forward_array_reset(void)
 
 	/* initialize port forward array */
 	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
-		if (ports_fwd_array[i].in_port_id > -1) {
+		if (ports_fwd_array[i].in_port_id != PORT_RESET) {
 			ports_fwd_array[i].out_port_id = PORT_RESET;
 			RTE_LOG(INFO, APP, "Port ID %d\n", i);
 			RTE_LOG(INFO, APP, "out_port_id %d\n",
@@ -200,7 +200,7 @@ print_active_ports(char *str)
 	sprintf(str, "%d\n", client_id);
 	/* every elements value */
 	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
-		if (ports_fwd_array[i].in_port_id < 0)
+		if (ports_fwd_array[i].in_port_id == PORT_RESET)
 			continue;
 
 		RTE_LOG(INFO, APP, "Port ID %d\n", i);
@@ -208,7 +208,7 @@ print_active_ports(char *str)
 			ports_fwd_array[i].in_port_id);
 
 		sprintf(str + strlen(str), "port id: %d,", i);
-		if (ports_fwd_array[i].in_port_id >= 0)
+		if (ports_fwd_array[i].in_port_id != PORT_RESET)
 			sprintf(str + strlen(str), "on,");
 		else
 			sprintf(str + strlen(str), "off,");
@@ -250,7 +250,7 @@ forward_array_remove(int port_id)
 	forward_array_init_one(port_id);
 
 	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
-		if (ports_fwd_array[i].in_port_id < 0)
+		if (ports_fwd_array[i].in_port_id == PORT_RESET)
 			continue;
 
 		if (ports_fwd_array[i].out_port_id == port_id) {
-- 
2.13.1

  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: " ogawa.yasufumi
2017-12-06  8:18 ` ogawa.yasufumi [this message]
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 ` [spp] [PATCH 6/7] spp: change type of counter " ogawa.yasufumi
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-2-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).