From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mogw0236.ocn.ad.jp (mogw0236.ocn.ad.jp [114.147.58.42]) by dpdk.org (Postfix) with ESMTP id DF5A3199B6 for ; Wed, 6 Dec 2017 09:19:40 +0100 (CET) Received: from mf-smf-ucb001.ocn.ad.jp (mf-smf-ucb001.ocn.ad.jp [153.149.227.3]) by mogw0236.ocn.ad.jp (Postfix) with ESMTP id B5562384239; Wed, 6 Dec 2017 17:19:38 +0900 (JST) Received: from mf-smf-ucb001.ocn.ad.jp (mf-smf-ucb001 [153.149.227.3]) by mf-smf-ucb001.ocn.ad.jp (Postfix) with ESMTP id 9E08E205F6; Wed, 6 Dec 2017 17:19:38 +0900 (JST) Received: from ntt.pod01.mv-mta-ucb023 (mv-mta-ucb023.ocn.ad.jp [153.149.142.86]) by mf-smf-ucb001.ocn.ad.jp (Switch-3.3.4/Switch-3.3.4) with ESMTP id vB68Jcbg061047; Wed, 6 Dec 2017 17:19:38 +0900 Received: from smtp.ocn.ne.jp ([153.149.227.167]) by ntt.pod01.mv-mta-ucb023 with id iYKd1w0043dLKTM01YKdZq; Wed, 06 Dec 2017 08:19:38 +0000 Received: from localhost.localdomain (sp49-98-150-93.msd.spmode.ne.jp [49.98.150.93]) by smtp.ocn.ne.jp (Postfix) with ESMTPA; Wed, 6 Dec 2017 17:19:35 +0900 (JST) 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 Date: Wed, 6 Dec 2017 17:18:21 +0900 Message-Id: <20171206081826.67688-2-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20171206081826.67688-1-ogawa.yasufumi@lab.ntt.co.jp> References: <20171206081826.67688-1-ogawa.yasufumi@lab.ntt.co.jp> Subject: [spp] [PATCH 2/7] spp_vm: change type of port_id to uint16_t X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 08:19:41 -0000 From: Yasufumi Ogawa This patch is similar to previous commit for updating spp_nfv. Signed-off-by: Yasufumi Ogawa --- 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