From: Zhiyong Yang Date: Fri, 13 Oct 2017 13:16:55 +0000 (+0800) Subject: net/i40e: fix port id type X-Git-Tag: spdx-start~1319 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=04b443fb2c439b78436f32e7ab2a3267067a0fbe;p=dpdk.git net/i40e: fix port id type 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 --- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 71327d1b9e..f40c463aa8 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 b58e3fe626..4881ea05b1 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 f18251be73..467b415b9e 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