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

Type of ID and number of ports managed in primary is uint8 while it is
changed from uint8_t to uint16_t in DPDK 17.11.

This update is to change type of ID and number of ports to uint16_t.
It also includes updates for common functions called from primary.

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

diff --git a/src/primary/args.c b/src/primary/args.c
index 55433a1..a786d3a 100644
--- a/src/primary/args.c
+++ b/src/primary/args.c
@@ -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/primary/args.h b/src/primary/args.h
index 73e1f82..e290860 100644
--- a/src/primary/args.h
+++ b/src/primary/args.h
@@ -40,6 +40,6 @@ extern uint8_t num_clients;
 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/primary/init.c b/src/primary/init.c
index 5ea21f9..7a15e9b 100644
--- a/src/primary/init.c
+++ b/src/primary/init.c
@@ -134,7 +134,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);
diff --git a/src/primary/main.c b/src/primary/main.c
index 15fa53a..d3feef7 100644
--- a/src/primary/main.c
+++ b/src/primary/main.c
@@ -56,7 +56,7 @@ turn_off(int sig)
 }
 
 static const char *
-get_printable_mac_addr(uint8_t port)
+get_printable_mac_addr(uint16_t port)
 {
 	static const char err_address[] = "00:00:00:00:00:00";
 	static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)];
diff --git a/src/shared/common.c b/src/shared/common.c
index da73cfe..9455294 100644
--- a/src/shared/common.c
+++ b/src/shared/common.c
@@ -160,7 +160,7 @@ init_port(uint8_t port_num, struct rte_mempool *pktmbuf_pool)
  * array variable
  */
 int
-parse_portmask(struct port_info *ports, uint8_t max_ports,
+parse_portmask(struct port_info *ports, uint16_t max_ports,
 		const char *portmask)
 {
 	char *end = NULL;
diff --git a/src/shared/common.h b/src/shared/common.h
index 27138bd..5b8d11d 100644
--- a/src/shared/common.h
+++ b/src/shared/common.h
@@ -108,8 +108,8 @@ struct stats {
 } __rte_cache_aligned;
 
 struct port_info {
-	uint8_t num_ports;
-	uint8_t id[RTE_MAX_ETHPORTS];
+	uint16_t num_ports;
+	uint16_t id[RTE_MAX_ETHPORTS];
 	struct stats port_stats[RTE_MAX_ETHPORTS];
 	struct stats client_stats[MAX_CLIENT];
 };
@@ -191,7 +191,7 @@ void check_all_ports_link_status(struct port_info *ports, uint8_t port_num,
 
 int init_port(uint8_t port_num, struct rte_mempool *pktmbuf_pool);
 
-int parse_portmask(struct port_info *ports, uint8_t max_ports,
+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_server(char **server_ip, int *server_port, char *server_addr);
-- 
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 ` ogawa.yasufumi [this message]
2017-12-06  8:18 ` [spp] [PATCH 4/7] spp_vm: change type of ports_id " 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-3-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).