All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] fix port id type
@ 2017-10-13 13:16 Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 1/8] net/bonding: " Zhiyong Yang
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

Fix port id type and update related docs.

Zhiyong Yang (8):
  net/bonding: fix port id type
  net/i40e: fix port id type
  net/fm10k: fix port id type
  net/mrvl: fix port id type
  app: fix port id type
  test: fix port id type
  examples: fix port id type
  doc: update port id type

 app/pdump/main.c                                   |  2 +-
 app/test-pmd/cmdline.c                             | 52 +++++++++++-----------
 doc/guides/prog_guide/poll_mode_drv.rst            |  2 +-
 doc/guides/prog_guide/rte_flow.rst                 | 12 ++---
 doc/guides/sample_app_ug/ipv4_multicast.rst        |  2 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst  |  8 ++--
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |  4 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |  2 +-
 doc/guides/sample_app_ug/l3_forward.rst            | 10 ++---
 doc/guides/sample_app_ug/l3_forward_power_man.rst  |  4 +-
 doc/guides/sample_app_ug/link_status_intr.rst      |  4 +-
 doc/guides/sample_app_ug/ptpclient.rst             |  2 +-
 doc/guides/sample_app_ug/rxtx_callbacks.rst        |  6 +--
 doc/guides/sample_app_ug/skeleton.rst              |  6 +--
 drivers/net/bonding/rte_eth_bond_pmd.c             |  8 ++--
 drivers/net/fm10k/fm10k_rxtx.c                     |  4 +-
 drivers/net/i40e/i40e_ethdev.c                     |  2 +-
 drivers/net/i40e/rte_pmd_i40e.c                    |  8 ++--
 drivers/net/i40e/rte_pmd_i40e.h                    |  8 ++--
 drivers/net/mrvl/mrvl_qos.c                        |  2 +-
 drivers/net/mrvl/mrvl_qos.h                        |  2 +-
 examples/distributor/main.c                        |  2 +-
 examples/ethtool/lib/rte_ethtool.c                 | 42 ++++++++---------
 examples/ethtool/lib/rte_ethtool.h                 | 42 ++++++++---------
 examples/exception_path/main.c                     |  2 +-
 examples/ipsec-secgw/ipsec-secgw.c                 | 47 ++++++++++---------
 examples/kni/main.c                                | 16 +++----
 examples/l2fwd-crypto/main.c                       | 18 ++++----
 examples/l2fwd-jobstats/main.c                     | 26 +++++------
 examples/l3fwd-acl/main.c                          | 23 +++++-----
 examples/l3fwd-power/main.c                        | 12 ++---
 examples/l3fwd/l3fwd_em.c                          | 17 +++----
 examples/l3fwd/l3fwd_em_sequential.h               |  4 +-
 examples/link_status_interrupt/main.c              | 15 +++----
 .../client_server_mp/mp_client/client.c            |  6 +--
 examples/multi_process/symmetric_mp/main.c         | 21 ++++-----
 examples/performance-thread/l3fwd-thread/main.c    |  6 +--
 examples/ptpclient/ptpclient.c                     |  8 ++--
 examples/qos_meter/main.c                          |  4 +-
 examples/qos_sched/cmdline.c                       | 30 ++++++-------
 examples/quota_watermark/qw/init.c                 |  4 +-
 examples/quota_watermark/qw/init.h                 |  4 +-
 examples/quota_watermark/qw/main.c                 |  4 +-
 examples/quota_watermark/qw/main.h                 |  2 +-
 examples/rxtx_callbacks/main.c                     |  2 +-
 examples/server_node_efd/node/node.c               | 21 ++++-----
 examples/server_node_efd/server/init.c             | 18 ++++----
 examples/tep_termination/main.c                    |  6 +--
 examples/tep_termination/vxlan_setup.c             |  6 +--
 examples/tep_termination/vxlan_setup.h             | 10 ++---
 examples/vmdq/main.c                               |  6 +--
 examples/vmdq_dcb/main.c                           |  6 +--
 test/test-pipeline/init.c                          |  8 ++--
 test/test/test_link_bonding.c                      |  2 +-
 test/test/test_link_bonding_mode4.c                |  4 +-
 test/test/test_link_bonding_rssconf.c              |  7 +--
 56 files changed, 306 insertions(+), 295 deletions(-)

-- 
2.13.3

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/8] net/bonding: fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
@ 2017-10-13 13:16 ` Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 2/8] net/i40e: " Zhiyong Yang
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 8cbcf6d72..3fbc1b123 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -538,7 +538,7 @@ ipv4_addr_to_dot(uint32_t be_ipv4_addr, char *buf, uint8_t buf_size)
 #define MAX_CLIENTS_NUMBER	128
 uint8_t active_clients;
 struct client_stats_t {
-	uint8_t port;
+	uint16_t port;
 	uint32_t ipv4_addr;
 	uint32_t ipv4_rx_packets;
 	uint32_t ipv4_tx_packets;
@@ -546,7 +546,7 @@ struct client_stats_t {
 struct client_stats_t client_stats[MAX_CLIENTS_NUMBER];
 
 static void
-update_client_stats(uint32_t addr, uint8_t port, uint32_t *TXorRXindicator)
+update_client_stats(uint32_t addr, uint16_t port, uint32_t *TXorRXindicator)
 {
 	int i = 0;
 
@@ -604,7 +604,7 @@ update_client_stats(uint32_t addr, uint8_t port, uint32_t *TXorRXindicator)
 
 static void
 mode6_debug(const char __attribute__((unused)) *info, struct ether_hdr *eth_h,
-		uint8_t port, uint32_t __attribute__((unused)) *burstnumber)
+		uint16_t port, uint32_t __attribute__((unused)) *burstnumber)
 {
 	struct ipv4_hdr *ipv4_h;
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
@@ -2059,7 +2059,7 @@ bond_ethdev_close(struct rte_eth_dev *dev)
 
 	RTE_LOG(INFO, EAL, "Closing bonded device %s\n", dev->device->name);
 	while (internals->slave_count != skipped) {
-		uint8_t port_id = internals->slaves[skipped].port_id;
+		uint16_t port_id = internals->slaves[skipped].port_id;
 
 		rte_eth_dev_stop(port_id);
 
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/8] net/i40e: fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 1/8] net/bonding: " Zhiyong Yang
@ 2017-10-13 13:16 ` Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 3/8] net/fm10k: " Zhiyong Yang
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

Some functions applied were still developed on top of uint8_t port_id,
however port_id has been increased range to uint16_t. The patch fixes
the issue.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c  | 2 +-
 drivers/net/i40e/rte_pmd_i40e.c | 8 ++++----
 drivers/net/i40e/rte_pmd_i40e.h | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 71327d1b9..f40c463aa 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11065,7 +11065,7 @@ i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg,
 			       struct rte_pmd_i40e_proto_info *proto)
 {
 	struct rte_pmd_i40e_ptype_mapping *ptype_mapping;
-	uint8_t port_id = dev->data->port_id;
+	uint16_t port_id = dev->data->port_id;
 	uint32_t ptype_num;
 	struct rte_pmd_i40e_ptype_info *ptype;
 	uint32_t buff_size;
diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 3155cf8d9..b113eb4c3 100644
--- a/drivers/net/i40e/rte_pmd_i40e.c
+++ b/drivers/net/i40e/rte_pmd_i40e.c
@@ -2295,7 +2295,7 @@ int rte_pmd_i40e_ptype_mapping_replace(uint16_t port,
 }
 
 int
-rte_pmd_i40e_add_vf_mac_addr(uint8_t port, uint16_t vf_id,
+rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
 			     struct ether_addr *mac_addr)
 {
 	struct rte_eth_dev *dev;
@@ -2338,7 +2338,7 @@ rte_pmd_i40e_add_vf_mac_addr(uint8_t port, uint16_t vf_id,
 	return 0;
 }
 
-int rte_pmd_i40e_flow_type_mapping_reset(uint8_t port)
+int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port)
 {
 	struct rte_eth_dev *dev;
 
@@ -2355,7 +2355,7 @@ int rte_pmd_i40e_flow_type_mapping_reset(uint8_t port)
 }
 
 int rte_pmd_i40e_flow_type_mapping_get(
-			uint8_t port,
+			uint16_t port,
 			struct rte_pmd_i40e_flow_type_mapping *mapping_items)
 {
 	struct rte_eth_dev *dev;
@@ -2381,7 +2381,7 @@ int rte_pmd_i40e_flow_type_mapping_get(
 
 int
 rte_pmd_i40e_flow_type_mapping_update(
-			uint8_t port,
+			uint16_t port,
 			struct rte_pmd_i40e_flow_type_mapping *mapping_items,
 			uint16_t count,
 			uint8_t exclusive)
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index f18251be7..467b415b9 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -759,7 +759,7 @@ int rte_pmd_i40e_ptype_mapping_replace(uint16_t port,
  *   - (-ENODEV) if *port* invalid.
  *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
  */
-int rte_pmd_i40e_add_vf_mac_addr(uint8_t port, uint16_t vf_id,
+int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id,
 				 struct ether_addr *mac_addr);
 
 #define RTE_PMD_I40E_PCTYPE_MAX		64
@@ -788,7 +788,7 @@ struct rte_pmd_i40e_flow_type_mapping {
  *	set other PCTYPEs maps to PCTYPE_INVALID.
  */
 int rte_pmd_i40e_flow_type_mapping_update(
-			uint8_t port,
+			uint16_t port,
 			struct rte_pmd_i40e_flow_type_mapping *mapping_items,
 			uint16_t count,
 			uint8_t exclusive);
@@ -805,7 +805,7 @@ int rte_pmd_i40e_flow_type_mapping_update(
  *    RTE_PMD_I40E_FLOW_TYPE_MAX items
  */
 int rte_pmd_i40e_flow_type_mapping_get(
-			uint8_t port,
+			uint16_t port,
 			struct rte_pmd_i40e_flow_type_mapping *mapping_items);
 
 /**
@@ -815,7 +815,7 @@ int rte_pmd_i40e_flow_type_mapping_get(
  * @param port
  *    pointer to port identifier of the device
  */
-int rte_pmd_i40e_flow_type_mapping_reset(uint8_t port);
+int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port);
 
 /**
  * On the PF, find VF index based on VF MAC address
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/8] net/fm10k: fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 1/8] net/bonding: " Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 2/8] net/i40e: " Zhiyong Yang
@ 2017-10-13 13:16 ` Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 4/8] net/mrvl: " Zhiyong Yang
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

The variable "port" should be defined as uint16_t, fix it here.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/fm10k/fm10k_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index c9bb04a0e..4e84926f8 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -198,7 +198,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 					q->alloc_thresh);
 
 		if (unlikely(ret != 0)) {
-			uint8_t port = q->port_id;
+			uint16_t port = q->port_id;
 			PMD_RX_LOG(ERR, "Failed to alloc mbuf");
 			/*
 			 * Need to restore next_dd if we cannot allocate new
@@ -356,7 +356,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 					q->alloc_thresh);
 
 		if (unlikely(ret != 0)) {
-			uint8_t port = q->port_id;
+			uint16_t port = q->port_id;
 			PMD_RX_LOG(ERR, "Failed to alloc mbuf");
 			/*
 			 * Need to restore next_dd if we cannot allocate new
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/8] net/mrvl: fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
                   ` (2 preceding siblings ...)
  2017-10-13 13:16 ` [PATCH 3/8] net/fm10k: " Zhiyong Yang
@ 2017-10-13 13:16 ` Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 5/8] app: " Zhiyong Yang
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

port id should be defined as uint16_t.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 drivers/net/mrvl/mrvl_qos.c | 2 +-
 drivers/net/mrvl/mrvl_qos.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mrvl/mrvl_qos.c b/drivers/net/mrvl/mrvl_qos.c
index 796509b1b..c7b96ef1d 100644
--- a/drivers/net/mrvl/mrvl_qos.c
+++ b/drivers/net/mrvl/mrvl_qos.c
@@ -486,7 +486,7 @@ setup_tc(struct pp2_ppio_tc_params *param, uint8_t inqs,
  * @returns 0 in case of success, negative value otherwise.
  */
 int
-mrvl_configure_rxqs(struct mrvl_priv *priv, uint8_t portid,
+mrvl_configure_rxqs(struct mrvl_priv *priv, uint16_t portid,
 	uint16_t max_queues)
 {
 	size_t i, tc;
diff --git a/drivers/net/mrvl/mrvl_qos.h b/drivers/net/mrvl/mrvl_qos.h
index 0fcc85ca7..90c08e98d 100644
--- a/drivers/net/mrvl/mrvl_qos.h
+++ b/drivers/net/mrvl/mrvl_qos.h
@@ -94,7 +94,7 @@ mrvl_get_qoscfg(const char *key __rte_unused, const char *path,
  * @returns 0 in case of success, negative value otherwise.
  */
 int
-mrvl_configure_rxqs(struct mrvl_priv *priv, uint8_t portid,
+mrvl_configure_rxqs(struct mrvl_priv *priv, uint16_t portid,
 		    uint16_t max_queues);
 
 /**
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/8] app: fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
                   ` (3 preceding siblings ...)
  2017-10-13 13:16 ` [PATCH 4/8] net/mrvl: " Zhiyong Yang
@ 2017-10-13 13:16 ` Zhiyong Yang
  2017-10-13 13:16 ` [PATCH 6/8] test: " Zhiyong Yang
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 app/pdump/main.c       |  2 +-
 app/test-pmd/cmdline.c | 52 ++++++++++++++++++++++++++------------------------
 2 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 3d8e50273..66272f59a 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -131,7 +131,7 @@ struct pdump_stats {
 
 struct pdump_tuples {
 	/* cli params */
-	uint8_t port;
+	uint16_t port;
 	char *device_id;
 	uint16_t queue;
 	char rx_dev[TX_STREAM_SIZE];
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index bb19d726f..bb01e989a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1942,7 +1942,7 @@ cmdline_parse_inst_t cmd_config_rss_hash_key = {
 /* *** configure port rxq/txq start/stop *** */
 struct cmd_config_rxtx_queue {
 	cmdline_fixed_string_t port;
-	uint8_t portid;
+	portid_t portid;
 	cmdline_fixed_string_t rxtxq;
 	uint16_t qid;
 	cmdline_fixed_string_t opname;
@@ -2010,7 +2010,7 @@ cmd_config_rxtx_queue_parsed(void *parsed_result,
 cmdline_parse_token_string_t cmd_config_rxtx_queue_port =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rxtx_queue, port, "port");
 cmdline_parse_token_num_t cmd_config_rxtx_queue_portid =
-	TOKEN_NUM_INITIALIZER(struct cmd_config_rxtx_queue, portid, UINT8);
+	TOKEN_NUM_INITIALIZER(struct cmd_config_rxtx_queue, portid, UINT16);
 cmdline_parse_token_string_t cmd_config_rxtx_queue_rxtxq =
 	TOKEN_STRING_INITIALIZER(struct cmd_config_rxtx_queue, rxtxq, "rxq#txq");
 cmdline_parse_token_num_t cmd_config_rxtx_queue_qid =
@@ -5237,7 +5237,7 @@ struct cmd_set_bond_mac_addr_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t bonding;
 	cmdline_fixed_string_t mac_addr;
-	uint8_t port_num;
+	uint16_t port_num;
 	struct ether_addr address;
 };
 
@@ -5267,7 +5267,8 @@ cmdline_parse_token_string_t cmd_set_bond_mac_addr_mac =
 		TOKEN_STRING_INITIALIZER(struct cmd_set_bond_mac_addr_result, mac_addr,
 				"mac_addr");
 cmdline_parse_token_num_t cmd_set_bond_mac_addr_portnum =
-		TOKEN_NUM_INITIALIZER(struct cmd_set_bond_mac_addr_result, port_num, UINT8);
+		TOKEN_NUM_INITIALIZER(struct cmd_set_bond_mac_addr_result,
+				port_num, UINT16);
 cmdline_parse_token_etheraddr_t cmd_set_bond_mac_addr_addr =
 		TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_bond_mac_addr_result, address);
 
@@ -5291,7 +5292,7 @@ struct cmd_set_bond_mon_period_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t bonding;
 	cmdline_fixed_string_t mon_period;
-	uint8_t port_num;
+	uint16_t port_num;
 	uint32_t period_ms;
 };
 
@@ -5325,7 +5326,7 @@ cmdline_parse_token_string_t cmd_set_bond_mon_period_mon_period =
 				mon_period,	"mon_period");
 cmdline_parse_token_num_t cmd_set_bond_mon_period_portnum =
 		TOKEN_NUM_INITIALIZER(struct cmd_set_bond_mon_period_result,
-				port_num, UINT8);
+				port_num, UINT16);
 cmdline_parse_token_num_t cmd_set_bond_mon_period_period_ms =
 		TOKEN_NUM_INITIALIZER(struct cmd_set_bond_mon_period_result,
 				period_ms, UINT32);
@@ -5350,7 +5351,7 @@ struct cmd_set_bonding_agg_mode_policy_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t bonding;
 	cmdline_fixed_string_t agg_mode;
-	uint8_t port_num;
+	uint16_t port_num;
 	cmdline_fixed_string_t policy;
 };
 
@@ -5393,7 +5394,7 @@ cmdline_parse_token_string_t cmd_set_bonding_agg_mode_agg_mode =
 
 cmdline_parse_token_num_t cmd_set_bonding_agg_mode_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_agg_mode_policy_result,
-				port_num, UINT8);
+				port_num, UINT16);
 
 cmdline_parse_token_string_t cmd_set_bonding_agg_mode_policy_string =
 	TOKEN_STRING_INITIALIZER(
@@ -5607,7 +5608,7 @@ struct cmd_set_promisc_mode_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t promisc;
 	cmdline_fixed_string_t port_all; /* valid if "allports" argument == 1 */
-	uint8_t port_num;                /* valid if "allports" argument == 0 */
+	uint16_t port_num;               /* valid if "allports" argument == 0 */
 	cmdline_fixed_string_t mode;
 };
 
@@ -5687,7 +5688,7 @@ struct cmd_set_allmulti_mode_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t allmulti;
 	cmdline_fixed_string_t port_all; /* valid if "allports" argument == 1 */
-	uint8_t port_num;                /* valid if "allports" argument == 0 */
+	uint16_t port_num;               /* valid if "allports" argument == 0 */
 	cmdline_fixed_string_t mode;
 };
 
@@ -5731,7 +5732,7 @@ cmdline_parse_token_string_t cmd_setallmulti_portall =
 				 "all");
 cmdline_parse_token_num_t cmd_setallmulti_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_set_allmulti_mode_result, port_num,
-			      UINT8);
+			      UINT16);
 cmdline_parse_token_string_t cmd_setallmulti_mode =
 	TOKEN_STRING_INITIALIZER(struct cmd_set_allmulti_mode_result, mode,
 				 "on#off");
@@ -6497,7 +6498,7 @@ struct cmd_showport_result {
 	cmdline_fixed_string_t show;
 	cmdline_fixed_string_t port;
 	cmdline_fixed_string_t what;
-	uint8_t portnum;
+	uint16_t portnum;
 };
 
 static void cmd_showport_parsed(void *parsed_result,
@@ -6535,7 +6536,7 @@ cmdline_parse_token_string_t cmd_showport_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
 				 "info#stats#xstats#fdir#stat_qmap#dcb_tc#cap");
 cmdline_parse_token_num_t cmd_showport_portnum =
-	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT8);
+	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT16);
 
 cmdline_parse_inst_t cmd_showport = {
 	.f = cmd_showport_parsed,
@@ -6557,7 +6558,7 @@ struct cmd_showqueue_result {
 	cmdline_fixed_string_t show;
 	cmdline_fixed_string_t type;
 	cmdline_fixed_string_t what;
-	uint8_t portnum;
+	uint16_t portnum;
 	uint16_t queuenum;
 };
 
@@ -6581,7 +6582,7 @@ cmdline_parse_token_string_t cmd_showqueue_type =
 cmdline_parse_token_string_t cmd_showqueue_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showqueue_result, what, "info");
 cmdline_parse_token_num_t cmd_showqueue_portnum =
-	TOKEN_NUM_INITIALIZER(struct cmd_showqueue_result, portnum, UINT8);
+	TOKEN_NUM_INITIALIZER(struct cmd_showqueue_result, portnum, UINT16);
 cmdline_parse_token_num_t cmd_showqueue_queuenum =
 	TOKEN_NUM_INITIALIZER(struct cmd_showqueue_result, queuenum, UINT16);
 
@@ -6969,7 +6970,7 @@ cmdline_parse_inst_t cmd_quit = {
 struct cmd_mac_addr_result {
 	cmdline_fixed_string_t mac_addr_cmd;
 	cmdline_fixed_string_t what;
-	uint8_t port_num;
+	uint16_t port_num;
 	struct ether_addr address;
 };
 
@@ -7001,7 +7002,8 @@ cmdline_parse_token_string_t cmd_mac_addr_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_mac_addr_result, what,
 				"add#remove#set");
 cmdline_parse_token_num_t cmd_mac_addr_portnum =
-		TOKEN_NUM_INITIALIZER(struct cmd_mac_addr_result, port_num, UINT8);
+		TOKEN_NUM_INITIALIZER(struct cmd_mac_addr_result, port_num,
+					UINT16);
 cmdline_parse_token_etheraddr_t cmd_mac_addr_addr =
 		TOKEN_ETHERADDR_INITIALIZER(struct cmd_mac_addr_result, address);
 
@@ -7460,7 +7462,7 @@ struct cmd_vf_mac_addr_result {
 	cmdline_fixed_string_t mac_addr_cmd;
 	cmdline_fixed_string_t what;
 	cmdline_fixed_string_t port;
-	uint8_t port_num;
+	uint16_t port_num;
 	cmdline_fixed_string_t vf;
 	uint8_t vf_num;
 	struct ether_addr address;
@@ -7503,7 +7505,7 @@ cmdline_parse_token_string_t cmd_vf_mac_addr_port =
 				port,"port");
 cmdline_parse_token_num_t cmd_vf_mac_addr_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_vf_mac_addr_result,
-				port_num, UINT8);
+				port_num, UINT16);
 cmdline_parse_token_string_t cmd_vf_mac_addr_vf =
 	TOKEN_STRING_INITIALIZER(struct cmd_vf_mac_addr_result,
 				vf,"vf");
@@ -7629,7 +7631,7 @@ cmdline_parse_inst_t cmd_vf_rxvlan_filter = {
 struct cmd_queue_rate_limit_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t port;
-	uint8_t port_num;
+	uint16_t port_num;
 	cmdline_fixed_string_t queue;
 	uint8_t queue_num;
 	cmdline_fixed_string_t rate;
@@ -7661,7 +7663,7 @@ cmdline_parse_token_string_t cmd_queue_rate_limit_port =
 				port, "port");
 cmdline_parse_token_num_t cmd_queue_rate_limit_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_queue_rate_limit_result,
-				port_num, UINT8);
+				port_num, UINT16);
 cmdline_parse_token_string_t cmd_queue_rate_limit_queue =
 	TOKEN_STRING_INITIALIZER(struct cmd_queue_rate_limit_result,
 				queue, "queue");
@@ -7696,7 +7698,7 @@ cmdline_parse_inst_t cmd_queue_rate_limit = {
 struct cmd_vf_rate_limit_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t port;
-	uint8_t port_num;
+	uint16_t port_num;
 	cmdline_fixed_string_t vf;
 	uint8_t vf_num;
 	cmdline_fixed_string_t rate;
@@ -7731,7 +7733,7 @@ cmdline_parse_token_string_t cmd_vf_rate_limit_port =
 				port, "port");
 cmdline_parse_token_num_t cmd_vf_rate_limit_portnum =
 	TOKEN_NUM_INITIALIZER(struct cmd_vf_rate_limit_result,
-				port_num, UINT8);
+				port_num, UINT16);
 cmdline_parse_token_string_t cmd_vf_rate_limit_vf =
 	TOKEN_STRING_INITIALIZER(struct cmd_vf_rate_limit_result,
 				vf, "vf");
@@ -11285,7 +11287,7 @@ cmdline_parse_inst_t cmd_set_fdir_input_set = {
 struct cmd_mcast_addr_result {
 	cmdline_fixed_string_t mcast_addr_cmd;
 	cmdline_fixed_string_t what;
-	uint8_t port_num;
+	uint16_t port_num;
 	struct ether_addr mc_addr;
 };
 
@@ -11315,7 +11317,7 @@ cmdline_parse_token_string_t cmd_mcast_addr_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_mcast_addr_result, what,
 				 "add#remove");
 cmdline_parse_token_num_t cmd_mcast_addr_portnum =
-	TOKEN_NUM_INITIALIZER(struct cmd_mcast_addr_result, port_num, UINT8);
+	TOKEN_NUM_INITIALIZER(struct cmd_mcast_addr_result, port_num, UINT16);
 cmdline_parse_token_etheraddr_t cmd_mcast_addr_addr =
 	TOKEN_ETHERADDR_INITIALIZER(struct cmd_mac_addr_result, address);
 
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/8] test: fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
                   ` (4 preceding siblings ...)
  2017-10-13 13:16 ` [PATCH 5/8] app: " Zhiyong Yang
@ 2017-10-13 13:16 ` Zhiyong Yang
  2017-10-13 13:17 ` [PATCH 7/8] examples: " Zhiyong Yang
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:16 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 test/test-pipeline/init.c             | 8 ++++----
 test/test/test_link_bonding.c         | 2 +-
 test/test/test_link_bonding_mode4.c   | 4 ++--
 test/test/test_link_bonding_rssconf.c | 7 ++++---
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/test/test-pipeline/init.c b/test/test-pipeline/init.c
index 1457c7890..b1f8e93ea 100644
--- a/test/test-pipeline/init.c
+++ b/test/test-pipeline/init.c
@@ -194,9 +194,9 @@ app_ports_check_link(void)
 
 	for (i = 0; i < app.n_ports; i++) {
 		struct rte_eth_link link;
-		uint8_t port;
+		uint16_t port;
 
-		port = (uint8_t) app.ports[i];
+		port = app.ports[i];
 		memset(&link, 0, sizeof(link));
 		rte_eth_link_get_nowait(port, &link);
 		RTE_LOG(INFO, USER1, "Port %u (%u Gbps) %s\n",
@@ -219,10 +219,10 @@ app_init_ports(void)
 
 	/* Init NIC ports, then start the ports */
 	for (i = 0; i < app.n_ports; i++) {
-		uint8_t port;
+		uint16_t port;
 		int ret;
 
-		port = (uint8_t) app.ports[i];
+		port = app.ports[i];
 		RTE_LOG(INFO, USER1, "Initializing NIC port %u ...\n", port);
 
 		/* Init port */
diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c
index e41ab60d2..c6e3a725b 100644
--- a/test/test/test_link_bonding.c
+++ b/test/test/test_link_bonding.c
@@ -226,7 +226,7 @@ static void free_virtualpmd_tx_queue(void);
 
 
 static int
-configure_ethdev(uint8_t port_id, uint8_t start, uint8_t en_isr)
+configure_ethdev(uint16_t port_id, uint8_t start, uint8_t en_isr)
 {
 	int q_id;
 
diff --git a/test/test/test_link_bonding_mode4.c b/test/test/test_link_bonding_mode4.c
index 5deea6e16..a7a3f8e25 100644
--- a/test/test/test_link_bonding_mode4.c
+++ b/test/test/test_link_bonding_mode4.c
@@ -102,7 +102,7 @@ static const struct ether_addr slow_protocol_mac_addr = {
 struct slave_conf {
 	struct rte_ring *rx_queue;
 	struct rte_ring *tx_queue;
-	uint8_t port_id;
+	uint16_t port_id;
 	uint8_t bonded : 1;
 
 	uint8_t lacp_parnter_state;
@@ -235,7 +235,7 @@ free_pkts(struct rte_mbuf **pkts, uint16_t count)
 }
 
 static int
-configure_ethdev(uint8_t port_id, uint8_t start)
+configure_ethdev(uint16_t port_id, uint8_t start)
 {
 	TEST_ASSERT(rte_eth_dev_configure(port_id, 1, 1, &default_pmd_conf) == 0,
 		"Failed to configure device %u", port_id);
diff --git a/test/test/test_link_bonding_rssconf.c b/test/test/test_link_bonding_rssconf.c
index f8cf1cabf..7dccc6e12 100644
--- a/test/test/test_link_bonding_rssconf.c
+++ b/test/test/test_link_bonding_rssconf.c
@@ -75,7 +75,7 @@
 #define INVALID_BONDING_MODE    (-1)
 
 struct slave_conf {
-	uint8_t port_id;
+	uint16_t port_id;
 	struct rte_eth_dev_info dev_info;
 
 	struct rte_eth_rss_conf rss_conf;
@@ -159,7 +159,8 @@ static struct rte_eth_conf rss_pmd_conf = {
 		RTE_DIM(test_params.slave_ports))
 
 static int
-configure_ethdev(uint8_t port_id, struct rte_eth_conf *eth_conf, uint8_t start)
+configure_ethdev(uint16_t port_id, struct rte_eth_conf *eth_conf,
+		 uint8_t start)
 {
 	int rxq, txq;
 
@@ -243,7 +244,7 @@ bond_slaves(void)
  * Set all RETA values in port_id to value
  */
 static int
-reta_set(uint8_t port_id, uint8_t value, int reta_size)
+reta_set(uint16_t port_id, uint8_t value, int reta_size)
 {
 	struct rte_eth_rss_reta_entry64 reta_conf[512/RTE_RETA_GROUP_SIZE];
 	int i, j;
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 7/8] examples: fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
                   ` (5 preceding siblings ...)
  2017-10-13 13:16 ` [PATCH 6/8] test: " Zhiyong Yang
@ 2017-10-13 13:17 ` Zhiyong Yang
  2017-10-13 13:17 ` [PATCH 8/8] doc: update " Zhiyong Yang
  2017-10-13 18:25 ` [PATCH 0/8] fix " Ferruh Yigit
  8 siblings, 0 replies; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:17 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 examples/distributor/main.c                        |  2 +-
 examples/ethtool/lib/rte_ethtool.c                 | 42 +++++++++----------
 examples/ethtool/lib/rte_ethtool.h                 | 42 +++++++++----------
 examples/exception_path/main.c                     |  2 +-
 examples/ipsec-secgw/ipsec-secgw.c                 | 47 ++++++++++++----------
 examples/kni/main.c                                | 16 ++++----
 examples/l2fwd-crypto/main.c                       | 18 ++++-----
 examples/l2fwd-jobstats/main.c                     | 26 ++++++------
 examples/l3fwd-acl/main.c                          | 23 ++++++-----
 examples/l3fwd-power/main.c                        | 12 +++---
 examples/l3fwd/l3fwd_em.c                          | 17 ++++----
 examples/l3fwd/l3fwd_em_sequential.h               |  4 +-
 examples/link_status_interrupt/main.c              | 15 ++++---
 .../client_server_mp/mp_client/client.c            |  6 +--
 examples/multi_process/symmetric_mp/main.c         | 21 +++++-----
 examples/performance-thread/l3fwd-thread/main.c    |  6 +--
 examples/ptpclient/ptpclient.c                     |  8 ++--
 examples/qos_meter/main.c                          |  4 +-
 examples/qos_sched/cmdline.c                       | 30 +++++++-------
 examples/quota_watermark/qw/init.c                 |  4 +-
 examples/quota_watermark/qw/init.h                 |  4 +-
 examples/quota_watermark/qw/main.c                 |  4 +-
 examples/quota_watermark/qw/main.h                 |  2 +-
 examples/rxtx_callbacks/main.c                     |  2 +-
 examples/server_node_efd/node/node.c               | 21 +++++-----
 examples/server_node_efd/server/init.c             | 18 +++++----
 examples/tep_termination/main.c                    |  6 +--
 examples/tep_termination/vxlan_setup.c             |  6 +--
 examples/tep_termination/vxlan_setup.h             | 10 ++---
 examples/vmdq/main.c                               |  6 +--
 examples/vmdq_dcb/main.c                           |  6 +--
 31 files changed, 219 insertions(+), 211 deletions(-)

diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index 108efc8a6..61e6e6b9e 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -212,7 +212,7 @@ lcore_rx(struct lcore_params *p)
 {
 	const uint16_t nb_ports = rte_eth_dev_count();
 	const int socket_id = rte_socket_id();
-	uint8_t port;
+	uint16_t port;
 	struct rte_mbuf *bufs[BURST_SIZE*2];
 
 	for (port = 0; port < nb_ports; port++) {
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index 252382cb5..6e30ed8db 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -47,7 +47,7 @@
 
 
 int
-rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo)
+rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)
 {
 	struct rte_eth_dev_info dev_info;
 	struct rte_dev_reg_info reg_info;
@@ -106,7 +106,7 @@ rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo)
 }
 
 int
-rte_ethtool_get_regs_len(uint8_t port_id)
+rte_ethtool_get_regs_len(uint16_t port_id)
 {
 	struct rte_dev_reg_info reg_info;
 	int ret;
@@ -121,7 +121,7 @@ rte_ethtool_get_regs_len(uint8_t port_id)
 }
 
 int
-rte_ethtool_get_regs(uint8_t port_id, struct ethtool_regs *regs, void *data)
+rte_ethtool_get_regs(uint16_t port_id, struct ethtool_regs *regs, void *data)
 {
 	struct rte_dev_reg_info reg_info;
 	int status;
@@ -141,7 +141,7 @@ rte_ethtool_get_regs(uint8_t port_id, struct ethtool_regs *regs, void *data)
 }
 
 int
-rte_ethtool_get_link(uint8_t port_id)
+rte_ethtool_get_link(uint16_t port_id)
 {
 	struct rte_eth_link link;
 
@@ -151,13 +151,13 @@ rte_ethtool_get_link(uint8_t port_id)
 }
 
 int
-rte_ethtool_get_eeprom_len(uint8_t port_id)
+rte_ethtool_get_eeprom_len(uint16_t port_id)
 {
 	return rte_eth_dev_get_eeprom_length(port_id);
 }
 
 int
-rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
+rte_ethtool_get_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom,
 	void *words)
 {
 	struct rte_dev_eeprom_info eeprom_info;
@@ -180,7 +180,7 @@ rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
 }
 
 int
-rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
+rte_ethtool_set_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom,
 	void *words)
 {
 	struct rte_dev_eeprom_info eeprom_info;
@@ -203,7 +203,7 @@ rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
 }
 
 int
-rte_ethtool_get_pauseparam(uint8_t port_id,
+rte_ethtool_get_pauseparam(uint16_t port_id,
 	struct ethtool_pauseparam *pause_param)
 {
 	struct rte_eth_fc_conf fc_conf;
@@ -238,7 +238,7 @@ rte_ethtool_get_pauseparam(uint8_t port_id,
 }
 
 int
-rte_ethtool_set_pauseparam(uint8_t port_id,
+rte_ethtool_set_pauseparam(uint16_t port_id,
 	struct ethtool_pauseparam *pause_param)
 {
 	struct rte_eth_fc_conf fc_conf;
@@ -281,7 +281,7 @@ rte_ethtool_set_pauseparam(uint8_t port_id,
 }
 
 int
-rte_ethtool_net_open(uint8_t port_id)
+rte_ethtool_net_open(uint16_t port_id)
 {
 	rte_eth_dev_stop(port_id);
 
@@ -289,7 +289,7 @@ rte_ethtool_net_open(uint8_t port_id)
 }
 
 int
-rte_ethtool_net_stop(uint8_t port_id)
+rte_ethtool_net_stop(uint16_t port_id)
 {
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	rte_eth_dev_stop(port_id);
@@ -298,7 +298,7 @@ rte_ethtool_net_stop(uint8_t port_id)
 }
 
 int
-rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr)
+rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr)
 {
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 	if (addr == NULL)
@@ -309,7 +309,7 @@ rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr)
 }
 
 int
-rte_ethtool_net_set_mac_addr(uint8_t port_id, struct ether_addr *addr)
+rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr)
 {
 	if (addr == NULL)
 		return -EINVAL;
@@ -317,7 +317,7 @@ rte_ethtool_net_set_mac_addr(uint8_t port_id, struct ether_addr *addr)
 }
 
 int
-rte_ethtool_net_validate_addr(uint8_t port_id __rte_unused,
+rte_ethtool_net_validate_addr(uint16_t port_id __rte_unused,
 	struct ether_addr *addr)
 {
 	if (addr == NULL)
@@ -326,7 +326,7 @@ rte_ethtool_net_validate_addr(uint8_t port_id __rte_unused,
 }
 
 int
-rte_ethtool_net_change_mtu(uint8_t port_id, int mtu)
+rte_ethtool_net_change_mtu(uint16_t port_id, int mtu)
 {
 	if (mtu < 0 || mtu > UINT16_MAX)
 		return -EINVAL;
@@ -334,7 +334,7 @@ rte_ethtool_net_change_mtu(uint8_t port_id, int mtu)
 }
 
 int
-rte_ethtool_net_get_stats64(uint8_t port_id, struct rte_eth_stats *stats)
+rte_ethtool_net_get_stats64(uint16_t port_id, struct rte_eth_stats *stats)
 {
 	if (stats == NULL)
 		return -EINVAL;
@@ -342,13 +342,13 @@ rte_ethtool_net_get_stats64(uint8_t port_id, struct rte_eth_stats *stats)
 }
 
 int
-rte_ethtool_net_vlan_rx_add_vid(uint8_t port_id, uint16_t vid)
+rte_ethtool_net_vlan_rx_add_vid(uint16_t port_id, uint16_t vid)
 {
 	return rte_eth_dev_vlan_filter(port_id, vid, 1);
 }
 
 int
-rte_ethtool_net_vlan_rx_kill_vid(uint8_t port_id, uint16_t vid)
+rte_ethtool_net_vlan_rx_kill_vid(uint16_t port_id, uint16_t vid)
 {
 	return rte_eth_dev_vlan_filter(port_id, vid, 0);
 }
@@ -361,7 +361,7 @@ rte_ethtool_net_vlan_rx_kill_vid(uint8_t port_id, uint16_t vid)
  * driver can register device-specific implementation
  */
 int
-rte_ethtool_net_set_rx_mode(uint8_t port_id)
+rte_ethtool_net_set_rx_mode(uint16_t port_id)
 {
 	uint16_t num_vfs;
 	struct rte_eth_dev_info dev_info;
@@ -387,7 +387,7 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
 
 
 int
-rte_ethtool_get_ringparam(uint8_t port_id,
+rte_ethtool_get_ringparam(uint16_t port_id,
 	struct ethtool_ringparam *ring_param)
 {
 	struct rte_eth_dev_info dev_info;
@@ -419,7 +419,7 @@ rte_ethtool_get_ringparam(uint8_t port_id,
 
 
 int
-rte_ethtool_set_ringparam(uint8_t port_id,
+rte_ethtool_set_ringparam(uint16_t port_id,
 	struct ethtool_ringparam *ring_param)
 {
 	struct rte_eth_rxq_info rx_qinfo;
diff --git a/examples/ethtool/lib/rte_ethtool.h b/examples/ethtool/lib/rte_ethtool.h
index 18f44404b..1cd8f4d2a 100644
--- a/examples/ethtool/lib/rte_ethtool.h
+++ b/examples/ethtool/lib/rte_ethtool.h
@@ -79,7 +79,7 @@ extern "C" {
  *   - (0) if successful.
  *   - (-ENODEV) if *port_id* invalid.
  */
-int rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo);
+int rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo);
 
 /**
  * Retrieve the Ethernet device register length in bytes.
@@ -93,7 +93,7 @@ int rte_ethtool_get_drvinfo(uint8_t port_id, struct ethtool_drvinfo *drvinfo);
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_get_regs_len(uint8_t port_id);
+int rte_ethtool_get_regs_len(uint16_t port_id);
 
 /**
  * Retrieve the Ethernet device register information according to
@@ -111,7 +111,7 @@ int rte_ethtool_get_regs_len(uint8_t port_id);
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_get_regs(uint8_t port_id, struct ethtool_regs *regs,
+int rte_ethtool_get_regs(uint16_t port_id, struct ethtool_regs *regs,
 			    void *data);
 
 /**
@@ -127,7 +127,7 @@ int rte_ethtool_get_regs(uint8_t port_id, struct ethtool_regs *regs,
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_get_link(uint8_t port_id);
+int rte_ethtool_get_link(uint16_t port_id);
 
 /**
  * Retrieve the Ethernet device EEPROM size
@@ -141,7 +141,7 @@ int rte_ethtool_get_link(uint8_t port_id);
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_get_eeprom_len(uint8_t port_id);
+int rte_ethtool_get_eeprom_len(uint16_t port_id);
 
 /**
  * Retrieve EEPROM content based upon eeprom range described in ethtool
@@ -159,7 +159,7 @@ int rte_ethtool_get_eeprom_len(uint8_t port_id);
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
+int rte_ethtool_get_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom,
 			      void *words);
 
 /**
@@ -179,7 +179,7 @@ int rte_ethtool_get_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
+int rte_ethtool_set_eeprom(uint16_t port_id, struct ethtool_eeprom *eeprom,
 			      void *words);
 
 /**
@@ -199,7 +199,7 @@ int rte_ethtool_set_eeprom(uint8_t port_id, struct ethtool_eeprom *eeprom,
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_get_pauseparam(uint8_t port_id,
+int rte_ethtool_get_pauseparam(uint16_t port_id,
 				   struct ethtool_pauseparam *pause_param);
 
 /**
@@ -217,7 +217,7 @@ int rte_ethtool_get_pauseparam(uint8_t port_id,
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_set_pauseparam(uint8_t port_id,
+int rte_ethtool_set_pauseparam(uint16_t port_id,
 				   struct ethtool_pauseparam *param);
 
 /**
@@ -231,7 +231,7 @@ int rte_ethtool_set_pauseparam(uint8_t port_id,
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_open(uint8_t port_id);
+int rte_ethtool_net_open(uint16_t port_id);
 
 /**
  * Stop the Ethernet device.
@@ -242,7 +242,7 @@ int rte_ethtool_net_open(uint8_t port_id);
  *   - (0) if successful.
  *   - (-ENODEV) if *port_id* invalid.
  */
-int rte_ethtool_net_stop(uint8_t port_id);
+int rte_ethtool_net_stop(uint16_t port_id);
 
 /**
  * Get the Ethernet device MAC address.
@@ -255,7 +255,7 @@ int rte_ethtool_net_stop(uint8_t port_id);
  *   - (0) if successful.
  *   - (-ENODEV) if *port_id* invalid.
  */
-int rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr);
+int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr);
 
 /**
  * Setting the Ethernet device MAC address.
@@ -271,7 +271,7 @@ int rte_ethtool_net_get_mac_addr(uint8_t port_id, struct ether_addr *addr);
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_set_mac_addr(uint8_t port_id, struct ether_addr *addr);
+int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr);
 
 /**
  * Validate if the provided MAC address is valid unicast address
@@ -287,7 +287,7 @@ int rte_ethtool_net_set_mac_addr(uint8_t port_id, struct ether_addr *addr);
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_validate_addr(uint8_t port_id, struct ether_addr *addr);
+int rte_ethtool_net_validate_addr(uint16_t port_id, struct ether_addr *addr);
 
 /**
  * Setting the Ethernet device maximum Tx unit.
@@ -303,7 +303,7 @@ int rte_ethtool_net_validate_addr(uint8_t port_id, struct ether_addr *addr);
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_change_mtu(uint8_t port_id, int mtu);
+int rte_ethtool_net_change_mtu(uint16_t port_id, int mtu);
 
 /**
  * Retrieve the Ethernet device traffic statistics
@@ -319,7 +319,7 @@ int rte_ethtool_net_change_mtu(uint8_t port_id, int mtu);
  *   - (-EINVAL) if parameters invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_get_stats64(uint8_t port_id, struct rte_eth_stats *stats);
+int rte_ethtool_net_get_stats64(uint16_t port_id, struct rte_eth_stats *stats);
 
 /**
  * Update the Ethernet device VLAN filter with new vid
@@ -334,7 +334,7 @@ int rte_ethtool_net_get_stats64(uint8_t port_id, struct rte_eth_stats *stats);
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_vlan_rx_add_vid(uint8_t port_id, uint16_t vid);
+int rte_ethtool_net_vlan_rx_add_vid(uint16_t port_id, uint16_t vid);
 
 /**
  * Remove VLAN id from Ethernet device.
@@ -349,7 +349,7 @@ int rte_ethtool_net_vlan_rx_add_vid(uint8_t port_id, uint16_t vid);
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_vlan_rx_kill_vid(uint8_t port_id, uint16_t vid);
+int rte_ethtool_net_vlan_rx_kill_vid(uint16_t port_id, uint16_t vid);
 
 /**
  * Setting the Ethernet device rx mode.
@@ -362,7 +362,7 @@ int rte_ethtool_net_vlan_rx_kill_vid(uint8_t port_id, uint16_t vid);
  *   - (-ENODEV) if *port_id* invalid.
  *   - others depends on the specific operations implementation.
  */
-int rte_ethtool_net_set_rx_mode(uint8_t port_id);
+int rte_ethtool_net_set_rx_mode(uint16_t port_id);
 
 /**
  * Getting ring parameters for Ethernet device.
@@ -380,7 +380,7 @@ int rte_ethtool_net_set_rx_mode(uint8_t port_id);
  *   Only the tx_pending and rx_pending fields of struct ethtool_ringparam
  *   are used, and the function only gets parameters for queue 0.
  */
-int rte_ethtool_get_ringparam(uint8_t port_id,
+int rte_ethtool_get_ringparam(uint16_t port_id,
 	struct ethtool_ringparam *ring_param);
 
 /**
@@ -399,7 +399,7 @@ int rte_ethtool_get_ringparam(uint8_t port_id,
  *   Only the tx_pending and rx_pending fields of struct ethtool_ringparam
  *   are used, and the function only sets parameters for queue 0.
  */
-int rte_ethtool_set_ringparam(uint8_t port_id,
+int rte_ethtool_set_ringparam(uint16_t port_id,
 	struct ethtool_ringparam *ring_param);
 
 
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index c85a86c10..dcd8f9bae 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -444,7 +444,7 @@ parse_args(int argc, char **argv)
 
 /* Initialise a single port on an Ethernet device */
 static void
-init_port(uint8_t port)
+init_port(uint16_t port)
 {
 	int ret;
 	uint16_t nb_rxd = NB_RXD;
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 99dc270cb..d451b3deb 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -163,12 +163,12 @@ static uint32_t single_sa;
 static uint32_t single_sa_idx;
 
 struct lcore_rx_queue {
-	uint8_t port_id;
+	uint16_t port_id;
 	uint8_t queue_id;
 } __rte_cache_aligned;
 
 struct lcore_params {
-	uint8_t port_id;
+	uint16_t port_id;
 	uint8_t queue_id;
 	uint8_t lcore_id;
 } __rte_cache_aligned;
@@ -290,7 +290,7 @@ prepare_traffic(struct rte_mbuf **pkts, struct ipsec_traffic *t,
 }
 
 static inline void
-prepare_tx_pkt(struct rte_mbuf *pkt, uint8_t port)
+prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port)
 {
 	struct ip *ip;
 	struct ether_hdr *ethhdr;
@@ -320,7 +320,7 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint8_t port)
 }
 
 static inline void
-prepare_tx_burst(struct rte_mbuf *pkts[], uint16_t nb_pkts, uint8_t port)
+prepare_tx_burst(struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t port)
 {
 	int32_t i;
 	const int32_t prefetch_offset = 2;
@@ -336,7 +336,7 @@ prepare_tx_burst(struct rte_mbuf *pkts[], uint16_t nb_pkts, uint8_t port)
 
 /* Send burst of packets on an output interface */
 static inline int32_t
-send_burst(struct lcore_conf *qconf, uint16_t n, uint8_t port)
+send_burst(struct lcore_conf *qconf, uint16_t n, uint16_t port)
 {
 	struct rte_mbuf **m_table;
 	int32_t ret;
@@ -359,7 +359,7 @@ send_burst(struct lcore_conf *qconf, uint16_t n, uint8_t port)
 
 /* Enqueue a single packet, and send burst if queue is filled */
 static inline int32_t
-send_single_packet(struct rte_mbuf *m, uint8_t port)
+send_single_packet(struct rte_mbuf *m, uint16_t port)
 {
 	uint32_t lcore_id;
 	uint16_t len;
@@ -646,7 +646,7 @@ route6_pkts(struct rt_ctx *rt_ctx, struct rte_mbuf *pkts[], uint8_t nb_pkts)
 
 static inline void
 process_pkts(struct lcore_conf *qconf, struct rte_mbuf **pkts,
-		uint8_t nb_pkts, uint8_t portid)
+		uint8_t nb_pkts, uint16_t portid)
 {
 	struct ipsec_traffic traffic;
 
@@ -691,7 +691,8 @@ main_loop(__attribute__((unused)) void *dummy)
 	uint32_t lcore_id;
 	uint64_t prev_tsc, diff_tsc, cur_tsc;
 	int32_t i, nb_rx;
-	uint8_t portid, queueid;
+	uint16_t portid;
+	uint8_t queueid;
 	struct lcore_conf *qconf;
 	int32_t socket_id;
 	const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)
@@ -728,7 +729,7 @@ main_loop(__attribute__((unused)) void *dummy)
 		portid = rxql[i].port_id;
 		queueid = rxql[i].queue_id;
 		RTE_LOG(INFO, IPSEC,
-			" -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n",
+			" -- lcoreid=%u portid=%u rxqueueid=%hhu\n",
 			lcore_id, portid, queueid);
 	}
 
@@ -759,7 +760,8 @@ main_loop(__attribute__((unused)) void *dummy)
 static int32_t
 check_params(void)
 {
-	uint8_t lcore, portid, nb_ports;
+	uint8_t lcore;
+	uint16_t portid, nb_ports;
 	uint16_t i;
 	int32_t socket_id;
 
@@ -797,7 +799,7 @@ check_params(void)
 }
 
 static uint8_t
-get_port_nb_rx_queues(const uint8_t port)
+get_port_nb_rx_queues(const uint16_t port)
 {
 	int32_t queue = -1;
 	uint16_t i;
@@ -1055,11 +1057,12 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr)
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(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, print_flag = 0;
+	uint16_t portid;
+	uint8_t count, all_ports_up, print_flag = 0;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status");
@@ -1074,14 +1077,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", (uint8_t)portid,
-						(uint32_t)link.link_speed,
+					printf(
+					"Port%d Link Up - speed %u Mbps -%s\n",
+						portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
-					printf("Port %d Link Down\n",
-						(uint8_t)portid);
+					printf("Port %d Link Down\n", portid);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
@@ -1322,7 +1324,7 @@ cryptodevs_init(void)
 }
 
 static void
-port_init(uint8_t portid)
+port_init(uint16_t portid)
 {
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_txconf *txconf;
@@ -1438,8 +1440,9 @@ int32_t
 main(int32_t argc, char **argv)
 {
 	int32_t ret;
-	uint32_t lcore_id, nb_ports;
-	uint8_t portid, socket_id;
+	uint32_t lcore_id;
+	uint8_t socket_id;
+	uint16_t portid, nb_ports;
 
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
@@ -1522,7 +1525,7 @@ main(int32_t argc, char **argv)
 			rte_eth_promiscuous_enable(portid);
 	}
 
-	check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask);
+	check_all_ports_link_status(nb_ports, enabled_port_mask);
 
 	/* launch per-lcore init on every lcore */
 	rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
diff --git a/examples/kni/main.c b/examples/kni/main.c
index 6d9e4a679..edf3fb1b0 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -603,7 +603,7 @@ init_kni(void)
 
 /* Initialise a single port on an Ethernet device */
 static void
-init_port(uint8_t port)
+init_port(uint16_t port)
 {
 	int ret;
 	uint16_t nb_rxd = NB_RXD;
@@ -645,11 +645,12 @@ init_port(uint8_t port)
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(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, print_flag = 0;
+	uint16_t portid;
+	uint8_t count, all_ports_up, print_flag = 0;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status\n");
@@ -664,14 +665,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", (uint8_t)portid,
-						(unsigned)link.link_speed,
+					printf(
+					"Port%d Link Up - speed %uMbps - %s\n",
+						portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
-					printf("Port %d Link Down\n",
-						(uint8_t)portid);
+					printf("Port %d Link Down\n", portid);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 5aa71c877..7dfcba421 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -577,7 +577,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 /* Send the burst of packets on an output interface */
 static int
 l2fwd_send_burst(struct lcore_queue_conf *qconf, unsigned n,
-		uint8_t port)
+		uint16_t port)
 {
 	struct rte_mbuf **pkt_buffer;
 	unsigned ret;
@@ -598,7 +598,7 @@ l2fwd_send_burst(struct lcore_queue_conf *qconf, unsigned n,
 
 /* Enqueue packets for TX and prepare them to be sent */
 static int
-l2fwd_send_packet(struct rte_mbuf *m, uint8_t port)
+l2fwd_send_packet(struct rte_mbuf *m, uint16_t port)
 {
 	unsigned lcore_id, len;
 	struct lcore_queue_conf *qconf;
@@ -1754,11 +1754,12 @@ l2fwd_crypto_parse_args(struct l2fwd_crypto_options *options,
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(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, print_flag = 0;
+	uint16_t portid;
+	uint8_t count, all_ports_up, print_flag = 0;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status");
@@ -1773,14 +1774,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", (uint8_t)portid,
-						(unsigned)link.link_speed,
+					printf(
+					"Port%d Link Up. Speed %u Mbps - %s\n",
+						portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
-					printf("Port %d Link Down\n",
-						(uint8_t)portid);
+					printf("Port %d Link Down\n", portid);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index 9511156d8..dfa3c8bc2 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -176,7 +176,7 @@ show_lcore_stats(unsigned lcore_id)
 	uint64_t busy, busy_min, busy_max;
 
 	/* Jobs statistics. */
-	const uint8_t port_cnt = qconf->n_rx_port;
+	const uint16_t port_cnt = qconf->n_rx_port;
 	uint64_t jobs_exec_cnt[port_cnt], jobs_period[port_cnt];
 	uint64_t jobs_exec[port_cnt], jobs_exec_min[port_cnt],
 				jobs_exec_max[port_cnt];
@@ -414,11 +414,11 @@ l2fwd_fwd_job(__rte_unused struct rte_timer *timer, void *arg)
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
 	struct rte_mbuf *m;
 
-	const uint8_t port_idx = (uintptr_t) arg;
+	const uint16_t port_idx = (uintptr_t) arg;
 	const unsigned lcore_id = rte_lcore_id();
 	struct lcore_queue_conf *qconf = &lcore_queue_conf[lcore_id];
 	struct rte_jobstats *job = &qconf->port_fwd_jobs[port_idx];
-	const uint8_t portid = qconf->rx_port_list[port_idx];
+	const uint16_t portid = qconf->rx_port_list[port_idx];
 
 	uint8_t j;
 	uint16_t total_nb_rx;
@@ -428,7 +428,7 @@ l2fwd_fwd_job(__rte_unused struct rte_timer *timer, void *arg)
 	/* Call rx burst 2 times. This allow rte_jobstats logic to see if this
 	 * function must be called more frequently. */
 
-	total_nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, pkts_burst,
+	total_nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst,
 			MAX_PKT_BURST);
 
 	for (j = 0; j < total_nb_rx; j++) {
@@ -438,7 +438,7 @@ l2fwd_fwd_job(__rte_unused struct rte_timer *timer, void *arg)
 	}
 
 	if (total_nb_rx == MAX_PKT_BURST) {
-		const uint16_t nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, pkts_burst,
+		const uint16_t nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst,
 				MAX_PKT_BURST);
 
 		total_nb_rx += nb_rx;
@@ -464,7 +464,7 @@ l2fwd_flush_job(__rte_unused struct rte_timer *timer, __rte_unused void *arg)
 	uint64_t now;
 	unsigned lcore_id;
 	struct lcore_queue_conf *qconf;
-	uint8_t portid;
+	uint16_t portid;
 	unsigned i;
 	uint32_t sent;
 	struct rte_eth_dev_tx_buffer *buffer;
@@ -714,11 +714,12 @@ l2fwd_parse_args(int argc, char **argv)
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(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, print_flag = 0;
+	uint16_t portid;
+	uint8_t count, all_ports_up, print_flag = 0;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status");
@@ -733,14 +734,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", (uint8_t)portid,
-						(unsigned)link.link_speed,
+					printf(
+					"Port%d Link Up. Speed %u Mbps - %s\n",
+						portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
-					printf("Port %d Link Down\n",
-						(uint8_t)portid);
+					printf("Port %d Link Down\n", portid);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 77f83cd6d..a7f9fffe8 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -184,7 +184,7 @@ static inline int
 is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len);
 #endif
 static inline void
-send_single_packet(struct rte_mbuf *m, uint8_t port);
+send_single_packet(struct rte_mbuf *m, uint16_t port);
 
 #define MAX_ACL_RULE_NUM	100000
 #define DEFAULT_MAX_CATEGORIES	1
@@ -1297,7 +1297,7 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE];
 
 /* Enqueue a single packet, and send burst if queue is filled */
 static inline void
-send_single_packet(struct rte_mbuf *m, uint8_t port)
+send_single_packet(struct rte_mbuf *m, uint16_t port)
 {
 	uint32_t lcore_id;
 	struct lcore_conf *qconf;
@@ -1501,7 +1501,7 @@ check_port_config(const unsigned nb_ports)
 }
 
 static uint8_t
-get_port_n_rx_queues(const uint8_t port)
+get_port_n_rx_queues(const uint16_t port)
 {
 	int queue = -1;
 	uint16_t i;
@@ -1830,11 +1830,12 @@ init_mem(unsigned nb_mbuf)
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(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, print_flag = 0;
+	uint16_t portid;
+	uint8_t count, all_ports_up, print_flag = 0;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status");
@@ -1849,14 +1850,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", (uint8_t)portid,
-						(unsigned)link.link_speed,
+					printf(
+					"Port%d Link Up. Speed %u Mbps %s\n",
+						portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
-					printf("Port %d Link Down\n",
-						(uint8_t)portid);
+					printf("Port %d Link Down\n", portid);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
@@ -1894,7 +1894,8 @@ main(int argc, char **argv)
 	uint16_t queueid;
 	unsigned lcore_id;
 	uint32_t n_tx_queue, nb_lcores;
-	uint8_t portid, nb_rx_queue, queue, socketid;
+	uint16_t portid;
+	uint8_t nb_rx_queue, queue, socketid;
 
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 8a8f34b50..a505e9109 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -451,7 +451,7 @@ power_timer_cb(__attribute__((unused)) struct rte_timer *tim,
 
 /* Enqueue a single packet, and send burst if queue is filled */
 static inline int
-send_single_packet(struct rte_mbuf *m, uint8_t port)
+send_single_packet(struct rte_mbuf *m, uint16_t port)
 {
 	uint32_t lcore_id;
 	struct lcore_conf *qconf;
@@ -659,7 +659,7 @@ add_cb_parse_ptype(uint16_t portid, uint16_t queueid)
 }
 
 static inline void
-l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid,
+l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
 				struct lcore_conf *qconf)
 {
 	struct ether_hdr *eth_hdr;
@@ -1115,7 +1115,7 @@ check_port_config(const unsigned nb_ports)
 }
 
 static uint8_t
-get_port_n_rx_queues(const uint8_t port)
+get_port_n_rx_queues(const uint16_t port)
 {
 	int queue = -1;
 	uint16_t i;
@@ -1599,7 +1599,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
 	}
 }
 
-static int check_ptype(uint8_t portid)
+static int check_ptype(uint16_t portid)
 {
 	int i, ret;
 	int ptype_l3_ipv4 = 0;
@@ -1650,7 +1650,7 @@ main(int argc, char **argv)
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_txconf *txconf;
 	int ret;
-	unsigned nb_ports;
+	uint16_t nb_ports;
 	uint16_t queueid;
 	unsigned lcore_id;
 	uint64_t hz;
@@ -1877,7 +1877,7 @@ main(int argc, char **argv)
 		rte_spinlock_init(&(locks[portid]));
 	}
 
-	check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask);
+	check_all_ports_link_status(nb_ports, enabled_port_mask);
 
 	/* launch per-lcore init on every lcore */
 	rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index df38a1362..2b7c173b1 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -274,8 +274,8 @@ em_mask_key(void *key, xmm_t mask)
 #error No vector engine (SSE, NEON, ALTIVEC) available, check your toolchain
 #endif
 
-static inline uint8_t
-em_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct)
+static inline uint16_t
+em_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct)
 {
 	int ret = 0;
 	union ipv4_5tuple_host key;
@@ -292,11 +292,11 @@ em_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct)
 
 	/* Find destination port */
 	ret = rte_hash_lookup(ipv4_l3fwd_lookup_struct, (const void *)&key);
-	return (uint8_t)((ret < 0) ? portid : ipv4_l3fwd_out_if[ret]);
+	return (ret < 0) ? portid : ipv4_l3fwd_out_if[ret];
 }
 
-static inline uint8_t
-em_get_ipv6_dst_port(void *ipv6_hdr,  uint8_t portid, void *lookup_struct)
+static inline uint16_t
+em_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct)
 {
 	int ret = 0;
 	union ipv6_5tuple_host key;
@@ -325,7 +325,7 @@ em_get_ipv6_dst_port(void *ipv6_hdr,  uint8_t portid, void *lookup_struct)
 
 	/* Find destination port */
 	ret = rte_hash_lookup(ipv6_l3fwd_lookup_struct, (const void *)&key);
-	return (uint8_t)((ret < 0) ? portid : ipv6_l3fwd_out_if[ret]);
+	return (ret < 0) ? portid : ipv6_l3fwd_out_if[ret];
 }
 
 #if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON
@@ -649,7 +649,8 @@ em_main_loop(__attribute__((unused)) void *dummy)
 	unsigned lcore_id;
 	uint64_t prev_tsc, diff_tsc, cur_tsc;
 	int i, nb_rx;
-	uint8_t portid, queueid;
+	uint8_t queueid;
+	uint16_t portid;
 	struct lcore_conf *qconf;
 	const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) /
 		US_PER_S * BURST_TX_DRAIN_US;
@@ -671,7 +672,7 @@ em_main_loop(__attribute__((unused)) void *dummy)
 		portid = qconf->rx_queue_list[i].port_id;
 		queueid = qconf->rx_queue_list[i].queue_id;
 		RTE_LOG(INFO, L3FWD,
-			" -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n",
+			" -- lcoreid=%u portid=%u rxqueueid=%hhu\n",
 			lcore_id, portid, queueid);
 	}
 
diff --git a/examples/l3fwd/l3fwd_em_sequential.h b/examples/l3fwd/l3fwd_em_sequential.h
index cb7c2abbb..fa89f0f35 100644
--- a/examples/l3fwd/l3fwd_em_sequential.h
+++ b/examples/l3fwd/l3fwd_em_sequential.h
@@ -51,7 +51,7 @@
 
 static __rte_always_inline uint16_t
 em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
-		uint8_t portid)
+		uint16_t portid)
 {
 	uint8_t next_hop;
 	struct ipv4_hdr *ipv4_hdr;
@@ -103,7 +103,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
  */
 static inline void
 l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
-			uint8_t portid, struct lcore_conf *qconf)
+			uint16_t portid, struct lcore_conf *qconf)
 {
 	int32_t i, j;
 	uint16_t dst_port[MAX_PKT_BURST];
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index c83a62fa4..9d562f852 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -494,7 +494,7 @@ lsi_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param,
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
 {
 #define CHECK_INTERVAL 100 /* 100ms */
 #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -514,14 +514,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", (uint8_t)portid,
-						(unsigned)link.link_speed,
+					printf(
+					"Port%d Link Up. Speed %u Mbps - %s\n",
+						portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
-					printf("Port %d Link Down\n",
-							(uint8_t)portid);
+					printf("Port %d Link Down\n", portid);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
@@ -554,8 +553,8 @@ main(int argc, char **argv)
 	struct lcore_queue_conf *qconf;
 	struct rte_eth_dev_info dev_info;
 	int ret;
-	uint8_t nb_ports;
-	uint8_t portid, portid_last = 0;
+	uint16_t nb_ports;
+	uint16_t portid, portid_last = 0;
 	unsigned lcore_id, rx_lcore_id;
 	unsigned nb_ports_in_mask = 0;
 
diff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c
index 59f36af08..44085429a 100644
--- a/examples/multi_process/client_server_mp/mp_client/client.c
+++ b/examples/multi_process/client_server_mp/mp_client/client.c
@@ -216,8 +216,8 @@ static void
 handle_packet(struct rte_mbuf *buf)
 {
 	int sent;
-	const uint8_t in_port = buf->port;
-	const uint8_t out_port = output_ports[in_port];
+	const uint16_t in_port = buf->port;
+	const uint16_t out_port = output_ports[in_port];
 	struct rte_eth_dev_tx_buffer *buffer = tx_buffer[out_port];
 
 	sent = rte_eth_tx_buffer(out_port, client_id, buffer, buf);
@@ -276,7 +276,7 @@ main(int argc, char *argv[])
 
 	for (;;) {
 		uint16_t i, rx_pkts;
-		uint8_t port;
+		uint16_t port;
 
 		rx_pkts = rte_ring_dequeue_burst(rx_ring, pkts,
 				PKT_READ_SIZE, NULL);
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 0f497910a..7d1d274d0 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -102,7 +102,7 @@ struct port_stats{
 static int proc_id = -1;
 static unsigned num_procs = 0;
 
-static uint8_t ports[RTE_MAX_ETHPORTS];
+static uint16_t ports[RTE_MAX_ETHPORTS];
 static unsigned num_ports = 0;
 
 static struct lcore_ports lcore_ports[RTE_MAX_LCORE];
@@ -202,7 +202,8 @@ smp_parse_args(int argc, char **argv)
  * coming from the mbuf_pool passed as parameter
  */
 static inline int
-smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues)
+smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
+	       uint16_t num_queues)
 {
 	struct rte_eth_conf port_conf = {
 			.rxmode = {
@@ -237,7 +238,7 @@ smp_port_init(uint8_t port, struct rte_mempool *mbuf_pool, uint16_t num_queues)
 	if (port >= rte_eth_dev_count())
 		return -1;
 
-	printf("# Initialising port %u... ", (unsigned)port);
+	printf("# Initialising port %u... ", port);
 	fflush(stdout);
 
 	rte_eth_dev_info_get(port, &info);
@@ -362,11 +363,12 @@ lcore_main(void *arg __rte_unused)
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(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, print_flag = 0;
+	uint16_t portid;
+	uint8_t count, all_ports_up, print_flag = 0;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status");
@@ -381,14 +383,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", (uint8_t)portid,
-						(unsigned)link.link_speed,
+					printf(
+					"Port%d Link Up. Speed %u Mbps - %s\n",
+						portid, link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
-					printf("Port %d Link Down\n",
-							(uint8_t)portid);
+					printf("Port %d Link Down\n", portid);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 9a1eef61a..0eb2ed9f2 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -2037,7 +2037,7 @@ static void
 lthread_tx_per_ring(void *dummy)
 {
 	int nb_rx;
-	uint8_t portid;
+	uint16_t portid;
 	struct rte_ring *ring;
 	struct thread_tx_conf *tx_conf;
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
@@ -2544,7 +2544,7 @@ check_port_config(const unsigned nb_ports)
 }
 
 static uint8_t
-get_port_n_rx_queues(const uint8_t port)
+get_port_n_rx_queues(const uint16_t port)
 {
 	int queue = -1;
 	uint16_t i;
@@ -3441,7 +3441,7 @@ init_mem(unsigned nb_mbuf)
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
 {
 #define CHECK_INTERVAL 100 /* 100ms */
 #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index c495e7508..c53dad68b 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -202,7 +202,7 @@ ns_to_timeval(int64_t nsec)
  * coming from the mbuf_pool passed as a parameter.
  */
 static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 {
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_conf port_conf = port_conf_default;
@@ -555,7 +555,7 @@ parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data)
  * functionality.
  */
 static void
-parse_ptp_frames(uint8_t portid, struct rte_mbuf *m) {
+parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) {
 	struct ptp_header *ptp_hdr;
 	struct ether_hdr *eth_hdr;
 	uint16_t eth_type;
@@ -593,7 +593,7 @@ parse_ptp_frames(uint8_t portid, struct rte_mbuf *m) {
 static __attribute__((noreturn)) void
 lcore_main(void)
 {
-	uint8_t portid;
+	uint16_t portid;
 	unsigned nb_rx;
 	struct rte_mbuf *m;
 
@@ -728,7 +728,7 @@ main(int argc, char *argv[])
 {
 	unsigned nb_ports;
 
-	uint8_t portid;
+	uint16_t portid;
 
 	/* Initialize the Environment Abstraction Layer (EAL). */
 	int ret = rte_eal_init(argc, argv);
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index b0909f6a3..67b4a75b9 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -116,8 +116,8 @@ static struct rte_eth_conf port_conf = {
 #define PKT_TX_BURST_MAX                32
 #define TIME_TX_DRAIN                   200000ULL
 
-static uint8_t port_rx;
-static uint8_t port_tx;
+static uint16_t port_rx;
+static uint16_t port_tx;
 static struct rte_mbuf *pkts_rx[PKT_RX_BURST_MAX];
 struct rte_eth_dev_tx_buffer *tx_buffer;
 
diff --git a/examples/qos_sched/cmdline.c b/examples/qos_sched/cmdline.c
index f79d52460..b62d165bd 100644
--- a/examples/qos_sched/cmdline.c
+++ b/examples/qos_sched/cmdline.c
@@ -191,7 +191,7 @@ cmdline_parse_inst_t cmd_appstats = {
 struct cmd_subportstats_result {
         cmdline_fixed_string_t stats_string;
         cmdline_fixed_string_t port_string;
-	uint8_t port_number;
+	uint16_t port_number;
         cmdline_fixed_string_t subport_string;
         uint32_t subport_number;
 };
@@ -220,7 +220,7 @@ cmdline_parse_token_num_t cmd_subportstats_subport_number =
                                 UINT32);
 cmdline_parse_token_num_t cmd_subportstats_port_number =
         TOKEN_NUM_INITIALIZER(struct cmd_subportstats_result, port_number,
-                                UINT8);
+			       UINT16);
 
 cmdline_parse_inst_t cmd_subportstats = {
         .f = cmd_subportstats_parsed,
@@ -240,7 +240,7 @@ cmdline_parse_inst_t cmd_subportstats = {
 struct cmd_pipestats_result {
         cmdline_fixed_string_t stats_string;
         cmdline_fixed_string_t port_string;
-        uint8_t port_number;
+	uint16_t port_number;
         cmdline_fixed_string_t subport_string;
         uint32_t subport_number;
         cmdline_fixed_string_t pipe_string;
@@ -265,7 +265,7 @@ cmdline_parse_token_string_t cmd_pipestats_port_string =
                                 "port");
 cmdline_parse_token_num_t cmd_pipestats_port_number =
         TOKEN_NUM_INITIALIZER(struct cmd_pipestats_result, port_number,
-                                UINT8);
+			       UINT16);
 cmdline_parse_token_string_t cmd_pipestats_subport_string =
         TOKEN_STRING_INITIALIZER(struct cmd_pipestats_result, subport_string,
                                 "subport");
@@ -299,7 +299,7 @@ cmdline_parse_inst_t cmd_pipestats = {
 struct cmd_avg_q_result {
         cmdline_fixed_string_t qavg_string;
         cmdline_fixed_string_t port_string;
-        uint8_t port_number;
+	uint16_t port_number;
         cmdline_fixed_string_t subport_string;
         uint32_t subport_number;
         cmdline_fixed_string_t pipe_string;
@@ -327,8 +327,8 @@ cmdline_parse_token_string_t cmd_avg_q_port_string =
         TOKEN_STRING_INITIALIZER(struct cmd_avg_q_result, port_string,
                                 "port");
 cmdline_parse_token_num_t cmd_avg_q_port_number =
-        TOKEN_NUM_INITIALIZER(struct cmd_avg_q_result, port_number,
-                                UINT8);
+	TOKEN_NUM_INITIALIZER(struct cmd_avg_q_result, port_number,
+			       UINT16);
 cmdline_parse_token_string_t cmd_avg_q_subport_string =
         TOKEN_STRING_INITIALIZER(struct cmd_avg_q_result, subport_string,
                                 "subport");
@@ -378,7 +378,7 @@ cmdline_parse_inst_t cmd_avg_q = {
 struct cmd_avg_tcpipe_result {
         cmdline_fixed_string_t qavg_string;
         cmdline_fixed_string_t port_string;
-        uint8_t port_number;
+	uint16_t port_number;
         cmdline_fixed_string_t subport_string;
         uint32_t subport_number;
         cmdline_fixed_string_t pipe_string;
@@ -405,7 +405,7 @@ cmdline_parse_token_string_t cmd_avg_tcpipe_port_string =
                                 "port");
 cmdline_parse_token_num_t cmd_avg_tcpipe_port_number =
         TOKEN_NUM_INITIALIZER(struct cmd_avg_tcpipe_result, port_number,
-                                UINT8);
+			       UINT16);
 cmdline_parse_token_string_t cmd_avg_tcpipe_subport_string =
         TOKEN_STRING_INITIALIZER(struct cmd_avg_tcpipe_result, subport_string,
                                 "subport");
@@ -447,7 +447,7 @@ cmdline_parse_inst_t cmd_avg_tcpipe = {
 struct cmd_avg_pipe_result {
         cmdline_fixed_string_t qavg_string;
         cmdline_fixed_string_t port_string;
-        uint8_t port_number;
+	uint16_t port_number;
         cmdline_fixed_string_t subport_string;
         uint32_t subport_number;
         cmdline_fixed_string_t pipe_string;
@@ -472,7 +472,7 @@ cmdline_parse_token_string_t cmd_avg_pipe_port_string =
                                 "port");
 cmdline_parse_token_num_t cmd_avg_pipe_port_number =
         TOKEN_NUM_INITIALIZER(struct cmd_avg_pipe_result, port_number,
-                                UINT8);
+			       UINT16);
 cmdline_parse_token_string_t cmd_avg_pipe_subport_string =
         TOKEN_STRING_INITIALIZER(struct cmd_avg_pipe_result, subport_string,
                                 "subport");
@@ -506,7 +506,7 @@ cmdline_parse_inst_t cmd_avg_pipe = {
 struct cmd_avg_tcsubport_result {
         cmdline_fixed_string_t qavg_string;
         cmdline_fixed_string_t port_string;
-        uint8_t port_number;
+	uint16_t port_number;
         cmdline_fixed_string_t subport_string;
         uint32_t subport_number;
         cmdline_fixed_string_t tc_string;
@@ -531,7 +531,7 @@ cmdline_parse_token_string_t cmd_avg_tcsubport_port_string =
                                 "port");
 cmdline_parse_token_num_t cmd_avg_tcsubport_port_number =
         TOKEN_NUM_INITIALIZER(struct cmd_avg_tcsubport_result, port_number,
-                                UINT8);
+			       UINT16);
 cmdline_parse_token_string_t cmd_avg_tcsubport_subport_string =
         TOKEN_STRING_INITIALIZER(struct cmd_avg_tcsubport_result, subport_string,
                                 "subport");
@@ -565,7 +565,7 @@ cmdline_parse_inst_t cmd_avg_tcsubport = {
 struct cmd_avg_subport_result {
         cmdline_fixed_string_t qavg_string;
         cmdline_fixed_string_t port_string;
-        uint8_t port_number;
+	uint16_t port_number;
         cmdline_fixed_string_t subport_string;
         uint32_t subport_number;
 };
@@ -588,7 +588,7 @@ cmdline_parse_token_string_t cmd_avg_subport_port_string =
                                 "port");
 cmdline_parse_token_num_t cmd_avg_subport_port_number =
         TOKEN_NUM_INITIALIZER(struct cmd_avg_subport_result, port_number,
-                                UINT8);
+			       UINT16);
 cmdline_parse_token_string_t cmd_avg_subport_subport_string =
         TOKEN_STRING_INITIALIZER(struct cmd_avg_subport_result, subport_string,
                                 "subport");
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index 415b68bb9..37b03626d 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -73,7 +73,7 @@ static struct rte_eth_fc_conf fc_conf = {
 };
 
 
-void configure_eth_port(uint8_t port_id)
+void configure_eth_port(uint16_t port_id)
 {
 	int ret;
 	uint16_t nb_rxd = RX_DESC_PER_QUEUE;
@@ -135,7 +135,7 @@ init_dpdk(void)
 		rte_exit(EXIT_FAILURE, "Not enough ethernet port available\n");
 }
 
-void init_ring(int lcore_id, uint8_t port_id)
+void init_ring(int lcore_id, uint16_t port_id)
 {
 	struct rte_ring *ring;
 	char ring_name[RTE_RING_NAMESIZE];
diff --git a/examples/quota_watermark/qw/init.h b/examples/quota_watermark/qw/init.h
index 6d0af3abd..2bfec2b10 100644
--- a/examples/quota_watermark/qw/init.h
+++ b/examples/quota_watermark/qw/init.h
@@ -34,9 +34,9 @@
 #ifndef _INIT_H_
 #define _INIT_H_
 
-void configure_eth_port(uint8_t port_id);
+void configure_eth_port(uint16_t port_id);
 void init_dpdk(void);
-void init_ring(int lcore_id, uint8_t port_id);
+void init_ring(int lcore_id, uint16_t port_id);
 void pair_ports(void);
 void setup_shared_variables(void);
 
diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c
index e5ecdb1cf..fe1745262 100644
--- a/examples/quota_watermark/qw/main.c
+++ b/examples/quota_watermark/qw/main.c
@@ -69,13 +69,13 @@ int *quota;
 unsigned int *low_watermark;
 unsigned int *high_watermark;
 
-uint8_t port_pairs[RTE_MAX_ETHPORTS];
+uint16_t port_pairs[RTE_MAX_ETHPORTS];
 
 struct rte_ring *rings[RTE_MAX_LCORE][RTE_MAX_ETHPORTS];
 struct rte_mempool *mbuf_pool;
 
 
-static void send_pause_frame(uint8_t port_id, uint16_t duration)
+static void send_pause_frame(uint16_t port_id, uint16_t duration)
 {
 	struct rte_mbuf *mbuf;
 	struct ether_fc_frame *pause_frame;
diff --git a/examples/quota_watermark/qw/main.h b/examples/quota_watermark/qw/main.h
index 8c8e3116d..ebed7b2f9 100644
--- a/examples/quota_watermark/qw/main.h
+++ b/examples/quota_watermark/qw/main.h
@@ -45,7 +45,7 @@ extern int *quota;
 extern unsigned int *low_watermark;
 extern unsigned int *high_watermark;
 
-extern uint8_t port_pairs[RTE_MAX_ETHPORTS];
+extern uint16_t port_pairs[RTE_MAX_ETHPORTS];
 
 extern struct rte_ring *rings[RTE_MAX_LCORE][RTE_MAX_ETHPORTS];
 extern struct rte_mempool *mbuf_pool;
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index e66f16f25..ca135d219 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -159,7 +159,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 static  __attribute__((noreturn)) void
 lcore_main(void)
 {
-	uint8_t port;
+	uint16_t port;
 
 	for (port = 0; port < nb_ports; port++)
 		if (rte_eth_dev_socket_id(port) > 0 &&
diff --git a/examples/server_node_efd/node/node.c b/examples/server_node_efd/node/node.c
index 86e57c890..c8ce391f1 100644
--- a/examples/server_node_efd/node/node.c
+++ b/examples/server_node_efd/node/node.c
@@ -77,7 +77,7 @@ static uint8_t node_id;
 #define MBQ_CAPACITY 32
 
 /* maps input ports to output ports for packets */
-static uint8_t output_ports[RTE_MAX_ETHPORTS];
+static uint16_t output_ports[RTE_MAX_ETHPORTS];
 
 /* buffers up a set of packet that are ready to send */
 struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
@@ -154,7 +154,7 @@ static void
 flush_tx_error_callback(struct rte_mbuf **unsent, uint16_t count,
 		void *userdata) {
 	int i;
-	uint8_t port_id = (uintptr_t)userdata;
+	uint16_t port_id = (uintptr_t)userdata;
 
 	tx_stats->tx_drop[port_id] += count;
 
@@ -165,7 +165,7 @@ flush_tx_error_callback(struct rte_mbuf **unsent, uint16_t count,
 }
 
 static void
-configure_tx_buffer(uint8_t port_id, uint16_t size)
+configure_tx_buffer(uint16_t port_id, uint16_t size)
 {
 	int ret;
 
@@ -174,16 +174,17 @@ configure_tx_buffer(uint8_t port_id, uint16_t size)
 			RTE_ETH_TX_BUFFER_SIZE(size), 0,
 			rte_eth_dev_socket_id(port_id));
 	if (tx_buffer[port_id] == NULL)
-		rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx "
-				"on port %u\n", (unsigned int) port_id);
+		rte_exit(EXIT_FAILURE,
+			"Cannot allocate buffer for tx on port %u\n", port_id);
 
 	rte_eth_tx_buffer_init(tx_buffer[port_id], size);
 
 	ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id],
 			flush_tx_error_callback, (void *)(intptr_t)port_id);
 	if (ret < 0)
-		rte_exit(EXIT_FAILURE, "Cannot set error callback for "
-			"tx buffer on port %u\n", (unsigned int) port_id);
+		rte_exit(EXIT_FAILURE,
+			"Cannot set error callback for tx buffer on port %u\n",
+			port_id);
 }
 
 /*
@@ -282,8 +283,8 @@ static inline void
 transmit_packet(struct rte_mbuf *buf)
 {
 	int sent;
-	const uint8_t in_port = buf->port;
-	const uint8_t out_port = output_ports[in_port];
+	const uint16_t in_port = buf->port;
+	const uint16_t out_port = output_ports[in_port];
 	struct rte_eth_dev_tx_buffer *buffer = tx_buffer[out_port];
 
 	sent = rte_eth_tx_buffer(out_port, node_id, buffer, buf);
@@ -381,7 +382,7 @@ main(int argc, char *argv[])
 
 	for (;;) {
 		uint16_t  rx_pkts = PKT_READ_SIZE;
-		uint8_t port;
+		uint16_t port;
 
 		/*
 		 * Try dequeuing max possible packets first, if that fails,
diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index d114e5bf0..9509e7145 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -121,7 +121,7 @@ init_mbuf_pools(void)
  * - start the port and report its status to stdout
  */
 static int
-init_port(uint8_t port_num)
+init_port(uint16_t port_num)
 {
 	/* for port configuration all features are off by default */
 	const struct rte_eth_conf port_conf = {
@@ -136,7 +136,7 @@ init_port(uint8_t port_num)
 	uint16_t q;
 	int retval;
 
-	printf("Port %u init ... ", (unsigned int)port_num);
+	printf("Port %u init ... ", port_num);
 	fflush(stdout);
 
 	/*
@@ -255,11 +255,12 @@ populate_efd_table(void)
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(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, print_flag = 0;
+	uint8_t count, all_ports_up, print_flag = 0;
+	uint16_t portid;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status");
@@ -274,14 +275,15 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
 			/* print link status if flag set */
 			if (print_flag == 1) {
 				if (link.link_status)
-					printf("Port %d Link Up - speed %u "
-						"Mbps - %s\n", info->id[portid],
-						(unsigned int)link.link_speed,
+					printf(
+					"Port%d Link Up. Speed %u Mbps - %s\n",
+						info->id[portid],
+						link.link_speed,
 				(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
 					("full-duplex") : ("half-duplex\n"));
 				else
 					printf("Port %d Link Down\n",
-						(uint8_t)info->id[portid]);
+						info->id[portid]);
 				continue;
 			}
 			/* clear all_ports_up flag if any link down */
diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c
index aee36c6e4..a14d2e379 100644
--- a/examples/tep_termination/main.c
+++ b/examples/tep_termination/main.c
@@ -98,7 +98,7 @@
 #define MBUF_HEADROOM_UINT32(mbuf) (*(uint32_t *)((uint8_t *)(mbuf) \
 		+ sizeof(struct rte_mbuf)))
 
-#define INVALID_PORT_ID 0xFF
+#define INVALID_PORT_ID 0xFFFF
 
 /* Size of buffers used for snprintfs. */
 #define MAX_PRINT_BUFF 6072
@@ -184,7 +184,7 @@ static uint32_t burst_rx_retry_num = BURST_RX_RETRIES;
 static char dev_basename[MAX_BASENAME_SZ] = "vhost-net";
 
 static unsigned lcore_ids[RTE_MAX_LCORE];
-uint8_t ports[RTE_MAX_ETHPORTS];
+uint16_t ports[RTE_MAX_ETHPORTS];
 
 static unsigned nb_ports; /**< The number of ports specified in command line */
 
@@ -1161,7 +1161,7 @@ main(int argc, char *argv[])
 	unsigned lcore_id, core_id = 0;
 	unsigned nb_ports, valid_nb_ports;
 	int ret;
-	uint8_t portid;
+	uint16_t portid;
 	uint16_t queue_id;
 	static pthread_t tid;
 	char thread_name[RTE_MAX_THREAD_NAME_LEN];
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 050bb32d3..1ad4ca3cd 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -129,7 +129,7 @@ const uint16_t tenant_id_conf[] = {
  * coming from the mbuf_pool passed as parameter
  */
 int
-vxlan_port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 {
 	int retval;
 	uint16_t q;
@@ -202,7 +202,7 @@ vxlan_port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	rte_eth_macaddr_get(port, &ports_eth_addr[port]);
 	RTE_LOG(INFO, PORT, "Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
 			" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
-			(unsigned)port,
+			port,
 			ports_eth_addr[port].addr_bytes[0],
 			ports_eth_addr[port].addr_bytes[1],
 			ports_eth_addr[port].addr_bytes[2],
@@ -414,7 +414,7 @@ vxlan_unlink(struct vhost_dev *vdev)
 
 /* Transmit packets after encapsulating */
 int
-vxlan_tx_pkts(uint8_t port_id, uint16_t queue_id,
+vxlan_tx_pkts(uint16_t port_id, uint16_t queue_id,
 		struct rte_mbuf **tx_pkts, uint16_t nb_pkts) {
 	int ret = 0;
 	uint16_t i;
diff --git a/examples/tep_termination/vxlan_setup.h b/examples/tep_termination/vxlan_setup.h
index 8d2646195..2e3550d38 100644
--- a/examples/tep_termination/vxlan_setup.h
+++ b/examples/tep_termination/vxlan_setup.h
@@ -37,14 +37,14 @@
 extern uint16_t nb_devices;
 extern uint16_t udp_port;
 extern uint8_t filter_idx;
-extern uint8_t ports[RTE_MAX_ETHPORTS];
+extern uint16_t ports[RTE_MAX_ETHPORTS];
 extern struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
 extern uint32_t enable_stats;
 extern struct device_statistics dev_statistics[MAX_DEVICES];
 extern uint8_t rx_decap;
 extern uint8_t tx_encap;
 
-typedef int (*ol_port_configure_t)(uint8_t port,
+typedef int (*ol_port_configure_t)(uint16_t port,
 				   struct rte_mempool *mbuf_pool);
 
 typedef int (*ol_tunnel_setup_t)(struct vhost_dev *vdev,
@@ -52,7 +52,7 @@ typedef int (*ol_tunnel_setup_t)(struct vhost_dev *vdev,
 
 typedef void (*ol_tunnel_destroy_t)(struct vhost_dev *vdev);
 
-typedef int (*ol_tx_handle_t)(uint8_t port_id, uint16_t queue_id,
+typedef int (*ol_tx_handle_t)(uint16_t port_id, uint16_t queue_id,
 			      struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
 
 typedef int (*ol_rx_handle_t)(int vid, struct rte_mbuf **pkts,
@@ -70,7 +70,7 @@ struct ol_switch_ops {
 };
 
 int
-vxlan_port_init(uint8_t port, struct rte_mempool *mbuf_pool);
+vxlan_port_init(uint16_t port, struct rte_mempool *mbuf_pool);
 
 int
 vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m);
@@ -79,7 +79,7 @@ void
 vxlan_unlink(struct vhost_dev *vdev);
 
 int
-vxlan_tx_pkts(uint8_t port_id, uint16_t queue_id,
+vxlan_tx_pkts(uint16_t port_id, uint16_t queue_id,
 			struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
 int
 vxlan_rx_pkts(int vid, struct rte_mbuf **pkts, uint32_t count);
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 8949a1156..0f3fa3003 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -121,7 +121,7 @@ static const struct rte_eth_conf vmdq_conf_default = {
 };
 
 static unsigned lcore_ids[RTE_MAX_LCORE];
-static uint8_t ports[RTE_MAX_ETHPORTS];
+static uint16_t ports[RTE_MAX_ETHPORTS];
 static unsigned num_ports; /**< The number of ports specified in command line */
 
 /* array used for printing out statistics */
@@ -186,7 +186,7 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
  * coming from the mbuf_pool passed as parameter
  */
 static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 {
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_rxconf *rxconf;
@@ -583,7 +583,7 @@ main(int argc, char *argv[])
 	unsigned lcore_id, core_id = 0;
 	int ret;
 	unsigned nb_ports, valid_num_ports;
-	uint8_t portid;
+	uint16_t portid;
 
 	signal(SIGHUP, sighup_handler);
 
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index b6ebccb24..cb1283496 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -87,7 +87,7 @@
 
 /* mask of enabled ports */
 static uint32_t enabled_port_mask;
-static uint8_t ports[RTE_MAX_ETHPORTS];
+static uint16_t ports[RTE_MAX_ETHPORTS];
 static unsigned num_ports;
 
 /* number of pools (if user does not specify any, 32 by default */
@@ -220,7 +220,7 @@ get_eth_conf(struct rte_eth_conf *eth_conf)
  * coming from the mbuf_pool passed as parameter
  */
 static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+port_init(uint16_t port, struct rte_mempool *mbuf_pool)
 {
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_conf port_conf = {0};
@@ -646,7 +646,7 @@ main(int argc, char *argv[])
 	uintptr_t i;
 	int ret;
 	unsigned nb_ports, valid_num_ports;
-	uint8_t portid;
+	uint16_t portid;
 
 	signal(SIGHUP, sighup_handler);
 
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 8/8] doc: update port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
                   ` (6 preceding siblings ...)
  2017-10-13 13:17 ` [PATCH 7/8] examples: " Zhiyong Yang
@ 2017-10-13 13:17 ` Zhiyong Yang
  2017-10-13 15:41   ` Mcnamara, John
  2017-10-13 18:25 ` [PATCH 0/8] fix " Ferruh Yigit
  8 siblings, 1 reply; 14+ messages in thread
From: Zhiyong Yang @ 2017-10-13 13:17 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Zhiyong Yang

Since port id has changed from uint8_t to uint16_t in dpdk code,
So update the change in related doc.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 doc/guides/prog_guide/poll_mode_drv.rst              |  2 +-
 doc/guides/prog_guide/rte_flow.rst                   | 12 ++++++------
 doc/guides/sample_app_ug/ipv4_multicast.rst          |  2 +-
 doc/guides/sample_app_ug/kernel_nic_interface.rst    |  8 ++++----
 doc/guides/sample_app_ug/l2_forward_job_stats.rst    |  4 ++--
 doc/guides/sample_app_ug/l2_forward_real_virtual.rst |  2 +-
 doc/guides/sample_app_ug/l3_forward.rst              | 10 +++++-----
 doc/guides/sample_app_ug/l3_forward_power_man.rst    |  4 ++--
 doc/guides/sample_app_ug/link_status_intr.rst        |  4 ++--
 doc/guides/sample_app_ug/ptpclient.rst               |  2 +-
 doc/guides/sample_app_ug/rxtx_callbacks.rst          |  6 +++---
 doc/guides/sample_app_ug/skeleton.rst                |  6 +++---
 12 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst
index 423170997..6a0c9f992 100644
--- a/doc/guides/prog_guide/poll_mode_drv.rst
+++ b/doc/guides/prog_guide/poll_mode_drv.rst
@@ -562,7 +562,7 @@ NIC Reset API
 
 .. code-block:: c
 
-    int rte_eth_dev_reset(uint8_t port_id);
+    int rte_eth_dev_reset(uint16_t port_id);
 
 Sometimes a port has to be reset passively. For example when a PF is
 reset, all its VFs should also be reset by the application to make them
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 31138819b..13e3dbe0d 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1418,7 +1418,7 @@ supported and can be created.
 .. code-block:: c
 
    int
-   rte_flow_validate(uint8_t port_id,
+   rte_flow_validate(uint16_t port_id,
                      const struct rte_flow_attr *attr,
                      const struct rte_flow_item pattern[],
                      const struct rte_flow_action actions[],
@@ -1473,7 +1473,7 @@ actually created and a handle returned.
 .. code-block:: c
 
    struct rte_flow *
-   rte_flow_create(uint8_t port_id,
+   rte_flow_create(uint16_t port_id,
                    const struct rte_flow_attr *attr,
                    const struct rte_flow_item pattern[],
                    const struct rte_flow_action *actions[],
@@ -1505,7 +1505,7 @@ performing this step before releasing resources.
 .. code-block:: c
 
    int
-   rte_flow_destroy(uint8_t port_id,
+   rte_flow_destroy(uint16_t port_id,
                     struct rte_flow *flow,
                     struct rte_flow_error *error);
 
@@ -1536,7 +1536,7 @@ port. They are released as with successive calls to ``rte_flow_destroy()``.
 .. code-block:: c
 
    int
-   rte_flow_flush(uint8_t port_id,
+   rte_flow_flush(uint16_t port_id,
                   struct rte_flow_error *error);
 
 In the unlikely event of failure, handles are still considered destroyed and
@@ -1564,7 +1564,7 @@ definition.
 .. code-block:: c
 
    int
-   rte_flow_query(uint8_t port_id,
+   rte_flow_query(uint16_t port_id,
                   struct rte_flow *flow,
                   enum rte_flow_action_type action,
                   void *data,
@@ -1637,7 +1637,7 @@ port and may return errors such as ``ENOTSUP`` ("not supported"):
 .. code-block:: c
 
    int
-   rte_flow_isolate(uint8_t port_id, int set, struct rte_flow_error *error);
+   rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error);
 
 Arguments:
 
diff --git a/doc/guides/sample_app_ug/ipv4_multicast.rst b/doc/guides/sample_app_ug/ipv4_multicast.rst
index 49712a0fe..60bca859e 100644
--- a/doc/guides/sample_app_ug/ipv4_multicast.rst
+++ b/doc/guides/sample_app_ug/ipv4_multicast.rst
@@ -268,7 +268,7 @@ The actual packet transmission is done in the mcast_send_pkt() function:
 
 .. code-block:: c
 
-    static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint8_t port)
+    static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port)
     {
         struct ether_hdr *ethdr;
         uint16_t len;
diff --git a/doc/guides/sample_app_ug/kernel_nic_interface.rst b/doc/guides/sample_app_ug/kernel_nic_interface.rst
index 619a7b527..e050e8bf7 100644
--- a/doc/guides/sample_app_ug/kernel_nic_interface.rst
+++ b/doc/guides/sample_app_ug/kernel_nic_interface.rst
@@ -246,7 +246,7 @@ The code for allocating the kernel NIC interfaces for a specific port is as foll
 .. code-block:: c
 
     static int
-    kni_alloc(uint8_t port_id)
+    kni_alloc(uint16_t port_id)
     {
         uint8_t i;
         struct rte_kni *kni;
@@ -335,7 +335,7 @@ The code is as follows:
         int i, j, nb_token;
         char *str_fld[_NUM_FLD];
         unsigned long int_fld[_NUM_FLD];
-        uint8_t port_id, nb_kni_port_params = 0;
+        uint16_t port_id, nb_kni_port_params = 0;
 
         memset(&kni_port_params_array, 0, sizeof(kni_port_params_array));
 
@@ -532,7 +532,7 @@ Currently, setting a new MTU and configuring the network interface (up/ down) ar
     /* Callback for request of changing MTU */
 
     static int
-    kni_change_mtu(uint8_t port_id, unsigned new_mtu)
+    kni_change_mtu(uint16_t port_id, unsigned new_mtu)
     {
         int ret;
         struct rte_eth_conf conf;
@@ -581,7 +581,7 @@ Currently, setting a new MTU and configuring the network interface (up/ down) ar
     /* Callback for request of configuring network interface up/down */
 
     static int
-    kni_config_network_interface(uint8_t port_id, uint8_t if_up)
+    kni_config_network_interface(uint16_t port_id, uint8_t if_up)
     {
         int ret = 0;
 
diff --git a/doc/guides/sample_app_ug/l2_forward_job_stats.rst b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
index 1029cc8ff..1d45896f5 100644
--- a/doc/guides/sample_app_ug/l2_forward_job_stats.rst
+++ b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
@@ -558,7 +558,7 @@ If the table is full, the whole packets table is transmitted using the l2fwd_sen
     /* Send the packet on an output interface */
 
     static int
-    l2fwd_send_packet(struct rte_mbuf *m, uint8_t port)
+    l2fwd_send_packet(struct rte_mbuf *m, uint16_t port)
     {
         unsigned lcore_id, len;
         struct lcore_queue_conf *qconf;
@@ -593,7 +593,7 @@ however it improves performance:
         unsigned lcore_id;
         struct lcore_queue_conf *qconf;
         struct mbuf_table *m_table;
-        uint8_t portid;
+        uint16_t portid;
 
         lcore_id = rte_lcore_id();
         qconf = &lcore_queue_conf[lcore_id];
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index f579c8fe9..6f496f730 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -474,7 +474,7 @@ If the table is full, the whole packets table is transmitted using the l2fwd_sen
     /* Send the packet on an output interface */
 
     static int
-    l2fwd_send_packet(struct rte_mbuf *m, uint8_t port)
+    l2fwd_send_packet(struct rte_mbuf *m, uint16_t port)
     {
         unsigned lcore_id, len;
         struct lcore_queue_conf *qconf;
diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst
index 6a6b8fbe8..2635f403b 100644
--- a/doc/guides/sample_app_ug/l3_forward.rst
+++ b/doc/guides/sample_app_ug/l3_forward.rst
@@ -283,7 +283,7 @@ The get_ipv4_dst_port() function is shown below:
 .. code-block:: c
 
     static inline uint8_t
-    get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
+    get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
     {
         int ret = 0;
         union ipv4_5tuple_host key;
@@ -312,7 +312,7 @@ The key code snippet of simple_ipv4_fwd_4pkts() is shown below:
 .. code-block:: c
 
     static inline void
-    simple_ipv4_fwd_4pkts(struct rte_mbuf* m[4], uint8_t portid, struct lcore_conf *qconf)
+    simple_ipv4_fwd_4pkts(struct rte_mbuf* m[4], uint16_t portid, struct lcore_conf *qconf)
     {
         // ...
 
@@ -351,10 +351,10 @@ for LPM-based lookups is done by the get_ipv4_dst_port() function below:
 
 .. code-block:: c
 
-    static inline uint8_t
-    get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
+    static inline uint16_t
+    get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
     {
         uint8_t next_hop;
 
-        return (uint8_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid);
+        return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid);
     }
diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst b/doc/guides/sample_app_ug/l3_forward_power_man.rst
index ea9c404d8..18fe63b5a 100644
--- a/doc/guides/sample_app_ug/l3_forward_power_man.rst
+++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst
@@ -181,11 +181,11 @@ responsible for checking if it needs to scale down frequency at run time by chec
         struct lcore_conf *qconf;
         int ret;
         unsigned nb_ports;
-        uint16_t queueid;
+        uint16_t queueid, portid;
         unsigned lcore_id;
         uint64_t hz;
         uint32_t n_tx_queue, nb_lcores;
-        uint8_t portid, nb_rx_queue, queue, socketid;
+        uint8_t nb_rx_queue, queue, socketid;
 
         // ...
 
diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
index f9af47492..abc1d8f0d 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -219,7 +219,7 @@ An example callback function that has been written as indicated below.
 .. code-block:: c
 
     static void
-    lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param)
+    lsi_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param)
     {
         struct rte_eth_link link;
 
@@ -405,7 +405,7 @@ If the table is full, the whole packets table is transmitted using the lsi_send_
     /* Send the packet on an output interface */
 
     static int
-    lsi_send_packet(struct rte_mbuf *m, uint8_t port)
+    lsi_send_packet(struct rte_mbuf *m, uint16_t port)
     {
         unsigned lcore_id, len;
         struct lcore_queue_conf *qconf;
diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst
index d3ef1d119..d643cf1ea 100644
--- a/doc/guides/sample_app_ug/ptpclient.rst
+++ b/doc/guides/sample_app_ug/ptpclient.rst
@@ -257,7 +257,7 @@ PTP IEEE1588 L2 functionality.
 .. code-block:: c
 
     void
-    parse_ptp_frames(uint8_t portid, struct rte_mbuf *m) {
+    parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) {
         struct ptp_header *ptp_hdr;
         struct ether_hdr *eth_hdr;
         uint16_t eth_type;
diff --git a/doc/guides/sample_app_ug/rxtx_callbacks.rst b/doc/guides/sample_app_ug/rxtx_callbacks.rst
index 8d1bb86f7..32619e0c1 100644
--- a/doc/guides/sample_app_ug/rxtx_callbacks.rst
+++ b/doc/guides/sample_app_ug/rxtx_callbacks.rst
@@ -124,7 +124,7 @@ comments:
 .. code-block:: c
 
     static inline int
-    port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+    port_init(uint16_t port, struct rte_mempool *mbuf_pool)
     {
         struct rte_eth_conf port_conf = port_conf_default;
         const uint16_t rx_rings = 1, tx_rings = 1;
@@ -196,7 +196,7 @@ all packets received:
 .. code-block:: c
 
     static uint16_t
-    add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
+    add_timestamps(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
             struct rte_mbuf **pkts, uint16_t nb_pkts, void *_ __rte_unused)
     {
         unsigned i;
@@ -222,7 +222,7 @@ packets prior to transmission:
 .. code-block:: c
 
     static uint16_t
-    calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
+    calc_latency(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
             struct rte_mbuf **pkts, uint16_t nb_pkts, void *_ __rte_unused)
     {
         uint64_t cycles = 0;
diff --git a/doc/guides/sample_app_ug/skeleton.rst b/doc/guides/sample_app_ug/skeleton.rst
index c39b03322..17714455c 100644
--- a/doc/guides/sample_app_ug/skeleton.rst
+++ b/doc/guides/sample_app_ug/skeleton.rst
@@ -160,7 +160,7 @@ Forwarding application is shown below:
 .. code-block:: c
 
     static inline int
-    port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+    port_init(uint16_t port, struct rte_mempool *mbuf_pool)
     {
         struct rte_eth_conf port_conf = port_conf_default;
         const uint16_t rx_rings = 1, tx_rings = 1;
@@ -241,8 +241,8 @@ looks like the following:
     static __attribute__((noreturn)) void
     lcore_main(void)
     {
-        const uint8_t nb_ports = rte_eth_dev_count();
-        uint8_t port;
+        const uint16_t nb_ports = rte_eth_dev_count();
+        uint16_t port;
 
         /*
          * Check that the port is on the same NUMA node as the polling thread
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] doc: update port id type
  2017-10-13 13:17 ` [PATCH 8/8] doc: update " Zhiyong Yang
@ 2017-10-13 15:41   ` Mcnamara, John
  2017-10-16  1:32     ` Yang, Zhiyong
  2017-10-18  9:13     ` Van Haaren, Harry
  0 siblings, 2 replies; 14+ messages in thread
From: Mcnamara, John @ 2017-10-13 15:41 UTC (permalink / raw)
  To: Yang, Zhiyong, dev; +Cc: Yigit, Ferruh, Yang, Zhiyong, Van Haaren, Harry



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang
> Sent: Friday, October 13, 2017 2:17 PM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong
> <zhiyong.yang@intel.com>
> Subject: [dpdk-dev] [PATCH 8/8] doc: update port id type
> 
> Since port id has changed from uint8_t to uint16_t in dpdk code, So update
> the change in related doc.
> 
> Fixes: f8244c6399d9 ("ethdev: increase port id range")
> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>

Looks good. There is one other unchanged reference but I don't know if it is relevant.

CC: Harry

    $ ag "uint8_t port" doc/guides/ 
    doc/guides/prog_guide/eventdev.rst
    283:        uint8_t port_id = 0;


Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/8] fix port id type
  2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
                   ` (7 preceding siblings ...)
  2017-10-13 13:17 ` [PATCH 8/8] doc: update " Zhiyong Yang
@ 2017-10-13 18:25 ` Ferruh Yigit
  2017-10-13 18:26   ` Ferruh Yigit
  8 siblings, 1 reply; 14+ messages in thread
From: Ferruh Yigit @ 2017-10-13 18:25 UTC (permalink / raw)
  To: Zhiyong Yang, dev

On 10/13/2017 2:16 PM, Zhiyong Yang wrote:
> Fix port id type and update related docs.
> 
> Zhiyong Yang (8):
>   net/bonding: fix port id type
>   net/i40e: fix port id type
>   net/fm10k: fix port id type
>   net/mrvl: fix port id type
>   app: fix port id type
>   test: fix port id type
>   examples: fix port id type
>   doc: update port id type

Series Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/8] fix port id type
  2017-10-13 18:25 ` [PATCH 0/8] fix " Ferruh Yigit
@ 2017-10-13 18:26   ` Ferruh Yigit
  0 siblings, 0 replies; 14+ messages in thread
From: Ferruh Yigit @ 2017-10-13 18:26 UTC (permalink / raw)
  To: Zhiyong Yang, dev

On 10/13/2017 7:25 PM, Ferruh Yigit wrote:
> On 10/13/2017 2:16 PM, Zhiyong Yang wrote:
>> Fix port id type and update related docs.
>>
>> Zhiyong Yang (8):
>>   net/bonding: fix port id type
>>   net/i40e: fix port id type
>>   net/fm10k: fix port id type
>>   net/mrvl: fix port id type
>>   app: fix port id type
>>   test: fix port id type
>>   examples: fix port id type
>>   doc: update port id type
> 
> Series Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdkt/master, thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] doc: update port id type
  2017-10-13 15:41   ` Mcnamara, John
@ 2017-10-16  1:32     ` Yang, Zhiyong
  2017-10-18  9:13     ` Van Haaren, Harry
  1 sibling, 0 replies; 14+ messages in thread
From: Yang, Zhiyong @ 2017-10-16  1:32 UTC (permalink / raw)
  To: Mcnamara, John, dev; +Cc: Yigit, Ferruh, Van Haaren, Harry

Hi John,

> -----Original Message-----
> From: Mcnamara, John
> Sent: Friday, October 13, 2017 11:41 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong
> <zhiyong.yang@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>
> Subject: RE: [dpdk-dev] [PATCH 8/8] doc: update port id type
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang
> > Sent: Friday, October 13, 2017 2:17 PM
> > To: dev@dpdk.org
> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong
> > <zhiyong.yang@intel.com>
> > Subject: [dpdk-dev] [PATCH 8/8] doc: update port id type
> >
> > Since port id has changed from uint8_t to uint16_t in dpdk code, So
> > update the change in related doc.
> >
> > Fixes: f8244c6399d9 ("ethdev: increase port id range")
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> 
> Looks good. There is one other unchanged reference but I don't know if it is
> relevant.
> 
> CC: Harry
> 
>     $ ag "uint8_t port" doc/guides/
>     doc/guides/prog_guide/eventdev.rst
>     283:        uint8_t port_id = 0;
> 
> 
> Acked-by: John McNamara <john.mcnamara@intel.com>

Thanks for your acked-by firstly.  The patchset increased port id range to uint16_t in ethdev,
Not eventdev. So I don't touch it here.  Port id in eventdev is stills uint8_t from my understanding.

Thanks
Zhiyong

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 8/8] doc: update port id type
  2017-10-13 15:41   ` Mcnamara, John
  2017-10-16  1:32     ` Yang, Zhiyong
@ 2017-10-18  9:13     ` Van Haaren, Harry
  1 sibling, 0 replies; 14+ messages in thread
From: Van Haaren, Harry @ 2017-10-18  9:13 UTC (permalink / raw)
  To: Mcnamara, John, Yang, Zhiyong, dev; +Cc: Yigit, Ferruh, Yang, Zhiyong

> From: Mcnamara, John
> Sent: Friday, October 13, 2017 4:41 PM
> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong
> <zhiyong.yang@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>
> Subject: RE: [dpdk-dev] [PATCH 8/8] doc: update port id type
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang
> > Sent: Friday, October 13, 2017 2:17 PM
> > To: dev@dpdk.org
> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong
> > <zhiyong.yang@intel.com>
> > Subject: [dpdk-dev] [PATCH 8/8] doc: update port id type
> >
> > Since port id has changed from uint8_t to uint16_t in dpdk code, So update
> > the change in related doc.
> >
> > Fixes: f8244c6399d9 ("ethdev: increase port id range")
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> 
> Looks good. There is one other unchanged reference but I don't know if it is
> relevant.
> 
> CC: Harry
> 
>     $ ag "uint8_t port" doc/guides/
>     doc/guides/prog_guide/eventdev.rst
>     283:        uint8_t port_id = 0;


No need to change this in the docs - the port here is an Eventdev port, not an Ethdev port.

TL:DR; Looks good to me! -Harry

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-10-18  9:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13 13:16 [PATCH 0/8] fix port id type Zhiyong Yang
2017-10-13 13:16 ` [PATCH 1/8] net/bonding: " Zhiyong Yang
2017-10-13 13:16 ` [PATCH 2/8] net/i40e: " Zhiyong Yang
2017-10-13 13:16 ` [PATCH 3/8] net/fm10k: " Zhiyong Yang
2017-10-13 13:16 ` [PATCH 4/8] net/mrvl: " Zhiyong Yang
2017-10-13 13:16 ` [PATCH 5/8] app: " Zhiyong Yang
2017-10-13 13:16 ` [PATCH 6/8] test: " Zhiyong Yang
2017-10-13 13:17 ` [PATCH 7/8] examples: " Zhiyong Yang
2017-10-13 13:17 ` [PATCH 8/8] doc: update " Zhiyong Yang
2017-10-13 15:41   ` Mcnamara, John
2017-10-16  1:32     ` Yang, Zhiyong
2017-10-18  9:13     ` Van Haaren, Harry
2017-10-13 18:25 ` [PATCH 0/8] fix " Ferruh Yigit
2017-10-13 18:26   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.