[dpdk-dev] [PATCH 2/8] net/i40e: fix port id type

Zhiyong Yang zhiyong.yang at intel.com
Fri Oct 13 15:16:55 CEST 2017


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 at 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



More information about the dev mailing list