net/i40e: fix port id type
authorZhiyong Yang <zhiyong.yang@intel.com>
Fri, 13 Oct 2017 13:16:55 +0000 (21:16 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 13 Oct 2017 19:57:48 +0000 (21:57 +0200)
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
drivers/net/i40e/rte_pmd_i40e.c
drivers/net/i40e/rte_pmd_i40e.h

index 71327d1..f40c463 100644 (file)
@@ -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;
index b58e3fe..4881ea0 100644 (file)
@@ -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)
index f18251b..467b415 100644 (file)
@@ -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