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 4/7] spp_vm: change type of ports_id to uint16_t
Date: Wed,  6 Dec 2017 17:18:23 +0900	[thread overview]
Message-ID: <20171206081826.67688-4-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 update is to change type of ID and number of ports to uint16_t.

It also includes updates for common functions called from from spp_vm,
spp_primary and spp_nfv.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/nfv/nfv.c       | 2 +-
 src/primary/args.c  | 2 +-
 src/primary/args.h  | 2 +-
 src/shared/common.c | 4 ++--
 src/shared/common.h | 2 +-
 src/vm/args.c       | 4 ++--
 src/vm/args.h       | 4 ++--
 src/vm/init.c       | 3 ++-
 8 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/nfv/nfv.c b/src/nfv/nfv.c
index 4bd9f6d..9edf06d 100644
--- a/src/nfv/nfv.c
+++ b/src/nfv/nfv.c
@@ -46,7 +46,7 @@ static sig_atomic_t on = 1;
  * our client id number - tells us which rx queue to read, and NIC TX
  * queue to write to.
  */
-static uint8_t client_id;
+static uint16_t client_id;
 static char *server_ip;
 static int server_port;
 
diff --git a/src/primary/args.c b/src/primary/args.c
index a786d3a..ba7c69b 100644
--- a/src/primary/args.c
+++ b/src/primary/args.c
@@ -40,7 +40,7 @@
 #include "init.h"
 
 /* global var for number of clients - extern in header */
-uint8_t num_clients;
+uint16_t num_clients;
 char *server_ip;
 int server_port;
 
diff --git a/src/primary/args.h b/src/primary/args.h
index e290860..020e848 100644
--- a/src/primary/args.h
+++ b/src/primary/args.h
@@ -36,7 +36,7 @@
 
 #include <stdint.h>
 
-extern uint8_t num_clients;
+extern uint16_t num_clients;
 extern char *server_ip;
 extern int server_port;
 
diff --git a/src/shared/common.c b/src/shared/common.c
index 9455294..7c7c6c8 100644
--- a/src/shared/common.c
+++ b/src/shared/common.c
@@ -197,7 +197,7 @@ parse_portmask(struct port_info *ports, uint16_t max_ports,
  * and convert to a number to store in the num_clients variable
  */
 int
-parse_num_clients(uint8_t *num_clients, const char *clients)
+parse_num_clients(uint16_t *num_clients, const char *clients)
 {
 	char *end = NULL;
 	unsigned long temp;
@@ -209,7 +209,7 @@ parse_num_clients(uint8_t *num_clients, const char *clients)
 	if (end == NULL || *end != '\0' || temp == 0)
 		return -1;
 
-	*num_clients = (uint8_t)temp;
+	*num_clients = (uint16_t)temp;
 	return 0;
 }
 
diff --git a/src/shared/common.h b/src/shared/common.h
index 5b8d11d..33c4d4f 100644
--- a/src/shared/common.h
+++ b/src/shared/common.h
@@ -193,7 +193,7 @@ int init_port(uint8_t port_num, struct rte_mempool *pktmbuf_pool);
 
 int parse_portmask(struct port_info *ports, uint16_t max_ports,
 		const char *portmask);
-int parse_num_clients(uint8_t *num_clients, const char *clients);
+int parse_num_clients(uint16_t *num_clients, const char *clients);
 int parse_server(char **server_ip, int *server_port, char *server_addr);
 
 int spp_atoi(const char *str, int *val);
diff --git a/src/vm/args.c b/src/vm/args.c
index dc11d77..f4bf856 100644
--- a/src/vm/args.c
+++ b/src/vm/args.c
@@ -40,7 +40,7 @@
 #include "init.h"
 
 /* global var for number of clients - extern in header */
-uint8_t client_id;
+uint16_t client_id;
 char *server_ip;
 int server_port;
 
@@ -66,7 +66,7 @@ usage(void)
  * on error.
  */
 int
-parse_app_args(uint8_t max_ports, int argc, char *argv[])
+parse_app_args(uint16_t max_ports, int argc, char *argv[])
 {
 	int option_index, opt;
 	char **argvopt = argv;
diff --git a/src/vm/args.h b/src/vm/args.h
index ecaebd2..15243e5 100644
--- a/src/vm/args.h
+++ b/src/vm/args.h
@@ -36,10 +36,10 @@
 
 #include <stdint.h>
 
-extern uint8_t client_id;
+extern uint16_t client_id;
 extern char *server_ip;
 extern int server_port;
 
-int parse_app_args(uint8_t max_ports, int argc, char *argv[]);
+int parse_app_args(uint16_t max_ports, int argc, char *argv[]);
 
 #endif /* ifndef _ARGS_H_ */
diff --git a/src/vm/init.c b/src/vm/init.c
index 40b0ffe..4405489 100644
--- a/src/vm/init.c
+++ b/src/vm/init.c
@@ -91,7 +91,8 @@ init(int argc, char *argv[])
 {
 	int retval;
 	const struct rte_memzone *mz;
-	uint8_t i, total_ports;
+	uint8_t i;
+	uint16_t total_ports;
 
 	/* init EAL, parsing EAL args */
 	retval = rte_eal_init(argc, argv);
-- 
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 ` ogawa.yasufumi [this message]
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-4-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).