[spp] [PATCH 5/7] spp/shared: change type of ports_id to uint16_t

ogawa.yasufumi at lab.ntt.co.jp ogawa.yasufumi at lab.ntt.co.jp
Wed Dec 6 09:18:24 CET 2017


From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>

This update is to change argument type of ID and number of ports to
uint16_t.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
 src/shared/common.c | 9 +++++----
 src/shared/common.h | 4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/shared/common.c b/src/shared/common.c
index 7c7c6c8..dd1f88c 100644
--- a/src/shared/common.c
+++ b/src/shared/common.c
@@ -37,12 +37,13 @@
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 void
-check_all_ports_link_status(struct port_info *ports, uint8_t port_num,
+check_all_ports_link_status(struct port_info *ports, uint16_t port_num,
 		uint32_t port_mask)
 {
 #define CHECK_INTERVAL 100 /* 100ms */
 #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
-	uint8_t portid, count, all_ports_up;
+	uint8_t count, all_ports_up;
+	uint16_t portid;
 	struct rte_eth_link link;
 
 	RTE_LOG(INFO, APP, "\nChecking link status");
@@ -102,7 +103,7 @@ check_all_ports_link_status(struct port_info *ports, uint8_t port_num,
  * - start the port and report its status to stdout
  */
 int
-init_port(uint8_t port_num, struct rte_mempool *pktmbuf_pool)
+init_port(uint16_t port_num, struct rte_mempool *pktmbuf_pool)
 {
 	/* for port configuration all features are off by default */
 	const struct rte_eth_conf port_conf = {
@@ -165,7 +166,7 @@ parse_portmask(struct port_info *ports, uint16_t max_ports,
 {
 	char *end = NULL;
 	unsigned long pm;
-	uint8_t count = 0;
+	uint16_t count = 0;
 
 	if (portmask == NULL || *portmask == '\0')
 		return -1;
diff --git a/src/shared/common.h b/src/shared/common.h
index 33c4d4f..e29c7b9 100644
--- a/src/shared/common.h
+++ b/src/shared/common.h
@@ -186,10 +186,10 @@ get_vhost_iface_name(unsigned int id)
 	return buffer;
 }
 
-void check_all_ports_link_status(struct port_info *ports, uint8_t port_num,
+void check_all_ports_link_status(struct port_info *ports, uint16_t port_num,
 		uint32_t port_mask);
 
-int init_port(uint8_t port_num, struct rte_mempool *pktmbuf_pool);
+int init_port(uint16_t port_num, struct rte_mempool *pktmbuf_pool);
 
 int parse_portmask(struct port_info *ports, uint16_t max_ports,
 		const char *portmask);
-- 
2.13.1



More information about the spp mailing list