* [dpdk-dev] [PATCH 0/2] increase port_id range @ 2017-08-09 8:42 Zhiyong Yang 2017-08-09 8:42 ` [dpdk-dev] [PATCH 1/2] ethdev: " Zhiyong Yang ` (3 more replies) 0 siblings, 4 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-08-09 8:42 UTC (permalink / raw) To: dev; +Cc: thomas port_id is currently defined as uint8_t, which is limited to the range 0 to 255. A larger range is required for vdev scalability. It is necessary for a redefinition of port_id to extend it from 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will be changed at the same time. Below is an API/ABI change notice for DPDK 17.11. http://www.dpdk.org/dev/patchwork/patch/27475/ Discussion about port_id is the following thread. http://www.dpdk.org/dev/patchwork/patch/23208/ Zhiyong Yang (2): ethdev: increase port_id range examples: increase port_id range app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 4 +- app/test-pmd/testpmd.c | 4 +- app/test-pmd/testpmd.h | 2 +- drivers/net/bonding/rte_eth_bond.h | 40 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 54 +++--- drivers/net/bonding/rte_eth_bond_pmd.c | 10 +- drivers/net/bonding/rte_eth_bond_private.h | 36 ++-- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/ring/rte_eth_ring.c | 2 +- examples/bond/main.c | 6 +- examples/ip_fragmentation/main.c | 4 +- examples/l3fwd-power/main.c | 7 +- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_lpm.c | 2 +- examples/link_status_interrupt/main.c | 5 +- examples/performance-thread/l3fwd-thread/main.c | 7 +- examples/rxtx_callbacks/main.c | 8 +- lib/librte_ether/rte_ethdev.c | 231 +++++++++++------------ lib/librte_ether/rte_ethdev.h | 236 ++++++++++++------------ lib/librte_ether/rte_tm.c | 62 +++---- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_latencystats/rte_latencystats.c | 8 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- 31 files changed, 431 insertions(+), 419 deletions(-) -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH 1/2] ethdev: increase port_id range 2017-08-09 8:42 [dpdk-dev] [PATCH 0/2] increase port_id range Zhiyong Yang @ 2017-08-09 8:42 ` Zhiyong Yang 2017-08-09 12:52 ` Ferruh Yigit 2017-08-09 8:42 ` [dpdk-dev] [PATCH 2/2] examples: " Zhiyong Yang ` (2 subsequent siblings) 3 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-08-09 8:42 UTC (permalink / raw) To: dev; +Cc: thomas, Zhiyong Yang Extend port_id definition from uint8_t to uint16_t in lib ethdev data structures, specifically rte_eth_dev_data and modify the APIs using port_id at the same time. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 4 +- app/test-pmd/testpmd.c | 4 +- app/test-pmd/testpmd.h | 2 +- drivers/net/bonding/rte_eth_bond.h | 40 ++--- drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 54 +++---- drivers/net/bonding/rte_eth_bond_pmd.c | 10 +- drivers/net/bonding/rte_eth_bond_private.h | 36 ++--- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/ring/rte_eth_ring.c | 2 +- lib/librte_ether/rte_ethdev.c | 231 ++++++++++++++-------------- lib/librte_ether/rte_ethdev.h | 236 ++++++++++++++--------------- lib/librte_ether/rte_tm.c | 62 ++++---- lib/librte_ether/rte_tm.h | 60 ++++---- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_latencystats/rte_latencystats.c | 8 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- 22 files changed, 404 insertions(+), 395 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index 3b13753d9..090a50cfc 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -623,7 +623,7 @@ static void create_mp_ring_vdev(void) { int i; - uint8_t portid; + uint16_t portid; struct pdump_tuples *pt = NULL; struct rte_mempool *mbuf_pool = NULL; char vdev_args[SIZE]; diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index cd8c35850..575c9bd85 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4584,7 +4584,7 @@ struct cmd_show_bonding_config_result { cmdline_fixed_string_t show; cmdline_fixed_string_t bonding; cmdline_fixed_string_t config; - uint8_t port_id; + uint16_t port_id; }; static void cmd_show_bonding_config_parsed(void *parsed_result, @@ -4593,7 +4593,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, { struct cmd_show_bonding_config_result *res = parsed_result; int bonding_mode, agg_mode; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int num_slaves, num_active_slaves; int primary_id; int i; diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 7d4013941..0b2694120 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -390,7 +390,7 @@ struct gro_status gro_ports[RTE_MAX_ETHPORTS]; /* Forward function declarations */ static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port); static void check_all_ports_link_status(uint32_t port_mask); -static int eth_event_callback(uint8_t port_id, +static int eth_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); @@ -1844,7 +1844,7 @@ rmv_event_callback(void *arg) /* This function is used by the interrupt thread */ static int -eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, +eth_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param) { static const char * const event_desc[] = { diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index c9d7739b8..91da056a6 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -78,7 +78,7 @@ #define UMA_NO_CONFIG 0xFF typedef uint8_t lcoreid_t; -typedef uint8_t portid_t; +typedef uint16_t portid_t; typedef uint16_t queueid_t; typedef uint16_t streamid_t; diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 8efbf0713..e506eea00 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -151,7 +151,7 @@ rte_eth_bond_free(const char *name); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Remove a slave rte_eth_dev device from the bonded device @@ -163,7 +163,7 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Set link bonding mode of bonded device @@ -175,7 +175,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode); /** * Get link bonding mode of bonded device @@ -186,7 +186,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); * link bonding mode on success, negative value otherwise */ int -rte_eth_bond_mode_get(uint8_t bonded_port_id); +rte_eth_bond_mode_get(uint16_t bonded_port_id); /** * Set slave rte_eth_dev as primary slave of bonded device @@ -198,7 +198,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Get primary slave of bonded device @@ -209,7 +209,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); * Port Id of primary slave on success, -1 on failure */ int -rte_eth_bond_primary_get(uint8_t bonded_port_id); +rte_eth_bond_primary_get(uint16_t bonded_port_id); /** * Populate an array with list of the slaves port id's of the bonded device @@ -223,7 +223,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id); * negative value otherwise */ int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint8_t len); /** * Populate an array with list of the active slaves port id's of the bonded @@ -238,7 +239,7 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); * negative value otherwise */ int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], uint8_t len); /** @@ -252,7 +253,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr); /** @@ -265,7 +266,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id); /** * Set the transmit policy for bonded device to use when it is operating in @@ -279,7 +280,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy); /** * Get the transmit policy set on bonded device for balance mode operation @@ -290,7 +291,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); * Balance transmit policy on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of @@ -304,7 +305,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); */ int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link @@ -316,8 +317,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); * Monitoring interval on success, negative value otherwise. */ int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); - +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the disabling of a bonded link @@ -330,7 +330,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the disabling of a bonded @@ -342,7 +343,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the enabling of a bonded link @@ -355,7 +356,8 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the enabling of a bonded @@ -367,7 +369,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); #ifdef __cplusplus diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 20b5a8961..7423acf0e 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -685,11 +685,11 @@ max_index(uint64_t *a, int n) * @param port_pos Port to assign. */ static void -selection_logic(struct bond_dev_private *internals, uint8_t slave_id) +selection_logic(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port; - uint8_t slaves_count, new_agg_id, i, j = 0; - uint8_t *slaves; + uint8_t slaves_count, i, j = 0; + uint16_t *slaves, new_agg_id; uint64_t agg_bandwidth[8] = {0}; uint64_t agg_count[8] = {0}; uint8_t default_slave = 0; diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index de1d9e0db..f70fdb386 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -56,14 +56,14 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) } int -valid_bonded_port_id(uint8_t port_id) +valid_bonded_port_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return check_for_bonded_ethdev(&rte_eth_devices[port_id]); } int -valid_slave_port_id(uint8_t port_id, uint8_t mode) +valid_slave_port_id(uint16_t port_id, uint8_t mode) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); @@ -80,7 +80,7 @@ valid_slave_port_id(uint8_t port_id, uint8_t mode) } void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -107,9 +107,9 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) } void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { - uint8_t slave_pos; + uint16_t slave_pos; struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -153,7 +153,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) { struct bond_dev_private *internals; char devargs[52]; - uint8_t port_id; + uint16_t port_id; int ret; if (name == NULL) { @@ -193,7 +193,7 @@ rte_eth_bond_free(const char *name) } static int -slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) +slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -233,7 +233,7 @@ slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev; struct bond_dev_private *internals; @@ -363,7 +363,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -466,7 +466,7 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -488,7 +488,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) { if (valid_bonded_port_id(bonded_port_id) != 0) return -1; @@ -497,7 +497,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) } int -rte_eth_bond_mode_get(uint8_t bonded_port_id) +rte_eth_bond_mode_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -510,7 +510,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id) } int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct bond_dev_private *internals; @@ -531,7 +531,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_primary_get(uint8_t bonded_port_id) +rte_eth_bond_primary_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -547,7 +547,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id) } int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint8_t len) { struct bond_dev_private *internals; uint8_t i; @@ -570,7 +571,7 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) } int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], uint8_t len) { struct bond_dev_private *internals; @@ -592,7 +593,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], } int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *bonded_eth_dev; @@ -618,7 +619,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, } int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -647,7 +648,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) } int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) { struct bond_dev_private *internals; @@ -677,7 +678,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) } int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -690,7 +691,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms) { struct bond_dev_private *internals; @@ -704,7 +705,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) } int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -717,7 +718,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms) { struct bond_dev_private *internals; @@ -732,7 +734,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -745,7 +747,7 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; @@ -760,7 +762,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 3ee70baa0..9a249d4f3 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1861,7 +1861,7 @@ slave_add(struct bond_dev_private *internals, void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id) + uint16_t slave_port_id) { int i; @@ -2277,7 +2277,7 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) static int bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) { - void (*link_update)(uint8_t port_id, struct rte_eth_link *eth_link); + void (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); struct bond_dev_private *bond_ctx; struct rte_eth_link slave_link; @@ -2466,7 +2466,7 @@ bond_ethdev_delayed_lsc_propagation(void *arg) } int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param __rte_unused) { struct rte_eth_dev *bonded_eth_dev; @@ -3086,7 +3086,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Parse/set primary slave port id*/ arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); if (arg_count == 1) { - uint8_t primary_slave_port_id; + uint16_t primary_slave_port_id; if (rte_kvargs_process(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG, @@ -3099,7 +3099,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } /* Set balance mode transmit policy*/ - if (rte_eth_bond_primary_set(port_id, (uint8_t)primary_slave_port_id) + if (rte_eth_bond_primary_set(port_id, primary_slave_port_id) != 0) { RTE_LOG(ERR, EAL, "Failed to set primary slave port %d on bonded device %s\n", diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 1fe6ff880..c42458a1b 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -93,12 +93,12 @@ struct bond_tx_queue { /** Bonded slave devices structure */ struct bond_ethdev_slave_ports { - uint8_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ + uint16_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ uint8_t slave_count; /**< Number of slaves */ }; struct bond_slave_details { - uint8_t port_id; + uint16_t port_id; uint8_t link_status_poll_enabled; uint8_t link_status_wait_to_complete; @@ -114,14 +114,14 @@ typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count) /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { - uint8_t port_id; /**< Port Id of Bonded Port */ - uint8_t mode; /**< Link Bonding Mode */ + uint16_t port_id; /**< Port Id of Bonded Port */ + uint8_t mode; /**< Link Bonding Mode */ rte_spinlock_t lock; - uint8_t primary_port; /**< Primary Slave Port */ - uint8_t current_primary_port; /**< Primary Slave Port */ - uint8_t user_defined_primary_port; + uint16_t primary_port; /**< Primary Slave Port */ + uint16_t current_primary_port; /**< Primary Slave Port */ + uint16_t user_defined_primary_port; /**< Flag for whether primary port is user defined or not */ uint8_t balance_xmit_policy; @@ -146,7 +146,7 @@ struct bond_dev_private { uint8_t active_slave; /**< Next active_slave to poll */ uint8_t active_slave_count; /**< Number of active slaves */ - uint8_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ + uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ uint8_t slave_count; /**< Number of bonded slaves */ struct bond_slave_details slaves[RTE_MAX_ETHPORTS]; @@ -186,10 +186,10 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); /* Search given slave array to find position of given id. * Return slave pos or slaves_count if not found. */ -static inline uint8_t -find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { +static inline uint16_t +find_slave_by_id(uint16_t *slaves, uint8_t slaves_count, uint16_t slave_id) { - uint8_t pos; + uint16_t pos; for (pos = 0; pos < slaves_count; pos++) { if (slave_id == slaves[pos]) break; @@ -199,19 +199,19 @@ find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { } int -valid_port_id(uint8_t port_id); +valid_port_id(uint16_t port_id); int -valid_bonded_port_id(uint8_t port_id); +valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(uint8_t port_id, uint8_t mode); +valid_slave_port_id(uint16_t port_id, uint8_t mode); void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void link_properties_set(struct rte_eth_dev *bonded_eth_dev, @@ -255,10 +255,10 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count); void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id); + uint16_t slave_port_id); int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); int diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index a3a8cce95..1c8a9337e 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -400,7 +400,7 @@ failsafe_eth_dev_state_sync(struct rte_eth_dev *dev) } int -failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_rmv_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { @@ -419,7 +419,7 @@ failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, } int -failsafe_eth_lsc_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 0361cf434..4ae6e6c5f 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -180,10 +180,10 @@ int failsafe_eal_uninit(struct rte_eth_dev *dev); int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev); void failsafe_dev_remove(struct rte_eth_dev *dev); -int failsafe_eth_rmv_event_callback(uint8_t port_id, +int failsafe_eth_rmv_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *arg, void *out); -int failsafe_eth_lsc_event_callback(uint8_t port_id, +int failsafe_eth_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *out); diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 464d3d384..e3fa7b0e2 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -394,7 +394,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], }; char args_str[32] = { 0 }; char ring_name[32] = { 0 }; - uint8_t port_id = RTE_MAX_ETHPORTS; + uint16_t port_id = RTE_MAX_ETHPORTS; int ret; /* do some parameter checking */ diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0597641ee..e3b5e6a16 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -138,8 +138,8 @@ enum { STAT_QMAP_RX }; -uint8_t -rte_eth_find_next(uint8_t port_id) +uint16_t +rte_eth_find_next(uint16_t port_id) { while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED) @@ -187,7 +187,7 @@ rte_eth_dev_allocated(const char *name) return NULL; } -static uint8_t +static uint16_t rte_eth_dev_find_free_port(void) { unsigned i; @@ -200,7 +200,7 @@ rte_eth_dev_find_free_port(void) } static struct rte_eth_dev * -eth_dev_get(uint8_t port_id) +eth_dev_get(uint16_t port_id) { struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id]; @@ -216,7 +216,7 @@ eth_dev_get(uint8_t port_id) struct rte_eth_dev * rte_eth_dev_allocate(const char *name) { - uint8_t port_id; + uint16_t port_id; struct rte_eth_dev *eth_dev; port_id = rte_eth_dev_find_free_port(); @@ -285,7 +285,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) } int -rte_eth_dev_is_valid_port(uint8_t port_id) +rte_eth_dev_is_valid_port(uint16_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && @@ -296,7 +296,7 @@ rte_eth_dev_is_valid_port(uint8_t port_id) } int -rte_eth_dev_socket_id(uint8_t port_id) +rte_eth_dev_socket_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; @@ -317,7 +317,7 @@ rte_eth_dev_count(void) } int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name) { const char *tmp; @@ -336,7 +336,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) } int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) { int ret; int i; @@ -361,7 +361,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) } static int -rte_eth_dev_is_detachable(uint8_t port_id) +rte_eth_dev_is_detachable(uint16_t port_id) { uint32_t dev_flags; @@ -377,7 +377,7 @@ rte_eth_dev_is_detachable(uint8_t port_id) /* attach the new device, then store port_id of the device */ int -rte_eth_dev_attach(const char *devargs, uint8_t *port_id) +rte_eth_dev_attach(const char *devargs, uint16_t *port_id) { int ret = -1; int current = rte_eth_dev_count(); @@ -423,7 +423,7 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id) /* detach the device, then store the name of the device */ int -rte_eth_dev_detach(uint8_t port_id, char *name) +rte_eth_dev_detach(uint16_t port_id, char *name) { int ret = -1; @@ -501,7 +501,7 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) } int -rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -527,7 +527,7 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -553,7 +553,7 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -579,7 +579,7 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) } int -rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -688,7 +688,7 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) } int -rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf) { struct rte_eth_dev *dev; @@ -839,7 +839,7 @@ _rte_eth_dev_reset(struct rte_eth_dev *dev) } static void -rte_eth_dev_config_restore(uint8_t port_id) +rte_eth_dev_config_restore(uint16_t port_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -894,7 +894,7 @@ rte_eth_dev_config_restore(uint8_t port_id) } int -rte_eth_dev_start(uint8_t port_id) +rte_eth_dev_start(uint16_t port_id) { struct rte_eth_dev *dev; int diag; @@ -906,7 +906,7 @@ rte_eth_dev_start(uint8_t port_id) RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP); if (dev->data->dev_started != 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already started\n", port_id); return 0; @@ -928,7 +928,7 @@ rte_eth_dev_start(uint8_t port_id) } void -rte_eth_dev_stop(uint8_t port_id) +rte_eth_dev_stop(uint16_t port_id) { struct rte_eth_dev *dev; @@ -938,7 +938,7 @@ rte_eth_dev_stop(uint8_t port_id) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop); if (dev->data->dev_started == 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already stopped\n", port_id); return; @@ -949,7 +949,7 @@ rte_eth_dev_stop(uint8_t port_id) } int -rte_eth_dev_set_link_up(uint8_t port_id) +rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; @@ -962,7 +962,7 @@ rte_eth_dev_set_link_up(uint8_t port_id) } int -rte_eth_dev_set_link_down(uint8_t port_id) +rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; @@ -975,7 +975,7 @@ rte_eth_dev_set_link_down(uint8_t port_id) } void -rte_eth_dev_close(uint8_t port_id) +rte_eth_dev_close(uint16_t port_id) { struct rte_eth_dev *dev; @@ -995,7 +995,7 @@ rte_eth_dev_close(uint8_t port_id) } int -rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) @@ -1086,7 +1086,7 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) { @@ -1190,7 +1190,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) } int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -1204,7 +1204,7 @@ rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) } void -rte_eth_promiscuous_enable(uint8_t port_id) +rte_eth_promiscuous_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1217,7 +1217,7 @@ rte_eth_promiscuous_enable(uint8_t port_id) } void -rte_eth_promiscuous_disable(uint8_t port_id) +rte_eth_promiscuous_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1230,7 +1230,7 @@ rte_eth_promiscuous_disable(uint8_t port_id) } int -rte_eth_promiscuous_get(uint8_t port_id) +rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1241,7 +1241,7 @@ rte_eth_promiscuous_get(uint8_t port_id) } void -rte_eth_allmulticast_enable(uint8_t port_id) +rte_eth_allmulticast_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1254,7 +1254,7 @@ rte_eth_allmulticast_enable(uint8_t port_id) } void -rte_eth_allmulticast_disable(uint8_t port_id) +rte_eth_allmulticast_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1267,7 +1267,7 @@ rte_eth_allmulticast_disable(uint8_t port_id) } int -rte_eth_allmulticast_get(uint8_t port_id) +rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1292,7 +1292,7 @@ rte_eth_dev_atomic_read_link_status(struct rte_eth_dev *dev, } void -rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1309,7 +1309,7 @@ rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) } void -rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1326,7 +1326,7 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) } int -rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) +rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; @@ -1342,7 +1342,7 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) } void -rte_eth_stats_reset(uint8_t port_id) +rte_eth_stats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1355,7 +1355,7 @@ rte_eth_stats_reset(uint8_t port_id) } static int -get_xstats_count(uint8_t port_id) +get_xstats_count(uint16_t port_id) { struct rte_eth_dev *dev; int count; @@ -1384,7 +1384,7 @@ get_xstats_count(uint8_t port_id) } int -rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id) { int cnt_xstats, idx_xstat; @@ -1428,7 +1428,7 @@ rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, } int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids) { @@ -1545,7 +1545,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, } int -rte_eth_xstats_get_names(uint8_t port_id, +rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size) { @@ -1611,8 +1611,8 @@ rte_eth_xstats_get_names(uint8_t port_id, /* retrieve ethdev extended statistics */ int -rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, - unsigned int n) +rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, + uint64_t *values, unsigned int n) { /* If need all xstats */ if (!ids) { @@ -1737,7 +1737,7 @@ rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, } int -rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n) { struct rte_eth_stats eth_stats; @@ -1819,7 +1819,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, /* reset ethdev extended statistics */ void -rte_eth_xstats_reset(uint8_t port_id) +rte_eth_xstats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1837,7 +1837,7 @@ rte_eth_xstats_reset(uint8_t port_id) } static int -set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, +set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx) { struct rte_eth_dev *dev; @@ -1853,7 +1853,7 @@ set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, int -rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, @@ -1862,7 +1862,7 @@ rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, int -rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, @@ -1870,7 +1870,7 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) +rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; @@ -1882,7 +1882,7 @@ rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) } void -rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) +rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; const struct rte_eth_desc_lim lim = { @@ -1906,7 +1906,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) } int -rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num) { int i, j; @@ -1932,7 +1932,7 @@ rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, } void -rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) +rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -1943,7 +1943,7 @@ rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) int -rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) +rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) { struct rte_eth_dev *dev; @@ -1955,7 +1955,7 @@ rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) } int -rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) +rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) { int ret; struct rte_eth_dev *dev; @@ -1972,7 +1972,7 @@ rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) } int -rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) +rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) { struct rte_eth_dev *dev; int ret; @@ -2011,7 +2011,8 @@ rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) } int -rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int on) +rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, + int on) { struct rte_eth_dev *dev; @@ -2029,7 +2030,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int o } int -rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tpid) { @@ -2043,7 +2044,7 @@ rte_eth_dev_set_vlan_ether_type(uint8_t port_id, } int -rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) +rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) { struct rte_eth_dev *dev; int ret = 0; @@ -2086,7 +2087,7 @@ rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) } int -rte_eth_dev_get_vlan_offload(uint8_t port_id) +rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; int ret = 0; @@ -2107,7 +2108,7 @@ rte_eth_dev_get_vlan_offload(uint8_t port_id) } int -rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) +rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; @@ -2120,7 +2121,7 @@ rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) } int -rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2132,7 +2133,7 @@ rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2148,7 +2149,8 @@ rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf) +rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, + struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; @@ -2214,7 +2216,7 @@ rte_eth_check_reta_entry(struct rte_eth_rss_reta_entry64 *reta_conf, } int -rte_eth_dev_rss_reta_update(uint8_t port_id, +rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2240,7 +2242,7 @@ rte_eth_dev_rss_reta_update(uint8_t port_id, } int -rte_eth_dev_rss_reta_query(uint8_t port_id, +rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2260,7 +2262,8 @@ rte_eth_dev_rss_reta_query(uint8_t port_id, } int -rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) +rte_eth_dev_rss_hash_update(uint16_t port_id, + struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; uint16_t rss_hash_protos; @@ -2279,7 +2282,7 @@ rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) } int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; @@ -2291,7 +2294,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2313,7 +2316,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2336,7 +2339,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, } int -rte_eth_led_on(uint8_t port_id) +rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2347,7 +2350,7 @@ rte_eth_led_on(uint8_t port_id) } int -rte_eth_led_off(uint8_t port_id) +rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2362,7 +2365,7 @@ rte_eth_led_off(uint8_t port_id) * an empty spot. */ static int -get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2381,7 +2384,7 @@ get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) static const struct ether_addr null_mac_addr; int -rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, uint32_t pool) { struct rte_eth_dev *dev; @@ -2434,7 +2437,7 @@ rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; int index; @@ -2463,7 +2466,7 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) } int -rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; @@ -2489,7 +2492,7 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) * an empty spot. */ static int -get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2508,7 +2511,7 @@ get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) } int -rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, uint8_t on) { int index; @@ -2560,7 +2563,7 @@ rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) +rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; @@ -2572,7 +2575,7 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) return (*dev->dev_ops->uc_all_hash_table_set)(dev, on); } -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate) { struct rte_eth_dev *dev; @@ -2603,7 +2606,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, } int -rte_eth_mirror_rule_set(uint8_t port_id, +rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) { @@ -2641,7 +2644,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, } int -rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) +rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id) { struct rte_eth_dev *dev; @@ -2654,7 +2657,7 @@ rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) } int -rte_eth_dev_callback_register(uint8_t port_id, +rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2694,7 +2697,7 @@ rte_eth_dev_callback_register(uint8_t port_id, } int -rte_eth_dev_callback_unregister(uint8_t port_id, +rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2766,7 +2769,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, } int -rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) +rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) { uint32_t vec; struct rte_eth_dev *dev; @@ -2827,7 +2830,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, } int -rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data) { uint32_t vec; @@ -2867,7 +2870,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_rx_intr_enable(uint8_t port_id, +rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2881,7 +2884,7 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id, } int -rte_eth_dev_rx_intr_disable(uint8_t port_id, +rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2896,7 +2899,8 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id, int -rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) +rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type) { struct rte_eth_dev *dev; @@ -2909,7 +2913,7 @@ rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) } int -rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { struct rte_eth_dev *dev; @@ -2922,7 +2926,7 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, } void * -rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2964,7 +2968,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2999,7 +3003,7 @@ rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3042,7 +3046,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3076,7 +3080,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3110,7 +3114,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo) { struct rte_eth_dev *dev; @@ -3134,7 +3138,7 @@ rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo) { struct rte_eth_dev *dev; @@ -3158,7 +3162,7 @@ rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_set_mc_addr_list(uint8_t port_id, +rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) { @@ -3172,7 +3176,7 @@ rte_eth_dev_set_mc_addr_list(uint8_t port_id, } int -rte_eth_timesync_enable(uint8_t port_id) +rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3184,7 +3188,7 @@ rte_eth_timesync_enable(uint8_t port_id) } int -rte_eth_timesync_disable(uint8_t port_id) +rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3196,7 +3200,7 @@ rte_eth_timesync_disable(uint8_t port_id) } int -rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, +rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; @@ -3209,7 +3213,8 @@ rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, } int -rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_tx_timestamp(uint16_t port_id, + struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3221,7 +3226,7 @@ rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) +rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; @@ -3233,7 +3238,7 @@ rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) } int -rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3245,7 +3250,7 @@ rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) +rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3257,7 +3262,7 @@ rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) } int -rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) +rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; @@ -3269,7 +3274,7 @@ rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) } int -rte_eth_dev_get_eeprom_length(uint8_t port_id) +rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3281,7 +3286,7 @@ rte_eth_dev_get_eeprom_length(uint8_t port_id) } int -rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3293,7 +3298,7 @@ rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3305,7 +3310,7 @@ rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_get_dcb_info(uint8_t port_id, +rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; @@ -3320,7 +3325,7 @@ rte_eth_dev_get_dcb_info(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) { struct rte_eth_dev *dev; @@ -3343,7 +3348,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en) @@ -3387,7 +3392,7 @@ rte_eth_dev_adjust_nb_desc(uint16_t *nb_desc, } int -rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 0adf3274a..8617f0335 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1568,7 +1568,7 @@ struct eth_dev_ops { * @return * The number of packets returned to the user. */ -typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); @@ -1592,7 +1592,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, * @return * The number of packets to be written to the NIC. */ -typedef uint16_t (*rte_tx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param); /** @@ -1695,7 +1695,7 @@ struct rte_eth_dev_data { /** bitmap array of associating Ethernet MAC addresses to pools */ struct ether_addr* hash_mac_addrs; /** Device Ethernet MAC addresses of hash filtering. */ - uint8_t port_id; /**< Device [external] port identifier. */ + uint16_t port_id; /**< Device [external] port identifier. */ __extension__ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */ scattered_rx : 1, /**< RX of scattered packets is ON(1) / OFF(0) */ @@ -1737,7 +1737,7 @@ extern struct rte_eth_dev rte_eth_devices[]; * @return * Next valid port id, RTE_MAX_ETHPORTS if there is none. */ -uint8_t rte_eth_find_next(uint8_t port_id); +uint16_t rte_eth_find_next(uint16_t port_id); /** * Macro to iterate over all enabled ethdev ports. @@ -1821,7 +1821,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * @return * 0 on success and port_id is filled, negative on error */ -int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); +int rte_eth_dev_attach(const char *devargs, uint16_t *port_id); /** * Detach a Ethernet device specified by port identifier. @@ -1836,7 +1836,7 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); * @return * 0 on success and devname is filled, negative on error */ -int rte_eth_dev_detach(uint8_t port_id, char *devname); +int rte_eth_dev_detach(uint16_t port_id, char *devname); /** * Convert a numerical speed in Mbps to a bitmap flag that can be used in @@ -1880,7 +1880,7 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex); * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, +int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf); /** @@ -1935,7 +1935,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * allocate network memory buffers from the memory pool when * initializing receive descriptors. */ -int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); @@ -1983,7 +1983,7 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, * - 0: Success, the transmit queue is correctly set up. * - -ENOMEM: Unable to allocate the transmit ring descriptors. */ -int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); @@ -1997,7 +1997,7 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, * a default of zero if the socket could not be determined. * -1 is returned is the port_id value is out of range. */ -int rte_eth_dev_socket_id(uint8_t port_id); +int rte_eth_dev_socket_id(uint16_t port_id); /** * Check if port_id of device is attached @@ -2008,7 +2008,7 @@ int rte_eth_dev_socket_id(uint8_t port_id); * - 0 if port is out of range or not attached * - 1 if device is attached */ -int rte_eth_dev_is_valid_port(uint8_t port_id); +int rte_eth_dev_is_valid_port(uint16_t port_id); /** * Start specified RX queue of a port. It is used when rx_deferred_start @@ -2025,7 +2025,7 @@ int rte_eth_dev_is_valid_port(uint8_t port_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); /** * Stop specified RX queue of a port @@ -2041,7 +2041,7 @@ int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); /** * Start TX for specified queue of a port. It is used when tx_deferred_start @@ -2058,7 +2058,7 @@ int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); /** * Stop specified TX queue of a port @@ -2074,9 +2074,7 @@ int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); - - +int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id); /** * Start an Ethernet device. @@ -2093,7 +2091,7 @@ int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); * - 0: Success, Ethernet device started. * - <0: Error code of the driver device start function. */ -int rte_eth_dev_start(uint8_t port_id); +int rte_eth_dev_start(uint16_t port_id); /** * Stop an Ethernet device. The device can be restarted with a call to @@ -2102,7 +2100,7 @@ int rte_eth_dev_start(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_stop(uint8_t port_id); +void rte_eth_dev_stop(uint16_t port_id); /** @@ -2117,7 +2115,7 @@ void rte_eth_dev_stop(uint8_t port_id); * - 0: Success, Ethernet device linked up. * - <0: Error code of the driver device link up function. */ -int rte_eth_dev_set_link_up(uint8_t port_id); +int rte_eth_dev_set_link_up(uint16_t port_id); /** * Link down an Ethernet device. @@ -2128,7 +2126,7 @@ int rte_eth_dev_set_link_up(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_set_link_down(uint8_t port_id); +int rte_eth_dev_set_link_down(uint16_t port_id); /** * Close a stopped Ethernet device. The device cannot be restarted! @@ -2138,7 +2136,7 @@ int rte_eth_dev_set_link_down(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_close(uint8_t port_id); +void rte_eth_dev_close(uint16_t port_id); /** * Enable receipt in promiscuous mode for an Ethernet device. @@ -2146,7 +2144,7 @@ void rte_eth_dev_close(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_enable(uint8_t port_id); +void rte_eth_promiscuous_enable(uint16_t port_id); /** * Disable receipt in promiscuous mode for an Ethernet device. @@ -2154,7 +2152,7 @@ void rte_eth_promiscuous_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_disable(uint8_t port_id); +void rte_eth_promiscuous_disable(uint16_t port_id); /** * Return the value of promiscuous mode for an Ethernet device. @@ -2166,7 +2164,7 @@ void rte_eth_promiscuous_disable(uint8_t port_id); * - (0) if promiscuous is disabled. * - (-1) on error */ -int rte_eth_promiscuous_get(uint8_t port_id); +int rte_eth_promiscuous_get(uint16_t port_id); /** * Enable the receipt of any multicast frame by an Ethernet device. @@ -2174,7 +2172,7 @@ int rte_eth_promiscuous_get(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_enable(uint8_t port_id); +void rte_eth_allmulticast_enable(uint16_t port_id); /** * Disable the receipt of all multicast frames by an Ethernet device. @@ -2182,7 +2180,7 @@ void rte_eth_allmulticast_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_disable(uint8_t port_id); +void rte_eth_allmulticast_disable(uint16_t port_id); /** * Return the value of allmulticast mode for an Ethernet device. @@ -2194,7 +2192,7 @@ void rte_eth_allmulticast_disable(uint8_t port_id); * - (0) if allmulticast is disabled. * - (-1) on error */ -int rte_eth_allmulticast_get(uint8_t port_id); +int rte_eth_allmulticast_get(uint16_t port_id); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2207,7 +2205,7 @@ int rte_eth_allmulticast_get(uint8_t port_id); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2220,7 +2218,7 @@ void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the general I/O statistics of an Ethernet device. @@ -2239,7 +2237,7 @@ void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); +int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. @@ -2247,7 +2245,7 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_stats_reset(uint8_t port_id); +void rte_eth_stats_reset(uint16_t port_id); /** * Retrieve names of extended statistics of an Ethernet device. @@ -2269,7 +2267,7 @@ void rte_eth_stats_reset(uint8_t port_id); * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_names(uint8_t port_id, +int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size); @@ -2295,7 +2293,7 @@ int rte_eth_xstats_get_names(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n); /** @@ -2321,7 +2319,7 @@ int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, * - A negative value on error (invalid port id). */ int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids); @@ -2348,7 +2346,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, +int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, uint64_t *values, unsigned int n); /** @@ -2368,7 +2366,7 @@ int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, * -ENODEV for invalid port_id, * -EINVAL if the xstat_name doesn't exist in port_id */ -int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id); /** @@ -2377,7 +2375,7 @@ int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_xstats_reset(uint8_t port_id); +void rte_eth_xstats_reset(uint16_t port_id); /** * Set a mapping for the specified transmit queue to the specified per-queue @@ -2396,7 +2394,7 @@ void rte_eth_xstats_reset(uint8_t port_id); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx); /** @@ -2416,7 +2414,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx); @@ -2429,7 +2427,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. */ -void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -2440,7 +2438,7 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); * A pointer to a structure of type *rte_eth_dev_info* to be filled with * the contextual information of the Ethernet device. */ -void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); +void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info); /** * Retrieve the firmware version of a device. @@ -2460,7 +2458,7 @@ void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); * - (>0) if *fw_size* is not enough to store firmware version, return * the size of the non truncated string. */ -int rte_eth_dev_fw_version_get(uint8_t port_id, +int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size); /** @@ -2501,7 +2499,7 @@ int rte_eth_dev_fw_version_get(uint8_t port_id, * count of supported ptypes will be returned. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num); /** @@ -2515,7 +2513,7 @@ int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); +int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu); /** * Change the MTU of an Ethernet device. @@ -2531,7 +2529,7 @@ int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); * - (-EINVAL) if *mtu* invalid. * - (-EBUSY) if operation is not allowed when the port is running */ -int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); +int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu); /** * Enable/Disable hardware filtering by an Ethernet device of received @@ -2551,7 +2549,7 @@ int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); * - (-ENOSYS) if VLAN filtering on *port_id* disabled. * - (-EINVAL) if *vlan_id* > 4095. */ -int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); +int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on); /** * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. @@ -2572,7 +2570,7 @@ int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *rx_queue_id* invalid. */ -int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on); /** @@ -2591,7 +2589,7 @@ int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type); @@ -2615,7 +2613,7 @@ int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); +int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); /** * Read VLAN Offload configuration from an Ethernet device @@ -2629,7 +2627,7 @@ int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); * ETH_VLAN_EXTEND_OFFLOAD * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_vlan_offload(uint8_t port_id); +int rte_eth_dev_get_vlan_offload(uint16_t port_id); /** * Set port based TX VLAN insertion on or off. @@ -2645,7 +2643,7 @@ int rte_eth_dev_get_vlan_offload(uint8_t port_id); * - (0) if successful. * - negative if failed. */ -int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); +int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); /** * @@ -2730,7 +2728,7 @@ int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); * *rx_pkts* array. */ static inline uint16_t -rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2775,7 +2773,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, * (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) +rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2804,7 +2802,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) * - (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) +rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); @@ -2851,7 +2849,7 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) * - (-ENODEV) bad port or queue (only if compiled with debug). */ static inline int -rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2908,7 +2906,7 @@ rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, * - (-ENOTSUP) if the device does not support this function. * - (-ENODEV) bad port or queue (only if compiled with debug). */ -static inline int rte_eth_tx_descriptor_status(uint8_t port_id, +static inline int rte_eth_tx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2992,7 +2990,7 @@ static inline int rte_eth_tx_descriptor_status(uint8_t port_id, * *tx_pkts* parameter when the transmit ring is full or has been filled up. */ static inline uint16_t -rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3081,7 +3079,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, #ifndef RTE_ETHDEV_TX_PREPARE_NOOP static inline uint16_t -rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev; @@ -3123,7 +3121,8 @@ rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, */ static inline uint16_t -rte_eth_tx_prepare(__rte_unused uint8_t port_id, __rte_unused uint16_t queue_id, +rte_eth_tx_prepare(__rte_unused uint16_t port_id, + __rte_unused uint16_t queue_id, __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { return nb_pkts; @@ -3192,7 +3191,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size); * callback is called for any packets which could not be sent. */ static inline uint16_t -rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer) { uint16_t sent; @@ -3244,7 +3243,7 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, * the rest. */ static __rte_always_inline uint16_t -rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt) { buffer->pkts[buffer->length++] = tx_pkt; @@ -3360,7 +3359,7 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, * are in use. */ int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt); +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt); /** * The eth device event type for interrupt, and maybe others in the future. @@ -3378,7 +3377,7 @@ enum rte_eth_event_type { RTE_ETH_EVENT_MAX /**< max value of this enum */ }; -typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, +typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param); /**< user application callback to be registered for interrupts */ @@ -3400,7 +3399,7 @@ typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_register(uint8_t port_id, +int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3421,7 +3420,7 @@ int rte_eth_dev_callback_register(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_unregister(uint8_t port_id, +int rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3467,7 +3466,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id); /** * When lcore wakes up from rx interrupt indicating packet coming, disable rx @@ -3488,7 +3487,7 @@ int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id); /** * RX Interrupt control per port. @@ -3507,7 +3506,7 @@ int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); +int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data); /** * RX Interrupt control per queue. @@ -3530,7 +3529,7 @@ int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data); /** @@ -3545,7 +3544,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_on(uint8_t port_id); +int rte_eth_led_on(uint16_t port_id); /** * Turn off the LED on the Ethernet device. @@ -3559,7 +3558,7 @@ int rte_eth_led_on(uint8_t port_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_off(uint8_t port_id); +int rte_eth_led_off(uint16_t port_id); /** * Get current status of the Ethernet link flow control for Ethernet device @@ -3573,7 +3572,7 @@ int rte_eth_led_off(uint8_t port_id); * - (-ENOTSUP) if hardware doesn't support flow control. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_flow_ctrl_get(uint8_t port_id, +int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3590,7 +3589,7 @@ int rte_eth_dev_flow_ctrl_get(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3608,7 +3607,7 @@ int rte_eth_dev_flow_ctrl_set(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf); /** @@ -3629,7 +3628,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t pool); /** @@ -3645,7 +3644,7 @@ int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EADDRINUSE) if attempting to remove the default MAC address */ -int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr); /** * Set the default MAC address. @@ -3660,8 +3659,8 @@ int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); - +int rte_eth_dev_default_mac_addr_set(uint16_t port, + struct ether_addr *mac_addr); /** * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device. @@ -3678,7 +3677,7 @@ int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_update(uint8_t port, +int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3697,7 +3696,7 @@ int rte_eth_dev_rss_reta_update(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_query(uint8_t port, +int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3719,8 +3718,8 @@ int rte_eth_dev_rss_reta_query(uint8_t port, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, - uint8_t on); +int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, + uint8_t on); /** * Updates all unicast hash bitmaps for receiving packet with any Unicast @@ -3739,7 +3738,7 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); +int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on); /** * Set a traffic mirroring rule on an Ethernet device @@ -3762,7 +3761,7 @@ int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if the mr_conf information is not correct. */ -int rte_eth_mirror_rule_set(uint8_t port_id, +int rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on); @@ -3780,7 +3779,7 @@ int rte_eth_mirror_rule_set(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_mirror_rule_reset(uint8_t port_id, +int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id); /** @@ -3798,7 +3797,7 @@ int rte_eth_mirror_rule_reset(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate); /** @@ -3814,7 +3813,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_hash_update(uint8_t port_id, +int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3831,7 +3830,7 @@ int rte_eth_dev_rss_hash_update(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support RSS. */ int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3852,7 +3851,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3874,7 +3873,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3890,7 +3889,8 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support this filter type. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type); +int rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type); /** * Take operations to assigned filter type on an Ethernet device. @@ -3910,7 +3910,7 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg); /** @@ -3925,7 +3925,7 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, * - (-ENODEV) if port identifier is invalid. * - (-ENOTSUP) if hardware doesn't support. */ -int rte_eth_dev_get_dcb_info(uint8_t port_id, +int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info); /** @@ -3952,7 +3952,7 @@ int rte_eth_dev_get_dcb_info(uint8_t port_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -3980,7 +3980,7 @@ void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4007,7 +4007,7 @@ void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param); /** @@ -4040,7 +4040,7 @@ void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4073,7 +4073,7 @@ int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4093,7 +4093,7 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); /** @@ -4113,7 +4113,7 @@ int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo); /** @@ -4132,7 +4132,7 @@ int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); +int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info); /** * Retrieve size of device EEPROM @@ -4145,7 +4145,7 @@ int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom_length(uint8_t port_id); +int rte_eth_dev_get_eeprom_length(uint16_t port_id); /** * Retrieve EEPROM and EEPROM attribute @@ -4161,7 +4161,7 @@ int rte_eth_dev_get_eeprom_length(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Program EEPROM with provided data @@ -4177,7 +4177,7 @@ int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Set the list of multicast addresses to filter on an Ethernet device. @@ -4196,7 +4196,7 @@ int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering. * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ -int rte_eth_dev_set_mc_addr_list(uint8_t port_id, +int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr); @@ -4211,7 +4211,7 @@ int rte_eth_dev_set_mc_addr_list(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_enable(uint8_t port_id); +int rte_eth_timesync_enable(uint16_t port_id); /** * Disable IEEE1588/802.1AS timestamping for an Ethernet device. @@ -4224,7 +4224,7 @@ int rte_eth_timesync_enable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_disable(uint8_t port_id); +int rte_eth_timesync_disable(uint16_t port_id); /** * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device. @@ -4243,7 +4243,7 @@ int rte_eth_timesync_disable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags); /** @@ -4260,7 +4260,7 @@ int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp); /** @@ -4279,7 +4279,7 @@ int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); +int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta); /** * Read the time from the timesync clock on an Ethernet device. @@ -4295,7 +4295,7 @@ int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); * @return * - 0: Success. */ -int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); +int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time); /** * Set the time of the timesync clock on an Ethernet device. @@ -4314,7 +4314,7 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time); +int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time); /** * Create memzone for HW rings. @@ -4355,7 +4355,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel); /** @@ -4382,7 +4382,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en); @@ -4400,7 +4400,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, * - (-ENODEV or -EINVAL) on failure. */ int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id); /** * Get the device name from port id @@ -4414,7 +4414,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); * - (-EINVAL) on failure. */ int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name); /** * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from @@ -4432,7 +4432,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); * - (0) if successful. * - (-ENOTSUP, -ENODEV or -EINVAL) on failure. */ -int rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc); diff --git a/lib/librte_ether/rte_tm.c b/lib/librte_ether/rte_tm.c index 71679650e..ceac34115 100644 --- a/lib/librte_ether/rte_tm.c +++ b/lib/librte_ether/rte_tm.c @@ -40,7 +40,7 @@ /* Get generic traffic manager operations structure from a port. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_tm_ops *ops; @@ -87,7 +87,7 @@ rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) /* Get number of leaf nodes */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error) { @@ -113,7 +113,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, /* Check node type (leaf or non-leaf) */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error) @@ -124,7 +124,7 @@ rte_tm_node_type_get(uint8_t port_id, } /* Get capabilities */ -int rte_tm_capabilities_get(uint8_t port_id, +int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error) { @@ -134,7 +134,7 @@ int rte_tm_capabilities_get(uint8_t port_id, } /* Get level capabilities */ -int rte_tm_level_capabilities_get(uint8_t port_id, +int rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error) @@ -145,7 +145,7 @@ int rte_tm_level_capabilities_get(uint8_t port_id, } /* Get node capabilities */ -int rte_tm_node_capabilities_get(uint8_t port_id, +int rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error) @@ -156,7 +156,7 @@ int rte_tm_node_capabilities_get(uint8_t port_id, } /* Add WRED profile */ -int rte_tm_wred_profile_add(uint8_t port_id, +int rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error) @@ -167,7 +167,7 @@ int rte_tm_wred_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_wred_profile_delete(uint8_t port_id, +int rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error) { @@ -177,7 +177,7 @@ int rte_tm_wred_profile_delete(uint8_t port_id, } /* Add/update shared WRED context */ -int rte_tm_shared_wred_context_add_update(uint8_t port_id, +int rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -188,7 +188,7 @@ int rte_tm_shared_wred_context_add_update(uint8_t port_id, } /* Delete shared WRED context */ -int rte_tm_shared_wred_context_delete(uint8_t port_id, +int rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error) { @@ -198,7 +198,7 @@ int rte_tm_shared_wred_context_delete(uint8_t port_id, } /* Add shaper profile */ -int rte_tm_shaper_profile_add(uint8_t port_id, +int rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error) @@ -209,7 +209,7 @@ int rte_tm_shaper_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_shaper_profile_delete(uint8_t port_id, +int rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error) { @@ -219,7 +219,7 @@ int rte_tm_shaper_profile_delete(uint8_t port_id, } /* Add shared shaper */ -int rte_tm_shared_shaper_add_update(uint8_t port_id, +int rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -230,7 +230,7 @@ int rte_tm_shared_shaper_add_update(uint8_t port_id, } /* Delete shared shaper */ -int rte_tm_shared_shaper_delete(uint8_t port_id, +int rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error) { @@ -240,7 +240,7 @@ int rte_tm_shared_shaper_delete(uint8_t port_id, } /* Add node to port traffic manager hierarchy */ -int rte_tm_node_add(uint8_t port_id, +int rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -256,7 +256,7 @@ int rte_tm_node_add(uint8_t port_id, } /* Delete node from traffic manager hierarchy */ -int rte_tm_node_delete(uint8_t port_id, +int rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -266,7 +266,7 @@ int rte_tm_node_delete(uint8_t port_id, } /* Suspend node */ -int rte_tm_node_suspend(uint8_t port_id, +int rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -276,7 +276,7 @@ int rte_tm_node_suspend(uint8_t port_id, } /* Resume node */ -int rte_tm_node_resume(uint8_t port_id, +int rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -286,7 +286,7 @@ int rte_tm_node_resume(uint8_t port_id, } /* Commit the initial port traffic manager hierarchy */ -int rte_tm_hierarchy_commit(uint8_t port_id, +int rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error) { @@ -296,7 +296,7 @@ int rte_tm_hierarchy_commit(uint8_t port_id, } /* Update node parent */ -int rte_tm_node_parent_update(uint8_t port_id, +int rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -309,7 +309,7 @@ int rte_tm_node_parent_update(uint8_t port_id, } /* Update node private shaper */ -int rte_tm_node_shaper_update(uint8_t port_id, +int rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -320,7 +320,7 @@ int rte_tm_node_shaper_update(uint8_t port_id, } /* Update node shared shapers */ -int rte_tm_node_shared_shaper_update(uint8_t port_id, +int rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -332,7 +332,7 @@ int rte_tm_node_shared_shaper_update(uint8_t port_id, } /* Update node stats */ -int rte_tm_node_stats_update(uint8_t port_id, +int rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error) @@ -343,7 +343,7 @@ int rte_tm_node_stats_update(uint8_t port_id, } /* Update WFQ weight mode */ -int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -355,7 +355,7 @@ int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, } /* Update node congestion management mode */ -int rte_tm_node_cman_update(uint8_t port_id, +int rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error) @@ -366,7 +366,7 @@ int rte_tm_node_cman_update(uint8_t port_id, } /* Update node private WRED context */ -int rte_tm_node_wred_context_update(uint8_t port_id, +int rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -377,7 +377,7 @@ int rte_tm_node_wred_context_update(uint8_t port_id, } /* Update node shared WRED context */ -int rte_tm_node_shared_wred_context_update(uint8_t port_id, +int rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -389,7 +389,7 @@ int rte_tm_node_shared_wred_context_update(uint8_t port_id, } /* Read and/or clear stats counters for specific node */ -int rte_tm_node_stats_read(uint8_t port_id, +int rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -402,7 +402,7 @@ int rte_tm_node_stats_read(uint8_t port_id, } /* Packet marking - VLAN DEI */ -int rte_tm_mark_vlan_dei(uint8_t port_id, +int rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -414,7 +414,7 @@ int rte_tm_mark_vlan_dei(uint8_t port_id, } /* Packet marking - IPv4/IPv6 ECN */ -int rte_tm_mark_ip_ecn(uint8_t port_id, +int rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -426,7 +426,7 @@ int rte_tm_mark_ip_ecn(uint8_t port_id, } /* Packet marking - IPv4/IPv6 DSCP */ -int rte_tm_mark_ip_dscp(uint8_t port_id, +int rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm.h b/lib/librte_ether/rte_tm.h index ebbfa1eec..2b25a8715 100644 --- a/lib/librte_ether/rte_tm.h +++ b/lib/librte_ether/rte_tm.h @@ -1040,7 +1040,7 @@ struct rte_tm_error { * 0 on success, non-zero error code otherwise. */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error); @@ -1064,7 +1064,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error); @@ -1082,7 +1082,7 @@ rte_tm_node_type_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_capabilities_get(uint8_t port_id, +rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error); @@ -1102,7 +1102,7 @@ rte_tm_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_level_capabilities_get(uint8_t port_id, +rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error); @@ -1122,7 +1122,7 @@ rte_tm_level_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_capabilities_get(uint8_t port_id, +rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error); @@ -1147,7 +1147,7 @@ rte_tm_node_capabilities_get(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_add(uint8_t port_id, +rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error); @@ -1170,7 +1170,7 @@ rte_tm_wred_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_delete(uint8_t port_id, +rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1201,7 +1201,7 @@ rte_tm_wred_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_add_update(uint8_t port_id, +rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1225,7 +1225,7 @@ rte_tm_shared_wred_context_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_delete(uint8_t port_id, +rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error); @@ -1249,7 +1249,7 @@ rte_tm_shared_wred_context_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_add(uint8_t port_id, +rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error); @@ -1272,7 +1272,7 @@ rte_tm_shaper_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_delete(uint8_t port_id, +rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1301,7 +1301,7 @@ rte_tm_shaper_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_add_update(uint8_t port_id, +rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1324,7 +1324,7 @@ rte_tm_shared_shaper_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_delete(uint8_t port_id, +rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error); @@ -1392,7 +1392,7 @@ rte_tm_shared_shaper_delete(uint8_t port_id, * @see struct rte_tm_capabilities */ int -rte_tm_node_add(uint8_t port_id, +rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1425,7 +1425,7 @@ rte_tm_node_add(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_ADD_DELETE */ int -rte_tm_node_delete(uint8_t port_id, +rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1449,7 +1449,7 @@ rte_tm_node_delete(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_suspend(uint8_t port_id, +rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1472,7 +1472,7 @@ rte_tm_node_suspend(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_resume(uint8_t port_id, +rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1513,7 +1513,7 @@ rte_tm_node_resume(uint8_t port_id, * @see rte_tm_node_delete() */ int -rte_tm_hierarchy_commit(uint8_t port_id, +rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error); @@ -1549,7 +1549,7 @@ rte_tm_hierarchy_commit(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_PARENT_CHANGE_LEVEL */ int -rte_tm_node_parent_update(uint8_t port_id, +rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1578,7 +1578,7 @@ rte_tm_node_parent_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_private_n_max */ int -rte_tm_node_shaper_update(uint8_t port_id, +rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1605,7 +1605,7 @@ rte_tm_node_shaper_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_node_shared_shaper_update(uint8_t port_id, +rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -1632,7 +1632,7 @@ rte_tm_node_shared_shaper_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_STATS */ int -rte_tm_node_stats_update(uint8_t port_id, +rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error); @@ -1660,7 +1660,7 @@ rte_tm_node_stats_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_N_SP_PRIORITIES */ int -rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -1683,7 +1683,7 @@ rte_tm_node_wfq_weight_mode_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_CMAN */ int -rte_tm_node_cman_update(uint8_t port_id, +rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error); @@ -1707,7 +1707,7 @@ rte_tm_node_cman_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_private_n_max */ int -rte_tm_node_wred_context_update(uint8_t port_id, +rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1732,7 +1732,7 @@ rte_tm_node_wred_context_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_node_shared_wred_context_update(uint8_t port_id, +rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -1764,7 +1764,7 @@ rte_tm_node_shared_wred_context_update(uint8_t port_id, * @see enum rte_tm_stats_type */ int -rte_tm_node_stats_read(uint8_t port_id, +rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -1801,7 +1801,7 @@ rte_tm_node_stats_read(uint8_t port_id, * @see struct rte_tm_capabilities::mark_vlan_dei_supported */ int -rte_tm_mark_vlan_dei(uint8_t port_id, +rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1851,7 +1851,7 @@ rte_tm_mark_vlan_dei(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_ecn_sctp_supported */ int -rte_tm_mark_ip_ecn(uint8_t port_id, +rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1899,7 +1899,7 @@ rte_tm_mark_ip_ecn(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_dscp_supported */ int -rte_tm_mark_ip_dscp(uint8_t port_id, +rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm_driver.h b/lib/librte_ether/rte_tm_driver.h index a5b698fe0..b2e8ccf80 100644 --- a/lib/librte_ether/rte_tm_driver.h +++ b/lib/librte_ether/rte_tm_driver.h @@ -357,7 +357,7 @@ rte_tm_error_set(struct rte_tm_error *error, * success, NULL otherwise. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error); +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error); #ifdef __cplusplus } diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c index ce029a12c..d59937bf9 100644 --- a/lib/librte_latencystats/rte_latencystats.c +++ b/lib/librte_latencystats/rte_latencystats.c @@ -135,7 +135,7 @@ rte_latencystats_fill_values(struct rte_metric_value *values) } static uint16_t -add_time_stamps(uint8_t pid __rte_unused, +add_time_stamps(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -165,7 +165,7 @@ add_time_stamps(uint8_t pid __rte_unused, } static uint16_t -calc_latency(uint8_t pid __rte_unused, +calc_latency(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -226,7 +226,7 @@ rte_latencystats_init(uint64_t app_samp_intvl, rte_latency_stats_flow_type_fn user_cb) { unsigned int i; - uint8_t pid; + uint16_t pid; uint16_t qid; struct rxtx_cbs *cbs = NULL; const uint8_t nb_ports = rte_eth_dev_count(); @@ -290,7 +290,7 @@ rte_latencystats_init(uint64_t app_samp_intvl, int rte_latencystats_uninit(void) { - uint8_t pid; + uint16_t pid; uint16_t qid; int ret = 0; struct rxtx_cbs *cbs = NULL; diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 729e79a36..e6182d35c 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -207,7 +207,7 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) } static uint16_t -pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_params) @@ -217,7 +217,7 @@ pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static uint16_t -pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) { pdump_copy(pkts, nb_pkts, user_params); @@ -225,7 +225,7 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static int -pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -279,7 +279,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, } static int -pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -337,7 +337,7 @@ static int set_pdump_rxtx_cbs(struct pdump_request *p) { uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue; - uint8_t port; + uint16_t port; int ret = 0; uint32_t flags; uint16_t operation; @@ -764,7 +764,7 @@ pdump_validate_flags(uint32_t flags) } static int -pdump_validate_port(uint8_t port, char *name) +pdump_validate_port(uint16_t port, char *name) { int ret = 0; @@ -828,7 +828,7 @@ pdump_prepare_client_request(char *device, uint16_t queue, } int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter) @@ -876,7 +876,7 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue, } int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags) +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags) { int ret = 0; char name[DEVICE_ID_SIZE]; diff --git a/lib/librte_pdump/rte_pdump.h b/lib/librte_pdump/rte_pdump.h index ba6e39b09..4ec0a106f 100644 --- a/lib/librte_pdump/rte_pdump.h +++ b/lib/librte_pdump/rte_pdump.h @@ -113,7 +113,7 @@ rte_pdump_uninit(void); */ int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter); @@ -136,7 +136,7 @@ rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, */ int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags); +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags); /** * Enables packet capturing on given device id and queue. diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c index d5c5fba55..4ed10f276 100644 --- a/lib/librte_port/rte_port_ethdev.c +++ b/lib/librte_port/rte_port_ethdev.c @@ -60,7 +60,7 @@ struct rte_port_ethdev_reader { struct rte_port_in_stats stats; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -156,7 +156,7 @@ struct rte_port_ethdev_writer { uint16_t tx_buf_count; uint64_t bsz_mask; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -337,7 +337,7 @@ struct rte_port_ethdev_writer_nodrop { uint64_t bsz_mask; uint64_t n_retries; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * diff --git a/lib/librte_port/rte_port_ethdev.h b/lib/librte_port/rte_port_ethdev.h index 201a79e41..f5ed9ab2d 100644 --- a/lib/librte_port/rte_port_ethdev.h +++ b/lib/librte_port/rte_port_ethdev.h @@ -54,7 +54,7 @@ extern "C" { /** ethdev_reader port parameters */ struct rte_port_ethdev_reader_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -66,7 +66,7 @@ extern struct rte_port_in_ops rte_port_ethdev_reader_ops; /** ethdev_writer port parameters */ struct rte_port_ethdev_writer_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -82,7 +82,7 @@ extern struct rte_port_out_ops rte_port_ethdev_writer_ops; /** ethdev_writer_nodrop port parameters */ struct rte_port_ethdev_writer_nodrop_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] ethdev: increase port_id range 2017-08-09 8:42 ` [dpdk-dev] [PATCH 1/2] ethdev: " Zhiyong Yang @ 2017-08-09 12:52 ` Ferruh Yigit 2017-08-09 12:57 ` Wiles, Keith 2017-08-10 0:51 ` Yang, Zhiyong 0 siblings, 2 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-08-09 12:52 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas On 8/9/2017 9:42 AM, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib > ethdev data structures, specifically rte_eth_dev_data and > modify the APIs using port_id at the same time. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > --- > app/pdump/main.c | 2 +- > app/test-pmd/cmdline.c | 4 +- > app/test-pmd/testpmd.c | 4 +- > app/test-pmd/testpmd.h | 2 +- > drivers/net/bonding/rte_eth_bond.h | 40 ++--- > drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- > drivers/net/bonding/rte_eth_bond_api.c | 54 +++---- > drivers/net/bonding/rte_eth_bond_pmd.c | 10 +- > drivers/net/bonding/rte_eth_bond_private.h | 36 ++--- > drivers/net/failsafe/failsafe_ether.c | 4 +- > drivers/net/failsafe/failsafe_private.h | 4 +- > drivers/net/ring/rte_eth_ring.c | 2 +- I would expect more drivers would be effected from this, almost all. Most PMDs stores the dev->data->port_in in their private data and use this value while updating mbuf field, those local storage also should be updated to u16 to prevent data loss. Can you please double check drivers, specially data->port_id usages? I quickly checked null and pcap for example, both needs to be updated. Also PMDs with PMD specific API are getting port_id as parameter, so they should be updated too. And I am getting build error for ixgbe and i40e for log type format, - via clang. Thanks, ferruh > lib/librte_ether/rte_ethdev.c | 231 ++++++++++++++-------------- > lib/librte_ether/rte_ethdev.h | 236 ++++++++++++++--------------- > lib/librte_ether/rte_tm.c | 62 ++++---- > lib/librte_ether/rte_tm.h | 60 ++++---- > lib/librte_ether/rte_tm_driver.h | 2 +- > lib/librte_latencystats/rte_latencystats.c | 8 +- > lib/librte_pdump/rte_pdump.c | 16 +- > lib/librte_pdump/rte_pdump.h | 4 +- > lib/librte_port/rte_port_ethdev.c | 6 +- > lib/librte_port/rte_port_ethdev.h | 6 +- > 22 files changed, 404 insertions(+), 395 deletions(-) <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] ethdev: increase port_id range 2017-08-09 12:52 ` Ferruh Yigit @ 2017-08-09 12:57 ` Wiles, Keith 2017-08-10 0:53 ` Yang, Zhiyong 2017-08-10 0:51 ` Yang, Zhiyong 1 sibling, 1 reply; 101+ messages in thread From: Wiles, Keith @ 2017-08-09 12:57 UTC (permalink / raw) To: Yigit, Ferruh; +Cc: Yang, Zhiyong, dev, thomas > On Aug 9, 2017, at 7:52 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote: > > On 8/9/2017 9:42 AM, Zhiyong Yang wrote: >> Extend port_id definition from uint8_t to uint16_t in lib >> ethdev data structures, specifically rte_eth_dev_data and >> modify the APIs using port_id at the same time. If we have not already decided, we need to apply this patch very soon to hammer out all of the bugs before the next release. >> >> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> >> --- >> app/pdump/main.c | 2 +- >> app/test-pmd/cmdline.c | 4 +- >> app/test-pmd/testpmd.c | 4 +- >> app/test-pmd/testpmd.h | 2 +- > >> drivers/net/bonding/rte_eth_bond.h | 40 ++--- >> drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- >> drivers/net/bonding/rte_eth_bond_api.c | 54 +++---- >> drivers/net/bonding/rte_eth_bond_pmd.c | 10 +- >> drivers/net/bonding/rte_eth_bond_private.h | 36 ++--- >> drivers/net/failsafe/failsafe_ether.c | 4 +- >> drivers/net/failsafe/failsafe_private.h | 4 +- >> drivers/net/ring/rte_eth_ring.c | 2 +- > > I would expect more drivers would be effected from this, almost all. > > Most PMDs stores the dev->data->port_in in their private data and use > this value while updating mbuf field, those local storage also should be > updated to u16 to prevent data loss. > > Can you please double check drivers, specially data->port_id usages? > I quickly checked null and pcap for example, both needs to be updated. > > Also PMDs with PMD specific API are getting port_id as parameter, so > they should be updated too. > > And I am getting build error for ixgbe and i40e for log type format, - > via clang. > > Thanks, > ferruh > >> lib/librte_ether/rte_ethdev.c | 231 ++++++++++++++-------------- >> lib/librte_ether/rte_ethdev.h | 236 ++++++++++++++--------------- >> lib/librte_ether/rte_tm.c | 62 ++++---- >> lib/librte_ether/rte_tm.h | 60 ++++---- >> lib/librte_ether/rte_tm_driver.h | 2 +- >> lib/librte_latencystats/rte_latencystats.c | 8 +- >> lib/librte_pdump/rte_pdump.c | 16 +- >> lib/librte_pdump/rte_pdump.h | 4 +- >> lib/librte_port/rte_port_ethdev.c | 6 +- >> lib/librte_port/rte_port_ethdev.h | 6 +- >> 22 files changed, 404 insertions(+), 395 deletions(-) > > <...> Regards, Keith ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] ethdev: increase port_id range 2017-08-09 12:57 ` Wiles, Keith @ 2017-08-10 0:53 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-08-10 0:53 UTC (permalink / raw) To: Wiles, Keith, Yigit, Ferruh; +Cc: dev, thomas > -----Original Message----- > From: Wiles, Keith > Sent: Wednesday, August 9, 2017 8:58 PM > To: Yigit, Ferruh <ferruh.yigit@intel.com> > Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; > thomas@monjalon.net > Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: increase port_id range > > > > On Aug 9, 2017, at 7:52 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote: > > > > On 8/9/2017 9:42 AM, Zhiyong Yang wrote: > >> Extend port_id definition from uint8_t to uint16_t in lib ethdev data > >> structures, specifically rte_eth_dev_data and modify the APIs using > >> port_id at the same time. > > If we have not already decided, we need to apply this patch very soon to > hammer out all of the bugs before the next release. Agreed seriously. :) Thanks Zhiyong > > Regards, > Keith ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] ethdev: increase port_id range 2017-08-09 12:52 ` Ferruh Yigit 2017-08-09 12:57 ` Wiles, Keith @ 2017-08-10 0:51 ` Yang, Zhiyong 1 sibling, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-08-10 0:51 UTC (permalink / raw) To: Yigit, Ferruh, dev; +Cc: thomas Hi, Ferruh: > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, August 9, 2017 8:53 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net > Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: increase port_id range > > On 8/9/2017 9:42 AM, Zhiyong Yang wrote: > > Extend port_id definition from uint8_t to uint16_t in lib ethdev data > > structures, specifically rte_eth_dev_data and modify the APIs using > > port_id at the same time. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > --- > > app/pdump/main.c | 2 +- > > app/test-pmd/cmdline.c | 4 +- > > app/test-pmd/testpmd.c | 4 +- > > app/test-pmd/testpmd.h | 2 +- > > > drivers/net/bonding/rte_eth_bond.h | 40 ++--- > > drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- > > drivers/net/bonding/rte_eth_bond_api.c | 54 +++---- > > drivers/net/bonding/rte_eth_bond_pmd.c | 10 +- > > drivers/net/bonding/rte_eth_bond_private.h | 36 ++--- > > drivers/net/failsafe/failsafe_ether.c | 4 +- > > drivers/net/failsafe/failsafe_private.h | 4 +- > > drivers/net/ring/rte_eth_ring.c | 2 +- > > I would expect more drivers would be effected from this, almost all. > > Most PMDs stores the dev->data->port_in in their private data and use this value > while updating mbuf field, those local storage also should be updated to u16 to > prevent data loss. > > Can you please double check drivers, specially data->port_id usages? > I quickly checked null and pcap for example, both needs to be updated. > > Also PMDs with PMD specific API are getting port_id as parameter, so they > should be updated too. Thanks for your reminder. I will double check them. > > And I am getting build error for ixgbe and i40e for log type format, - via clang. I see them just now and fix them later. Thanks Zhiyong > > Thanks, > ferruh ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH 2/2] examples: increase port_id range 2017-08-09 8:42 [dpdk-dev] [PATCH 0/2] increase port_id range Zhiyong Yang 2017-08-09 8:42 ` [dpdk-dev] [PATCH 1/2] ethdev: " Zhiyong Yang @ 2017-08-09 8:42 ` Zhiyong Yang 2017-08-09 14:48 ` Stephen Hemminger 2017-08-09 9:00 ` [dpdk-dev] [PATCH 0/2] " De Lara Guarch, Pablo 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang 3 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-08-09 8:42 UTC (permalink / raw) To: dev; +Cc: thomas, Zhiyong Yang Modify port_id related code in examples accordingly since port_id definition in lib changes. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- examples/bond/main.c | 6 +++--- examples/ip_fragmentation/main.c | 4 ++-- examples/l3fwd-power/main.c | 7 ++++--- examples/l3fwd/l3fwd.h | 10 +++++----- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_lpm.c | 2 +- examples/link_status_interrupt/main.c | 5 +++-- examples/performance-thread/l3fwd-thread/main.c | 7 ++++--- examples/rxtx_callbacks/main.c | 8 ++++---- 9 files changed, 27 insertions(+), 24 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index 2d019d433..231906072 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -144,7 +144,7 @@ uint8_t slaves[RTE_MAX_ETHPORTS]; uint8_t slaves_count; -static uint8_t BOND_PORT = 0xff; +static uint16_t BOND_PORT = 0xff; static struct rte_mempool *mbuf_pool; @@ -234,7 +234,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "Faled to create bond port\n"); - BOND_PORT = (uint8_t)retval; + BOND_PORT = (uint16_t)retval; retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); if (retval != 0) @@ -675,7 +675,7 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result, struct cmdline *cl, __attribute__((unused)) void *data) { - uint8_t slaves[16] = {0}; + uint16_t slaves[16] = {0}; uint8_t len = 16; struct ether_addr addr; uint8_t i = 0; diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8c0e17911..a8e2a8657 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -708,7 +708,7 @@ parse_ptype(struct rte_mbuf *m) /* callback function to detect packet type for a queue of a port */ static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -876,7 +876,7 @@ main(int argc, char **argv) uint16_t queueid = 0; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd442f5ef..a64188a5b 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -634,7 +634,7 @@ parse_ptype_one(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -648,7 +648,7 @@ cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, } static int -add_cb_parse_ptype(uint8_t portid, uint16_t queueid) +add_cb_parse_ptype(uint16_t portid, uint16_t queueid) { printf("Port %d: softly parse packet type info\n", portid); if (rte_eth_add_rx_callback(portid, queueid, cb_parse_ptype, NULL)) @@ -1651,7 +1651,8 @@ main(int argc, char **argv) uint64_t hz; uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + uint16_t portid; uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index 011ba148b..d1d14f957 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -83,7 +83,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -117,7 +117,7 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE]; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -139,7 +139,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 int send_single_packet(struct lcore_conf *qconf, - struct rte_mbuf *m, uint8_t port) + struct rte_mbuf *m, uint16_t port) { uint16_t len; @@ -212,11 +212,11 @@ int lpm_check_ptype(int portid); uint16_t -em_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +em_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); uint16_t -lpm_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); int diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 53d081bd7..df38a1362 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -628,7 +628,7 @@ em_parse_ptype(struct rte_mbuf *m) } uint16_t -em_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index ff1e40355..1cb9dccf7 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -413,7 +413,7 @@ lpm_parse_ptype(struct rte_mbuf *m) } uint16_t -lpm_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f4e3969a6..e923243a2 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -470,7 +470,7 @@ lsi_parse_args(int argc, char **argv) * int. */ static int -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, void *ret_param) { struct rte_eth_link link; @@ -498,7 +498,8 @@ check_all_ports_link_status(uint8_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"); diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 7954b9744..826e08dca 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -140,7 +140,7 @@ parse_ptype(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(__rte_unused uint8_t port, __rte_unused uint16_t queue, +cb_parse_ptype(__rte_unused uint16_t port, __rte_unused uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, __rte_unused uint16_t max_pkts, __rte_unused void *user_param) { @@ -3497,10 +3497,11 @@ main(int argc, char **argv) int ret; int i; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 669924055..e66f16f25 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -59,7 +59,7 @@ static struct { 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, uint16_t max_pkts __rte_unused, void *_ __rte_unused) { @@ -72,7 +72,7 @@ add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } 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; @@ -97,7 +97,7 @@ calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused, * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; - uint8_t portid; + uint16_t portid; /* init EAL */ int ret = rte_eal_init(argc, argv); -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] examples: increase port_id range 2017-08-09 8:42 ` [dpdk-dev] [PATCH 2/2] examples: " Zhiyong Yang @ 2017-08-09 14:48 ` Stephen Hemminger 2017-08-10 1:03 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Stephen Hemminger @ 2017-08-09 14:48 UTC (permalink / raw) To: Zhiyong Yang; +Cc: dev, thomas On Wed, 9 Aug 2017 16:42:03 +0800 Zhiyong Yang <zhiyong.yang@intel.com> wrote: > - BOND_PORT = (uint8_t)retval; > + BOND_PORT = (uint16_t)retval; > The cast here is unnecessary (in C). Please remove it. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] examples: increase port_id range 2017-08-09 14:48 ` Stephen Hemminger @ 2017-08-10 1:03 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-08-10 1:03 UTC (permalink / raw) To: Stephen Hemminger; +Cc: dev, thomas Hi, Stephen: > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Wednesday, August 9, 2017 10:49 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com> > Cc: dev@dpdk.org; thomas@monjalon.net > Subject: Re: [dpdk-dev] [PATCH 2/2] examples: increase port_id range > > On Wed, 9 Aug 2017 16:42:03 +0800 > Zhiyong Yang <zhiyong.yang@intel.com> wrote: > > > - BOND_PORT = (uint8_t)retval; > > + BOND_PORT = (uint16_t)retval; > > > > The cast here is unnecessary (in C). Please remove it. Ok, remove it. Thanks Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] increase port_id range 2017-08-09 8:42 [dpdk-dev] [PATCH 0/2] increase port_id range Zhiyong Yang 2017-08-09 8:42 ` [dpdk-dev] [PATCH 1/2] ethdev: " Zhiyong Yang 2017-08-09 8:42 ` [dpdk-dev] [PATCH 2/2] examples: " Zhiyong Yang @ 2017-08-09 9:00 ` De Lara Guarch, Pablo 2017-08-09 9:17 ` Yang, Zhiyong 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang 3 siblings, 1 reply; 101+ messages in thread From: De Lara Guarch, Pablo @ 2017-08-09 9:00 UTC (permalink / raw) To: Yang, Zhiyong, dev; +Cc: thomas Hi Zhiyong, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > Sent: Wednesday, August 9, 2017 9:42 AM > To: dev@dpdk.org > Cc: thomas@monjalon.net > Subject: [dpdk-dev] [PATCH 0/2] increase port_id range > > port_id is currently defined as uint8_t, which is limited to the range 0 to > 255. A larger range is required for vdev scalability. > > It is necessary for a redefinition of port_id to extend it from 1 bytes to > 2 bytes. All ethdev APIs and usages related to port_id will be changed at the > same time. > > Below is an API/ABI change notice for DPDK 17.11. > http://www.dpdk.org/dev/patchwork/patch/27475/ > > Discussion about port_id is the following thread. > http://www.dpdk.org/dev/patchwork/patch/23208/ > > Zhiyong Yang (2): > ethdev: increase port_id range > examples: increase port_id range > > app/pdump/main.c | 2 +- > app/test-pmd/cmdline.c | 4 +- > app/test-pmd/testpmd.c | 4 +- > app/test-pmd/testpmd.h | 2 +- > drivers/net/bonding/rte_eth_bond.h | 40 ++-- > drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- > drivers/net/bonding/rte_eth_bond_api.c | 54 +++--- > drivers/net/bonding/rte_eth_bond_pmd.c | 10 +- > drivers/net/bonding/rte_eth_bond_private.h | 36 ++-- > drivers/net/failsafe/failsafe_ether.c | 4 +- > drivers/net/failsafe/failsafe_private.h | 4 +- > drivers/net/ring/rte_eth_ring.c | 2 +- > examples/bond/main.c | 6 +- > examples/ip_fragmentation/main.c | 4 +- > examples/l3fwd-power/main.c | 7 +- > examples/l3fwd/l3fwd.h | 10 +- > examples/l3fwd/l3fwd_em.c | 2 +- > examples/l3fwd/l3fwd_lpm.c | 2 +- > examples/link_status_interrupt/main.c | 5 +- > examples/performance-thread/l3fwd-thread/main.c | 7 +- > examples/rxtx_callbacks/main.c | 8 +- > lib/librte_ether/rte_ethdev.c | 231 +++++++++++------------ > lib/librte_ether/rte_ethdev.h | 236 ++++++++++++------------ > lib/librte_ether/rte_tm.c | 62 +++---- > lib/librte_ether/rte_tm.h | 60 +++--- > lib/librte_ether/rte_tm_driver.h | 2 +- > lib/librte_latencystats/rte_latencystats.c | 8 +- > lib/librte_pdump/rte_pdump.c | 16 +- > lib/librte_pdump/rte_pdump.h | 4 +- > lib/librte_port/rte_port_ethdev.c | 6 +- > lib/librte_port/rte_port_ethdev.h | 6 +- > 31 files changed, 431 insertions(+), 419 deletions(-) > > -- > 2.13.3 You should remove the deprecation notice that was sent for the ABI breakage in this patchset, and add a note in release notes, documenting the API/ABI changes that you have done. Thanks, Pablo ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] increase port_id range 2017-08-09 9:00 ` [dpdk-dev] [PATCH 0/2] " De Lara Guarch, Pablo @ 2017-08-09 9:17 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-08-09 9:17 UTC (permalink / raw) To: De Lara Guarch, Pablo, dev; +Cc: thomas Hi,Pablo: > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Wednesday, August 9, 2017 5:01 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net > Subject: RE: [dpdk-dev] [PATCH 0/2] increase port_id range > > Hi Zhiyong, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > > Sent: Wednesday, August 9, 2017 9:42 AM > > To: dev@dpdk.org > > Cc: thomas@monjalon.net > > Subject: [dpdk-dev] [PATCH 0/2] increase port_id range > > > > port_id is currently defined as uint8_t, which is limited to the range > > 0 to 255. A larger range is required for vdev scalability. > > > > It is necessary for a redefinition of port_id to extend it from 1 > > bytes to > > 2 bytes. All ethdev APIs and usages related to port_id will be changed > > at the same time. > > > > Below is an API/ABI change notice for DPDK 17.11. > > http://www.dpdk.org/dev/patchwork/patch/27475/ > > > > Discussion about port_id is the following thread. > > http://www.dpdk.org/dev/patchwork/patch/23208/ > > > > Zhiyong Yang (2): > > ethdev: increase port_id range > > examples: increase port_id range > > > > app/pdump/main.c | 2 +- > > app/test-pmd/cmdline.c | 4 +- > > app/test-pmd/testpmd.c | 4 +- > > app/test-pmd/testpmd.h | 2 +- > > drivers/net/bonding/rte_eth_bond.h | 40 ++-- > > drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- > > drivers/net/bonding/rte_eth_bond_api.c | 54 +++--- > > drivers/net/bonding/rte_eth_bond_pmd.c | 10 +- > > drivers/net/bonding/rte_eth_bond_private.h | 36 ++-- > > drivers/net/failsafe/failsafe_ether.c | 4 +- > > drivers/net/failsafe/failsafe_private.h | 4 +- > > drivers/net/ring/rte_eth_ring.c | 2 +- > > examples/bond/main.c | 6 +- > > examples/ip_fragmentation/main.c | 4 +- > > examples/l3fwd-power/main.c | 7 +- > > examples/l3fwd/l3fwd.h | 10 +- > > examples/l3fwd/l3fwd_em.c | 2 +- > > examples/l3fwd/l3fwd_lpm.c | 2 +- > > examples/link_status_interrupt/main.c | 5 +- > > examples/performance-thread/l3fwd-thread/main.c | 7 +- > > examples/rxtx_callbacks/main.c | 8 +- > > lib/librte_ether/rte_ethdev.c | 231 +++++++++++------------ > > lib/librte_ether/rte_ethdev.h | 236 ++++++++++++------------ > > lib/librte_ether/rte_tm.c | 62 +++---- > > lib/librte_ether/rte_tm.h | 60 +++--- > > lib/librte_ether/rte_tm_driver.h | 2 +- > > lib/librte_latencystats/rte_latencystats.c | 8 +- > > lib/librte_pdump/rte_pdump.c | 16 +- > > lib/librte_pdump/rte_pdump.h | 4 +- > > lib/librte_port/rte_port_ethdev.c | 6 +- > > lib/librte_port/rte_port_ethdev.h | 6 +- > > 31 files changed, 431 insertions(+), 419 deletions(-) > > > > -- > > 2.13.3 > > You should remove the deprecation notice that was sent for the ABI breakage in > this patchset, and add a note in release notes, documenting the API/ABI changes > that you have done. > Thank you, Pablo. I forget to add a note. Deprecation notice will be removed if need v2 patch. It is my first patchset which needs to send deprecation notice firstly. :) Zhiyong > Thanks, > Pablo ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v2 0/4] increase port_id range 2017-08-09 8:42 [dpdk-dev] [PATCH 0/2] increase port_id range Zhiyong Yang ` (2 preceding siblings ...) 2017-08-09 9:00 ` [dpdk-dev] [PATCH 0/2] " De Lara Guarch, Pablo @ 2017-09-04 5:57 ` Zhiyong Yang 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang ` (4 more replies) 3 siblings, 5 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-04 5:57 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, keith.wiles, stephen port_id is currently defined as uint8_t, which is limited to the range 0 to 255. A larger range is required for vdev scalability. It is necessary for a redefinition of port_id to extend it from 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will be changed at the same time. Discussion about port_id is the following thread. http://www.dpdk.org/dev/patchwork/patch/23208/ Changes in V2: 1. cover more PMDs to increase port_id range. 2. cover more examples to increase port_id range. 3. add release note to 2/4 patch. 4. extend RTE_MAX_ETHPORTS by default from 32 to 1024. 5. introduce one mbuf allocation policy in testpmd. Zhiyong Yang (4): ethdev: increase port_id range examples: increase port_id range common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 testpmd: add flexibility to mbuf allocation app/pdump/main.c | 2 +- app/test-eventdev/test_perf_common.h | 6 +- app/test-pmd/cmdline.c | 4 +- app/test-pmd/config.c | 4 +- app/test-pmd/testpmd.c | 89 +++++--- app/test-pmd/testpmd.h | 5 +- config/common_base | 2 +- doc/guides/rel_notes/release_17_11.rst | 4 + drivers/event/octeontx/ssovf_evdev.c | 6 +- drivers/event/octeontx/ssovf_evdev.h | 4 +- drivers/event/skeleton/skeleton_eventdev.c | 4 +- drivers/event/skeleton/skeleton_eventdev.h | 2 +- drivers/event/sw/sw_evdev.c | 4 +- drivers/event/sw/sw_evdev.h | 6 +- drivers/event/sw/sw_evdev_xstats.c | 8 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/ark/ark_udm.h | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.c | 11 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnx2x/elink.c | 12 +- drivers/net/bnx2x/elink.h | 17 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 8 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 36 ++-- drivers/net/bonding/rte_eth_bond.h | 42 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 56 ++--- drivers/net/bonding/rte_eth_bond_pmd.c | 30 +-- drivers/net/bonding/rte_eth_bond_private.h | 43 ++-- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 70 +++--- drivers/net/nfp/nfp_net.c | 26 +-- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/vhost/rte_eth_vhost.c | 8 +- drivers/net/vhost/rte_eth_vhost.h | 6 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/xenvirt/virtqueue.h | 2 +- examples/bond/main.c | 10 +- examples/distributor/main.c | 28 +-- examples/eventdev_pipeline_sw_pmd/main.c | 2 +- examples/exception_path/main.c | 39 ++-- examples/ip_fragmentation/main.c | 33 +-- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 +-- examples/ipv4_multicast/main.c | 34 +-- examples/kni/main.c | 31 +-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-crypto/main.c | 30 +-- examples/l2fwd-jobstats/main.c | 34 +-- examples/l2fwd-keepalive/main.c | 49 ++--- examples/l2fwd/main.c | 49 ++--- examples/l3fwd-acl/main.c | 11 +- examples/l3fwd-power/main.c | 62 +++--- examples/l3fwd-vf/main.c | 53 ++--- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 17 +- examples/l3fwd/l3fwd_lpm.h | 6 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 +-- examples/link_status_interrupt/main.c | 11 +- examples/load_balancer/config.c | 21 +- examples/load_balancer/init.c | 40 ++-- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 21 +- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 14 +- examples/netmap_compat/lib/compat_netmap.c | 52 +++-- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +- examples/performance-thread/l3fwd-thread/main.c | 160 +++++++------- examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +-- examples/qos_sched/main.c | 18 +- examples/qos_sched/main.h | 24 ++- examples/qos_sched/stats.c | 16 +- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/rte_ethdev.c | 239 +++++++++++---------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++---------- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_eventdev/rte_eventdev.c | 36 ++-- lib/librte_eventdev/rte_eventdev.h | 34 +-- lib/librte_eventdev/rte_eventdev_pmd.h | 8 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- 131 files changed, 1389 insertions(+), 1290 deletions(-) -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang @ 2017-09-04 5:57 ` Zhiyong Yang 2017-09-04 9:06 ` Bruce Richardson ` (2 more replies) 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 2/4] examples: " Zhiyong Yang ` (3 subsequent siblings) 4 siblings, 3 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-04 5:57 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, keith.wiles, stephen, Zhiyong Yang Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time except some drivers such as MLX4 and MLX5 due to fail to compile them in my server. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- app/pdump/main.c | 2 +- app/test-eventdev/test_perf_common.h | 6 +- app/test-pmd/cmdline.c | 4 +- app/test-pmd/config.c | 4 +- app/test-pmd/testpmd.c | 18 +- app/test-pmd/testpmd.h | 2 +- drivers/event/octeontx/ssovf_evdev.c | 6 +- drivers/event/octeontx/ssovf_evdev.h | 4 +- drivers/event/skeleton/skeleton_eventdev.c | 4 +- drivers/event/skeleton/skeleton_eventdev.h | 2 +- drivers/event/sw/sw_evdev.c | 4 +- drivers/event/sw/sw_evdev.h | 6 +- drivers/event/sw/sw_evdev_xstats.c | 8 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/ark/ark_udm.h | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.c | 11 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnx2x/elink.c | 12 +- drivers/net/bnx2x/elink.h | 17 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 8 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 36 ++-- drivers/net/bonding/rte_eth_bond.h | 42 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 56 ++--- drivers/net/bonding/rte_eth_bond_pmd.c | 30 +-- drivers/net/bonding/rte_eth_bond_private.h | 43 ++-- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 70 ++++--- drivers/net/nfp/nfp_net.c | 26 +-- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/vhost/rte_eth_vhost.c | 8 +- drivers/net/vhost/rte_eth_vhost.h | 6 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/xenvirt/virtqueue.h | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/rte_ethdev.c | 239 +++++++++++----------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_eventdev/rte_eventdev.c | 36 ++-- lib/librte_eventdev/rte_eventdev.h | 34 +-- lib/librte_eventdev/rte_eventdev_pmd.h | 8 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- 73 files changed, 733 insertions(+), 715 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index 3b13753d9..090a50cfc 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -623,7 +623,7 @@ static void create_mp_ring_vdev(void) { int i; - uint8_t portid; + uint16_t portid; struct pdump_tuples *pt = NULL; struct rte_mempool *mbuf_pool = NULL; char vdev_args[SIZE]; diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h index 4956586cc..be7a9f4ef 100644 --- a/app/test-eventdev/test_perf_common.h +++ b/app/test-eventdev/test_perf_common.h @@ -54,13 +54,13 @@ struct worker_data { uint64_t processed_pkts; uint64_t latency; uint8_t dev_id; - uint8_t port_id; + uint16_t port_id; struct test_perf *t; } __rte_cache_aligned; struct prod_data { uint8_t dev_id; - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; struct test_perf *t; } __rte_cache_aligned; @@ -93,7 +93,7 @@ struct perf_elt { struct test_perf *t = w->t;\ struct evt_options *opt = t->opt;\ const uint8_t dev = w->dev_id;\ - const uint8_t port = w->port_id;\ + const uint16_t port = w->port_id;\ uint8_t *const sched_type_list = &t->sched_type_list[0];\ struct rte_mempool *const pool = t->pool;\ const uint8_t nb_stages = t->opt->nb_stages;\ diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index cd8c35850..575c9bd85 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4584,7 +4584,7 @@ struct cmd_show_bonding_config_result { cmdline_fixed_string_t show; cmdline_fixed_string_t bonding; cmdline_fixed_string_t config; - uint8_t port_id; + uint16_t port_id; }; static void cmd_show_bonding_config_parsed(void *parsed_result, @@ -4593,7 +4593,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, { struct cmd_show_bonding_config_result *res = parsed_result; int bonding_mode, agg_mode; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int num_slaves, num_active_slaves; int primary_id; int i; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3ae3e1cd8..155136dd5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -358,7 +358,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "RX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; @@ -391,7 +391,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "TX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 7d4013941..ed42a4c08 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -390,7 +390,7 @@ struct gro_status gro_ports[RTE_MAX_ETHPORTS]; /* Forward function declarations */ static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port); static void check_all_ports_link_status(uint32_t port_mask); -static int eth_event_callback(uint8_t port_id, +static int eth_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); @@ -1775,7 +1775,8 @@ check_all_ports_link_status(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("Checking link statuses...\n"); @@ -1790,14 +1791,13 @@ check_all_ports_link_status(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 */ @@ -1844,7 +1844,7 @@ rmv_event_callback(void *arg) /* This function is used by the interrupt thread */ static int -eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, +eth_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param) { static const char * const event_desc[] = { @@ -2287,7 +2287,7 @@ int main(int argc, char** argv) { int diag; - uint8_t port_id; + uint16_t port_id; signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index c9d7739b8..e00d9eb2d 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -78,7 +78,7 @@ #define UMA_NO_CONFIG 0xFF typedef uint8_t lcoreid_t; -typedef uint8_t portid_t; +typedef uint16_t portid_t; typedef uint16_t queueid_t; typedef uint16_t streamid_t; diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index d829b491e..600bd85f6 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -243,7 +243,7 @@ ssovf_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, } static void -ssovf_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, +ssovf_port_def_conf(struct rte_eventdev *dev, uint16_t port_id, struct rte_event_port_conf *port_conf) { struct ssovf_evdev *edev = ssovf_pmd_priv(dev); @@ -261,7 +261,7 @@ ssovf_port_release(void *port) } static int -ssovf_port_setup(struct rte_eventdev *dev, uint8_t port_id, +ssovf_port_setup(struct rte_eventdev *dev, uint16_t port_id, const struct rte_event_port_conf *port_conf) { struct ssows *ws; @@ -399,7 +399,7 @@ static void ssovf_dump(struct rte_eventdev *dev, FILE *f) { struct ssovf_evdev *edev = ssovf_pmd_priv(dev); - uint8_t port; + uint16_t port; /* Dump SSOWVF debug registers */ for (port = 0; port < edev->nb_event_ports; port++) diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 1cdc81047..0a7239c69 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -164,7 +164,7 @@ struct ssovf_evdev { uint8_t max_event_ports; uint8_t is_timeout_deq; uint8_t nb_event_queues; - uint8_t nb_event_ports; + uint16_t nb_event_ports; uint32_t min_deq_timeout_ns; uint32_t max_deq_timeout_ns; int32_t max_num_events; @@ -178,7 +178,7 @@ struct ssows { uint8_t *base; uint8_t *getwork; uint8_t *grps[SSO_MAX_VHGRP]; - uint8_t port; + uint16_t port; } __rte_cache_aligned; static inline struct ssovf_evdev * diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index bcd205568..69d59213c 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -225,7 +225,7 @@ skeleton_eventdev_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, } static void -skeleton_eventdev_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, +skeleton_eventdev_port_def_conf(struct rte_eventdev *dev, uint16_t port_id, struct rte_event_port_conf *port_conf) { struct skeleton_eventdev *skel = skeleton_pmd_priv(dev); @@ -250,7 +250,7 @@ skeleton_eventdev_port_release(void *port) } static int -skeleton_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id, +skeleton_eventdev_port_setup(struct rte_eventdev *dev, uint16_t port_id, const struct rte_event_port_conf *port_conf) { struct skeleton_port *sp; diff --git a/drivers/event/skeleton/skeleton_eventdev.h b/drivers/event/skeleton/skeleton_eventdev.h index 32064721e..5c375b218 100644 --- a/drivers/event/skeleton/skeleton_eventdev.h +++ b/drivers/event/skeleton/skeleton_eventdev.h @@ -57,7 +57,7 @@ struct skeleton_eventdev { } __rte_cache_aligned; struct skeleton_port { - uint8_t port_id; + uint16_t port_id; } __rte_cache_aligned; static inline struct skeleton_eventdev * diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index 9c534b7f9..af2a13151 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -136,7 +136,7 @@ sw_port_unlink(struct rte_eventdev *dev, void *port, uint8_t queues[], } static int -sw_port_setup(struct rte_eventdev *dev, uint8_t port_id, +sw_port_setup(struct rte_eventdev *dev, uint16_t port_id, const struct rte_event_port_conf *conf) { struct sw_evdev *sw = sw_pmd_priv(dev); @@ -408,7 +408,7 @@ sw_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, } static void -sw_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, +sw_port_def_conf(struct rte_eventdev *dev, uint16_t port_id, struct rte_event_port_conf *port_conf) { RTE_SET_USED(dev); diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h index 71de3c14a..9b356a0af 100644 --- a/drivers/event/sw/sw_evdev.h +++ b/drivers/event/sw/sw_evdev.h @@ -181,7 +181,7 @@ struct sw_port { /* set when the port is initialized */ uint8_t initialized; /* A numeric ID for the port */ - uint8_t id; + uint16_t id; int16_t is_directed; /** Takes from a single directed QID */ /** @@ -304,11 +304,11 @@ void sw_event_schedule(struct rte_eventdev *dev); int sw_xstats_init(struct sw_evdev *dev); int sw_xstats_uninit(struct sw_evdev *dev); int sw_xstats_get_names(const struct rte_eventdev *dev, - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, struct rte_event_dev_xstats_name *xstats_names, unsigned int *ids, unsigned int size); int sw_xstats_get(const struct rte_eventdev *dev, - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, const unsigned int ids[], uint64_t values[], unsigned int n); uint64_t sw_xstats_get_by_name(const struct rte_eventdev *dev, const char *name, unsigned int *id); diff --git a/drivers/event/sw/sw_evdev_xstats.c b/drivers/event/sw/sw_evdev_xstats.c index 8cb6d88d1..99718922b 100644 --- a/drivers/event/sw/sw_evdev_xstats.c +++ b/drivers/event/sw/sw_evdev_xstats.c @@ -414,7 +414,7 @@ sw_xstats_uninit(struct sw_evdev *sw) int sw_xstats_get_names(const struct rte_eventdev *dev, - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, struct rte_event_dev_xstats_name *xstats_names, unsigned int *ids, unsigned int size) { @@ -469,7 +469,7 @@ sw_xstats_get_names(const struct rte_eventdev *dev, static int sw_xstats_update(struct sw_evdev *sw, enum rte_event_dev_xstats_mode mode, - uint8_t queue_port_id, const unsigned int ids[], + uint16_t queue_port_id, const unsigned int ids[], uint64_t values[], unsigned int n, const uint32_t reset, const uint32_t ret_if_n_lt_nstats) { @@ -533,7 +533,7 @@ sw_xstats_update(struct sw_evdev *sw, enum rte_event_dev_xstats_mode mode, int sw_xstats_get(const struct rte_eventdev *dev, - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, const unsigned int ids[], uint64_t values[], unsigned int n) { struct sw_evdev *sw = sw_pmd_priv(dev); @@ -602,7 +602,7 @@ sw_xstats_reset_queue(struct sw_evdev *sw, uint8_t queue_id, } static int -sw_xstats_reset_port(struct sw_evdev *sw, uint8_t port_id, +sw_xstats_reset_port(struct sw_evdev *sw, uint16_t port_id, const uint32_t ids[], uint32_t nb_ids) { const uint32_t reset = 1; diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 9a47852ca..483b0c107 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -75,7 +75,7 @@ struct pkt_rx_queue { unsigned int framenum; struct rte_mempool *mb_pool; - uint8_t in_port; + uint16_t in_port; volatile unsigned long rx_pkts; volatile unsigned long err_pkts; diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 6db362b04..893284733 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -641,7 +641,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_tx_queues; i++) { status = eth_ark_tx_queue_stop(dev, i); if (status != 0) { - uint8_t port = dev->data->port_id; + uint16_t port = dev->data->port_id; PMD_DRV_LOG(ERR, "tx_queue stop anomaly" " port %u, queue %u\n", diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h index 29bf1e8f7..b71951d61 100644 --- a/drivers/net/ark/ark_udm.h +++ b/drivers/net/ark/ark_udm.h @@ -48,7 +48,7 @@ struct ark_rx_meta { uint64_t timestamp; uint64_t user_data; - uint8_t port; + uint16_t port; uint8_t dst_queue; uint16_t pkt_len; }; diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index c746a0e2c..b5cc955f2 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -190,7 +190,7 @@ struct avp_dev { struct rte_eth_dev_data *dev_data; /**< Back pointer to ethernet device data */ volatile uint32_t flags; /**< Device operational flags */ - uint8_t port_id; /**< Ethernet port identifier */ + uint16_t port_id; /**< Ethernet port identifier */ struct rte_mempool *pool; /**< pkt mbuf mempool */ unsigned int guest_mbuf_size; /**< local pool mbuf size */ unsigned int host_mbuf_size; /**< host mbuf size */ diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 06733d153..fbbda590f 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -608,7 +608,8 @@ static int bnx2x_gpio_read(struct bnx2x_softc *sc, int gpio_num, uint8_t port) } static int -bnx2x_gpio_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, uint8_t port) +bnx2x_gpio_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, + uint16_t port) { /* The GPIO should be swapped if swap register is set and active */ int gpio_port = ((REG_RD(sc, NIG_REG_PORT_SWAP) && @@ -703,7 +704,7 @@ bnx2x_gpio_mult_write(struct bnx2x_softc *sc, uint8_t pins, uint32_t mode) static int bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, - uint8_t port) + uint8_t port) { /* The GPIO should be swapped if swap register is set and active */ int gpio_port = ((REG_RD(sc, NIG_REG_PORT_SWAP) && @@ -749,13 +750,13 @@ bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, } uint32_t -elink_cb_gpio_read(struct bnx2x_softc * sc, uint16_t gpio_num, uint8_t port) +elink_cb_gpio_read(struct bnx2x_softc *sc, uint16_t gpio_num, uint16_t port) { return bnx2x_gpio_read(sc, gpio_num, port); } uint8_t elink_cb_gpio_write(struct bnx2x_softc * sc, uint16_t gpio_num, uint8_t mode, /* 0=low 1=high */ - uint8_t port) + uint16_t port) { return bnx2x_gpio_write(sc, gpio_num, mode, port); } @@ -768,7 +769,7 @@ elink_cb_gpio_mult_write(struct bnx2x_softc * sc, uint8_t pins, } uint8_t elink_cb_gpio_int_write(struct bnx2x_softc * sc, uint16_t gpio_num, uint8_t mode, /* 0=low 1=high */ - uint8_t port) + uint16_t port) { return bnx2x_gpio_int_write(sc, gpio_num, mode, port); } diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index 2e38ec26a..48d540476 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -41,7 +41,7 @@ struct bnx2x_rx_queue { uint16_t rx_cq_head; /**< Index of current rcq bd. */ uint16_t rx_cq_tail; /**< Index of last rcq bd. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data. */ }; @@ -62,7 +62,7 @@ struct bnx2x_tx_queue { uint16_t nb_tx_avail; /**< Number of TX descriptors available. */ uint16_t nb_tx_pages; /**< number of TX pages */ uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data */ }; diff --git a/drivers/net/bnx2x/elink.c b/drivers/net/bnx2x/elink.c index 9d0f31364..63f3b9686 100644 --- a/drivers/net/bnx2x/elink.c +++ b/drivers/net/bnx2x/elink.c @@ -1105,7 +1105,7 @@ static void elink_set_cfg_pin(struct bnx2x_softc *sc, uint32_t pin_cfg, elink_set_epio(sc, pin_cfg - PIN_CFG_EPIO0, val); } else { uint8_t gpio_num = (pin_cfg - PIN_CFG_GPIO0_P0) & 0x3; - uint8_t gpio_port = (pin_cfg - PIN_CFG_GPIO0_P0) >> 2; + uint16_t gpio_port = (pin_cfg - PIN_CFG_GPIO0_P0) >> 2; elink_cb_gpio_write(sc, gpio_num, (uint8_t) val, gpio_port); } } @@ -1119,7 +1119,7 @@ static uint32_t elink_get_cfg_pin(struct bnx2x_softc *sc, uint32_t pin_cfg, elink_get_epio(sc, pin_cfg - PIN_CFG_EPIO0, val); } else { uint8_t gpio_num = (pin_cfg - PIN_CFG_GPIO0_P0) & 0x3; - uint8_t gpio_port = (pin_cfg - PIN_CFG_GPIO0_P0) >> 2; + uint16_t gpio_port = (pin_cfg - PIN_CFG_GPIO0_P0) >> 2; *val = elink_cb_gpio_read(sc, gpio_num, gpio_port); } return ELINK_STATUS_OK; @@ -1244,7 +1244,7 @@ static void elink_emac_init(struct elink_params *params) { /* reset and unreset the emac core */ struct bnx2x_softc *sc = params->sc; - uint8_t port = params->port; + uint16_t port = params->port; uint32_t emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0; uint32_t val; uint16_t timeout; @@ -1474,7 +1474,7 @@ static void elink_xmac_init(struct elink_params *params, uint32_t max_speed) static void elink_set_xmac_rxtx(struct elink_params *params, uint8_t en) { - uint8_t port = params->port; + uint16_t port = params->port; struct bnx2x_softc *sc = params->sc; uint32_t pfc_ctrl, xmac_base = (port) ? GRCBASE_XMAC1 : GRCBASE_XMAC0; uint32_t val; @@ -12987,7 +12987,7 @@ void elink_period_func(struct elink_params *params, struct elink_vars *vars) uint8_t elink_fan_failure_det_req(struct bnx2x_softc *sc, uint32_t shmem_base, - uint32_t shmem2_base, uint8_t port) + uint32_t shmem2_base, uint16_t port) { uint8_t phy_index, fan_failure_det_req = 0; struct elink_phy phy; @@ -13027,7 +13027,7 @@ void elink_hw_reset_phy(struct elink_params *params) void elink_init_mod_abs_int(struct bnx2x_softc *sc, struct elink_vars *vars, __rte_unused uint32_t chip_id, uint32_t shmem_base, - uint32_t shmem2_base, uint8_t port) + uint32_t shmem2_base, uint16_t port) { uint8_t gpio_num = 0xff, gpio_port = 0xff, phy_index; uint32_t val; diff --git a/drivers/net/bnx2x/elink.h b/drivers/net/bnx2x/elink.h index 9401b7cd5..22661d06b 100644 --- a/drivers/net/bnx2x/elink.h +++ b/drivers/net/bnx2x/elink.h @@ -34,16 +34,17 @@ extern void elink_cb_reg_write(struct bnx2x_softc *sc, uint32_t reg_addr, uint32 /* mode - 0( LOW ) /1(HIGH)*/ extern uint8_t elink_cb_gpio_write(struct bnx2x_softc *sc, - uint16_t gpio_num, - uint8_t mode, uint8_t port); + uint16_t gpio_num, + uint8_t mode, uint16_t port); extern uint8_t elink_cb_gpio_mult_write(struct bnx2x_softc *sc, uint8_t pins, uint8_t mode); -extern uint32_t elink_cb_gpio_read(struct bnx2x_softc *sc, uint16_t gpio_num, uint8_t port); +extern uint32_t elink_cb_gpio_read(struct bnx2x_softc *sc, uint16_t gpio_num, + uint16_t port); extern uint8_t elink_cb_gpio_int_write(struct bnx2x_softc *sc, - uint16_t gpio_num, - uint8_t mode, uint8_t port); + uint16_t gpio_num, + uint8_t mode, uint16_t port); extern uint32_t elink_cb_fw_command(struct bnx2x_softc *sc, uint32_t command, uint32_t param); @@ -318,7 +319,7 @@ struct elink_phy { /* Inputs parameters to the CLC */ struct elink_params { - uint8_t port; + uint16_t port; /* Default / User Configuration */ uint8_t loopback_mode; @@ -500,7 +501,7 @@ elink_status_t elink_phy_probe(struct elink_params *params); /* Checks if fan failure detection is required on one of the phys on board */ uint8_t elink_fan_failure_det_req(struct bnx2x_softc *sc, uint32_t shmem_base, - uint32_t shmem2_base, uint8_t port); + uint32_t shmem2_base, uint16_t port); /* Open / close the gate between the NIG and the BRB */ void elink_set_rx_filter(struct elink_params *params, uint8_t en); @@ -573,7 +574,7 @@ elink_status_t elink_update_pfc(struct elink_params *params, void elink_init_mod_abs_int(struct bnx2x_softc *sc, struct elink_vars *vars, uint32_t chip_id, uint32_t shmem_base, uint32_t shmem2_base, - uint8_t port); + uint16_t port); void elink_period_func(struct elink_params *params, struct elink_vars *vars); diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 405d94deb..26a9018b5 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -126,7 +126,7 @@ struct bnxt_pf_info { #define BNXT_FIRST_VF_FID 128 #define BNXT_PF_RINGS_USED(bp) bnxt_get_num_queues(bp) #define BNXT_PF_RINGS_AVAIL(bp) (bp->pf.max_cp_rings - BNXT_PF_RINGS_USED(bp)) - uint8_t port_id; + uint16_t port_id; uint16_t first_vf_id; uint16_t active_vfs; uint16_t max_vfs; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index c9d11228b..d8face1bc 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -488,14 +488,14 @@ static void bnxt_print_link_info(struct rte_eth_dev *eth_dev) struct rte_eth_link *link = ð_dev->data->dev_link; if (link->link_status) - RTE_LOG(INFO, PMD, "Port %d Link Up - speed %u Mbps - %s\n", - (uint8_t)(eth_dev->data->port_id), + RTE_LOG(INFO, PMD, "Port %u Link Up - speed %u Mbps - %s\n", + eth_dev->data->port_id, (uint32_t)link->link_speed, (link->link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex\n")); else - RTE_LOG(INFO, PMD, "Port %d Link Down\n", - (uint8_t)(eth_dev->data->port_id)); + RTE_LOG(INFO, PMD, "Port %u Link Down\n", + eth_dev->data->port_id); } static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev) diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h index 01aaa007f..cea0785d1 100644 --- a/drivers/net/bnxt/bnxt_rxq.h +++ b/drivers/net/bnxt/bnxt_rxq.h @@ -48,7 +48,7 @@ struct bnxt_rx_queue { uint16_t rx_free_thresh; /* max free RX desc to hold */ uint16_t queue_id; /* RX queue index */ uint16_t reg_idx; /* RX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ struct bnxt *bp; diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h index 16f3a0bdd..f753c10f2 100644 --- a/drivers/net/bnxt/bnxt_txq.h +++ b/drivers/net/bnxt/bnxt_txq.h @@ -46,7 +46,7 @@ struct bnxt_tx_queue { uint16_t tx_next_rs; /* next desc to set RS bit */ uint16_t queue_id; /* TX queue index */ uint16_t reg_idx; /* TX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t pthresh; /* Prefetch threshold register */ uint8_t hthresh; /* Host threshold register */ uint8_t wthresh; /* Write-back threshold reg */ diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c343d9033..63fc27911 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -67,7 +67,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) true : false; } -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -108,7 +108,7 @@ rte_pmd_bnxt_set_all_queues_drop_en_cb(struct bnxt_vnic_info *vnic, void *onptr) vnic->bd_stall = !(*on); } -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -159,7 +159,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -191,7 +191,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *eth_dev; @@ -241,7 +241,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -294,7 +294,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -350,7 +350,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq_cb(struct bnxt_vnic_info *vnic, void *onptr) } int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -385,7 +385,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -477,7 +477,7 @@ static int bnxt_set_vf_table(struct bnxt *bp, uint16_t vf) return rc; } -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct bnxt_vlan_table_entry *ve; @@ -570,7 +570,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, return rc; } -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -598,7 +598,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, return bnxt_hwrm_func_qstats(bp, bp->pf.first_vf_id + vf_id, stats); } -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -625,7 +625,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, return bnxt_hwrm_func_clr_stats(bp, bp->pf.first_vf_id + vf_id); } -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -651,7 +651,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) return bnxt_vf_vnic_count(bp, vf_id); } -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count) { struct rte_eth_dev *dev; @@ -679,7 +679,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, count); } -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr, uint32_t vf_id) { struct rte_eth_dev *dev; @@ -756,7 +756,7 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, } int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -793,7 +793,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h index c4c4770e3..548e5b3e5 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.h +++ b/drivers/net/bnxt/rte_pmd_bnxt.h @@ -78,7 +78,7 @@ struct rte_pmd_bnxt_mb_event_param { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set the VF MAC address. @@ -94,7 +94,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -115,7 +115,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -134,8 +134,8 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, - uint16_t vlan_id); +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, + uint16_t vlan_id); /** * Enable/Disable hardware VF VLAN filtering by an Ethernet device of @@ -156,7 +156,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); /** @@ -173,7 +173,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -189,7 +189,7 @@ int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * Set the VF rate limit. @@ -207,7 +207,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); /** @@ -226,7 +226,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -242,7 +242,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -261,7 +261,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set RX L2 Filtering mode of a VF of an Ethernet device. @@ -280,7 +280,7 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); /** @@ -297,7 +297,7 @@ int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, * - (-ENOMEM) on an allocation failure * - (-1) firmware interface error */ -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id); /** * Queries the TX drop counter for the function @@ -313,7 +313,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); * - (-EINVAL) invalid vf_id specified. * - (-ENOTSUP) Ethernet device is not a PF */ -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count); /** @@ -331,8 +331,8 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, * - (-ENOTSUP) Ethernet device is not a PF * - (-ENOMEM) on an allocation failure */ -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, - uint32_t vf_id); +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, + uint32_t vf_id); /** * Enable/Disable VF statistics retention @@ -350,5 +350,5 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on); #endif /* _PMD_BNXT_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 8efbf0713..36b4e0643 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -151,7 +151,7 @@ rte_eth_bond_free(const char *name); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Remove a slave rte_eth_dev device from the bonded device @@ -163,7 +163,7 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Set link bonding mode of bonded device @@ -175,7 +175,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode); /** * Get link bonding mode of bonded device @@ -186,7 +186,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); * link bonding mode on success, negative value otherwise */ int -rte_eth_bond_mode_get(uint8_t bonded_port_id); +rte_eth_bond_mode_get(uint16_t bonded_port_id); /** * Set slave rte_eth_dev as primary slave of bonded device @@ -198,7 +198,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Get primary slave of bonded device @@ -209,7 +209,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); * Port Id of primary slave on success, -1 on failure */ int -rte_eth_bond_primary_get(uint8_t bonded_port_id); +rte_eth_bond_primary_get(uint16_t bonded_port_id); /** * Populate an array with list of the slaves port id's of the bonded device @@ -223,7 +223,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id); * negative value otherwise */ int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Populate an array with list of the active slaves port id's of the bonded @@ -238,8 +239,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); * negative value otherwise */ int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len); +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Set explicit MAC address to use on bonded device and it's slaves. @@ -252,7 +253,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr); /** @@ -265,7 +266,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id); /** * Set the transmit policy for bonded device to use when it is operating in @@ -279,7 +280,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy); /** * Get the transmit policy set on bonded device for balance mode operation @@ -290,7 +291,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); * Balance transmit policy on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of @@ -304,7 +305,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); */ int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link @@ -316,8 +317,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); * Monitoring interval on success, negative value otherwise. */ int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); - +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the disabling of a bonded link @@ -330,7 +330,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the disabling of a bonded @@ -342,7 +343,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the enabling of a bonded link @@ -355,7 +356,8 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the enabling of a bonded @@ -367,7 +369,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); #ifdef __cplusplus diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 20b5a8961..7423acf0e 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -685,11 +685,11 @@ max_index(uint64_t *a, int n) * @param port_pos Port to assign. */ static void -selection_logic(struct bond_dev_private *internals, uint8_t slave_id) +selection_logic(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port; - uint8_t slaves_count, new_agg_id, i, j = 0; - uint8_t *slaves; + uint8_t slaves_count, i, j = 0; + uint16_t *slaves, new_agg_id; uint64_t agg_bandwidth[8] = {0}; uint64_t agg_count[8] = {0}; uint8_t default_slave = 0; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h index d46e44a84..0d8288ac3 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h @@ -318,12 +318,12 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev); int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port); + uint16_t slave_port); int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port); +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port); int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id); +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index de1d9e0db..55f5bb145 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -56,14 +56,14 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) } int -valid_bonded_port_id(uint8_t port_id) +valid_bonded_port_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return check_for_bonded_ethdev(&rte_eth_devices[port_id]); } int -valid_slave_port_id(uint8_t port_id, uint8_t mode) +valid_slave_port_id(uint16_t port_id, uint8_t mode) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); @@ -80,7 +80,7 @@ valid_slave_port_id(uint8_t port_id, uint8_t mode) } void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -107,9 +107,9 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) } void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { - uint8_t slave_pos; + uint16_t slave_pos; struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -153,7 +153,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) { struct bond_dev_private *internals; char devargs[52]; - uint8_t port_id; + uint16_t port_id; int ret; if (name == NULL) { @@ -193,7 +193,7 @@ rte_eth_bond_free(const char *name) } static int -slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) +slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -233,7 +233,7 @@ slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev; struct bond_dev_private *internals; @@ -363,7 +363,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -466,7 +466,7 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -488,7 +488,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) { if (valid_bonded_port_id(bonded_port_id) != 0) return -1; @@ -497,7 +497,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) } int -rte_eth_bond_mode_get(uint8_t bonded_port_id) +rte_eth_bond_mode_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -510,7 +510,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id) } int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct bond_dev_private *internals; @@ -531,7 +531,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_primary_get(uint8_t bonded_port_id) +rte_eth_bond_primary_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -547,7 +547,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id) } int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; uint8_t i; @@ -570,8 +571,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) } int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len) +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; @@ -592,7 +593,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], } int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *bonded_eth_dev; @@ -618,7 +619,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, } int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -647,7 +648,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) } int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) { struct bond_dev_private *internals; @@ -677,7 +678,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) } int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -690,7 +691,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms) { struct bond_dev_private *internals; @@ -704,7 +705,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) } int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -717,7 +718,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms) { struct bond_dev_private *internals; @@ -732,7 +734,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -745,7 +747,7 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; @@ -760,7 +762,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 3ee70baa0..5a288e631 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -174,7 +174,7 @@ const struct rte_flow_attr flow_attr_8023ad = { int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port) { + uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); @@ -202,12 +202,12 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, } int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { struct rte_eth_dev *bond_dev = &rte_eth_devices[port_id]; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); struct rte_eth_dev_info bond_info, slave_info; - uint8_t idx; + uint16_t idx; /* Verify if all slaves in bonding supports flow director and */ if (internals->slave_count > 0) { @@ -230,7 +230,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { } int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port) { +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) @@ -270,10 +270,10 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; struct bond_dev_private *internals = bd_rx_q->dev_private; uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count; - uint8_t i, idx; + uint16_t i, idx; /* Copy slave list to protect against slave up/down changes during tx * bursting */ @@ -302,8 +302,8 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -1861,7 +1861,7 @@ slave_add(struct bond_dev_private *internals, void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id) + uint16_t slave_port_id) { int i; @@ -2277,7 +2277,7 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) static int bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) { - void (*link_update)(uint8_t port_id, struct rte_eth_link *eth_link); + void (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); struct bond_dev_private *bond_ctx; struct rte_eth_link slave_link; @@ -2466,8 +2466,8 @@ bond_ethdev_delayed_lsc_propagation(void *arg) } int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, - void *param, void *ret_param __rte_unused) +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, + void *param, void *ret_param __rte_unused) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -3086,7 +3086,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Parse/set primary slave port id*/ arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); if (arg_count == 1) { - uint8_t primary_slave_port_id; + uint16_t primary_slave_port_id; if (rte_kvargs_process(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG, @@ -3099,7 +3099,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } /* Set balance mode transmit policy*/ - if (rte_eth_bond_primary_set(port_id, (uint8_t)primary_slave_port_id) + if (rte_eth_bond_primary_set(port_id, primary_slave_port_id) != 0) { RTE_LOG(ERR, EAL, "Failed to set primary slave port %d on bonded device %s\n", diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 1fe6ff880..758ef78a0 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -93,12 +93,12 @@ struct bond_tx_queue { /** Bonded slave devices structure */ struct bond_ethdev_slave_ports { - uint8_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ - uint8_t slave_count; /**< Number of slaves */ + uint16_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ + uint16_t slave_count; /**< Number of slaves */ }; struct bond_slave_details { - uint8_t port_id; + uint16_t port_id; uint8_t link_status_poll_enabled; uint8_t link_status_wait_to_complete; @@ -114,14 +114,14 @@ typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count) /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { - uint8_t port_id; /**< Port Id of Bonded Port */ - uint8_t mode; /**< Link Bonding Mode */ + uint16_t port_id; /**< Port Id of Bonded Port */ + uint8_t mode; /**< Link Bonding Mode */ rte_spinlock_t lock; - uint8_t primary_port; /**< Primary Slave Port */ - uint8_t current_primary_port; /**< Primary Slave Port */ - uint8_t user_defined_primary_port; + uint16_t primary_port; /**< Primary Slave Port */ + uint16_t current_primary_port; /**< Primary Slave Port */ + uint16_t user_defined_primary_port; /**< Flag for whether primary port is user defined or not */ uint8_t balance_xmit_policy; @@ -146,14 +146,15 @@ struct bond_dev_private { uint8_t active_slave; /**< Next active_slave to poll */ uint8_t active_slave_count; /**< Number of active slaves */ - uint8_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ + uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ uint8_t slave_count; /**< Number of bonded slaves */ struct bond_slave_details slaves[RTE_MAX_ETHPORTS]; /**< Arary of bonded slaves details */ struct mode8023ad_private mode4; - uint8_t tlb_slaves_order[RTE_MAX_ETHPORTS]; /* TLB active slaves send order */ + /**< TLB active slaves send order */ + uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS]; struct mode_alb_private mode6; uint32_t rx_offload_capa; /** Rx offload capability */ @@ -186,10 +187,10 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); /* Search given slave array to find position of given id. * Return slave pos or slaves_count if not found. */ -static inline uint8_t -find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { +static inline uint16_t +find_slave_by_id(uint16_t *slaves, uint8_t slaves_count, uint16_t slave_id) { - uint8_t pos; + uint16_t pos; for (pos = 0; pos < slaves_count; pos++) { if (slave_id == slaves[pos]) break; @@ -199,19 +200,19 @@ find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { } int -valid_port_id(uint8_t port_id); +valid_port_id(uint16_t port_id); int -valid_bonded_port_id(uint8_t port_id); +valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(uint8_t port_id, uint8_t mode); +valid_slave_port_id(uint16_t port_id, uint8_t mode); void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void link_properties_set(struct rte_eth_dev *bonded_eth_dev, @@ -255,11 +256,11 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count); void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id); + uint16_t slave_port_id); int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, - void *param, void *ret_param); +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, + void *param, void *ret_param); int bond_ethdev_parse_slave_port_kvarg(const char *key, diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 31819c5bd..06ba68e39 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -119,7 +119,7 @@ struct em_rx_queue { uint16_t nb_rx_hold; /**< number of held free RX desc. */ uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -186,7 +186,7 @@ struct em_tx_queue { /** Total number of TX descriptors ready to be allocated. */ uint16_t nb_tx_free; uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 1c80a2a1b..a800d9c2b 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -122,7 +122,7 @@ struct igb_rx_queue { uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -191,7 +191,7 @@ struct igb_tx_queue { /**< Index of first used TX descriptor. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index a3a8cce95..1c8a9337e 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -400,7 +400,7 @@ failsafe_eth_dev_state_sync(struct rte_eth_dev *dev) } int -failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_rmv_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { @@ -419,7 +419,7 @@ failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, } int -failsafe_eth_lsc_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 0361cf434..4ae6e6c5f 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -180,10 +180,10 @@ int failsafe_eal_uninit(struct rte_eth_dev *dev); int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev); void failsafe_dev_remove(struct rte_eth_dev *dev); -int failsafe_eth_rmv_event_callback(uint8_t port_id, +int failsafe_eth_rmv_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *arg, void *out); -int failsafe_eth_lsc_event_callback(uint8_t port_id, +int failsafe_eth_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *out); diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h index 8e1a95062..060982b10 100644 --- a/drivers/net/fm10k/fm10k.h +++ b/drivers/net/fm10k/fm10k.h @@ -204,7 +204,7 @@ struct fm10k_rx_queue { uint16_t rxrearm_nb; /* number of remaining to be re-armed */ uint16_t rxrearm_start; /* the idx we start the re-arming from */ uint16_t rx_using_sse; /* indicates that vector RX is in use */ - uint8_t port_id; + uint16_t port_id; uint8_t drop_en; uint8_t rx_deferred_start; /* don't start this queue in dev start. */ uint16_t rx_ftag_en; /* indicates FTAG RX supported */ @@ -241,7 +241,7 @@ struct fm10k_tx_queue { volatile uint32_t *tail_ptr; uint32_t txq_flags; /* Holds flags for this TXq */ uint16_t nb_desc; - uint8_t port_id; + uint16_t port_id; uint8_t tx_deferred_start; /** don't start this queue in dev start. */ uint16_t queue_id; uint16_t tx_ftag_en; /* indicates FTAG TX supported */ @@ -289,7 +289,7 @@ static inline uint16_t fifo_remove(struct fifo *fifo) } static inline void -fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint8_t in_port) +fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint16_t in_port) { rte_mbuf_refcnt_set(mb, 1); mb->next = NULL; diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 5f26e24a3..d17d7497f 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1918,8 +1918,9 @@ i40e_dev_start(struct rte_eth_dev *dev) hw->adapter_stopped = 0; if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; autonegotiation disabled", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, autonegotiation disabled", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index 20084d649..ff2ab8575 100644 --- a/drivers/net/i40e/i40e_rxtx.h +++ b/drivers/net/i40e/i40e_rxtx.h @@ -121,7 +121,7 @@ struct i40e_rx_queue { uint16_t rxrearm_start; /**< the idx we start the re-arming from */ uint64_t mbuf_initializer; /**< value to init mbufs */ - uint8_t port_id; /**< device port ID */ + uint16_t port_id; /**< device port ID */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise */ uint16_t queue_id; /**< RX queue index */ uint16_t reg_idx; /**< RX queue register index */ @@ -167,7 +167,7 @@ struct i40e_tx_queue { uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; uint32_t txq_flags; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index f12b7f4a1..3728d39b9 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -41,7 +41,7 @@ #include "rte_pmd_i40e.h" int -rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) +rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -66,7 +66,7 @@ rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) } int -rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -170,7 +170,7 @@ i40e_add_rm_all_vlan_filter(struct i40e_vsi *vsi, uint8_t add) } int -rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -430,7 +430,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on) } int -rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -473,7 +473,7 @@ rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -514,7 +514,7 @@ rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -555,7 +555,7 @@ rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr) { struct i40e_mac_filter *f; @@ -598,7 +598,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, /* Set vlan strip on/off for specific VF from host */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -633,7 +633,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) return ret; } -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -698,7 +698,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; @@ -764,7 +764,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on) +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -858,7 +858,7 @@ i40e_vlan_filter_count(struct i40e_vsi *vsi) return count; } -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -941,7 +941,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, } int -rte_pmd_i40e_get_vf_stats(uint8_t port, +rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -986,7 +986,7 @@ rte_pmd_i40e_get_vf_stats(uint8_t port, } int -rte_pmd_i40e_reset_vf_stats(uint8_t port, +rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -1020,7 +1020,7 @@ rte_pmd_i40e_reset_vf_stats(uint8_t port, } int -rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) +rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1109,7 +1109,7 @@ rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) } int -rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight) { struct rte_eth_dev *dev; @@ -1223,7 +1223,7 @@ rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw) { struct rte_eth_dev *dev; @@ -1341,7 +1341,7 @@ rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map) +rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1513,7 +1513,7 @@ i40e_add_rm_profile_info(struct i40e_hw *hw, uint8_t *profile_info_sec) /* Check if the profile info exists */ static int -i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) +i40e_check_profile_info(uint16_t port, uint8_t *profile_info_sec) { struct rte_eth_dev *dev = &rte_eth_devices[port]; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1557,7 +1557,7 @@ i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) } int -rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op) { @@ -1863,7 +1863,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg_buff, uint32_t pkg_size, } int -rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size) +rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size) { struct rte_eth_dev *dev; struct i40e_hw *hw; @@ -1991,7 +1991,7 @@ static int check_invalid_ptype_mapping( int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive) @@ -2027,7 +2027,7 @@ rte_pmd_i40e_ptype_mapping_update( return 0; } -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port) { struct rte_eth_dev *dev; @@ -2044,7 +2044,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) } int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -2078,7 +2078,7 @@ int rte_pmd_i40e_ptype_mapping_get( return 0; } -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type) diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h index 356fa89d7..7f32a59b1 100644 --- a/drivers/net/i40e/rte_pmd_i40e.h +++ b/drivers/net/i40e/rte_pmd_i40e.h @@ -157,7 +157,7 @@ struct rte_pmd_i40e_ptype_mapping { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); +int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf); /** * Enable/Disable VF MAC anti spoofing. @@ -174,7 +174,7 @@ int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -193,7 +193,7 @@ int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -210,7 +210,7 @@ int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_tx_loopback(uint8_t port, +int rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on); /** @@ -228,7 +228,7 @@ int rte_pmd_i40e_set_tx_loopback(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -247,7 +247,7 @@ int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -271,7 +271,7 @@ int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr); /** @@ -291,7 +291,7 @@ int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, * - (-EINVAL) if bad parameter. */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -309,7 +309,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id); /** @@ -328,7 +328,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on); /** @@ -347,7 +347,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on); /** * Enable/Disable VF VLAN filter @@ -368,7 +368,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on); /** @@ -393,7 +393,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_vf_stats(uint8_t port, +int rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -409,7 +409,7 @@ int rte_pmd_i40e_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_reset_vf_stats(uint8_t port, +int rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -434,7 +434,7 @@ int rte_pmd_i40e_reset_vf_stats(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw); @@ -459,7 +459,7 @@ int rte_pmd_i40e_set_vf_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, +int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight); @@ -484,7 +484,7 @@ int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw); @@ -502,7 +502,7 @@ int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); +int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map); /** * Load/Unload a ddp package @@ -523,7 +523,7 @@ int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); * - (-EACCES) if profile does not exist. * - (-ENOTSUP) if operation not supported. */ -int rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op); @@ -561,7 +561,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); +int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size); /** * Update hardware defined ptype to software defined packet type @@ -581,7 +581,7 @@ int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); * set other PTYPEs maps to PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive); @@ -593,7 +593,7 @@ int rte_pmd_i40e_ptype_mapping_update( * @param port * pointer to port identifier of the device */ -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port); /** * Get hardware defined ptype to software defined ptype @@ -612,7 +612,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -632,7 +632,7 @@ int rte_pmd_i40e_ptype_mapping_get( * @param pkt_type * the new packet type to overwrite */ -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 22171d866..c5e039886 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2504,8 +2504,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev) * - fixed speed: TODO implement */ if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; fix speed not supported", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, fix speed not supported", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 85feb0bdc..176c9d4a2 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -148,7 +148,7 @@ struct ixgbe_rx_queue { uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ uint16_t pkt_type_mask; /**< Packet type mask for different NICs. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise. */ uint8_t drop_en; /**< If not 0, set SRRCTL.Drop_En. */ uint8_t rx_deferred_start; /**< not in global dev start. */ @@ -237,7 +237,7 @@ struct ixgbe_tx_queue { uint16_t tx_next_rs; /**< next desc to set RS bit */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 79897ff64..f12737857 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -38,7 +38,7 @@ #include "rte_pmd_ixgbe.h" int -rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct ixgbe_hw *hw; @@ -73,7 +73,7 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) +rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf) { struct ixgbe_hw *hw; struct ixgbe_vf_info *vfinfo; @@ -105,7 +105,7 @@ rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) } int -rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -135,7 +135,7 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -164,7 +164,7 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) +rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -200,7 +200,7 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) } int -rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -230,7 +230,7 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -260,7 +260,7 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -295,7 +295,7 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -342,7 +342,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { int val = 0; @@ -389,7 +389,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -439,7 +439,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -489,7 +489,7 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct rte_eth_dev *dev; @@ -524,7 +524,7 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, } int -rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *dev; @@ -540,7 +540,7 @@ rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) +rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -623,7 +623,7 @@ rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) } int -rte_pmd_ixgbe_macsec_disable(uint8_t port) +rte_pmd_ixgbe_macsec_disable(uint16_t port) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -687,7 +687,7 @@ rte_pmd_ixgbe_macsec_disable(uint8_t port) } int -rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) +rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -712,7 +712,7 @@ rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) } int -rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) +rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -738,7 +738,7 @@ rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) } int -rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -794,7 +794,7 @@ rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -837,7 +837,7 @@ rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight) { @@ -911,7 +911,7 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, #ifdef RTE_LIBRTE_IXGBE_BYPASS int -rte_pmd_ixgbe_bypass_init(uint8_t port_id) +rte_pmd_ixgbe_bypass_init(uint16_t port_id) { struct rte_eth_dev *dev; @@ -926,7 +926,7 @@ rte_pmd_ixgbe_bypass_init(uint8_t port_id) } int -rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) +rte_pmd_ixgbe_bypass_state_show(uint16_t port_id, uint32_t *state) { struct rte_eth_dev *dev; @@ -940,7 +940,7 @@ rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) } int -rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) +rte_pmd_ixgbe_bypass_state_set(uint16_t port_id, uint32_t *new_state) { struct rte_eth_dev *dev; @@ -954,7 +954,7 @@ rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) } int -rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_show(uint16_t port_id, uint32_t event, uint32_t *state) { @@ -970,7 +970,7 @@ rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_store(uint16_t port_id, uint32_t event, uint32_t state) { @@ -986,7 +986,7 @@ rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) +rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port_id, uint32_t timeout) { struct rte_eth_dev *dev; @@ -1000,7 +1000,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) } int -rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) +rte_pmd_ixgbe_bypass_ver_show(uint16_t port_id, uint32_t *ver) { struct rte_eth_dev *dev; @@ -1014,7 +1014,7 @@ rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) } int -rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) +rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port_id, uint32_t *wd_timeout) { struct rte_eth_dev *dev; @@ -1028,7 +1028,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) } int -rte_pmd_ixgbe_bypass_wd_reset(uint8_t port_id) +rte_pmd_ixgbe_bypass_wd_reset(uint16_t port_id) { struct rte_eth_dev *dev; diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index d33c285db..3d55ab20e 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -53,7 +53,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); +int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf); /** * Set the VF MAC address. @@ -69,8 +69,8 @@ int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, - struct ether_addr *mac_addr); +int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, + struct ether_addr *mac_addr); /** * Enable/Disable VF VLAN anti spoofing. @@ -87,7 +87,8 @@ int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, + uint8_t on); /** * Enable/Disable VF MAC anti spoofing. @@ -104,7 +105,7 @@ int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -122,7 +123,7 @@ int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -139,7 +140,7 @@ int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -155,7 +156,7 @@ int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * set drop enable bit in the VF split rx control register @@ -174,7 +175,7 @@ int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan strip for all queues in a pool @@ -194,7 +195,7 @@ int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable MACsec offload. @@ -212,7 +213,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); +int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp); /** * Disable MACsec offload. @@ -224,7 +225,7 @@ int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_disable(uint8_t port); +int rte_pmd_ixgbe_macsec_disable(uint16_t port); /** * Configure Tx SC (Secure Connection). @@ -238,7 +239,7 @@ int rte_pmd_ixgbe_macsec_disable(uint8_t port); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); +int rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac); /** * Configure Rx SC (Secure Connection). @@ -254,7 +255,7 @@ int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); +int rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi); /** * Enable Tx SA (Secure Association). @@ -275,8 +276,8 @@ int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, - uint32_t pn, uint8_t *key); +int rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); /** * Enable Rx SA (Secure Association). @@ -297,8 +298,8 @@ int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, - uint32_t pn, uint8_t *key); +int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); /** * Set RX L2 Filtering mode of a VF of an Ethernet device. @@ -323,7 +324,8 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, + uint8_t on); /** * Enable or disable a VF traffic receive of an Ethernet device. @@ -342,7 +344,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable or disable a VF traffic transmit of the Ethernet device. @@ -361,7 +363,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable hardware VF VLAN filtering by an Ethernet device of @@ -383,7 +385,8 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, + uint64_t vf_mask, uint8_t vlan_on); /** * Set the rate limitation for a vf on an Ethernet device. @@ -402,7 +405,8 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); +int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, + uint16_t tx_rate, uint64_t q_msk); /** * Set all the TCs' bandwidth weight. @@ -423,7 +427,7 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +int rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight); @@ -439,7 +443,7 @@ int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_init(uint8_t port); +int rte_pmd_ixgbe_bypass_init(uint16_t port); /** * Return bypass state. @@ -456,7 +460,7 @@ int rte_pmd_ixgbe_bypass_init(uint8_t port); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); +int rte_pmd_ixgbe_bypass_state_show(uint16_t port, uint32_t *state); /** * Set bypass state @@ -473,7 +477,7 @@ int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); +int rte_pmd_ixgbe_bypass_state_set(uint16_t port, uint32_t *new_state); /** * Return bypass state when given event occurs. @@ -497,7 +501,7 @@ int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_show(uint8_t port, +int rte_pmd_ixgbe_bypass_event_show(uint16_t port, uint32_t event, uint32_t *state); @@ -523,7 +527,7 @@ int rte_pmd_ixgbe_bypass_event_show(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_store(uint8_t port, +int rte_pmd_ixgbe_bypass_event_store(uint16_t port, uint32_t event, uint32_t state); @@ -547,7 +551,7 @@ int rte_pmd_ixgbe_bypass_event_store(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port, uint32_t timeout); /** * Get bypass firmware version. @@ -561,7 +565,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); +int rte_pmd_ixgbe_bypass_ver_show(uint16_t port, uint32_t *ver); /** * Return bypass watchdog timeout in seconds @@ -583,7 +587,7 @@ int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port, uint32_t *wd_timeout); /** * Reset bypass watchdog timer @@ -595,7 +599,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_reset(uint8_t port); +int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port); /** diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 92b03c4cb..2d794f841 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1239,13 +1239,13 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev) memset(&link, 0, sizeof(link)); nfp_net_dev_atomic_read_link_status(dev, &link); if (link.link_status) - RTE_LOG(INFO, PMD, "Port %d: Link Up - speed %u Mbps - %s\n", - (int)(dev->data->port_id), (unsigned)link.link_speed, + RTE_LOG(INFO, PMD, "Port %u: Link Up - speed %u Mbps - %s\n", + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); else - RTE_LOG(INFO, PMD, " Port %d: Link Down\n", - (int)(dev->data->port_id)); + RTE_LOG(INFO, PMD, " Port %u: Link Down\n", + dev->data->port_id); RTE_LOG(INFO, PMD, "PCI Address: %04d:%02d:%02d:%d\n", pci_dev->addr.domain, pci_dev->addr.bus, @@ -1547,9 +1547,9 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, if (tx_free_thresh > (nb_desc)) { RTE_LOG(ERR, PMD, "tx_free_thresh must be less than the number of TX " - "descriptors. (tx_free_thresh=%u port=%d " + "descriptors. (tx_free_thresh=%u port=%u " "queue=%d)\n", (unsigned int)tx_free_thresh, - (int)dev->data->port_id, (int)queue_idx); + dev->data->port_id, (int)queue_idx); return -(EINVAL); } @@ -1847,9 +1847,9 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) */ new_mb = rte_pktmbuf_alloc(rxq->mem_pool); if (unlikely(new_mb == NULL)) { - RTE_LOG_DP(DEBUG, PMD, "RX mbuf alloc failed port_id=%u " - "queue_id=%u\n", (unsigned)rxq->port_id, - (unsigned)rxq->qidx); + RTE_LOG_DP(DEBUG, PMD, + "RX mbuf alloc failed port_id=%u queue_id=%u\n", + rxq->port_id, rxq->qidx); nfp_net_mbuf_alloc_failed(rxq); break; } @@ -1932,8 +1932,8 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (nb_hold == 0) return nb_hold; - PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, nb_hold); + PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received\n", + rxq->port_id, (unsigned int)rxq->qidx, nb_hold); nb_hold += rxq->nb_rx_hold; @@ -1944,7 +1944,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rte_wmb(); if (nb_hold > rxq->rx_free_thresh) { PMD_RX_LOG(DEBUG, "port=%u queue=%u nb_hold=%u avail=%u\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, + rxq->port_id, (unsigned int)rxq->qidx, (unsigned)nb_hold, (unsigned)avail); nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, nb_hold); nb_hold = 0; @@ -2547,7 +2547,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) ether_addr_copy((struct ether_addr *)hw->mac_addr, ð_dev->data->mac_addrs[0]); - PMD_INIT_LOG(INFO, "port %d VendorID=0x%x DeviceID=0x%x " + PMD_INIT_LOG(INFO, "port %u VendorID=0x%x DeviceID=0x%x " "mac=%02x:%02x:%02x:%02x:%02x:%02x", eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id, diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h index eec56bc1c..7fc76aa76 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -250,7 +250,7 @@ struct nfp_net_txq { uint32_t tx_hthresh; /* not used by now. Future? */ uint32_t tx_wthresh; /* not used by now. Future? */ uint32_t txq_flags; /* not used by now. Future? */ - uint8_t port_id; + uint16_t port_id; int qidx; int tx_qcidx; __le64 dma; diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 5aef0591e..fa9313dec 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -68,7 +68,7 @@ struct null_queue { struct pmd_internals { unsigned packet_size; unsigned packet_copy; - uint8_t port_id; + uint16_t port_id; struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT]; struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT]; diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index defb3b419..b51f16cbd 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -75,7 +75,7 @@ struct queue_stat { struct pcap_rx_queue { pcap_t *pcap; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; struct queue_stat rx_stat; char name[PATH_MAX]; diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h index 9864bb448..96f0d351d 100644 --- a/drivers/net/qede/qede_if.h +++ b/drivers/net/qede/qede_if.h @@ -97,7 +97,7 @@ struct qed_link_output { uint32_t speed; /* In Mb/s */ uint32_t adv_speed; /* Speed mask */ uint8_t duplex; /* In DUPLEX defs */ - uint8_t port; /* In PORT defs */ + uint16_t port; /* In PORT defs */ bool autoneg; uint32_t pause_config; }; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 464d3d384..e3fa7b0e2 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -394,7 +394,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], }; char args_str[32] = { 0 }; char ring_name[32] = { 0 }; - uint8_t port_id = RTE_MAX_ETHPORTS; + uint16_t port_id = RTE_MAX_ETHPORTS; int ret; /* do some parameter checking */ diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 0dac5e60e..93310bdfb 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -105,7 +105,7 @@ struct vhost_queue { rte_atomic32_t while_queuing; struct pmd_internal *internal; struct rte_mempool *mb_pool; - uint8_t port; + uint16_t port; uint16_t virtqueue_id; struct vhost_stats stats; }; @@ -705,8 +705,8 @@ static struct vhost_device_ops vhost_ops = { }; int -rte_eth_vhost_get_queue_event(uint8_t port_id, - struct rte_eth_vhost_queue_event *event) +rte_eth_vhost_get_queue_event(uint16_t port_id, + struct rte_eth_vhost_queue_event *event) { struct rte_vhost_vring_state *state; unsigned int i; @@ -742,7 +742,7 @@ rte_eth_vhost_get_queue_event(uint8_t port_id, } int -rte_eth_vhost_get_vid_from_port_id(uint8_t port_id) +rte_eth_vhost_get_vid_from_port_id(uint16_t port_id) { struct internal_list *list; struct rte_eth_dev *eth_dev; diff --git a/drivers/net/vhost/rte_eth_vhost.h b/drivers/net/vhost/rte_eth_vhost.h index 39ca77197..0528c6aee 100644 --- a/drivers/net/vhost/rte_eth_vhost.h +++ b/drivers/net/vhost/rte_eth_vhost.h @@ -69,8 +69,8 @@ struct rte_eth_vhost_queue_event { * - On success, zero. * - On failure, a negative value. */ -int rte_eth_vhost_get_queue_event(uint8_t port_id, - struct rte_eth_vhost_queue_event *event); +int rte_eth_vhost_get_queue_event(uint16_t port_id, + struct rte_eth_vhost_queue_event *event); /** * Get the 'vid' value associated with the specified port. @@ -79,7 +79,7 @@ int rte_eth_vhost_get_queue_event(uint8_t port_id, * - On success, the 'vid' associated with 'port_id'. * - On failure, a negative value. */ -int rte_eth_vhost_get_vid_from_port_id(uint8_t port_id); +int rte_eth_vhost_get_vid_from_port_id(uint16_t port_id); #ifdef __cplusplus } diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 18caebdd7..330ee94be 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -260,7 +260,7 @@ struct virtio_hw { uint8_t use_msix; uint8_t modern; uint8_t use_simple_rxtx; - uint8_t port_id; + uint16_t port_id; uint8_t mac_addr[ETHER_ADDR_LEN]; uint32_t notify_off_multiplier; uint8_t *isr; diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h index 28f82d6a8..198b2d8fb 100644 --- a/drivers/net/virtio/virtio_rxtx.h +++ b/drivers/net/virtio/virtio_rxtx.h @@ -54,7 +54,7 @@ struct virtnet_rx { struct rte_mempool *mpool; /**< mempool for mbuf allocation */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -69,7 +69,7 @@ struct virtnet_tx { phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -82,7 +82,7 @@ struct virtnet_ctl { /**< memzone to populate hdr. */ const struct rte_memzone *virtio_net_hdr_mz; phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ const struct rte_memzone *mz; /**< mem zone to populate RX ring. */ }; diff --git a/drivers/net/xenvirt/virtqueue.h b/drivers/net/xenvirt/virtqueue.h index 1bb6877cd..1374d9193 100644 --- a/drivers/net/xenvirt/virtqueue.h +++ b/drivers/net/xenvirt/virtqueue.h @@ -74,7 +74,7 @@ struct virtqueue { struct rte_mempool *mpool; /**< mempool for mbuf allocation */ uint16_t queue_id; /**< DPDK queue index. */ uint16_t vq_queue_index; /**< PCI queue index */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ void *vq_ring_virt_mem; /**< virtual address of vring*/ int vq_alignment; diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index 3ceb35166..f373697a7 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -84,7 +84,7 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data) int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id) + uint16_t port_id) { struct rte_stats_bitrate *port_data; struct rte_eth_stats eth_stats; diff --git a/lib/librte_bitratestats/rte_bitrate.h b/lib/librte_bitratestats/rte_bitrate.h index 15fc270a3..2b40cda03 100644 --- a/lib/librte_bitratestats/rte_bitrate.h +++ b/lib/librte_bitratestats/rte_bitrate.h @@ -85,7 +85,7 @@ int rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data); * - Negative value on error */ int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id); + uint16_t port_id); #ifdef __cplusplus } diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0597641ee..f1731238b 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -138,8 +138,8 @@ enum { STAT_QMAP_RX }; -uint8_t -rte_eth_find_next(uint8_t port_id) +uint16_t +rte_eth_find_next(uint16_t port_id) { while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED) @@ -187,7 +187,7 @@ rte_eth_dev_allocated(const char *name) return NULL; } -static uint8_t +static uint16_t rte_eth_dev_find_free_port(void) { unsigned i; @@ -200,7 +200,7 @@ rte_eth_dev_find_free_port(void) } static struct rte_eth_dev * -eth_dev_get(uint8_t port_id) +eth_dev_get(uint16_t port_id) { struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id]; @@ -216,7 +216,7 @@ eth_dev_get(uint8_t port_id) struct rte_eth_dev * rte_eth_dev_allocate(const char *name) { - uint8_t port_id; + uint16_t port_id; struct rte_eth_dev *eth_dev; port_id = rte_eth_dev_find_free_port(); @@ -251,7 +251,7 @@ rte_eth_dev_allocate(const char *name) struct rte_eth_dev * rte_eth_dev_attach_secondary(const char *name) { - uint8_t i; + uint16_t i; struct rte_eth_dev *eth_dev; if (rte_eth_dev_data == NULL) @@ -285,7 +285,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) } int -rte_eth_dev_is_valid_port(uint8_t port_id) +rte_eth_dev_is_valid_port(uint16_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && @@ -296,17 +296,17 @@ rte_eth_dev_is_valid_port(uint8_t port_id) } int -rte_eth_dev_socket_id(uint8_t port_id) +rte_eth_dev_socket_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; } -uint8_t +uint16_t rte_eth_dev_count(void) { - uint8_t p; - uint8_t count; + uint16_t p; + uint16_t count; count = 0; @@ -317,7 +317,7 @@ rte_eth_dev_count(void) } int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name) { const char *tmp; @@ -336,7 +336,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) } int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) { int ret; int i; @@ -361,7 +361,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) } static int -rte_eth_dev_is_detachable(uint8_t port_id) +rte_eth_dev_is_detachable(uint16_t port_id) { uint32_t dev_flags; @@ -377,7 +377,7 @@ rte_eth_dev_is_detachable(uint8_t port_id) /* attach the new device, then store port_id of the device */ int -rte_eth_dev_attach(const char *devargs, uint8_t *port_id) +rte_eth_dev_attach(const char *devargs, uint16_t *port_id) { int ret = -1; int current = rte_eth_dev_count(); @@ -423,7 +423,7 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id) /* detach the device, then store the name of the device */ int -rte_eth_dev_detach(uint8_t port_id, char *name) +rte_eth_dev_detach(uint16_t port_id, char *name) { int ret = -1; @@ -501,7 +501,7 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) } int -rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -527,7 +527,7 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -553,7 +553,7 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -579,7 +579,7 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) } int -rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -688,7 +688,7 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) } int -rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf) { struct rte_eth_dev *dev; @@ -839,7 +839,7 @@ _rte_eth_dev_reset(struct rte_eth_dev *dev) } static void -rte_eth_dev_config_restore(uint8_t port_id) +rte_eth_dev_config_restore(uint16_t port_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -894,7 +894,7 @@ rte_eth_dev_config_restore(uint8_t port_id) } int -rte_eth_dev_start(uint8_t port_id) +rte_eth_dev_start(uint16_t port_id) { struct rte_eth_dev *dev; int diag; @@ -906,7 +906,7 @@ rte_eth_dev_start(uint8_t port_id) RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP); if (dev->data->dev_started != 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already started\n", port_id); return 0; @@ -928,7 +928,7 @@ rte_eth_dev_start(uint8_t port_id) } void -rte_eth_dev_stop(uint8_t port_id) +rte_eth_dev_stop(uint16_t port_id) { struct rte_eth_dev *dev; @@ -938,7 +938,7 @@ rte_eth_dev_stop(uint8_t port_id) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop); if (dev->data->dev_started == 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already stopped\n", port_id); return; @@ -949,7 +949,7 @@ rte_eth_dev_stop(uint8_t port_id) } int -rte_eth_dev_set_link_up(uint8_t port_id) +rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; @@ -962,7 +962,7 @@ rte_eth_dev_set_link_up(uint8_t port_id) } int -rte_eth_dev_set_link_down(uint8_t port_id) +rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; @@ -975,7 +975,7 @@ rte_eth_dev_set_link_down(uint8_t port_id) } void -rte_eth_dev_close(uint8_t port_id) +rte_eth_dev_close(uint16_t port_id) { struct rte_eth_dev *dev; @@ -995,7 +995,7 @@ rte_eth_dev_close(uint8_t port_id) } int -rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) @@ -1086,7 +1086,7 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) { @@ -1190,7 +1190,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) } int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -1204,7 +1204,7 @@ rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) } void -rte_eth_promiscuous_enable(uint8_t port_id) +rte_eth_promiscuous_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1217,7 +1217,7 @@ rte_eth_promiscuous_enable(uint8_t port_id) } void -rte_eth_promiscuous_disable(uint8_t port_id) +rte_eth_promiscuous_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1230,7 +1230,7 @@ rte_eth_promiscuous_disable(uint8_t port_id) } int -rte_eth_promiscuous_get(uint8_t port_id) +rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1241,7 +1241,7 @@ rte_eth_promiscuous_get(uint8_t port_id) } void -rte_eth_allmulticast_enable(uint8_t port_id) +rte_eth_allmulticast_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1254,7 +1254,7 @@ rte_eth_allmulticast_enable(uint8_t port_id) } void -rte_eth_allmulticast_disable(uint8_t port_id) +rte_eth_allmulticast_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1267,7 +1267,7 @@ rte_eth_allmulticast_disable(uint8_t port_id) } int -rte_eth_allmulticast_get(uint8_t port_id) +rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1292,7 +1292,7 @@ rte_eth_dev_atomic_read_link_status(struct rte_eth_dev *dev, } void -rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1309,7 +1309,7 @@ rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) } void -rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1326,7 +1326,7 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) } int -rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) +rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; @@ -1342,7 +1342,7 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) } void -rte_eth_stats_reset(uint8_t port_id) +rte_eth_stats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1355,7 +1355,7 @@ rte_eth_stats_reset(uint8_t port_id) } static int -get_xstats_count(uint8_t port_id) +get_xstats_count(uint16_t port_id) { struct rte_eth_dev *dev; int count; @@ -1384,7 +1384,7 @@ get_xstats_count(uint8_t port_id) } int -rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id) { int cnt_xstats, idx_xstat; @@ -1428,7 +1428,7 @@ rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, } int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids) { @@ -1545,7 +1545,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, } int -rte_eth_xstats_get_names(uint8_t port_id, +rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size) { @@ -1611,8 +1611,8 @@ rte_eth_xstats_get_names(uint8_t port_id, /* retrieve ethdev extended statistics */ int -rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, - unsigned int n) +rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, + uint64_t *values, unsigned int n) { /* If need all xstats */ if (!ids) { @@ -1737,7 +1737,7 @@ rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, } int -rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n) { struct rte_eth_stats eth_stats; @@ -1819,7 +1819,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, /* reset ethdev extended statistics */ void -rte_eth_xstats_reset(uint8_t port_id) +rte_eth_xstats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1837,7 +1837,7 @@ rte_eth_xstats_reset(uint8_t port_id) } static int -set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, +set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx) { struct rte_eth_dev *dev; @@ -1853,7 +1853,7 @@ set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, int -rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, @@ -1862,7 +1862,7 @@ rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, int -rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, @@ -1870,7 +1870,7 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) +rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; @@ -1882,7 +1882,7 @@ rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) } void -rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) +rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; const struct rte_eth_desc_lim lim = { @@ -1906,7 +1906,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) } int -rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num) { int i, j; @@ -1932,7 +1932,7 @@ rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, } void -rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) +rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -1943,7 +1943,7 @@ rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) int -rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) +rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) { struct rte_eth_dev *dev; @@ -1955,7 +1955,7 @@ rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) } int -rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) +rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) { int ret; struct rte_eth_dev *dev; @@ -1972,7 +1972,7 @@ rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) } int -rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) +rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) { struct rte_eth_dev *dev; int ret; @@ -2011,7 +2011,8 @@ rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) } int -rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int on) +rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, + int on) { struct rte_eth_dev *dev; @@ -2029,7 +2030,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int o } int -rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tpid) { @@ -2043,7 +2044,7 @@ rte_eth_dev_set_vlan_ether_type(uint8_t port_id, } int -rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) +rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) { struct rte_eth_dev *dev; int ret = 0; @@ -2086,7 +2087,7 @@ rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) } int -rte_eth_dev_get_vlan_offload(uint8_t port_id) +rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; int ret = 0; @@ -2107,7 +2108,7 @@ rte_eth_dev_get_vlan_offload(uint8_t port_id) } int -rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) +rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; @@ -2120,7 +2121,7 @@ rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) } int -rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2132,7 +2133,7 @@ rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2148,7 +2149,8 @@ rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf) +rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, + struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; @@ -2214,7 +2216,7 @@ rte_eth_check_reta_entry(struct rte_eth_rss_reta_entry64 *reta_conf, } int -rte_eth_dev_rss_reta_update(uint8_t port_id, +rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2240,7 +2242,7 @@ rte_eth_dev_rss_reta_update(uint8_t port_id, } int -rte_eth_dev_rss_reta_query(uint8_t port_id, +rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2260,7 +2262,8 @@ rte_eth_dev_rss_reta_query(uint8_t port_id, } int -rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) +rte_eth_dev_rss_hash_update(uint16_t port_id, + struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; uint16_t rss_hash_protos; @@ -2279,7 +2282,7 @@ rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) } int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; @@ -2291,7 +2294,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2313,7 +2316,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2336,7 +2339,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, } int -rte_eth_led_on(uint8_t port_id) +rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2347,7 +2350,7 @@ rte_eth_led_on(uint8_t port_id) } int -rte_eth_led_off(uint8_t port_id) +rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2362,7 +2365,7 @@ rte_eth_led_off(uint8_t port_id) * an empty spot. */ static int -get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2381,7 +2384,7 @@ get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) static const struct ether_addr null_mac_addr; int -rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, uint32_t pool) { struct rte_eth_dev *dev; @@ -2434,7 +2437,7 @@ rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; int index; @@ -2463,7 +2466,7 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) } int -rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; @@ -2489,7 +2492,7 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) * an empty spot. */ static int -get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2508,7 +2511,7 @@ get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) } int -rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, uint8_t on) { int index; @@ -2560,7 +2563,7 @@ rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) +rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; @@ -2572,7 +2575,7 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) return (*dev->dev_ops->uc_all_hash_table_set)(dev, on); } -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate) { struct rte_eth_dev *dev; @@ -2603,7 +2606,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, } int -rte_eth_mirror_rule_set(uint8_t port_id, +rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) { @@ -2641,7 +2644,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, } int -rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) +rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id) { struct rte_eth_dev *dev; @@ -2654,7 +2657,7 @@ rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) } int -rte_eth_dev_callback_register(uint8_t port_id, +rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2694,7 +2697,7 @@ rte_eth_dev_callback_register(uint8_t port_id, } int -rte_eth_dev_callback_unregister(uint8_t port_id, +rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2766,7 +2769,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, } int -rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) +rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) { uint32_t vec; struct rte_eth_dev *dev; @@ -2827,7 +2830,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, } int -rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data) { uint32_t vec; @@ -2867,7 +2870,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_rx_intr_enable(uint8_t port_id, +rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2881,7 +2884,7 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id, } int -rte_eth_dev_rx_intr_disable(uint8_t port_id, +rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2896,7 +2899,8 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id, int -rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) +rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type) { struct rte_eth_dev *dev; @@ -2909,7 +2913,7 @@ rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) } int -rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { struct rte_eth_dev *dev; @@ -2922,7 +2926,7 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, } void * -rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2964,7 +2968,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2999,7 +3003,7 @@ rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3042,7 +3046,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3076,7 +3080,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3110,7 +3114,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo) { struct rte_eth_dev *dev; @@ -3134,7 +3138,7 @@ rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo) { struct rte_eth_dev *dev; @@ -3158,7 +3162,7 @@ rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_set_mc_addr_list(uint8_t port_id, +rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) { @@ -3172,7 +3176,7 @@ rte_eth_dev_set_mc_addr_list(uint8_t port_id, } int -rte_eth_timesync_enable(uint8_t port_id) +rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3184,7 +3188,7 @@ rte_eth_timesync_enable(uint8_t port_id) } int -rte_eth_timesync_disable(uint8_t port_id) +rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3196,7 +3200,7 @@ rte_eth_timesync_disable(uint8_t port_id) } int -rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, +rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; @@ -3209,7 +3213,8 @@ rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, } int -rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_tx_timestamp(uint16_t port_id, + struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3221,7 +3226,7 @@ rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) +rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; @@ -3233,7 +3238,7 @@ rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) } int -rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3245,7 +3250,7 @@ rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) +rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3257,7 +3262,7 @@ rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) } int -rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) +rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; @@ -3269,7 +3274,7 @@ rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) } int -rte_eth_dev_get_eeprom_length(uint8_t port_id) +rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3281,7 +3286,7 @@ rte_eth_dev_get_eeprom_length(uint8_t port_id) } int -rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3293,7 +3298,7 @@ rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3305,7 +3310,7 @@ rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_get_dcb_info(uint8_t port_id, +rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; @@ -3320,7 +3325,7 @@ rte_eth_dev_get_dcb_info(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) { struct rte_eth_dev *dev; @@ -3343,7 +3348,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en) @@ -3387,7 +3392,7 @@ rte_eth_dev_adjust_nb_desc(uint16_t *nb_desc, } int -rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 0adf3274a..ca75b199c 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1568,7 +1568,7 @@ struct eth_dev_ops { * @return * The number of packets returned to the user. */ -typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); @@ -1592,7 +1592,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, * @return * The number of packets to be written to the NIC. */ -typedef uint16_t (*rte_tx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param); /** @@ -1695,7 +1695,7 @@ struct rte_eth_dev_data { /** bitmap array of associating Ethernet MAC addresses to pools */ struct ether_addr* hash_mac_addrs; /** Device Ethernet MAC addresses of hash filtering. */ - uint8_t port_id; /**< Device [external] port identifier. */ + uint16_t port_id; /**< Device [external] port identifier. */ __extension__ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */ scattered_rx : 1, /**< RX of scattered packets is ON(1) / OFF(0) */ @@ -1737,7 +1737,7 @@ extern struct rte_eth_dev rte_eth_devices[]; * @return * Next valid port id, RTE_MAX_ETHPORTS if there is none. */ -uint8_t rte_eth_find_next(uint8_t port_id); +uint16_t rte_eth_find_next(uint16_t port_id); /** * Macro to iterate over all enabled ethdev ports. @@ -1760,7 +1760,7 @@ uint8_t rte_eth_find_next(uint8_t port_id); * @return * - The total number of usable Ethernet devices. */ -uint8_t rte_eth_dev_count(void); +uint16_t rte_eth_dev_count(void); /** * @internal @@ -1821,7 +1821,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * @return * 0 on success and port_id is filled, negative on error */ -int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); +int rte_eth_dev_attach(const char *devargs, uint16_t *port_id); /** * Detach a Ethernet device specified by port identifier. @@ -1836,7 +1836,7 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); * @return * 0 on success and devname is filled, negative on error */ -int rte_eth_dev_detach(uint8_t port_id, char *devname); +int rte_eth_dev_detach(uint16_t port_id, char *devname); /** * Convert a numerical speed in Mbps to a bitmap flag that can be used in @@ -1880,7 +1880,7 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex); * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, +int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf); /** @@ -1935,7 +1935,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * allocate network memory buffers from the memory pool when * initializing receive descriptors. */ -int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); @@ -1983,7 +1983,7 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, * - 0: Success, the transmit queue is correctly set up. * - -ENOMEM: Unable to allocate the transmit ring descriptors. */ -int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); @@ -1997,7 +1997,7 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, * a default of zero if the socket could not be determined. * -1 is returned is the port_id value is out of range. */ -int rte_eth_dev_socket_id(uint8_t port_id); +int rte_eth_dev_socket_id(uint16_t port_id); /** * Check if port_id of device is attached @@ -2008,7 +2008,7 @@ int rte_eth_dev_socket_id(uint8_t port_id); * - 0 if port is out of range or not attached * - 1 if device is attached */ -int rte_eth_dev_is_valid_port(uint8_t port_id); +int rte_eth_dev_is_valid_port(uint16_t port_id); /** * Start specified RX queue of a port. It is used when rx_deferred_start @@ -2025,7 +2025,7 @@ int rte_eth_dev_is_valid_port(uint8_t port_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); /** * Stop specified RX queue of a port @@ -2041,7 +2041,7 @@ int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); /** * Start TX for specified queue of a port. It is used when tx_deferred_start @@ -2058,7 +2058,7 @@ int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); /** * Stop specified TX queue of a port @@ -2074,9 +2074,7 @@ int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); - - +int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id); /** * Start an Ethernet device. @@ -2093,7 +2091,7 @@ int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); * - 0: Success, Ethernet device started. * - <0: Error code of the driver device start function. */ -int rte_eth_dev_start(uint8_t port_id); +int rte_eth_dev_start(uint16_t port_id); /** * Stop an Ethernet device. The device can be restarted with a call to @@ -2102,7 +2100,7 @@ int rte_eth_dev_start(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_stop(uint8_t port_id); +void rte_eth_dev_stop(uint16_t port_id); /** @@ -2117,7 +2115,7 @@ void rte_eth_dev_stop(uint8_t port_id); * - 0: Success, Ethernet device linked up. * - <0: Error code of the driver device link up function. */ -int rte_eth_dev_set_link_up(uint8_t port_id); +int rte_eth_dev_set_link_up(uint16_t port_id); /** * Link down an Ethernet device. @@ -2128,7 +2126,7 @@ int rte_eth_dev_set_link_up(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_set_link_down(uint8_t port_id); +int rte_eth_dev_set_link_down(uint16_t port_id); /** * Close a stopped Ethernet device. The device cannot be restarted! @@ -2138,7 +2136,7 @@ int rte_eth_dev_set_link_down(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_close(uint8_t port_id); +void rte_eth_dev_close(uint16_t port_id); /** * Enable receipt in promiscuous mode for an Ethernet device. @@ -2146,7 +2144,7 @@ void rte_eth_dev_close(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_enable(uint8_t port_id); +void rte_eth_promiscuous_enable(uint16_t port_id); /** * Disable receipt in promiscuous mode for an Ethernet device. @@ -2154,7 +2152,7 @@ void rte_eth_promiscuous_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_disable(uint8_t port_id); +void rte_eth_promiscuous_disable(uint16_t port_id); /** * Return the value of promiscuous mode for an Ethernet device. @@ -2166,7 +2164,7 @@ void rte_eth_promiscuous_disable(uint8_t port_id); * - (0) if promiscuous is disabled. * - (-1) on error */ -int rte_eth_promiscuous_get(uint8_t port_id); +int rte_eth_promiscuous_get(uint16_t port_id); /** * Enable the receipt of any multicast frame by an Ethernet device. @@ -2174,7 +2172,7 @@ int rte_eth_promiscuous_get(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_enable(uint8_t port_id); +void rte_eth_allmulticast_enable(uint16_t port_id); /** * Disable the receipt of all multicast frames by an Ethernet device. @@ -2182,7 +2180,7 @@ void rte_eth_allmulticast_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_disable(uint8_t port_id); +void rte_eth_allmulticast_disable(uint16_t port_id); /** * Return the value of allmulticast mode for an Ethernet device. @@ -2194,7 +2192,7 @@ void rte_eth_allmulticast_disable(uint8_t port_id); * - (0) if allmulticast is disabled. * - (-1) on error */ -int rte_eth_allmulticast_get(uint8_t port_id); +int rte_eth_allmulticast_get(uint16_t port_id); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2207,7 +2205,7 @@ int rte_eth_allmulticast_get(uint8_t port_id); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2220,7 +2218,7 @@ void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the general I/O statistics of an Ethernet device. @@ -2239,7 +2237,7 @@ void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); +int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. @@ -2247,7 +2245,7 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_stats_reset(uint8_t port_id); +void rte_eth_stats_reset(uint16_t port_id); /** * Retrieve names of extended statistics of an Ethernet device. @@ -2269,7 +2267,7 @@ void rte_eth_stats_reset(uint8_t port_id); * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_names(uint8_t port_id, +int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size); @@ -2295,7 +2293,7 @@ int rte_eth_xstats_get_names(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n); /** @@ -2321,7 +2319,7 @@ int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, * - A negative value on error (invalid port id). */ int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids); @@ -2348,7 +2346,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, +int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, uint64_t *values, unsigned int n); /** @@ -2368,7 +2366,7 @@ int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, * -ENODEV for invalid port_id, * -EINVAL if the xstat_name doesn't exist in port_id */ -int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id); /** @@ -2377,7 +2375,7 @@ int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_xstats_reset(uint8_t port_id); +void rte_eth_xstats_reset(uint16_t port_id); /** * Set a mapping for the specified transmit queue to the specified per-queue @@ -2396,7 +2394,7 @@ void rte_eth_xstats_reset(uint8_t port_id); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx); /** @@ -2416,7 +2414,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx); @@ -2429,7 +2427,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. */ -void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -2440,7 +2438,7 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); * A pointer to a structure of type *rte_eth_dev_info* to be filled with * the contextual information of the Ethernet device. */ -void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); +void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info); /** * Retrieve the firmware version of a device. @@ -2460,7 +2458,7 @@ void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); * - (>0) if *fw_size* is not enough to store firmware version, return * the size of the non truncated string. */ -int rte_eth_dev_fw_version_get(uint8_t port_id, +int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size); /** @@ -2501,7 +2499,7 @@ int rte_eth_dev_fw_version_get(uint8_t port_id, * count of supported ptypes will be returned. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num); /** @@ -2515,7 +2513,7 @@ int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); +int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu); /** * Change the MTU of an Ethernet device. @@ -2531,7 +2529,7 @@ int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); * - (-EINVAL) if *mtu* invalid. * - (-EBUSY) if operation is not allowed when the port is running */ -int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); +int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu); /** * Enable/Disable hardware filtering by an Ethernet device of received @@ -2551,7 +2549,7 @@ int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); * - (-ENOSYS) if VLAN filtering on *port_id* disabled. * - (-EINVAL) if *vlan_id* > 4095. */ -int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); +int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on); /** * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. @@ -2572,7 +2570,7 @@ int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *rx_queue_id* invalid. */ -int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on); /** @@ -2591,7 +2589,7 @@ int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type); @@ -2615,7 +2613,7 @@ int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); +int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); /** * Read VLAN Offload configuration from an Ethernet device @@ -2629,7 +2627,7 @@ int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); * ETH_VLAN_EXTEND_OFFLOAD * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_vlan_offload(uint8_t port_id); +int rte_eth_dev_get_vlan_offload(uint16_t port_id); /** * Set port based TX VLAN insertion on or off. @@ -2645,7 +2643,7 @@ int rte_eth_dev_get_vlan_offload(uint8_t port_id); * - (0) if successful. * - negative if failed. */ -int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); +int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); /** * @@ -2730,7 +2728,7 @@ int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); * *rx_pkts* array. */ static inline uint16_t -rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2775,7 +2773,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, * (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) +rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2804,7 +2802,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) * - (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) +rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); @@ -2851,7 +2849,7 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) * - (-ENODEV) bad port or queue (only if compiled with debug). */ static inline int -rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2908,7 +2906,7 @@ rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, * - (-ENOTSUP) if the device does not support this function. * - (-ENODEV) bad port or queue (only if compiled with debug). */ -static inline int rte_eth_tx_descriptor_status(uint8_t port_id, +static inline int rte_eth_tx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2992,7 +2990,7 @@ static inline int rte_eth_tx_descriptor_status(uint8_t port_id, * *tx_pkts* parameter when the transmit ring is full or has been filled up. */ static inline uint16_t -rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3081,7 +3079,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, #ifndef RTE_ETHDEV_TX_PREPARE_NOOP static inline uint16_t -rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev; @@ -3123,7 +3121,8 @@ rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, */ static inline uint16_t -rte_eth_tx_prepare(__rte_unused uint8_t port_id, __rte_unused uint16_t queue_id, +rte_eth_tx_prepare(__rte_unused uint16_t port_id, + __rte_unused uint16_t queue_id, __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { return nb_pkts; @@ -3192,7 +3191,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size); * callback is called for any packets which could not be sent. */ static inline uint16_t -rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer) { uint16_t sent; @@ -3244,7 +3243,7 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, * the rest. */ static __rte_always_inline uint16_t -rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt) { buffer->pkts[buffer->length++] = tx_pkt; @@ -3360,7 +3359,7 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, * are in use. */ int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt); +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt); /** * The eth device event type for interrupt, and maybe others in the future. @@ -3378,7 +3377,7 @@ enum rte_eth_event_type { RTE_ETH_EVENT_MAX /**< max value of this enum */ }; -typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, +typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param); /**< user application callback to be registered for interrupts */ @@ -3400,7 +3399,7 @@ typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_register(uint8_t port_id, +int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3421,7 +3420,7 @@ int rte_eth_dev_callback_register(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_unregister(uint8_t port_id, +int rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3467,7 +3466,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id); /** * When lcore wakes up from rx interrupt indicating packet coming, disable rx @@ -3488,7 +3487,7 @@ int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id); /** * RX Interrupt control per port. @@ -3507,7 +3506,7 @@ int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); +int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data); /** * RX Interrupt control per queue. @@ -3530,7 +3529,7 @@ int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data); /** @@ -3545,7 +3544,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_on(uint8_t port_id); +int rte_eth_led_on(uint16_t port_id); /** * Turn off the LED on the Ethernet device. @@ -3559,7 +3558,7 @@ int rte_eth_led_on(uint8_t port_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_off(uint8_t port_id); +int rte_eth_led_off(uint16_t port_id); /** * Get current status of the Ethernet link flow control for Ethernet device @@ -3573,7 +3572,7 @@ int rte_eth_led_off(uint8_t port_id); * - (-ENOTSUP) if hardware doesn't support flow control. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_flow_ctrl_get(uint8_t port_id, +int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3590,7 +3589,7 @@ int rte_eth_dev_flow_ctrl_get(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3608,7 +3607,7 @@ int rte_eth_dev_flow_ctrl_set(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf); /** @@ -3629,7 +3628,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t pool); /** @@ -3645,7 +3644,7 @@ int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EADDRINUSE) if attempting to remove the default MAC address */ -int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr); /** * Set the default MAC address. @@ -3660,8 +3659,8 @@ int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); - +int rte_eth_dev_default_mac_addr_set(uint16_t port, + struct ether_addr *mac_addr); /** * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device. @@ -3678,7 +3677,7 @@ int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_update(uint8_t port, +int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3697,7 +3696,7 @@ int rte_eth_dev_rss_reta_update(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_query(uint8_t port, +int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3719,8 +3718,8 @@ int rte_eth_dev_rss_reta_query(uint8_t port, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, - uint8_t on); +int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, + uint8_t on); /** * Updates all unicast hash bitmaps for receiving packet with any Unicast @@ -3739,7 +3738,7 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); +int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on); /** * Set a traffic mirroring rule on an Ethernet device @@ -3762,7 +3761,7 @@ int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if the mr_conf information is not correct. */ -int rte_eth_mirror_rule_set(uint8_t port_id, +int rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on); @@ -3780,7 +3779,7 @@ int rte_eth_mirror_rule_set(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_mirror_rule_reset(uint8_t port_id, +int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id); /** @@ -3798,7 +3797,7 @@ int rte_eth_mirror_rule_reset(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate); /** @@ -3814,7 +3813,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_hash_update(uint8_t port_id, +int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3831,7 +3830,7 @@ int rte_eth_dev_rss_hash_update(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support RSS. */ int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3852,7 +3851,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3874,7 +3873,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3890,7 +3889,8 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support this filter type. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type); +int rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type); /** * Take operations to assigned filter type on an Ethernet device. @@ -3910,7 +3910,7 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg); /** @@ -3925,7 +3925,7 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, * - (-ENODEV) if port identifier is invalid. * - (-ENOTSUP) if hardware doesn't support. */ -int rte_eth_dev_get_dcb_info(uint8_t port_id, +int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info); /** @@ -3952,7 +3952,7 @@ int rte_eth_dev_get_dcb_info(uint8_t port_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -3980,7 +3980,7 @@ void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4007,7 +4007,7 @@ void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param); /** @@ -4040,7 +4040,7 @@ void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4073,7 +4073,7 @@ int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4093,7 +4093,7 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); /** @@ -4113,7 +4113,7 @@ int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo); /** @@ -4132,7 +4132,7 @@ int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); +int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info); /** * Retrieve size of device EEPROM @@ -4145,7 +4145,7 @@ int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom_length(uint8_t port_id); +int rte_eth_dev_get_eeprom_length(uint16_t port_id); /** * Retrieve EEPROM and EEPROM attribute @@ -4161,7 +4161,7 @@ int rte_eth_dev_get_eeprom_length(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Program EEPROM with provided data @@ -4177,7 +4177,7 @@ int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Set the list of multicast addresses to filter on an Ethernet device. @@ -4196,7 +4196,7 @@ int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering. * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ -int rte_eth_dev_set_mc_addr_list(uint8_t port_id, +int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr); @@ -4211,7 +4211,7 @@ int rte_eth_dev_set_mc_addr_list(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_enable(uint8_t port_id); +int rte_eth_timesync_enable(uint16_t port_id); /** * Disable IEEE1588/802.1AS timestamping for an Ethernet device. @@ -4224,7 +4224,7 @@ int rte_eth_timesync_enable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_disable(uint8_t port_id); +int rte_eth_timesync_disable(uint16_t port_id); /** * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device. @@ -4243,7 +4243,7 @@ int rte_eth_timesync_disable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags); /** @@ -4260,7 +4260,7 @@ int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp); /** @@ -4279,7 +4279,7 @@ int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); +int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta); /** * Read the time from the timesync clock on an Ethernet device. @@ -4295,7 +4295,7 @@ int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); * @return * - 0: Success. */ -int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); +int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time); /** * Set the time of the timesync clock on an Ethernet device. @@ -4314,7 +4314,7 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time); +int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time); /** * Create memzone for HW rings. @@ -4355,7 +4355,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel); /** @@ -4382,7 +4382,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en); @@ -4400,7 +4400,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, * - (-ENODEV or -EINVAL) on failure. */ int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id); /** * Get the device name from port id @@ -4414,7 +4414,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); * - (-EINVAL) on failure. */ int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name); /** * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from @@ -4432,7 +4432,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); * - (0) if successful. * - (-ENOTSUP, -ENODEV or -EINVAL) on failure. */ -int rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc); diff --git a/lib/librte_ether/rte_tm.c b/lib/librte_ether/rte_tm.c index 71679650e..ceac34115 100644 --- a/lib/librte_ether/rte_tm.c +++ b/lib/librte_ether/rte_tm.c @@ -40,7 +40,7 @@ /* Get generic traffic manager operations structure from a port. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_tm_ops *ops; @@ -87,7 +87,7 @@ rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) /* Get number of leaf nodes */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error) { @@ -113,7 +113,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, /* Check node type (leaf or non-leaf) */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error) @@ -124,7 +124,7 @@ rte_tm_node_type_get(uint8_t port_id, } /* Get capabilities */ -int rte_tm_capabilities_get(uint8_t port_id, +int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error) { @@ -134,7 +134,7 @@ int rte_tm_capabilities_get(uint8_t port_id, } /* Get level capabilities */ -int rte_tm_level_capabilities_get(uint8_t port_id, +int rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error) @@ -145,7 +145,7 @@ int rte_tm_level_capabilities_get(uint8_t port_id, } /* Get node capabilities */ -int rte_tm_node_capabilities_get(uint8_t port_id, +int rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error) @@ -156,7 +156,7 @@ int rte_tm_node_capabilities_get(uint8_t port_id, } /* Add WRED profile */ -int rte_tm_wred_profile_add(uint8_t port_id, +int rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error) @@ -167,7 +167,7 @@ int rte_tm_wred_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_wred_profile_delete(uint8_t port_id, +int rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error) { @@ -177,7 +177,7 @@ int rte_tm_wred_profile_delete(uint8_t port_id, } /* Add/update shared WRED context */ -int rte_tm_shared_wred_context_add_update(uint8_t port_id, +int rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -188,7 +188,7 @@ int rte_tm_shared_wred_context_add_update(uint8_t port_id, } /* Delete shared WRED context */ -int rte_tm_shared_wred_context_delete(uint8_t port_id, +int rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error) { @@ -198,7 +198,7 @@ int rte_tm_shared_wred_context_delete(uint8_t port_id, } /* Add shaper profile */ -int rte_tm_shaper_profile_add(uint8_t port_id, +int rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error) @@ -209,7 +209,7 @@ int rte_tm_shaper_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_shaper_profile_delete(uint8_t port_id, +int rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error) { @@ -219,7 +219,7 @@ int rte_tm_shaper_profile_delete(uint8_t port_id, } /* Add shared shaper */ -int rte_tm_shared_shaper_add_update(uint8_t port_id, +int rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -230,7 +230,7 @@ int rte_tm_shared_shaper_add_update(uint8_t port_id, } /* Delete shared shaper */ -int rte_tm_shared_shaper_delete(uint8_t port_id, +int rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error) { @@ -240,7 +240,7 @@ int rte_tm_shared_shaper_delete(uint8_t port_id, } /* Add node to port traffic manager hierarchy */ -int rte_tm_node_add(uint8_t port_id, +int rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -256,7 +256,7 @@ int rte_tm_node_add(uint8_t port_id, } /* Delete node from traffic manager hierarchy */ -int rte_tm_node_delete(uint8_t port_id, +int rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -266,7 +266,7 @@ int rte_tm_node_delete(uint8_t port_id, } /* Suspend node */ -int rte_tm_node_suspend(uint8_t port_id, +int rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -276,7 +276,7 @@ int rte_tm_node_suspend(uint8_t port_id, } /* Resume node */ -int rte_tm_node_resume(uint8_t port_id, +int rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -286,7 +286,7 @@ int rte_tm_node_resume(uint8_t port_id, } /* Commit the initial port traffic manager hierarchy */ -int rte_tm_hierarchy_commit(uint8_t port_id, +int rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error) { @@ -296,7 +296,7 @@ int rte_tm_hierarchy_commit(uint8_t port_id, } /* Update node parent */ -int rte_tm_node_parent_update(uint8_t port_id, +int rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -309,7 +309,7 @@ int rte_tm_node_parent_update(uint8_t port_id, } /* Update node private shaper */ -int rte_tm_node_shaper_update(uint8_t port_id, +int rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -320,7 +320,7 @@ int rte_tm_node_shaper_update(uint8_t port_id, } /* Update node shared shapers */ -int rte_tm_node_shared_shaper_update(uint8_t port_id, +int rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -332,7 +332,7 @@ int rte_tm_node_shared_shaper_update(uint8_t port_id, } /* Update node stats */ -int rte_tm_node_stats_update(uint8_t port_id, +int rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error) @@ -343,7 +343,7 @@ int rte_tm_node_stats_update(uint8_t port_id, } /* Update WFQ weight mode */ -int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -355,7 +355,7 @@ int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, } /* Update node congestion management mode */ -int rte_tm_node_cman_update(uint8_t port_id, +int rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error) @@ -366,7 +366,7 @@ int rte_tm_node_cman_update(uint8_t port_id, } /* Update node private WRED context */ -int rte_tm_node_wred_context_update(uint8_t port_id, +int rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -377,7 +377,7 @@ int rte_tm_node_wred_context_update(uint8_t port_id, } /* Update node shared WRED context */ -int rte_tm_node_shared_wred_context_update(uint8_t port_id, +int rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -389,7 +389,7 @@ int rte_tm_node_shared_wred_context_update(uint8_t port_id, } /* Read and/or clear stats counters for specific node */ -int rte_tm_node_stats_read(uint8_t port_id, +int rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -402,7 +402,7 @@ int rte_tm_node_stats_read(uint8_t port_id, } /* Packet marking - VLAN DEI */ -int rte_tm_mark_vlan_dei(uint8_t port_id, +int rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -414,7 +414,7 @@ int rte_tm_mark_vlan_dei(uint8_t port_id, } /* Packet marking - IPv4/IPv6 ECN */ -int rte_tm_mark_ip_ecn(uint8_t port_id, +int rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -426,7 +426,7 @@ int rte_tm_mark_ip_ecn(uint8_t port_id, } /* Packet marking - IPv4/IPv6 DSCP */ -int rte_tm_mark_ip_dscp(uint8_t port_id, +int rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm.h b/lib/librte_ether/rte_tm.h index ebbfa1eec..2b25a8715 100644 --- a/lib/librte_ether/rte_tm.h +++ b/lib/librte_ether/rte_tm.h @@ -1040,7 +1040,7 @@ struct rte_tm_error { * 0 on success, non-zero error code otherwise. */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error); @@ -1064,7 +1064,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error); @@ -1082,7 +1082,7 @@ rte_tm_node_type_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_capabilities_get(uint8_t port_id, +rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error); @@ -1102,7 +1102,7 @@ rte_tm_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_level_capabilities_get(uint8_t port_id, +rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error); @@ -1122,7 +1122,7 @@ rte_tm_level_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_capabilities_get(uint8_t port_id, +rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error); @@ -1147,7 +1147,7 @@ rte_tm_node_capabilities_get(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_add(uint8_t port_id, +rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error); @@ -1170,7 +1170,7 @@ rte_tm_wred_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_delete(uint8_t port_id, +rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1201,7 +1201,7 @@ rte_tm_wred_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_add_update(uint8_t port_id, +rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1225,7 +1225,7 @@ rte_tm_shared_wred_context_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_delete(uint8_t port_id, +rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error); @@ -1249,7 +1249,7 @@ rte_tm_shared_wred_context_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_add(uint8_t port_id, +rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error); @@ -1272,7 +1272,7 @@ rte_tm_shaper_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_delete(uint8_t port_id, +rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1301,7 +1301,7 @@ rte_tm_shaper_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_add_update(uint8_t port_id, +rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1324,7 +1324,7 @@ rte_tm_shared_shaper_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_delete(uint8_t port_id, +rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error); @@ -1392,7 +1392,7 @@ rte_tm_shared_shaper_delete(uint8_t port_id, * @see struct rte_tm_capabilities */ int -rte_tm_node_add(uint8_t port_id, +rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1425,7 +1425,7 @@ rte_tm_node_add(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_ADD_DELETE */ int -rte_tm_node_delete(uint8_t port_id, +rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1449,7 +1449,7 @@ rte_tm_node_delete(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_suspend(uint8_t port_id, +rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1472,7 +1472,7 @@ rte_tm_node_suspend(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_resume(uint8_t port_id, +rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1513,7 +1513,7 @@ rte_tm_node_resume(uint8_t port_id, * @see rte_tm_node_delete() */ int -rte_tm_hierarchy_commit(uint8_t port_id, +rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error); @@ -1549,7 +1549,7 @@ rte_tm_hierarchy_commit(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_PARENT_CHANGE_LEVEL */ int -rte_tm_node_parent_update(uint8_t port_id, +rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1578,7 +1578,7 @@ rte_tm_node_parent_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_private_n_max */ int -rte_tm_node_shaper_update(uint8_t port_id, +rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1605,7 +1605,7 @@ rte_tm_node_shaper_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_node_shared_shaper_update(uint8_t port_id, +rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -1632,7 +1632,7 @@ rte_tm_node_shared_shaper_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_STATS */ int -rte_tm_node_stats_update(uint8_t port_id, +rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error); @@ -1660,7 +1660,7 @@ rte_tm_node_stats_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_N_SP_PRIORITIES */ int -rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -1683,7 +1683,7 @@ rte_tm_node_wfq_weight_mode_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_CMAN */ int -rte_tm_node_cman_update(uint8_t port_id, +rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error); @@ -1707,7 +1707,7 @@ rte_tm_node_cman_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_private_n_max */ int -rte_tm_node_wred_context_update(uint8_t port_id, +rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1732,7 +1732,7 @@ rte_tm_node_wred_context_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_node_shared_wred_context_update(uint8_t port_id, +rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -1764,7 +1764,7 @@ rte_tm_node_shared_wred_context_update(uint8_t port_id, * @see enum rte_tm_stats_type */ int -rte_tm_node_stats_read(uint8_t port_id, +rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -1801,7 +1801,7 @@ rte_tm_node_stats_read(uint8_t port_id, * @see struct rte_tm_capabilities::mark_vlan_dei_supported */ int -rte_tm_mark_vlan_dei(uint8_t port_id, +rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1851,7 +1851,7 @@ rte_tm_mark_vlan_dei(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_ecn_sctp_supported */ int -rte_tm_mark_ip_ecn(uint8_t port_id, +rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1899,7 +1899,7 @@ rte_tm_mark_ip_ecn(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_dscp_supported */ int -rte_tm_mark_ip_dscp(uint8_t port_id, +rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm_driver.h b/lib/librte_ether/rte_tm_driver.h index a5b698fe0..b2e8ccf80 100644 --- a/lib/librte_ether/rte_tm_driver.h +++ b/lib/librte_ether/rte_tm_driver.h @@ -357,7 +357,7 @@ rte_tm_error_set(struct rte_tm_error *error, * success, NULL otherwise. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error); +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error); #ifdef __cplusplus } diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index bbb380502..b1eba4c20 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -190,9 +190,9 @@ rte_event_dev_queue_config(struct rte_eventdev *dev, uint8_t nb_queues) #define EVENT_QUEUE_SERVICE_PRIORITY_INVALID (0xdead) static inline int -rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports) +rte_event_dev_port_config(struct rte_eventdev *dev, uint16_t nb_ports) { - uint8_t old_nb_ports = dev->data->nb_ports; + uint16_t old_nb_ports = dev->data->nb_ports; void **ports; uint16_t *links_map; uint8_t *ports_dequeue_depth; @@ -631,7 +631,7 @@ rte_event_queue_priority(uint8_t dev_id, uint8_t queue_id) } static inline int -is_valid_port(struct rte_eventdev *dev, uint8_t port_id) +is_valid_port(struct rte_eventdev *dev, uint16_t port_id) { if (port_id < dev->data->nb_ports) return 1; @@ -640,7 +640,7 @@ is_valid_port(struct rte_eventdev *dev, uint8_t port_id) } int -rte_event_port_default_conf_get(uint8_t dev_id, uint8_t port_id, +rte_event_port_default_conf_get(uint8_t dev_id, uint16_t port_id, struct rte_event_port_conf *port_conf) { struct rte_eventdev *dev; @@ -652,7 +652,7 @@ rte_event_port_default_conf_get(uint8_t dev_id, uint8_t port_id, return -EINVAL; if (!is_valid_port(dev, port_id)) { - RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); + RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu16, port_id); return -EINVAL; } @@ -663,7 +663,7 @@ rte_event_port_default_conf_get(uint8_t dev_id, uint8_t port_id, } int -rte_event_port_setup(uint8_t dev_id, uint8_t port_id, +rte_event_port_setup(uint8_t dev_id, uint16_t port_id, const struct rte_event_port_conf *port_conf) { struct rte_eventdev *dev; @@ -674,7 +674,7 @@ rte_event_port_setup(uint8_t dev_id, uint8_t port_id, dev = &rte_eventdevs[dev_id]; if (!is_valid_port(dev, port_id)) { - RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); + RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu16, port_id); return -EINVAL; } @@ -744,7 +744,7 @@ rte_event_port_setup(uint8_t dev_id, uint8_t port_id, } uint8_t -rte_event_port_dequeue_depth(uint8_t dev_id, uint8_t port_id) +rte_event_port_dequeue_depth(uint8_t dev_id, uint16_t port_id) { struct rte_eventdev *dev; @@ -753,7 +753,7 @@ rte_event_port_dequeue_depth(uint8_t dev_id, uint8_t port_id) } uint8_t -rte_event_port_enqueue_depth(uint8_t dev_id, uint8_t port_id) +rte_event_port_enqueue_depth(uint8_t dev_id, uint16_t port_id) { struct rte_eventdev *dev; @@ -771,7 +771,7 @@ rte_event_port_count(uint8_t dev_id) } int -rte_event_port_link(uint8_t dev_id, uint8_t port_id, +rte_event_port_link(uint8_t dev_id, uint16_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links) { @@ -786,7 +786,7 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id, RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_link, -ENOTSUP); if (!is_valid_port(dev, port_id)) { - RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); + RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu16, port_id); return -EINVAL; } @@ -824,7 +824,7 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id, } int -rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, +rte_event_port_unlink(uint8_t dev_id, uint16_t port_id, uint8_t queues[], uint16_t nb_unlinks) { struct rte_eventdev *dev; @@ -837,7 +837,7 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_unlink, -ENOTSUP); if (!is_valid_port(dev, port_id)) { - RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); + RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu16, port_id); return -EINVAL; } @@ -868,7 +868,7 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, } int -rte_event_port_links_get(uint8_t dev_id, uint8_t port_id, +rte_event_port_links_get(uint8_t dev_id, uint16_t port_id, uint8_t queues[], uint8_t priorities[]) { struct rte_eventdev *dev; @@ -878,7 +878,7 @@ rte_event_port_links_get(uint8_t dev_id, uint8_t port_id, RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); dev = &rte_eventdevs[dev_id]; if (!is_valid_port(dev, port_id)) { - RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); + RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu16, port_id); return -EINVAL; } @@ -927,7 +927,7 @@ rte_event_dev_dump(uint8_t dev_id, FILE *f) static int xstats_get_count(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, - uint8_t queue_port_id) + uint16_t queue_port_id) { struct rte_eventdev *dev = &rte_eventdevs[dev_id]; if (dev->dev_ops->xstats_get_names != NULL) @@ -939,7 +939,7 @@ xstats_get_count(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, int rte_event_dev_xstats_names_get(uint8_t dev_id, - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, struct rte_event_dev_xstats_name *xstats_names, unsigned int *ids, unsigned int size) { @@ -963,7 +963,7 @@ rte_event_dev_xstats_names_get(uint8_t dev_id, /* retrieve eventdev extended statistics */ int rte_event_dev_xstats_get(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, - uint8_t queue_port_id, const unsigned int ids[], + uint16_t queue_port_id, const unsigned int ids[], uint64_t values[], unsigned int n) { RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -ENODEV); diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index 128bc5221..3b52d0f24 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -360,7 +360,7 @@ struct rte_event_dev_info { /**< Maximum number of event priority levels by this device. * Valid when the device has RTE_EVENT_DEV_CAP_EVENT_QOS capability */ - uint8_t max_event_ports; + uint16_t max_event_ports; /**< Maximum number of event ports supported by this device */ uint8_t max_event_port_dequeue_depth; /**< Maximum number of events can be dequeued at a time from an @@ -428,7 +428,7 @@ struct rte_event_dev_config { * This value cannot exceed the *max_event_queues* which previously * provided in rte_event_dev_info_get() */ - uint8_t nb_event_ports; + uint16_t nb_event_ports; /**< Number of event ports to configure on this device. * This value cannot exceed the *max_event_ports* which previously * provided in rte_event_dev_info_get() @@ -687,7 +687,7 @@ struct rte_event_port_conf { * */ int -rte_event_port_default_conf_get(uint8_t dev_id, uint8_t port_id, +rte_event_port_default_conf_get(uint8_t dev_id, uint16_t port_id, struct rte_event_port_conf *port_conf); /** @@ -711,7 +711,7 @@ rte_event_port_default_conf_get(uint8_t dev_id, uint8_t port_id, * with RTE_EVENT_QUEUE_CFG_SINGLE_LINK to more than one event ports) */ int -rte_event_port_setup(uint8_t dev_id, uint8_t port_id, +rte_event_port_setup(uint8_t dev_id, uint16_t port_id, const struct rte_event_port_conf *port_conf); /** @@ -728,7 +728,7 @@ rte_event_port_setup(uint8_t dev_id, uint8_t port_id, * @see rte_event_dequeue_burst() */ uint8_t -rte_event_port_dequeue_depth(uint8_t dev_id, uint8_t port_id); +rte_event_port_dequeue_depth(uint8_t dev_id, uint16_t port_id); /** * Get the number of enqueue queue depth configured for event port designated @@ -744,7 +744,7 @@ rte_event_port_dequeue_depth(uint8_t dev_id, uint8_t port_id); * @see rte_event_enqueue_burst() */ uint8_t -rte_event_port_enqueue_depth(uint8_t dev_id, uint8_t port_id); +rte_event_port_enqueue_depth(uint8_t dev_id, uint16_t port_id); /** * Get the number of ports on a specific event device @@ -1030,7 +1030,7 @@ struct rte_eventdev_data { /**< Device ID for this instance */ uint8_t nb_queues; /**< Number of event queues. */ - uint8_t nb_ports; + uint16_t nb_ports; /**< Number of event ports. */ void **ports; /**< Array of pointers to ports. */ @@ -1108,7 +1108,7 @@ rte_event_schedule(uint8_t dev_id) } static __rte_always_inline uint16_t -__rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, +__rte_event_enqueue_burst(uint8_t dev_id, uint16_t port_id, const struct rte_event ev[], uint16_t nb_events, const event_enqueue_burst_t fn) { @@ -1175,7 +1175,7 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, * @see rte_event_port_enqueue_depth() */ static inline uint16_t -rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, +rte_event_enqueue_burst(uint8_t dev_id, uint16_t port_id, const struct rte_event ev[], uint16_t nb_events) { const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; @@ -1224,7 +1224,7 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, * @see rte_event_port_enqueue_depth() rte_event_enqueue_burst() */ static inline uint16_t -rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id, +rte_event_enqueue_new_burst(uint8_t dev_id, uint16_t port_id, const struct rte_event ev[], uint16_t nb_events) { const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; @@ -1273,7 +1273,7 @@ rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id, * @see rte_event_port_enqueue_depth() rte_event_enqueue_burst() */ static inline uint16_t -rte_event_enqueue_forward_burst(uint8_t dev_id, uint8_t port_id, +rte_event_enqueue_forward_burst(uint8_t dev_id, uint16_t port_id, const struct rte_event ev[], uint16_t nb_events) { const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; @@ -1375,7 +1375,7 @@ rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns, * @see rte_event_port_dequeue_depth() */ static inline uint16_t -rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], +rte_event_dequeue_burst(uint8_t dev_id, uint16_t port_id, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks) { struct rte_eventdev *dev = &rte_eventdevs[dev_id]; @@ -1466,7 +1466,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], * */ int -rte_event_port_link(uint8_t dev_id, uint8_t port_id, +rte_event_port_link(uint8_t dev_id, uint16_t port_id, const uint8_t queues[], const uint8_t priorities[], uint16_t nb_links); @@ -1510,7 +1510,7 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id, * */ int -rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, +rte_event_port_unlink(uint8_t dev_id, uint16_t port_id, uint8_t queues[], uint16_t nb_unlinks); /** @@ -1541,7 +1541,7 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, * */ int -rte_event_port_links_get(uint8_t dev_id, uint8_t port_id, +rte_event_port_links_get(uint8_t dev_id, uint16_t port_id, uint8_t queues[], uint8_t priorities[]); /** @@ -1617,7 +1617,7 @@ struct rte_event_dev_xstats_name { int rte_event_dev_xstats_names_get(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, - uint8_t queue_port_id, + uint16_t queue_port_id, struct rte_event_dev_xstats_name *xstats_names, unsigned int *ids, unsigned int size); @@ -1651,7 +1651,7 @@ rte_event_dev_xstats_names_get(uint8_t dev_id, int rte_event_dev_xstats_get(uint8_t dev_id, enum rte_event_dev_xstats_mode mode, - uint8_t queue_port_id, + uint16_t queue_port_id, const unsigned int ids[], uint64_t values[], unsigned int n); diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index 3d72acf3a..ef7c932a7 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -265,7 +265,7 @@ typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev, * */ typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, - uint8_t port_id, struct rte_event_port_conf *port_conf); + uint16_t port_id, struct rte_event_port_conf *port_conf); /** * Setup an event port. @@ -281,7 +281,7 @@ typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, * Returns 0 on success. */ typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev, - uint8_t port_id, + uint16_t port_id, const struct rte_event_port_conf *port_conf); /** @@ -379,7 +379,7 @@ typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f); * The number of stat values successfully filled into the values array */ typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev, - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, const unsigned int ids[], uint64_t values[], unsigned int n); /** @@ -407,7 +407,7 @@ typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev, * values, and do not fill in any data into xstats_names. */ typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev, - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, struct rte_event_dev_xstats_name *xstats_names, unsigned int *ids, unsigned int size); diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 37deb4727..87812cd55 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -63,13 +63,13 @@ struct rte_mbuf; * Structure which has the function pointers for KNI interface. */ struct rte_kni_ops { - uint8_t port_id; /* Port ID */ + uint16_t port_id; /* Port ID */ /* Pointer to function of changing MTU */ - int (*change_mtu)(uint8_t port_id, unsigned new_mtu); + int (*change_mtu)(uint16_t port_id, unsigned int new_mtu); /* Pointer to function of configuring network interface */ - int (*config_network_if)(uint8_t port_id, uint8_t if_up); + int (*config_network_if)(uint16_t port_id, uint8_t if_up); }; /** diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c index ce029a12c..d6ad13c4e 100644 --- a/lib/librte_latencystats/rte_latencystats.c +++ b/lib/librte_latencystats/rte_latencystats.c @@ -135,7 +135,7 @@ rte_latencystats_fill_values(struct rte_metric_value *values) } static uint16_t -add_time_stamps(uint8_t pid __rte_unused, +add_time_stamps(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -165,7 +165,7 @@ add_time_stamps(uint8_t pid __rte_unused, } static uint16_t -calc_latency(uint8_t pid __rte_unused, +calc_latency(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -226,10 +226,10 @@ rte_latencystats_init(uint64_t app_samp_intvl, rte_latency_stats_flow_type_fn user_cb) { unsigned int i; - uint8_t pid; + uint16_t pid; uint16_t qid; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const char *ptr_strings[NUM_LATENCY_STATS] = {0}; const struct rte_memzone *mz = NULL; const unsigned int flags = 0; @@ -290,11 +290,11 @@ rte_latencystats_init(uint64_t app_samp_intvl, int rte_latencystats_uninit(void) { - uint8_t pid; + uint16_t pid; uint16_t qid; int ret = 0; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); /** De register Rx/Tx callbacks */ for (pid = 0; pid < nb_ports; pid++) { diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 729e79a36..e6182d35c 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -207,7 +207,7 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) } static uint16_t -pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_params) @@ -217,7 +217,7 @@ pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static uint16_t -pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) { pdump_copy(pkts, nb_pkts, user_params); @@ -225,7 +225,7 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static int -pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -279,7 +279,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, } static int -pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -337,7 +337,7 @@ static int set_pdump_rxtx_cbs(struct pdump_request *p) { uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue; - uint8_t port; + uint16_t port; int ret = 0; uint32_t flags; uint16_t operation; @@ -764,7 +764,7 @@ pdump_validate_flags(uint32_t flags) } static int -pdump_validate_port(uint8_t port, char *name) +pdump_validate_port(uint16_t port, char *name) { int ret = 0; @@ -828,7 +828,7 @@ pdump_prepare_client_request(char *device, uint16_t queue, } int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter) @@ -876,7 +876,7 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue, } int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags) +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags) { int ret = 0; char name[DEVICE_ID_SIZE]; diff --git a/lib/librte_pdump/rte_pdump.h b/lib/librte_pdump/rte_pdump.h index ba6e39b09..4ec0a106f 100644 --- a/lib/librte_pdump/rte_pdump.h +++ b/lib/librte_pdump/rte_pdump.h @@ -113,7 +113,7 @@ rte_pdump_uninit(void); */ int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter); @@ -136,7 +136,7 @@ rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, */ int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags); +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags); /** * Enables packet capturing on given device id and queue. diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c index d5c5fba55..4ed10f276 100644 --- a/lib/librte_port/rte_port_ethdev.c +++ b/lib/librte_port/rte_port_ethdev.c @@ -60,7 +60,7 @@ struct rte_port_ethdev_reader { struct rte_port_in_stats stats; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -156,7 +156,7 @@ struct rte_port_ethdev_writer { uint16_t tx_buf_count; uint64_t bsz_mask; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -337,7 +337,7 @@ struct rte_port_ethdev_writer_nodrop { uint64_t bsz_mask; uint64_t n_retries; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * diff --git a/lib/librte_port/rte_port_ethdev.h b/lib/librte_port/rte_port_ethdev.h index 201a79e41..f5ed9ab2d 100644 --- a/lib/librte_port/rte_port_ethdev.h +++ b/lib/librte_port/rte_port_ethdev.h @@ -54,7 +54,7 @@ extern "C" { /** ethdev_reader port parameters */ struct rte_port_ethdev_reader_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -66,7 +66,7 @@ extern struct rte_port_in_ops rte_port_ethdev_reader_ops; /** ethdev_writer port parameters */ struct rte_port_ethdev_writer_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -82,7 +82,7 @@ extern struct rte_port_out_ops rte_port_ethdev_writer_ops; /** ethdev_writer_nodrop port parameters */ struct rte_port_ethdev_writer_nodrop_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang @ 2017-09-04 9:06 ` Bruce Richardson 2017-09-04 9:29 ` Ferruh Yigit 2017-09-05 6:51 ` Yang, Zhiyong 2017-09-06 8:32 ` Hemant Agrawal [not found] ` <CALZ3Guikt9x8sz-oEKCuDCSp_wtKa64bSXTrMhqcWyg7f_dS7g@mail.gmail.com> 2 siblings, 2 replies; 101+ messages in thread From: Bruce Richardson @ 2017-09-04 9:06 UTC (permalink / raw) To: Zhiyong Yang; +Cc: dev, thomas, ferruh.yigit, keith.wiles, stephen On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib and drivers > data structures, specifically rte_eth_dev_data. Modify the APIs, > drivers and app using port_id at the same time except some drivers > such as MLX4 and MLX5 due to fail to compile them in my server. > I think you can change those drivers too - it's not hard to set up compilation for MLX drivers (instruction in DPDK docs on the website), and even if you can't compile test them, e.g. dpaa2 drivers, or other SoC ones, others can do so on your behalf. If you are going to change drivers, I think you should change all of them across the board. > Fix some checkpatch issues from the original code and remove some > unnecessary cast operations. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > --- > app/pdump/main.c | 2 +- > app/test-eventdev/test_perf_common.h | 6 +- > app/test-pmd/cmdline.c | 4 +- > app/test-pmd/config.c | 4 +- > app/test-pmd/testpmd.c | 18 +- > app/test-pmd/testpmd.h | 2 +- > drivers/event/octeontx/ssovf_evdev.c | 6 +- > drivers/event/octeontx/ssovf_evdev.h | 4 +- > drivers/event/skeleton/skeleton_eventdev.c | 4 +- > drivers/event/skeleton/skeleton_eventdev.h | 2 +- > drivers/event/sw/sw_evdev.c | 4 +- > drivers/event/sw/sw_evdev.h | 6 +- > drivers/event/sw/sw_evdev_xstats.c | 8 +- These are not ethdev drivers, but eventdev ones. I don't think eventdev needs to go to 16-bit port numbers, but there is no harm in doing so. However, it would be best to modify eventdev drivers in a separate patch - or even patchset. > drivers/net/af_packet/rte_eth_af_packet.c | 2 +- > drivers/net/ark/ark_ethdev.c | 2 +- > drivers/net/ark/ark_udm.h | 2 +- > drivers/net/avp/avp_ethdev.c | 2 +- > drivers/net/bnx2x/bnx2x.c | 11 +- > drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- > drivers/net/bnx2x/elink.c | 12 +- > drivers/net/bnx2x/elink.h | 17 +- > drivers/net/bnxt/bnxt.h | 2 +- > drivers/net/bnxt/bnxt_ethdev.c | 8 +- > drivers/net/bnxt/bnxt_rxq.h | 2 +- > drivers/net/bnxt/bnxt_txq.h | 2 +- > drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- > drivers/net/bnxt/rte_pmd_bnxt.h | 36 ++-- > drivers/net/bonding/rte_eth_bond.h | 42 ++-- > drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- > drivers/net/bonding/rte_eth_bond_8023ad_private.h | 6 +- > drivers/net/bonding/rte_eth_bond_api.c | 56 ++--- > drivers/net/bonding/rte_eth_bond_pmd.c | 30 +-- > drivers/net/bonding/rte_eth_bond_private.h | 43 ++-- > drivers/net/e1000/em_rxtx.c | 4 +- > drivers/net/e1000/igb_rxtx.c | 4 +- > drivers/net/failsafe/failsafe_ether.c | 4 +- > drivers/net/failsafe/failsafe_private.h | 4 +- > drivers/net/fm10k/fm10k.h | 6 +- > drivers/net/i40e/i40e_ethdev.c | 5 +- > drivers/net/i40e/i40e_rxtx.h | 4 +- > drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- > drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- > drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- > drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- > drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- > drivers/net/ixgbe/rte_pmd_ixgbe.h | 70 ++++--- > drivers/net/nfp/nfp_net.c | 26 +-- > drivers/net/nfp/nfp_net_pmd.h | 2 +- > drivers/net/null/rte_eth_null.c | 2 +- > drivers/net/pcap/rte_eth_pcap.c | 2 +- > drivers/net/qede/qede_if.h | 2 +- > drivers/net/ring/rte_eth_ring.c | 2 +- > drivers/net/vhost/rte_eth_vhost.c | 8 +- > drivers/net/vhost/rte_eth_vhost.h | 6 +- > drivers/net/virtio/virtio_pci.h | 2 +- > drivers/net/virtio/virtio_rxtx.h | 6 +- > drivers/net/xenvirt/virtqueue.h | 2 +- > lib/librte_bitratestats/rte_bitrate.c | 2 +- > lib/librte_bitratestats/rte_bitrate.h | 2 +- > lib/librte_ether/rte_ethdev.c | 239 +++++++++++----------- > lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- > lib/librte_ether/rte_tm.c | 62 +++--- > lib/librte_ether/rte_tm.h | 60 +++--- > lib/librte_ether/rte_tm_driver.h | 2 +- > lib/librte_eventdev/rte_eventdev.c | 36 ++-- > lib/librte_eventdev/rte_eventdev.h | 34 +-- > lib/librte_eventdev/rte_eventdev_pmd.h | 8 +- eventdev changes should be separte patches from ethdev. > lib/librte_kni/rte_kni.h | 6 +- > lib/librte_latencystats/rte_latencystats.c | 12 +- > lib/librte_pdump/rte_pdump.c | 16 +- > lib/librte_pdump/rte_pdump.h | 4 +- > lib/librte_port/rte_port_ethdev.c | 6 +- > lib/librte_port/rte_port_ethdev.h | 6 +- > 73 files changed, 733 insertions(+), 715 deletions(-) > ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 9:06 ` Bruce Richardson @ 2017-09-04 9:29 ` Ferruh Yigit 2017-09-04 9:47 ` Yang, Zhiyong 2017-09-05 6:51 ` Yang, Zhiyong 1 sibling, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-04 9:29 UTC (permalink / raw) To: Bruce Richardson, Zhiyong Yang; +Cc: dev, thomas, keith.wiles, stephen On 9/4/2017 10:06 AM, Bruce Richardson wrote: > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: >> Extend port_id definition from uint8_t to uint16_t in lib and drivers >> data structures, specifically rte_eth_dev_data. Modify the APIs, >> drivers and app using port_id at the same time except some drivers >> such as MLX4 and MLX5 due to fail to compile them in my server. >> > I think you can change those drivers too - it's not hard to set up > compilation for MLX drivers (instruction in DPDK docs on the website), > and even if you can't compile test them, e.g. dpaa2 drivers, or other > SoC ones, others can do so on your behalf. If you are going to change > drivers, I think you should change all of them across the board. +1 > >> Fix some checkpatch issues from the original code and remove some >> unnecessary cast operations. >> >> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> >> --- >> app/pdump/main.c | 2 +- >> app/test-eventdev/test_perf_common.h | 6 +- >> app/test-pmd/cmdline.c | 4 +- >> app/test-pmd/config.c | 4 +- >> app/test-pmd/testpmd.c | 18 +- >> app/test-pmd/testpmd.h | 2 +- >> drivers/event/octeontx/ssovf_evdev.c | 6 +- >> drivers/event/octeontx/ssovf_evdev.h | 4 +- >> drivers/event/skeleton/skeleton_eventdev.c | 4 +- >> drivers/event/skeleton/skeleton_eventdev.h | 2 +- >> drivers/event/sw/sw_evdev.c | 4 +- >> drivers/event/sw/sw_evdev.h | 6 +- >> drivers/event/sw/sw_evdev_xstats.c | 8 +- > > These are not ethdev drivers, but eventdev ones. I don't think eventdev > needs to go to 16-bit port numbers, but there is no harm in doing so. > However, it would be best to modify eventdev drivers in a separate > patch - or even patchset. > >> drivers/net/af_packet/rte_eth_af_packet.c | 2 +- >> drivers/net/ark/ark_ethdev.c | 2 +- >> drivers/net/ark/ark_udm.h | 2 +- >> drivers/net/avp/avp_ethdev.c | 2 +- >> drivers/net/bnx2x/bnx2x.c | 11 +- >> drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- >> drivers/net/bnx2x/elink.c | 12 +- >> drivers/net/bnx2x/elink.h | 17 +- >> drivers/net/bnxt/bnxt.h | 2 +- >> drivers/net/bnxt/bnxt_ethdev.c | 8 +- >> drivers/net/bnxt/bnxt_rxq.h | 2 +- >> drivers/net/bnxt/bnxt_txq.h | 2 +- >> drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- >> drivers/net/bnxt/rte_pmd_bnxt.h | 36 ++-- >> drivers/net/bonding/rte_eth_bond.h | 42 ++-- >> drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- >> drivers/net/bonding/rte_eth_bond_8023ad_private.h | 6 +- >> drivers/net/bonding/rte_eth_bond_api.c | 56 ++--- >> drivers/net/bonding/rte_eth_bond_pmd.c | 30 +-- >> drivers/net/bonding/rte_eth_bond_private.h | 43 ++-- >> drivers/net/e1000/em_rxtx.c | 4 +- >> drivers/net/e1000/igb_rxtx.c | 4 +- >> drivers/net/failsafe/failsafe_ether.c | 4 +- >> drivers/net/failsafe/failsafe_private.h | 4 +- >> drivers/net/fm10k/fm10k.h | 6 +- >> drivers/net/i40e/i40e_ethdev.c | 5 +- >> drivers/net/i40e/i40e_rxtx.h | 4 +- >> drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- >> drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- >> drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- >> drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- >> drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- >> drivers/net/ixgbe/rte_pmd_ixgbe.h | 70 ++++--- >> drivers/net/nfp/nfp_net.c | 26 +-- >> drivers/net/nfp/nfp_net_pmd.h | 2 +- >> drivers/net/null/rte_eth_null.c | 2 +- >> drivers/net/pcap/rte_eth_pcap.c | 2 +- >> drivers/net/qede/qede_if.h | 2 +- >> drivers/net/ring/rte_eth_ring.c | 2 +- >> drivers/net/vhost/rte_eth_vhost.c | 8 +- >> drivers/net/vhost/rte_eth_vhost.h | 6 +- >> drivers/net/virtio/virtio_pci.h | 2 +- >> drivers/net/virtio/virtio_rxtx.h | 6 +- >> drivers/net/xenvirt/virtqueue.h | 2 +- >> lib/librte_bitratestats/rte_bitrate.c | 2 +- >> lib/librte_bitratestats/rte_bitrate.h | 2 +- >> lib/librte_ether/rte_ethdev.c | 239 +++++++++++----------- >> lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- >> lib/librte_ether/rte_tm.c | 62 +++--- >> lib/librte_ether/rte_tm.h | 60 +++--- >> lib/librte_ether/rte_tm_driver.h | 2 +- >> lib/librte_eventdev/rte_eventdev.c | 36 ++-- >> lib/librte_eventdev/rte_eventdev.h | 34 +-- >> lib/librte_eventdev/rte_eventdev_pmd.h | 8 +- > > eventdev changes should be separte patches from ethdev. What do you think extracting them out of this patcset, and have another patchset for evendev ones perhaps? > >> lib/librte_kni/rte_kni.h | 6 +- >> lib/librte_latencystats/rte_latencystats.c | 12 +- >> lib/librte_pdump/rte_pdump.c | 16 +- >> lib/librte_pdump/rte_pdump.h | 4 +- >> lib/librte_port/rte_port_ethdev.c | 6 +- >> lib/librte_port/rte_port_ethdev.h | 6 +- >> 73 files changed, 733 insertions(+), 715 deletions(-) >> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 9:29 ` Ferruh Yigit @ 2017-09-04 9:47 ` Yang, Zhiyong 2017-09-04 13:12 ` Adrien Mazarguil 0 siblings, 1 reply; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-04 9:47 UTC (permalink / raw) To: Yigit, Ferruh, Richardson, Bruce; +Cc: dev, thomas, Wiles, Keith, stephen Hi, Ferruh, Bruce: > -----Original Message----- > From: Yigit, Ferruh > Sent: Monday, September 4, 2017 5:30 PM > To: Richardson, Bruce <bruce.richardson@intel.com>; Yang, Zhiyong > <zhiyong.yang@intel.com> > Cc: dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > <keith.wiles@intel.com>; stephen@networkplumber.org > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range > > On 9/4/2017 10:06 AM, Bruce Richardson wrote: > > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > >> Extend port_id definition from uint8_t to uint16_t in lib and drivers > >> data structures, specifically rte_eth_dev_data. Modify the APIs, > >> drivers and app using port_id at the same time except some drivers > >> such as MLX4 and MLX5 due to fail to compile them in my server. > >> > > I think you can change those drivers too - it's not hard to set up > > compilation for MLX drivers (instruction in DPDK docs on the website), > > and even if you can't compile test them, e.g. dpaa2 drivers, or other > > SoC ones, others can do so on your behalf. If you are going to change > > drivers, I think you should change all of them across the board. > > +1 OK. I will change them. Thanks Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 9:47 ` Yang, Zhiyong @ 2017-09-04 13:12 ` Adrien Mazarguil 2017-09-04 13:17 ` Richardson, Bruce 0 siblings, 1 reply; 101+ messages in thread From: Adrien Mazarguil @ 2017-09-04 13:12 UTC (permalink / raw) To: Yang, Zhiyong Cc: Yigit, Ferruh, Richardson, Bruce, dev, thomas, Wiles, Keith, stephen, Nelio Laranjeiro Hi Zhiyong, On Mon, Sep 04, 2017 at 09:47:10AM +0000, Yang, Zhiyong wrote: > Hi, Ferruh, Bruce: > > > -----Original Message----- > > From: Yigit, Ferruh > > Sent: Monday, September 4, 2017 5:30 PM > > To: Richardson, Bruce <bruce.richardson@intel.com>; Yang, Zhiyong > > <zhiyong.yang@intel.com> > > Cc: dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > > <keith.wiles@intel.com>; stephen@networkplumber.org > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range > > > > On 9/4/2017 10:06 AM, Bruce Richardson wrote: > > > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > > >> Extend port_id definition from uint8_t to uint16_t in lib and drivers > > >> data structures, specifically rte_eth_dev_data. Modify the APIs, > > >> drivers and app using port_id at the same time except some drivers > > >> such as MLX4 and MLX5 due to fail to compile them in my server. > > >> > > > I think you can change those drivers too - it's not hard to set up > > > compilation for MLX drivers (instruction in DPDK docs on the website), > > > and even if you can't compile test them, e.g. dpaa2 drivers, or other > > > SoC ones, others can do so on your behalf. If you are going to change > > > drivers, I think you should change all of them across the board. > > > > +1 > > OK. I will change them. I haven't applied the series yet but I think mlx4 doesn't need any modification to support the new width. mlx5, on the other hand, at least uses the following field in its data path: unsigned int port_id:8; One related question, why not define a new type (like testpmd's portid_t) part of rte_ethdev.h? (rte_portid_t?) I think uint16_t may not last long with virtual ports and all, and when it becomes necessary, the switch to uint32_t will be painful. A typedef should also ease the conversion of user applications. If you choose to use a typedef, I suggest to do so in a separate patch first (uint8_t => rte_portid_t) before upgrading rte_portid_t to 16 bits in the subsequent patch. It means the first patch is large but trivial while the second one is shorter but deals with the complex changes such as the one needed for mlx5. Thanks. -- Adrien Mazarguil 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 13:12 ` Adrien Mazarguil @ 2017-09-04 13:17 ` Richardson, Bruce 2017-09-04 13:36 ` Adrien Mazarguil 0 siblings, 1 reply; 101+ messages in thread From: Richardson, Bruce @ 2017-09-04 13:17 UTC (permalink / raw) To: Adrien Mazarguil, Yang, Zhiyong Cc: Yigit, Ferruh, dev, thomas, Wiles, Keith, stephen, Nelio Laranjeiro > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Monday, September 4, 2017 2:12 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce > <bruce.richardson@intel.com>; dev@dpdk.org; thomas@monjalon.net; Wiles, > Keith <keith.wiles@intel.com>; stephen@networkplumber.org; Nelio > Laranjeiro <nelio.laranjeiro@6wind.com> > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range > > Hi Zhiyong, > > On Mon, Sep 04, 2017 at 09:47:10AM +0000, Yang, Zhiyong wrote: > > Hi, Ferruh, Bruce: > > > > > -----Original Message----- > > > From: Yigit, Ferruh > > > Sent: Monday, September 4, 2017 5:30 PM > > > To: Richardson, Bruce <bruce.richardson@intel.com>; Yang, Zhiyong > > > <zhiyong.yang@intel.com> > > > Cc: dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > > > <keith.wiles@intel.com>; stephen@networkplumber.org > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id > > > range > > > > > > On 9/4/2017 10:06 AM, Bruce Richardson wrote: > > > > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > > > >> Extend port_id definition from uint8_t to uint16_t in lib and > > > >> drivers data structures, specifically rte_eth_dev_data. Modify > > > >> the APIs, drivers and app using port_id at the same time except > > > >> some drivers such as MLX4 and MLX5 due to fail to compile them in > my server. > > > >> > > > > I think you can change those drivers too - it's not hard to set up > > > > compilation for MLX drivers (instruction in DPDK docs on the > > > > website), and even if you can't compile test them, e.g. dpaa2 > > > > drivers, or other SoC ones, others can do so on your behalf. If > > > > you are going to change drivers, I think you should change all of > them across the board. > > > > > > +1 > > > > OK. I will change them. > > I haven't applied the series yet but I think mlx4 doesn't need any > modification to support the new width. mlx5, on the other hand, at least > uses the following field in its data path: > > unsigned int port_id:8; > > One related question, why not define a new type (like testpmd's portid_t) > part of rte_ethdev.h? (rte_portid_t?) > > I think uint16_t may not last long with virtual ports and all, and when it > becomes necessary, the switch to uint32_t will be painful. A typedef > should also ease the conversion of user applications. > > If you choose to use a typedef, I suggest to do so in a separate patch > first (uint8_t => rte_portid_t) before upgrading rte_portid_t to 16 bits > in the subsequent patch. It means the first patch is large but trivial > while the second one is shorter but deals with the complex changes such as > the one needed for mlx5. > > Thanks. The downside of hiding the size is that it becomes harder to reason about the layout of key structures like mbuf. Probably not a huge issue, though. A better question would be whether we would see the port id ever needing to increase in size to 32-bits? Even with virtual ports, I find it hard to see us needing more 64k ports in a single application. Regards, /Bruce ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 13:17 ` Richardson, Bruce @ 2017-09-04 13:36 ` Adrien Mazarguil 2017-09-04 13:59 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Adrien Mazarguil @ 2017-09-04 13:36 UTC (permalink / raw) To: Richardson, Bruce Cc: Yang, Zhiyong, Yigit, Ferruh, dev, thomas, Wiles, Keith, stephen, Nelio Laranjeiro On Mon, Sep 04, 2017 at 01:17:56PM +0000, Richardson, Bruce wrote: > > > > -----Original Message----- > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > Sent: Monday, September 4, 2017 2:12 PM > > To: Yang, Zhiyong <zhiyong.yang@intel.com> > > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce > > <bruce.richardson@intel.com>; dev@dpdk.org; thomas@monjalon.net; Wiles, > > Keith <keith.wiles@intel.com>; stephen@networkplumber.org; Nelio > > Laranjeiro <nelio.laranjeiro@6wind.com> > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range > > > > Hi Zhiyong, > > > > On Mon, Sep 04, 2017 at 09:47:10AM +0000, Yang, Zhiyong wrote: > > > Hi, Ferruh, Bruce: > > > > > > > -----Original Message----- > > > > From: Yigit, Ferruh > > > > Sent: Monday, September 4, 2017 5:30 PM > > > > To: Richardson, Bruce <bruce.richardson@intel.com>; Yang, Zhiyong > > > > <zhiyong.yang@intel.com> > > > > Cc: dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > > > > <keith.wiles@intel.com>; stephen@networkplumber.org > > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id > > > > range > > > > > > > > On 9/4/2017 10:06 AM, Bruce Richardson wrote: > > > > > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > > > > >> Extend port_id definition from uint8_t to uint16_t in lib and > > > > >> drivers data structures, specifically rte_eth_dev_data. Modify > > > > >> the APIs, drivers and app using port_id at the same time except > > > > >> some drivers such as MLX4 and MLX5 due to fail to compile them in > > my server. > > > > >> > > > > > I think you can change those drivers too - it's not hard to set up > > > > > compilation for MLX drivers (instruction in DPDK docs on the > > > > > website), and even if you can't compile test them, e.g. dpaa2 > > > > > drivers, or other SoC ones, others can do so on your behalf. If > > > > > you are going to change drivers, I think you should change all of > > them across the board. > > > > > > > > +1 > > > > > > OK. I will change them. > > > > I haven't applied the series yet but I think mlx4 doesn't need any > > modification to support the new width. mlx5, on the other hand, at least > > uses the following field in its data path: > > > > unsigned int port_id:8; > > > > One related question, why not define a new type (like testpmd's portid_t) > > part of rte_ethdev.h? (rte_portid_t?) > > > > I think uint16_t may not last long with virtual ports and all, and when it > > becomes necessary, the switch to uint32_t will be painful. A typedef > > should also ease the conversion of user applications. > > > > If you choose to use a typedef, I suggest to do so in a separate patch > > first (uint8_t => rte_portid_t) before upgrading rte_portid_t to 16 bits > > in the subsequent patch. It means the first patch is large but trivial > > while the second one is shorter but deals with the complex changes such as > > the one needed for mlx5. > > > > Thanks. > > The downside of hiding the size is that it becomes harder to reason about the layout of key structures like mbuf. Probably not a huge issue, though. A better question would be whether we would see the port id ever needing to increase in size to 32-bits? Even with virtual ports, I find it hard to see us needing more 64k ports in a single application. Right, I also think 16-bit is actually enough for now, but we never know. We see more and more applications using virtual ports, talking to and controlling other DPDK applications, the total number of ports in such scenarios at any given time may exceed uint16_t. I just think that as a fundamental DPDK object, port IDs probably need a dedicated type for clarity. -- Adrien Mazarguil 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 13:36 ` Adrien Mazarguil @ 2017-09-04 13:59 ` Yang, Zhiyong 2017-09-04 14:41 ` Adrien Mazarguil 0 siblings, 1 reply; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-04 13:59 UTC (permalink / raw) To: Adrien Mazarguil, Richardson, Bruce Cc: Yigit, Ferruh, dev, thomas, Wiles, Keith, stephen, Nelio Laranjeiro Hi, Adrien: > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Monday, September 4, 2017 9:37 PM > To: Richardson, Bruce <bruce.richardson@intel.com> > Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; Yigit, Ferruh > <ferruh.yigit@intel.com>; dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > <keith.wiles@intel.com>; stephen@networkplumber.org; Nelio Laranjeiro > <nelio.laranjeiro@6wind.com> > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range > > On Mon, Sep 04, 2017 at 01:17:56PM +0000, Richardson, Bruce wrote: > > > > > > > -----Original Message----- > > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > > Sent: Monday, September 4, 2017 2:12 PM > > > To: Yang, Zhiyong <zhiyong.yang@intel.com> > > > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce > > > <bruce.richardson@intel.com>; dev@dpdk.org; thomas@monjalon.net; > > > Wiles, Keith <keith.wiles@intel.com>; stephen@networkplumber.org; > > > Nelio Laranjeiro <nelio.laranjeiro@6wind.com> > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id > > > range > > > > > > Hi Zhiyong, > > > > > > On Mon, Sep 04, 2017 at 09:47:10AM +0000, Yang, Zhiyong wrote: > > > > Hi, Ferruh, Bruce: > > > > > > > > > -----Original Message----- > > > > > From: Yigit, Ferruh > > > > > Sent: Monday, September 4, 2017 5:30 PM > > > > > To: Richardson, Bruce <bruce.richardson@intel.com>; Yang, > > > > > Zhiyong <zhiyong.yang@intel.com> > > > > > Cc: dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > > > > > <keith.wiles@intel.com>; stephen@networkplumber.org > > > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id > > > > > range > > > > > > > > > > On 9/4/2017 10:06 AM, Bruce Richardson wrote: > > > > > > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > > > > > >> Extend port_id definition from uint8_t to uint16_t in lib and > > > > > >> drivers data structures, specifically rte_eth_dev_data. > > > > > >> Modify the APIs, drivers and app using port_id at the same > > > > > >> time except some drivers such as MLX4 and MLX5 due to fail to > > > > > >> compile them in > > > my server. > > > > > >> > > > > > > I think you can change those drivers too - it's not hard to > > > > > > set up compilation for MLX drivers (instruction in DPDK docs > > > > > > on the website), and even if you can't compile test them, e.g. > > > > > > dpaa2 drivers, or other SoC ones, others can do so on your > > > > > > behalf. If you are going to change drivers, I think you should > > > > > > change all of > > > them across the board. > > > > > > > > > > +1 > > > > > > > > OK. I will change them. > > > > > > I haven't applied the series yet but I think mlx4 doesn't need any > > > modification to support the new width. mlx5, on the other hand, at > > > least uses the following field in its data path: > > > > > > unsigned int port_id:8; > > > > > > One related question, why not define a new type (like testpmd's > > > portid_t) part of rte_ethdev.h? (rte_portid_t?) > > > > > > I think uint16_t may not last long with virtual ports and all, and > > > when it becomes necessary, the switch to uint32_t will be painful. A > > > typedef should also ease the conversion of user applications. > > > > > > If you choose to use a typedef, I suggest to do so in a separate > > > patch first (uint8_t => rte_portid_t) before upgrading rte_portid_t > > > to 16 bits in the subsequent patch. It means the first patch is > > > large but trivial while the second one is shorter but deals with the > > > complex changes such as the one needed for mlx5. Your suggestion is another solution. Many people discussed the topic in the thread http://www.dpdk.org/dev/patchwork/patch/23208/ Most of people agree to use basic type directly and think uint16_t is enough. Thanks Zhiyong > > > > > > Thanks. > > > > The downside of hiding the size is that it becomes harder to reason about the > layout of key structures like mbuf. Probably not a huge issue, though. A better > question would be whether we would see the port id ever needing to increase in > size to 32-bits? Even with virtual ports, I find it hard to see us needing more 64k > ports in a single application. > > Right, I also think 16-bit is actually enough for now, but we never know. > We see more and more applications using virtual ports, talking to and > controlling other DPDK applications, the total number of ports in such scenarios > at any given time may exceed uint16_t. > > I just think that as a fundamental DPDK object, port IDs probably need a > dedicated type for clarity. > > -- > Adrien Mazarguil > 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 13:59 ` Yang, Zhiyong @ 2017-09-04 14:41 ` Adrien Mazarguil 0 siblings, 0 replies; 101+ messages in thread From: Adrien Mazarguil @ 2017-09-04 14:41 UTC (permalink / raw) To: Yang, Zhiyong Cc: Richardson, Bruce, Yigit, Ferruh, dev, thomas, Wiles, Keith, stephen, Nelio Laranjeiro On Mon, Sep 04, 2017 at 01:59:26PM +0000, Yang, Zhiyong wrote: > Hi, Adrien: > > > -----Original Message----- > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > Sent: Monday, September 4, 2017 9:37 PM > > To: Richardson, Bruce <bruce.richardson@intel.com> > > Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; Yigit, Ferruh > > <ferruh.yigit@intel.com>; dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > > <keith.wiles@intel.com>; stephen@networkplumber.org; Nelio Laranjeiro > > <nelio.laranjeiro@6wind.com> > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range > > > > On Mon, Sep 04, 2017 at 01:17:56PM +0000, Richardson, Bruce wrote: > > > > > > > > > > -----Original Message----- > > > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > > > Sent: Monday, September 4, 2017 2:12 PM > > > > To: Yang, Zhiyong <zhiyong.yang@intel.com> > > > > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Richardson, Bruce > > > > <bruce.richardson@intel.com>; dev@dpdk.org; thomas@monjalon.net; > > > > Wiles, Keith <keith.wiles@intel.com>; stephen@networkplumber.org; > > > > Nelio Laranjeiro <nelio.laranjeiro@6wind.com> > > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id > > > > range > > > > > > > > Hi Zhiyong, > > > > > > > > On Mon, Sep 04, 2017 at 09:47:10AM +0000, Yang, Zhiyong wrote: > > > > > Hi, Ferruh, Bruce: > > > > > > > > > > > -----Original Message----- > > > > > > From: Yigit, Ferruh > > > > > > Sent: Monday, September 4, 2017 5:30 PM > > > > > > To: Richardson, Bruce <bruce.richardson@intel.com>; Yang, > > > > > > Zhiyong <zhiyong.yang@intel.com> > > > > > > Cc: dev@dpdk.org; thomas@monjalon.net; Wiles, Keith > > > > > > <keith.wiles@intel.com>; stephen@networkplumber.org > > > > > > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id > > > > > > range > > > > > > > > > > > > On 9/4/2017 10:06 AM, Bruce Richardson wrote: > > > > > > > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > > > > > > >> Extend port_id definition from uint8_t to uint16_t in lib and > > > > > > >> drivers data structures, specifically rte_eth_dev_data. > > > > > > >> Modify the APIs, drivers and app using port_id at the same > > > > > > >> time except some drivers such as MLX4 and MLX5 due to fail to > > > > > > >> compile them in > > > > my server. > > > > > > >> > > > > > > > I think you can change those drivers too - it's not hard to > > > > > > > set up compilation for MLX drivers (instruction in DPDK docs > > > > > > > on the website), and even if you can't compile test them, e.g. > > > > > > > dpaa2 drivers, or other SoC ones, others can do so on your > > > > > > > behalf. If you are going to change drivers, I think you should > > > > > > > change all of > > > > them across the board. > > > > > > > > > > > > +1 > > > > > > > > > > OK. I will change them. > > > > > > > > I haven't applied the series yet but I think mlx4 doesn't need any > > > > modification to support the new width. mlx5, on the other hand, at > > > > least uses the following field in its data path: > > > > > > > > unsigned int port_id:8; > > > > > > > > One related question, why not define a new type (like testpmd's > > > > portid_t) part of rte_ethdev.h? (rte_portid_t?) > > > > > > > > I think uint16_t may not last long with virtual ports and all, and > > > > when it becomes necessary, the switch to uint32_t will be painful. A > > > > typedef should also ease the conversion of user applications. > > > > > > > > If you choose to use a typedef, I suggest to do so in a separate > > > > patch first (uint8_t => rte_portid_t) before upgrading rte_portid_t > > > > to 16 bits in the subsequent patch. It means the first patch is > > > > large but trivial while the second one is shorter but deals with the > > > > complex changes such as the one needed for mlx5. > > Your suggestion is another solution. > Many people discussed the topic in the thread > http://www.dpdk.org/dev/patchwork/patch/23208/ > Most of people agree to use basic type directly and think uint16_t is enough. Thanks for pointing the discussion again, looks like I missed it. I don't mind using a basic-ish type, so no problem with uint16_t either way. However even after reading the discussion, I still think having a dedicated type would be better, so let me throw in another reason for the sake of the argument. This is optional, you can ignore it but here it is anyway. What is currently known as "port ID" in DPDK may refer to: 1. ID corresponding to one port in the global namespace comprising all ports from all detected devices. 2. Physical port of a device exposing multiple ports (device-specific namespace). 3. Application-internal numbering for ports, since they do not necessarily use all ports detected by DPDK (e.g. testpmd port 1 may be actually bound to port ID 42). Having a dedicated type for 1. can avoid confusion between all these things and related bugs. The goal in this sense would not be to hide but to clarify. That's the purpose of typedefs on basic types in public APIs (it's not like typedef'ing structures which are usually already named). Again, this is optional, if you change your mind, I suggest moving first to a dedicated type before increasing its width in a separate commit. > > > The downside of hiding the size is that it becomes harder to reason about the > > layout of key structures like mbuf. Probably not a huge issue, though. A better > > question would be whether we would see the port id ever needing to increase in > > size to 32-bits? Even with virtual ports, I find it hard to see us needing more 64k > > ports in a single application. > > > > Right, I also think 16-bit is actually enough for now, but we never know. > > We see more and more applications using virtual ports, talking to and > > controlling other DPDK applications, the total number of ports in such scenarios > > at any given time may exceed uint16_t. > > > > I just think that as a fundamental DPDK object, port IDs probably need a > > dedicated type for clarity. -- Adrien Mazarguil 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 9:06 ` Bruce Richardson 2017-09-04 9:29 ` Ferruh Yigit @ 2017-09-05 6:51 ` Yang, Zhiyong 1 sibling, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-05 6:51 UTC (permalink / raw) To: Richardson, Bruce; +Cc: dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi, Bruce: Thanks for your comments. Reply inline. Zhiyong > -----Original Message----- > From: Richardson, Bruce > Sent: Monday, September 4, 2017 5:07 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com> > Cc: dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh > <ferruh.yigit@intel.com>; Wiles, Keith <keith.wiles@intel.com>; > stephen@networkplumber.org > Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range > > On Mon, Sep 04, 2017 at 01:57:31PM +0800, Zhiyong Yang wrote: > > Extend port_id definition from uint8_t to uint16_t in lib and drivers > > data structures, specifically rte_eth_dev_data. Modify the APIs, > > drivers and app using port_id at the same time except some drivers > > such as MLX4 and MLX5 due to fail to compile them in my server. > > > I think you can change those drivers too - it's not hard to set up compilation for > MLX drivers (instruction in DPDK docs on the website), and even if you can't > compile test them, e.g. dpaa2 drivers, or other SoC ones, others can do so on > your behalf. If you are going to change drivers, I think you should change all of > them across the board. > Ok. I will change them. > > Fix some checkpatch issues from the original code and remove some > > unnecessary cast operations. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > --- > > app/pdump/main.c | 2 +- > > app/test-eventdev/test_perf_common.h | 6 +- > > app/test-pmd/cmdline.c | 4 +- > > app/test-pmd/config.c | 4 +- > > app/test-pmd/testpmd.c | 18 +- > > app/test-pmd/testpmd.h | 2 +- > > drivers/event/octeontx/ssovf_evdev.c | 6 +- > > drivers/event/octeontx/ssovf_evdev.h | 4 +- > > drivers/event/skeleton/skeleton_eventdev.c | 4 +- > > drivers/event/skeleton/skeleton_eventdev.h | 2 +- > > drivers/event/sw/sw_evdev.c | 4 +- > > drivers/event/sw/sw_evdev.h | 6 +- > > drivers/event/sw/sw_evdev_xstats.c | 8 +- > > These are not ethdev drivers, but eventdev ones. I don't think eventdev needs to > go to 16-bit port numbers, but there is no harm in doing so. > However, it would be best to modify eventdev drivers in a separate patch - or > even patchset. > I will remove them and focus on ethdev in the patchset. > > drivers/net/af_packet/rte_eth_af_packet.c | 2 +- > > drivers/net/ark/ark_ethdev.c | 2 +- > > drivers/net/ark/ark_udm.h | 2 +- > > drivers/net/avp/avp_ethdev.c | 2 +- > > drivers/net/bnx2x/bnx2x.c | 11 +- > > drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- > > drivers/net/bnx2x/elink.c | 12 +- > > drivers/net/bnx2x/elink.h | 17 +- > > drivers/net/bnxt/bnxt.h | 2 +- > > drivers/net/bnxt/bnxt_ethdev.c | 8 +- > > drivers/net/bnxt/bnxt_rxq.h | 2 +- > > drivers/net/bnxt/bnxt_txq.h | 2 +- > > drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- > > drivers/net/bnxt/rte_pmd_bnxt.h | 36 ++-- > > drivers/net/bonding/rte_eth_bond.h | 42 ++-- > > drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- > > drivers/net/bonding/rte_eth_bond_8023ad_private.h | 6 +- > > drivers/net/bonding/rte_eth_bond_api.c | 56 ++--- > > drivers/net/bonding/rte_eth_bond_pmd.c | 30 +-- > > drivers/net/bonding/rte_eth_bond_private.h | 43 ++-- > > drivers/net/e1000/em_rxtx.c | 4 +- > > drivers/net/e1000/igb_rxtx.c | 4 +- > > drivers/net/failsafe/failsafe_ether.c | 4 +- > > drivers/net/failsafe/failsafe_private.h | 4 +- > > drivers/net/fm10k/fm10k.h | 6 +- > > drivers/net/i40e/i40e_ethdev.c | 5 +- > > drivers/net/i40e/i40e_rxtx.h | 4 +- > > drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- > > drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- > > drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- > > drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- > > drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- > > drivers/net/ixgbe/rte_pmd_ixgbe.h | 70 ++++--- > > drivers/net/nfp/nfp_net.c | 26 +-- > > drivers/net/nfp/nfp_net_pmd.h | 2 +- > > drivers/net/null/rte_eth_null.c | 2 +- > > drivers/net/pcap/rte_eth_pcap.c | 2 +- > > drivers/net/qede/qede_if.h | 2 +- > > drivers/net/ring/rte_eth_ring.c | 2 +- > > drivers/net/vhost/rte_eth_vhost.c | 8 +- > > drivers/net/vhost/rte_eth_vhost.h | 6 +- > > drivers/net/virtio/virtio_pci.h | 2 +- > > drivers/net/virtio/virtio_rxtx.h | 6 +- > > drivers/net/xenvirt/virtqueue.h | 2 +- > > lib/librte_bitratestats/rte_bitrate.c | 2 +- > > lib/librte_bitratestats/rte_bitrate.h | 2 +- > > lib/librte_ether/rte_ethdev.c | 239 +++++++++++----------- > > lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- > > lib/librte_ether/rte_tm.c | 62 +++--- > > lib/librte_ether/rte_tm.h | 60 +++--- > > lib/librte_ether/rte_tm_driver.h | 2 +- > > lib/librte_eventdev/rte_eventdev.c | 36 ++-- > > lib/librte_eventdev/rte_eventdev.h | 34 +-- > > lib/librte_eventdev/rte_eventdev_pmd.h | 8 +- > > eventdev changes should be separte patches from ethdev. > Ok. I will remove them from the patchset. Zhiyong > > lib/librte_kni/rte_kni.h | 6 +- > > lib/librte_latencystats/rte_latencystats.c | 12 +- > > lib/librte_pdump/rte_pdump.c | 16 +- > > lib/librte_pdump/rte_pdump.h | 4 +- > > lib/librte_port/rte_port_ethdev.c | 6 +- > > lib/librte_port/rte_port_ethdev.h | 6 +- > > 73 files changed, 733 insertions(+), 715 deletions(-) > > ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang 2017-09-04 9:06 ` Bruce Richardson @ 2017-09-06 8:32 ` Hemant Agrawal 2017-09-06 8:48 ` Yang, Zhiyong [not found] ` <CALZ3Guikt9x8sz-oEKCuDCSp_wtKa64bSXTrMhqcWyg7f_dS7g@mail.gmail.com> 2 siblings, 1 reply; 101+ messages in thread From: Hemant Agrawal @ 2017-09-06 8:32 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, ferruh.yigit, keith.wiles, stephen On 9/4/2017 11:27 AM, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib and drivers > data structures, specifically rte_eth_dev_data. > Modify the APIs, drivers and app using port_id at the same time except > some drivers such as MLX4 and MLX5 due to fail to compile them in my > server. > > Fix some checkpatch issues from the original code and remove some > unnecessary cast operations. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> ..<snip> diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > index 128bc5221..3b52d0f24 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -360,7 +360,7 @@ struct rte_event_dev_info { > /**< Maximum number of event priority levels by this device. > * Valid when the device has RTE_EVENT_DEV_CAP_EVENT_QOS capability > */ > - uint8_t max_event_ports; > + uint16_t max_event_ports; > /**< Maximum number of event ports supported by this device */ I think, you can leave this one. Or a bit of variable movement will help in structure alignment. if you still want to change, please also change dpaa2_eventdev.h struct dpaa2_eventdev { - uint8_t nb_event_ports; - uint8_t resvd_1; + uint16_t nb_event_ports; > uint8_t max_event_port_dequeue_depth; > /**< Maximum number of events can be dequeued at a time from an > @@ -428,7 +428,7 @@ struct rte_event_dev_config { > * This value cannot exceed the *max_event_queues* which previously > * provided in rte_event_dev_info_get() > */ > - uint8_t nb_event_ports; > + uint16_t nb_event_ports; > /**< Number of event ports to configure on this device. > * This value cannot exceed the *max_event_ports* which previously > * provided in rte_event_dev_info_get() ..<snip> > > diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h > index 3d72acf3a..ef7c932a7 100644 > --- a/lib/librte_eventdev/rte_eventdev_pmd.h > +++ b/lib/librte_eventdev/rte_eventdev_pmd.h > @@ -265,7 +265,7 @@ typedef void (*eventdev_queue_release_t)(struct rte_eventdev *dev, > * > */ > typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, > - uint8_t port_id, struct rte_event_port_conf *port_conf); > + uint16_t port_id, struct rte_event_port_conf *port_conf); > please also update dpaa2_eventdev_port_def_conf > /** > * Setup an event port. > @@ -281,7 +281,7 @@ typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, > * Returns 0 on success. > */ > typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev, > - uint8_t port_id, > + uint16_t port_id, > const struct rte_event_port_conf *port_conf); > please also update dpaa2_eventdev_port_setup > /** > @@ -379,7 +379,7 @@ typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f); > * The number of stat values successfully filled into the values array > */ > typedef int (*eventdev_xstats_get_t)(const struct rte_eventdev *dev, > - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, > + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, > const unsigned int ids[], uint64_t values[], unsigned int n); > > /** > @@ -407,7 +407,7 @@ typedef int (*eventdev_xstats_reset_t)(struct rte_eventdev *dev, > * values, and do not fill in any data into xstats_names. > */ > typedef int (*eventdev_xstats_get_names_t)(const struct rte_eventdev *dev, > - enum rte_event_dev_xstats_mode mode, uint8_t queue_port_id, > + enum rte_event_dev_xstats_mode mode, uint16_t queue_port_id, > struct rte_event_dev_xstats_name *xstats_names, > unsigned int *ids, unsigned int size); > ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range 2017-09-06 8:32 ` Hemant Agrawal @ 2017-09-06 8:48 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-06 8:48 UTC (permalink / raw) To: Hemant Agrawal, dev; +Cc: thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi, hemant: This patchset will focus on ethdev, don't touch rte_eventdev next version. Thanks Zhiyong > > */ > > typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, > > - uint8_t port_id, struct rte_event_port_conf *port_conf); > > + uint16_t port_id, struct rte_event_port_conf *port_conf); > > > please also update > dpaa2_eventdev_port_def_conf > > > /** > > * Setup an event port. > > @@ -281,7 +281,7 @@ typedef void > (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, > > * Returns 0 on success. > > */ > > typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev, > > - uint8_t port_id, > > + uint16_t port_id, > > const struct rte_event_port_conf *port_conf); > > > please also update > dpaa2_eventdev_port_setup ^ permalink raw reply [flat|nested] 101+ messages in thread
[parent not found: <CALZ3Guikt9x8sz-oEKCuDCSp_wtKa64bSXTrMhqcWyg7f_dS7g@mail.gmail.com>]
* Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range [not found] ` <CALZ3Guikt9x8sz-oEKCuDCSp_wtKa64bSXTrMhqcWyg7f_dS7g@mail.gmail.com> @ 2017-09-07 0:45 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-07 0:45 UTC (permalink / raw) To: Ed Czeck Cc: dev, thomas, Yigit, Ferruh, Wiles, Keith, Stephen Hemminger, John Miller Hi, Ed: Ok. Thanks a lot for your reminder. Thanks Zhiyong From: Ed Czeck [mailto:ed.czeck@atomicrules.com] Sent: Thursday, September 7, 2017 3:21 AM To: Yang, Zhiyong <zhiyong.yang@intel.com> Cc: dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith <keith.wiles@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; John Miller <john.miller@atomicrules.com> Subject: Re: [dpdk-dev] [PATCH v2 1/4] ethdev: increase port_id range Please remove this change in Arkville's PMD from the patch set. The change will break the structure's packing and its handshake with the hardware device. ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v2 2/4] examples: increase port_id range 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang @ 2017-09-04 5:57 ` Zhiyong Yang 2017-09-04 14:15 ` Hunt, David 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 Zhiyong Yang ` (2 subsequent siblings) 4 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-09-04 5:57 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, keith.wiles, stephen, Zhiyong Yang Modify port_id related code in examples accordingly since port_id definition in lib and pmd changes. Fix some original checkpatch issues and remove some unnecessary cast at the same time. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- doc/guides/rel_notes/release_17_11.rst | 4 + examples/bond/main.c | 10 +- examples/distributor/main.c | 28 ++-- examples/eventdev_pipeline_sw_pmd/main.c | 2 +- examples/exception_path/main.c | 39 ++--- examples/ip_fragmentation/main.c | 33 ++--- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 ++--- examples/ipv4_multicast/main.c | 34 ++--- examples/kni/main.c | 31 ++-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-crypto/main.c | 30 ++-- examples/l2fwd-jobstats/main.c | 34 ++--- examples/l2fwd-keepalive/main.c | 49 +++---- examples/l2fwd/main.c | 49 +++---- examples/l3fwd-acl/main.c | 11 +- examples/l3fwd-power/main.c | 62 ++++---- examples/l3fwd-vf/main.c | 53 +++---- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 17 +-- examples/l3fwd/l3fwd_lpm.h | 6 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 ++-- examples/link_status_interrupt/main.c | 11 +- examples/load_balancer/config.c | 21 +-- examples/load_balancer/init.c | 40 +++--- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 21 +-- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 14 +- examples/netmap_compat/lib/compat_netmap.c | 52 ++++--- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +-- examples/performance-thread/l3fwd-thread/main.c | 160 +++++++++++---------- examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 ++-- examples/qos_sched/main.c | 18 ++- examples/qos_sched/main.h | 24 ++-- examples/qos_sched/stats.c | 16 ++- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- 57 files changed, 597 insertions(+), 558 deletions(-) diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst index 170f4f916..98fd7cb23 100644 --- a/doc/guides/rel_notes/release_17_11.rst +++ b/doc/guides/rel_notes/release_17_11.rst @@ -41,6 +41,10 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range from uint8_t to uint16_t.** + + Extended port_id range from 8 bits to 16 bits in order to support more than + 256 ports in dpdk. Resolved Issues --------------- diff --git a/examples/bond/main.c b/examples/bond/main.c index 2d019d433..559801ff3 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -144,7 +144,7 @@ uint8_t slaves[RTE_MAX_ETHPORTS]; uint8_t slaves_count; -static uint8_t BOND_PORT = 0xff; +static uint16_t BOND_PORT = 0xffff; static struct rte_mempool *mbuf_pool; @@ -171,7 +171,7 @@ static struct rte_eth_conf port_conf = { }; static void -slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) +slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) { int retval; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; @@ -215,7 +215,7 @@ slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) struct ether_addr addr; rte_eth_macaddr_get(portid, &addr); - printf("Port %u MAC: ", (unsigned)portid); + printf("Port %u MAC: ", portid); PRINT_MAC(addr); printf("\n"); } @@ -234,7 +234,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "Faled to create bond port\n"); - BOND_PORT = (uint8_t)retval; + BOND_PORT = retval; retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); if (retval != 0) @@ -675,7 +675,7 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result, struct cmdline *cl, __attribute__((unused)) void *data) { - uint8_t slaves[16] = {0}; + uint16_t slaves[16] = {0}; uint8_t len = 16; struct ether_addr addr; uint8_t i = 0; diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 87603d039..24b65e3aa 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -132,7 +132,7 @@ static void print_stats(void); * 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_conf port_conf = port_conf_default; const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1; @@ -175,13 +175,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) struct rte_eth_link link; rte_eth_link_get_nowait(port, &link); while (!link.link_status) { - printf("Waiting for Link up on port %"PRIu8"\n", port); + printf("Waiting for Link up on port %"PRIu16"\n", port); sleep(1); rte_eth_link_get_nowait(port, &link); } if (!link.link_status) { - printf("Link down on port %"PRIu8"\n", port); + printf("Link down on port %"PRIu16"\n", port); return 0; } @@ -189,7 +189,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -210,7 +210,7 @@ struct lcore_params { static int lcore_rx(struct lcore_params *p) { - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); uint8_t port; struct rte_mbuf *bufs[BURST_SIZE*2]; @@ -312,9 +312,9 @@ flush_one_port(struct output_buffer *outbuf, uint8_t outp) } static inline void -flush_all_ports(struct output_buffer *tx_buffers, uint8_t nb_ports) +flush_all_ports(struct output_buffer *tx_buffers, uint16_t nb_ports) { - uint8_t outp; + uint16_t outp; for (outp = 0; outp < nb_ports; outp++) { /* skip ports that are not enabled */ @@ -384,9 +384,9 @@ static int lcore_tx(struct rte_ring *in_r) { static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS]; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); - uint8_t port; + uint16_t port; for (port = 0; port < nb_ports; port++) { /* skip ports that are not enabled */ @@ -668,8 +668,8 @@ main(int argc, char *argv[]) struct rte_ring *rx_dist_ring; unsigned lcore_id, worker_id = 0; unsigned nb_ports; - uint8_t portid; - uint8_t nb_ports_available; + uint16_t portid; + uint16_t nb_ports_available; uint64_t t, freq; /* catch ctrl-c so we can print on exit */ @@ -719,11 +719,11 @@ main(int argc, char *argv[]) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) portid); + printf("Initializing port %u... done\n", portid); if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", - portid); + rte_exit(EXIT_FAILURE, "Cannot initialize port %u\n", + portid); } if (!nb_ports_available) { diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index dd75cb7a3..3763082e5 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -669,7 +669,7 @@ setup_eventdev(struct prod_data *prod_data, /* +1 stages is for a SINGLE_LINK TX stage */ const uint8_t nb_queues = cdata.num_stages + 1; /* + 2 is one port for producer and one for consumer */ - const uint8_t nb_ports = cdata.num_workers + 2; + const uint16_t nb_ports = cdata.num_workers + 2; struct rte_event_dev_config config = { .nb_event_queues = nb_queues, .nb_event_ports = nb_ports, diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index e551e6d11..e4d952343 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -135,7 +135,7 @@ static uint64_t input_cores_mask = 0; static uint64_t output_cores_mask = 0; /* Array storing port_id that is associated with each lcore */ -static uint8_t port_ids[RTE_MAX_LCORE]; +static uint16_t port_ids[RTE_MAX_LCORE]; /* Structure type for recording lcore-specific stats */ struct stats { @@ -360,8 +360,8 @@ static void setup_port_lcore_affinities(void) { unsigned long i; - uint8_t tx_port = 0; - uint8_t rx_port = 0; + uint16_t tx_port = 0; + uint16_t rx_port = 0; /* Setup port_ids[] array, and check masks were ok */ RTE_LCORE_FOREACH(i) { @@ -444,24 +444,23 @@ 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; uint16_t nb_txd = NB_TXD; /* Initialise device and RX/TX queues */ - PRINT_INFO("Initialising port %u ...", (unsigned)port); + PRINT_INFO("Initialising port %u ...", port); fflush(stdout); ret = rte_eth_dev_configure(port, 1, 1, &port_conf); if (ret < 0) - FATAL_ERROR("Could not configure port%u (%d)", - (unsigned)port, ret); + FATAL_ERROR("Could not configure port%u (%d)", port, ret); ret = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd); if (ret < 0) FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, rte_eth_dev_socket_id(port), @@ -469,29 +468,30 @@ init_port(uint8_t port) pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_tx_queue_setup(port, 0, nb_txd, rte_eth_dev_socket_id(port), NULL); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_dev_start(port); if (ret < 0) - FATAL_ERROR("Could not start port%u (%d)", (unsigned)port, ret); + FATAL_ERROR("Could not start port%u (%d)", port, ret); rte_eth_promiscuous_enable(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"); @@ -506,14 +506,14 @@ 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 %u Link Down\n", + portid); continue; } /* clear all_ports_up flag if any link down */ @@ -546,7 +546,8 @@ main(int argc, char** argv) { int ret; unsigned i,high_port; - uint8_t nb_sys_ports, port; + uint8_t nb_sys_ports; + uint16_t port; /* Associate signal_hanlder function with USR signals */ signal(SIGUSR1, signal_handler); diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8c0e17911..de252760f 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -154,7 +154,7 @@ struct rx_queue { struct rte_mempool *indirect_pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; #define MAX_RX_QUEUE_PER_LCORE 16 @@ -240,7 +240,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -261,11 +261,12 @@ send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) static inline void l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, - uint8_t queueid, uint8_t port_in) + uint8_t queueid, uint16_t port_in) { struct rx_queue *rxq; uint32_t i, len, next_hop; - uint8_t port_out, ipv6; + uint8_t ipv6; + uint16_t port_out; int32_t len2; ipv6 = 0; @@ -403,7 +404,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -423,7 +424,7 @@ main_loop(__attribute__((unused)) void *dummy) portid = qconf->rx_queue_list[i].portid; RTE_LOG(INFO, IP_FRAG, " -- lcoreid=%u portid=%d\n", lcore_id, - (int) portid); + portid); } while (1) { @@ -600,11 +601,12 @@ print_ethaddr(const char *name, 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"); @@ -619,14 +621,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 */ @@ -708,7 +709,7 @@ parse_ptype(struct rte_mbuf *m) /* callback function to detect packet type for a queue of a port */ static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -876,7 +877,7 @@ main(int argc, char **argv) uint16_t queueid = 0; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1035,7 +1036,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - 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/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 7cde49a47..ca59baf40 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -1236,7 +1236,7 @@ app_init_tap(struct app_params *app) #ifdef RTE_LIBRTE_KNI 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; if (port_id >= rte_eth_dev_count()) @@ -1250,7 +1250,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) { } static int -kni_change_mtu(uint8_t port_id, unsigned new_mtu) { +kni_change_mtu(uint16_t port_id, unsigned int new_mtu) { int ret; if (port_id >= rte_eth_dev_count()) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index e62636cb4..cadf4c5bd 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -166,7 +166,7 @@ struct rx_queue { struct rte_mempool *pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; struct tx_lcore_stat { @@ -277,7 +277,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; * send burst of packets on an output interface. */ static inline uint32_t -send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint16_t port) { uint32_t fill, len, k, n; struct mbuf_table *txmb; @@ -307,7 +307,7 @@ send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) /* 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 fill, lcore_id, len; struct lcore_queue_conf *qconf; @@ -337,7 +337,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) } static inline void -reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, +reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct lcore_queue_conf *qconf, uint64_t tms) { struct ether_hdr *eth_hdr; @@ -346,7 +346,7 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, struct rx_queue *rxq; void *d_addr_bytes; uint32_t next_hop; - uint8_t dst_port; + uint16_t dst_port; rxq = &qconf->rx_queue_list[queue]; @@ -454,7 +454,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t diff_tsc, cur_tsc, prev_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -473,7 +473,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].portid; - RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%hhu\n", lcore_id, + RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%u\n", lcore_id, portid); } @@ -732,11 +732,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"); @@ -751,14 +752,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 */ @@ -987,7 +987,7 @@ queue_dump_stat(void) qconf = &lcore_queue_conf[lcore]; for (i = 0; i < qconf->n_rx_queue; i++) { - fprintf(stdout, " -- lcoreid=%u portid=%hhu " + fprintf(stdout, " -- lcoreid=%u portid=%u " "frag tbl stat:\n", lcore, qconf->rx_queue_list[i].portid); rte_ip_frag_table_statistics_dump(stdout, @@ -1024,7 +1024,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1177,7 +1177,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); signal(SIGUSR1, signal_handler); signal(SIGTERM, signal_handler); diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 9a13d3530..d635e166a 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -116,7 +116,7 @@ static struct ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; -static uint8_t nb_ports = 0; +static uint16_t nb_ports; static int rx_queue_per_lcore = 1; @@ -195,7 +195,7 @@ static struct mcast_group_params mcast_group_table[] = { /* Send burst of packets on an output interface */ static void -send_burst(struct lcore_queue_conf *qconf, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t port) { struct rte_mbuf **m_table; uint16_t n, queueid; @@ -312,7 +312,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) */ static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, - struct lcore_queue_conf *qconf, uint8_t port) + struct lcore_queue_conf *qconf, uint16_t port) { struct ether_hdr *ethdr; uint16_t len; @@ -343,7 +343,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) struct ipv4_hdr *iphdr; uint32_t dest_addr, port_mask, port_num, use_clone; int32_t hash; - uint8_t port; + uint16_t port; union { uint64_t as_int; struct ether_addr as_addr; @@ -375,7 +375,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) /* Mark all packet's segments as referenced port_num times */ if (use_clone == 0) - rte_pktmbuf_refcnt_update(m, (uint16_t)port_num); + rte_pktmbuf_refcnt_update(m, port_num); /* construct destination ethernet address */ dst_eth_addr.as_int = ETHER_ADDR_FOR_IPV4_MCAST(dest_addr); @@ -407,7 +407,7 @@ static inline void send_timeout_burst(struct lcore_queue_conf *qconf) { uint64_t cur_tsc; - uint8_t portid; + uint16_t portid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; cur_tsc = rte_rdtsc(); @@ -428,7 +428,7 @@ main_loop(__rte_unused void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; unsigned lcore_id; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; lcore_id = rte_lcore_id(); @@ -447,8 +447,8 @@ main_loop(__rte_unused void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i]; - RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%d\n", - lcore_id, (int) portid); + RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%u\n", + lcore_id, portid); } while (1) { @@ -610,11 +610,12 @@ init_mcast_hash(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -629,14 +630,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 */ @@ -673,7 +673,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/kni/main.c b/examples/kni/main.c index e3bc2fb78..cde4c3904 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -110,7 +110,7 @@ * Structure of port parameters */ struct kni_port_params { - uint8_t port_id;/* Port ID */ + uint16_t port_id;/* Port ID */ unsigned lcore_rx; /* lcore ID for RX */ unsigned lcore_tx; /* lcore ID for TX */ uint32_t nb_lcore_k; /* Number of lcores for KNI multi kernel threads */ @@ -162,8 +162,8 @@ struct kni_interface_stats { /* kni device statistics array */ static struct kni_interface_stats kni_stats[RTE_MAX_ETHPORTS]; -static int kni_change_mtu(uint8_t port_id, unsigned new_mtu); -static int kni_config_network_interface(uint8_t port_id, uint8_t if_up); +static int kni_change_mtu(uint16_t port_id, unsigned int new_mtu); +static int kni_config_network_interface(uint16_t port_id, uint8_t if_up); static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); @@ -171,7 +171,7 @@ static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); static void print_stats(void) { - uint8_t i; + uint16_t i; printf("\n**KNI example application statistics**\n" "====== ============== ============ ============ ============ ============\n" @@ -238,7 +238,8 @@ kni_burst_free_mbufs(struct rte_mbuf **pkts, unsigned num) static void kni_ingress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_rx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -274,7 +275,8 @@ kni_ingress(struct kni_port_params *p) static void kni_egress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_tx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -416,7 +418,8 @@ parse_config(const char *arg) 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; + uint16_t nb_kni_port_params = 0; memset(&kni_port_params_array, 0, sizeof(kni_port_params_array)); while (((p = strchr(p0, '(')) != NULL) && @@ -445,7 +448,7 @@ parse_config(const char *arg) } i = 0; - port_id = (uint8_t)int_fld[i++]; + port_id = int_fld[i++]; if (port_id >= RTE_MAX_ETHPORTS) { printf("Port ID %d could not exceed the maximum %d\n", port_id, RTE_MAX_ETHPORTS); @@ -698,7 +701,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) /* 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 int new_mtu) { int ret; struct rte_eth_conf conf; @@ -741,7 +744,7 @@ kni_change_mtu(uint8_t port_id, unsigned new_mtu) /* 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; @@ -766,7 +769,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) } static int -kni_alloc(uint8_t port_id) +kni_alloc(uint16_t port_id) { uint8_t i; struct rte_kni *kni; @@ -790,7 +793,7 @@ kni_alloc(uint8_t port_id) } else snprintf(conf.name, RTE_KNI_NAMESIZE, "vEth%u", port_id); - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; /* * The first KNI device associated to a port @@ -825,7 +828,7 @@ kni_alloc(uint8_t port_id) } static int -kni_free_kni(uint8_t port_id) +kni_free_kni(uint16_t port_id) { uint8_t i; struct kni_port_params **p = kni_port_params_array; @@ -848,7 +851,7 @@ int main(int argc, char** argv) { int ret; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; unsigned i; /* Associate signal_hanlder function with USR signals */ diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index c293bd9c9..b10ac896f 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -59,7 +59,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -106,7 +106,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -124,8 +124,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -181,7 +181,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -217,7 +217,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index f020be32d..121ef6b90 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -566,7 +566,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; @@ -587,7 +587,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; @@ -629,14 +629,14 @@ static void l2fwd_simple_forward(struct rte_mbuf *m, unsigned int portid, struct l2fwd_crypto_options *options) { - unsigned int dst_port; + uint16_t dst_port; dst_port = l2fwd_dst_ports[portid]; if (options->mac_updating) l2fwd_mac_updating(m, dst_port); - l2fwd_send_packet(m, (uint8_t) dst_port); + l2fwd_send_packet(m, dst_port); } /** Generate random key */ @@ -2319,7 +2319,7 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports, static int initialize_ports(struct l2fwd_crypto_options *options) { - uint8_t last_portid, portid; + uint16_t last_portid, portid; unsigned enabled_portcount = 0; unsigned nb_ports = rte_eth_dev_count(); @@ -2340,12 +2340,12 @@ initialize_ports(struct l2fwd_crypto_options *options) continue; /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); retval = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (retval < 0) { printf("Cannot configure device: err=%d, port=%u\n", - retval, (unsigned) portid); + retval, portid); return -1; } @@ -2353,7 +2353,7 @@ initialize_ports(struct l2fwd_crypto_options *options) &nb_txd); if (retval < 0) { printf("Cannot adjust number of descriptors: err=%d, port=%u\n", - retval, (unsigned) portid); + retval, portid); return -1; } @@ -2364,7 +2364,7 @@ initialize_ports(struct l2fwd_crypto_options *options) NULL, l2fwd_pktmbuf_pool); if (retval < 0) { printf("rte_eth_rx_queue_setup:err=%d, port=%u\n", - retval, (unsigned) portid); + retval, portid); return -1; } @@ -2375,7 +2375,7 @@ initialize_ports(struct l2fwd_crypto_options *options) NULL); if (retval < 0) { printf("rte_eth_tx_queue_setup:err=%d, port=%u\n", - retval, (unsigned) portid); + retval, portid); return -1; } @@ -2384,7 +2384,7 @@ initialize_ports(struct l2fwd_crypto_options *options) retval = rte_eth_dev_start(portid); if (retval < 0) { printf("rte_eth_dev_start:err=%d, port=%u\n", - retval, (unsigned) portid); + retval, portid); return -1; } @@ -2393,7 +2393,7 @@ initialize_ports(struct l2fwd_crypto_options *options) rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], @@ -2469,8 +2469,8 @@ main(int argc, char **argv) { struct lcore_queue_conf *qconf; struct l2fwd_crypto_options options; - - uint8_t nb_ports, nb_cryptodevs, portid, cdev_id; + uint16_t nb_ports, portid; + uint8_t nb_cryptodevs, cdev_id; unsigned lcore_id, rx_lcore_id; int ret, enabled_cdevcount, enabled_portcount; uint8_t enabled_cdevs[RTE_CRYPTO_MAX_DEVS] = {0}; @@ -2547,7 +2547,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->nb_rx_ports] = portid; qconf->nb_rx_ports++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned)portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } /* Enable Crypto devices */ diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 989362067..9511156d8 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -776,9 +776,9 @@ main(int argc, char **argv) unsigned nb_ports_in_mask = 0; int ret; char name[RTE_JOBSTATS_NAMESIZE]; - uint8_t nb_ports; - uint8_t nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; uint8_t i; /* init EAL */ @@ -861,7 +861,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -870,24 +870,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -899,7 +899,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -907,8 +907,9 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid), NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup:err=%d, port=%u\n", + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -916,7 +917,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -924,21 +925,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done:\n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 83bc542c1..3f7024fcc 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -157,7 +157,7 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, __attribute__((unused)) void *ptr_data) { uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -299,7 +299,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -479,11 +479,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"); @@ -498,14 +499,14 @@ 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); + portid); continue; } /* clear all_ports_up flag if any link down */ @@ -560,9 +561,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; struct sigaction signal_handler; @@ -653,7 +654,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; printf("Lcore %u: RX port %u\n", - rx_lcore_id, (unsigned) portid); + rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -662,26 +663,25 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", - (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -694,7 +694,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -704,7 +704,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -712,7 +712,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -720,21 +720,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: " "%02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 142633584..290d7c118 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -304,7 +304,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -480,11 +480,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"); @@ -503,14 +504,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 */ @@ -553,9 +553,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; @@ -644,7 +644,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -653,26 +653,26 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); - rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]); + rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); /* init one RX queue */ fflush(stdout); @@ -682,7 +682,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -691,7 +691,7 @@ main(int argc, char **argv) NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -699,7 +699,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -707,21 +707,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done: \n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 8eff4de41..21e17502e 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -121,7 +121,7 @@ static int promiscuous_on; /**< Ports set in promiscuous mode off by default. */ static int numa_on = 1; /**< NUMA is enabled by default. */ struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -131,7 +131,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -1358,7 +1358,8 @@ 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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; int socketid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -1381,7 +1382,7 @@ 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); } @@ -1481,7 +1482,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd442f5ef..f60649bd9 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -174,7 +174,7 @@ enum freq_scale_hint_t }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; enum freq_scale_hint_t freq_up_hint; uint32_t zero_rx_packet_count; @@ -190,7 +190,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -308,8 +308,8 @@ static lookup_struct_t *ipv6_l3fwd_lookup_struct[NB_SOCKETS]; #define IPV6_L3FWD_NUM_ROUTES \ (sizeof(ipv6_l3fwd_route_array) / sizeof(ipv6_l3fwd_route_array[0])) -static uint8_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; -static uint8_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) @@ -370,14 +370,14 @@ static struct rte_timer power_timers[RTE_MAX_LCORE]; static inline uint32_t power_idle_heuristic(uint32_t zero_rx_packet_count); static inline enum freq_scale_hint_t power_freq_scaleup_heuristic( \ - unsigned lcore_id, uint8_t port_id, uint16_t queue_id); + unsigned int lcore_id, uint16_t port_id, uint16_t queue_id); /* exit signal handler */ static void signal_exit_now(int sigtype) { unsigned lcore_id; - unsigned int portid, nb_ports; + uint16_t portid, nb_ports; int ret; if (sigtype == SIGINT) { @@ -523,8 +523,8 @@ print_ipv6_key(struct ipv6_5tuple key) key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t * ipv4_l3fwd_lookup_struct) { struct ipv4_5tuple key; @@ -559,11 +559,11 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, /* 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 -get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { struct ipv6_5tuple key; @@ -599,18 +599,18 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid); } @@ -634,7 +634,7 @@ parse_ptype_one(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -648,7 +648,7 @@ cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, } static int -add_cb_parse_ptype(uint8_t portid, uint16_t queueid) +add_cb_parse_ptype(uint16_t portid, uint16_t queueid) { printf("Port %d: softly parse packet type info\n", portid); if (rte_eth_add_rx_callback(portid, queueid, cb_parse_ptype, NULL)) @@ -665,7 +665,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *d_addr_bytes; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -758,7 +758,7 @@ power_idle_heuristic(uint32_t zero_rx_packet_count) static inline enum freq_scale_hint_t power_freq_scaleup_heuristic(unsigned lcore_id, - uint8_t port_id, + uint16_t port_id, uint16_t queue_id) { /** @@ -805,7 +805,8 @@ sleep_until_rx_interrupt(int num) { struct rte_epoll_event event[num]; int n, i; - uint8_t port_id, queue_id; + uint16_t port_id; + uint8_t queue_id; void *data; RTE_LOG(INFO, L3FWD_POWER, @@ -832,7 +833,8 @@ static void turn_on_intr(struct lcore_conf *qconf) { int i; struct lcore_rx_queue *rx_queue; - uint8_t port_id, queue_id; + uint8_t queue_id; + uint16_t port_id; for (i = 0; i < qconf->n_rx_queue; ++i) { rx_queue = &(qconf->rx_queue_list[i]); @@ -848,7 +850,8 @@ static void turn_on_intr(struct lcore_conf *qconf) static int event_register(struct lcore_conf *qconf) { struct lcore_rx_queue *rx_queue; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; uint32_t data; int ret; int i; @@ -879,7 +882,8 @@ main_loop(__attribute__((unused)) void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; uint64_t prev_tsc_power = 0, cur_tsc_power, diff_tsc_power; int i, j, nb_rx; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; enum freq_scale_hint_t lcore_scaleup_hint; @@ -904,7 +908,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%hhu " + RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%u " "rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -1541,11 +1545,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; + uint8_t count, all_ports_up, print_flag = 0; + uint16_t portid; struct rte_eth_link link; printf("\nChecking link status"); @@ -1651,7 +1656,8 @@ main(int argc, char **argv) uint64_t hz; uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + uint16_t portid; uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ @@ -1751,7 +1757,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (qconf->tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Can't allocate tx buffer for port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(qconf->tx_buffer[portid], MAX_PKT_BURST); } diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 34e4a6bef..a7fa26aed 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -155,7 +155,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -165,7 +165,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -300,7 +300,7 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE]; static rte_spinlock_t spinlock_conf[RTE_MAX_ETHPORTS] = {RTE_SPINLOCK_INITIALIZER}; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -324,7 +324,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 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; uint16_t len; @@ -396,8 +396,9 @@ print_key(struct ipv4_5tuple key) (unsigned)key.ip_dst, (unsigned)key.ip_src, key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint16_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ipv4_5tuple key; struct tcp_hdr *tcp; @@ -430,29 +431,31 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd /* Find destination port */ ret = rte_hash_lookup(l3fwd_lookup_struct, (const void *)&key); - return (uint8_t)((ret < 0)? portid : l3fwd_out_if[ret]); + return ((ret < 0) ? portid : l3fwd_out_if[ret]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint32_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(l3fwd_lookup_struct, - rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? - next_hop : portid); + return ((rte_lpm_lookup(l3fwd_lookup_struct, + rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0) ? + next_hop : portid); } #endif static inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *tmp; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -496,7 +499,8 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -513,11 +517,10 @@ main_loop(__attribute__((unused)) void *dummy) RTE_LOG(INFO, L3FWD, "entering main loop on lcore %u\n", lcore_id); for (i = 0; i < qconf->n_rx_queue; i++) { - 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", lcore_id, - portid, queueid); + RTE_LOG(INFO, L3FWD, " --lcoreid=%u portid=%u rxqueueid=%u\n", + lcore_id, portid, queueid); } while (1) { @@ -606,7 +609,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { @@ -624,7 +627,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; @@ -676,8 +679,8 @@ print_usage(const char *prgname) static void signal_handler(int signum) { - uint8_t portid; - uint8_t nb_ports = rte_eth_dev_count(); + uint16_t portid; + uint16_t nb_ports = rte_eth_dev_count(); /* When we receive a SIGINT signal */ if (signum == SIGINT) { @@ -749,7 +752,7 @@ parse_config(const char *q_arg) nb_lcore_params); return -1; } - lcore_params_array[nb_lcore_params].port_id = (uint8_t)int_fld[FLD_PORT]; + lcore_params_array[nb_lcore_params].port_id = int_fld[FLD_PORT]; lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = (uint8_t)int_fld[FLD_LCORE]; ++nb_lcore_params; @@ -953,11 +956,11 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t nb_lcores; uint16_t n_tx_queue; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; signal(SIGINT, signal_handler); /* init EAL */ diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index 011ba148b..4bb15943c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -83,7 +83,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -117,7 +117,7 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE]; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -139,7 +139,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 int send_single_packet(struct lcore_conf *qconf, - struct rte_mbuf *m, uint8_t port) + struct rte_mbuf *m, uint16_t port) { uint16_t len; @@ -212,11 +212,11 @@ int lpm_check_ptype(int portid); uint16_t -em_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +em_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); uint16_t -lpm_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); int diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h index 2867365d0..7002a43a4 100644 --- a/examples/l3fwd/l3fwd_common.h +++ b/examples/l3fwd/l3fwd_common.h @@ -207,7 +207,7 @@ static const struct { }; static __rte_always_inline void -send_packetsx4(struct lcore_conf *qconf, uint8_t port, struct rte_mbuf *m[], +send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 53d081bd7..df38a1362 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -628,7 +628,7 @@ em_parse_ptype(struct rte_mbuf *m) } uint16_t -em_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h index d509a1fcd..3ca241899 100644 --- a/examples/l3fwd/l3fwd_em.h +++ b/examples/l3fwd/l3fwd_em.h @@ -35,12 +35,12 @@ #define __L3FWD_EM_H__ static __rte_always_inline void -l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; uint32_t tcp_or_udp; uint32_t l3_ptypes; @@ -112,7 +112,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, */ static inline void l3fwd_em_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h index 520672d51..2be61cd48 100644 --- a/examples/l3fwd/l3fwd_em_hlm.h +++ b/examples/l3fwd/l3fwd_em_hlm.h @@ -52,7 +52,7 @@ static __rte_always_inline void em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -68,7 +68,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv4_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -79,7 +79,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], static __rte_always_inline void em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -95,7 +95,7 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv6_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -106,9 +106,9 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], 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; + uint16_t next_hop; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; uint32_t tcp_or_udp; @@ -158,7 +158,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, pos; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index ff1e40355..f7ea7be63 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -105,7 +105,7 @@ struct rte_lpm *ipv4_l3fwd_lpm_lookup_struct[NB_SOCKETS]; struct rte_lpm6 *ipv6_l3fwd_lpm_lookup_struct[NB_SOCKETS]; static inline uint16_t -lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm *ipv4_l3fwd_lookup_struct = @@ -117,7 +117,7 @@ lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) } static inline uint16_t -lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm6 *ipv6_l3fwd_lookup_struct = @@ -130,7 +130,7 @@ lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) static __rte_always_inline uint16_t lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint8_t portid) + uint16_t portid) { struct ipv6_hdr *ipv6_hdr; struct ipv4_hdr *ipv4_hdr; @@ -162,7 +162,7 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, */ static __rte_always_inline uint16_t lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint32_t dst_ipv4, uint8_t portid) + uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -203,7 +203,8 @@ lpm_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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -225,7 +226,7 @@ lpm_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); } @@ -259,7 +260,7 @@ lpm_main_loop(__attribute__((unused)) void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, - MAX_PKT_BURST); + MAX_PKT_BURST); if (nb_rx == 0) continue; @@ -413,7 +414,7 @@ lpm_parse_ptype(struct rte_mbuf *m) } uint16_t -lpm_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h index 55c3e8329..92f613b22 100644 --- a/examples/l3fwd/l3fwd_lpm.h +++ b/examples/l3fwd/l3fwd_lpm.h @@ -35,8 +35,8 @@ #define __L3FWD_LPM_H__ static __rte_always_inline void -l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, - struct lcore_conf *qconf) +l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, + struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; @@ -104,7 +104,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, static inline void l3fwd_lpm_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h index baedbfe84..85f314d1e 100644 --- a/examples/l3fwd/l3fwd_lpm_neon.h +++ b/examples/l3fwd/l3fwd_lpm_neon.h @@ -82,7 +82,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, int32x4_t dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -115,7 +115,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 = 0, j = 0; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h index 4e294c844..d474396ed 100644 --- a/examples/l3fwd/l3fwd_lpm_sse.h +++ b/examples/l3fwd/l3fwd_lpm_sse.h @@ -79,7 +79,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, __m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -112,7 +112,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 j; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 81995fdbe..a5e55baae 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -124,7 +124,7 @@ uint32_t hash_entry_number = HASH_ENTRY_NUMBER_DEFAULT; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -245,7 +245,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { @@ -263,7 +263,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; @@ -445,7 +445,7 @@ parse_config(const char *q_arg) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -750,11 +750,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"); @@ -773,14 +774,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 */ @@ -818,7 +818,7 @@ signal_handler(int signum) } static int -prepare_ptype_parser(uint8_t portid, uint16_t queueid) +prepare_ptype_parser(uint16_t portid, uint16_t queueid) { if (parse_ptype) { printf("Port %d: softly parse packet type info\n", portid); @@ -847,10 +847,10 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1048,7 +1048,7 @@ main(int argc, char **argv) } - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); ret = 0; /* launch per-lcore init on every lcore */ diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f4e3969a6..4600841ae 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -145,7 +145,7 @@ print_stats(void) { struct rte_eth_link link; uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -165,7 +165,7 @@ print_stats(void) continue; memset(&link, 0, sizeof(link)); - rte_eth_link_get_nowait((uint8_t)portid, &link); + rte_eth_link_get_nowait(portid, &link); printf("\nStatistics for port %u ------------------------------" "\nLink status: %25s" "\nLink speed: %26u" @@ -175,7 +175,7 @@ print_stats(void) "\nPackets dropped: %21"PRIu64, portid, (link.link_status ? "Link up" : "Link down"), - (unsigned)link.link_speed, + link.link_speed, (link.link_duplex == ETH_LINK_FULL_DUPLEX ? \ "full-duplex" : "half-duplex"), port_statistics[portid].tx, @@ -470,7 +470,7 @@ lsi_parse_args(int argc, char **argv) * int. */ static int -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, void *ret_param) { struct rte_eth_link link; @@ -498,7 +498,8 @@ check_all_ports_link_status(uint8_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"); diff --git a/examples/load_balancer/config.c b/examples/load_balancer/config.c index 503250951..d7ba2ae45 100644 --- a/examples/load_balancer/config.c +++ b/examples/load_balancer/config.c @@ -240,8 +240,8 @@ parse_arg_rx(const char *arg) if (lp->io.rx.n_nic_queues >= APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE) { return -9; } - lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = (uint8_t) port; - lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].queue = (uint8_t) queue; + lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = port; + lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].queue = queue; lp->io.rx.n_nic_queues ++; n_tuples ++; @@ -318,7 +318,7 @@ parse_arg_tx(const char *arg) if (lp->io.tx.n_nic_ports >= APP_MAX_NIC_TX_PORTS_PER_IO_LCORE) { return -9; } - lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = (uint8_t) port; + lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = port; lp->io.tx.n_nic_ports ++; n_tuples ++; @@ -488,9 +488,9 @@ app_check_lpm_table(void) static int app_check_every_rx_port_is_tx_enabled(void) { - uint8_t port; + uint16_t port; - for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { + for (port = 0; port < APP_MAX_NIC_PORTS; port++) { if ((app_get_nic_rx_queues_per_port(port) > 0) && (app.nic_tx_port_mask[port] == 0)) { return -1; } @@ -762,7 +762,7 @@ app_parse_args(int argc, char **argv) } int -app_get_nic_rx_queues_per_port(uint8_t port) +app_get_nic_rx_queues_per_port(uint16_t port) { uint32_t i, count; @@ -781,7 +781,7 @@ app_get_nic_rx_queues_per_port(uint8_t port) } int -app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) +app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, uint32_t *lcore_out) { uint32_t lcore; @@ -808,7 +808,7 @@ app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) } int -app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out) +app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out) { uint32_t lcore; @@ -896,12 +896,13 @@ app_get_lcores_worker(void) void app_print_params(void) { - unsigned port, queue, lcore, rule, i, j; + uint16_t port; + unsigned int queue, lcore, rule, i, j; /* Print NIC RX configuration */ printf("NIC RX ports: "); for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { - uint32_t n_rx_queues = app_get_nic_rx_queues_per_port((uint8_t) port); + uint32_t n_rx_queues = app_get_nic_rx_queues_per_port(port); if (n_rx_queues == 0) { continue; diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 717232e6e..692d33458 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -308,7 +308,7 @@ app_init_rings_tx(void) continue; } - if (app_get_lcore_for_nic_tx((uint8_t) port, &lcore_io) < 0) { + if (app_get_lcore_for_nic_tx(port, &lcore_io) < 0) { rte_panic("Algorithmic error (no I/O core to handle TX of port %u)\n", port); } @@ -359,11 +359,12 @@ app_init_rings_tx(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; uint32_t n_rx_queues, n_tx_queues; @@ -383,14 +384,14 @@ 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 */ @@ -422,12 +423,13 @@ app_init_nics(void) { unsigned socket; uint32_t lcore; - uint8_t port, queue; + uint16_t port; + uint8_t queue; int ret; uint32_t n_rx_queues, n_tx_queues; /* Init NIC ports and queues, then start the ports */ - for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { + for (port = 0; port < APP_MAX_NIC_PORTS; port++) { struct rte_mempool *pool; uint16_t nic_rx_ring_size; uint16_t nic_tx_ring_size; @@ -440,14 +442,14 @@ app_init_nics(void) } /* Init port */ - printf("Initializing NIC port %u ...\n", (unsigned) port); + printf("Initializing NIC port %u ...\n", port); ret = rte_eth_dev_configure( port, (uint8_t) n_rx_queues, (uint8_t) n_tx_queues, &port_conf); if (ret < 0) { - rte_panic("Cannot init NIC port %u (%d)\n", (unsigned) port, ret); + rte_panic("Cannot init NIC port %u (%d)\n", port, ret); } rte_eth_promiscuous_enable(port); @@ -457,7 +459,7 @@ app_init_nics(void) port, &nic_rx_ring_size, &nic_tx_ring_size); if (ret < 0) { rte_panic("Cannot adjust number of descriptors for port %u (%d)\n", - (unsigned) port, ret); + port, ret); } app.nic_rx_ring_size = nic_rx_ring_size; app.nic_tx_ring_size = nic_tx_ring_size; @@ -473,8 +475,7 @@ app_init_nics(void) pool = app.lcore_params[lcore].pool; printf("Initializing NIC port %u RX queue %u ...\n", - (unsigned) port, - (unsigned) queue); + port, queue); ret = rte_eth_rx_queue_setup( port, queue, @@ -484,9 +485,7 @@ app_init_nics(void) pool); if (ret < 0) { rte_panic("Cannot init RX queue %u for port %u (%d)\n", - (unsigned) queue, - (unsigned) port, - ret); + queue, port, ret); } } @@ -495,7 +494,7 @@ app_init_nics(void) app_get_lcore_for_nic_tx(port, &lcore); socket = rte_lcore_to_socket_id(lcore); printf("Initializing NIC port %u TX queue 0 ...\n", - (unsigned) port); + port); ret = rte_eth_tx_queue_setup( port, 0, @@ -504,8 +503,7 @@ app_init_nics(void) NULL); if (ret < 0) { rte_panic("Cannot init TX queue 0 for port %d (%d)\n", - port, - ret); + port, ret); } } diff --git a/examples/load_balancer/main.h b/examples/load_balancer/main.h index dc407555d..bef2ba041 100644 --- a/examples/load_balancer/main.h +++ b/examples/load_balancer/main.h @@ -248,7 +248,7 @@ struct app_lcore_params_io { struct { /* NIC */ struct { - uint8_t port; + uint16_t port; uint8_t queue; } nic_queues[APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE]; uint32_t n_nic_queues; @@ -275,7 +275,7 @@ struct app_lcore_params_io { struct rte_ring *rings[APP_MAX_NIC_PORTS][APP_MAX_WORKER_LCORES]; /* NIC */ - uint8_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; + uint16_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; uint32_t n_nic_ports; /* Internal buffers */ @@ -368,9 +368,10 @@ void app_print_usage(void); void app_init(void); int app_lcore_main_loop(void *arg); -int app_get_nic_rx_queues_per_port(uint8_t port); -int app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out); -int app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out); +int app_get_nic_rx_queues_per_port(uint16_t port); +int app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, + uint32_t *lcore_out); +int app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out); int app_is_socket_used(uint32_t socket); uint32_t app_get_lcores_io_rx(void); uint32_t app_get_lcores_worker(void); diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index e54b78510..b342e755f 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -188,7 +188,7 @@ app_lcore_io_rx( uint32_t i; for (i = 0; i < lp->rx.n_nic_queues; i ++) { - uint8_t port = lp->rx.nic_queues[i].port; + uint16_t port = lp->rx.nic_queues[i].port; uint8_t queue = lp->rx.nic_queues[i].queue; uint32_t n_mbufs, j; @@ -213,7 +213,7 @@ app_lcore_io_rx( printf("I/O RX %u in (NIC port %u): NIC drop ratio = %.2f avg burst size = %.2f\n", lcore, - (unsigned) port, + port, (double) stats.imissed / (double) (stats.imissed + stats.ipackets), ((double) lp->rx.nic_queues_count[i]) / ((double) lp->rx.nic_queues_iters[i])); lp->rx.nic_queues_iters[i] = 0; @@ -339,7 +339,7 @@ app_lcore_io_tx( uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i ++) { - uint8_t port = lp->tx.nic_ports[i]; + uint16_t port = lp->tx.nic_ports[i]; struct rte_ring *ring = lp->tx.rings[port][worker]; uint32_t n_mbufs, n_pkts; int ret; @@ -395,7 +395,7 @@ app_lcore_io_tx( printf("\t\t\tI/O TX %u out (port %u): avg burst size = %.2f\n", lcore, - (unsigned) port, + port, ((double) lp->tx.nic_ports_count[port]) / ((double) lp->tx.nic_ports_iters[port])); lp->tx.nic_ports_iters[port] = 0; lp->tx.nic_ports_count[port] = 0; @@ -418,7 +418,7 @@ app_lcore_io_tx( static inline void app_lcore_io_tx_flush(struct app_lcore_params_io *lp) { - uint8_t port; + uint16_t port; uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i++) { @@ -569,7 +569,7 @@ app_lcore_worker( if (lp->rings_out_iters[port] == APP_STATS){ printf("\t\tWorker %u out (NIC port %u): enq success rate = %.2f\n", (unsigned) lp->worker_id, - (unsigned) port, + port, ((double) lp->rings_out_count[port]) / ((double) lp->rings_out_iters[port])); lp->rings_out_iters[port] = 0; lp->rings_out_count[port] = 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 f8453e57a..075e0fe75 100644 --- a/examples/multi_process/client_server_mp/mp_client/client.c +++ b/examples/multi_process/client_server_mp/mp_client/client.c @@ -74,7 +74,7 @@ static uint8_t client_id = 0; #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]; @@ -150,7 +150,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; @@ -161,7 +161,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; @@ -171,15 +171,16 @@ configure_tx_buffer(uint8_t port_id, uint16_t size) 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) port_id); + 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) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } /* @@ -193,10 +194,10 @@ configure_output_ports(const struct port_info *ports) int i; if (ports->num_ports > RTE_MAX_ETHPORTS) rte_exit(EXIT_FAILURE, "Too many ethernet ports. RTE_MAX_ETHPORTS = %u\n", - (unsigned)RTE_MAX_ETHPORTS); - for (i = 0; i < ports->num_ports - 1; i+=2){ - uint8_t p1 = ports->id[i]; - uint8_t p2 = ports->id[i+1]; + RTE_MAX_ETHPORTS); + for (i = 0; i < ports->num_ports - 1; i += 2) { + uint16_t p1 = ports->id[i]; + uint16_t p2 = ports->id[i + 1]; output_ports[p1] = p2; output_ports[p2] = p1; diff --git a/examples/multi_process/client_server_mp/mp_server/args.c b/examples/multi_process/client_server_mp/mp_server/args.c index bf8c666c2..a65884fd9 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.c +++ b/examples/multi_process/client_server_mp/mp_server/args.c @@ -74,7 +74,7 @@ parse_portmask(uint8_t max_ports, const char *portmask) { char *end = NULL; unsigned long pm; - uint8_t count = 0; + uint16_t count = 0; if (portmask == NULL || *portmask == '\0') return -1; @@ -128,7 +128,7 @@ parse_num_clients(const char *clients) * on error. */ int -parse_app_args(uint8_t max_ports, int argc, char *argv[]) +parse_app_args(uint16_t max_ports, int argc, char *argv[]) { int option_index, opt; char **argvopt = argv; diff --git a/examples/multi_process/client_server_mp/mp_server/args.h b/examples/multi_process/client_server_mp/mp_server/args.h index 23af1bd38..33888b894 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.h +++ b/examples/multi_process/client_server_mp/mp_server/args.h @@ -34,6 +34,6 @@ #ifndef _ARGS_H_ #define _ARGS_H_ -int parse_app_args(uint8_t max_ports, int argc, char *argv[]); +int parse_app_args(uint16_t max_ports, int argc, char *argv[]); #endif /* ifndef _ARGS_H_ */ diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index 0bc929217..cacf4e0d5 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -114,7 +114,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 = { @@ -129,7 +129,7 @@ init_port(uint8_t port_num) uint16_t q; int retval; - printf("Port %u init ... ", (unsigned)port_num); + printf("Port %u init ... ", port_num); fflush(stdout); /* Standard DPDK port initialisation - config port, then set up @@ -200,11 +200,12 @@ init_shm_rings(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -262,7 +263,7 @@ init(int argc, char *argv[]) { int retval; const struct rte_memzone *mz; - uint8_t i, total_ports; + uint16_t i, total_ports; /* init EAL, parsing EAL args */ retval = rte_eal_init(argc, argv); diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index 7055b543a..121383f8c 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -88,7 +88,7 @@ struct client_rx_buf { static struct client_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/multi_process/client_server_mp/shared/common.h b/examples/multi_process/client_server_mp/shared/common.h index 631c46325..35a3b01d0 100644 --- a/examples/multi_process/client_server_mp/shared/common.h +++ b/examples/multi_process/client_server_mp/shared/common.h @@ -57,8 +57,8 @@ struct tx_stats{ } __rte_cache_aligned; struct port_info { - uint8_t num_ports; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t num_ports; + uint16_t id[RTE_MAX_ETHPORTS]; volatile struct rx_stats rx_stats; volatile struct tx_stats tx_stats[MAX_CLIENTS]; }; diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index f8a626ba7..5d7a9566c 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -140,7 +140,8 @@ struct lcore_resource_struct { /* ring[1] for slave send ack, master read */ struct rte_ring *ring[2]; int port_num; /* Total port numbers */ - uint8_t port[RTE_MAX_ETHPORTS]; /* Port id for that lcore to receive packets */ + /* Port id for that lcore to receive packets */ + uint16_t port[RTE_MAX_ETHPORTS]; }__attribute__((packed)) __rte_cache_aligned; static struct lcore_resource_struct lcore_resource[RTE_MAX_LCORE]; @@ -871,11 +872,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"); @@ -930,9 +932,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned rx_lcore_id; unsigned nb_ports_in_mask = 0; unsigned i; diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index af2d9f3f7..98fbd74d1 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -129,7 +129,7 @@ static void netmap_unregif(uint32_t idx, uint32_t port); static int32_t -ifname_to_portid(const char *ifname, uint8_t *port) +ifname_to_portid(const char *ifname, uint16_t *port) { char *endptr; uint64_t portid; @@ -140,7 +140,7 @@ ifname_to_portid(const char *ifname, uint8_t *port) portid >= RTE_DIM(ports) || errno != 0) return -EINVAL; - *port = (uint8_t)portid; + *port = portid; return 0; } @@ -222,10 +222,10 @@ fd_release(int32_t fd) } static int -check_nmreq(struct nmreq *req, uint8_t *port) +check_nmreq(struct nmreq *req, uint16_t *port) { int32_t rc; - uint8_t portid; + uint16_t portid; if (req == NULL) return -EINVAL; @@ -242,7 +242,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) } if (ports[portid].pool == NULL) { - RTE_LOG(ERR, USER1, "Misconfigured portid %hhu\n", portid); + RTE_LOG(ERR, USER1, "Misconfigured portid %u\n", portid); return -EINVAL; } @@ -262,7 +262,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) static int ioctl_niocginfo(__rte_unused int fd, void * param) { - uint8_t portid; + uint16_t portid; struct nmreq *req; int32_t rc; @@ -283,7 +283,7 @@ ioctl_niocginfo(__rte_unused int fd, void * param) } static void -netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, +netmap_ring_setup(struct netmap_ring *ring, uint16_t port, uint32_t ringid, uint32_t num_slots) { uint32_t j; @@ -305,7 +305,7 @@ netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, } static int -netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) +netmap_regif(struct nmreq *req, uint32_t idx, uint16_t port) { struct netmap_if *nmif; struct netmap_ring *ring; @@ -313,7 +313,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) int32_t rc; if (ports[port].fd < RTE_DIM(fd_port)) { - RTE_LOG(ERR, USER1, "port %hhu already in use by fd: %u\n", + RTE_LOG(ERR, USER1, "port %u already in use by fd: %u\n", port, IDX_TO_FD(ports[port].fd)); return -EBUSY; } @@ -399,7 +399,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) static int ioctl_niocregif(int32_t fd, void * param) { - uint8_t portid; + uint16_t portid; int32_t rc; uint32_t idx; struct nmreq *req; @@ -422,7 +422,7 @@ netmap_unregif(uint32_t idx, uint32_t port) { fd_port[idx].port = FD_PORT_RSRV; ports[port].fd = UINT32_MAX; - rte_eth_dev_stop((uint8_t)port); + rte_eth_dev_stop(port); } /** @@ -460,7 +460,7 @@ ioctl_niocunregif(int fd) * packets as it can hold coming from its dpdk port. */ static inline int -rx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +rx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, uint16_t max_burst) { int32_t i, n_rx; @@ -513,7 +513,7 @@ rx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_rx_rings + 1; i++) { r = NETMAP_RXRING(nifp, i); - rx_sync_ring(r, (uint8_t)port, (uint16_t)i, burst); + rx_sync_ring(r, port, (uint16_t)i, burst); rc += r->avail; } @@ -542,7 +542,7 @@ ioctl_niocrxsync(int fd) * buffers into rte_mbufs and sending them out on the rings's dpdk port. */ static int -tx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +tx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, struct rte_mempool *pool, uint16_t max_burst) { uint32_t i, n_tx; @@ -608,7 +608,7 @@ tx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_tx_rings + 1; i++) { r = NETMAP_TXRING(nifp, i); - tx_sync_ring(r, (uint8_t)port, (uint16_t)i, mp, burst); + tx_sync_ring(r, port, (uint16_t)i, mp, burst); rc += r->avail; } @@ -686,7 +686,7 @@ rte_netmap_init(const struct rte_netmap_conf *conf) int -rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) +rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) { int32_t ret; uint16_t i; @@ -696,17 +696,17 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) portid >= RTE_DIM(ports) || conf->nr_tx_rings > netmap.conf.max_rings || conf->nr_rx_rings > netmap.conf.max_rings) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } - rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); - tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); + rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); + tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); if (tx_slots > netmap.conf.max_slots || rx_slots > netmap.conf.max_slots) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } @@ -715,15 +715,15 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) conf->nr_tx_rings, conf->eth_conf); if (ret < 0) { - RTE_LOG(ERR, USER1, "Couldn't configure port %hhu\n", portid); - return ret; + RTE_LOG(ERR, USER1, "Couldn't configure port %u\n", portid); + return ret; } ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_slots, &tx_slots); if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't ot adjust number of descriptors for port %hhu\n", + "Couldn't ot adjust number of descriptors for port %u\n", portid); return ret; } @@ -734,8 +734,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure TX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure TX queue %u of port %u\n", i, portid); return ret; } @@ -745,8 +744,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure RX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure RX queue %u of port %u\n", i, portid); return ret; } diff --git a/examples/netmap_compat/lib/compat_netmap.h b/examples/netmap_compat/lib/compat_netmap.h index 3dc7a2f40..76b2d2b4c 100644 --- a/examples/netmap_compat/lib/compat_netmap.h +++ b/examples/netmap_compat/lib/compat_netmap.h @@ -67,7 +67,7 @@ struct rte_netmap_port_conf { }; int rte_netmap_init(const struct rte_netmap_conf *conf); -int rte_netmap_init_port(uint8_t portid, +int rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf); int rte_netmap_close(int fd); diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index b26c33df5..3add7be47 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -269,21 +269,22 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) 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) port_id); + port_id); rte_eth_tx_buffer_init(tx_buffer[port_id], MAX_PKTS_BURST); ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id], flush_tx_error_callback, NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } return 0; } static inline int -configure_eth_port(uint8_t port_id) +configure_eth_port(uint16_t port_id) { struct ether_addr addr; const uint16_t rxRings = 1, txRings = 1; @@ -326,7 +327,7 @@ configure_eth_port(uint8_t port_id) rte_eth_macaddr_get(port_id, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port_id, + port_id, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -401,7 +402,7 @@ rx_thread(struct rte_ring *ring_out) uint32_t seqn = 0; uint16_t i, ret = 0; uint16_t nb_rx_pkts; - uint8_t port_id; + uint16_t port_id; struct rte_mbuf *pkts[MAX_PKTS_BURST]; RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__, @@ -632,8 +633,8 @@ main(int argc, char **argv) int ret; unsigned nb_ports; unsigned int lcore_id, last_lcore_id, master_lcore_id; - uint8_t port_id; - uint8_t nb_ports_available; + uint16_t port_id; + uint16_t nb_ports_available; struct worker_thread_args worker_args = {NULL, NULL}; struct send_thread_args send_args = {NULL, NULL}; struct rte_ring *rx_to_workers; @@ -687,7 +688,7 @@ main(int argc, char **argv) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) port_id); + printf("Initializing port %u... done\n", port_id); if (configure_eth_port(port_id) != 0) rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 7954b9744..521a4af0e 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -140,7 +140,7 @@ parse_ptype(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(__rte_unused uint8_t port, __rte_unused uint16_t queue, +cb_parse_ptype(__rte_unused uint16_t port, __rte_unused uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, __rte_unused uint16_t max_pkts, __rte_unused void *user_param) { @@ -277,7 +277,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint32_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -287,7 +287,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct rx_thread_params { - uint8_t port_id; + uint32_t port_id; uint8_t queue_id; uint8_t lcore_id; uint8_t thread_id; @@ -636,7 +636,7 @@ struct thread_tx_conf { struct thread_conf conf; uint16_t tx_queue_id[RTE_MAX_LCORE]; - struct mbuf_table tx_mbufs[RTE_MAX_LCORE]; + struct mbuf_table tx_mbufs[RTE_MAX_ETHPORTS]; struct rte_ring *ring; struct lthread_cond **ready; @@ -648,7 +648,7 @@ struct thread_tx_conf tx_thread[MAX_TX_THREAD]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct thread_tx_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -669,7 +669,7 @@ send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) /* 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) { uint16_t len; struct thread_tx_conf *qconf; @@ -696,8 +696,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) #if ((APP_LOOKUP_METHOD == APP_LOOKUP_LPM) && \ (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline void -send_packetsx4(uint8_t port, - struct rte_mbuf *m[], uint32_t num) +send_packetsx4(uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; struct thread_tx_conf *qconf; @@ -832,9 +831,9 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len) static __m128i mask0; static __m128i mask1; static __m128i mask2; -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, - lookup_struct_t *ipv4_l3fwd_lookup_struct) +static inline uint16_t +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; @@ -846,12 +845,12 @@ get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, key.xmm = _mm_and_si128(data, mask0); /* 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 -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, - lookup_struct_t *ipv6_l3fwd_lookup_struct) +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, + lookup_struct_t *ipv6_l3fwd_lookup_struct) { int ret = 0; union ipv6_5tuple_host key; @@ -873,36 +872,36 @@ get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t)((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(((struct ipv4_hdr *)ipv4_hdr)->dst_addr), &next_hop) == 0) ? next_hop : portid); } -static inline uint8_t -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, - lookup6_struct_t *ipv6_l3fwd_lookup_struct) +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, + lookup6_struct_t *ipv6_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, - ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) == 0) ? - next_hop : portid); + return ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, + ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) == 0) ? + next_hop : portid); } #endif -static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) __attribute__((unused)); #if ((APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH) && \ @@ -919,11 +918,11 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) #define EXCLUDE_8TH_PKT 0x7f static inline void -simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { struct ether_hdr *eth_hdr[8]; struct ipv4_hdr *ipv4_hdr[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; int32_t ret[8]; union ipv4_5tuple_host key[8]; __m128i data[8]; @@ -1042,14 +1041,14 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv4_lookup_struct, &key_array[0], 8, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1146,10 +1145,10 @@ static inline void get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0, } static inline void -simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { int32_t ret[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; struct ether_hdr *eth_hdr[8]; union ipv6_5tuple_host key[8]; @@ -1196,14 +1195,14 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv6_lookup_struct, &key_array[0], 4, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1250,24 +1249,24 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) ether_addr_copy(&ports_eth_addr[dst_port[6]], ð_hdr[6]->s_addr); ether_addr_copy(&ports_eth_addr[dst_port[7]], ð_hdr[7]->s_addr); - send_single_packet(m[0], (uint8_t)dst_port[0]); - send_single_packet(m[1], (uint8_t)dst_port[1]); - send_single_packet(m[2], (uint8_t)dst_port[2]); - send_single_packet(m[3], (uint8_t)dst_port[3]); - send_single_packet(m[4], (uint8_t)dst_port[4]); - send_single_packet(m[5], (uint8_t)dst_port[5]); - send_single_packet(m[6], (uint8_t)dst_port[6]); - send_single_packet(m[7], (uint8_t)dst_port[7]); + send_single_packet(m[0], dst_port[0]); + send_single_packet(m[1], dst_port[1]); + send_single_packet(m[2], dst_port[2]); + send_single_packet(m[3], dst_port[3]); + send_single_packet(m[4], dst_port[4]); + send_single_packet(m[5], dst_port[5]); + send_single_packet(m[6], dst_port[6]); + send_single_packet(m[7], dst_port[7]); } #endif /* APP_LOOKUP_METHOD */ static __rte_always_inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -1379,7 +1378,7 @@ rfc1812_process(struct ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype) (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline uint16_t -get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) +get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -1406,7 +1405,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) } static inline void -process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint8_t portid) +process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; @@ -1473,7 +1472,7 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], static inline void processx4_step2(__m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -1716,7 +1715,8 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2) static void process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx, - uint8_t portid) { + uint16_t portid) +{ int j; @@ -2091,7 +2091,7 @@ lthread_tx(void *args) struct lthread *lt; unsigned lcore_id; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; tx_conf = (struct thread_tx_conf *)args; @@ -2138,7 +2138,8 @@ lthread_rx(void *dummy) int ret; uint16_t nb_rx; int i; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; int worker_id; int len[RTE_MAX_LCORE] = { 0 }; int old_len, new_len; @@ -2164,8 +2165,8 @@ lthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", - rte_lcore_id(), portid, queueid); + RTE_LOG(INFO, L3FWD, "-- lcoreid=%u portid=%u rxqueueid=%u\n", + rte_lcore_id(), portid, queueid); } /* @@ -2323,7 +2324,7 @@ pthread_tx(void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; uint64_t prev_tsc, diff_tsc, cur_tsc; int nb_rx; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -2392,7 +2393,8 @@ pthread_rx(void *dummy) uint32_t n; uint32_t nb_rx; unsigned lcore_id; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct thread_rx_conf *rx_conf; @@ -2411,8 +2413,9 @@ pthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", - lcore_id, portid, queueid); + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + lcore_id, portid, queueid); } worker_id = 0; @@ -2769,7 +2772,7 @@ parse_rx_config(const char *q_arg) return -1; } rx_thread_params_array[nb_rx_thread_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + int_fld[FLD_PORT]; rx_thread_params_array[nb_rx_thread_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; rx_thread_params_array[nb_rx_thread_params].lcore_id = @@ -2853,7 +2856,7 @@ parse_stat_lcore(const char *stat_lcore) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -3440,7 +3443,8 @@ check_all_ports_link_status(uint8_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"); @@ -3455,14 +3459,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 */ @@ -3497,10 +3500,11 @@ main(int argc, char **argv) int ret; int i; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index ddfcdb832..c495e7508 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -158,12 +158,12 @@ struct ptpv2_data_slave_ordinary { struct clock_id master_clock_id; struct timeval new_adj; int64_t delta; - uint8_t portid; + uint16_t portid; uint16_t seqID_SYNC; uint16_t seqID_FOLLOWUP; uint8_t ptpset; uint8_t kernel_time_set; - uint8_t current_ptp_port; + uint16_t current_ptp_port; }; static struct ptpv2_data_slave_ordinary ptp_data; diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 2350d64f4..203a34704 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -252,8 +252,8 @@ app_parse_flow_conf(const char *conf_str) pconf = &qos_conf[nb_pfc]; - pconf->rx_port = (uint8_t)vals[0]; - pconf->tx_port = (uint8_t)vals[1]; + pconf->rx_port = vals[0]; + pconf->tx_port = vals[1]; pconf->rx_core = (uint8_t)vals[2]; pconf->wt_core = (uint8_t)vals[3]; if (ret == 5) @@ -267,19 +267,19 @@ app_parse_flow_conf(const char *conf_str) } if (pconf->rx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu16" index\n", nb_pfc, pconf->rx_port); return -1; } if (pconf->tx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu16" index\n", nb_pfc, pconf->tx_port); return -1; } mask = 1lu << pconf->rx_port; if (app_used_rx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu16" is used already\n", nb_pfc, pconf->rx_port); return -1; } @@ -288,7 +288,7 @@ app_parse_flow_conf(const char *conf_str) mask = 1lu << pconf->tx_port; if (app_used_tx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: port %"PRIu16" is used already\n", nb_pfc, pconf->tx_port); return -1; } diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index a82cbd7d5..004ac54e7 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -100,7 +100,7 @@ static const struct rte_eth_conf port_conf = { }; static int -app_init_port(uint8_t portid, struct rte_mempool *mp) +app_init_port(uint16_t portid, struct rte_mempool *mp) { int ret; struct rte_eth_link link; @@ -127,19 +127,21 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; /* init port */ - RTE_LOG(INFO, APP, "Initializing port %"PRIu8"... ", portid); + RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot configure device: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "Cannot configure device: err=%d, port=%u\n", + ret, portid); rx_size = ring_conf.rx_size; tx_size = ring_conf.tx_size; ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_size, &tx_size); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_dev_adjust_nb_rx_tx_desc: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_dev_adjust_nb_rx_tx_desc: err=%d,port=%u\n", + ret, portid); ring_conf.rx_size = rx_size; ring_conf.tx_size = tx_size; @@ -148,22 +150,25 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size, rte_eth_dev_socket_id(portid), &rx_conf, mp); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u\n", + ret, portid); /* init one TX queue */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, (uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, " - "port=%"PRIu8" queue=%d\n", ret, portid, 0); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n", + ret, portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_pmd_port_start: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_pmd_port_start: err=%d, port=%u\n", + ret, portid); printf("done: "); @@ -256,7 +261,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) uint32_t pipe, subport; int err; - rte_eth_link_get((uint8_t)portid, &link); + rte_eth_link_get(portid, &link); port_params.socket = socketid; port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8; diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index e10cfd448..60caa8b77 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -125,8 +125,7 @@ app_main_loop(__attribute__((unused))void *dummy) /* initialize mbuf memory */ if (mode == APP_RX_MODE) { for (i = 0; i < rx_idx; i++) { - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "reading port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u reading port%u\n", i, lcore_id, rx_confs[i]->rx_port); } @@ -140,9 +139,9 @@ app_main_loop(__attribute__((unused))void *dummy) if (wt_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u sched+write " - "port %"PRIu8"\n", - i, lcore_id, wt_confs[i]->tx_port); + RTE_LOG(INFO, APP, + "flow %u lcoreid %u sched+write port %u\n", + i, lcore_id, wt_confs[i]->tx_port); } app_mixed_thread(wt_confs); @@ -155,9 +154,8 @@ app_main_loop(__attribute__((unused))void *dummy) if (tx_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "writing port %"PRIu8"\n", - i, lcore_id, tx_confs[i]->tx_port); + RTE_LOG(INFO, APP, "flow%u lcoreid%u write port%u\n", + i, lcore_id, tx_confs[i]->tx_port); } app_tx_thread(tx_confs); @@ -186,7 +184,7 @@ app_stat(void) struct flow_conf *flow = &qos_conf[i]; rte_eth_stats_get(flow->rx_port, &stats); - printf("\nRX port %"PRIu8": rx: %"PRIu64 " err: %"PRIu64 + printf("\nRX port %"PRIu16": rx: %"PRIu64 " err: %"PRIu64 " no_mbuf: %"PRIu64 "\n", flow->rx_port, stats.ipackets - rx_stats[i].ipackets, @@ -195,7 +193,7 @@ app_stat(void) memcpy(&rx_stats[i], &stats, sizeof(stats)); rte_eth_stats_get(flow->tx_port, &stats); - printf("TX port %"PRIu8": tx: %" PRIu64 " err: %" PRIu64 "\n", + printf("TX port %"PRIu16": tx: %" PRIu64 " err: %" PRIu64 "\n", flow->tx_port, stats.opackets - tx_stats[i].opackets, stats.oerrors - tx_stats[i].oerrors); diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h index 8d02e1ade..77b6e3ee7 100644 --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -106,8 +106,8 @@ struct thread_conf uint32_t n_mbufs; struct rte_mbuf **m_table; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -125,8 +125,8 @@ struct flow_conf uint32_t rx_core; uint32_t wt_core; uint32_t tx_core; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -188,13 +188,15 @@ void app_worker_thread(struct thread_conf **qconf); void app_mixed_thread(struct thread_conf **qconf); void app_stat(void); -int subport_stat(uint8_t port_id, uint32_t subport_id); -int pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q); -int qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc); -int qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc); -int qavg_subport(uint8_t port_id, uint32_t subport_id); +int subport_stat(uint16_t port_id, uint32_t subport_id); +int pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc, uint8_t q); +int qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc); +int qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc); +int qavg_subport(uint16_t port_id, uint32_t subport_id); #ifdef __cplusplus } diff --git a/examples/qos_sched/stats.c b/examples/qos_sched/stats.c index 5c894455b..4e97a022e 100644 --- a/examples/qos_sched/stats.c +++ b/examples/qos_sched/stats.c @@ -37,7 +37,8 @@ #include "main.h" int -qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q) +qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, + uint8_t q) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -74,7 +75,8 @@ qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8 } int -qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) +qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -114,7 +116,7 @@ qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) } int -qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -153,7 +155,7 @@ qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) } int -qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) +qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -195,7 +197,7 @@ qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) } int -qavg_subport(uint8_t port_id, uint32_t subport_id) +qavg_subport(uint16_t port_id, uint32_t subport_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -237,7 +239,7 @@ qavg_subport(uint8_t port_id, uint32_t subport_id) } int -subport_stat(uint8_t port_id, uint32_t subport_id) +subport_stat(uint16_t port_id, uint32_t subport_id) { struct rte_sched_subport_stats stats; struct rte_sched_port *port; @@ -273,7 +275,7 @@ subport_stat(uint8_t port_id, uint32_t subport_id) } int -pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 083a37a92..415b68bb9 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -156,12 +156,12 @@ void init_ring(int lcore_id, uint8_t port_id) void pair_ports(void) { - uint8_t i, j; + uint16_t i, j; /* Pair ports with their "closest neighbour" in the portmask */ for (i = 0; i < RTE_MAX_ETHPORTS; i++) if (is_bit_set(i, portmask)) - for (j = (uint8_t) (i + 1); j < RTE_MAX_ETHPORTS; j++) + for (j = i + 1; j < RTE_MAX_ETHPORTS; j++) if (is_bit_set(j, portmask)) { port_pairs[i] = j; port_pairs[j] = i; diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c index d4fcfde48..e5ecdb1cf 100644 --- a/examples/quota_watermark/qw/main.c +++ b/examples/quota_watermark/qw/main.c @@ -155,7 +155,7 @@ receive_stage(__attribute__((unused)) void *args) { int i, ret; - uint8_t port_id; + uint16_t port_id; uint16_t nb_rx_pkts; unsigned int lcore_id; @@ -216,7 +216,7 @@ pipeline_stage(__attribute__((unused)) void *args) int i, ret; int nb_dq_pkts; - uint8_t port_id; + uint16_t port_id; unsigned int lcore_id, previous_lcore_id; unsigned int free; @@ -279,8 +279,8 @@ send_stage(__attribute__((unused)) void *args) { uint16_t nb_dq_pkts; - uint8_t port_id; - uint8_t dest_port_id; + uint16_t port_id; + uint16_t dest_port_id; unsigned int lcore_id, previous_lcore_id; @@ -324,7 +324,7 @@ main(int argc, char **argv) int ret; unsigned int lcore_id, master_lcore_id, last_lcore_id; - uint8_t port_id; + uint16_t port_id; rte_log_set_global_level(RTE_LOG_INFO); diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 669924055..e66f16f25 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -59,7 +59,7 @@ static struct { 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, uint16_t max_pkts __rte_unused, void *_ __rte_unused) { @@ -72,7 +72,7 @@ add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } 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; @@ -97,7 +97,7 @@ calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused, * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; - uint8_t portid; + uint16_t portid; /* init EAL */ int ret = rte_eal_init(argc, argv); diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index dcdc0a48b..382a2ded8 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -95,7 +95,7 @@ struct efd_stats { static struct node_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/server_node_efd/shared/common.h b/examples/server_node_efd/shared/common.h index 8a1347993..b1e0abe52 100644 --- a/examples/server_node_efd/shared/common.h +++ b/examples/server_node_efd/shared/common.h @@ -65,9 +65,9 @@ struct filter_stats { struct shared_info { uint8_t num_nodes; - uint8_t num_ports; + uint16_t num_ports; uint32_t num_flows; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t id[RTE_MAX_ETHPORTS]; struct rx_stats rx_stats; struct tx_stats tx_stats[MAX_NODES]; struct filter_stats filter_stats[MAX_NODES]; diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index b4d50de89..e623754cf 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -57,7 +57,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -104,7 +104,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -122,8 +122,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -179,7 +179,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -204,7 +204,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 4d1589d06..89a61f0e5 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -177,7 +177,7 @@ static 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 = 0; /**< The number of ports specified in command line */ static uint16_t num_pf_queues, num_vmdq_queues; static uint16_t vmdq_pool_base, vmdq_queue_base; @@ -265,7 +265,7 @@ validate_num_devices(uint32_t max_nb_devices) * coming from the mbuf_pool passed as parameter */ static inline int -port_init(uint8_t port) +port_init(uint16_t port) { struct rte_eth_dev_info dev_info; struct rte_eth_conf port_conf; @@ -392,7 +392,7 @@ port_init(uint8_t port) RTE_LOG(INFO, VHOST_PORT, "Max virtio devices supported: %u\n", num_devices); RTE_LOG(INFO, VHOST_PORT, "Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, vmdq_ports_eth_addr[port].addr_bytes[0], vmdq_ports_eth_addr[port].addr_bytes[1], vmdq_ports_eth_addr[port].addr_bytes[2], @@ -667,7 +667,7 @@ us_vhost_parse_args(int argc, char **argv) for (i = 0; i < RTE_MAX_ETHPORTS; i++) { if (enabled_port_mask & (1 << i)) - ports[num_ports++] = (uint8_t)i; + ports[num_ports++] = i; } if ((num_ports == 0) || (num_ports > MAX_SUP_PORTS)) { @@ -1443,7 +1443,7 @@ main(int argc, char *argv[]) unsigned lcore_id, core_id = 0; unsigned nb_ports, valid_num_ports; int ret, i; - uint8_t portid; + uint16_t portid; static pthread_t tid; char thread_name[RTE_MAX_THREAD_NAME_LEN]; uint64_t flags = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/4] examples: increase port_id range 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 2/4] examples: " Zhiyong Yang @ 2017-09-04 14:15 ` Hunt, David 2017-09-04 15:01 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Hunt, David @ 2017-09-04 14:15 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, ferruh.yigit, keith.wiles, stephen Hi Zhiyong, On 4/9/2017 6:57 AM, Zhiyong Yang wrote: > Modify port_id related code in examples accordingly since port_id > definition in lib and pmd changes. > > Fix some original checkpatch issues and remove some unnecessary > cast at the same time. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > --- ---big snip--- I noticed that in /test/test/test_pmd_perf.c after applying the patch set, RTE_PORT_ALL is still 8-bit: -#define RTE_PORT_ALL (~(uint8_t)0x0) This probably needs to be: +#define RTE_PORT_ALL (~(portid_t)0x0) Regards, Dave. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/4] examples: increase port_id range 2017-09-04 14:15 ` Hunt, David @ 2017-09-04 15:01 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-04 15:01 UTC (permalink / raw) To: Hunt, David, dev; +Cc: thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi , Dave: Thanks for your reminder. It looks like that I don't cover the folder /test/, if needed, I will cover them next version. Thanks Zhiyong > -----Original Message----- > From: Hunt, David > Sent: Monday, September 4, 2017 10:16 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith > <keith.wiles@intel.com>; stephen@networkplumber.org > Subject: Re: [dpdk-dev] [PATCH v2 2/4] examples: increase port_id range > > Hi Zhiyong, > > > > On 4/9/2017 6:57 AM, Zhiyong Yang wrote: > > Modify port_id related code in examples accordingly since port_id > > definition in lib and pmd changes. > > > > Fix some original checkpatch issues and remove some unnecessary cast > > at the same time. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > --- > ---big snip--- > > > I noticed that in /test/test/test_pmd_perf.c after applying the patch set, > RTE_PORT_ALL is still 8-bit: > > -#define RTE_PORT_ALL (~(uint8_t)0x0) > > This probably needs to be: > > +#define RTE_PORT_ALL (~(portid_t)0x0) > > Regards, > Dave. > > > ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 2/4] examples: " Zhiyong Yang @ 2017-09-04 5:57 ` Zhiyong Yang 2017-09-04 7:46 ` Yao, Lei A 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 4/4] testpmd: add flexibility to mbuf allocation Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang 4 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-09-04 5:57 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, keith.wiles, stephen, Zhiyong Yang The reasons to modify RTE_MAX_ETHPORTS is the following. 1. RTE_MAX_ETHPORTS=32 by default has not met user's requirements with development of virtualization technology. Some vdev users have to modify the setting before the compiling. 2. port_id have been extended to 16 bits definition. But for many samples such as testpmd, l3fwd, num of port is still limited to RTE_MAX_ETHPORTS=32 by default. This may limit usage of 16 bits port_id. So, it is necessary to enlarge RTE_MAX_ETHPORTS to more than 256. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- config/common_base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/common_base b/config/common_base index 5e97a08b6..dccc13e31 100644 --- a/config/common_base +++ b/config/common_base @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y # CONFIG_RTE_LIBRTE_ETHER=y CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n -CONFIG_RTE_MAX_ETHPORTS=32 +CONFIG_RTE_MAX_ETHPORTS=1024 CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 CONFIG_RTE_LIBRTE_IEEE1588=n CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 Zhiyong Yang @ 2017-09-04 7:46 ` Yao, Lei A 2017-09-04 7:59 ` Yang, Zhiyong 2017-09-04 9:27 ` Ananyev, Konstantin 0 siblings, 2 replies; 101+ messages in thread From: Yao, Lei A @ 2017-09-04 7:46 UTC (permalink / raw) To: Yang, Zhiyong, dev Cc: thomas, Yigit, Ferruh, Wiles, Keith, stephen, Yang, Zhiyong > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > Sent: Monday, September 4, 2017 1:58 PM > To: dev@dpdk.org > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, > Keith <keith.wiles@intel.com>; stephen@networkplumber.org; Yang, > Zhiyong <zhiyong.yang@intel.com> > Subject: [dpdk-dev] [PATCH v2 3/4] common_base: extend > RTE_MAX_ETHPORTS from 32 to 1024 > > The reasons to modify RTE_MAX_ETHPORTS is the following. > > 1. RTE_MAX_ETHPORTS=32 by default has not met user's requirements > with development of virtualization technology. Some vdev users have > to modify the setting before the compiling. > > 2. port_id have been extended to 16 bits definition. But for many > samples such as testpmd, l3fwd, num of port is still limited to > RTE_MAX_ETHPORTS=32 by default. This may limit usage of 16 bits > port_id. > > So, it is necessary to enlarge RTE_MAX_ETHPORTS to more than 256. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > --- > config/common_base | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/config/common_base b/config/common_base > index 5e97a08b6..dccc13e31 100644 > --- a/config/common_base > +++ b/config/common_base > @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y > # > CONFIG_RTE_LIBRTE_ETHER=y > CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n > -CONFIG_RTE_MAX_ETHPORTS=32 > +CONFIG_RTE_MAX_ETHPORTS=1024 > CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 > CONFIG_RTE_LIBRTE_IEEE1588=n > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 > -- > 2.13.3 Hi, Zhiyong I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. One process can only open 1024 file as maximum in common linux distribution, after practice, only 1009 socket file can be used for vdev device with testpmd sample. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 7:46 ` Yao, Lei A @ 2017-09-04 7:59 ` Yang, Zhiyong 2017-09-04 9:09 ` Bruce Richardson 2017-09-04 9:27 ` Ananyev, Konstantin 1 sibling, 1 reply; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-04 7:59 UTC (permalink / raw) To: Yao, Lei A, dev; +Cc: thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi, Lei: > -----Original Message----- > From: Yao, Lei A > Sent: Monday, September 4, 2017 3:46 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith > <keith.wiles@intel.com>; stephen@networkplumber.org; Yang, Zhiyong > <zhiyong.yang@intel.com> > Subject: RE: [dpdk-dev] [PATCH v2 3/4] common_base: extend > RTE_MAX_ETHPORTS from 32 to 1024 > > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > > Sent: Monday, September 4, 2017 1:58 PM > > To: dev@dpdk.org > > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; > > Wiles, Keith <keith.wiles@intel.com>; stephen@networkplumber.org; > > Yang, Zhiyong <zhiyong.yang@intel.com> > > Subject: [dpdk-dev] [PATCH v2 3/4] common_base: extend > > RTE_MAX_ETHPORTS from 32 to 1024 > > > > The reasons to modify RTE_MAX_ETHPORTS is the following. > > > > 1. RTE_MAX_ETHPORTS=32 by default has not met user's requirements with > > development of virtualization technology. Some vdev users have to > > modify the setting before the compiling. > > > > 2. port_id have been extended to 16 bits definition. But for many > > samples such as testpmd, l3fwd, num of port is still limited to > > RTE_MAX_ETHPORTS=32 by default. This may limit usage of 16 bits > > port_id. > > > > So, it is necessary to enlarge RTE_MAX_ETHPORTS to more than 256. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > --- > > config/common_base | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/config/common_base b/config/common_base index > > 5e97a08b6..dccc13e31 100644 > > --- a/config/common_base > > +++ b/config/common_base > > @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y # > > CONFIG_RTE_LIBRTE_ETHER=y CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n > > -CONFIG_RTE_MAX_ETHPORTS=32 > > +CONFIG_RTE_MAX_ETHPORTS=1024 > > CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 > > CONFIG_RTE_LIBRTE_IEEE1588=n > > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 > > -- > > 2.13.3 > Hi, Zhiyong > > I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. > One process can only open 1024 file as maximum in common linux distribution, > after practice, only 1009 socket file can be used for vdev device with testpmd > sample. Thanks for your info. It seems that 1024 is too large and may bring some potential issues. Thanks Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 7:59 ` Yang, Zhiyong @ 2017-09-04 9:09 ` Bruce Richardson 2017-09-04 10:05 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Bruce Richardson @ 2017-09-04 9:09 UTC (permalink / raw) To: Yang, Zhiyong Cc: Yao, Lei A, dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen On Mon, Sep 04, 2017 at 07:59:29AM +0000, Yang, Zhiyong wrote: > Hi, Lei: > > > -----Original Message----- > > From: Yao, Lei A > > Sent: Monday, September 4, 2017 3:46 PM > > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith > > <keith.wiles@intel.com>; stephen@networkplumber.org; Yang, Zhiyong > > <zhiyong.yang@intel.com> > > Subject: RE: [dpdk-dev] [PATCH v2 3/4] common_base: extend > > RTE_MAX_ETHPORTS from 32 to 1024 > > > > > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > > > Sent: Monday, September 4, 2017 1:58 PM > > > To: dev@dpdk.org > > > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; > > > Wiles, Keith <keith.wiles@intel.com>; stephen@networkplumber.org; > > > Yang, Zhiyong <zhiyong.yang@intel.com> > > > Subject: [dpdk-dev] [PATCH v2 3/4] common_base: extend > > > RTE_MAX_ETHPORTS from 32 to 1024 > > > > > > The reasons to modify RTE_MAX_ETHPORTS is the following. > > > > > > 1. RTE_MAX_ETHPORTS=32 by default has not met user's requirements with > > > development of virtualization technology. Some vdev users have to > > > modify the setting before the compiling. > > > > > > 2. port_id have been extended to 16 bits definition. But for many > > > samples such as testpmd, l3fwd, num of port is still limited to > > > RTE_MAX_ETHPORTS=32 by default. This may limit usage of 16 bits > > > port_id. > > > > > > So, it is necessary to enlarge RTE_MAX_ETHPORTS to more than 256. > > > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > > --- > > > config/common_base | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/config/common_base b/config/common_base index > > > 5e97a08b6..dccc13e31 100644 > > > --- a/config/common_base > > > +++ b/config/common_base > > > @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y # > > > CONFIG_RTE_LIBRTE_ETHER=y CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n > > > -CONFIG_RTE_MAX_ETHPORTS=32 > > > +CONFIG_RTE_MAX_ETHPORTS=1024 > > > CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 > > > CONFIG_RTE_LIBRTE_IEEE1588=n > > > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 > > > -- > > > 2.13.3 > > Hi, Zhiyong > > > > I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. > > One process can only open 1024 file as maximum in common linux distribution, > > after practice, only 1009 socket file can be used for vdev device with testpmd > > sample. > > Thanks for your info. It seems that 1024 is too large and may bring some potential issues. > > Thanks > Zhiyong > It should be possible to have a dynamically allocated ethdev array, which would allow use to have a default value - which could be e.g. 32 or 64 as now - while also allowing a run-time parameter to increase that to thousands if needed. /Bruce ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 9:09 ` Bruce Richardson @ 2017-09-04 10:05 ` Yang, Zhiyong 2017-09-04 10:27 ` Ananyev, Konstantin 2017-09-04 10:29 ` Bruce Richardson 0 siblings, 2 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-04 10:05 UTC (permalink / raw) To: Richardson, Bruce Cc: Yao, Lei A, dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi, Bruce: > -----Original Message----- > From: Richardson, Bruce > Sent: Monday, September 4, 2017 5:09 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com> > Cc: Yao, Lei A <lei.a.yao@intel.com>; dev@dpdk.org; thomas@monjalon.net; > Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith <keith.wiles@intel.com>; > stephen@networkplumber.org > Subject: Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend > RTE_MAX_ETHPORTS from 32 to 1024 > > > > --- a/config/common_base > > > > +++ b/config/common_base > > > > @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y # > > > > CONFIG_RTE_LIBRTE_ETHER=y CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n > > > > -CONFIG_RTE_MAX_ETHPORTS=32 > > > > +CONFIG_RTE_MAX_ETHPORTS=1024 > > > > CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 > > > > CONFIG_RTE_LIBRTE_IEEE1588=n > > > > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 > > > > -- > > > > 2.13.3 > > > Hi, Zhiyong > > > > > > I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. > > > One process can only open 1024 file as maximum in common linux > > > distribution, after practice, only 1009 socket file can be used for > > > vdev device with testpmd sample. > > > > Thanks for your info. It seems that 1024 is too large and may bring some > potential issues. > > > > Thanks > > Zhiyong > > > > It should be possible to have a dynamically allocated ethdev array, which would > allow use to have a default value - which could be e.g. 32 or 64 as now - while > also allowing a run-time parameter to increase that to thousands if needed. > > /Bruce In testpmd, the following function will be called to validate the port_id. So, It is necessary to modify the max port num RTE_MAX_ETHPORTS. I think that RTE_MAX_ETHPORTS and a default value(num of port ) should be different values. Now dpdk limits the max num to RTE_MAX_ETHPORTS = 32 by default. int rte_eth_dev_is_valid_port(uint16_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && rte_eth_devices[port_id].state != RTE_ETH_DEV_DEFERRED)) return 0; else return 1; } Thanks Zhiyong. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 10:05 ` Yang, Zhiyong @ 2017-09-04 10:27 ` Ananyev, Konstantin 2017-09-04 14:18 ` Yang, Zhiyong 2017-09-06 8:42 ` Hemant Agrawal 2017-09-04 10:29 ` Bruce Richardson 1 sibling, 2 replies; 101+ messages in thread From: Ananyev, Konstantin @ 2017-09-04 10:27 UTC (permalink / raw) To: Yang, Zhiyong, Richardson, Bruce Cc: Yao, Lei A, dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi Zhiong, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yang, Zhiyong > Sent: Monday, September 4, 2017 11:05 AM > To: Richardson, Bruce <bruce.richardson@intel.com> > Cc: Yao, Lei A <lei.a.yao@intel.com>; dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith > <keith.wiles@intel.com>; stephen@networkplumber.org > Subject: Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 > > Hi, Bruce: > > > -----Original Message----- > > From: Richardson, Bruce > > Sent: Monday, September 4, 2017 5:09 PM > > To: Yang, Zhiyong <zhiyong.yang@intel.com> > > Cc: Yao, Lei A <lei.a.yao@intel.com>; dev@dpdk.org; thomas@monjalon.net; > > Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith <keith.wiles@intel.com>; > > stephen@networkplumber.org > > Subject: Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend > > RTE_MAX_ETHPORTS from 32 to 1024 > > > > > --- a/config/common_base > > > > > +++ b/config/common_base > > > > > @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y # > > > > > CONFIG_RTE_LIBRTE_ETHER=y CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n > > > > > -CONFIG_RTE_MAX_ETHPORTS=32 > > > > > +CONFIG_RTE_MAX_ETHPORTS=1024 > > > > > CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 > > > > > CONFIG_RTE_LIBRTE_IEEE1588=n > > > > > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 > > > > > -- > > > > > 2.13.3 > > > > Hi, Zhiyong > > > > > > > > I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. > > > > One process can only open 1024 file as maximum in common linux > > > > distribution, after practice, only 1009 socket file can be used for > > > > vdev device with testpmd sample. > > > > > > Thanks for your info. It seems that 1024 is too large and may bring some > > potential issues. > > > > > > Thanks > > > Zhiyong > > > > > > > It should be possible to have a dynamically allocated ethdev array, which would > > allow use to have a default value - which could be e.g. 32 or 64 as now - while > > also allowing a run-time parameter to increase that to thousands if needed. > > > > /Bruce > > In testpmd, the following function will be called to validate the port_id. > So, It is necessary to modify the max port num RTE_MAX_ETHPORTS. There are quite a lot memory allocations (both static an dynamic) inside DPDK libs and sample apps that use RTE_MAX_ETHPORTS. Increasing RTE_MAX_ETHPORTS would increase DPDK memory requirements quite significantly. Why do you think it is *necessary* to increase default RTE_MAX_ETHPORTS to 1024? Konstantin > > I think that RTE_MAX_ETHPORTS and a default value(num of port ) should be different values. > Now dpdk limits the max num to RTE_MAX_ETHPORTS = 32 by default. > int > rte_eth_dev_is_valid_port(uint16_t port_id) > { > if (port_id >= RTE_MAX_ETHPORTS || > (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && > rte_eth_devices[port_id].state != RTE_ETH_DEV_DEFERRED)) > return 0; > else > return 1; > } > > Thanks > Zhiyong. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 10:27 ` Ananyev, Konstantin @ 2017-09-04 14:18 ` Yang, Zhiyong 2017-09-06 8:42 ` Hemant Agrawal 1 sibling, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-04 14:18 UTC (permalink / raw) To: Ananyev, Konstantin, Richardson, Bruce Cc: Yao, Lei A, dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi, konstantin: > > > It should be possible to have a dynamically allocated ethdev array, > > > which would allow use to have a default value - which could be e.g. > > > 32 or 64 as now - while also allowing a run-time parameter to increase that > to thousands if needed. > > > > > > /Bruce > > > > In testpmd, the following function will be called to validate the port_id. > > So, It is necessary to modify the max port num RTE_MAX_ETHPORTS. > > There are quite a lot memory allocations (both static an dynamic) inside DPDK > libs and sample apps that use RTE_MAX_ETHPORTS. > Increasing RTE_MAX_ETHPORTS would increase DPDK memory requirements > quite significantly. > Why do you think it is *necessary* to increase default RTE_MAX_ETHPORTS to > 1024? > Konstantin One reason is that some users have the requirement of more than 32 ports now. But it need to reconfigure and recompile dpdk. Another reason is that validating team doesn't modify the common_base when doing regression test. But they need to validate if uint16_t port_id can work. Bruce suggests to pass parameter and dynamically allocate ethdev array at run time. It is another method. I'm thinking about it. Thanks Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 10:27 ` Ananyev, Konstantin 2017-09-04 14:18 ` Yang, Zhiyong @ 2017-09-06 8:42 ` Hemant Agrawal 2017-09-06 8:52 ` Yang, Zhiyong 1 sibling, 1 reply; 101+ messages in thread From: Hemant Agrawal @ 2017-09-06 8:42 UTC (permalink / raw) To: Ananyev, Konstantin, Yang, Zhiyong, Richardson, Bruce Cc: Yao, Lei A, dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen On 9/4/2017 3:57 PM, Ananyev, Konstantin wrote: > Hi Zhiong, > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yang, Zhiyong >> Sent: Monday, September 4, 2017 11:05 AM >> To: Richardson, Bruce <bruce.richardson@intel.com> >> Cc: Yao, Lei A <lei.a.yao@intel.com>; dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith >> <keith.wiles@intel.com>; stephen@networkplumber.org >> Subject: Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 >> >> Hi, Bruce: >> >>> -----Original Message----- >>> From: Richardson, Bruce >>> Sent: Monday, September 4, 2017 5:09 PM >>> To: Yang, Zhiyong <zhiyong.yang@intel.com> >>> Cc: Yao, Lei A <lei.a.yao@intel.com>; dev@dpdk.org; thomas@monjalon.net; >>> Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith <keith.wiles@intel.com>; >>> stephen@networkplumber.org >>> Subject: Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend >>> RTE_MAX_ETHPORTS from 32 to 1024 >>>>>> --- a/config/common_base >>>>>> +++ b/config/common_base >>>>>> @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y # >>>>>> CONFIG_RTE_LIBRTE_ETHER=y CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n >>>>>> -CONFIG_RTE_MAX_ETHPORTS=32 >>>>>> +CONFIG_RTE_MAX_ETHPORTS=1024 >>>>>> CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 >>>>>> CONFIG_RTE_LIBRTE_IEEE1588=n >>>>>> CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 >>>>>> -- >>>>>> 2.13.3 >>>>> Hi, Zhiyong >>>>> >>>>> I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. >>>>> One process can only open 1024 file as maximum in common linux >>>>> distribution, after practice, only 1009 socket file can be used for >>>>> vdev device with testpmd sample. >>>> >>>> Thanks for your info. It seems that 1024 is too large and may bring some >>> potential issues. >>>> >>>> Thanks >>>> Zhiyong >>>> >>> >>> It should be possible to have a dynamically allocated ethdev array, which would >>> allow use to have a default value - which could be e.g. 32 or 64 as now - while >>> also allowing a run-time parameter to increase that to thousands if needed. >>> >>> /Bruce >> >> In testpmd, the following function will be called to validate the port_id. >> So, It is necessary to modify the max port num RTE_MAX_ETHPORTS. > > There are quite a lot memory allocations (both static an dynamic) inside DPDK libs and sample apps > that use RTE_MAX_ETHPORTS. > Increasing RTE_MAX_ETHPORTS would increase DPDK memory requirements quite significantly. It is not a good idea to significantly increase the DPDK memory requirement. Can you not make it with "CONFIG_RTE_MAX_ETHPORTS=1024" for your testing configs? > Why do you think it is *necessary* to increase default RTE_MAX_ETHPORTS to 1024? > Konstantin > >> >> I think that RTE_MAX_ETHPORTS and a default value(num of port ) should be different values. >> Now dpdk limits the max num to RTE_MAX_ETHPORTS = 32 by default. >> int >> rte_eth_dev_is_valid_port(uint16_t port_id) >> { >> if (port_id >= RTE_MAX_ETHPORTS || >> (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && >> rte_eth_devices[port_id].state != RTE_ETH_DEV_DEFERRED)) >> return 0; >> else >> return 1; >> } >> >> Thanks >> Zhiyong. > ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-06 8:42 ` Hemant Agrawal @ 2017-09-06 8:52 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-06 8:52 UTC (permalink / raw) To: Hemant Agrawal, Ananyev, Konstantin, Richardson, Bruce Cc: Yao, Lei A, dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen Hi, Hemant: This patch will be dropped from the patchset next version. Thanks Zhiyong >> In testpmd, the following function will be called to validate the port_id. > >> So, It is necessary to modify the max port num RTE_MAX_ETHPORTS. > > > > There are quite a lot memory allocations (both static an dynamic) > > inside DPDK libs and sample apps that use RTE_MAX_ETHPORTS. > > Increasing RTE_MAX_ETHPORTS would increase DPDK memory requirements > quite significantly. > > It is not a good idea to significantly increase the DPDK memory requirement. > > Can you not make it with "CONFIG_RTE_MAX_ETHPORTS=1024" for your testing > configs? > ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 10:05 ` Yang, Zhiyong 2017-09-04 10:27 ` Ananyev, Konstantin @ 2017-09-04 10:29 ` Bruce Richardson 1 sibling, 0 replies; 101+ messages in thread From: Bruce Richardson @ 2017-09-04 10:29 UTC (permalink / raw) To: Yang, Zhiyong Cc: Yao, Lei A, dev, thomas, Yigit, Ferruh, Wiles, Keith, stephen On Mon, Sep 04, 2017 at 11:05:11AM +0100, Yang, Zhiyong wrote: > Hi, Bruce: > > > -----Original Message----- > > From: Richardson, Bruce > > Sent: Monday, September 4, 2017 5:09 PM > > To: Yang, Zhiyong <zhiyong.yang@intel.com> > > Cc: Yao, Lei A <lei.a.yao@intel.com>; dev@dpdk.org; thomas@monjalon.net; > > Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith <keith.wiles@intel.com>; > > stephen@networkplumber.org > > Subject: Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend > > RTE_MAX_ETHPORTS from 32 to 1024 > > > > > --- a/config/common_base > > > > > +++ b/config/common_base > > > > > @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y # > > > > > CONFIG_RTE_LIBRTE_ETHER=y CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n > > > > > -CONFIG_RTE_MAX_ETHPORTS=32 > > > > > +CONFIG_RTE_MAX_ETHPORTS=1024 > > > > > CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 > > > > > CONFIG_RTE_LIBRTE_IEEE1588=n > > > > > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 > > > > > -- > > > > > 2.13.3 > > > > Hi, Zhiyong > > > > > > > > I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. > > > > One process can only open 1024 file as maximum in common linux > > > > distribution, after practice, only 1009 socket file can be used for > > > > vdev device with testpmd sample. > > > > > > Thanks for your info. It seems that 1024 is too large and may bring some > > potential issues. > > > > > > Thanks > > > Zhiyong > > > > > > > It should be possible to have a dynamically allocated ethdev array, which would > > allow use to have a default value - which could be e.g. 32 or 64 as now - while > > also allowing a run-time parameter to increase that to thousands if needed. > > > > /Bruce > > In testpmd, the following function will be called to validate the port_id. > So, It is necessary to modify the max port num RTE_MAX_ETHPORTS. > > I think that RTE_MAX_ETHPORTS and a default value(num of port ) should be different values. > Now dpdk limits the max num to RTE_MAX_ETHPORTS = 32 by default. > int > rte_eth_dev_is_valid_port(uint16_t port_id) > { > if (port_id >= RTE_MAX_ETHPORTS || > (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && > rte_eth_devices[port_id].state != RTE_ETH_DEV_DEFERRED)) > return 0; > else > return 1; > } > If we have a dynamically allocated array size, the port_id can still be bounds-checks. It's just the check comes from a variable rather than a compile-time constant. It should not be any slower in practice. As for an absolute max value, I won't object to having one, but I don't see it as needed. If we don't use one, we have one automatically at 64k, i.e. UINT_16_MAX. I fail to see the need to limit it to lower than that - if a user wants that many ports, let them have them. /Bruce ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 2017-09-04 7:46 ` Yao, Lei A 2017-09-04 7:59 ` Yang, Zhiyong @ 2017-09-04 9:27 ` Ananyev, Konstantin 1 sibling, 0 replies; 101+ messages in thread From: Ananyev, Konstantin @ 2017-09-04 9:27 UTC (permalink / raw) To: Yao, Lei A, Yang, Zhiyong, dev Cc: thomas, Yigit, Ferruh, Wiles, Keith, stephen, Yang, Zhiyong > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yao, Lei A > Sent: Monday, September 4, 2017 8:46 AM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, Keith <keith.wiles@intel.com>; stephen@networkplumber.org; > Yang, Zhiyong <zhiyong.yang@intel.com> > Subject: Re: [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 > > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhiyong Yang > > Sent: Monday, September 4, 2017 1:58 PM > > To: dev@dpdk.org > > Cc: thomas@monjalon.net; Yigit, Ferruh <ferruh.yigit@intel.com>; Wiles, > > Keith <keith.wiles@intel.com>; stephen@networkplumber.org; Yang, > > Zhiyong <zhiyong.yang@intel.com> > > Subject: [dpdk-dev] [PATCH v2 3/4] common_base: extend > > RTE_MAX_ETHPORTS from 32 to 1024 > > > > The reasons to modify RTE_MAX_ETHPORTS is the following. > > > > 1. RTE_MAX_ETHPORTS=32 by default has not met user's requirements > > with development of virtualization technology. Some vdev users have > > to modify the setting before the compiling. > > > > 2. port_id have been extended to 16 bits definition. But for many > > samples such as testpmd, l3fwd, num of port is still limited to > > RTE_MAX_ETHPORTS=32 by default. This may limit usage of 16 bits > > port_id. > > > > So, it is necessary to enlarge RTE_MAX_ETHPORTS to more than 256. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > --- > > config/common_base | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/config/common_base b/config/common_base > > index 5e97a08b6..dccc13e31 100644 > > --- a/config/common_base > > +++ b/config/common_base > > @@ -131,7 +131,7 @@ CONFIG_RTE_LIBRTE_KVARGS=y > > # > > CONFIG_RTE_LIBRTE_ETHER=y > > CONFIG_RTE_LIBRTE_ETHDEV_DEBUG=n > > -CONFIG_RTE_MAX_ETHPORTS=32 > > +CONFIG_RTE_MAX_ETHPORTS=1024 > > CONFIG_RTE_MAX_QUEUES_PER_PORT=1024 > > CONFIG_RTE_LIBRTE_IEEE1588=n > > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS=16 > > -- > 2.13.3 > Hi, Zhiyong > > I met one issue for changing CONFIG_RTE_MAX_ETHPORTS to 1024. > One process can only open 1024 file as maximum in common linux distribution, > after practice, only 1009 socket file can be used for vdev device with testpmd > sample. ulimit -Sn 10000 ? ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v2 4/4] testpmd: add flexibility to mbuf allocation 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang ` (2 preceding siblings ...) 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 Zhiyong Yang @ 2017-09-04 5:57 ` Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang 4 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-04 5:57 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, keith.wiles, stephen, Zhiyong Yang The currnet mechanisim of allocating mbuf depends on RTE_MAX_ETHPORTS which is hardcoded at the compiling time. Once large numbers of ports are needed by users, it may easily cause the failure of creating mempool due to be lack of enough hugepage memory. The patch introduces the policy to limit the max memory size, and try to allocate a mempool with nb_mbuf_per_pool * nb_ports firstly, if this fails due to be lack of enough hugepages, we will keep halving the size until the allocation succeeds, or reaches the min memory requirement. The policy refers to OvS's solution. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- app/test-pmd/testpmd.c | 71 ++++++++++++++++++++++++++++++++++++++------------ app/test-pmd/testpmd.h | 3 +++ 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index ed42a4c08..fb01f28ae 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -482,13 +482,14 @@ set_def_fwd_config(void) /* * Configuration initialisation done once at init time. */ -static void +static int mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf, unsigned int socket_id) { char pool_name[RTE_MEMPOOL_NAMESIZE]; struct rte_mempool *rte_mp = NULL; uint32_t mb_size; + int ret = 0; mb_size = sizeof(struct rte_mbuf) + mbuf_seg_size; mbuf_poolname_build(socket_id, pool_name, sizeof(pool_name)); @@ -531,13 +532,12 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf, } err: - if (rte_mp == NULL) { - rte_exit(EXIT_FAILURE, - "Creation of mbuf pool for socket %u failed: %s\n", - socket_id, rte_strerror(rte_errno)); - } else if (verbose_level > 0) { + if (rte_mp == NULL) + ret = -1; + else if (verbose_level > 0) rte_mempool_dump(stdout, rte_mp); - } + + return ret; } /* @@ -570,6 +570,8 @@ init_config(void) unsigned int nb_mbuf_per_pool; lcoreid_t lc_id; uint8_t port_per_socket[RTE_MAX_NUMA_NODES]; + uint16_t num_ports; + int32_t ret = -1; memset(port_per_socket,0,RTE_MAX_NUMA_NODES); @@ -632,24 +634,61 @@ init_config(void) if (param_total_num_mbufs) nb_mbuf_per_pool = param_total_num_mbufs; else { + num_ports = RTE_MIN(MAX_MULTIPLIER_POOL, RTE_MAX_ETHPORTS); + num_ports = RTE_MAX(MIN_MULTIPLIER_POOL, num_ports); nb_mbuf_per_pool = RTE_TEST_RX_DESC_MAX + (nb_lcores * mb_mempool_cache) + RTE_TEST_TX_DESC_MAX + MAX_PKT_BURST; - nb_mbuf_per_pool *= RTE_MAX_ETHPORTS; + nb_mbuf_per_pool *= num_ports; } + /* try to allocate a mempool with nb_mbuf_per_pool * num_ports, if + * this fails due to be lack of enough hugepages, we will keep halving + * the number until the allocation succeeds. or reaches the min memory + * requirement. + */ + if (numa_support) { uint8_t i; + unsigned int nb_mbuf = nb_mbuf_per_pool; + uint16_t nb_ports = num_ports; + + for (i = 0; i < num_sockets; i++) { + nb_mbuf_per_pool = nb_mbuf; + num_ports = nb_ports; + do { + ret = mbuf_pool_create(mbuf_data_size, + nb_mbuf_per_pool, + socket_ids[i]); + nb_mbuf_per_pool /= 2; + num_ports /= 2; + } while (ret < 0 && num_ports > MIN_MULTIPLIER_POOL); + + if (ret < 0) + rte_exit(EXIT_FAILURE, + "Creation of socket %u mbuf pool failed: %s\n", + socket_ids[i], + rte_strerror(rte_errno)); + } - for (i = 0; i < num_sockets; i++) - mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, - socket_ids[i]); } else { - if (socket_num == UMA_NO_CONFIG) - mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, 0); - else - mbuf_pool_create(mbuf_data_size, nb_mbuf_per_pool, - socket_num); + + do { + if (socket_num == UMA_NO_CONFIG) + ret = mbuf_pool_create(mbuf_data_size, + nb_mbuf_per_pool, 0); + else + ret = mbuf_pool_create(mbuf_data_size, + nb_mbuf_per_pool, + socket_num); + nb_mbuf_per_pool /= 2; + num_ports /= 2; + } while (ret < 0 && num_ports > MIN_MULTIPLIER_POOL); + + if (ret < 0) + rte_exit(EXIT_FAILURE, + "Creation of mbuf pool for socket %u failed: %s\n", + socket_num, rte_strerror(rte_errno)); } init_port_config(); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index e00d9eb2d..50cb9c78c 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -90,6 +90,9 @@ enum { PORT_TOPOLOGY_LOOP, }; +#define MAX_MULTIPLIER_POOL 64 +#define MIN_MULTIPLIER_POOL 4 + #ifdef RTE_TEST_PMD_RECORD_BURST_STATS /** * The data structure associated with RX and TX packet burst statistics -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang ` (3 preceding siblings ...) 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 4/4] testpmd: add flexibility to mbuf allocation Zhiyong Yang @ 2017-09-09 14:47 ` Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang ` (6 more replies) 4 siblings, 7 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-09 14:47 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, david.hunt port_id is currently defined as uint8_t, which is limited to the range 0 to 255. A larger range is required for vdev scalability. It is necessary for a redefinition of port_id to extend it from 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will be changed at the same time. Discussion about port_id is the following thread. http://www.dpdk.org/dev/patchwork/patch/23208/ Changes in V2: 1. cover more PMDs to increase port_id range. 2. cover more examples to increase port_id range. 3. add 17.11 release note. Changes in V3: 1. cover mlx4 and mlx5. 2. add to increase port_id range in test code. 3. The patch "librte_mbuf: modify port initialization value" is merged into the patchset. Zhiyong Yang (4): ethdev: increase port_id range test: increase port_id range examples: increase port_id range librte_mbuf: modify port initialization value app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 ++- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 19 +- app/test-pmd/testpmd.h | 4 +- doc/guides/rel_notes/release_17_11.rst | 4 + drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.c | 4 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnx2x/elink.h | 11 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 8 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 36 ++-- drivers/net/bonding/rte_eth_bond.h | 42 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 81 ++++--- drivers/net/bonding/rte_eth_bond_8023ad.h | 44 ++-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 64 +++--- drivers/net/bonding/rte_eth_bond_private.h | 49 ++--- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 70 +++--- drivers/net/mlx4/mlx4.h | 2 +- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_rxtx.h | 2 +- drivers/net/nfp/nfp_net.c | 26 +-- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/rte_eth_vhost.c | 8 +- drivers/net/vhost/rte_eth_vhost.h | 6 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/virtio/virtio_user/virtio_user_dev.h | 2 +- drivers/net/vmxnet3/vmxnet3_ring.h | 8 +- drivers/net/xenvirt/virtqueue.h | 2 +- examples/bond/main.c | 10 +- examples/distributor/main.c | 28 +-- examples/exception_path/main.c | 39 ++-- examples/ip_fragmentation/main.c | 33 +-- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 +-- examples/ipv4_multicast/main.c | 34 +-- examples/kni/main.c | 31 +-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 +-- examples/l2fwd-keepalive/main.c | 49 ++--- examples/l2fwd/main.c | 49 ++--- examples/l3fwd-acl/main.c | 11 +- examples/l3fwd-power/main.c | 62 +++--- examples/l3fwd-vf/main.c | 53 ++--- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 17 +- examples/l3fwd/l3fwd_lpm.h | 6 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 +-- examples/link_status_interrupt/main.c | 11 +- examples/load_balancer/config.c | 21 +- examples/load_balancer/init.c | 40 ++-- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 21 +- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 14 +- examples/netmap_compat/lib/compat_netmap.c | 52 +++-- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +- examples/performance-thread/l3fwd-thread/main.c | 160 +++++++------- examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +-- examples/qos_sched/main.c | 18 +- examples/qos_sched/main.h | 24 ++- examples/qos_sched/stats.c | 16 +- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/rte_ethdev.c | 239 +++++++++++---------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++---------- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 39 ++-- lib/librte_port/rte_port_ethdev.h | 6 +- test/test/test_kni.c | 14 +- test/test/test_link_bonding.c | 42 ++-- test/test/test_link_bonding_mode4.c | 24 +-- test/test/test_pmd_perf.c | 32 +-- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 +-- test/test/virtual_pmd.h | 28 +-- 140 files changed, 1462 insertions(+), 1415 deletions(-) -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang @ 2017-09-09 14:47 ` Zhiyong Yang 2017-09-11 9:37 ` Adrien Mazarguil 2017-09-11 10:21 ` Ferruh Yigit 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 2/4] test: " Zhiyong Yang ` (5 subsequent siblings) 6 siblings, 2 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-09 14:47 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, david.hunt, Zhiyong Yang Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 ++- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 19 +- app/test-pmd/testpmd.h | 4 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.c | 4 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnx2x/elink.h | 11 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 8 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 36 ++-- drivers/net/bonding/rte_eth_bond.h | 42 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 81 ++++---- drivers/net/bonding/rte_eth_bond_8023ad.h | 44 ++-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 64 +++--- drivers/net/bonding/rte_eth_bond_private.h | 49 ++--- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 70 ++++--- drivers/net/mlx4/mlx4.h | 2 +- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_rxtx.h | 2 +- drivers/net/nfp/nfp_net.c | 26 +-- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/rte_eth_vhost.c | 8 +- drivers/net/vhost/rte_eth_vhost.h | 6 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/virtio/virtio_user/virtio_user_dev.h | 2 +- drivers/net/vmxnet3/vmxnet3_ring.h | 8 +- drivers/net/xenvirt/virtqueue.h | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/rte_ethdev.c | 239 +++++++++++----------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 39 ++-- lib/librte_port/rte_port_ethdev.h | 6 +- 76 files changed, 793 insertions(+), 789 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index 3b13753d9..090a50cfc 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -623,7 +623,7 @@ static void create_mp_ring_vdev(void) { int i; - uint8_t portid; + uint16_t portid; struct pdump_tuples *pt = NULL; struct rte_mempool *mbuf_pool = NULL; char vdev_args[SIZE]; diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index cd8c35850..168897e99 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4584,7 +4584,7 @@ struct cmd_show_bonding_config_result { cmdline_fixed_string_t show; cmdline_fixed_string_t bonding; cmdline_fixed_string_t config; - uint8_t port_id; + uint16_t port_id; }; static void cmd_show_bonding_config_parsed(void *parsed_result, @@ -4593,7 +4593,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, { struct cmd_show_bonding_config_result *res = parsed_result; int bonding_mode, agg_mode; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int num_slaves, num_active_slaves; int primary_id; int i; @@ -11496,7 +11496,7 @@ struct cmd_vf_vlan_stripq_result { cmdline_fixed_string_t vf; cmdline_fixed_string_t vlan; cmdline_fixed_string_t stripq; - uint8_t port_id; + uint16_t port_id; uint16_t vf_id; cmdline_fixed_string_t on_off; }; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3ae3e1cd8..155136dd5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -358,7 +358,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "RX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; @@ -391,7 +391,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "TX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 51170ee3e..66a3bf11e 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -86,12 +86,11 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index) struct timespec timestamp = {0, 0}; if (rte_eth_timesync_read_rx_timestamp(pi, ×tamp, index) < 0) { - printf("Port %u RX timestamp registers not valid\n", - (unsigned) pi); + printf("Port %u RX timestamp registers not valid\n", pi); return; } printf("Port %u RX timestamp value %lu s %lu ns\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec); + pi, timestamp.tv_sec, timestamp.tv_nsec); } #define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */ @@ -110,12 +109,12 @@ port_ieee1588_tx_timestamp_check(portid_t pi) if (wait_us >= MAX_TX_TMST_WAIT_MICROSECS) { printf("Port %u TX timestamp registers not valid after " "%u micro-seconds\n", - (unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS); + pi, MAX_TX_TMST_WAIT_MICROSECS); return; } printf("Port %u TX timestamp value %lu s %lu ns validated after " "%u micro-second%s\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, + pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, (wait_us == 1) ? "" : "s"); } @@ -148,11 +147,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type == ETHER_TYPE_1588) { printf("Port %u Received PTP packet not filtered" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); } else { printf("Port %u Received non PTP packet type=0x%4x " "len=%u\n", - (unsigned) fs->rx_port, eth_type, + fs->rx_port, eth_type, (unsigned) mb->pkt_len); } rte_pktmbuf_free(mb); @@ -161,7 +160,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type != ETHER_TYPE_1588) { printf("Port %u Received NON PTP packet incorrectly" " detected by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -175,19 +174,19 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (ptp_hdr->version != 0x02) { printf("Port %u Received PTP V2 Ethernet frame with wrong PTP" " protocol version 0x%x (should be 0x02)\n", - (unsigned) fs->rx_port, ptp_hdr->version); + fs->rx_port, ptp_hdr->version); rte_pktmbuf_free(mb); return; } if (ptp_hdr->msg_id != PTP_SYNC_MESSAGE) { printf("Port %u Received PTP V2 Ethernet frame with unexpected" " message ID 0x%x (expected 0x0 - PTP_SYNC_MESSAGE)\n", - (unsigned) fs->rx_port, ptp_hdr->msg_id); + fs->rx_port, ptp_hdr->msg_id); rte_pktmbuf_free(mb); return; } printf("Port %u IEEE1588 PTP V2 SYNC Message filtered by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); /* * Check that the received PTP packet has been timestamped by the @@ -196,7 +195,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (! (mb->ol_flags & PKT_RX_IEEE1588_TMST)) { printf("Port %u Received PTP packet not timestamped" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -216,8 +215,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) mb->ol_flags |= PKT_TX_IEEE1588_TMST; fs->tx_packets += 1; if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) { - printf("Port %u sent PTP packet dropped\n", - (unsigned) fs->rx_port); + printf("Port %u sent PTP packet dropped\n", fs->rx_port); fs->fwd_dropped += 1; rte_pktmbuf_free(mb); return; diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 2f7f70fd6..31287d71d 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -734,7 +734,7 @@ launch_args_parse(int argc, char** argv) if (!strcmp(lgopts[opt_idx].name, "nb-ports")) { n = atoi(optarg); if (n > 0 && n <= nb_ports) - nb_fwd_ports = (uint8_t) n; + nb_fwd_ports = n; else rte_exit(EXIT_FAILURE, "Invalid port %d\n", n); diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index 5ef021905..137246e88 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -122,7 +122,7 @@ pkt_burst_receive(struct fwd_stream *fs) */ if (verbose_level > 0) printf("port %u/queue %u: received %u packets\n", - (unsigned) fs->rx_port, + fs->rx_port, (unsigned) fs->rx_queue, (unsigned) nb_rx); for (i = 0; i < nb_rx; i++) { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 7d4013941..368d2313d 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -390,7 +390,7 @@ struct gro_status gro_ports[RTE_MAX_ETHPORTS]; /* Forward function declarations */ static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port); static void check_all_ports_link_status(uint32_t port_mask); -static int eth_event_callback(uint8_t port_id, +static int eth_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); @@ -673,7 +673,6 @@ init_config(void) fwd_config_setup(); } - void reconfig(portid_t new_port_id, unsigned socket_id) { @@ -1775,7 +1774,8 @@ check_all_ports_link_status(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("Checking link statuses...\n"); @@ -1790,14 +1790,13 @@ check_all_ports_link_status(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 */ @@ -1844,7 +1843,7 @@ rmv_event_callback(void *arg) /* This function is used by the interrupt thread */ static int -eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, +eth_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param) { static const char * const event_desc[] = { @@ -2287,7 +2286,7 @@ int main(int argc, char** argv) { int diag; - uint8_t port_id; + uint16_t port_id; signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index c9d7739b8..c045afd64 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -78,7 +78,7 @@ #define UMA_NO_CONFIG 0xFF typedef uint8_t lcoreid_t; -typedef uint8_t portid_t; +typedef uint16_t portid_t; typedef uint16_t queueid_t; typedef uint16_t streamid_t; @@ -283,7 +283,7 @@ enum dcb_mode_enable #define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */ struct queue_stats_mappings { - uint8_t port_id; + uint16_t port_id; uint16_t queue_id; uint8_t stats_counter_id; } __rte_cache_aligned; diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 9a47852ca..483b0c107 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -75,7 +75,7 @@ struct pkt_rx_queue { unsigned int framenum; struct rte_mempool *mb_pool; - uint8_t in_port; + uint16_t in_port; volatile unsigned long rx_pkts; volatile unsigned long err_pkts; diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 6db362b04..893284733 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -641,7 +641,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_tx_queues; i++) { status = eth_ark_tx_queue_stop(dev, i); if (status != 0) { - uint8_t port = dev->data->port_id; + uint16_t port = dev->data->port_id; PMD_DRV_LOG(ERR, "tx_queue stop anomaly" " port %u, queue %u\n", diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index c746a0e2c..b5cc955f2 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -190,7 +190,7 @@ struct avp_dev { struct rte_eth_dev_data *dev_data; /**< Back pointer to ethernet device data */ volatile uint32_t flags; /**< Device operational flags */ - uint8_t port_id; /**< Ethernet port identifier */ + uint16_t port_id; /**< Ethernet port identifier */ struct rte_mempool *pool; /**< pkt mbuf mempool */ unsigned int guest_mbuf_size; /**< local pool mbuf size */ unsigned int host_mbuf_size; /**< host mbuf size */ diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 06733d153..0765f62d7 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -703,7 +703,7 @@ bnx2x_gpio_mult_write(struct bnx2x_softc *sc, uint8_t pins, uint32_t mode) static int bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, - uint8_t port) + uint8_t port) { /* The GPIO should be swapped if swap register is set and active */ int gpio_port = ((REG_RD(sc, NIG_REG_PORT_SWAP) && @@ -749,7 +749,7 @@ bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, } uint32_t -elink_cb_gpio_read(struct bnx2x_softc * sc, uint16_t gpio_num, uint8_t port) +elink_cb_gpio_read(struct bnx2x_softc *sc, uint16_t gpio_num, uint8_t port) { return bnx2x_gpio_read(sc, gpio_num, port); } diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index 2e38ec26a..48d540476 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -41,7 +41,7 @@ struct bnx2x_rx_queue { uint16_t rx_cq_head; /**< Index of current rcq bd. */ uint16_t rx_cq_tail; /**< Index of last rcq bd. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data. */ }; @@ -62,7 +62,7 @@ struct bnx2x_tx_queue { uint16_t nb_tx_avail; /**< Number of TX descriptors available. */ uint16_t nb_tx_pages; /**< number of TX pages */ uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data */ }; diff --git a/drivers/net/bnx2x/elink.h b/drivers/net/bnx2x/elink.h index 9401b7cd5..38f504426 100644 --- a/drivers/net/bnx2x/elink.h +++ b/drivers/net/bnx2x/elink.h @@ -34,16 +34,17 @@ extern void elink_cb_reg_write(struct bnx2x_softc *sc, uint32_t reg_addr, uint32 /* mode - 0( LOW ) /1(HIGH)*/ extern uint8_t elink_cb_gpio_write(struct bnx2x_softc *sc, - uint16_t gpio_num, - uint8_t mode, uint8_t port); + uint16_t gpio_num, + uint8_t mode, uint8_t port); extern uint8_t elink_cb_gpio_mult_write(struct bnx2x_softc *sc, uint8_t pins, uint8_t mode); extern uint32_t elink_cb_gpio_read(struct bnx2x_softc *sc, uint16_t gpio_num, uint8_t port); + extern uint8_t elink_cb_gpio_int_write(struct bnx2x_softc *sc, - uint16_t gpio_num, - uint8_t mode, uint8_t port); + uint16_t gpio_num, + uint8_t mode, uint8_t port); extern uint32_t elink_cb_fw_command(struct bnx2x_softc *sc, uint32_t command, uint32_t param); @@ -500,7 +501,7 @@ elink_status_t elink_phy_probe(struct elink_params *params); /* Checks if fan failure detection is required on one of the phys on board */ uint8_t elink_fan_failure_det_req(struct bnx2x_softc *sc, uint32_t shmem_base, - uint32_t shmem2_base, uint8_t port); + uint32_t shmem2_base, uint8_t port); /* Open / close the gate between the NIG and the BRB */ void elink_set_rx_filter(struct elink_params *params, uint8_t en); diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 405d94deb..26a9018b5 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -126,7 +126,7 @@ struct bnxt_pf_info { #define BNXT_FIRST_VF_FID 128 #define BNXT_PF_RINGS_USED(bp) bnxt_get_num_queues(bp) #define BNXT_PF_RINGS_AVAIL(bp) (bp->pf.max_cp_rings - BNXT_PF_RINGS_USED(bp)) - uint8_t port_id; + uint16_t port_id; uint16_t first_vf_id; uint16_t active_vfs; uint16_t max_vfs; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index c9d11228b..d8face1bc 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -488,14 +488,14 @@ static void bnxt_print_link_info(struct rte_eth_dev *eth_dev) struct rte_eth_link *link = ð_dev->data->dev_link; if (link->link_status) - RTE_LOG(INFO, PMD, "Port %d Link Up - speed %u Mbps - %s\n", - (uint8_t)(eth_dev->data->port_id), + RTE_LOG(INFO, PMD, "Port %u Link Up - speed %u Mbps - %s\n", + eth_dev->data->port_id, (uint32_t)link->link_speed, (link->link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex\n")); else - RTE_LOG(INFO, PMD, "Port %d Link Down\n", - (uint8_t)(eth_dev->data->port_id)); + RTE_LOG(INFO, PMD, "Port %u Link Down\n", + eth_dev->data->port_id); } static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev) diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h index 01aaa007f..cea0785d1 100644 --- a/drivers/net/bnxt/bnxt_rxq.h +++ b/drivers/net/bnxt/bnxt_rxq.h @@ -48,7 +48,7 @@ struct bnxt_rx_queue { uint16_t rx_free_thresh; /* max free RX desc to hold */ uint16_t queue_id; /* RX queue index */ uint16_t reg_idx; /* RX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ struct bnxt *bp; diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h index 16f3a0bdd..f753c10f2 100644 --- a/drivers/net/bnxt/bnxt_txq.h +++ b/drivers/net/bnxt/bnxt_txq.h @@ -46,7 +46,7 @@ struct bnxt_tx_queue { uint16_t tx_next_rs; /* next desc to set RS bit */ uint16_t queue_id; /* TX queue index */ uint16_t reg_idx; /* TX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t pthresh; /* Prefetch threshold register */ uint8_t hthresh; /* Host threshold register */ uint8_t wthresh; /* Write-back threshold reg */ diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c343d9033..63fc27911 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -67,7 +67,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) true : false; } -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -108,7 +108,7 @@ rte_pmd_bnxt_set_all_queues_drop_en_cb(struct bnxt_vnic_info *vnic, void *onptr) vnic->bd_stall = !(*on); } -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -159,7 +159,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -191,7 +191,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *eth_dev; @@ -241,7 +241,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -294,7 +294,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -350,7 +350,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq_cb(struct bnxt_vnic_info *vnic, void *onptr) } int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -385,7 +385,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -477,7 +477,7 @@ static int bnxt_set_vf_table(struct bnxt *bp, uint16_t vf) return rc; } -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct bnxt_vlan_table_entry *ve; @@ -570,7 +570,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, return rc; } -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -598,7 +598,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, return bnxt_hwrm_func_qstats(bp, bp->pf.first_vf_id + vf_id, stats); } -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -625,7 +625,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, return bnxt_hwrm_func_clr_stats(bp, bp->pf.first_vf_id + vf_id); } -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -651,7 +651,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) return bnxt_vf_vnic_count(bp, vf_id); } -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count) { struct rte_eth_dev *dev; @@ -679,7 +679,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, count); } -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr, uint32_t vf_id) { struct rte_eth_dev *dev; @@ -756,7 +756,7 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, } int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -793,7 +793,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h index c4c4770e3..548e5b3e5 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.h +++ b/drivers/net/bnxt/rte_pmd_bnxt.h @@ -78,7 +78,7 @@ struct rte_pmd_bnxt_mb_event_param { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set the VF MAC address. @@ -94,7 +94,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -115,7 +115,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -134,8 +134,8 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, - uint16_t vlan_id); +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, + uint16_t vlan_id); /** * Enable/Disable hardware VF VLAN filtering by an Ethernet device of @@ -156,7 +156,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); /** @@ -173,7 +173,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -189,7 +189,7 @@ int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * Set the VF rate limit. @@ -207,7 +207,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); /** @@ -226,7 +226,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -242,7 +242,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -261,7 +261,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set RX L2 Filtering mode of a VF of an Ethernet device. @@ -280,7 +280,7 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); /** @@ -297,7 +297,7 @@ int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, * - (-ENOMEM) on an allocation failure * - (-1) firmware interface error */ -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id); /** * Queries the TX drop counter for the function @@ -313,7 +313,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); * - (-EINVAL) invalid vf_id specified. * - (-ENOTSUP) Ethernet device is not a PF */ -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count); /** @@ -331,8 +331,8 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, * - (-ENOTSUP) Ethernet device is not a PF * - (-ENOMEM) on an allocation failure */ -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, - uint32_t vf_id); +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, + uint32_t vf_id); /** * Enable/Disable VF statistics retention @@ -350,5 +350,5 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on); #endif /* _PMD_BNXT_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 8efbf0713..36b4e0643 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -151,7 +151,7 @@ rte_eth_bond_free(const char *name); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Remove a slave rte_eth_dev device from the bonded device @@ -163,7 +163,7 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Set link bonding mode of bonded device @@ -175,7 +175,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode); /** * Get link bonding mode of bonded device @@ -186,7 +186,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); * link bonding mode on success, negative value otherwise */ int -rte_eth_bond_mode_get(uint8_t bonded_port_id); +rte_eth_bond_mode_get(uint16_t bonded_port_id); /** * Set slave rte_eth_dev as primary slave of bonded device @@ -198,7 +198,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Get primary slave of bonded device @@ -209,7 +209,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); * Port Id of primary slave on success, -1 on failure */ int -rte_eth_bond_primary_get(uint8_t bonded_port_id); +rte_eth_bond_primary_get(uint16_t bonded_port_id); /** * Populate an array with list of the slaves port id's of the bonded device @@ -223,7 +223,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id); * negative value otherwise */ int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Populate an array with list of the active slaves port id's of the bonded @@ -238,8 +239,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); * negative value otherwise */ int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len); +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Set explicit MAC address to use on bonded device and it's slaves. @@ -252,7 +253,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr); /** @@ -265,7 +266,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id); /** * Set the transmit policy for bonded device to use when it is operating in @@ -279,7 +280,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy); /** * Get the transmit policy set on bonded device for balance mode operation @@ -290,7 +291,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); * Balance transmit policy on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of @@ -304,7 +305,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); */ int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link @@ -316,8 +317,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); * Monitoring interval on success, negative value otherwise. */ int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); - +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the disabling of a bonded link @@ -330,7 +330,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the disabling of a bonded @@ -342,7 +343,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the enabling of a bonded link @@ -355,7 +356,8 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the enabling of a bonded @@ -367,7 +369,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); #ifdef __cplusplus diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 20b5a8961..1ca43b60c 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -209,7 +209,7 @@ set_warning_flags(struct port *port, uint16_t flags) } static void -show_warnings(uint8_t slave_id) +show_warnings(uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; uint8_t warnings; @@ -278,7 +278,7 @@ record_default(struct port *port) * @param port Port on which LACPDU was received. */ static void -rx_machine(struct bond_dev_private *internals, uint8_t slave_id, +rx_machine(struct bond_dev_private *internals, uint16_t slave_id, struct lacpdu *lacp) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -399,7 +399,7 @@ rx_machine(struct bond_dev_private *internals, uint8_t slave_id, * @param port Port to handle state machine. */ static void -periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) +periodic_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; /* Calculate if either site is LACP enabled */ @@ -461,7 +461,7 @@ periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port Port to handle state machine. */ static void -mux_machine(struct bond_dev_private *internals, uint8_t slave_id) +mux_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; @@ -511,7 +511,6 @@ mux_machine(struct bond_dev_private *internals, uint8_t slave_id) ACTOR_STATE_CLR(port, SYNCHRONIZATION); MODE4_DEBUG("Out of sync -> ATTACHED\n"); } - if (!ACTOR_STATE(port, SYNCHRONIZATION)) { /* attach mux to aggregator */ RTE_ASSERT((port->actor_state & (STATE_COLLECTING | @@ -564,7 +563,7 @@ mux_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port */ static void -tx_machine(struct bond_dev_private *internals, uint8_t slave_id) +tx_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -685,11 +684,11 @@ max_index(uint64_t *a, int n) * @param port_pos Port to assign. */ static void -selection_logic(struct bond_dev_private *internals, uint8_t slave_id) +selection_logic(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port; - uint8_t slaves_count, new_agg_id, i, j = 0; - uint8_t *slaves; + uint8_t slaves_count, i, j = 0; + uint16_t *slaves, new_agg_id; uint64_t agg_bandwidth[8] = {0}; uint64_t agg_count[8] = {0}; uint8_t default_slave = 0; @@ -923,7 +922,8 @@ bond_mode_8023ad_periodic_cb(void *arg) } void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) +bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; @@ -951,7 +951,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) memcpy(&port->actor, &initial, sizeof(struct port_params)); /* Standard requires that port ID must be grater than 0. * Add 1 do get corresponding port_number */ - port->actor.port_number = rte_cpu_to_be_16((uint16_t)slave_id + 1); + port->actor.port_number = rte_cpu_to_be_16(slave_id + 1); memcpy(&port->partner, &initial, sizeof(struct port_params)); @@ -1022,12 +1022,12 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) int bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev, - uint8_t slave_id) + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; void *pkt = NULL; struct port *port; - uint8_t i; + uint16_t i; /* Given slave must be in active list */ RTE_ASSERT(find_slave_by_id(internals->active_slaves, @@ -1066,7 +1066,7 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) struct bond_dev_private *internals = bond_dev->data->dev_private; struct ether_addr slave_addr; struct port *slave, *agg_slave; - uint8_t slave_id, i, j; + uint16_t slave_id, i, j; bond_mode_8023ad_stop(bond_dev); @@ -1277,7 +1277,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev) void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt) + uint16_t slave_id, struct rte_mbuf *pkt) { struct mode8023ad_private *mode4 = &internals->mode4; struct port *port = &mode_8023ad_ports[slave_id]; @@ -1358,7 +1358,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, +rte_eth_bond_8023ad_conf_get_v20(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1376,7 +1376,7 @@ rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v20, 2.0); int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, +rte_eth_bond_8023ad_conf_get_v1607(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1394,7 +1394,7 @@ rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1607, 16.07); int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, +rte_eth_bond_8023ad_conf_get_v1708(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1409,13 +1409,13 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, bond_mode_8023ad_conf_get_v1708(bond_dev, conf); return 0; } -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_conf_get(uint8_t port_id, +MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf), rte_eth_bond_8023ad_conf_get_v1708); BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1708, 17.08); int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection) { struct rte_eth_dev *bond_dev; @@ -1437,7 +1437,7 @@ rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, return 0; } -int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) +int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1458,7 +1458,7 @@ int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) static int -bond_8023ad_setup_validate(uint8_t port_id, +bond_8023ad_setup_validate(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { if (valid_bonded_port_id(port_id) != 0) @@ -1483,7 +1483,7 @@ bond_8023ad_setup_validate(uint8_t port_id, } int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, +rte_eth_bond_8023ad_setup_v20(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1501,7 +1501,7 @@ rte_eth_bond_8023ad_setup_v20(uint8_t port_id, VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v20, 2.0); int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, +rte_eth_bond_8023ad_setup_v1607(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1520,7 +1520,7 @@ VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v1607, 16.07); int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, +rte_eth_bond_8023ad_setup_v1708(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1536,17 +1536,12 @@ rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, return 0; } BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, +MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf), rte_eth_bond_8023ad_setup_v1708); - - - - - int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *info) { struct rte_eth_dev *bond_dev; @@ -1579,7 +1574,7 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, } static int -bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) +bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1607,7 +1602,8 @@ bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1622,12 +1618,13 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) ACTOR_STATE_SET(port, COLLECTING); else ACTOR_STATE_CLR(port, COLLECTING); - + printf("enabled port->actor_state = %d \r\n", port->actor_state); return 0; } int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1647,7 +1644,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) } int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1661,7 +1658,7 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1675,8 +1672,8 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, - struct rte_mbuf *lacp_pkt) +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, + struct rte_mbuf *lacp_pkt) { struct port *port; int res; @@ -1736,7 +1733,7 @@ bond_mode_8023ad_ext_periodic_cb(void *arg) } int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; @@ -1760,7 +1757,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) } int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 1d353c734..6d36e8300 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -64,7 +64,7 @@ extern "C" { #define MARKER_TLV_TYPE_INFO 0x01 #define MARKER_TLV_TYPE_RESP 0x02 -typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint8_t slave_id, +typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t slave_id, struct rte_mbuf *lacp_pkt); enum rte_bond_8023ad_selection { @@ -176,7 +176,7 @@ struct rte_eth_bond_8023ad_slave_info { struct port_params actor; uint8_t partner_state; struct port_params partner; - uint8_t agg_port_id; + uint16_t agg_port_id; }; /** @@ -192,16 +192,16 @@ struct rte_eth_bond_8023ad_slave_info { * -EINVAL if conf is NULL */ int -rte_eth_bond_8023ad_conf_get(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, +rte_eth_bond_8023ad_conf_get_v20(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, +rte_eth_bond_8023ad_conf_get_v1607(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, +rte_eth_bond_8023ad_conf_get_v1708(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -216,16 +216,16 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, * -EINVAL if configuration is invalid. */ int -rte_eth_bond_8023ad_setup(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, +rte_eth_bond_8023ad_setup_v20(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, +rte_eth_bond_8023ad_setup_v1607(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, +rte_eth_bond_8023ad_setup_v1708(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -241,7 +241,7 @@ rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, * bonded device or is not inactive). */ int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *conf); #ifdef __cplusplus @@ -259,7 +259,8 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get COLLECTING flag from slave port actor state. @@ -272,7 +273,7 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id); /** * Configure a slave port to start distributing. @@ -285,7 +286,8 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get DISTRIBUTING flag from slave port actor state. @@ -298,7 +300,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id); /** * LACPDU transmit path for external 802.3ad state machine. Caller retains @@ -312,8 +314,8 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, - struct rte_mbuf *lacp_pkt); +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, + struct rte_mbuf *lacp_pkt); /** * Enable dedicated hw queues for 802.3ad control plane traffic on on slaves @@ -338,7 +340,7 @@ rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id); /** * Disable slow queue on slaves @@ -355,7 +357,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); * */ int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port_id); /* * Get aggregator mode for 8023ad @@ -365,7 +367,7 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); * agregator mode on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); +rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id); /** * Set aggregator mode for 8023ad @@ -374,6 +376,6 @@ rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h index d46e44a84..9ee5ca23d 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h @@ -279,7 +279,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *dev); */ void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt); + uint16_t slave_id, struct rte_mbuf *pkt); /** * @internal @@ -293,7 +293,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, * 0 on success, negative value otherwise. */ void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); +bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint16_t port_id); /** * @internal @@ -307,7 +307,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); * 0 on success, negative value otherwise. */ int -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint8_t slave_pos); +bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint16_t slave_pos); /** * Updates state when MAC was changed on bonded device or one of its slaves. @@ -318,12 +318,12 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev); int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port); + uint16_t slave_port); int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port); +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port); int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id); +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index d9d37495d..f7efbb78e 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -148,7 +148,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, rte_spinlock_unlock(&internals->mode6.lock); } -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals) { @@ -220,13 +220,13 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, return internals->current_primary_port; } -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals) { struct ether_hdr *eth_h; struct arp_hdr *arp_h; - uint8_t slave_idx; + uint16_t slave_idx; rte_spinlock_lock(&internals->mode6.lock); eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h index fd7c3aeb4..9f17f7c85 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.h +++ b/drivers/net/bonding/rte_eth_bond_alb.h @@ -51,7 +51,7 @@ struct client_data { uint32_t cli_ip; /**< Client IP address */ - uint8_t slave_idx; + uint16_t slave_idx; /**< Index of slave on which we connect with that client */ uint8_t in_use; /**< Flag indicating if entry in client table is currently used */ @@ -113,7 +113,7 @@ bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slave on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals); @@ -127,7 +127,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slawe on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals); diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index de1d9e0db..957390f71 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -56,14 +56,14 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) } int -valid_bonded_port_id(uint8_t port_id) +valid_bonded_port_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return check_for_bonded_ethdev(&rte_eth_devices[port_id]); } int -valid_slave_port_id(uint8_t port_id, uint8_t mode) +valid_slave_port_id(uint16_t port_id, uint8_t mode) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); @@ -80,7 +80,7 @@ valid_slave_port_id(uint8_t port_id, uint8_t mode) } void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -107,11 +107,11 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) } void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { - uint8_t slave_pos; + uint16_t slave_pos; struct bond_dev_private *internals = eth_dev->data->dev_private; - uint8_t active_count = internals->active_slave_count; + uint16_t active_count = internals->active_slave_count; if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_stop(eth_dev); @@ -153,7 +153,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) { struct bond_dev_private *internals; char devargs[52]; - uint8_t port_id; + uint16_t port_id; int ret; if (name == NULL) { @@ -193,7 +193,7 @@ rte_eth_bond_free(const char *name) } static int -slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) +slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -233,7 +233,7 @@ slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev; struct bond_dev_private *internals; @@ -363,7 +363,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -387,7 +387,8 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_remove_lock_free(uint16_t bonded_port_id, + uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -466,7 +467,7 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -488,7 +489,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) { if (valid_bonded_port_id(bonded_port_id) != 0) return -1; @@ -497,7 +498,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) } int -rte_eth_bond_mode_get(uint8_t bonded_port_id) +rte_eth_bond_mode_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -510,7 +511,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id) } int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct bond_dev_private *internals; @@ -531,7 +532,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_primary_get(uint8_t bonded_port_id) +rte_eth_bond_primary_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -547,7 +548,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id) } int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; uint8_t i; @@ -570,8 +572,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) } int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len) +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; @@ -586,13 +588,14 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], if (internals->active_slave_count > len) return -1; - memcpy(slaves, internals->active_slaves, internals->active_slave_count); + memcpy(slaves, internals->active_slaves, + internals->active_slave_count * sizeof(internals->active_slaves[0])); return internals->active_slave_count; } int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *bonded_eth_dev; @@ -618,7 +621,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, } int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -647,7 +650,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) } int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) { struct bond_dev_private *internals; @@ -677,7 +680,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) } int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -690,7 +693,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms) { struct bond_dev_private *internals; @@ -704,7 +707,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) } int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -717,7 +720,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms) { struct bond_dev_private *internals; @@ -732,7 +736,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -745,7 +749,7 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; @@ -760,7 +764,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index bb634c62e..04d1f4e8f 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -153,7 +153,7 @@ bond_ethdev_parse_slave_port_kvarg(const char *key, return -1; } else slave_ports->slaves[slave_ports->slave_count++] = - (uint8_t)port_id; + port_id; } return 0; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 3ee70baa0..2fea9423f 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -174,7 +174,7 @@ const struct rte_flow_attr flow_attr_8023ad = { int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port) { + uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); @@ -202,12 +202,12 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, } int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { struct rte_eth_dev *bond_dev = &rte_eth_devices[port_id]; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); struct rte_eth_dev_info bond_info, slave_info; - uint8_t idx; + uint16_t idx; /* Verify if all slaves in bonding supports flow director and */ if (internals->slave_count > 0) { @@ -230,7 +230,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { } int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port) { +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) @@ -270,10 +270,10 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; struct bond_dev_private *internals = bd_rx_q->dev_private; uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count; - uint8_t i, idx; + uint16_t i, idx; /* Copy slave list to protect against slave up/down changes during tx * bursting */ @@ -302,8 +302,8 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -394,8 +394,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW); uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count, idx; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count, idx; uint8_t collecting; /* current slave collecting status */ const uint8_t promisc = internals->promiscuous_en; @@ -673,8 +673,8 @@ bond_ethdev_tx_burst_round_robin(void *queue, struct rte_mbuf **bufs, struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts]; uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] = { 0 }; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave; @@ -904,7 +904,7 @@ bandwidth_cmp(const void *a, const void *b) } static void -bandwidth_left(uint8_t port_id, uint64_t load, uint8_t update_idx, +bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx, struct bwg_slave *bwg_slave) { struct rte_eth_link link_status; @@ -970,10 +970,10 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct rte_eth_dev *primary_port = &rte_eth_devices[internals->primary_port]; uint16_t num_tx_total = 0; - uint8_t i, j; + uint16_t i, j; - uint8_t num_of_slaves = internals->active_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves = internals->active_slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct ether_hdr *ether_hdr; struct ether_addr primary_slave_addr; @@ -1059,7 +1059,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t num_send, num_not_send = 0; uint16_t num_tx_total = 0; - uint8_t slave_idx; + uint16_t slave_idx; int i, j; @@ -1178,8 +1178,8 @@ bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave = 0, tx_fail_total = 0; @@ -1239,8 +1239,8 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -1333,7 +1333,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs, struct bond_tx_queue *bd_tx_q; uint8_t tx_failed_flag = 0, num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t max_nb_of_tx_pkts = 0; @@ -1861,7 +1861,7 @@ slave_add(struct bond_dev_private *internals, void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id) + uint16_t slave_port_id) { int i; @@ -2125,7 +2125,7 @@ static int bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { int res; - uint8_t i; + uint16_t i; struct bond_dev_private *internals = dev->data->dev_private; /* don't do this while a slave is being added */ @@ -2137,7 +2137,7 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) rte_bitmap_clear(internals->vlan_filter_bmp, vlan_id); for (i = 0; i < internals->slave_count; i++) { - uint8_t port_id = internals->slaves[i].port_id; + uint16_t port_id = internals->slaves[i].port_id; res = rte_eth_dev_vlan_filter(port_id, vlan_id, on); if (res == ENOTSUP) @@ -2277,7 +2277,7 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) static int bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) { - void (*link_update)(uint8_t port_id, struct rte_eth_link *eth_link); + void (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); struct bond_dev_private *bond_ctx; struct rte_eth_link slave_link; @@ -2466,8 +2466,8 @@ bond_ethdev_delayed_lsc_propagation(void *arg) } int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, - void *param, void *ret_param __rte_unused) +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, + void *param, void *ret_param __rte_unused) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -2951,7 +2951,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) struct bond_dev_private *internals = dev->data->dev_private; struct rte_kvargs *kvlist = internals->kvlist; int arg_count; - uint8_t port_id = dev - rte_eth_devices; + uint16_t port_id = dev - rte_eth_devices; uint8_t agg_mode; static const uint8_t default_rss_key[40] = { @@ -3086,7 +3086,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Parse/set primary slave port id*/ arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); if (arg_count == 1) { - uint8_t primary_slave_port_id; + uint16_t primary_slave_port_id; if (rte_kvargs_process(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG, @@ -3099,7 +3099,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } /* Set balance mode transmit policy*/ - if (rte_eth_bond_primary_set(port_id, (uint8_t)primary_slave_port_id) + if (rte_eth_bond_primary_set(port_id, primary_slave_port_id) != 0) { RTE_LOG(ERR, EAL, "Failed to set primary slave port %d on bonded device %s\n", diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 1fe6ff880..ec604875e 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -93,12 +93,12 @@ struct bond_tx_queue { /** Bonded slave devices structure */ struct bond_ethdev_slave_ports { - uint8_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ - uint8_t slave_count; /**< Number of slaves */ + uint16_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ + uint16_t slave_count; /**< Number of slaves */ }; struct bond_slave_details { - uint8_t port_id; + uint16_t port_id; uint8_t link_status_poll_enabled; uint8_t link_status_wait_to_complete; @@ -114,14 +114,14 @@ typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count) /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { - uint8_t port_id; /**< Port Id of Bonded Port */ - uint8_t mode; /**< Link Bonding Mode */ + uint16_t port_id; /**< Port Id of Bonded Port */ + uint8_t mode; /**< Link Bonding Mode */ rte_spinlock_t lock; - uint8_t primary_port; /**< Primary Slave Port */ - uint8_t current_primary_port; /**< Primary Slave Port */ - uint8_t user_defined_primary_port; + uint16_t primary_port; /**< Primary Slave Port */ + uint16_t current_primary_port; /**< Primary Slave Port */ + uint16_t user_defined_primary_port; /**< Flag for whether primary port is user defined or not */ uint8_t balance_xmit_policy; @@ -144,16 +144,17 @@ struct bond_dev_private { uint16_t nb_rx_queues; /**< Total number of rx queues */ uint16_t nb_tx_queues; /**< Total number of tx queues*/ - uint8_t active_slave; /**< Next active_slave to poll */ - uint8_t active_slave_count; /**< Number of active slaves */ - uint8_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ + uint16_t active_slave; /**< Next active_slave to poll */ + uint16_t active_slave_count; /**< Number of active slaves */ + uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ - uint8_t slave_count; /**< Number of bonded slaves */ + uint16_t slave_count; /**< Number of bonded slaves */ struct bond_slave_details slaves[RTE_MAX_ETHPORTS]; /**< Arary of bonded slaves details */ struct mode8023ad_private mode4; - uint8_t tlb_slaves_order[RTE_MAX_ETHPORTS]; /* TLB active slaves send order */ + /**< TLB active slaves send order */ + uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS]; struct mode_alb_private mode6; uint32_t rx_offload_capa; /** Rx offload capability */ @@ -186,10 +187,10 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); /* Search given slave array to find position of given id. * Return slave pos or slaves_count if not found. */ -static inline uint8_t -find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { +static inline uint16_t +find_slave_by_id(uint16_t *slaves, uint16_t slaves_count, uint16_t slave_id) { - uint8_t pos; + uint16_t pos; for (pos = 0; pos < slaves_count; pos++) { if (slave_id == slaves[pos]) break; @@ -199,19 +200,19 @@ find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { } int -valid_port_id(uint8_t port_id); +valid_port_id(uint16_t port_id); int -valid_bonded_port_id(uint8_t port_id); +valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(uint8_t port_id, uint8_t mode); +valid_slave_port_id(uint16_t port_id, uint8_t mode); void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void link_properties_set(struct rte_eth_dev *bonded_eth_dev, @@ -255,11 +256,11 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count); void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id); + uint16_t slave_port_id); int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, - void *param, void *ret_param); +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, + void *param, void *ret_param); int bond_ethdev_parse_slave_port_kvarg(const char *key, diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 3d4ab9368..a59947d78 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1624,7 +1624,7 @@ eth_em_interrupt_action(struct rte_eth_dev *dev, rte_em_dev_atomic_read_link_status(dev, &link); if (link.link_status) { PMD_INIT_LOG(INFO, " Port %d: Link Up - speed %u Mbps - %s", - dev->data->port_id, (unsigned)link.link_speed, + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); } else { diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 31819c5bd..06ba68e39 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -119,7 +119,7 @@ struct em_rx_queue { uint16_t nb_rx_hold; /**< number of held free RX desc. */ uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -186,7 +186,7 @@ struct em_tx_queue { /** Total number of TX descriptors ready to be allocated. */ uint16_t nb_tx_free; uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 1c80a2a1b..a800d9c2b 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -122,7 +122,7 @@ struct igb_rx_queue { uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -191,7 +191,7 @@ struct igb_tx_queue { /**< Index of first used TX descriptor. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index a3a8cce95..1c8a9337e 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -400,7 +400,7 @@ failsafe_eth_dev_state_sync(struct rte_eth_dev *dev) } int -failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_rmv_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { @@ -419,7 +419,7 @@ failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, } int -failsafe_eth_lsc_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 0361cf434..4ae6e6c5f 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -180,10 +180,10 @@ int failsafe_eal_uninit(struct rte_eth_dev *dev); int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev); void failsafe_dev_remove(struct rte_eth_dev *dev); -int failsafe_eth_rmv_event_callback(uint8_t port_id, +int failsafe_eth_rmv_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *arg, void *out); -int failsafe_eth_lsc_event_callback(uint8_t port_id, +int failsafe_eth_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *out); diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h index 8e1a95062..060982b10 100644 --- a/drivers/net/fm10k/fm10k.h +++ b/drivers/net/fm10k/fm10k.h @@ -204,7 +204,7 @@ struct fm10k_rx_queue { uint16_t rxrearm_nb; /* number of remaining to be re-armed */ uint16_t rxrearm_start; /* the idx we start the re-arming from */ uint16_t rx_using_sse; /* indicates that vector RX is in use */ - uint8_t port_id; + uint16_t port_id; uint8_t drop_en; uint8_t rx_deferred_start; /* don't start this queue in dev start. */ uint16_t rx_ftag_en; /* indicates FTAG RX supported */ @@ -241,7 +241,7 @@ struct fm10k_tx_queue { volatile uint32_t *tail_ptr; uint32_t txq_flags; /* Holds flags for this TXq */ uint16_t nb_desc; - uint8_t port_id; + uint16_t port_id; uint8_t tx_deferred_start; /** don't start this queue in dev start. */ uint16_t queue_id; uint16_t tx_ftag_en; /* indicates FTAG TX supported */ @@ -289,7 +289,7 @@ static inline uint16_t fifo_remove(struct fifo *fifo) } static inline void -fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint8_t in_port) +fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint16_t in_port) { rte_mbuf_refcnt_set(mb, 1); mb->next = NULL; diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 5f26e24a3..d17d7497f 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1918,8 +1918,9 @@ i40e_dev_start(struct rte_eth_dev *dev) hw->adapter_stopped = 0; if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; autonegotiation disabled", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, autonegotiation disabled", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index 20084d649..ff2ab8575 100644 --- a/drivers/net/i40e/i40e_rxtx.h +++ b/drivers/net/i40e/i40e_rxtx.h @@ -121,7 +121,7 @@ struct i40e_rx_queue { uint16_t rxrearm_start; /**< the idx we start the re-arming from */ uint64_t mbuf_initializer; /**< value to init mbufs */ - uint8_t port_id; /**< device port ID */ + uint16_t port_id; /**< device port ID */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise */ uint16_t queue_id; /**< RX queue index */ uint16_t reg_idx; /**< RX queue register index */ @@ -167,7 +167,7 @@ struct i40e_tx_queue { uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; uint32_t txq_flags; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index f12b7f4a1..3728d39b9 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -41,7 +41,7 @@ #include "rte_pmd_i40e.h" int -rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) +rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -66,7 +66,7 @@ rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) } int -rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -170,7 +170,7 @@ i40e_add_rm_all_vlan_filter(struct i40e_vsi *vsi, uint8_t add) } int -rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -430,7 +430,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on) } int -rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -473,7 +473,7 @@ rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -514,7 +514,7 @@ rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -555,7 +555,7 @@ rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr) { struct i40e_mac_filter *f; @@ -598,7 +598,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, /* Set vlan strip on/off for specific VF from host */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -633,7 +633,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) return ret; } -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -698,7 +698,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; @@ -764,7 +764,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on) +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -858,7 +858,7 @@ i40e_vlan_filter_count(struct i40e_vsi *vsi) return count; } -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -941,7 +941,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, } int -rte_pmd_i40e_get_vf_stats(uint8_t port, +rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -986,7 +986,7 @@ rte_pmd_i40e_get_vf_stats(uint8_t port, } int -rte_pmd_i40e_reset_vf_stats(uint8_t port, +rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -1020,7 +1020,7 @@ rte_pmd_i40e_reset_vf_stats(uint8_t port, } int -rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) +rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1109,7 +1109,7 @@ rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) } int -rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight) { struct rte_eth_dev *dev; @@ -1223,7 +1223,7 @@ rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw) { struct rte_eth_dev *dev; @@ -1341,7 +1341,7 @@ rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map) +rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1513,7 +1513,7 @@ i40e_add_rm_profile_info(struct i40e_hw *hw, uint8_t *profile_info_sec) /* Check if the profile info exists */ static int -i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) +i40e_check_profile_info(uint16_t port, uint8_t *profile_info_sec) { struct rte_eth_dev *dev = &rte_eth_devices[port]; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1557,7 +1557,7 @@ i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) } int -rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op) { @@ -1863,7 +1863,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg_buff, uint32_t pkg_size, } int -rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size) +rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size) { struct rte_eth_dev *dev; struct i40e_hw *hw; @@ -1991,7 +1991,7 @@ static int check_invalid_ptype_mapping( int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive) @@ -2027,7 +2027,7 @@ rte_pmd_i40e_ptype_mapping_update( return 0; } -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port) { struct rte_eth_dev *dev; @@ -2044,7 +2044,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) } int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -2078,7 +2078,7 @@ int rte_pmd_i40e_ptype_mapping_get( return 0; } -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type) diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h index 356fa89d7..7f32a59b1 100644 --- a/drivers/net/i40e/rte_pmd_i40e.h +++ b/drivers/net/i40e/rte_pmd_i40e.h @@ -157,7 +157,7 @@ struct rte_pmd_i40e_ptype_mapping { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); +int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf); /** * Enable/Disable VF MAC anti spoofing. @@ -174,7 +174,7 @@ int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -193,7 +193,7 @@ int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -210,7 +210,7 @@ int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_tx_loopback(uint8_t port, +int rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on); /** @@ -228,7 +228,7 @@ int rte_pmd_i40e_set_tx_loopback(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -247,7 +247,7 @@ int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -271,7 +271,7 @@ int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr); /** @@ -291,7 +291,7 @@ int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, * - (-EINVAL) if bad parameter. */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -309,7 +309,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id); /** @@ -328,7 +328,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on); /** @@ -347,7 +347,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on); /** * Enable/Disable VF VLAN filter @@ -368,7 +368,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on); /** @@ -393,7 +393,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_vf_stats(uint8_t port, +int rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -409,7 +409,7 @@ int rte_pmd_i40e_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_reset_vf_stats(uint8_t port, +int rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -434,7 +434,7 @@ int rte_pmd_i40e_reset_vf_stats(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw); @@ -459,7 +459,7 @@ int rte_pmd_i40e_set_vf_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, +int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight); @@ -484,7 +484,7 @@ int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw); @@ -502,7 +502,7 @@ int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); +int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map); /** * Load/Unload a ddp package @@ -523,7 +523,7 @@ int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); * - (-EACCES) if profile does not exist. * - (-ENOTSUP) if operation not supported. */ -int rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op); @@ -561,7 +561,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); +int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size); /** * Update hardware defined ptype to software defined packet type @@ -581,7 +581,7 @@ int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); * set other PTYPEs maps to PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive); @@ -593,7 +593,7 @@ int rte_pmd_i40e_ptype_mapping_update( * @param port * pointer to port identifier of the device */ -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port); /** * Get hardware defined ptype to software defined ptype @@ -612,7 +612,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -632,7 +632,7 @@ int rte_pmd_i40e_ptype_mapping_get( * @param pkt_type * the new packet type to overwrite */ -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 22171d866..c5e039886 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2504,8 +2504,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev) * - fixed speed: TODO implement */ if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; fix speed not supported", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, fix speed not supported", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 85feb0bdc..176c9d4a2 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -148,7 +148,7 @@ struct ixgbe_rx_queue { uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ uint16_t pkt_type_mask; /**< Packet type mask for different NICs. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise. */ uint8_t drop_en; /**< If not 0, set SRRCTL.Drop_En. */ uint8_t rx_deferred_start; /**< not in global dev start. */ @@ -237,7 +237,7 @@ struct ixgbe_tx_queue { uint16_t tx_next_rs; /**< next desc to set RS bit */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 79897ff64..f12737857 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -38,7 +38,7 @@ #include "rte_pmd_ixgbe.h" int -rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct ixgbe_hw *hw; @@ -73,7 +73,7 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) +rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf) { struct ixgbe_hw *hw; struct ixgbe_vf_info *vfinfo; @@ -105,7 +105,7 @@ rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) } int -rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -135,7 +135,7 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -164,7 +164,7 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) +rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -200,7 +200,7 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) } int -rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -230,7 +230,7 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -260,7 +260,7 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -295,7 +295,7 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -342,7 +342,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { int val = 0; @@ -389,7 +389,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -439,7 +439,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -489,7 +489,7 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct rte_eth_dev *dev; @@ -524,7 +524,7 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, } int -rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *dev; @@ -540,7 +540,7 @@ rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) +rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -623,7 +623,7 @@ rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) } int -rte_pmd_ixgbe_macsec_disable(uint8_t port) +rte_pmd_ixgbe_macsec_disable(uint16_t port) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -687,7 +687,7 @@ rte_pmd_ixgbe_macsec_disable(uint8_t port) } int -rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) +rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -712,7 +712,7 @@ rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) } int -rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) +rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -738,7 +738,7 @@ rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) } int -rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -794,7 +794,7 @@ rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -837,7 +837,7 @@ rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight) { @@ -911,7 +911,7 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, #ifdef RTE_LIBRTE_IXGBE_BYPASS int -rte_pmd_ixgbe_bypass_init(uint8_t port_id) +rte_pmd_ixgbe_bypass_init(uint16_t port_id) { struct rte_eth_dev *dev; @@ -926,7 +926,7 @@ rte_pmd_ixgbe_bypass_init(uint8_t port_id) } int -rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) +rte_pmd_ixgbe_bypass_state_show(uint16_t port_id, uint32_t *state) { struct rte_eth_dev *dev; @@ -940,7 +940,7 @@ rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) } int -rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) +rte_pmd_ixgbe_bypass_state_set(uint16_t port_id, uint32_t *new_state) { struct rte_eth_dev *dev; @@ -954,7 +954,7 @@ rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) } int -rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_show(uint16_t port_id, uint32_t event, uint32_t *state) { @@ -970,7 +970,7 @@ rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_store(uint16_t port_id, uint32_t event, uint32_t state) { @@ -986,7 +986,7 @@ rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) +rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port_id, uint32_t timeout) { struct rte_eth_dev *dev; @@ -1000,7 +1000,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) } int -rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) +rte_pmd_ixgbe_bypass_ver_show(uint16_t port_id, uint32_t *ver) { struct rte_eth_dev *dev; @@ -1014,7 +1014,7 @@ rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) } int -rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) +rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port_id, uint32_t *wd_timeout) { struct rte_eth_dev *dev; @@ -1028,7 +1028,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) } int -rte_pmd_ixgbe_bypass_wd_reset(uint8_t port_id) +rte_pmd_ixgbe_bypass_wd_reset(uint16_t port_id) { struct rte_eth_dev *dev; diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index d33c285db..3d55ab20e 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -53,7 +53,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); +int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf); /** * Set the VF MAC address. @@ -69,8 +69,8 @@ int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, - struct ether_addr *mac_addr); +int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, + struct ether_addr *mac_addr); /** * Enable/Disable VF VLAN anti spoofing. @@ -87,7 +87,8 @@ int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, + uint8_t on); /** * Enable/Disable VF MAC anti spoofing. @@ -104,7 +105,7 @@ int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -122,7 +123,7 @@ int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -139,7 +140,7 @@ int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -155,7 +156,7 @@ int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * set drop enable bit in the VF split rx control register @@ -174,7 +175,7 @@ int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan strip for all queues in a pool @@ -194,7 +195,7 @@ int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable MACsec offload. @@ -212,7 +213,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); +int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp); /** * Disable MACsec offload. @@ -224,7 +225,7 @@ int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_disable(uint8_t port); +int rte_pmd_ixgbe_macsec_disable(uint16_t port); /** * Configure Tx SC (Secure Connection). @@ -238,7 +239,7 @@ int rte_pmd_ixgbe_macsec_disable(uint8_t port); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); +int rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac); /** * Configure Rx SC (Secure Connection). @@ -254,7 +255,7 @@ int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); +int rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi); /** * Enable Tx SA (Secure Association). @@ -275,8 +276,8 @@ int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, - uint32_t pn, uint8_t *key); +int rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); /** * Enable Rx SA (Secure Association). @@ -297,8 +298,8 @@ int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, - uint32_t pn, uint8_t *key); +int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, + uint32_t pn, uint8_t *key); /** * Set RX L2 Filtering mode of a VF of an Ethernet device. @@ -323,7 +324,8 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, + uint8_t on); /** * Enable or disable a VF traffic receive of an Ethernet device. @@ -342,7 +344,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable or disable a VF traffic transmit of the Ethernet device. @@ -361,7 +363,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable hardware VF VLAN filtering by an Ethernet device of @@ -383,7 +385,8 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, + uint64_t vf_mask, uint8_t vlan_on); /** * Set the rate limitation for a vf on an Ethernet device. @@ -402,7 +405,8 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); +int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, + uint16_t tx_rate, uint64_t q_msk); /** * Set all the TCs' bandwidth weight. @@ -423,7 +427,7 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +int rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight); @@ -439,7 +443,7 @@ int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_init(uint8_t port); +int rte_pmd_ixgbe_bypass_init(uint16_t port); /** * Return bypass state. @@ -456,7 +460,7 @@ int rte_pmd_ixgbe_bypass_init(uint8_t port); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); +int rte_pmd_ixgbe_bypass_state_show(uint16_t port, uint32_t *state); /** * Set bypass state @@ -473,7 +477,7 @@ int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); +int rte_pmd_ixgbe_bypass_state_set(uint16_t port, uint32_t *new_state); /** * Return bypass state when given event occurs. @@ -497,7 +501,7 @@ int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_show(uint8_t port, +int rte_pmd_ixgbe_bypass_event_show(uint16_t port, uint32_t event, uint32_t *state); @@ -523,7 +527,7 @@ int rte_pmd_ixgbe_bypass_event_show(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_store(uint8_t port, +int rte_pmd_ixgbe_bypass_event_store(uint16_t port, uint32_t event, uint32_t state); @@ -547,7 +551,7 @@ int rte_pmd_ixgbe_bypass_event_store(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port, uint32_t timeout); /** * Get bypass firmware version. @@ -561,7 +565,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); +int rte_pmd_ixgbe_bypass_ver_show(uint16_t port, uint32_t *ver); /** * Return bypass watchdog timeout in seconds @@ -583,7 +587,7 @@ int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port, uint32_t *wd_timeout); /** * Reset bypass watchdog timer @@ -595,7 +599,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_reset(uint8_t port); +int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port); /** diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index c0ade4f1a..fe911c3a7 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -334,7 +334,7 @@ struct priv { } vlan_filter[MLX4_MAX_VLAN_IDS]; /* VLAN filters table. */ /* Device properties. */ uint16_t mtu; /* Configured MTU. */ - uint8_t port; /* Physical port number. */ + uint16_t port; /* Physical port number. */ unsigned int started:1; /* Device started, flows enabled. */ unsigned int promisc:1; /* Device in promiscuous mode. */ unsigned int allmulti:1; /* Device receives all multicast packets. */ diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 43c538419..54a2e8a54 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -114,7 +114,7 @@ struct priv { unsigned int vlan_filter_n; /* Number of configured VLAN filters. */ /* Device properties. */ uint16_t mtu; /* Configured MTU. */ - uint8_t port; /* Physical port number. */ + uint16_t port; /* Physical port number. */ unsigned int started:1; /* Device started, flows enabled. */ unsigned int promisc_req:1; /* Promiscuous mode requested. */ unsigned int allmulti_req:1; /* All multicast mode requested. */ diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index b0eb3cdfc..58e7cf571 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -75,7 +75,7 @@ struct ethtool_link_settings { uint32_t cmd; uint32_t speed; uint8_t duplex; - uint8_t port; + uint16_t port; uint8_t phy_address; uint8_t autoneg; uint8_t mdio_support; diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 7de1d1086..c47e54fe0 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -112,7 +112,6 @@ struct rxq { unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ unsigned int cqe_n:4; /* Log 2 of CQ elements. */ unsigned int elts_n:4; /* Log 2 of Mbufs. */ - unsigned int port_id:8; unsigned int rss_hash:1; /* RSS hash result is enabled. */ unsigned int mark:1; /* Marked flow available on the queue. */ unsigned int pending_err:1; /* CQE error needs to be handled. */ @@ -120,6 +119,7 @@ struct rxq { unsigned int :6; /* Remaining bits. */ volatile uint32_t *rq_db; volatile uint32_t *cq_db; + uint16_t port_id; uint16_t rq_ci; uint16_t rq_pi; uint16_t cq_ci; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 92b03c4cb..2d794f841 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1239,13 +1239,13 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev) memset(&link, 0, sizeof(link)); nfp_net_dev_atomic_read_link_status(dev, &link); if (link.link_status) - RTE_LOG(INFO, PMD, "Port %d: Link Up - speed %u Mbps - %s\n", - (int)(dev->data->port_id), (unsigned)link.link_speed, + RTE_LOG(INFO, PMD, "Port %u: Link Up - speed %u Mbps - %s\n", + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); else - RTE_LOG(INFO, PMD, " Port %d: Link Down\n", - (int)(dev->data->port_id)); + RTE_LOG(INFO, PMD, " Port %u: Link Down\n", + dev->data->port_id); RTE_LOG(INFO, PMD, "PCI Address: %04d:%02d:%02d:%d\n", pci_dev->addr.domain, pci_dev->addr.bus, @@ -1547,9 +1547,9 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, if (tx_free_thresh > (nb_desc)) { RTE_LOG(ERR, PMD, "tx_free_thresh must be less than the number of TX " - "descriptors. (tx_free_thresh=%u port=%d " + "descriptors. (tx_free_thresh=%u port=%u " "queue=%d)\n", (unsigned int)tx_free_thresh, - (int)dev->data->port_id, (int)queue_idx); + dev->data->port_id, (int)queue_idx); return -(EINVAL); } @@ -1847,9 +1847,9 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) */ new_mb = rte_pktmbuf_alloc(rxq->mem_pool); if (unlikely(new_mb == NULL)) { - RTE_LOG_DP(DEBUG, PMD, "RX mbuf alloc failed port_id=%u " - "queue_id=%u\n", (unsigned)rxq->port_id, - (unsigned)rxq->qidx); + RTE_LOG_DP(DEBUG, PMD, + "RX mbuf alloc failed port_id=%u queue_id=%u\n", + rxq->port_id, rxq->qidx); nfp_net_mbuf_alloc_failed(rxq); break; } @@ -1932,8 +1932,8 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) if (nb_hold == 0) return nb_hold; - PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, nb_hold); + PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received\n", + rxq->port_id, (unsigned int)rxq->qidx, nb_hold); nb_hold += rxq->nb_rx_hold; @@ -1944,7 +1944,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rte_wmb(); if (nb_hold > rxq->rx_free_thresh) { PMD_RX_LOG(DEBUG, "port=%u queue=%u nb_hold=%u avail=%u\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, + rxq->port_id, (unsigned int)rxq->qidx, (unsigned)nb_hold, (unsigned)avail); nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, nb_hold); nb_hold = 0; @@ -2547,7 +2547,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) ether_addr_copy((struct ether_addr *)hw->mac_addr, ð_dev->data->mac_addrs[0]); - PMD_INIT_LOG(INFO, "port %d VendorID=0x%x DeviceID=0x%x " + PMD_INIT_LOG(INFO, "port %u VendorID=0x%x DeviceID=0x%x " "mac=%02x:%02x:%02x:%02x:%02x:%02x", eth_dev->data->port_id, pci_dev->id.vendor_id, pci_dev->id.device_id, diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h index eec56bc1c..7fc76aa76 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -250,7 +250,7 @@ struct nfp_net_txq { uint32_t tx_hthresh; /* not used by now. Future? */ uint32_t tx_wthresh; /* not used by now. Future? */ uint32_t txq_flags; /* not used by now. Future? */ - uint8_t port_id; + uint16_t port_id; int qidx; int tx_qcidx; __le64 dma; diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 5aef0591e..fa9313dec 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -68,7 +68,7 @@ struct null_queue { struct pmd_internals { unsigned packet_size; unsigned packet_copy; - uint8_t port_id; + uint16_t port_id; struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT]; struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT]; diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index defb3b419..b51f16cbd 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -75,7 +75,7 @@ struct queue_stat { struct pcap_rx_queue { pcap_t *pcap; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; struct queue_stat rx_stat; char name[PATH_MAX]; diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h index 9864bb448..96f0d351d 100644 --- a/drivers/net/qede/qede_if.h +++ b/drivers/net/qede/qede_if.h @@ -97,7 +97,7 @@ struct qed_link_output { uint32_t speed; /* In Mb/s */ uint32_t adv_speed; /* Speed mask */ uint8_t duplex; /* In DUPLEX defs */ - uint8_t port; /* In PORT defs */ + uint16_t port; /* In PORT defs */ bool autoneg; uint32_t pause_config; }; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 464d3d384..e3fa7b0e2 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -394,7 +394,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], }; char args_str[32] = { 0 }; char ring_name[32] = { 0 }; - uint8_t port_id = RTE_MAX_ETHPORTS; + uint16_t port_id = RTE_MAX_ETHPORTS; int ret; /* do some parameter checking */ diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 9c0d57cc1..d141acf0e 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -71,7 +71,7 @@ struct szedata2_rx_queue { struct szedata *sze; uint8_t rx_channel; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; volatile uint64_t rx_pkts; volatile uint64_t rx_bytes; diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h index 4ee6c3bb0..e54a96f8e 100644 --- a/drivers/net/thunderx/nicvf_struct.h +++ b/drivers/net/thunderx/nicvf_struct.h @@ -100,7 +100,7 @@ struct nicvf_rxq { uint16_t queue_id; uint16_t precharge_cnt; uint8_t rx_drop_en; - uint8_t port_id; + uint16_t port_id; uint8_t rbptr_offset; } __rte_cache_aligned; diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 0dac5e60e..93310bdfb 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -105,7 +105,7 @@ struct vhost_queue { rte_atomic32_t while_queuing; struct pmd_internal *internal; struct rte_mempool *mb_pool; - uint8_t port; + uint16_t port; uint16_t virtqueue_id; struct vhost_stats stats; }; @@ -705,8 +705,8 @@ static struct vhost_device_ops vhost_ops = { }; int -rte_eth_vhost_get_queue_event(uint8_t port_id, - struct rte_eth_vhost_queue_event *event) +rte_eth_vhost_get_queue_event(uint16_t port_id, + struct rte_eth_vhost_queue_event *event) { struct rte_vhost_vring_state *state; unsigned int i; @@ -742,7 +742,7 @@ rte_eth_vhost_get_queue_event(uint8_t port_id, } int -rte_eth_vhost_get_vid_from_port_id(uint8_t port_id) +rte_eth_vhost_get_vid_from_port_id(uint16_t port_id) { struct internal_list *list; struct rte_eth_dev *eth_dev; diff --git a/drivers/net/vhost/rte_eth_vhost.h b/drivers/net/vhost/rte_eth_vhost.h index 39ca77197..0528c6aee 100644 --- a/drivers/net/vhost/rte_eth_vhost.h +++ b/drivers/net/vhost/rte_eth_vhost.h @@ -69,8 +69,8 @@ struct rte_eth_vhost_queue_event { * - On success, zero. * - On failure, a negative value. */ -int rte_eth_vhost_get_queue_event(uint8_t port_id, - struct rte_eth_vhost_queue_event *event); +int rte_eth_vhost_get_queue_event(uint16_t port_id, + struct rte_eth_vhost_queue_event *event); /** * Get the 'vid' value associated with the specified port. @@ -79,7 +79,7 @@ int rte_eth_vhost_get_queue_event(uint8_t port_id, * - On success, the 'vid' associated with 'port_id'. * - On failure, a negative value. */ -int rte_eth_vhost_get_vid_from_port_id(uint8_t port_id); +int rte_eth_vhost_get_vid_from_port_id(uint16_t port_id); #ifdef __cplusplus } diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 18caebdd7..330ee94be 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -260,7 +260,7 @@ struct virtio_hw { uint8_t use_msix; uint8_t modern; uint8_t use_simple_rxtx; - uint8_t port_id; + uint16_t port_id; uint8_t mac_addr[ETHER_ADDR_LEN]; uint32_t notify_off_multiplier; uint8_t *isr; diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h index 28f82d6a8..198b2d8fb 100644 --- a/drivers/net/virtio/virtio_rxtx.h +++ b/drivers/net/virtio/virtio_rxtx.h @@ -54,7 +54,7 @@ struct virtnet_rx { struct rte_mempool *mpool; /**< mempool for mbuf allocation */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -69,7 +69,7 @@ struct virtnet_tx { phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -82,7 +82,7 @@ struct virtnet_ctl { /**< memzone to populate hdr. */ const struct rte_memzone *virtio_net_hdr_mz; phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ const struct rte_memzone *mz; /**< mem zone to populate RX ring. */ }; diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h index 8361b6bdd..de6302cbf 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.h +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h @@ -60,7 +60,7 @@ struct virtio_user_dev { */ uint64_t device_features; /* supported features by device */ uint8_t status; - uint8_t port_id; + uint16_t port_id; uint8_t mac_addr[ETHER_ADDR_LEN]; char path[PATH_MAX]; struct vring vrings[VIRTIO_MAX_VIRTQUEUES]; diff --git a/drivers/net/vmxnet3/vmxnet3_ring.h b/drivers/net/vmxnet3/vmxnet3_ring.h index d2e8323ba..2f2ff3976 100644 --- a/drivers/net/vmxnet3/vmxnet3_ring.h +++ b/drivers/net/vmxnet3/vmxnet3_ring.h @@ -143,8 +143,8 @@ typedef struct vmxnet3_tx_queue { struct vmxnet3_txq_stats stats; const struct rte_memzone *mz; bool stopped; - uint16_t queue_id; /**< Device TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t queue_id; /**< Device TX queue index. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t txdata_desc_size; } vmxnet3_tx_queue_t; @@ -178,8 +178,8 @@ typedef struct vmxnet3_rx_queue { struct vmxnet3_rxq_stats stats; const struct rte_memzone *mz; bool stopped; - uint16_t queue_id; /**< Device RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t queue_id; /**< Device RX queue index. */ + uint16_t port_id; /**< Device port identifier. */ } vmxnet3_rx_queue_t; #endif /* _VMXNET3_RING_H_ */ diff --git a/drivers/net/xenvirt/virtqueue.h b/drivers/net/xenvirt/virtqueue.h index 1bb6877cd..1374d9193 100644 --- a/drivers/net/xenvirt/virtqueue.h +++ b/drivers/net/xenvirt/virtqueue.h @@ -74,7 +74,7 @@ struct virtqueue { struct rte_mempool *mpool; /**< mempool for mbuf allocation */ uint16_t queue_id; /**< DPDK queue index. */ uint16_t vq_queue_index; /**< PCI queue index */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ void *vq_ring_virt_mem; /**< virtual address of vring*/ int vq_alignment; diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index 3ceb35166..f373697a7 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -84,7 +84,7 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data) int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id) + uint16_t port_id) { struct rte_stats_bitrate *port_data; struct rte_eth_stats eth_stats; diff --git a/lib/librte_bitratestats/rte_bitrate.h b/lib/librte_bitratestats/rte_bitrate.h index 15fc270a3..2b40cda03 100644 --- a/lib/librte_bitratestats/rte_bitrate.h +++ b/lib/librte_bitratestats/rte_bitrate.h @@ -85,7 +85,7 @@ int rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data); * - Negative value on error */ int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id); + uint16_t port_id); #ifdef __cplusplus } diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 0597641ee..f1731238b 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -138,8 +138,8 @@ enum { STAT_QMAP_RX }; -uint8_t -rte_eth_find_next(uint8_t port_id) +uint16_t +rte_eth_find_next(uint16_t port_id) { while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED) @@ -187,7 +187,7 @@ rte_eth_dev_allocated(const char *name) return NULL; } -static uint8_t +static uint16_t rte_eth_dev_find_free_port(void) { unsigned i; @@ -200,7 +200,7 @@ rte_eth_dev_find_free_port(void) } static struct rte_eth_dev * -eth_dev_get(uint8_t port_id) +eth_dev_get(uint16_t port_id) { struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id]; @@ -216,7 +216,7 @@ eth_dev_get(uint8_t port_id) struct rte_eth_dev * rte_eth_dev_allocate(const char *name) { - uint8_t port_id; + uint16_t port_id; struct rte_eth_dev *eth_dev; port_id = rte_eth_dev_find_free_port(); @@ -251,7 +251,7 @@ rte_eth_dev_allocate(const char *name) struct rte_eth_dev * rte_eth_dev_attach_secondary(const char *name) { - uint8_t i; + uint16_t i; struct rte_eth_dev *eth_dev; if (rte_eth_dev_data == NULL) @@ -285,7 +285,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) } int -rte_eth_dev_is_valid_port(uint8_t port_id) +rte_eth_dev_is_valid_port(uint16_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && @@ -296,17 +296,17 @@ rte_eth_dev_is_valid_port(uint8_t port_id) } int -rte_eth_dev_socket_id(uint8_t port_id) +rte_eth_dev_socket_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; } -uint8_t +uint16_t rte_eth_dev_count(void) { - uint8_t p; - uint8_t count; + uint16_t p; + uint16_t count; count = 0; @@ -317,7 +317,7 @@ rte_eth_dev_count(void) } int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name) { const char *tmp; @@ -336,7 +336,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) } int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) { int ret; int i; @@ -361,7 +361,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) } static int -rte_eth_dev_is_detachable(uint8_t port_id) +rte_eth_dev_is_detachable(uint16_t port_id) { uint32_t dev_flags; @@ -377,7 +377,7 @@ rte_eth_dev_is_detachable(uint8_t port_id) /* attach the new device, then store port_id of the device */ int -rte_eth_dev_attach(const char *devargs, uint8_t *port_id) +rte_eth_dev_attach(const char *devargs, uint16_t *port_id) { int ret = -1; int current = rte_eth_dev_count(); @@ -423,7 +423,7 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id) /* detach the device, then store the name of the device */ int -rte_eth_dev_detach(uint8_t port_id, char *name) +rte_eth_dev_detach(uint16_t port_id, char *name) { int ret = -1; @@ -501,7 +501,7 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) } int -rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -527,7 +527,7 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -553,7 +553,7 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -579,7 +579,7 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) } int -rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -688,7 +688,7 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) } int -rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf) { struct rte_eth_dev *dev; @@ -839,7 +839,7 @@ _rte_eth_dev_reset(struct rte_eth_dev *dev) } static void -rte_eth_dev_config_restore(uint8_t port_id) +rte_eth_dev_config_restore(uint16_t port_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -894,7 +894,7 @@ rte_eth_dev_config_restore(uint8_t port_id) } int -rte_eth_dev_start(uint8_t port_id) +rte_eth_dev_start(uint16_t port_id) { struct rte_eth_dev *dev; int diag; @@ -906,7 +906,7 @@ rte_eth_dev_start(uint8_t port_id) RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP); if (dev->data->dev_started != 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already started\n", port_id); return 0; @@ -928,7 +928,7 @@ rte_eth_dev_start(uint8_t port_id) } void -rte_eth_dev_stop(uint8_t port_id) +rte_eth_dev_stop(uint16_t port_id) { struct rte_eth_dev *dev; @@ -938,7 +938,7 @@ rte_eth_dev_stop(uint8_t port_id) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop); if (dev->data->dev_started == 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already stopped\n", port_id); return; @@ -949,7 +949,7 @@ rte_eth_dev_stop(uint8_t port_id) } int -rte_eth_dev_set_link_up(uint8_t port_id) +rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; @@ -962,7 +962,7 @@ rte_eth_dev_set_link_up(uint8_t port_id) } int -rte_eth_dev_set_link_down(uint8_t port_id) +rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; @@ -975,7 +975,7 @@ rte_eth_dev_set_link_down(uint8_t port_id) } void -rte_eth_dev_close(uint8_t port_id) +rte_eth_dev_close(uint16_t port_id) { struct rte_eth_dev *dev; @@ -995,7 +995,7 @@ rte_eth_dev_close(uint8_t port_id) } int -rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) @@ -1086,7 +1086,7 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) { @@ -1190,7 +1190,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) } int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -1204,7 +1204,7 @@ rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) } void -rte_eth_promiscuous_enable(uint8_t port_id) +rte_eth_promiscuous_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1217,7 +1217,7 @@ rte_eth_promiscuous_enable(uint8_t port_id) } void -rte_eth_promiscuous_disable(uint8_t port_id) +rte_eth_promiscuous_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1230,7 +1230,7 @@ rte_eth_promiscuous_disable(uint8_t port_id) } int -rte_eth_promiscuous_get(uint8_t port_id) +rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1241,7 +1241,7 @@ rte_eth_promiscuous_get(uint8_t port_id) } void -rte_eth_allmulticast_enable(uint8_t port_id) +rte_eth_allmulticast_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1254,7 +1254,7 @@ rte_eth_allmulticast_enable(uint8_t port_id) } void -rte_eth_allmulticast_disable(uint8_t port_id) +rte_eth_allmulticast_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1267,7 +1267,7 @@ rte_eth_allmulticast_disable(uint8_t port_id) } int -rte_eth_allmulticast_get(uint8_t port_id) +rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1292,7 +1292,7 @@ rte_eth_dev_atomic_read_link_status(struct rte_eth_dev *dev, } void -rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1309,7 +1309,7 @@ rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) } void -rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1326,7 +1326,7 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) } int -rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) +rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; @@ -1342,7 +1342,7 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) } void -rte_eth_stats_reset(uint8_t port_id) +rte_eth_stats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1355,7 +1355,7 @@ rte_eth_stats_reset(uint8_t port_id) } static int -get_xstats_count(uint8_t port_id) +get_xstats_count(uint16_t port_id) { struct rte_eth_dev *dev; int count; @@ -1384,7 +1384,7 @@ get_xstats_count(uint8_t port_id) } int -rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id) { int cnt_xstats, idx_xstat; @@ -1428,7 +1428,7 @@ rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, } int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids) { @@ -1545,7 +1545,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, } int -rte_eth_xstats_get_names(uint8_t port_id, +rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size) { @@ -1611,8 +1611,8 @@ rte_eth_xstats_get_names(uint8_t port_id, /* retrieve ethdev extended statistics */ int -rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, - unsigned int n) +rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, + uint64_t *values, unsigned int n) { /* If need all xstats */ if (!ids) { @@ -1737,7 +1737,7 @@ rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, } int -rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n) { struct rte_eth_stats eth_stats; @@ -1819,7 +1819,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, /* reset ethdev extended statistics */ void -rte_eth_xstats_reset(uint8_t port_id) +rte_eth_xstats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1837,7 +1837,7 @@ rte_eth_xstats_reset(uint8_t port_id) } static int -set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, +set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx) { struct rte_eth_dev *dev; @@ -1853,7 +1853,7 @@ set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, int -rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, @@ -1862,7 +1862,7 @@ rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, int -rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, @@ -1870,7 +1870,7 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) +rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; @@ -1882,7 +1882,7 @@ rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) } void -rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) +rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; const struct rte_eth_desc_lim lim = { @@ -1906,7 +1906,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) } int -rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num) { int i, j; @@ -1932,7 +1932,7 @@ rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, } void -rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) +rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -1943,7 +1943,7 @@ rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) int -rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) +rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) { struct rte_eth_dev *dev; @@ -1955,7 +1955,7 @@ rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) } int -rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) +rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) { int ret; struct rte_eth_dev *dev; @@ -1972,7 +1972,7 @@ rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) } int -rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) +rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) { struct rte_eth_dev *dev; int ret; @@ -2011,7 +2011,8 @@ rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) } int -rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int on) +rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, + int on) { struct rte_eth_dev *dev; @@ -2029,7 +2030,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int o } int -rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tpid) { @@ -2043,7 +2044,7 @@ rte_eth_dev_set_vlan_ether_type(uint8_t port_id, } int -rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) +rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) { struct rte_eth_dev *dev; int ret = 0; @@ -2086,7 +2087,7 @@ rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) } int -rte_eth_dev_get_vlan_offload(uint8_t port_id) +rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; int ret = 0; @@ -2107,7 +2108,7 @@ rte_eth_dev_get_vlan_offload(uint8_t port_id) } int -rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) +rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; @@ -2120,7 +2121,7 @@ rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) } int -rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2132,7 +2133,7 @@ rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2148,7 +2149,8 @@ rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf) +rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, + struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; @@ -2214,7 +2216,7 @@ rte_eth_check_reta_entry(struct rte_eth_rss_reta_entry64 *reta_conf, } int -rte_eth_dev_rss_reta_update(uint8_t port_id, +rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2240,7 +2242,7 @@ rte_eth_dev_rss_reta_update(uint8_t port_id, } int -rte_eth_dev_rss_reta_query(uint8_t port_id, +rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2260,7 +2262,8 @@ rte_eth_dev_rss_reta_query(uint8_t port_id, } int -rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) +rte_eth_dev_rss_hash_update(uint16_t port_id, + struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; uint16_t rss_hash_protos; @@ -2279,7 +2282,7 @@ rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) } int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; @@ -2291,7 +2294,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2313,7 +2316,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2336,7 +2339,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, } int -rte_eth_led_on(uint8_t port_id) +rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2347,7 +2350,7 @@ rte_eth_led_on(uint8_t port_id) } int -rte_eth_led_off(uint8_t port_id) +rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2362,7 +2365,7 @@ rte_eth_led_off(uint8_t port_id) * an empty spot. */ static int -get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2381,7 +2384,7 @@ get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) static const struct ether_addr null_mac_addr; int -rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, uint32_t pool) { struct rte_eth_dev *dev; @@ -2434,7 +2437,7 @@ rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; int index; @@ -2463,7 +2466,7 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) } int -rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; @@ -2489,7 +2492,7 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) * an empty spot. */ static int -get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2508,7 +2511,7 @@ get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) } int -rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, uint8_t on) { int index; @@ -2560,7 +2563,7 @@ rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) +rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; @@ -2572,7 +2575,7 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) return (*dev->dev_ops->uc_all_hash_table_set)(dev, on); } -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate) { struct rte_eth_dev *dev; @@ -2603,7 +2606,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, } int -rte_eth_mirror_rule_set(uint8_t port_id, +rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) { @@ -2641,7 +2644,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, } int -rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) +rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id) { struct rte_eth_dev *dev; @@ -2654,7 +2657,7 @@ rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) } int -rte_eth_dev_callback_register(uint8_t port_id, +rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2694,7 +2697,7 @@ rte_eth_dev_callback_register(uint8_t port_id, } int -rte_eth_dev_callback_unregister(uint8_t port_id, +rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2766,7 +2769,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, } int -rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) +rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) { uint32_t vec; struct rte_eth_dev *dev; @@ -2827,7 +2830,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, } int -rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data) { uint32_t vec; @@ -2867,7 +2870,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_rx_intr_enable(uint8_t port_id, +rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2881,7 +2884,7 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id, } int -rte_eth_dev_rx_intr_disable(uint8_t port_id, +rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2896,7 +2899,8 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id, int -rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) +rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type) { struct rte_eth_dev *dev; @@ -2909,7 +2913,7 @@ rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) } int -rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { struct rte_eth_dev *dev; @@ -2922,7 +2926,7 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, } void * -rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2964,7 +2968,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2999,7 +3003,7 @@ rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3042,7 +3046,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3076,7 +3080,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3110,7 +3114,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo) { struct rte_eth_dev *dev; @@ -3134,7 +3138,7 @@ rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo) { struct rte_eth_dev *dev; @@ -3158,7 +3162,7 @@ rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_set_mc_addr_list(uint8_t port_id, +rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) { @@ -3172,7 +3176,7 @@ rte_eth_dev_set_mc_addr_list(uint8_t port_id, } int -rte_eth_timesync_enable(uint8_t port_id) +rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3184,7 +3188,7 @@ rte_eth_timesync_enable(uint8_t port_id) } int -rte_eth_timesync_disable(uint8_t port_id) +rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3196,7 +3200,7 @@ rte_eth_timesync_disable(uint8_t port_id) } int -rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, +rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; @@ -3209,7 +3213,8 @@ rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, } int -rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_tx_timestamp(uint16_t port_id, + struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3221,7 +3226,7 @@ rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) +rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; @@ -3233,7 +3238,7 @@ rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) } int -rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3245,7 +3250,7 @@ rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) +rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3257,7 +3262,7 @@ rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) } int -rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) +rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; @@ -3269,7 +3274,7 @@ rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) } int -rte_eth_dev_get_eeprom_length(uint8_t port_id) +rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3281,7 +3286,7 @@ rte_eth_dev_get_eeprom_length(uint8_t port_id) } int -rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3293,7 +3298,7 @@ rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3305,7 +3310,7 @@ rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_get_dcb_info(uint8_t port_id, +rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; @@ -3320,7 +3325,7 @@ rte_eth_dev_get_dcb_info(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) { struct rte_eth_dev *dev; @@ -3343,7 +3348,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en) @@ -3387,7 +3392,7 @@ rte_eth_dev_adjust_nb_desc(uint16_t *nb_desc, } int -rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 0adf3274a..ca75b199c 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1568,7 +1568,7 @@ struct eth_dev_ops { * @return * The number of packets returned to the user. */ -typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); @@ -1592,7 +1592,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, * @return * The number of packets to be written to the NIC. */ -typedef uint16_t (*rte_tx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param); /** @@ -1695,7 +1695,7 @@ struct rte_eth_dev_data { /** bitmap array of associating Ethernet MAC addresses to pools */ struct ether_addr* hash_mac_addrs; /** Device Ethernet MAC addresses of hash filtering. */ - uint8_t port_id; /**< Device [external] port identifier. */ + uint16_t port_id; /**< Device [external] port identifier. */ __extension__ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */ scattered_rx : 1, /**< RX of scattered packets is ON(1) / OFF(0) */ @@ -1737,7 +1737,7 @@ extern struct rte_eth_dev rte_eth_devices[]; * @return * Next valid port id, RTE_MAX_ETHPORTS if there is none. */ -uint8_t rte_eth_find_next(uint8_t port_id); +uint16_t rte_eth_find_next(uint16_t port_id); /** * Macro to iterate over all enabled ethdev ports. @@ -1760,7 +1760,7 @@ uint8_t rte_eth_find_next(uint8_t port_id); * @return * - The total number of usable Ethernet devices. */ -uint8_t rte_eth_dev_count(void); +uint16_t rte_eth_dev_count(void); /** * @internal @@ -1821,7 +1821,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * @return * 0 on success and port_id is filled, negative on error */ -int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); +int rte_eth_dev_attach(const char *devargs, uint16_t *port_id); /** * Detach a Ethernet device specified by port identifier. @@ -1836,7 +1836,7 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); * @return * 0 on success and devname is filled, negative on error */ -int rte_eth_dev_detach(uint8_t port_id, char *devname); +int rte_eth_dev_detach(uint16_t port_id, char *devname); /** * Convert a numerical speed in Mbps to a bitmap flag that can be used in @@ -1880,7 +1880,7 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex); * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, +int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf); /** @@ -1935,7 +1935,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * allocate network memory buffers from the memory pool when * initializing receive descriptors. */ -int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); @@ -1983,7 +1983,7 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, * - 0: Success, the transmit queue is correctly set up. * - -ENOMEM: Unable to allocate the transmit ring descriptors. */ -int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); @@ -1997,7 +1997,7 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, * a default of zero if the socket could not be determined. * -1 is returned is the port_id value is out of range. */ -int rte_eth_dev_socket_id(uint8_t port_id); +int rte_eth_dev_socket_id(uint16_t port_id); /** * Check if port_id of device is attached @@ -2008,7 +2008,7 @@ int rte_eth_dev_socket_id(uint8_t port_id); * - 0 if port is out of range or not attached * - 1 if device is attached */ -int rte_eth_dev_is_valid_port(uint8_t port_id); +int rte_eth_dev_is_valid_port(uint16_t port_id); /** * Start specified RX queue of a port. It is used when rx_deferred_start @@ -2025,7 +2025,7 @@ int rte_eth_dev_is_valid_port(uint8_t port_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); /** * Stop specified RX queue of a port @@ -2041,7 +2041,7 @@ int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); /** * Start TX for specified queue of a port. It is used when tx_deferred_start @@ -2058,7 +2058,7 @@ int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); /** * Stop specified TX queue of a port @@ -2074,9 +2074,7 @@ int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); - - +int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id); /** * Start an Ethernet device. @@ -2093,7 +2091,7 @@ int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); * - 0: Success, Ethernet device started. * - <0: Error code of the driver device start function. */ -int rte_eth_dev_start(uint8_t port_id); +int rte_eth_dev_start(uint16_t port_id); /** * Stop an Ethernet device. The device can be restarted with a call to @@ -2102,7 +2100,7 @@ int rte_eth_dev_start(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_stop(uint8_t port_id); +void rte_eth_dev_stop(uint16_t port_id); /** @@ -2117,7 +2115,7 @@ void rte_eth_dev_stop(uint8_t port_id); * - 0: Success, Ethernet device linked up. * - <0: Error code of the driver device link up function. */ -int rte_eth_dev_set_link_up(uint8_t port_id); +int rte_eth_dev_set_link_up(uint16_t port_id); /** * Link down an Ethernet device. @@ -2128,7 +2126,7 @@ int rte_eth_dev_set_link_up(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_set_link_down(uint8_t port_id); +int rte_eth_dev_set_link_down(uint16_t port_id); /** * Close a stopped Ethernet device. The device cannot be restarted! @@ -2138,7 +2136,7 @@ int rte_eth_dev_set_link_down(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_close(uint8_t port_id); +void rte_eth_dev_close(uint16_t port_id); /** * Enable receipt in promiscuous mode for an Ethernet device. @@ -2146,7 +2144,7 @@ void rte_eth_dev_close(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_enable(uint8_t port_id); +void rte_eth_promiscuous_enable(uint16_t port_id); /** * Disable receipt in promiscuous mode for an Ethernet device. @@ -2154,7 +2152,7 @@ void rte_eth_promiscuous_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_disable(uint8_t port_id); +void rte_eth_promiscuous_disable(uint16_t port_id); /** * Return the value of promiscuous mode for an Ethernet device. @@ -2166,7 +2164,7 @@ void rte_eth_promiscuous_disable(uint8_t port_id); * - (0) if promiscuous is disabled. * - (-1) on error */ -int rte_eth_promiscuous_get(uint8_t port_id); +int rte_eth_promiscuous_get(uint16_t port_id); /** * Enable the receipt of any multicast frame by an Ethernet device. @@ -2174,7 +2172,7 @@ int rte_eth_promiscuous_get(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_enable(uint8_t port_id); +void rte_eth_allmulticast_enable(uint16_t port_id); /** * Disable the receipt of all multicast frames by an Ethernet device. @@ -2182,7 +2180,7 @@ void rte_eth_allmulticast_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_disable(uint8_t port_id); +void rte_eth_allmulticast_disable(uint16_t port_id); /** * Return the value of allmulticast mode for an Ethernet device. @@ -2194,7 +2192,7 @@ void rte_eth_allmulticast_disable(uint8_t port_id); * - (0) if allmulticast is disabled. * - (-1) on error */ -int rte_eth_allmulticast_get(uint8_t port_id); +int rte_eth_allmulticast_get(uint16_t port_id); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2207,7 +2205,7 @@ int rte_eth_allmulticast_get(uint8_t port_id); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2220,7 +2218,7 @@ void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the general I/O statistics of an Ethernet device. @@ -2239,7 +2237,7 @@ void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); +int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. @@ -2247,7 +2245,7 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_stats_reset(uint8_t port_id); +void rte_eth_stats_reset(uint16_t port_id); /** * Retrieve names of extended statistics of an Ethernet device. @@ -2269,7 +2267,7 @@ void rte_eth_stats_reset(uint8_t port_id); * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_names(uint8_t port_id, +int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size); @@ -2295,7 +2293,7 @@ int rte_eth_xstats_get_names(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n); /** @@ -2321,7 +2319,7 @@ int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, * - A negative value on error (invalid port id). */ int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids); @@ -2348,7 +2346,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, +int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, uint64_t *values, unsigned int n); /** @@ -2368,7 +2366,7 @@ int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, * -ENODEV for invalid port_id, * -EINVAL if the xstat_name doesn't exist in port_id */ -int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id); /** @@ -2377,7 +2375,7 @@ int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_xstats_reset(uint8_t port_id); +void rte_eth_xstats_reset(uint16_t port_id); /** * Set a mapping for the specified transmit queue to the specified per-queue @@ -2396,7 +2394,7 @@ void rte_eth_xstats_reset(uint8_t port_id); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx); /** @@ -2416,7 +2414,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx); @@ -2429,7 +2427,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. */ -void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -2440,7 +2438,7 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); * A pointer to a structure of type *rte_eth_dev_info* to be filled with * the contextual information of the Ethernet device. */ -void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); +void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info); /** * Retrieve the firmware version of a device. @@ -2460,7 +2458,7 @@ void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); * - (>0) if *fw_size* is not enough to store firmware version, return * the size of the non truncated string. */ -int rte_eth_dev_fw_version_get(uint8_t port_id, +int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size); /** @@ -2501,7 +2499,7 @@ int rte_eth_dev_fw_version_get(uint8_t port_id, * count of supported ptypes will be returned. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num); /** @@ -2515,7 +2513,7 @@ int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); +int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu); /** * Change the MTU of an Ethernet device. @@ -2531,7 +2529,7 @@ int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); * - (-EINVAL) if *mtu* invalid. * - (-EBUSY) if operation is not allowed when the port is running */ -int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); +int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu); /** * Enable/Disable hardware filtering by an Ethernet device of received @@ -2551,7 +2549,7 @@ int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); * - (-ENOSYS) if VLAN filtering on *port_id* disabled. * - (-EINVAL) if *vlan_id* > 4095. */ -int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); +int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on); /** * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. @@ -2572,7 +2570,7 @@ int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *rx_queue_id* invalid. */ -int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on); /** @@ -2591,7 +2589,7 @@ int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type); @@ -2615,7 +2613,7 @@ int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); +int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); /** * Read VLAN Offload configuration from an Ethernet device @@ -2629,7 +2627,7 @@ int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); * ETH_VLAN_EXTEND_OFFLOAD * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_vlan_offload(uint8_t port_id); +int rte_eth_dev_get_vlan_offload(uint16_t port_id); /** * Set port based TX VLAN insertion on or off. @@ -2645,7 +2643,7 @@ int rte_eth_dev_get_vlan_offload(uint8_t port_id); * - (0) if successful. * - negative if failed. */ -int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); +int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); /** * @@ -2730,7 +2728,7 @@ int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); * *rx_pkts* array. */ static inline uint16_t -rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2775,7 +2773,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, * (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) +rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2804,7 +2802,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) * - (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) +rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); @@ -2851,7 +2849,7 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) * - (-ENODEV) bad port or queue (only if compiled with debug). */ static inline int -rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2908,7 +2906,7 @@ rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, * - (-ENOTSUP) if the device does not support this function. * - (-ENODEV) bad port or queue (only if compiled with debug). */ -static inline int rte_eth_tx_descriptor_status(uint8_t port_id, +static inline int rte_eth_tx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2992,7 +2990,7 @@ static inline int rte_eth_tx_descriptor_status(uint8_t port_id, * *tx_pkts* parameter when the transmit ring is full or has been filled up. */ static inline uint16_t -rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3081,7 +3079,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, #ifndef RTE_ETHDEV_TX_PREPARE_NOOP static inline uint16_t -rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev; @@ -3123,7 +3121,8 @@ rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, */ static inline uint16_t -rte_eth_tx_prepare(__rte_unused uint8_t port_id, __rte_unused uint16_t queue_id, +rte_eth_tx_prepare(__rte_unused uint16_t port_id, + __rte_unused uint16_t queue_id, __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { return nb_pkts; @@ -3192,7 +3191,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size); * callback is called for any packets which could not be sent. */ static inline uint16_t -rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer) { uint16_t sent; @@ -3244,7 +3243,7 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, * the rest. */ static __rte_always_inline uint16_t -rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt) { buffer->pkts[buffer->length++] = tx_pkt; @@ -3360,7 +3359,7 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, * are in use. */ int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt); +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt); /** * The eth device event type for interrupt, and maybe others in the future. @@ -3378,7 +3377,7 @@ enum rte_eth_event_type { RTE_ETH_EVENT_MAX /**< max value of this enum */ }; -typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, +typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param); /**< user application callback to be registered for interrupts */ @@ -3400,7 +3399,7 @@ typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_register(uint8_t port_id, +int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3421,7 +3420,7 @@ int rte_eth_dev_callback_register(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_unregister(uint8_t port_id, +int rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3467,7 +3466,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id); /** * When lcore wakes up from rx interrupt indicating packet coming, disable rx @@ -3488,7 +3487,7 @@ int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id); /** * RX Interrupt control per port. @@ -3507,7 +3506,7 @@ int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); +int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data); /** * RX Interrupt control per queue. @@ -3530,7 +3529,7 @@ int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data); /** @@ -3545,7 +3544,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_on(uint8_t port_id); +int rte_eth_led_on(uint16_t port_id); /** * Turn off the LED on the Ethernet device. @@ -3559,7 +3558,7 @@ int rte_eth_led_on(uint8_t port_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_off(uint8_t port_id); +int rte_eth_led_off(uint16_t port_id); /** * Get current status of the Ethernet link flow control for Ethernet device @@ -3573,7 +3572,7 @@ int rte_eth_led_off(uint8_t port_id); * - (-ENOTSUP) if hardware doesn't support flow control. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_flow_ctrl_get(uint8_t port_id, +int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3590,7 +3589,7 @@ int rte_eth_dev_flow_ctrl_get(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3608,7 +3607,7 @@ int rte_eth_dev_flow_ctrl_set(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf); /** @@ -3629,7 +3628,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t pool); /** @@ -3645,7 +3644,7 @@ int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EADDRINUSE) if attempting to remove the default MAC address */ -int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr); /** * Set the default MAC address. @@ -3660,8 +3659,8 @@ int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); - +int rte_eth_dev_default_mac_addr_set(uint16_t port, + struct ether_addr *mac_addr); /** * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device. @@ -3678,7 +3677,7 @@ int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_update(uint8_t port, +int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3697,7 +3696,7 @@ int rte_eth_dev_rss_reta_update(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_query(uint8_t port, +int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3719,8 +3718,8 @@ int rte_eth_dev_rss_reta_query(uint8_t port, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, - uint8_t on); +int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, + uint8_t on); /** * Updates all unicast hash bitmaps for receiving packet with any Unicast @@ -3739,7 +3738,7 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); +int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on); /** * Set a traffic mirroring rule on an Ethernet device @@ -3762,7 +3761,7 @@ int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if the mr_conf information is not correct. */ -int rte_eth_mirror_rule_set(uint8_t port_id, +int rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on); @@ -3780,7 +3779,7 @@ int rte_eth_mirror_rule_set(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_mirror_rule_reset(uint8_t port_id, +int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id); /** @@ -3798,7 +3797,7 @@ int rte_eth_mirror_rule_reset(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate); /** @@ -3814,7 +3813,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_hash_update(uint8_t port_id, +int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3831,7 +3830,7 @@ int rte_eth_dev_rss_hash_update(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support RSS. */ int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3852,7 +3851,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3874,7 +3873,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3890,7 +3889,8 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support this filter type. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type); +int rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type); /** * Take operations to assigned filter type on an Ethernet device. @@ -3910,7 +3910,7 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg); /** @@ -3925,7 +3925,7 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, * - (-ENODEV) if port identifier is invalid. * - (-ENOTSUP) if hardware doesn't support. */ -int rte_eth_dev_get_dcb_info(uint8_t port_id, +int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info); /** @@ -3952,7 +3952,7 @@ int rte_eth_dev_get_dcb_info(uint8_t port_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -3980,7 +3980,7 @@ void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4007,7 +4007,7 @@ void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param); /** @@ -4040,7 +4040,7 @@ void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4073,7 +4073,7 @@ int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4093,7 +4093,7 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); /** @@ -4113,7 +4113,7 @@ int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo); /** @@ -4132,7 +4132,7 @@ int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); +int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info); /** * Retrieve size of device EEPROM @@ -4145,7 +4145,7 @@ int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom_length(uint8_t port_id); +int rte_eth_dev_get_eeprom_length(uint16_t port_id); /** * Retrieve EEPROM and EEPROM attribute @@ -4161,7 +4161,7 @@ int rte_eth_dev_get_eeprom_length(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Program EEPROM with provided data @@ -4177,7 +4177,7 @@ int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Set the list of multicast addresses to filter on an Ethernet device. @@ -4196,7 +4196,7 @@ int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering. * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ -int rte_eth_dev_set_mc_addr_list(uint8_t port_id, +int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr); @@ -4211,7 +4211,7 @@ int rte_eth_dev_set_mc_addr_list(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_enable(uint8_t port_id); +int rte_eth_timesync_enable(uint16_t port_id); /** * Disable IEEE1588/802.1AS timestamping for an Ethernet device. @@ -4224,7 +4224,7 @@ int rte_eth_timesync_enable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_disable(uint8_t port_id); +int rte_eth_timesync_disable(uint16_t port_id); /** * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device. @@ -4243,7 +4243,7 @@ int rte_eth_timesync_disable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags); /** @@ -4260,7 +4260,7 @@ int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp); /** @@ -4279,7 +4279,7 @@ int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); +int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta); /** * Read the time from the timesync clock on an Ethernet device. @@ -4295,7 +4295,7 @@ int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); * @return * - 0: Success. */ -int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); +int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time); /** * Set the time of the timesync clock on an Ethernet device. @@ -4314,7 +4314,7 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time); +int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time); /** * Create memzone for HW rings. @@ -4355,7 +4355,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel); /** @@ -4382,7 +4382,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en); @@ -4400,7 +4400,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, * - (-ENODEV or -EINVAL) on failure. */ int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id); /** * Get the device name from port id @@ -4414,7 +4414,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); * - (-EINVAL) on failure. */ int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name); /** * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from @@ -4432,7 +4432,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); * - (0) if successful. * - (-ENOTSUP, -ENODEV or -EINVAL) on failure. */ -int rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc); diff --git a/lib/librte_ether/rte_tm.c b/lib/librte_ether/rte_tm.c index 71679650e..ceac34115 100644 --- a/lib/librte_ether/rte_tm.c +++ b/lib/librte_ether/rte_tm.c @@ -40,7 +40,7 @@ /* Get generic traffic manager operations structure from a port. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_tm_ops *ops; @@ -87,7 +87,7 @@ rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) /* Get number of leaf nodes */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error) { @@ -113,7 +113,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, /* Check node type (leaf or non-leaf) */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error) @@ -124,7 +124,7 @@ rte_tm_node_type_get(uint8_t port_id, } /* Get capabilities */ -int rte_tm_capabilities_get(uint8_t port_id, +int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error) { @@ -134,7 +134,7 @@ int rte_tm_capabilities_get(uint8_t port_id, } /* Get level capabilities */ -int rte_tm_level_capabilities_get(uint8_t port_id, +int rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error) @@ -145,7 +145,7 @@ int rte_tm_level_capabilities_get(uint8_t port_id, } /* Get node capabilities */ -int rte_tm_node_capabilities_get(uint8_t port_id, +int rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error) @@ -156,7 +156,7 @@ int rte_tm_node_capabilities_get(uint8_t port_id, } /* Add WRED profile */ -int rte_tm_wred_profile_add(uint8_t port_id, +int rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error) @@ -167,7 +167,7 @@ int rte_tm_wred_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_wred_profile_delete(uint8_t port_id, +int rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error) { @@ -177,7 +177,7 @@ int rte_tm_wred_profile_delete(uint8_t port_id, } /* Add/update shared WRED context */ -int rte_tm_shared_wred_context_add_update(uint8_t port_id, +int rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -188,7 +188,7 @@ int rte_tm_shared_wred_context_add_update(uint8_t port_id, } /* Delete shared WRED context */ -int rte_tm_shared_wred_context_delete(uint8_t port_id, +int rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error) { @@ -198,7 +198,7 @@ int rte_tm_shared_wred_context_delete(uint8_t port_id, } /* Add shaper profile */ -int rte_tm_shaper_profile_add(uint8_t port_id, +int rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error) @@ -209,7 +209,7 @@ int rte_tm_shaper_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_shaper_profile_delete(uint8_t port_id, +int rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error) { @@ -219,7 +219,7 @@ int rte_tm_shaper_profile_delete(uint8_t port_id, } /* Add shared shaper */ -int rte_tm_shared_shaper_add_update(uint8_t port_id, +int rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -230,7 +230,7 @@ int rte_tm_shared_shaper_add_update(uint8_t port_id, } /* Delete shared shaper */ -int rte_tm_shared_shaper_delete(uint8_t port_id, +int rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error) { @@ -240,7 +240,7 @@ int rte_tm_shared_shaper_delete(uint8_t port_id, } /* Add node to port traffic manager hierarchy */ -int rte_tm_node_add(uint8_t port_id, +int rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -256,7 +256,7 @@ int rte_tm_node_add(uint8_t port_id, } /* Delete node from traffic manager hierarchy */ -int rte_tm_node_delete(uint8_t port_id, +int rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -266,7 +266,7 @@ int rte_tm_node_delete(uint8_t port_id, } /* Suspend node */ -int rte_tm_node_suspend(uint8_t port_id, +int rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -276,7 +276,7 @@ int rte_tm_node_suspend(uint8_t port_id, } /* Resume node */ -int rte_tm_node_resume(uint8_t port_id, +int rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -286,7 +286,7 @@ int rte_tm_node_resume(uint8_t port_id, } /* Commit the initial port traffic manager hierarchy */ -int rte_tm_hierarchy_commit(uint8_t port_id, +int rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error) { @@ -296,7 +296,7 @@ int rte_tm_hierarchy_commit(uint8_t port_id, } /* Update node parent */ -int rte_tm_node_parent_update(uint8_t port_id, +int rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -309,7 +309,7 @@ int rte_tm_node_parent_update(uint8_t port_id, } /* Update node private shaper */ -int rte_tm_node_shaper_update(uint8_t port_id, +int rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -320,7 +320,7 @@ int rte_tm_node_shaper_update(uint8_t port_id, } /* Update node shared shapers */ -int rte_tm_node_shared_shaper_update(uint8_t port_id, +int rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -332,7 +332,7 @@ int rte_tm_node_shared_shaper_update(uint8_t port_id, } /* Update node stats */ -int rte_tm_node_stats_update(uint8_t port_id, +int rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error) @@ -343,7 +343,7 @@ int rte_tm_node_stats_update(uint8_t port_id, } /* Update WFQ weight mode */ -int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -355,7 +355,7 @@ int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, } /* Update node congestion management mode */ -int rte_tm_node_cman_update(uint8_t port_id, +int rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error) @@ -366,7 +366,7 @@ int rte_tm_node_cman_update(uint8_t port_id, } /* Update node private WRED context */ -int rte_tm_node_wred_context_update(uint8_t port_id, +int rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -377,7 +377,7 @@ int rte_tm_node_wred_context_update(uint8_t port_id, } /* Update node shared WRED context */ -int rte_tm_node_shared_wred_context_update(uint8_t port_id, +int rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -389,7 +389,7 @@ int rte_tm_node_shared_wred_context_update(uint8_t port_id, } /* Read and/or clear stats counters for specific node */ -int rte_tm_node_stats_read(uint8_t port_id, +int rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -402,7 +402,7 @@ int rte_tm_node_stats_read(uint8_t port_id, } /* Packet marking - VLAN DEI */ -int rte_tm_mark_vlan_dei(uint8_t port_id, +int rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -414,7 +414,7 @@ int rte_tm_mark_vlan_dei(uint8_t port_id, } /* Packet marking - IPv4/IPv6 ECN */ -int rte_tm_mark_ip_ecn(uint8_t port_id, +int rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -426,7 +426,7 @@ int rte_tm_mark_ip_ecn(uint8_t port_id, } /* Packet marking - IPv4/IPv6 DSCP */ -int rte_tm_mark_ip_dscp(uint8_t port_id, +int rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm.h b/lib/librte_ether/rte_tm.h index ebbfa1eec..2b25a8715 100644 --- a/lib/librte_ether/rte_tm.h +++ b/lib/librte_ether/rte_tm.h @@ -1040,7 +1040,7 @@ struct rte_tm_error { * 0 on success, non-zero error code otherwise. */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error); @@ -1064,7 +1064,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error); @@ -1082,7 +1082,7 @@ rte_tm_node_type_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_capabilities_get(uint8_t port_id, +rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error); @@ -1102,7 +1102,7 @@ rte_tm_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_level_capabilities_get(uint8_t port_id, +rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error); @@ -1122,7 +1122,7 @@ rte_tm_level_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_capabilities_get(uint8_t port_id, +rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error); @@ -1147,7 +1147,7 @@ rte_tm_node_capabilities_get(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_add(uint8_t port_id, +rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error); @@ -1170,7 +1170,7 @@ rte_tm_wred_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_delete(uint8_t port_id, +rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1201,7 +1201,7 @@ rte_tm_wred_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_add_update(uint8_t port_id, +rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1225,7 +1225,7 @@ rte_tm_shared_wred_context_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_delete(uint8_t port_id, +rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error); @@ -1249,7 +1249,7 @@ rte_tm_shared_wred_context_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_add(uint8_t port_id, +rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error); @@ -1272,7 +1272,7 @@ rte_tm_shaper_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_delete(uint8_t port_id, +rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1301,7 +1301,7 @@ rte_tm_shaper_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_add_update(uint8_t port_id, +rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1324,7 +1324,7 @@ rte_tm_shared_shaper_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_delete(uint8_t port_id, +rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error); @@ -1392,7 +1392,7 @@ rte_tm_shared_shaper_delete(uint8_t port_id, * @see struct rte_tm_capabilities */ int -rte_tm_node_add(uint8_t port_id, +rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1425,7 +1425,7 @@ rte_tm_node_add(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_ADD_DELETE */ int -rte_tm_node_delete(uint8_t port_id, +rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1449,7 +1449,7 @@ rte_tm_node_delete(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_suspend(uint8_t port_id, +rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1472,7 +1472,7 @@ rte_tm_node_suspend(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_resume(uint8_t port_id, +rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1513,7 +1513,7 @@ rte_tm_node_resume(uint8_t port_id, * @see rte_tm_node_delete() */ int -rte_tm_hierarchy_commit(uint8_t port_id, +rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error); @@ -1549,7 +1549,7 @@ rte_tm_hierarchy_commit(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_PARENT_CHANGE_LEVEL */ int -rte_tm_node_parent_update(uint8_t port_id, +rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1578,7 +1578,7 @@ rte_tm_node_parent_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_private_n_max */ int -rte_tm_node_shaper_update(uint8_t port_id, +rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1605,7 +1605,7 @@ rte_tm_node_shaper_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_node_shared_shaper_update(uint8_t port_id, +rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -1632,7 +1632,7 @@ rte_tm_node_shared_shaper_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_STATS */ int -rte_tm_node_stats_update(uint8_t port_id, +rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error); @@ -1660,7 +1660,7 @@ rte_tm_node_stats_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_N_SP_PRIORITIES */ int -rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -1683,7 +1683,7 @@ rte_tm_node_wfq_weight_mode_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_CMAN */ int -rte_tm_node_cman_update(uint8_t port_id, +rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error); @@ -1707,7 +1707,7 @@ rte_tm_node_cman_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_private_n_max */ int -rte_tm_node_wred_context_update(uint8_t port_id, +rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1732,7 +1732,7 @@ rte_tm_node_wred_context_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_node_shared_wred_context_update(uint8_t port_id, +rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -1764,7 +1764,7 @@ rte_tm_node_shared_wred_context_update(uint8_t port_id, * @see enum rte_tm_stats_type */ int -rte_tm_node_stats_read(uint8_t port_id, +rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -1801,7 +1801,7 @@ rte_tm_node_stats_read(uint8_t port_id, * @see struct rte_tm_capabilities::mark_vlan_dei_supported */ int -rte_tm_mark_vlan_dei(uint8_t port_id, +rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1851,7 +1851,7 @@ rte_tm_mark_vlan_dei(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_ecn_sctp_supported */ int -rte_tm_mark_ip_ecn(uint8_t port_id, +rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1899,7 +1899,7 @@ rte_tm_mark_ip_ecn(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_dscp_supported */ int -rte_tm_mark_ip_dscp(uint8_t port_id, +rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm_driver.h b/lib/librte_ether/rte_tm_driver.h index a5b698fe0..b2e8ccf80 100644 --- a/lib/librte_ether/rte_tm_driver.h +++ b/lib/librte_ether/rte_tm_driver.h @@ -357,7 +357,7 @@ rte_tm_error_set(struct rte_tm_error *error, * success, NULL otherwise. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error); +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error); #ifdef __cplusplus } diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 37deb4727..87812cd55 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -63,13 +63,13 @@ struct rte_mbuf; * Structure which has the function pointers for KNI interface. */ struct rte_kni_ops { - uint8_t port_id; /* Port ID */ + uint16_t port_id; /* Port ID */ /* Pointer to function of changing MTU */ - int (*change_mtu)(uint8_t port_id, unsigned new_mtu); + int (*change_mtu)(uint16_t port_id, unsigned int new_mtu); /* Pointer to function of configuring network interface */ - int (*config_network_if)(uint8_t port_id, uint8_t if_up); + int (*config_network_if)(uint16_t port_id, uint8_t if_up); }; /** diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c index ce029a12c..d6ad13c4e 100644 --- a/lib/librte_latencystats/rte_latencystats.c +++ b/lib/librte_latencystats/rte_latencystats.c @@ -135,7 +135,7 @@ rte_latencystats_fill_values(struct rte_metric_value *values) } static uint16_t -add_time_stamps(uint8_t pid __rte_unused, +add_time_stamps(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -165,7 +165,7 @@ add_time_stamps(uint8_t pid __rte_unused, } static uint16_t -calc_latency(uint8_t pid __rte_unused, +calc_latency(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -226,10 +226,10 @@ rte_latencystats_init(uint64_t app_samp_intvl, rte_latency_stats_flow_type_fn user_cb) { unsigned int i; - uint8_t pid; + uint16_t pid; uint16_t qid; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const char *ptr_strings[NUM_LATENCY_STATS] = {0}; const struct rte_memzone *mz = NULL; const unsigned int flags = 0; @@ -290,11 +290,11 @@ rte_latencystats_init(uint64_t app_samp_intvl, int rte_latencystats_uninit(void) { - uint8_t pid; + uint16_t pid; uint16_t qid; int ret = 0; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); /** De register Rx/Tx callbacks */ for (pid = 0; pid < nb_ports; pid++) { diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 729e79a36..e6182d35c 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -207,7 +207,7 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) } static uint16_t -pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_params) @@ -217,7 +217,7 @@ pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static uint16_t -pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) { pdump_copy(pkts, nb_pkts, user_params); @@ -225,7 +225,7 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static int -pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -279,7 +279,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, } static int -pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -337,7 +337,7 @@ static int set_pdump_rxtx_cbs(struct pdump_request *p) { uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue; - uint8_t port; + uint16_t port; int ret = 0; uint32_t flags; uint16_t operation; @@ -764,7 +764,7 @@ pdump_validate_flags(uint32_t flags) } static int -pdump_validate_port(uint8_t port, char *name) +pdump_validate_port(uint16_t port, char *name) { int ret = 0; @@ -828,7 +828,7 @@ pdump_prepare_client_request(char *device, uint16_t queue, } int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter) @@ -876,7 +876,7 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue, } int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags) +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags) { int ret = 0; char name[DEVICE_ID_SIZE]; diff --git a/lib/librte_pdump/rte_pdump.h b/lib/librte_pdump/rte_pdump.h index ba6e39b09..4ec0a106f 100644 --- a/lib/librte_pdump/rte_pdump.h +++ b/lib/librte_pdump/rte_pdump.h @@ -113,7 +113,7 @@ rte_pdump_uninit(void); */ int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter); @@ -136,7 +136,7 @@ rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, */ int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags); +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags); /** * Enables packet capturing on given device id and queue. diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c index d5c5fba55..1dc949c73 100644 --- a/lib/librte_port/rte_port_ethdev.c +++ b/lib/librte_port/rte_port_ethdev.c @@ -60,7 +60,7 @@ struct rte_port_ethdev_reader { struct rte_port_in_stats stats; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -94,8 +94,7 @@ rte_port_ethdev_reader_create(void *params, int socket_id) static int rte_port_ethdev_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts) { - struct rte_port_ethdev_reader *p = - port; + struct rte_port_ethdev_reader *p = port; uint16_t rx_pkt_cnt; rx_pkt_cnt = rte_eth_rx_burst(p->port_id, p->queue_id, pkts, n_pkts); @@ -119,8 +118,7 @@ rte_port_ethdev_reader_free(void *port) static int rte_port_ethdev_reader_stats_read(void *port, struct rte_port_in_stats *stats, int clear) { - struct rte_port_ethdev_reader *p = - port; + struct rte_port_ethdev_reader *p = port; if (stats != NULL) memcpy(stats, &p->stats, sizeof(p->stats)); @@ -156,7 +154,7 @@ struct rte_port_ethdev_writer { uint16_t tx_buf_count; uint64_t bsz_mask; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -211,8 +209,7 @@ send_burst(struct rte_port_ethdev_writer *p) static int rte_port_ethdev_writer_tx(void *port, struct rte_mbuf *pkt) { - struct rte_port_ethdev_writer *p = - port; + struct rte_port_ethdev_writer *p = port; p->tx_buf[p->tx_buf_count++] = pkt; RTE_PORT_ETHDEV_WRITER_STATS_PKTS_IN_ADD(p, 1); @@ -227,8 +224,7 @@ rte_port_ethdev_writer_tx_bulk(void *port, struct rte_mbuf **pkts, uint64_t pkts_mask) { - struct rte_port_ethdev_writer *p = - port; + struct rte_port_ethdev_writer *p = port; uint64_t bsz_mask = p->bsz_mask; uint32_t tx_buf_count = p->tx_buf_count; uint64_t expr = (pkts_mask & (pkts_mask + 1)) | @@ -273,8 +269,7 @@ rte_port_ethdev_writer_tx_bulk(void *port, static int rte_port_ethdev_writer_flush(void *port) { - struct rte_port_ethdev_writer *p = - port; + struct rte_port_ethdev_writer *p = port; if (p->tx_buf_count > 0) send_burst(p); @@ -299,8 +294,7 @@ rte_port_ethdev_writer_free(void *port) static int rte_port_ethdev_writer_stats_read(void *port, struct rte_port_out_stats *stats, int clear) { - struct rte_port_ethdev_writer *p = - port; + struct rte_port_ethdev_writer *p = port; if (stats != NULL) memcpy(stats, &p->stats, sizeof(p->stats)); @@ -337,14 +331,13 @@ struct rte_port_ethdev_writer_nodrop { uint64_t bsz_mask; uint64_t n_retries; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * rte_port_ethdev_writer_nodrop_create(void *params, int socket_id) { - struct rte_port_ethdev_writer_nodrop_params *conf = - params; + struct rte_port_ethdev_writer_nodrop_params *conf = params; struct rte_port_ethdev_writer_nodrop *port; /* Check input parameters */ @@ -417,8 +410,7 @@ send_burst_nodrop(struct rte_port_ethdev_writer_nodrop *p) static int rte_port_ethdev_writer_nodrop_tx(void *port, struct rte_mbuf *pkt) { - struct rte_port_ethdev_writer_nodrop *p = - port; + struct rte_port_ethdev_writer_nodrop *p = port; p->tx_buf[p->tx_buf_count++] = pkt; RTE_PORT_ETHDEV_WRITER_NODROP_STATS_PKTS_IN_ADD(p, 1); @@ -433,8 +425,7 @@ rte_port_ethdev_writer_nodrop_tx_bulk(void *port, struct rte_mbuf **pkts, uint64_t pkts_mask) { - struct rte_port_ethdev_writer_nodrop *p = - port; + struct rte_port_ethdev_writer_nodrop *p = port; uint64_t bsz_mask = p->bsz_mask; uint32_t tx_buf_count = p->tx_buf_count; @@ -486,8 +477,7 @@ rte_port_ethdev_writer_nodrop_tx_bulk(void *port, static int rte_port_ethdev_writer_nodrop_flush(void *port) { - struct rte_port_ethdev_writer_nodrop *p = - port; + struct rte_port_ethdev_writer_nodrop *p = port; if (p->tx_buf_count > 0) send_burst_nodrop(p); @@ -512,8 +502,7 @@ rte_port_ethdev_writer_nodrop_free(void *port) static int rte_port_ethdev_writer_nodrop_stats_read(void *port, struct rte_port_out_stats *stats, int clear) { - struct rte_port_ethdev_writer_nodrop *p = - port; + struct rte_port_ethdev_writer_nodrop *p = port; if (stats != NULL) memcpy(stats, &p->stats, sizeof(p->stats)); diff --git a/lib/librte_port/rte_port_ethdev.h b/lib/librte_port/rte_port_ethdev.h index 201a79e41..f5ed9ab2d 100644 --- a/lib/librte_port/rte_port_ethdev.h +++ b/lib/librte_port/rte_port_ethdev.h @@ -54,7 +54,7 @@ extern "C" { /** ethdev_reader port parameters */ struct rte_port_ethdev_reader_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -66,7 +66,7 @@ extern struct rte_port_in_ops rte_port_ethdev_reader_ops; /** ethdev_writer port parameters */ struct rte_port_ethdev_writer_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -82,7 +82,7 @@ extern struct rte_port_out_ops rte_port_ethdev_writer_ops; /** ethdev_writer_nodrop port parameters */ struct rte_port_ethdev_writer_nodrop_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang @ 2017-09-11 9:37 ` Adrien Mazarguil 2017-09-11 10:51 ` Yang, Zhiyong 2017-09-11 10:21 ` Ferruh Yigit 1 sibling, 1 reply; 101+ messages in thread From: Adrien Mazarguil @ 2017-09-11 9:37 UTC (permalink / raw) To: Zhiyong Yang; +Cc: dev, thomas, ferruh.yigit, hemant.agrawal, david.hunt Hi Zhiyong, On Sat, Sep 09, 2017 at 10:47:24PM +0800, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib and drivers > data structures, specifically rte_eth_dev_data. > Modify the APIs, drivers and app using port_id at the same time. > > Fix some checkpatch issues from the original code and remove some > unnecessary cast operations. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Thanks for the mlx4/mlx5 update, I have some comments, see below. By the way, since this commit breaks ABI compatibility for pretty much all public functions in librte_ether and a few in other places, remember to update rte_ethdev_version.map and other affected .map files accordingly. I think this change has to be part of this series. <snip> > diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h > index c0ade4f1a..fe911c3a7 100644 > --- a/drivers/net/mlx4/mlx4.h > +++ b/drivers/net/mlx4/mlx4.h > @@ -334,7 +334,7 @@ struct priv { > } vlan_filter[MLX4_MAX_VLAN_IDS]; /* VLAN filters table. */ > /* Device properties. */ > uint16_t mtu; /* Configured MTU. */ > - uint8_t port; /* Physical port number. */ > + uint16_t port; /* Physical port number. */ > unsigned int started:1; /* Device started, flows enabled. */ > unsigned int promisc:1; /* Device in promiscuous mode. */ > unsigned int allmulti:1; /* Device receives all multicast packets. */ This is a physical port number internal to the device, not DPDK's. Please drop this change. What would need change is struct rxq's port_id field (already large enough) if you want to enforce uint16_t everywhere. > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h > index 43c538419..54a2e8a54 100644 > --- a/drivers/net/mlx5/mlx5.h > +++ b/drivers/net/mlx5/mlx5.h > @@ -114,7 +114,7 @@ struct priv { > unsigned int vlan_filter_n; /* Number of configured VLAN filters. */ > /* Device properties. */ > uint16_t mtu; /* Configured MTU. */ > - uint8_t port; /* Physical port number. */ > + uint16_t port; /* Physical port number. */ Same comment here. > unsigned int started:1; /* Device started, flows enabled. */ > unsigned int promisc_req:1; /* Promiscuous mode requested. */ > unsigned int allmulti_req:1; /* All multicast mode requested. */ > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c > index b0eb3cdfc..58e7cf571 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -75,7 +75,7 @@ struct ethtool_link_settings { > uint32_t cmd; > uint32_t speed; > uint8_t duplex; > - uint8_t port; > + uint16_t port; This is the ethtool interface from the Linux kernel, again this field has to remain 8 bits. That's the kind of mistakes a dedicated type might have prevented by the way, I'm still not convinced that not adding one was the right decision. > uint8_t phy_address; > uint8_t autoneg; > uint8_t mdio_support; > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index 7de1d1086..c47e54fe0 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -112,7 +112,6 @@ struct rxq { > unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ > unsigned int cqe_n:4; /* Log 2 of CQ elements. */ > unsigned int elts_n:4; /* Log 2 of Mbufs. */ > - unsigned int port_id:8; > unsigned int rss_hash:1; /* RSS hash result is enabled. */ > unsigned int mark:1; /* Marked flow available on the queue. */ > unsigned int pending_err:1; /* CQE error needs to be handled. */ > @@ -120,6 +119,7 @@ struct rxq { > unsigned int :6; /* Remaining bits. */ > volatile uint32_t *rq_db; > volatile uint32_t *cq_db; > + uint16_t port_id; > uint16_t rq_ci; > uint16_t rq_pi; > uint16_t cq_ci; This change might have a performance impact. All important fields are found at the beginning of this structure for that reason. Since there's not enough room in the above bit-field (8 + 6), I guess there's no other choice for now, however you should at least update the "Remaining bits" comment. <snip> -- Adrien Mazarguil 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-11 9:37 ` Adrien Mazarguil @ 2017-09-11 10:51 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-11 10:51 UTC (permalink / raw) To: Adrien Mazarguil; +Cc: dev, thomas, Yigit, Ferruh, hemant.agrawal, Hunt, David Hi, Adrien: Thanks for your reviews. Reply inline. > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Monday, September 11, 2017 5:37 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com> > Cc: dev@dpdk.org; thomas@monjalon.net; Yigit, Ferruh > <ferruh.yigit@intel.com>; hemant.agrawal@nxp.com; Hunt, David > <david.hunt@intel.com> > Subject: Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range > > Hi Zhiyong, > > On Sat, Sep 09, 2017 at 10:47:24PM +0800, Zhiyong Yang wrote: > > Extend port_id definition from uint8_t to uint16_t in lib and drivers > > data structures, specifically rte_eth_dev_data. > > Modify the APIs, drivers and app using port_id at the same time. > > > > Fix some checkpatch issues from the original code and remove some > > unnecessary cast operations. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > Thanks for the mlx4/mlx5 update, I have some comments, see below. > > By the way, since this commit breaks ABI compatibility for pretty much all public > functions in librte_ether and a few in other places, remember to update > rte_ethdev_version.map and other affected .map files accordingly. > I think this change has to be part of this series. Thanks a lot for your reminder. > > <snip> > > diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index > > c0ade4f1a..fe911c3a7 100644 > > --- a/drivers/net/mlx4/mlx4.h > > +++ b/drivers/net/mlx4/mlx4.h > > @@ -334,7 +334,7 @@ struct priv { > > } vlan_filter[MLX4_MAX_VLAN_IDS]; /* VLAN filters table. */ > > /* Device properties. */ > > uint16_t mtu; /* Configured MTU. */ > > - uint8_t port; /* Physical port number. */ > > + uint16_t port; /* Physical port number. */ > > unsigned int started:1; /* Device started, flows enabled. */ > > unsigned int promisc:1; /* Device in promiscuous mode. */ > > unsigned int allmulti:1; /* Device receives all multicast packets. > > */ > > This is a physical port number internal to the device, not DPDK's. Please drop this > change. My bad. Drop it. > > What would need change is struct rxq's port_id field (already large enough) if > you want to enforce uint16_t everywhere. Ok. > > > diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index > > 43c538419..54a2e8a54 100644 > > --- a/drivers/net/mlx5/mlx5.h > > +++ b/drivers/net/mlx5/mlx5.h > > @@ -114,7 +114,7 @@ struct priv { > > unsigned int vlan_filter_n; /* Number of configured VLAN filters. */ > > /* Device properties. */ > > uint16_t mtu; /* Configured MTU. */ > > - uint8_t port; /* Physical port number. */ > > + uint16_t port; /* Physical port number. */ > > Same comment here. Drop it. > > > unsigned int started:1; /* Device started, flows enabled. */ > > unsigned int promisc_req:1; /* Promiscuous mode requested. */ > > unsigned int allmulti_req:1; /* All multicast mode requested. */ > > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > > b/drivers/net/mlx5/mlx5_ethdev.c index b0eb3cdfc..58e7cf571 100644 > > --- a/drivers/net/mlx5/mlx5_ethdev.c > > +++ b/drivers/net/mlx5/mlx5_ethdev.c > > @@ -75,7 +75,7 @@ struct ethtool_link_settings { > > uint32_t cmd; > > uint32_t speed; > > uint8_t duplex; > > - uint8_t port; > > + uint16_t port; > > This is the ethtool interface from the Linux kernel, again this field has to remain > 8 bits. > > That's the kind of mistakes a dedicated type might have prevented by the way, > I'm still not convinced that not adding one was the right decision. > Ok. I see. > > uint8_t phy_address; > > uint8_t autoneg; > > uint8_t mdio_support; > > diff --git a/drivers/net/mlx5/mlx5_rxtx.h > > b/drivers/net/mlx5/mlx5_rxtx.h index 7de1d1086..c47e54fe0 100644 > > --- a/drivers/net/mlx5/mlx5_rxtx.h > > +++ b/drivers/net/mlx5/mlx5_rxtx.h > > @@ -112,7 +112,6 @@ struct rxq { > > unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ > > unsigned int cqe_n:4; /* Log 2 of CQ elements. */ > > unsigned int elts_n:4; /* Log 2 of Mbufs. */ > > - unsigned int port_id:8; > > unsigned int rss_hash:1; /* RSS hash result is enabled. */ > > unsigned int mark:1; /* Marked flow available on the queue. */ > > unsigned int pending_err:1; /* CQE error needs to be handled. */ @@ > > -120,6 +119,7 @@ struct rxq { > > unsigned int :6; /* Remaining bits. */ > > volatile uint32_t *rq_db; > > volatile uint32_t *cq_db; > > + uint16_t port_id; > > uint16_t rq_ci; > > uint16_t rq_pi; > > uint16_t cq_ci; > > This change might have a performance impact. All important fields are found at > the beginning of this structure for that reason. Since there's not enough room in > the above bit-field (8 + 6), I guess there's no other choice for now, however you > should at least update the "Remaining bits" comment. > Ok . Thanks again for your pointing out. Adrien. Zhiyong > <snip> > > -- > Adrien Mazarguil > 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang 2017-09-11 9:37 ` Adrien Mazarguil @ 2017-09-11 10:21 ` Ferruh Yigit 2017-09-13 2:26 ` Yang, Zhiyong 1 sibling, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-11 10:21 UTC (permalink / raw) To: Zhiyong Yang, dev, Declan Doherty, Wenzhuo Lu Cc: thomas, hemant.agrawal, david.hunt On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib and drivers > data structures, specifically rte_eth_dev_data. > Modify the APIs, drivers and app using port_id at the same time. > > Fix some checkpatch issues from the original code and remove some > unnecessary cast operations. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> <...> > @@ -283,7 +283,7 @@ enum dcb_mode_enable > #define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */ > > struct queue_stats_mappings { > - uint8_t port_id; > + uint16_t port_id; Can this be "portid_t port_id;" ? For testpmd, portid_t can be used for all port_id declarations. <...> > --- a/drivers/net/bnx2x/bnx2x.c > +++ b/drivers/net/bnx2x/bnx2x.c > @@ -703,7 +703,7 @@ bnx2x_gpio_mult_write(struct bnx2x_softc *sc, uint8_t pins, uint32_t mode) > > static int > bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, > - uint8_t port) > + uint8_t port) If port storage type will not change, no need to update this line. It is good to fix syntax the lines touched, but for the lines not updated please don't fix the syntax in this patch. > { > /* The GPIO should be swapped if swap register is set and active */ > int gpio_port = ((REG_RD(sc, NIG_REG_PORT_SWAP) && > @@ -749,7 +749,7 @@ bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, > } > > uint32_t > -elink_cb_gpio_read(struct bnx2x_softc * sc, uint16_t gpio_num, uint8_t port) > +elink_cb_gpio_read(struct bnx2x_softc *sc, uint16_t gpio_num, uint8_t port) Same here. > { > return bnx2x_gpio_read(sc, gpio_num, port); > } > diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h > index 2e38ec26a..48d540476 100644 > --- a/drivers/net/bnx2x/bnx2x_rxtx.h > +++ b/drivers/net/bnx2x/bnx2x_rxtx.h > @@ -41,7 +41,7 @@ struct bnx2x_rx_queue { > uint16_t rx_cq_head; /**< Index of current rcq bd. */ > uint16_t rx_cq_tail; /**< Index of last rcq bd. */ > uint16_t queue_id; /**< RX queue index. */ > - uint8_t port_id; /**< Device port identifier. */ > + uint16_t port_id; /**< Device port identifier. */ Please fix comment allignment. > struct bnx2x_softc *sc; /**< Ptr to dev_private data. */ > }; <...> > @@ -500,7 +501,7 @@ elink_status_t elink_phy_probe(struct elink_params *params); > > /* Checks if fan failure detection is required on one of the phys on board */ > uint8_t elink_fan_failure_det_req(struct bnx2x_softc *sc, uint32_t shmem_base, > - uint32_t shmem2_base, uint8_t port); > + uint32_t shmem2_base, uint8_t port); no change, please drop. <...> > @@ -511,7 +511,6 @@ mux_machine(struct bond_dev_private *internals, uint8_t slave_id) > ACTOR_STATE_CLR(port, SYNCHRONIZATION); > MODE4_DEBUG("Out of sync -> ATTACHED\n"); > } > - Please drop this one. <...> > @@ -1022,12 +1022,12 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) > > int > bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev, > - uint8_t slave_id) > + uint16_t slave_id) The coding style for multiple lines in a function call is two tabs or alternatively allign to the paranthesis. Original code synyax looks good here, no need to update. <...> > @@ -1536,17 +1536,12 @@ rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, > return 0; > } > BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); > -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, > +MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint16_t port_id, Hmm, this is tricky! The macro MAP_STATIC_SYMBOL is used for ABI versioning, but changing the port_id storage type breaks the ABI already. ABI versioning can be removed completely. Cc'ed Declan. Which also reminds me that bonding LIBABIVER needs to be updated. This is also required for all i40e, ixgbe and bnxt. Please let me know if you need help here. <...> > @@ -1622,12 +1618,13 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) > ACTOR_STATE_SET(port, COLLECTING); > else > ACTOR_STATE_CLR(port, COLLECTING); > - > + printf("enabled port->actor_state = %d \r\n", port->actor_state); Is this a git rebase error ? <...> > @@ -586,13 +588,14 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], > if (internals->active_slave_count > len) > return -1; > > - memcpy(slaves, internals->active_slaves, internals->active_slave_count); > + memcpy(slaves, internals->active_slaves, > + internals->active_slave_count * sizeof(internals->active_slaves[0])); Good catch! I wonder if there are more like this, did you traced all memcpy, memset, etc.. ? <...> > --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c > +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c > @@ -38,7 +38,7 @@ > #include "rte_pmd_ixgbe.h" > > int > -rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, > +rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, > struct ether_addr *mac_addr) ixgbe LIBABIVER also needs to be updated. I have just recognized that release notes missing this library, I will add. <...> > --- a/drivers/net/vmxnet3/vmxnet3_ring.h > +++ b/drivers/net/vmxnet3/vmxnet3_ring.h > @@ -143,8 +143,8 @@ typedef struct vmxnet3_tx_queue { > struct vmxnet3_txq_stats stats; > const struct rte_memzone *mz; > bool stopped; > - uint16_t queue_id; /**< Device TX queue index. */ > - uint8_t port_id; /**< Device port identifier. */ > + uint16_t queue_id; /**< Device TX queue index. */ No need to change "queue_id" here, if this is for comment allignment, please allign the port_id one. > + uint16_t port_id; /**< Device port identifier. */ > uint16_t txdata_desc_size; > } vmxnet3_tx_queue_t; > > @@ -178,8 +178,8 @@ typedef struct vmxnet3_rx_queue { > struct vmxnet3_rxq_stats stats; > const struct rte_memzone *mz; > bool stopped; > - uint16_t queue_id; /**< Device RX queue index. */ > - uint8_t port_id; /**< Device port identifier. */ > + uint16_t queue_id; /**< Device RX queue index. */ same as above. <...> > @@ -94,8 +94,7 @@ rte_port_ethdev_reader_create(void *params, int socket_id) > static int > rte_port_ethdev_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts) > { > - struct rte_port_ethdev_reader *p = > - port; > + struct rte_port_ethdev_reader *p = port; This is a good syntax correction, but this patch is already big, please drop these ones. > uint16_t rx_pkt_cnt; > > rx_pkt_cnt = rte_eth_rx_burst(p->port_id, p->queue_id, pkts, n_pkts); > @@ -119,8 +118,7 @@ rte_port_ethdev_reader_free(void *port) > static int rte_port_ethdev_reader_stats_read(void *port, > struct rte_port_in_stats *stats, int clear) > { > - struct rte_port_ethdev_reader *p = > - port; > + struct rte_port_ethdev_reader *p = port; same as above, and there are few more below. <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-11 10:21 ` Ferruh Yigit @ 2017-09-13 2:26 ` Yang, Zhiyong 2017-09-13 11:56 ` Ferruh Yigit 2017-09-14 12:49 ` Ferruh Yigit 0 siblings, 2 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-13 2:26 UTC (permalink / raw) To: Yigit, Ferruh, dev, Doherty, Declan, Lu, Wenzhuo Cc: thomas, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin Hi Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Monday, September 11, 2017 6:22 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, Declan > <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com> > Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David > <david.hunt@intel.com> > Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range > > On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > > Extend port_id definition from uint8_t to uint16_t in lib and drivers > > data structures, specifically rte_eth_dev_data. > > Modify the APIs, drivers and app using port_id at the same time. > > > > Fix some checkpatch issues from the original code and remove some > > unnecessary cast operations. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > <...> > > > @@ -283,7 +283,7 @@ enum dcb_mode_enable #define > > MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 > > rx_queues/port */ > > > > struct queue_stats_mappings { > > - uint8_t port_id; > > + uint16_t port_id; > > Can this be "portid_t port_id;" ? For testpmd, portid_t can be used for all port_id > declarations. > Ferruh, the suggestion has been discussed in the following thread. Most of people agree on The basic type uint16_t. :). Your suggestion was my preference previously. At last, I make this decision to use uint16_t. You know, whatever I use, some ones will stand out and Say the other is better. :) http://www.dpdk.org/dev/patchwork/patch/23208/ > <...> > > > --- a/drivers/net/bnx2x/bnx2x.c > > +++ b/drivers/net/bnx2x/bnx2x.c > > @@ -703,7 +703,7 @@ bnx2x_gpio_mult_write(struct bnx2x_softc *sc, > > uint8_t pins, uint32_t mode) > > > > static int > > bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t mode, > > - uint8_t port) > > + uint8_t port) > > If port storage type will not change, no need to update this line. It is good to fix > syntax the lines touched, but for the lines not updated please don't fix the syntax > in this patch. Ok > > > { > > /* The GPIO should be swapped if swap register is set and active */ > > int gpio_port = ((REG_RD(sc, NIG_REG_PORT_SWAP) && @@ -749,7 > +749,7 > > @@ bnx2x_gpio_int_write(struct bnx2x_softc *sc, int gpio_num, uint32_t > > mode, } > > > > uint32_t > > -elink_cb_gpio_read(struct bnx2x_softc * sc, uint16_t gpio_num, > > uint8_t port) > > +elink_cb_gpio_read(struct bnx2x_softc *sc, uint16_t gpio_num, uint8_t > > +port) > > Same here. Ok. > > > { > > return bnx2x_gpio_read(sc, gpio_num, port); } diff --git > > a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h > > index 2e38ec26a..48d540476 100644 > > --- a/drivers/net/bnx2x/bnx2x_rxtx.h > > +++ b/drivers/net/bnx2x/bnx2x_rxtx.h > > @@ -41,7 +41,7 @@ struct bnx2x_rx_queue { > > uint16_t rx_cq_head; /**< Index of current rcq bd. */ > > uint16_t rx_cq_tail; /**< Index of last rcq bd. */ > > uint16_t queue_id; /**< RX queue index. */ > > - uint8_t port_id; /**< Device port identifier. */ > > + uint16_t port_id; /**< Device port identifier. */ > > Please fix comment allignment. > Ok. > > struct bnx2x_softc *sc; /**< Ptr to dev_private data. */ > > }; > > <...> > > > @@ -500,7 +501,7 @@ elink_status_t elink_phy_probe(struct elink_params > > *params); > > > > /* Checks if fan failure detection is required on one of the phys on > > board */ uint8_t elink_fan_failure_det_req(struct bnx2x_softc *sc, uint32_t > shmem_base, > > - uint32_t shmem2_base, uint8_t port); > > + uint32_t shmem2_base, uint8_t port); > > no change, please drop. > Ok > <...> > > > @@ -511,7 +511,6 @@ mux_machine(struct bond_dev_private *internals, > uint8_t slave_id) > > ACTOR_STATE_CLR(port, SYNCHRONIZATION); > > MODE4_DEBUG("Out of sync -> ATTACHED\n"); > > } > > - > > Please drop this one. Ok > > <...> > > @@ -1022,12 +1022,12 @@ bond_mode_8023ad_activate_slave(struct > > rte_eth_dev *bond_dev, uint8_t slave_id) > > > > int > > bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev, > > - uint8_t slave_id) > > + uint16_t slave_id) > > The coding style for multiple lines in a function call is two tabs or alternatively > allign to the paranthesis. Original code synyax looks good here, no need to > update. > Ok > <...> > > > @@ -1536,17 +1536,12 @@ rte_eth_bond_8023ad_setup_v1708(uint8_t > port_id, > > return 0; > > } > > BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); > > -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, > > +MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint16_t port_id, > > Hmm, this is tricky! > The macro MAP_STATIC_SYMBOL is used for ABI versioning, but changing the > port_id storage type breaks the ABI already. ABI versioning can be removed > completely. Cc'ed Declan. > Do you mean that I should remove > > -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, ? > Which also reminds me that bonding LIBABIVER needs to be updated. This is also > required for all i40e, ixgbe and bnxt. Please let me know if you need help here. > Yes. I'm not clear about it. Need help Ferruh. > <...> > > > @@ -1622,12 +1618,13 @@ rte_eth_bond_8023ad_ext_collect(uint8_t > port_id, uint8_t slave_id, int enabled) > > ACTOR_STATE_SET(port, COLLECTING); > > else > > ACTOR_STATE_CLR(port, COLLECTING); > > - > > + printf("enabled port->actor_state = %d \r\n", port->actor_state); > > Is this a git rebase error ? > My bad. Remove it. > <...> > > > @@ -586,13 +588,14 @@ rte_eth_bond_active_slaves_get(uint8_t > bonded_port_id, uint8_t slaves[], > > if (internals->active_slave_count > len) > > return -1; > > > > - memcpy(slaves, internals->active_slaves, internals->active_slave_count); > > + memcpy(slaves, internals->active_slaves, > > + internals->active_slave_count * > > +sizeof(internals->active_slaves[0])); > > Good catch! > I wonder if there are more like this, did you traced all memcpy, memset, etc.. ? > The code caused failures when I test bonding driver in test code. and I will fix them if I trace. > <...> > > > --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c > > +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c > > @@ -38,7 +38,7 @@ > > #include "rte_pmd_ixgbe.h" > > > > int > > -rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, > > +rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, > > struct ether_addr *mac_addr) > > ixgbe LIBABIVER also needs to be updated. > > I have just recognized that release notes missing this library, I will add. > thanks > <...> > > > --- a/drivers/net/vmxnet3/vmxnet3_ring.h > > +++ b/drivers/net/vmxnet3/vmxnet3_ring.h > > @@ -143,8 +143,8 @@ typedef struct vmxnet3_tx_queue { > > struct vmxnet3_txq_stats stats; > > const struct rte_memzone *mz; > > bool stopped; > > - uint16_t queue_id; /**< Device TX queue index. */ > > - uint8_t port_id; /**< Device port identifier. */ > > + uint16_t queue_id; /**< Device TX queue index. */ > > No need to change "queue_id" here, if this is for comment allignment, please > allign the port_id one. > Ok. > > + uint16_t port_id; /**< Device port identifier. */ > > uint16_t txdata_desc_size; > > } vmxnet3_tx_queue_t; > > > > @@ -178,8 +178,8 @@ typedef struct vmxnet3_rx_queue { > > struct vmxnet3_rxq_stats stats; > > const struct rte_memzone *mz; > > bool stopped; > > - uint16_t queue_id; /**< Device RX queue index. */ > > - uint8_t port_id; /**< Device port identifier. */ > > + uint16_t queue_id; /**< Device RX queue index. */ > > same as above. > Ok. > <...> > > > @@ -94,8 +94,7 @@ rte_port_ethdev_reader_create(void *params, int > > socket_id) static int rte_port_ethdev_reader_rx(void *port, struct > > rte_mbuf **pkts, uint32_t n_pkts) { > > - struct rte_port_ethdev_reader *p = > > - port; > > + struct rte_port_ethdev_reader *p = port; > > This is a good syntax correction, but this patch is already big, please drop these > ones. Ok. I should focus on port id range increase . :) > > > uint16_t rx_pkt_cnt; > > > > rx_pkt_cnt = rte_eth_rx_burst(p->port_id, p->queue_id, pkts, > > n_pkts); @@ -119,8 +118,7 @@ rte_port_ethdev_reader_free(void *port) > > static int rte_port_ethdev_reader_stats_read(void *port, > > struct rte_port_in_stats *stats, int clear) { > > - struct rte_port_ethdev_reader *p = > > - port; > > + struct rte_port_ethdev_reader *p = port; > > same as above, and there are few more below. > Ok > <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-13 2:26 ` Yang, Zhiyong @ 2017-09-13 11:56 ` Ferruh Yigit 2017-09-13 12:15 ` Yang, Zhiyong 2017-09-13 12:18 ` Thomas Monjalon 2017-09-14 12:49 ` Ferruh Yigit 1 sibling, 2 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-09-13 11:56 UTC (permalink / raw) To: Yang, Zhiyong, dev, Doherty, Declan, Lu, Wenzhuo Cc: thomas, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin On 9/13/2017 3:26 AM, Yang, Zhiyong wrote: > Hi Ferruh, > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Monday, September 11, 2017 6:22 PM >> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, Declan >> <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com> >> Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David >> <david.hunt@intel.com> >> Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range >> >> On 9/9/2017 3:47 PM, Zhiyong Yang wrote: >>> Extend port_id definition from uint8_t to uint16_t in lib and drivers >>> data structures, specifically rte_eth_dev_data. >>> Modify the APIs, drivers and app using port_id at the same time. >>> >>> Fix some checkpatch issues from the original code and remove some >>> unnecessary cast operations. >>> >>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> >> >> <...> >> >>> @@ -283,7 +283,7 @@ enum dcb_mode_enable #define >>> MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 >>> rx_queues/port */ >>> >>> struct queue_stats_mappings { >>> - uint8_t port_id; >>> + uint16_t port_id; >> >> Can this be "portid_t port_id;" ? For testpmd, portid_t can be used for all port_id >> declarations. >> > > Ferruh, the suggestion has been discussed in the following thread. Most of people agree on > The basic type uint16_t. :). Your suggestion was my preference previously. > At last, I make this decision to use uint16_t. You know, whatever I use, some ones will stand out and > Say the other is better. :) > http://www.dpdk.org/dev/patchwork/patch/23208/ This discussion was whole dpdk, my comment is for testpmd only. Testpmd already defines "portid_t" and uses it in many places [1]. I am saying why keep using "uint16_t" in some places in testpmd? Lets switch all to "portid_t" while we are touching them all. [1] -typedef uint8_t portid_t; +typedef uint16_t portid_t; <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-13 11:56 ` Ferruh Yigit @ 2017-09-13 12:15 ` Yang, Zhiyong 2017-09-13 12:18 ` Thomas Monjalon 1 sibling, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-13 12:15 UTC (permalink / raw) To: Yigit, Ferruh, dev, Doherty, Declan, Lu, Wenzhuo Cc: thomas, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin Hi Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, September 13, 2017 7:57 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, Declan > <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com> > Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David > <david.hunt@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; > Ananyev, Konstantin <konstantin.ananyev@intel.com> > Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range > > On 9/13/2017 3:26 AM, Yang, Zhiyong wrote: > > Hi Ferruh, > > > >> -----Original Message----- > >> From: Yigit, Ferruh > >> Sent: Monday, September 11, 2017 6:22 PM > >> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, > Declan > >> <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com> > >> Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David > >> <david.hunt@intel.com> > >> Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range > >> > >> On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > >>> Extend port_id definition from uint8_t to uint16_t in lib and drivers > >>> data structures, specifically rte_eth_dev_data. > >>> Modify the APIs, drivers and app using port_id at the same time. > >>> > >>> Fix some checkpatch issues from the original code and remove some > >>> unnecessary cast operations. > >>> > >>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > >> > >> <...> > >> > >>> @@ -283,7 +283,7 @@ enum dcb_mode_enable #define > >>> MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 > >>> rx_queues/port */ > >>> > >>> struct queue_stats_mappings { > >>> - uint8_t port_id; > >>> + uint16_t port_id; > >> > >> Can this be "portid_t port_id;" ? For testpmd, portid_t can be used for all > port_id > >> declarations. > >> > > > > Ferruh, the suggestion has been discussed in the following thread. Most of > people agree on > > The basic type uint16_t. :). Your suggestion was my preference previously. > > At last, I make this decision to use uint16_t. You know, whatever I use, some > ones will stand out and > > Say the other is better. :) > > http://www.dpdk.org/dev/patchwork/patch/23208/ > > This discussion was whole dpdk, my comment is for testpmd only. > > Testpmd already defines "portid_t" and uses it in many places [1]. I am > saying why keep using "uint16_t" in some places in testpmd? Lets switch > all to "portid_t" while we are touching them all. Make sense. Do it as you say. Thanks for the suggestion. Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-13 11:56 ` Ferruh Yigit 2017-09-13 12:15 ` Yang, Zhiyong @ 2017-09-13 12:18 ` Thomas Monjalon 2017-09-13 13:33 ` Ferruh Yigit 1 sibling, 1 reply; 101+ messages in thread From: Thomas Monjalon @ 2017-09-13 12:18 UTC (permalink / raw) To: Ferruh Yigit Cc: Yang, Zhiyong, dev, Doherty, Declan, Lu, Wenzhuo, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin 13/09/2017 13:56, Ferruh Yigit: > On 9/13/2017 3:26 AM, Yang, Zhiyong wrote: > > From: Yigit, Ferruh > >> On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > >>> Extend port_id definition from uint8_t to uint16_t in lib and drivers > >>> data structures, specifically rte_eth_dev_data. > >>> Modify the APIs, drivers and app using port_id at the same time. > >>> > >>> Fix some checkpatch issues from the original code and remove some > >>> unnecessary cast operations. > >>> > >>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > >> > >> <...> > >> > >>> @@ -283,7 +283,7 @@ enum dcb_mode_enable #define > >>> MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 > >>> rx_queues/port */ > >>> > >>> struct queue_stats_mappings { > >>> - uint8_t port_id; > >>> + uint16_t port_id; > >> > >> Can this be "portid_t port_id;" ? For testpmd, portid_t can be used for all port_id > >> declarations. > >> > > > > Ferruh, the suggestion has been discussed in the following thread. Most of people agree on > > The basic type uint16_t. :). Your suggestion was my preference previously. > > At last, I make this decision to use uint16_t. You know, whatever I use, some ones will stand out and > > Say the other is better. :) > > http://www.dpdk.org/dev/patchwork/patch/23208/ > > This discussion was whole dpdk, my comment is for testpmd only. > > Testpmd already defines "portid_t" and uses it in many places [1]. I am > saying why keep using "uint16_t" in some places in testpmd? Lets switch > all to "portid_t" while we are touching them all. > > [1] > -typedef uint8_t portid_t; > +typedef uint16_t portid_t; Or the reverse, we can drop portid_t from testpmd, especially if it is not used everywhere in testpmd. Note: this typedef hides the size of the port, which may be important when optimizing code. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-13 12:18 ` Thomas Monjalon @ 2017-09-13 13:33 ` Ferruh Yigit 2017-09-19 6:05 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-13 13:33 UTC (permalink / raw) To: Thomas Monjalon Cc: Yang, Zhiyong, dev, Doherty, Declan, Lu, Wenzhuo, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin On 9/13/2017 1:18 PM, Thomas Monjalon wrote: > 13/09/2017 13:56, Ferruh Yigit: >> On 9/13/2017 3:26 AM, Yang, Zhiyong wrote: >>> From: Yigit, Ferruh >>>> On 9/9/2017 3:47 PM, Zhiyong Yang wrote: >>>>> Extend port_id definition from uint8_t to uint16_t in lib and drivers >>>>> data structures, specifically rte_eth_dev_data. >>>>> Modify the APIs, drivers and app using port_id at the same time. >>>>> >>>>> Fix some checkpatch issues from the original code and remove some >>>>> unnecessary cast operations. >>>>> >>>>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> >>>> >>>> <...> >>>> >>>>> @@ -283,7 +283,7 @@ enum dcb_mode_enable #define >>>>> MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 >>>>> rx_queues/port */ >>>>> >>>>> struct queue_stats_mappings { >>>>> - uint8_t port_id; >>>>> + uint16_t port_id; >>>> >>>> Can this be "portid_t port_id;" ? For testpmd, portid_t can be used for all port_id >>>> declarations. >>>> >>> >>> Ferruh, the suggestion has been discussed in the following thread. Most of people agree on >>> The basic type uint16_t. :). Your suggestion was my preference previously. >>> At last, I make this decision to use uint16_t. You know, whatever I use, some ones will stand out and >>> Say the other is better. :) >>> http://www.dpdk.org/dev/patchwork/patch/23208/ >> >> This discussion was whole dpdk, my comment is for testpmd only. >> >> Testpmd already defines "portid_t" and uses it in many places [1]. I am >> saying why keep using "uint16_t" in some places in testpmd? Lets switch >> all to "portid_t" while we are touching them all. >> >> [1] >> -typedef uint8_t portid_t; >> +typedef uint16_t portid_t; > > Or the reverse, we can drop portid_t from testpmd, especially if it is > not used everywhere in testpmd. > Note: this typedef hides the size of the port, which may be important > when optimizing code. No strong opinion about keeping "uint16_t" or "portid_t", "portid_t" is already in use, not sure if worth the effort to remove it. But I am for unifying the storage type used, one or other. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-13 13:33 ` Ferruh Yigit @ 2017-09-19 6:05 ` Yang, Zhiyong 2017-09-19 12:30 ` Wiles, Keith 0 siblings, 1 reply; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-19 6:05 UTC (permalink / raw) To: Yigit, Ferruh, Thomas Monjalon Cc: dev, Doherty, Declan, Lu, Wenzhuo, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, September 13, 2017 9:33 PM > To: Thomas Monjalon <thomas@monjalon.net> > Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, Declan > <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; > hemant.agrawal@nxp.com; Hunt, David <david.hunt@intel.com>; Richardson, > Bruce <bruce.richardson@intel.com>; Ananyev, Konstantin > <konstantin.ananyev@intel.com> > Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range > > On 9/13/2017 1:18 PM, Thomas Monjalon wrote: > > 13/09/2017 13:56, Ferruh Yigit: > >> On 9/13/2017 3:26 AM, Yang, Zhiyong wrote: > >>> From: Yigit, Ferruh > >>>> On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > >>>>> Extend port_id definition from uint8_t to uint16_t in lib and > >>>>> drivers data structures, specifically rte_eth_dev_data. > >>>>> Modify the APIs, drivers and app using port_id at the same time. > >>>>> > >>>>> Fix some checkpatch issues from the original code and remove some > >>>>> unnecessary cast operations. > >>>>> > >>>>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > >>>> > >>>> <...> > >>>> > >>>>> @@ -283,7 +283,7 @@ enum dcb_mode_enable #define > >>>>> MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 > >>>>> rx_queues/port */ > >>>>> > >>>>> struct queue_stats_mappings { > >>>>> - uint8_t port_id; > >>>>> + uint16_t port_id; > >>>> > >>>> Can this be "portid_t port_id;" ? For testpmd, portid_t can be used > >>>> for all port_id declarations. > >>>> > >>> > >>> Ferruh, the suggestion has been discussed in the following thread. > >>> Most of people agree on The basic type uint16_t. :). Your suggestion was > my preference previously. > >>> At last, I make this decision to use uint16_t. You know, whatever I > >>> use, some ones will stand out and Say the other is better. :) > >>> http://www.dpdk.org/dev/patchwork/patch/23208/ > >> > >> This discussion was whole dpdk, my comment is for testpmd only. > >> > >> Testpmd already defines "portid_t" and uses it in many places [1]. I > >> am saying why keep using "uint16_t" in some places in testpmd? Lets > >> switch all to "portid_t" while we are touching them all. > >> > >> [1] > >> -typedef uint8_t portid_t; > >> +typedef uint16_t portid_t; > > > > Or the reverse, we can drop portid_t from testpmd, especially if it is > > not used everywhere in testpmd. > > Note: this typedef hides the size of the port, which may be important > > when optimizing code. > > No strong opinion about keeping "uint16_t" or "portid_t", "portid_t" is already in > use, not sure if worth the effort to remove it. > > But I am for unifying the storage type used, one or other. Think again. If basic type can bring the benefit as Thomas said, we may consider to use uint16_t instead of portid_t in testpmd. Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-19 6:05 ` Yang, Zhiyong @ 2017-09-19 12:30 ` Wiles, Keith 0 siblings, 0 replies; 101+ messages in thread From: Wiles, Keith @ 2017-09-19 12:30 UTC (permalink / raw) To: Yang, Zhiyong Cc: Yigit, Ferruh, Thomas Monjalon, dev, Doherty, Declan, Lu, Wenzhuo, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin > On Sep 19, 2017, at 1:05 AM, Yang, Zhiyong <zhiyong.yang@intel.com> wrote: > > > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Wednesday, September 13, 2017 9:33 PM >> To: Thomas Monjalon <thomas@monjalon.net> >> Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, Declan >> <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; >> hemant.agrawal@nxp.com; Hunt, David <david.hunt@intel.com>; Richardson, >> Bruce <bruce.richardson@intel.com>; Ananyev, Konstantin >> <konstantin.ananyev@intel.com> >> Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range >> >> On 9/13/2017 1:18 PM, Thomas Monjalon wrote: >>> 13/09/2017 13:56, Ferruh Yigit: >>>> On 9/13/2017 3:26 AM, Yang, Zhiyong wrote: >>>>> From: Yigit, Ferruh >>>>>> On 9/9/2017 3:47 PM, Zhiyong Yang wrote: >>>>>>> Extend port_id definition from uint8_t to uint16_t in lib and >>>>>>> drivers data structures, specifically rte_eth_dev_data. >>>>>>> Modify the APIs, drivers and app using port_id at the same time. >>>>>>> >>>>>>> Fix some checkpatch issues from the original code and remove some >>>>>>> unnecessary cast operations. >>>>>>> >>>>>>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> >>>>>> >>>>>> <...> >>>>>> >>>>>>> @@ -283,7 +283,7 @@ enum dcb_mode_enable #define >>>>>>> MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 >>>>>>> rx_queues/port */ >>>>>>> >>>>>>> struct queue_stats_mappings { >>>>>>> - uint8_t port_id; >>>>>>> + uint16_t port_id; >>>>>> >>>>>> Can this be "portid_t port_id;" ? For testpmd, portid_t can be used >>>>>> for all port_id declarations. >>>>>> >>>>> >>>>> Ferruh, the suggestion has been discussed in the following thread. >>>>> Most of people agree on The basic type uint16_t. :). Your suggestion was >> my preference previously. >>>>> At last, I make this decision to use uint16_t. You know, whatever I >>>>> use, some ones will stand out and Say the other is better. :) >>>>> http://www.dpdk.org/dev/patchwork/patch/23208/ >>>> >>>> This discussion was whole dpdk, my comment is for testpmd only. >>>> >>>> Testpmd already defines "portid_t" and uses it in many places [1]. I >>>> am saying why keep using "uint16_t" in some places in testpmd? Lets >>>> switch all to "portid_t" while we are touching them all. >>>> >>>> [1] >>>> -typedef uint8_t portid_t; >>>> +typedef uint16_t portid_t; >>> >>> Or the reverse, we can drop portid_t from testpmd, especially if it is >>> not used everywhere in testpmd. >>> Note: this typedef hides the size of the port, which may be important >>> when optimizing code. >> >> No strong opinion about keeping "uint16_t" or "portid_t", "portid_t" is already in >> use, not sure if worth the effort to remove it. >> >> But I am for unifying the storage type used, one or other. > > Think again. If basic type can bring the benefit as Thomas said, we may consider to use uint16_t instead of portid_t in testpmd. We have already decided to use uint16_t for the port ID type and we should convert testpmd to use that typedef instead of the one it is using. I know this changes testpmd a bit, but it is also very low risk to testpmd. > > Zhiyong Regards, Keith ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-13 2:26 ` Yang, Zhiyong 2017-09-13 11:56 ` Ferruh Yigit @ 2017-09-14 12:49 ` Ferruh Yigit 2017-09-15 5:11 ` Yang, Zhiyong 1 sibling, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-14 12:49 UTC (permalink / raw) To: Yang, Zhiyong, dev, Doherty, Declan, Lu, Wenzhuo Cc: thomas, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin On 9/13/2017 3:26 AM, Yang, Zhiyong wrote: > Hi Ferruh, > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Monday, September 11, 2017 6:22 PM >> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, Declan >> <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com> >> Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David >> <david.hunt@intel.com> >> Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range >> >> On 9/9/2017 3:47 PM, Zhiyong Yang wrote: >>> Extend port_id definition from uint8_t to uint16_t in lib and drivers >>> data structures, specifically rte_eth_dev_data. >>> Modify the APIs, drivers and app using port_id at the same time. >>> >>> Fix some checkpatch issues from the original code and remove some >>> unnecessary cast operations. >>> >>> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> >> <...> >>> @@ -1536,17 +1536,12 @@ rte_eth_bond_8023ad_setup_v1708(uint8_t >> port_id, >>> return 0; >>> } >>> BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); >>> -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, >>> +MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint16_t port_id, >> >> Hmm, this is tricky! >> The macro MAP_STATIC_SYMBOL is used for ABI versioning, but changing the >> port_id storage type breaks the ABI already. ABI versioning can be removed >> completely. Cc'ed Declan. >> > Do you mean that I should remove >>> -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, ? > >> Which also reminds me that bonding LIBABIVER needs to be updated. This is also >> required for all i40e, ixgbe and bnxt. Please let me know if you need help here. >> > Yes. I'm not clear about it. Need help Ferruh. There are two bonding APIs [1] using ABI versioning [2], and both have port_id as parameter. Since we are already breaking ABI, no need to keep older versions of APIs. So what needs to be done is, in .c file, remove those APIs and versioning macros [3], rename latest version of API [6] and update .map file [4] to remove exposed ABIs [5] from _older_ versions, only keep latest ones. I believe ideally these updates should be in this patch, but this patch is big and no need to make it more confusing, I would suggest making these changes _before_ this patch, so get rid of unnecessary update in this patch. [1] rte_eth_bond_8023ad_conf_get_v20() rte_eth_bond_8023ad_conf_get_v1607() rte_eth_bond_8023ad_setup_v20() rte_eth_bond_8023ad_setup_v1607() [2] http://dpdk.org/doc/guides/contributing/versioning.html [3] VERSION_SYMBOL, MAP_STATIC_SYMBOL, BIND_DEFAULT_SYMBOL [4] rte_eth_bond_version.map [5] rte_eth_bond_8023ad_setup rte_eth_bond_8023ad_conf_get [6] rte_eth_bond_8023ad_conf_get_v1708 --> rte_eth_bond_8023ad_conf_get rte_eth_bond_8023ad_setup_v1708 ---> rte_eth_bond_8023ad_setup ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/4] ethdev: increase port_id range 2017-09-14 12:49 ` Ferruh Yigit @ 2017-09-15 5:11 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-15 5:11 UTC (permalink / raw) To: Yigit, Ferruh, dev, Doherty, Declan, Lu, Wenzhuo Cc: thomas, hemant.agrawal, Hunt, David, Richardson, Bruce, Ananyev, Konstantin Hi Ferruh: > -----Original Message----- > From: Yigit, Ferruh > Sent: Thursday, September 14, 2017 8:50 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Doherty, Declan > <declan.doherty@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com> > Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David > <david.hunt@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; > Ananyev, Konstantin <konstantin.ananyev@intel.com> > Subject: Re: [PATCH v3 1/4] ethdev: increase port_id range > > >>> } > >>> BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); > >>> -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, > >>> +MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint16_t port_id, > >> > >> Hmm, this is tricky! > >> The macro MAP_STATIC_SYMBOL is used for ABI versioning, but changing > >> the port_id storage type breaks the ABI already. ABI versioning can > >> be removed completely. Cc'ed Declan. > >> > > Do you mean that I should remove > >>> -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, ? > > > >> Which also reminds me that bonding LIBABIVER needs to be updated. > >> This is also required for all i40e, ixgbe and bnxt. Please let me know if you > need help here. > >> > > Yes. I'm not clear about it. Need help Ferruh. > > There are two bonding APIs [1] using ABI versioning [2], and both have port_id > as parameter. Since we are already breaking ABI, no need to keep older versions > of APIs. > > So what needs to be done is, in .c file, remove those APIs and versioning macros > [3], rename latest version of API [6] and update .map file [4] to remove exposed > ABIs [5] from _older_ versions, only keep latest ones. > > I believe ideally these updates should be in this patch, but this patch is big and no > need to make it more confusing, I would suggest making these changes > _before_ this patch, so get rid of unnecessary update in this patch. > > > [1] > rte_eth_bond_8023ad_conf_get_v20() > rte_eth_bond_8023ad_conf_get_v1607() > rte_eth_bond_8023ad_setup_v20() > rte_eth_bond_8023ad_setup_v1607() > > [2] > http://dpdk.org/doc/guides/contributing/versioning.html > > [3] > VERSION_SYMBOL, MAP_STATIC_SYMBOL, BIND_DEFAULT_SYMBOL > > [4] > rte_eth_bond_version.map > > [5] > rte_eth_bond_8023ad_setup > rte_eth_bond_8023ad_conf_get > > [6] > rte_eth_bond_8023ad_conf_get_v1708 --> > rte_eth_bond_8023ad_conf_get > rte_eth_bond_8023ad_setup_v1708 ---> > rte_eth_bond_8023ad_setup > Thanks so much for detailed guide. If no objection, I will do it as you say. Add it as the first patch in the patchset next version. I will send it out very soon. Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v3 2/4] test: increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang @ 2017-09-09 14:47 ` Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 3/4] examples: " Zhiyong Yang ` (4 subsequent siblings) 6 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-09 14:47 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, david.hunt, Zhiyong Yang Increase port_id range from 8 bit to 16 bits in test code. And remove some unnecessary cast operations. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- test/test/test_kni.c | 14 ++++++------- test/test/test_link_bonding.c | 42 ++++++++++++++++++------------------- test/test/test_link_bonding_mode4.c | 24 ++++++++++----------- test/test/test_pmd_perf.c | 32 ++++++++++++++-------------- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 ++++++++++----------- test/test/virtual_pmd.h | 28 +++++++++++++------------ 7 files changed, 84 insertions(+), 82 deletions(-) diff --git a/test/test/test_kni.c b/test/test/test_kni.c index db17fdf30..45187c680 100644 --- a/test/test/test_kni.c +++ b/test/test/test_kni.c @@ -132,11 +132,11 @@ test_kni_lookup_mempool(void) } /* 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 int new_mtu) { printf("Change MTU of port %d to %u\n", port_id, new_mtu); kni_pkt_mtu = new_mtu; - printf("Change MTU of port %d to %i successfully.\n", + printf("Change MTU of port %u to %i successfully.\n", port_id, kni_pkt_mtu); return 0; } @@ -362,7 +362,7 @@ test_kni_register_handler_mp(void) } static int -test_kni_processing(uint8_t port_id, struct rte_mempool *mp) +test_kni_processing(uint16_t port_id, struct rte_mempool *mp) { int ret = 0; unsigned i; @@ -387,7 +387,7 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp) conf.core_id = 1; conf.force_bind = 1; conf.mbuf_size = MAX_PACKET_SZ; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; ops = kni_ops; ops.port_id = port_id; @@ -472,7 +472,7 @@ static int test_kni(void) { int ret = -1; - uint8_t nb_ports, port_id; + uint16_t nb_ports, port_id; struct rte_kni *kni; struct rte_mempool *mp; struct rte_kni_conf conf; @@ -538,7 +538,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; @@ -567,7 +567,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c index dc28cea59..7e7ad7cb1 100644 --- a/test/test/test_link_bonding.c +++ b/test/test/test_link_bonding.c @@ -94,9 +94,9 @@ uint8_t slave_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; uint8_t bonded_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; struct link_bonding_unittest_params { - int8_t bonded_port_id; - int8_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; - uint8_t bonded_slave_count; + int16_t bonded_port_id; + int16_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; + uint16_t bonded_slave_count; uint8_t bonding_mode; uint16_t nb_rx_q; @@ -317,7 +317,7 @@ test_create_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Don't try to recreate bonded device if re-running test suite*/ if (test_params->bonded_port_id == -1) { @@ -387,7 +387,7 @@ test_add_slave_to_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count]), @@ -434,7 +434,7 @@ test_remove_slave_from_bonded_device(void) { int current_slave_count; struct ether_addr read_mac_addr, *mac_addr; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count-1]), @@ -496,7 +496,7 @@ static int test_add_already_bonded_slave_to_bonded_device(void) { int port_id, current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; char pmd_name[RTE_ETH_NAME_MAX_LEN]; test_add_slave_to_bonded_device(); @@ -528,7 +528,7 @@ static int test_get_slaves_from_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), "Failed to add slave to bonded device"); @@ -609,7 +609,7 @@ test_start_bonded_device(void) struct rte_eth_link link_status; int current_slave_count, current_bonding_mode, primary_port; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Add slave to bonded device*/ TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), @@ -658,7 +658,7 @@ static int test_stop_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct rte_eth_link link_status; @@ -932,7 +932,7 @@ test_set_bonded_port_initialization_mac_assignment(void) { int i, slave_count, bonded_port_id; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; struct ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; @@ -1114,7 +1114,7 @@ test_set_bonded_port_initialization_mac_assignment(void) static int initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr, - uint8_t number_of_slaves, uint8_t enable_slave) + uint16_t number_of_slaves, uint8_t enable_slave) { /* Configure bonded device */ TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, @@ -1179,7 +1179,7 @@ int test_lsc_interrupt_count; static int -test_bonding_lsc_event_callback(uint8_t port_id __rte_unused, +test_bonding_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type type __rte_unused, void *param __rte_unused, void *ret_param __rte_unused) @@ -1224,7 +1224,7 @@ static int test_status_interrupt(void) { int slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* initialized bonding device with T slaves */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( @@ -1313,7 +1313,7 @@ test_status_interrupt(void) static int generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size, uint8_t vlan, uint8_t ipv4, uint8_t toggle_dst_mac, - uint8_t toggle_ip_addr, uint8_t toggle_udp_port) + uint8_t toggle_ip_addr, uint16_t toggle_udp_port) { uint16_t pktlen, generated_burst_size, ether_type; void *ip_hdr; @@ -1854,7 +1854,7 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -2408,7 +2408,7 @@ test_activebackup_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; @@ -2805,7 +2805,7 @@ test_balance_l23_tx_burst_toggle_mac_addr(void) static int balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, uint8_t toggle_mac_addr, uint8_t toggle_ip_addr, - uint8_t toggle_udp_port) + uint16_t toggle_udp_port) { int i, burst_size_1, burst_size_2, nb_tx_1, nb_tx_2; @@ -3302,7 +3302,7 @@ test_balance_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -3861,7 +3861,7 @@ test_broadcast_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -4373,7 +4373,7 @@ test_tlb_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; diff --git a/test/test/test_link_bonding_mode4.c b/test/test/test_link_bonding_mode4.c index 8e9e23db5..a31386108 100644 --- a/test/test/test_link_bonding_mode4.c +++ b/test/test/test_link_bonding_mode4.c @@ -325,7 +325,7 @@ remove_slave(struct slave_conf *slave) } static void -lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) +lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; @@ -343,7 +343,7 @@ lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) } static int -initialize_bonded_device_with_slaves(uint8_t slave_count, uint8_t external_sm) +initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) { uint8_t i; @@ -379,8 +379,8 @@ remove_slaves_and_stop_bonded_device(void) { struct slave_conf *slave; int retval; - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t i; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t i; rte_eth_dev_stop(test_params.bonded_port_id); @@ -411,7 +411,7 @@ test_setup(void) char name[RTE_ETH_NAME_MAX_LEN]; struct slave_conf *port; const uint8_t socket_id = rte_socket_id(); - uint8_t i; + uint16_t i; if (test_params.mbuf_pool == NULL) { nb_mbuf_per_pool = TEST_RX_DESC_MAX + DEF_PKT_BURST + @@ -571,6 +571,7 @@ bond_handshake_reply(struct slave_conf *slave) if (make_lacp_reply(slave, rx_buf[i]) == 0) { /* reply with actor's LACP */ lacp_tx_buf[lacp_tx_buf_cnt++] = rx_buf[i]; + } else rte_pktmbuf_free(rx_buf[i]); } @@ -633,18 +634,15 @@ bond_handshake(void) all_slaves_done = 0; for (i = 0; i < 30 && all_slaves_done == 0; ++i) { rte_delay_ms(delay); - all_slaves_done = 1; FOR_EACH_SLAVE(j, slave) { /* If response already send, skip slave */ if (status[j] != 0) continue; - if (bond_handshake_reply(slave) < 0) { all_slaves_done = 0; break; } - status[j] = bond_handshake_done(slave); if (status[j] == 0) all_slaves_done = 0; @@ -659,7 +657,6 @@ bond_handshake(void) } /* If response didn't send - report failure */ TEST_ASSERT_EQUAL(all_slaves_done, 1, "Bond handshake failed\n"); - /* If flags doesn't match - report failure */ return all_slaves_done = 1 ? TEST_SUCCESS : TEST_FAILED; } @@ -690,14 +687,16 @@ test_mode4_agg_mode_selection(void) retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); - retval = rte_eth_bond_8023ad_agg_selection_set( test_params.bonded_port_id, AGG_STABLE); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bond aggregation mode"); + retval = bond_handshake(); + TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); + retval = rte_eth_bond_8023ad_agg_selection_get( test_params.bonded_port_id); TEST_ASSERT_EQUAL(retval, AGG_STABLE, @@ -1520,8 +1519,9 @@ static int check_environment(void) { struct slave_conf *port; - uint8_t i, env_state; - uint8_t slaves[RTE_DIM(test_params.slave_ports)]; + uint16_t i; + uint8_t env_state; + uint16_t slaves[RTE_DIM(test_params.slave_ports)]; int slaves_count; env_state = 0; diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c index 1ffd65a52..70179bc37 100644 --- a/test/test/test_pmd_perf.c +++ b/test/test/test_pmd_perf.c @@ -50,7 +50,7 @@ #define MAX_PKT_BURST (32) #define RTE_TEST_RX_DESC_DEFAULT (128) #define RTE_TEST_TX_DESC_DEFAULT (512) -#define RTE_PORT_ALL (~(uint8_t)0x0) +#define RTE_PORT_ALL (~(uint16_t)0x0) /* how long test would take at full line rate */ #define RTE_TEST_DURATION (2) @@ -143,7 +143,7 @@ struct lcore_conf { uint8_t status; uint8_t socketid; uint16_t nb_ports; - uint8_t portlist[RTE_MAX_ETHPORTS]; + uint16_t portlist[RTE_MAX_ETHPORTS]; } __rte_cache_aligned; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; @@ -160,11 +160,12 @@ static uint32_t sc_flag; /* Check the link status of all ports in up to 3s, 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 30 /* 3s (30 * 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("Checking link statuses...\n"); @@ -179,16 +180,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", (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")); if (link_mbps == 0) link_mbps = link.link_speed; } 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 */ @@ -335,7 +335,7 @@ reset_count(void) } static void -stats_display(uint8_t port_id) +stats_display(uint16_t port_id) { struct rte_eth_stats stats; rte_eth_stats_get(port_id, &stats); @@ -383,7 +383,7 @@ measure_rxtx(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -422,7 +422,7 @@ measure_rxonly(struct lcore_conf *conf, portid = conf->portlist[i]; cur_tsc = rte_rdtsc(); - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -459,7 +459,7 @@ measure_txonly(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -537,7 +537,7 @@ main_loop(__rte_unused void *args) portid = conf->portlist[i]; int nb_free = pkt_per_port; do { /* dry out */ - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); nb_tx = 0; while (nb_tx < nb_rx) @@ -600,7 +600,7 @@ poll_burst(void *args) while (total) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, &pkts_burst[next[portid]], MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { @@ -689,7 +689,7 @@ exec_burst(uint32_t flags, int lcore) static int test_pmd_perf(void) { - uint16_t nb_ports, num, nb_lcores, slave_id = (uint16_t)-1; + uint16_t nb_ports, num, nb_lcores, slave_id = -1; uint16_t nb_rxd = MAX_TRAFFIC_BURST; uint16_t nb_txd = MAX_TRAFFIC_BURST; uint16_t portid; diff --git a/test/test/test_pmd_ring_perf.c b/test/test/test_pmd_ring_perf.c index 004882af1..8e9cd3310 100644 --- a/test/test/test_pmd_ring_perf.c +++ b/test/test/test_pmd_ring_perf.c @@ -54,7 +54,7 @@ static const volatile unsigned bulk_sizes[] = { 1, 8, 32 }; /* The ring structure used for tests */ static struct rte_ring *r; -static uint8_t ring_ethdev_port; +static uint16_t ring_ethdev_port; /* Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */ static void diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c index 9d46ad564..6568cb5b9 100644 --- a/test/test/virtual_pmd.c +++ b/test/test/virtual_pmd.c @@ -261,7 +261,7 @@ static const struct eth_dev_ops virtual_ethdev_default_dev_ops = { void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -275,7 +275,7 @@ virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -288,7 +288,7 @@ virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -301,7 +301,7 @@ virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -314,7 +314,7 @@ virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -430,7 +430,7 @@ virtual_ethdev_tx_burst_fail(void *queue, struct rte_mbuf **bufs, void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -442,7 +442,7 @@ virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct virtual_ethdev_private *dev_private = NULL; struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -458,7 +458,7 @@ virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count) { struct virtual_ethdev_private *dev_private = NULL; @@ -470,7 +470,7 @@ virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, } void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -478,7 +478,7 @@ virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) } void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -490,7 +490,7 @@ virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, } int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -502,7 +502,7 @@ virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, } int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct virtual_ethdev_private *dev_private; diff --git a/test/test/virtual_pmd.h b/test/test/virtual_pmd.h index de001884d..7c53dd346 100644 --- a/test/test/virtual_pmd.h +++ b/test/test/virtual_pmd.h @@ -48,53 +48,55 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, uint8_t socket_id, uint8_t isr_support); void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status); +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status); void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status); int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkts_burst, int burst_length); int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length); /** Control methods for the dev_ops functions pointer to control the behavior * of the Virtual PMD */ void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_stop_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_stop_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success); /* if a value greater than zero is set for packet_fail_count then virtual * device tx burst function will fail that many packet from burst or all * packets if packet_fail_count is greater than the number of packets in the * burst */ void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count); #ifdef __cplusplus -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v3 3/4] examples: increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 2/4] test: " Zhiyong Yang @ 2017-09-09 14:47 ` Zhiyong Yang 2017-09-14 14:41 ` Ferruh Yigit 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 4/4] librte_mbuf: modify port initialization value Zhiyong Yang ` (3 subsequent siblings) 6 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-09-09 14:47 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, david.hunt, Zhiyong Yang Modify port_id related code in examples accordingly since port_id definition in lib and pmd changes. Fix some original checkpatch issues and remove some unnecessary cast at the same time. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- doc/guides/rel_notes/release_17_11.rst | 4 + examples/bond/main.c | 10 +- examples/distributor/main.c | 28 ++-- examples/exception_path/main.c | 39 ++--- examples/ip_fragmentation/main.c | 33 ++--- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 ++--- examples/ipv4_multicast/main.c | 34 ++--- examples/kni/main.c | 31 ++-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 ++--- examples/l2fwd-keepalive/main.c | 49 +++---- examples/l2fwd/main.c | 49 +++---- examples/l3fwd-acl/main.c | 11 +- examples/l3fwd-power/main.c | 62 ++++---- examples/l3fwd-vf/main.c | 53 +++---- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 17 +-- examples/l3fwd/l3fwd_lpm.h | 6 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 ++-- examples/link_status_interrupt/main.c | 11 +- examples/load_balancer/config.c | 21 +-- examples/load_balancer/init.c | 40 +++--- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 21 +-- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 14 +- examples/netmap_compat/lib/compat_netmap.c | 52 ++++--- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +-- examples/performance-thread/l3fwd-thread/main.c | 160 +++++++++++---------- examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 ++-- examples/qos_sched/main.c | 18 ++- examples/qos_sched/main.h | 24 ++-- examples/qos_sched/stats.c | 16 ++- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- 55 files changed, 581 insertions(+), 542 deletions(-) diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst index 170f4f916..98fd7cb23 100644 --- a/doc/guides/rel_notes/release_17_11.rst +++ b/doc/guides/rel_notes/release_17_11.rst @@ -41,6 +41,10 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range from uint8_t to uint16_t.** + + Extended port_id range from 8 bits to 16 bits in order to support more than + 256 ports in dpdk. Resolved Issues --------------- diff --git a/examples/bond/main.c b/examples/bond/main.c index 2d019d433..559801ff3 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -144,7 +144,7 @@ uint8_t slaves[RTE_MAX_ETHPORTS]; uint8_t slaves_count; -static uint8_t BOND_PORT = 0xff; +static uint16_t BOND_PORT = 0xffff; static struct rte_mempool *mbuf_pool; @@ -171,7 +171,7 @@ static struct rte_eth_conf port_conf = { }; static void -slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) +slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) { int retval; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; @@ -215,7 +215,7 @@ slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) struct ether_addr addr; rte_eth_macaddr_get(portid, &addr); - printf("Port %u MAC: ", (unsigned)portid); + printf("Port %u MAC: ", portid); PRINT_MAC(addr); printf("\n"); } @@ -234,7 +234,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "Faled to create bond port\n"); - BOND_PORT = (uint8_t)retval; + BOND_PORT = retval; retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); if (retval != 0) @@ -675,7 +675,7 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result, struct cmdline *cl, __attribute__((unused)) void *data) { - uint8_t slaves[16] = {0}; + uint16_t slaves[16] = {0}; uint8_t len = 16; struct ether_addr addr; uint8_t i = 0; diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 87603d039..24b65e3aa 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -132,7 +132,7 @@ static void print_stats(void); * 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_conf port_conf = port_conf_default; const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1; @@ -175,13 +175,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) struct rte_eth_link link; rte_eth_link_get_nowait(port, &link); while (!link.link_status) { - printf("Waiting for Link up on port %"PRIu8"\n", port); + printf("Waiting for Link up on port %"PRIu16"\n", port); sleep(1); rte_eth_link_get_nowait(port, &link); } if (!link.link_status) { - printf("Link down on port %"PRIu8"\n", port); + printf("Link down on port %"PRIu16"\n", port); return 0; } @@ -189,7 +189,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -210,7 +210,7 @@ struct lcore_params { static int lcore_rx(struct lcore_params *p) { - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); uint8_t port; struct rte_mbuf *bufs[BURST_SIZE*2]; @@ -312,9 +312,9 @@ flush_one_port(struct output_buffer *outbuf, uint8_t outp) } static inline void -flush_all_ports(struct output_buffer *tx_buffers, uint8_t nb_ports) +flush_all_ports(struct output_buffer *tx_buffers, uint16_t nb_ports) { - uint8_t outp; + uint16_t outp; for (outp = 0; outp < nb_ports; outp++) { /* skip ports that are not enabled */ @@ -384,9 +384,9 @@ static int lcore_tx(struct rte_ring *in_r) { static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS]; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); - uint8_t port; + uint16_t port; for (port = 0; port < nb_ports; port++) { /* skip ports that are not enabled */ @@ -668,8 +668,8 @@ main(int argc, char *argv[]) struct rte_ring *rx_dist_ring; unsigned lcore_id, worker_id = 0; unsigned nb_ports; - uint8_t portid; - uint8_t nb_ports_available; + uint16_t portid; + uint16_t nb_ports_available; uint64_t t, freq; /* catch ctrl-c so we can print on exit */ @@ -719,11 +719,11 @@ main(int argc, char *argv[]) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) portid); + printf("Initializing port %u... done\n", portid); if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", - portid); + rte_exit(EXIT_FAILURE, "Cannot initialize port %u\n", + portid); } if (!nb_ports_available) { diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index e551e6d11..e4d952343 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -135,7 +135,7 @@ static uint64_t input_cores_mask = 0; static uint64_t output_cores_mask = 0; /* Array storing port_id that is associated with each lcore */ -static uint8_t port_ids[RTE_MAX_LCORE]; +static uint16_t port_ids[RTE_MAX_LCORE]; /* Structure type for recording lcore-specific stats */ struct stats { @@ -360,8 +360,8 @@ static void setup_port_lcore_affinities(void) { unsigned long i; - uint8_t tx_port = 0; - uint8_t rx_port = 0; + uint16_t tx_port = 0; + uint16_t rx_port = 0; /* Setup port_ids[] array, and check masks were ok */ RTE_LCORE_FOREACH(i) { @@ -444,24 +444,23 @@ 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; uint16_t nb_txd = NB_TXD; /* Initialise device and RX/TX queues */ - PRINT_INFO("Initialising port %u ...", (unsigned)port); + PRINT_INFO("Initialising port %u ...", port); fflush(stdout); ret = rte_eth_dev_configure(port, 1, 1, &port_conf); if (ret < 0) - FATAL_ERROR("Could not configure port%u (%d)", - (unsigned)port, ret); + FATAL_ERROR("Could not configure port%u (%d)", port, ret); ret = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd); if (ret < 0) FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, rte_eth_dev_socket_id(port), @@ -469,29 +468,30 @@ init_port(uint8_t port) pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_tx_queue_setup(port, 0, nb_txd, rte_eth_dev_socket_id(port), NULL); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_dev_start(port); if (ret < 0) - FATAL_ERROR("Could not start port%u (%d)", (unsigned)port, ret); + FATAL_ERROR("Could not start port%u (%d)", port, ret); rte_eth_promiscuous_enable(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"); @@ -506,14 +506,14 @@ 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 %u Link Down\n", + portid); continue; } /* clear all_ports_up flag if any link down */ @@ -546,7 +546,8 @@ main(int argc, char** argv) { int ret; unsigned i,high_port; - uint8_t nb_sys_ports, port; + uint8_t nb_sys_ports; + uint16_t port; /* Associate signal_hanlder function with USR signals */ signal(SIGUSR1, signal_handler); diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8c0e17911..de252760f 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -154,7 +154,7 @@ struct rx_queue { struct rte_mempool *indirect_pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; #define MAX_RX_QUEUE_PER_LCORE 16 @@ -240,7 +240,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -261,11 +261,12 @@ send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) static inline void l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, - uint8_t queueid, uint8_t port_in) + uint8_t queueid, uint16_t port_in) { struct rx_queue *rxq; uint32_t i, len, next_hop; - uint8_t port_out, ipv6; + uint8_t ipv6; + uint16_t port_out; int32_t len2; ipv6 = 0; @@ -403,7 +404,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -423,7 +424,7 @@ main_loop(__attribute__((unused)) void *dummy) portid = qconf->rx_queue_list[i].portid; RTE_LOG(INFO, IP_FRAG, " -- lcoreid=%u portid=%d\n", lcore_id, - (int) portid); + portid); } while (1) { @@ -600,11 +601,12 @@ print_ethaddr(const char *name, 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"); @@ -619,14 +621,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 */ @@ -708,7 +709,7 @@ parse_ptype(struct rte_mbuf *m) /* callback function to detect packet type for a queue of a port */ static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -876,7 +877,7 @@ main(int argc, char **argv) uint16_t queueid = 0; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1035,7 +1036,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - 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/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 7cde49a47..ca59baf40 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -1236,7 +1236,7 @@ app_init_tap(struct app_params *app) #ifdef RTE_LIBRTE_KNI 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; if (port_id >= rte_eth_dev_count()) @@ -1250,7 +1250,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) { } static int -kni_change_mtu(uint8_t port_id, unsigned new_mtu) { +kni_change_mtu(uint16_t port_id, unsigned int new_mtu) { int ret; if (port_id >= rte_eth_dev_count()) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index e62636cb4..cadf4c5bd 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -166,7 +166,7 @@ struct rx_queue { struct rte_mempool *pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; struct tx_lcore_stat { @@ -277,7 +277,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; * send burst of packets on an output interface. */ static inline uint32_t -send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint16_t port) { uint32_t fill, len, k, n; struct mbuf_table *txmb; @@ -307,7 +307,7 @@ send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) /* 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 fill, lcore_id, len; struct lcore_queue_conf *qconf; @@ -337,7 +337,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) } static inline void -reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, +reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct lcore_queue_conf *qconf, uint64_t tms) { struct ether_hdr *eth_hdr; @@ -346,7 +346,7 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, struct rx_queue *rxq; void *d_addr_bytes; uint32_t next_hop; - uint8_t dst_port; + uint16_t dst_port; rxq = &qconf->rx_queue_list[queue]; @@ -454,7 +454,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t diff_tsc, cur_tsc, prev_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -473,7 +473,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].portid; - RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%hhu\n", lcore_id, + RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%u\n", lcore_id, portid); } @@ -732,11 +732,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"); @@ -751,14 +752,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 */ @@ -987,7 +987,7 @@ queue_dump_stat(void) qconf = &lcore_queue_conf[lcore]; for (i = 0; i < qconf->n_rx_queue; i++) { - fprintf(stdout, " -- lcoreid=%u portid=%hhu " + fprintf(stdout, " -- lcoreid=%u portid=%u " "frag tbl stat:\n", lcore, qconf->rx_queue_list[i].portid); rte_ip_frag_table_statistics_dump(stdout, @@ -1024,7 +1024,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1177,7 +1177,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); signal(SIGUSR1, signal_handler); signal(SIGTERM, signal_handler); diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 9a13d3530..d635e166a 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -116,7 +116,7 @@ static struct ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; -static uint8_t nb_ports = 0; +static uint16_t nb_ports; static int rx_queue_per_lcore = 1; @@ -195,7 +195,7 @@ static struct mcast_group_params mcast_group_table[] = { /* Send burst of packets on an output interface */ static void -send_burst(struct lcore_queue_conf *qconf, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t port) { struct rte_mbuf **m_table; uint16_t n, queueid; @@ -312,7 +312,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) */ static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, - struct lcore_queue_conf *qconf, uint8_t port) + struct lcore_queue_conf *qconf, uint16_t port) { struct ether_hdr *ethdr; uint16_t len; @@ -343,7 +343,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) struct ipv4_hdr *iphdr; uint32_t dest_addr, port_mask, port_num, use_clone; int32_t hash; - uint8_t port; + uint16_t port; union { uint64_t as_int; struct ether_addr as_addr; @@ -375,7 +375,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) /* Mark all packet's segments as referenced port_num times */ if (use_clone == 0) - rte_pktmbuf_refcnt_update(m, (uint16_t)port_num); + rte_pktmbuf_refcnt_update(m, port_num); /* construct destination ethernet address */ dst_eth_addr.as_int = ETHER_ADDR_FOR_IPV4_MCAST(dest_addr); @@ -407,7 +407,7 @@ static inline void send_timeout_burst(struct lcore_queue_conf *qconf) { uint64_t cur_tsc; - uint8_t portid; + uint16_t portid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; cur_tsc = rte_rdtsc(); @@ -428,7 +428,7 @@ main_loop(__rte_unused void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; unsigned lcore_id; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; lcore_id = rte_lcore_id(); @@ -447,8 +447,8 @@ main_loop(__rte_unused void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i]; - RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%d\n", - lcore_id, (int) portid); + RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%u\n", + lcore_id, portid); } while (1) { @@ -610,11 +610,12 @@ init_mcast_hash(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -629,14 +630,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 */ @@ -673,7 +673,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/kni/main.c b/examples/kni/main.c index e3bc2fb78..cde4c3904 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -110,7 +110,7 @@ * Structure of port parameters */ struct kni_port_params { - uint8_t port_id;/* Port ID */ + uint16_t port_id;/* Port ID */ unsigned lcore_rx; /* lcore ID for RX */ unsigned lcore_tx; /* lcore ID for TX */ uint32_t nb_lcore_k; /* Number of lcores for KNI multi kernel threads */ @@ -162,8 +162,8 @@ struct kni_interface_stats { /* kni device statistics array */ static struct kni_interface_stats kni_stats[RTE_MAX_ETHPORTS]; -static int kni_change_mtu(uint8_t port_id, unsigned new_mtu); -static int kni_config_network_interface(uint8_t port_id, uint8_t if_up); +static int kni_change_mtu(uint16_t port_id, unsigned int new_mtu); +static int kni_config_network_interface(uint16_t port_id, uint8_t if_up); static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); @@ -171,7 +171,7 @@ static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); static void print_stats(void) { - uint8_t i; + uint16_t i; printf("\n**KNI example application statistics**\n" "====== ============== ============ ============ ============ ============\n" @@ -238,7 +238,8 @@ kni_burst_free_mbufs(struct rte_mbuf **pkts, unsigned num) static void kni_ingress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_rx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -274,7 +275,8 @@ kni_ingress(struct kni_port_params *p) static void kni_egress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_tx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -416,7 +418,8 @@ parse_config(const char *arg) 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; + uint16_t nb_kni_port_params = 0; memset(&kni_port_params_array, 0, sizeof(kni_port_params_array)); while (((p = strchr(p0, '(')) != NULL) && @@ -445,7 +448,7 @@ parse_config(const char *arg) } i = 0; - port_id = (uint8_t)int_fld[i++]; + port_id = int_fld[i++]; if (port_id >= RTE_MAX_ETHPORTS) { printf("Port ID %d could not exceed the maximum %d\n", port_id, RTE_MAX_ETHPORTS); @@ -698,7 +701,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) /* 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 int new_mtu) { int ret; struct rte_eth_conf conf; @@ -741,7 +744,7 @@ kni_change_mtu(uint8_t port_id, unsigned new_mtu) /* 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; @@ -766,7 +769,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) } static int -kni_alloc(uint8_t port_id) +kni_alloc(uint16_t port_id) { uint8_t i; struct rte_kni *kni; @@ -790,7 +793,7 @@ kni_alloc(uint8_t port_id) } else snprintf(conf.name, RTE_KNI_NAMESIZE, "vEth%u", port_id); - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; /* * The first KNI device associated to a port @@ -825,7 +828,7 @@ kni_alloc(uint8_t port_id) } static int -kni_free_kni(uint8_t port_id) +kni_free_kni(uint16_t port_id) { uint8_t i; struct kni_port_params **p = kni_port_params_array; @@ -848,7 +851,7 @@ int main(int argc, char** argv) { int ret; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; unsigned i; /* Associate signal_hanlder function with USR signals */ diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index c293bd9c9..b10ac896f 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -59,7 +59,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -106,7 +106,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -124,8 +124,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -181,7 +181,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -217,7 +217,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 989362067..9511156d8 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -776,9 +776,9 @@ main(int argc, char **argv) unsigned nb_ports_in_mask = 0; int ret; char name[RTE_JOBSTATS_NAMESIZE]; - uint8_t nb_ports; - uint8_t nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; uint8_t i; /* init EAL */ @@ -861,7 +861,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -870,24 +870,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -899,7 +899,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -907,8 +907,9 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid), NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup:err=%d, port=%u\n", + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -916,7 +917,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -924,21 +925,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done:\n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 83bc542c1..3f7024fcc 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -157,7 +157,7 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, __attribute__((unused)) void *ptr_data) { uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -299,7 +299,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -479,11 +479,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"); @@ -498,14 +499,14 @@ 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); + portid); continue; } /* clear all_ports_up flag if any link down */ @@ -560,9 +561,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; struct sigaction signal_handler; @@ -653,7 +654,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; printf("Lcore %u: RX port %u\n", - rx_lcore_id, (unsigned) portid); + rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -662,26 +663,25 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", - (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -694,7 +694,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -704,7 +704,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -712,7 +712,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -720,21 +720,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: " "%02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 142633584..290d7c118 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -304,7 +304,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -480,11 +480,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"); @@ -503,14 +504,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 */ @@ -553,9 +553,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; @@ -644,7 +644,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -653,26 +653,26 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); - rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]); + rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); /* init one RX queue */ fflush(stdout); @@ -682,7 +682,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -691,7 +691,7 @@ main(int argc, char **argv) NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -699,7 +699,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -707,21 +707,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done: \n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 8eff4de41..21e17502e 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -121,7 +121,7 @@ static int promiscuous_on; /**< Ports set in promiscuous mode off by default. */ static int numa_on = 1; /**< NUMA is enabled by default. */ struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -131,7 +131,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -1358,7 +1358,8 @@ 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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; int socketid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -1381,7 +1382,7 @@ 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); } @@ -1481,7 +1482,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd442f5ef..f60649bd9 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -174,7 +174,7 @@ enum freq_scale_hint_t }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; enum freq_scale_hint_t freq_up_hint; uint32_t zero_rx_packet_count; @@ -190,7 +190,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -308,8 +308,8 @@ static lookup_struct_t *ipv6_l3fwd_lookup_struct[NB_SOCKETS]; #define IPV6_L3FWD_NUM_ROUTES \ (sizeof(ipv6_l3fwd_route_array) / sizeof(ipv6_l3fwd_route_array[0])) -static uint8_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; -static uint8_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) @@ -370,14 +370,14 @@ static struct rte_timer power_timers[RTE_MAX_LCORE]; static inline uint32_t power_idle_heuristic(uint32_t zero_rx_packet_count); static inline enum freq_scale_hint_t power_freq_scaleup_heuristic( \ - unsigned lcore_id, uint8_t port_id, uint16_t queue_id); + unsigned int lcore_id, uint16_t port_id, uint16_t queue_id); /* exit signal handler */ static void signal_exit_now(int sigtype) { unsigned lcore_id; - unsigned int portid, nb_ports; + uint16_t portid, nb_ports; int ret; if (sigtype == SIGINT) { @@ -523,8 +523,8 @@ print_ipv6_key(struct ipv6_5tuple key) key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t * ipv4_l3fwd_lookup_struct) { struct ipv4_5tuple key; @@ -559,11 +559,11 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, /* 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 -get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { struct ipv6_5tuple key; @@ -599,18 +599,18 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid); } @@ -634,7 +634,7 @@ parse_ptype_one(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -648,7 +648,7 @@ cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, } static int -add_cb_parse_ptype(uint8_t portid, uint16_t queueid) +add_cb_parse_ptype(uint16_t portid, uint16_t queueid) { printf("Port %d: softly parse packet type info\n", portid); if (rte_eth_add_rx_callback(portid, queueid, cb_parse_ptype, NULL)) @@ -665,7 +665,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *d_addr_bytes; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -758,7 +758,7 @@ power_idle_heuristic(uint32_t zero_rx_packet_count) static inline enum freq_scale_hint_t power_freq_scaleup_heuristic(unsigned lcore_id, - uint8_t port_id, + uint16_t port_id, uint16_t queue_id) { /** @@ -805,7 +805,8 @@ sleep_until_rx_interrupt(int num) { struct rte_epoll_event event[num]; int n, i; - uint8_t port_id, queue_id; + uint16_t port_id; + uint8_t queue_id; void *data; RTE_LOG(INFO, L3FWD_POWER, @@ -832,7 +833,8 @@ static void turn_on_intr(struct lcore_conf *qconf) { int i; struct lcore_rx_queue *rx_queue; - uint8_t port_id, queue_id; + uint8_t queue_id; + uint16_t port_id; for (i = 0; i < qconf->n_rx_queue; ++i) { rx_queue = &(qconf->rx_queue_list[i]); @@ -848,7 +850,8 @@ static void turn_on_intr(struct lcore_conf *qconf) static int event_register(struct lcore_conf *qconf) { struct lcore_rx_queue *rx_queue; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; uint32_t data; int ret; int i; @@ -879,7 +882,8 @@ main_loop(__attribute__((unused)) void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; uint64_t prev_tsc_power = 0, cur_tsc_power, diff_tsc_power; int i, j, nb_rx; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; enum freq_scale_hint_t lcore_scaleup_hint; @@ -904,7 +908,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%hhu " + RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%u " "rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -1541,11 +1545,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; + uint8_t count, all_ports_up, print_flag = 0; + uint16_t portid; struct rte_eth_link link; printf("\nChecking link status"); @@ -1651,7 +1656,8 @@ main(int argc, char **argv) uint64_t hz; uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + uint16_t portid; uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ @@ -1751,7 +1757,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (qconf->tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Can't allocate tx buffer for port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(qconf->tx_buffer[portid], MAX_PKT_BURST); } diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 34e4a6bef..a7fa26aed 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -155,7 +155,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -165,7 +165,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -300,7 +300,7 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE]; static rte_spinlock_t spinlock_conf[RTE_MAX_ETHPORTS] = {RTE_SPINLOCK_INITIALIZER}; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -324,7 +324,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 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; uint16_t len; @@ -396,8 +396,9 @@ print_key(struct ipv4_5tuple key) (unsigned)key.ip_dst, (unsigned)key.ip_src, key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint16_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ipv4_5tuple key; struct tcp_hdr *tcp; @@ -430,29 +431,31 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd /* Find destination port */ ret = rte_hash_lookup(l3fwd_lookup_struct, (const void *)&key); - return (uint8_t)((ret < 0)? portid : l3fwd_out_if[ret]); + return ((ret < 0) ? portid : l3fwd_out_if[ret]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint32_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(l3fwd_lookup_struct, - rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? - next_hop : portid); + return ((rte_lpm_lookup(l3fwd_lookup_struct, + rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0) ? + next_hop : portid); } #endif static inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *tmp; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -496,7 +499,8 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -513,11 +517,10 @@ main_loop(__attribute__((unused)) void *dummy) RTE_LOG(INFO, L3FWD, "entering main loop on lcore %u\n", lcore_id); for (i = 0; i < qconf->n_rx_queue; i++) { - 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", lcore_id, - portid, queueid); + RTE_LOG(INFO, L3FWD, " --lcoreid=%u portid=%u rxqueueid=%u\n", + lcore_id, portid, queueid); } while (1) { @@ -606,7 +609,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { @@ -624,7 +627,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; @@ -676,8 +679,8 @@ print_usage(const char *prgname) static void signal_handler(int signum) { - uint8_t portid; - uint8_t nb_ports = rte_eth_dev_count(); + uint16_t portid; + uint16_t nb_ports = rte_eth_dev_count(); /* When we receive a SIGINT signal */ if (signum == SIGINT) { @@ -749,7 +752,7 @@ parse_config(const char *q_arg) nb_lcore_params); return -1; } - lcore_params_array[nb_lcore_params].port_id = (uint8_t)int_fld[FLD_PORT]; + lcore_params_array[nb_lcore_params].port_id = int_fld[FLD_PORT]; lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = (uint8_t)int_fld[FLD_LCORE]; ++nb_lcore_params; @@ -953,11 +956,11 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t nb_lcores; uint16_t n_tx_queue; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; signal(SIGINT, signal_handler); /* init EAL */ diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index 011ba148b..4bb15943c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -83,7 +83,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -117,7 +117,7 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE]; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -139,7 +139,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 int send_single_packet(struct lcore_conf *qconf, - struct rte_mbuf *m, uint8_t port) + struct rte_mbuf *m, uint16_t port) { uint16_t len; @@ -212,11 +212,11 @@ int lpm_check_ptype(int portid); uint16_t -em_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +em_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); uint16_t -lpm_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); int diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h index 2867365d0..7002a43a4 100644 --- a/examples/l3fwd/l3fwd_common.h +++ b/examples/l3fwd/l3fwd_common.h @@ -207,7 +207,7 @@ static const struct { }; static __rte_always_inline void -send_packetsx4(struct lcore_conf *qconf, uint8_t port, struct rte_mbuf *m[], +send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 53d081bd7..df38a1362 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -628,7 +628,7 @@ em_parse_ptype(struct rte_mbuf *m) } uint16_t -em_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h index d509a1fcd..3ca241899 100644 --- a/examples/l3fwd/l3fwd_em.h +++ b/examples/l3fwd/l3fwd_em.h @@ -35,12 +35,12 @@ #define __L3FWD_EM_H__ static __rte_always_inline void -l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; uint32_t tcp_or_udp; uint32_t l3_ptypes; @@ -112,7 +112,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, */ static inline void l3fwd_em_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h index 520672d51..2be61cd48 100644 --- a/examples/l3fwd/l3fwd_em_hlm.h +++ b/examples/l3fwd/l3fwd_em_hlm.h @@ -52,7 +52,7 @@ static __rte_always_inline void em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -68,7 +68,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv4_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -79,7 +79,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], static __rte_always_inline void em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -95,7 +95,7 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv6_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -106,9 +106,9 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], 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; + uint16_t next_hop; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; uint32_t tcp_or_udp; @@ -158,7 +158,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, pos; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index ff1e40355..f7ea7be63 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -105,7 +105,7 @@ struct rte_lpm *ipv4_l3fwd_lpm_lookup_struct[NB_SOCKETS]; struct rte_lpm6 *ipv6_l3fwd_lpm_lookup_struct[NB_SOCKETS]; static inline uint16_t -lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm *ipv4_l3fwd_lookup_struct = @@ -117,7 +117,7 @@ lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) } static inline uint16_t -lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm6 *ipv6_l3fwd_lookup_struct = @@ -130,7 +130,7 @@ lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) static __rte_always_inline uint16_t lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint8_t portid) + uint16_t portid) { struct ipv6_hdr *ipv6_hdr; struct ipv4_hdr *ipv4_hdr; @@ -162,7 +162,7 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, */ static __rte_always_inline uint16_t lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint32_t dst_ipv4, uint8_t portid) + uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -203,7 +203,8 @@ lpm_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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -225,7 +226,7 @@ lpm_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); } @@ -259,7 +260,7 @@ lpm_main_loop(__attribute__((unused)) void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, - MAX_PKT_BURST); + MAX_PKT_BURST); if (nb_rx == 0) continue; @@ -413,7 +414,7 @@ lpm_parse_ptype(struct rte_mbuf *m) } uint16_t -lpm_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h index 55c3e8329..92f613b22 100644 --- a/examples/l3fwd/l3fwd_lpm.h +++ b/examples/l3fwd/l3fwd_lpm.h @@ -35,8 +35,8 @@ #define __L3FWD_LPM_H__ static __rte_always_inline void -l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, - struct lcore_conf *qconf) +l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, + struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; @@ -104,7 +104,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, static inline void l3fwd_lpm_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h index baedbfe84..85f314d1e 100644 --- a/examples/l3fwd/l3fwd_lpm_neon.h +++ b/examples/l3fwd/l3fwd_lpm_neon.h @@ -82,7 +82,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, int32x4_t dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -115,7 +115,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 = 0, j = 0; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h index 4e294c844..d474396ed 100644 --- a/examples/l3fwd/l3fwd_lpm_sse.h +++ b/examples/l3fwd/l3fwd_lpm_sse.h @@ -79,7 +79,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, __m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -112,7 +112,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 j; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 81995fdbe..a5e55baae 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -124,7 +124,7 @@ uint32_t hash_entry_number = HASH_ENTRY_NUMBER_DEFAULT; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -245,7 +245,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { @@ -263,7 +263,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; @@ -445,7 +445,7 @@ parse_config(const char *q_arg) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -750,11 +750,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"); @@ -773,14 +774,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 */ @@ -818,7 +818,7 @@ signal_handler(int signum) } static int -prepare_ptype_parser(uint8_t portid, uint16_t queueid) +prepare_ptype_parser(uint16_t portid, uint16_t queueid) { if (parse_ptype) { printf("Port %d: softly parse packet type info\n", portid); @@ -847,10 +847,10 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1048,7 +1048,7 @@ main(int argc, char **argv) } - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); ret = 0; /* launch per-lcore init on every lcore */ diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f4e3969a6..4600841ae 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -145,7 +145,7 @@ print_stats(void) { struct rte_eth_link link; uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -165,7 +165,7 @@ print_stats(void) continue; memset(&link, 0, sizeof(link)); - rte_eth_link_get_nowait((uint8_t)portid, &link); + rte_eth_link_get_nowait(portid, &link); printf("\nStatistics for port %u ------------------------------" "\nLink status: %25s" "\nLink speed: %26u" @@ -175,7 +175,7 @@ print_stats(void) "\nPackets dropped: %21"PRIu64, portid, (link.link_status ? "Link up" : "Link down"), - (unsigned)link.link_speed, + link.link_speed, (link.link_duplex == ETH_LINK_FULL_DUPLEX ? \ "full-duplex" : "half-duplex"), port_statistics[portid].tx, @@ -470,7 +470,7 @@ lsi_parse_args(int argc, char **argv) * int. */ static int -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, void *ret_param) { struct rte_eth_link link; @@ -498,7 +498,8 @@ check_all_ports_link_status(uint8_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"); diff --git a/examples/load_balancer/config.c b/examples/load_balancer/config.c index 503250951..d7ba2ae45 100644 --- a/examples/load_balancer/config.c +++ b/examples/load_balancer/config.c @@ -240,8 +240,8 @@ parse_arg_rx(const char *arg) if (lp->io.rx.n_nic_queues >= APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE) { return -9; } - lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = (uint8_t) port; - lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].queue = (uint8_t) queue; + lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = port; + lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].queue = queue; lp->io.rx.n_nic_queues ++; n_tuples ++; @@ -318,7 +318,7 @@ parse_arg_tx(const char *arg) if (lp->io.tx.n_nic_ports >= APP_MAX_NIC_TX_PORTS_PER_IO_LCORE) { return -9; } - lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = (uint8_t) port; + lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = port; lp->io.tx.n_nic_ports ++; n_tuples ++; @@ -488,9 +488,9 @@ app_check_lpm_table(void) static int app_check_every_rx_port_is_tx_enabled(void) { - uint8_t port; + uint16_t port; - for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { + for (port = 0; port < APP_MAX_NIC_PORTS; port++) { if ((app_get_nic_rx_queues_per_port(port) > 0) && (app.nic_tx_port_mask[port] == 0)) { return -1; } @@ -762,7 +762,7 @@ app_parse_args(int argc, char **argv) } int -app_get_nic_rx_queues_per_port(uint8_t port) +app_get_nic_rx_queues_per_port(uint16_t port) { uint32_t i, count; @@ -781,7 +781,7 @@ app_get_nic_rx_queues_per_port(uint8_t port) } int -app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) +app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, uint32_t *lcore_out) { uint32_t lcore; @@ -808,7 +808,7 @@ app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) } int -app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out) +app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out) { uint32_t lcore; @@ -896,12 +896,13 @@ app_get_lcores_worker(void) void app_print_params(void) { - unsigned port, queue, lcore, rule, i, j; + uint16_t port; + unsigned int queue, lcore, rule, i, j; /* Print NIC RX configuration */ printf("NIC RX ports: "); for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { - uint32_t n_rx_queues = app_get_nic_rx_queues_per_port((uint8_t) port); + uint32_t n_rx_queues = app_get_nic_rx_queues_per_port(port); if (n_rx_queues == 0) { continue; diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 717232e6e..692d33458 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -308,7 +308,7 @@ app_init_rings_tx(void) continue; } - if (app_get_lcore_for_nic_tx((uint8_t) port, &lcore_io) < 0) { + if (app_get_lcore_for_nic_tx(port, &lcore_io) < 0) { rte_panic("Algorithmic error (no I/O core to handle TX of port %u)\n", port); } @@ -359,11 +359,12 @@ app_init_rings_tx(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; uint32_t n_rx_queues, n_tx_queues; @@ -383,14 +384,14 @@ 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 */ @@ -422,12 +423,13 @@ app_init_nics(void) { unsigned socket; uint32_t lcore; - uint8_t port, queue; + uint16_t port; + uint8_t queue; int ret; uint32_t n_rx_queues, n_tx_queues; /* Init NIC ports and queues, then start the ports */ - for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { + for (port = 0; port < APP_MAX_NIC_PORTS; port++) { struct rte_mempool *pool; uint16_t nic_rx_ring_size; uint16_t nic_tx_ring_size; @@ -440,14 +442,14 @@ app_init_nics(void) } /* Init port */ - printf("Initializing NIC port %u ...\n", (unsigned) port); + printf("Initializing NIC port %u ...\n", port); ret = rte_eth_dev_configure( port, (uint8_t) n_rx_queues, (uint8_t) n_tx_queues, &port_conf); if (ret < 0) { - rte_panic("Cannot init NIC port %u (%d)\n", (unsigned) port, ret); + rte_panic("Cannot init NIC port %u (%d)\n", port, ret); } rte_eth_promiscuous_enable(port); @@ -457,7 +459,7 @@ app_init_nics(void) port, &nic_rx_ring_size, &nic_tx_ring_size); if (ret < 0) { rte_panic("Cannot adjust number of descriptors for port %u (%d)\n", - (unsigned) port, ret); + port, ret); } app.nic_rx_ring_size = nic_rx_ring_size; app.nic_tx_ring_size = nic_tx_ring_size; @@ -473,8 +475,7 @@ app_init_nics(void) pool = app.lcore_params[lcore].pool; printf("Initializing NIC port %u RX queue %u ...\n", - (unsigned) port, - (unsigned) queue); + port, queue); ret = rte_eth_rx_queue_setup( port, queue, @@ -484,9 +485,7 @@ app_init_nics(void) pool); if (ret < 0) { rte_panic("Cannot init RX queue %u for port %u (%d)\n", - (unsigned) queue, - (unsigned) port, - ret); + queue, port, ret); } } @@ -495,7 +494,7 @@ app_init_nics(void) app_get_lcore_for_nic_tx(port, &lcore); socket = rte_lcore_to_socket_id(lcore); printf("Initializing NIC port %u TX queue 0 ...\n", - (unsigned) port); + port); ret = rte_eth_tx_queue_setup( port, 0, @@ -504,8 +503,7 @@ app_init_nics(void) NULL); if (ret < 0) { rte_panic("Cannot init TX queue 0 for port %d (%d)\n", - port, - ret); + port, ret); } } diff --git a/examples/load_balancer/main.h b/examples/load_balancer/main.h index dc407555d..bef2ba041 100644 --- a/examples/load_balancer/main.h +++ b/examples/load_balancer/main.h @@ -248,7 +248,7 @@ struct app_lcore_params_io { struct { /* NIC */ struct { - uint8_t port; + uint16_t port; uint8_t queue; } nic_queues[APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE]; uint32_t n_nic_queues; @@ -275,7 +275,7 @@ struct app_lcore_params_io { struct rte_ring *rings[APP_MAX_NIC_PORTS][APP_MAX_WORKER_LCORES]; /* NIC */ - uint8_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; + uint16_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; uint32_t n_nic_ports; /* Internal buffers */ @@ -368,9 +368,10 @@ void app_print_usage(void); void app_init(void); int app_lcore_main_loop(void *arg); -int app_get_nic_rx_queues_per_port(uint8_t port); -int app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out); -int app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out); +int app_get_nic_rx_queues_per_port(uint16_t port); +int app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, + uint32_t *lcore_out); +int app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out); int app_is_socket_used(uint32_t socket); uint32_t app_get_lcores_io_rx(void); uint32_t app_get_lcores_worker(void); diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index e54b78510..b342e755f 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -188,7 +188,7 @@ app_lcore_io_rx( uint32_t i; for (i = 0; i < lp->rx.n_nic_queues; i ++) { - uint8_t port = lp->rx.nic_queues[i].port; + uint16_t port = lp->rx.nic_queues[i].port; uint8_t queue = lp->rx.nic_queues[i].queue; uint32_t n_mbufs, j; @@ -213,7 +213,7 @@ app_lcore_io_rx( printf("I/O RX %u in (NIC port %u): NIC drop ratio = %.2f avg burst size = %.2f\n", lcore, - (unsigned) port, + port, (double) stats.imissed / (double) (stats.imissed + stats.ipackets), ((double) lp->rx.nic_queues_count[i]) / ((double) lp->rx.nic_queues_iters[i])); lp->rx.nic_queues_iters[i] = 0; @@ -339,7 +339,7 @@ app_lcore_io_tx( uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i ++) { - uint8_t port = lp->tx.nic_ports[i]; + uint16_t port = lp->tx.nic_ports[i]; struct rte_ring *ring = lp->tx.rings[port][worker]; uint32_t n_mbufs, n_pkts; int ret; @@ -395,7 +395,7 @@ app_lcore_io_tx( printf("\t\t\tI/O TX %u out (port %u): avg burst size = %.2f\n", lcore, - (unsigned) port, + port, ((double) lp->tx.nic_ports_count[port]) / ((double) lp->tx.nic_ports_iters[port])); lp->tx.nic_ports_iters[port] = 0; lp->tx.nic_ports_count[port] = 0; @@ -418,7 +418,7 @@ app_lcore_io_tx( static inline void app_lcore_io_tx_flush(struct app_lcore_params_io *lp) { - uint8_t port; + uint16_t port; uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i++) { @@ -569,7 +569,7 @@ app_lcore_worker( if (lp->rings_out_iters[port] == APP_STATS){ printf("\t\tWorker %u out (NIC port %u): enq success rate = %.2f\n", (unsigned) lp->worker_id, - (unsigned) port, + port, ((double) lp->rings_out_count[port]) / ((double) lp->rings_out_iters[port])); lp->rings_out_iters[port] = 0; lp->rings_out_count[port] = 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 f8453e57a..075e0fe75 100644 --- a/examples/multi_process/client_server_mp/mp_client/client.c +++ b/examples/multi_process/client_server_mp/mp_client/client.c @@ -74,7 +74,7 @@ static uint8_t client_id = 0; #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]; @@ -150,7 +150,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; @@ -161,7 +161,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; @@ -171,15 +171,16 @@ configure_tx_buffer(uint8_t port_id, uint16_t size) 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) port_id); + 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) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } /* @@ -193,10 +194,10 @@ configure_output_ports(const struct port_info *ports) int i; if (ports->num_ports > RTE_MAX_ETHPORTS) rte_exit(EXIT_FAILURE, "Too many ethernet ports. RTE_MAX_ETHPORTS = %u\n", - (unsigned)RTE_MAX_ETHPORTS); - for (i = 0; i < ports->num_ports - 1; i+=2){ - uint8_t p1 = ports->id[i]; - uint8_t p2 = ports->id[i+1]; + RTE_MAX_ETHPORTS); + for (i = 0; i < ports->num_ports - 1; i += 2) { + uint16_t p1 = ports->id[i]; + uint16_t p2 = ports->id[i + 1]; output_ports[p1] = p2; output_ports[p2] = p1; diff --git a/examples/multi_process/client_server_mp/mp_server/args.c b/examples/multi_process/client_server_mp/mp_server/args.c index bf8c666c2..a65884fd9 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.c +++ b/examples/multi_process/client_server_mp/mp_server/args.c @@ -74,7 +74,7 @@ parse_portmask(uint8_t max_ports, const char *portmask) { char *end = NULL; unsigned long pm; - uint8_t count = 0; + uint16_t count = 0; if (portmask == NULL || *portmask == '\0') return -1; @@ -128,7 +128,7 @@ parse_num_clients(const char *clients) * on error. */ int -parse_app_args(uint8_t max_ports, int argc, char *argv[]) +parse_app_args(uint16_t max_ports, int argc, char *argv[]) { int option_index, opt; char **argvopt = argv; diff --git a/examples/multi_process/client_server_mp/mp_server/args.h b/examples/multi_process/client_server_mp/mp_server/args.h index 23af1bd38..33888b894 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.h +++ b/examples/multi_process/client_server_mp/mp_server/args.h @@ -34,6 +34,6 @@ #ifndef _ARGS_H_ #define _ARGS_H_ -int parse_app_args(uint8_t max_ports, int argc, char *argv[]); +int parse_app_args(uint16_t max_ports, int argc, char *argv[]); #endif /* ifndef _ARGS_H_ */ diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index 0bc929217..cacf4e0d5 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -114,7 +114,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 = { @@ -129,7 +129,7 @@ init_port(uint8_t port_num) uint16_t q; int retval; - printf("Port %u init ... ", (unsigned)port_num); + printf("Port %u init ... ", port_num); fflush(stdout); /* Standard DPDK port initialisation - config port, then set up @@ -200,11 +200,12 @@ init_shm_rings(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -262,7 +263,7 @@ init(int argc, char *argv[]) { int retval; const struct rte_memzone *mz; - uint8_t i, total_ports; + uint16_t i, total_ports; /* init EAL, parsing EAL args */ retval = rte_eal_init(argc, argv); diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index 7055b543a..121383f8c 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -88,7 +88,7 @@ struct client_rx_buf { static struct client_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/multi_process/client_server_mp/shared/common.h b/examples/multi_process/client_server_mp/shared/common.h index 631c46325..35a3b01d0 100644 --- a/examples/multi_process/client_server_mp/shared/common.h +++ b/examples/multi_process/client_server_mp/shared/common.h @@ -57,8 +57,8 @@ struct tx_stats{ } __rte_cache_aligned; struct port_info { - uint8_t num_ports; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t num_ports; + uint16_t id[RTE_MAX_ETHPORTS]; volatile struct rx_stats rx_stats; volatile struct tx_stats tx_stats[MAX_CLIENTS]; }; diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index f8a626ba7..5d7a9566c 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -140,7 +140,8 @@ struct lcore_resource_struct { /* ring[1] for slave send ack, master read */ struct rte_ring *ring[2]; int port_num; /* Total port numbers */ - uint8_t port[RTE_MAX_ETHPORTS]; /* Port id for that lcore to receive packets */ + /* Port id for that lcore to receive packets */ + uint16_t port[RTE_MAX_ETHPORTS]; }__attribute__((packed)) __rte_cache_aligned; static struct lcore_resource_struct lcore_resource[RTE_MAX_LCORE]; @@ -871,11 +872,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"); @@ -930,9 +932,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned rx_lcore_id; unsigned nb_ports_in_mask = 0; unsigned i; diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index af2d9f3f7..98fbd74d1 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -129,7 +129,7 @@ static void netmap_unregif(uint32_t idx, uint32_t port); static int32_t -ifname_to_portid(const char *ifname, uint8_t *port) +ifname_to_portid(const char *ifname, uint16_t *port) { char *endptr; uint64_t portid; @@ -140,7 +140,7 @@ ifname_to_portid(const char *ifname, uint8_t *port) portid >= RTE_DIM(ports) || errno != 0) return -EINVAL; - *port = (uint8_t)portid; + *port = portid; return 0; } @@ -222,10 +222,10 @@ fd_release(int32_t fd) } static int -check_nmreq(struct nmreq *req, uint8_t *port) +check_nmreq(struct nmreq *req, uint16_t *port) { int32_t rc; - uint8_t portid; + uint16_t portid; if (req == NULL) return -EINVAL; @@ -242,7 +242,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) } if (ports[portid].pool == NULL) { - RTE_LOG(ERR, USER1, "Misconfigured portid %hhu\n", portid); + RTE_LOG(ERR, USER1, "Misconfigured portid %u\n", portid); return -EINVAL; } @@ -262,7 +262,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) static int ioctl_niocginfo(__rte_unused int fd, void * param) { - uint8_t portid; + uint16_t portid; struct nmreq *req; int32_t rc; @@ -283,7 +283,7 @@ ioctl_niocginfo(__rte_unused int fd, void * param) } static void -netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, +netmap_ring_setup(struct netmap_ring *ring, uint16_t port, uint32_t ringid, uint32_t num_slots) { uint32_t j; @@ -305,7 +305,7 @@ netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, } static int -netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) +netmap_regif(struct nmreq *req, uint32_t idx, uint16_t port) { struct netmap_if *nmif; struct netmap_ring *ring; @@ -313,7 +313,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) int32_t rc; if (ports[port].fd < RTE_DIM(fd_port)) { - RTE_LOG(ERR, USER1, "port %hhu already in use by fd: %u\n", + RTE_LOG(ERR, USER1, "port %u already in use by fd: %u\n", port, IDX_TO_FD(ports[port].fd)); return -EBUSY; } @@ -399,7 +399,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) static int ioctl_niocregif(int32_t fd, void * param) { - uint8_t portid; + uint16_t portid; int32_t rc; uint32_t idx; struct nmreq *req; @@ -422,7 +422,7 @@ netmap_unregif(uint32_t idx, uint32_t port) { fd_port[idx].port = FD_PORT_RSRV; ports[port].fd = UINT32_MAX; - rte_eth_dev_stop((uint8_t)port); + rte_eth_dev_stop(port); } /** @@ -460,7 +460,7 @@ ioctl_niocunregif(int fd) * packets as it can hold coming from its dpdk port. */ static inline int -rx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +rx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, uint16_t max_burst) { int32_t i, n_rx; @@ -513,7 +513,7 @@ rx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_rx_rings + 1; i++) { r = NETMAP_RXRING(nifp, i); - rx_sync_ring(r, (uint8_t)port, (uint16_t)i, burst); + rx_sync_ring(r, port, (uint16_t)i, burst); rc += r->avail; } @@ -542,7 +542,7 @@ ioctl_niocrxsync(int fd) * buffers into rte_mbufs and sending them out on the rings's dpdk port. */ static int -tx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +tx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, struct rte_mempool *pool, uint16_t max_burst) { uint32_t i, n_tx; @@ -608,7 +608,7 @@ tx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_tx_rings + 1; i++) { r = NETMAP_TXRING(nifp, i); - tx_sync_ring(r, (uint8_t)port, (uint16_t)i, mp, burst); + tx_sync_ring(r, port, (uint16_t)i, mp, burst); rc += r->avail; } @@ -686,7 +686,7 @@ rte_netmap_init(const struct rte_netmap_conf *conf) int -rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) +rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) { int32_t ret; uint16_t i; @@ -696,17 +696,17 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) portid >= RTE_DIM(ports) || conf->nr_tx_rings > netmap.conf.max_rings || conf->nr_rx_rings > netmap.conf.max_rings) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } - rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); - tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); + rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); + tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); if (tx_slots > netmap.conf.max_slots || rx_slots > netmap.conf.max_slots) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } @@ -715,15 +715,15 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) conf->nr_tx_rings, conf->eth_conf); if (ret < 0) { - RTE_LOG(ERR, USER1, "Couldn't configure port %hhu\n", portid); - return ret; + RTE_LOG(ERR, USER1, "Couldn't configure port %u\n", portid); + return ret; } ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_slots, &tx_slots); if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't ot adjust number of descriptors for port %hhu\n", + "Couldn't ot adjust number of descriptors for port %u\n", portid); return ret; } @@ -734,8 +734,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure TX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure TX queue %u of port %u\n", i, portid); return ret; } @@ -745,8 +744,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure RX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure RX queue %u of port %u\n", i, portid); return ret; } diff --git a/examples/netmap_compat/lib/compat_netmap.h b/examples/netmap_compat/lib/compat_netmap.h index 3dc7a2f40..76b2d2b4c 100644 --- a/examples/netmap_compat/lib/compat_netmap.h +++ b/examples/netmap_compat/lib/compat_netmap.h @@ -67,7 +67,7 @@ struct rte_netmap_port_conf { }; int rte_netmap_init(const struct rte_netmap_conf *conf); -int rte_netmap_init_port(uint8_t portid, +int rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf); int rte_netmap_close(int fd); diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index b26c33df5..3add7be47 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -269,21 +269,22 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) 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) port_id); + port_id); rte_eth_tx_buffer_init(tx_buffer[port_id], MAX_PKTS_BURST); ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id], flush_tx_error_callback, NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } return 0; } static inline int -configure_eth_port(uint8_t port_id) +configure_eth_port(uint16_t port_id) { struct ether_addr addr; const uint16_t rxRings = 1, txRings = 1; @@ -326,7 +327,7 @@ configure_eth_port(uint8_t port_id) rte_eth_macaddr_get(port_id, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port_id, + port_id, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -401,7 +402,7 @@ rx_thread(struct rte_ring *ring_out) uint32_t seqn = 0; uint16_t i, ret = 0; uint16_t nb_rx_pkts; - uint8_t port_id; + uint16_t port_id; struct rte_mbuf *pkts[MAX_PKTS_BURST]; RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__, @@ -632,8 +633,8 @@ main(int argc, char **argv) int ret; unsigned nb_ports; unsigned int lcore_id, last_lcore_id, master_lcore_id; - uint8_t port_id; - uint8_t nb_ports_available; + uint16_t port_id; + uint16_t nb_ports_available; struct worker_thread_args worker_args = {NULL, NULL}; struct send_thread_args send_args = {NULL, NULL}; struct rte_ring *rx_to_workers; @@ -687,7 +688,7 @@ main(int argc, char **argv) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) port_id); + printf("Initializing port %u... done\n", port_id); if (configure_eth_port(port_id) != 0) rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 7954b9744..521a4af0e 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -140,7 +140,7 @@ parse_ptype(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(__rte_unused uint8_t port, __rte_unused uint16_t queue, +cb_parse_ptype(__rte_unused uint16_t port, __rte_unused uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, __rte_unused uint16_t max_pkts, __rte_unused void *user_param) { @@ -277,7 +277,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint32_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -287,7 +287,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct rx_thread_params { - uint8_t port_id; + uint32_t port_id; uint8_t queue_id; uint8_t lcore_id; uint8_t thread_id; @@ -636,7 +636,7 @@ struct thread_tx_conf { struct thread_conf conf; uint16_t tx_queue_id[RTE_MAX_LCORE]; - struct mbuf_table tx_mbufs[RTE_MAX_LCORE]; + struct mbuf_table tx_mbufs[RTE_MAX_ETHPORTS]; struct rte_ring *ring; struct lthread_cond **ready; @@ -648,7 +648,7 @@ struct thread_tx_conf tx_thread[MAX_TX_THREAD]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct thread_tx_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -669,7 +669,7 @@ send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) /* 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) { uint16_t len; struct thread_tx_conf *qconf; @@ -696,8 +696,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) #if ((APP_LOOKUP_METHOD == APP_LOOKUP_LPM) && \ (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline void -send_packetsx4(uint8_t port, - struct rte_mbuf *m[], uint32_t num) +send_packetsx4(uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; struct thread_tx_conf *qconf; @@ -832,9 +831,9 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len) static __m128i mask0; static __m128i mask1; static __m128i mask2; -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, - lookup_struct_t *ipv4_l3fwd_lookup_struct) +static inline uint16_t +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; @@ -846,12 +845,12 @@ get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, key.xmm = _mm_and_si128(data, mask0); /* 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 -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, - lookup_struct_t *ipv6_l3fwd_lookup_struct) +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, + lookup_struct_t *ipv6_l3fwd_lookup_struct) { int ret = 0; union ipv6_5tuple_host key; @@ -873,36 +872,36 @@ get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t)((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(((struct ipv4_hdr *)ipv4_hdr)->dst_addr), &next_hop) == 0) ? next_hop : portid); } -static inline uint8_t -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, - lookup6_struct_t *ipv6_l3fwd_lookup_struct) +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, + lookup6_struct_t *ipv6_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, - ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) == 0) ? - next_hop : portid); + return ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, + ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) == 0) ? + next_hop : portid); } #endif -static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) __attribute__((unused)); #if ((APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH) && \ @@ -919,11 +918,11 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) #define EXCLUDE_8TH_PKT 0x7f static inline void -simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { struct ether_hdr *eth_hdr[8]; struct ipv4_hdr *ipv4_hdr[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; int32_t ret[8]; union ipv4_5tuple_host key[8]; __m128i data[8]; @@ -1042,14 +1041,14 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv4_lookup_struct, &key_array[0], 8, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1146,10 +1145,10 @@ static inline void get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0, } static inline void -simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { int32_t ret[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; struct ether_hdr *eth_hdr[8]; union ipv6_5tuple_host key[8]; @@ -1196,14 +1195,14 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv6_lookup_struct, &key_array[0], 4, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1250,24 +1249,24 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) ether_addr_copy(&ports_eth_addr[dst_port[6]], ð_hdr[6]->s_addr); ether_addr_copy(&ports_eth_addr[dst_port[7]], ð_hdr[7]->s_addr); - send_single_packet(m[0], (uint8_t)dst_port[0]); - send_single_packet(m[1], (uint8_t)dst_port[1]); - send_single_packet(m[2], (uint8_t)dst_port[2]); - send_single_packet(m[3], (uint8_t)dst_port[3]); - send_single_packet(m[4], (uint8_t)dst_port[4]); - send_single_packet(m[5], (uint8_t)dst_port[5]); - send_single_packet(m[6], (uint8_t)dst_port[6]); - send_single_packet(m[7], (uint8_t)dst_port[7]); + send_single_packet(m[0], dst_port[0]); + send_single_packet(m[1], dst_port[1]); + send_single_packet(m[2], dst_port[2]); + send_single_packet(m[3], dst_port[3]); + send_single_packet(m[4], dst_port[4]); + send_single_packet(m[5], dst_port[5]); + send_single_packet(m[6], dst_port[6]); + send_single_packet(m[7], dst_port[7]); } #endif /* APP_LOOKUP_METHOD */ static __rte_always_inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -1379,7 +1378,7 @@ rfc1812_process(struct ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype) (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline uint16_t -get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) +get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -1406,7 +1405,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) } static inline void -process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint8_t portid) +process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; @@ -1473,7 +1472,7 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], static inline void processx4_step2(__m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -1716,7 +1715,8 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2) static void process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx, - uint8_t portid) { + uint16_t portid) +{ int j; @@ -2091,7 +2091,7 @@ lthread_tx(void *args) struct lthread *lt; unsigned lcore_id; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; tx_conf = (struct thread_tx_conf *)args; @@ -2138,7 +2138,8 @@ lthread_rx(void *dummy) int ret; uint16_t nb_rx; int i; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; int worker_id; int len[RTE_MAX_LCORE] = { 0 }; int old_len, new_len; @@ -2164,8 +2165,8 @@ lthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", - rte_lcore_id(), portid, queueid); + RTE_LOG(INFO, L3FWD, "-- lcoreid=%u portid=%u rxqueueid=%u\n", + rte_lcore_id(), portid, queueid); } /* @@ -2323,7 +2324,7 @@ pthread_tx(void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; uint64_t prev_tsc, diff_tsc, cur_tsc; int nb_rx; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -2392,7 +2393,8 @@ pthread_rx(void *dummy) uint32_t n; uint32_t nb_rx; unsigned lcore_id; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct thread_rx_conf *rx_conf; @@ -2411,8 +2413,9 @@ pthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", - lcore_id, portid, queueid); + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", + lcore_id, portid, queueid); } worker_id = 0; @@ -2769,7 +2772,7 @@ parse_rx_config(const char *q_arg) return -1; } rx_thread_params_array[nb_rx_thread_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + int_fld[FLD_PORT]; rx_thread_params_array[nb_rx_thread_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; rx_thread_params_array[nb_rx_thread_params].lcore_id = @@ -2853,7 +2856,7 @@ parse_stat_lcore(const char *stat_lcore) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -3440,7 +3443,8 @@ check_all_ports_link_status(uint8_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"); @@ -3455,14 +3459,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 */ @@ -3497,10 +3500,11 @@ main(int argc, char **argv) int ret; int i; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index ddfcdb832..c495e7508 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -158,12 +158,12 @@ struct ptpv2_data_slave_ordinary { struct clock_id master_clock_id; struct timeval new_adj; int64_t delta; - uint8_t portid; + uint16_t portid; uint16_t seqID_SYNC; uint16_t seqID_FOLLOWUP; uint8_t ptpset; uint8_t kernel_time_set; - uint8_t current_ptp_port; + uint16_t current_ptp_port; }; static struct ptpv2_data_slave_ordinary ptp_data; diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 2350d64f4..203a34704 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -252,8 +252,8 @@ app_parse_flow_conf(const char *conf_str) pconf = &qos_conf[nb_pfc]; - pconf->rx_port = (uint8_t)vals[0]; - pconf->tx_port = (uint8_t)vals[1]; + pconf->rx_port = vals[0]; + pconf->tx_port = vals[1]; pconf->rx_core = (uint8_t)vals[2]; pconf->wt_core = (uint8_t)vals[3]; if (ret == 5) @@ -267,19 +267,19 @@ app_parse_flow_conf(const char *conf_str) } if (pconf->rx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu16" index\n", nb_pfc, pconf->rx_port); return -1; } if (pconf->tx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu16" index\n", nb_pfc, pconf->tx_port); return -1; } mask = 1lu << pconf->rx_port; if (app_used_rx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu16" is used already\n", nb_pfc, pconf->rx_port); return -1; } @@ -288,7 +288,7 @@ app_parse_flow_conf(const char *conf_str) mask = 1lu << pconf->tx_port; if (app_used_tx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: port %"PRIu16" is used already\n", nb_pfc, pconf->tx_port); return -1; } diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index a82cbd7d5..004ac54e7 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -100,7 +100,7 @@ static const struct rte_eth_conf port_conf = { }; static int -app_init_port(uint8_t portid, struct rte_mempool *mp) +app_init_port(uint16_t portid, struct rte_mempool *mp) { int ret; struct rte_eth_link link; @@ -127,19 +127,21 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; /* init port */ - RTE_LOG(INFO, APP, "Initializing port %"PRIu8"... ", portid); + RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot configure device: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "Cannot configure device: err=%d, port=%u\n", + ret, portid); rx_size = ring_conf.rx_size; tx_size = ring_conf.tx_size; ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_size, &tx_size); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_dev_adjust_nb_rx_tx_desc: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_dev_adjust_nb_rx_tx_desc: err=%d,port=%u\n", + ret, portid); ring_conf.rx_size = rx_size; ring_conf.tx_size = tx_size; @@ -148,22 +150,25 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size, rte_eth_dev_socket_id(portid), &rx_conf, mp); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u\n", + ret, portid); /* init one TX queue */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, (uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, " - "port=%"PRIu8" queue=%d\n", ret, portid, 0); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n", + ret, portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_pmd_port_start: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_pmd_port_start: err=%d, port=%u\n", + ret, portid); printf("done: "); @@ -256,7 +261,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) uint32_t pipe, subport; int err; - rte_eth_link_get((uint8_t)portid, &link); + rte_eth_link_get(portid, &link); port_params.socket = socketid; port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8; diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index e10cfd448..60caa8b77 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -125,8 +125,7 @@ app_main_loop(__attribute__((unused))void *dummy) /* initialize mbuf memory */ if (mode == APP_RX_MODE) { for (i = 0; i < rx_idx; i++) { - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "reading port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u reading port%u\n", i, lcore_id, rx_confs[i]->rx_port); } @@ -140,9 +139,9 @@ app_main_loop(__attribute__((unused))void *dummy) if (wt_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u sched+write " - "port %"PRIu8"\n", - i, lcore_id, wt_confs[i]->tx_port); + RTE_LOG(INFO, APP, + "flow %u lcoreid %u sched+write port %u\n", + i, lcore_id, wt_confs[i]->tx_port); } app_mixed_thread(wt_confs); @@ -155,9 +154,8 @@ app_main_loop(__attribute__((unused))void *dummy) if (tx_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "writing port %"PRIu8"\n", - i, lcore_id, tx_confs[i]->tx_port); + RTE_LOG(INFO, APP, "flow%u lcoreid%u write port%u\n", + i, lcore_id, tx_confs[i]->tx_port); } app_tx_thread(tx_confs); @@ -186,7 +184,7 @@ app_stat(void) struct flow_conf *flow = &qos_conf[i]; rte_eth_stats_get(flow->rx_port, &stats); - printf("\nRX port %"PRIu8": rx: %"PRIu64 " err: %"PRIu64 + printf("\nRX port %"PRIu16": rx: %"PRIu64 " err: %"PRIu64 " no_mbuf: %"PRIu64 "\n", flow->rx_port, stats.ipackets - rx_stats[i].ipackets, @@ -195,7 +193,7 @@ app_stat(void) memcpy(&rx_stats[i], &stats, sizeof(stats)); rte_eth_stats_get(flow->tx_port, &stats); - printf("TX port %"PRIu8": tx: %" PRIu64 " err: %" PRIu64 "\n", + printf("TX port %"PRIu16": tx: %" PRIu64 " err: %" PRIu64 "\n", flow->tx_port, stats.opackets - tx_stats[i].opackets, stats.oerrors - tx_stats[i].oerrors); diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h index 8d02e1ade..77b6e3ee7 100644 --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -106,8 +106,8 @@ struct thread_conf uint32_t n_mbufs; struct rte_mbuf **m_table; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -125,8 +125,8 @@ struct flow_conf uint32_t rx_core; uint32_t wt_core; uint32_t tx_core; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -188,13 +188,15 @@ void app_worker_thread(struct thread_conf **qconf); void app_mixed_thread(struct thread_conf **qconf); void app_stat(void); -int subport_stat(uint8_t port_id, uint32_t subport_id); -int pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q); -int qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc); -int qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc); -int qavg_subport(uint8_t port_id, uint32_t subport_id); +int subport_stat(uint16_t port_id, uint32_t subport_id); +int pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc, uint8_t q); +int qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc); +int qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc); +int qavg_subport(uint16_t port_id, uint32_t subport_id); #ifdef __cplusplus } diff --git a/examples/qos_sched/stats.c b/examples/qos_sched/stats.c index 5c894455b..4e97a022e 100644 --- a/examples/qos_sched/stats.c +++ b/examples/qos_sched/stats.c @@ -37,7 +37,8 @@ #include "main.h" int -qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q) +qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, + uint8_t q) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -74,7 +75,8 @@ qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8 } int -qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) +qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -114,7 +116,7 @@ qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) } int -qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -153,7 +155,7 @@ qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) } int -qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) +qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -195,7 +197,7 @@ qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) } int -qavg_subport(uint8_t port_id, uint32_t subport_id) +qavg_subport(uint16_t port_id, uint32_t subport_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -237,7 +239,7 @@ qavg_subport(uint8_t port_id, uint32_t subport_id) } int -subport_stat(uint8_t port_id, uint32_t subport_id) +subport_stat(uint16_t port_id, uint32_t subport_id) { struct rte_sched_subport_stats stats; struct rte_sched_port *port; @@ -273,7 +275,7 @@ subport_stat(uint8_t port_id, uint32_t subport_id) } int -pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 083a37a92..415b68bb9 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -156,12 +156,12 @@ void init_ring(int lcore_id, uint8_t port_id) void pair_ports(void) { - uint8_t i, j; + uint16_t i, j; /* Pair ports with their "closest neighbour" in the portmask */ for (i = 0; i < RTE_MAX_ETHPORTS; i++) if (is_bit_set(i, portmask)) - for (j = (uint8_t) (i + 1); j < RTE_MAX_ETHPORTS; j++) + for (j = i + 1; j < RTE_MAX_ETHPORTS; j++) if (is_bit_set(j, portmask)) { port_pairs[i] = j; port_pairs[j] = i; diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c index d4fcfde48..e5ecdb1cf 100644 --- a/examples/quota_watermark/qw/main.c +++ b/examples/quota_watermark/qw/main.c @@ -155,7 +155,7 @@ receive_stage(__attribute__((unused)) void *args) { int i, ret; - uint8_t port_id; + uint16_t port_id; uint16_t nb_rx_pkts; unsigned int lcore_id; @@ -216,7 +216,7 @@ pipeline_stage(__attribute__((unused)) void *args) int i, ret; int nb_dq_pkts; - uint8_t port_id; + uint16_t port_id; unsigned int lcore_id, previous_lcore_id; unsigned int free; @@ -279,8 +279,8 @@ send_stage(__attribute__((unused)) void *args) { uint16_t nb_dq_pkts; - uint8_t port_id; - uint8_t dest_port_id; + uint16_t port_id; + uint16_t dest_port_id; unsigned int lcore_id, previous_lcore_id; @@ -324,7 +324,7 @@ main(int argc, char **argv) int ret; unsigned int lcore_id, master_lcore_id, last_lcore_id; - uint8_t port_id; + uint16_t port_id; rte_log_set_global_level(RTE_LOG_INFO); diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 669924055..e66f16f25 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -59,7 +59,7 @@ static struct { 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, uint16_t max_pkts __rte_unused, void *_ __rte_unused) { @@ -72,7 +72,7 @@ add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } 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; @@ -97,7 +97,7 @@ calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused, * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; - uint8_t portid; + uint16_t portid; /* init EAL */ int ret = rte_eal_init(argc, argv); diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index dcdc0a48b..382a2ded8 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -95,7 +95,7 @@ struct efd_stats { static struct node_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/server_node_efd/shared/common.h b/examples/server_node_efd/shared/common.h index 8a1347993..b1e0abe52 100644 --- a/examples/server_node_efd/shared/common.h +++ b/examples/server_node_efd/shared/common.h @@ -65,9 +65,9 @@ struct filter_stats { struct shared_info { uint8_t num_nodes; - uint8_t num_ports; + uint16_t num_ports; uint32_t num_flows; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t id[RTE_MAX_ETHPORTS]; struct rx_stats rx_stats; struct tx_stats tx_stats[MAX_NODES]; struct filter_stats filter_stats[MAX_NODES]; diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index b4d50de89..e623754cf 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -57,7 +57,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -104,7 +104,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -122,8 +122,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -179,7 +179,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -204,7 +204,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 4d1589d06..89a61f0e5 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -177,7 +177,7 @@ static 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 = 0; /**< The number of ports specified in command line */ static uint16_t num_pf_queues, num_vmdq_queues; static uint16_t vmdq_pool_base, vmdq_queue_base; @@ -265,7 +265,7 @@ validate_num_devices(uint32_t max_nb_devices) * coming from the mbuf_pool passed as parameter */ static inline int -port_init(uint8_t port) +port_init(uint16_t port) { struct rte_eth_dev_info dev_info; struct rte_eth_conf port_conf; @@ -392,7 +392,7 @@ port_init(uint8_t port) RTE_LOG(INFO, VHOST_PORT, "Max virtio devices supported: %u\n", num_devices); RTE_LOG(INFO, VHOST_PORT, "Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, vmdq_ports_eth_addr[port].addr_bytes[0], vmdq_ports_eth_addr[port].addr_bytes[1], vmdq_ports_eth_addr[port].addr_bytes[2], @@ -667,7 +667,7 @@ us_vhost_parse_args(int argc, char **argv) for (i = 0; i < RTE_MAX_ETHPORTS; i++) { if (enabled_port_mask & (1 << i)) - ports[num_ports++] = (uint8_t)i; + ports[num_ports++] = i; } if ((num_ports == 0) || (num_ports > MAX_SUP_PORTS)) { @@ -1443,7 +1443,7 @@ main(int argc, char *argv[]) unsigned lcore_id, core_id = 0; unsigned nb_ports, valid_num_ports; int ret, i; - uint8_t portid; + uint16_t portid; static pthread_t tid; char thread_name[RTE_MAX_THREAD_NAME_LEN]; uint64_t flags = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/4] examples: increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 3/4] examples: " Zhiyong Yang @ 2017-09-14 14:41 ` Ferruh Yigit 0 siblings, 0 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-09-14 14:41 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, hemant.agrawal, david.hunt On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > Modify port_id related code in examples accordingly since port_id > definition in lib and pmd changes. > > Fix some original checkpatch issues and remove some unnecessary > cast at the same time. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > --- <...> > > diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst > index 170f4f916..98fd7cb23 100644 > --- a/doc/guides/rel_notes/release_17_11.rst > +++ b/doc/guides/rel_notes/release_17_11.rst > @@ -41,6 +41,10 @@ New Features > Also, make sure to start the actual text at the margin. > ========================================================= > > +* **Extended port_id range from uint8_t to uint16_t.** > + > + Extended port_id range from 8 bits to 16 bits in order to support more than > + 256 ports in dpdk. > > Resolved Issues > --------------- There was a LIBABIVER update comment in patch 1/4, let me continue it here. First lets extract documentation on its own patch, instead of being part of "examples" update. And update it a little more: 1- Remove deprecation notice. Each patch implements a deprecation notice also should remove the notice. rel_notes/deprecation.rst should be updated to remove port_id related paragraph. 2- LIBABIVER values of increased libraries should be increased. LIBABIVER is defined in each library Makefile, and set to the value of current version of the library. The libraries breaking ABI/API should increase this by one. So for this patch, following libraries should be updated: drivers/net/bnxt drivers/net/bonding drivers/net/i40e drivers/net/ixgbe lib/librte_ether lib/librte_bitratestats lib/librte_pdump Please double check the list the libraries in case I missed. And it seems we are breaking more API than initially intended. Should we highlight this more? 3- Document updated library versions in release notes in release notes, there is a "Shared Library Versions" section. This section lists all libraries with their versions, like: " librte_ethdev.so.7" [1] This should be updates as: " librte_ethdev.so.8" [1] It seems I have selected wrong sample :(, there is a mismatch in Makefile LIBABIVER value and release notes version for librte_ethdev, I will send a patch for it. <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v3 4/4] librte_mbuf: modify port initialization value 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang ` (2 preceding siblings ...) 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 3/4] examples: " Zhiyong Yang @ 2017-09-09 14:47 ` Zhiyong Yang 2017-09-11 10:23 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Ferruh Yigit ` (2 subsequent siblings) 6 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-09 14:47 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, hemant.agrawal, david.hunt, Zhiyong Yang In order to support more than 256 virtual ports, the field "port" in rte_mbuf has been increased to 16 bits. The initialization/reset value of the field "port" should be changed from 0xff to 0xffff accordingly. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 26a62b8e1..bcf4e2fcf 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp, /* init some constant fields */ m->pool = mp; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; rte_mbuf_refcnt_set(m, 1); m->next = NULL; } diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eaed7eee0..cc380400d 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1087,6 +1087,8 @@ static inline void rte_pktmbuf_reset_headroom(struct rte_mbuf *m) * @param m * The packet mbuf to be resetted. */ +#define MBUF_INVALID_PORT UINT16_MAX + static inline void rte_pktmbuf_reset(struct rte_mbuf *m) { m->next = NULL; @@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m) m->vlan_tci = 0; m->vlan_tci_outer = 0; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; m->ol_flags = 0; m->packet_type = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang ` (3 preceding siblings ...) 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 4/4] librte_mbuf: modify port initialization value Zhiyong Yang @ 2017-09-11 10:23 ` Ferruh Yigit 2017-09-11 11:25 ` Yang, Zhiyong 2017-09-13 8:14 ` Matej Vido 2017-09-11 10:26 ` Ferruh Yigit 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang 6 siblings, 2 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-09-11 10:23 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, hemant.agrawal, david.hunt On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > port_id is currently defined as uint8_t, which is limited to the range > 0 to 255. A larger range is required for vdev scalability. > > It is necessary for a redefinition of port_id to extend it from > 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will > be changed at the same time. > > Discussion about port_id is the following thread. > http://www.dpdk.org/dev/patchwork/patch/23208/ > > Changes in V2: > 1. cover more PMDs to increase port_id range. > 2. cover more examples to increase port_id range. > 3. add 17.11 release note. > > Changes in V3: > 1. cover mlx4 and mlx5. > 2. add to increase port_id range in test code. > 3. The patch "librte_mbuf: modify port initialization value" is merged > into the patchset. > > Zhiyong Yang (4): > ethdev: increase port_id range > test: increase port_id range > examples: increase port_id range > librte_mbuf: modify port initialization value > PMD Maintainers, please review this patch for your PMD, this innocent uint8_t to uint16_t change may break your PMD! ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-11 10:23 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Ferruh Yigit @ 2017-09-11 11:25 ` Yang, Zhiyong 2017-09-13 8:14 ` Matej Vido 1 sibling, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-11 11:25 UTC (permalink / raw) To: Yigit, Ferruh, dev; +Cc: thomas, hemant.agrawal, Hunt, David > -----Original Message----- > From: Yigit, Ferruh > Sent: Monday, September 11, 2017 6:23 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David > <david.hunt@intel.com> > Subject: Re: [PATCH v3 0/4] increase port_id range > > On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > > port_id is currently defined as uint8_t, which is limited to the range > > 0 to 255. A larger range is required for vdev scalability. > > > > It is necessary for a redefinition of port_id to extend it from > > 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will > > be changed at the same time. > > > > Discussion about port_id is the following thread. > > http://www.dpdk.org/dev/patchwork/patch/23208/ > > > > Changes in V2: > > 1. cover more PMDs to increase port_id range. > > 2. cover more examples to increase port_id range. > > 3. add 17.11 release note. > > > > Changes in V3: > > 1. cover mlx4 and mlx5. > > 2. add to increase port_id range in test code. > > 3. The patch "librte_mbuf: modify port initialization value" is > > merged into the patchset. > > > > Zhiyong Yang (4): > > ethdev: increase port_id range > > test: increase port_id range > > examples: increase port_id range > > librte_mbuf: modify port initialization value > > > > PMD Maintainers, please review this patch for your PMD, this innocent uint8_t > to uint16_t change may break your PMD! Agreed seriously. The patchset needs more reviews and comments. thanks Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-11 10:23 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Ferruh Yigit 2017-09-11 11:25 ` Yang, Zhiyong @ 2017-09-13 8:14 ` Matej Vido 2017-09-13 8:21 ` Yang, Zhiyong 1 sibling, 1 reply; 101+ messages in thread From: Matej Vido @ 2017-09-13 8:14 UTC (permalink / raw) To: Ferruh Yigit, Zhiyong Yang, dev On 11.09.2017 12:23, Ferruh Yigit wrote: > On 9/9/2017 3:47 PM, Zhiyong Yang wrote: >> port_id is currently defined as uint8_t, which is limited to the range >> 0 to 255. A larger range is required for vdev scalability. >> >> It is necessary for a redefinition of port_id to extend it from >> 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will >> be changed at the same time. >> >> Discussion about port_id is the following thread. >> http://www.dpdk.org/dev/patchwork/patch/23208/ >> >> Changes in V2: >> 1. cover more PMDs to increase port_id range. >> 2. cover more examples to increase port_id range. >> 3. add 17.11 release note. >> >> Changes in V3: >> 1. cover mlx4 and mlx5. >> 2. add to increase port_id range in test code. >> 3. The patch "librte_mbuf: modify port initialization value" is merged >> into the patchset. >> >> Zhiyong Yang (4): >> ethdev: increase port_id range >> test: increase port_id range >> examples: increase port_id range >> librte_mbuf: modify port initialization value >> > PMD Maintainers, please review this patch for your PMD, this innocent > uint8_t to uint16_t change may break your PMD! Regarding the szedata2 PMD this change is fine. Thanks, Matej ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-13 8:14 ` Matej Vido @ 2017-09-13 8:21 ` Yang, Zhiyong 2017-09-18 14:54 ` Laatz, Kevin 0 siblings, 1 reply; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-13 8:21 UTC (permalink / raw) To: Matej Vido, Yigit, Ferruh, dev Hi Matej, > -----Original Message----- > From: Matej Vido [mailto:vido@cesnet.cz] > Sent: Wednesday, September 13, 2017 4:14 PM > To: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong > <zhiyong.yang@intel.com>; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range > > On 11.09.2017 12:23, Ferruh Yigit wrote: > > On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > >> port_id is currently defined as uint8_t, which is limited to the > >> range > >> 0 to 255. A larger range is required for vdev scalability. > >> > >> It is necessary for a redefinition of port_id to extend it from > >> 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id > >> will be changed at the same time. > >> > >> Discussion about port_id is the following thread. > >> http://www.dpdk.org/dev/patchwork/patch/23208/ > >> > >> Changes in V2: > >> 1. cover more PMDs to increase port_id range. > >> 2. cover more examples to increase port_id range. > >> 3. add 17.11 release note. > >> > >> Changes in V3: > >> 1. cover mlx4 and mlx5. > >> 2. add to increase port_id range in test code. > >> 3. The patch "librte_mbuf: modify port initialization value" is > >> merged into the patchset. > >> > >> Zhiyong Yang (4): > >> ethdev: increase port_id range > >> test: increase port_id range > >> examples: increase port_id range > >> librte_mbuf: modify port initialization value > >> > > PMD Maintainers, please review this patch for your PMD, this innocent > > uint8_t to uint16_t change may break your PMD! > Regarding the szedata2 PMD this change is fine. > Thanks for your review. Zhiyong > Thanks, > Matej ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-13 8:21 ` Yang, Zhiyong @ 2017-09-18 14:54 ` Laatz, Kevin 2017-09-19 1:39 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Laatz, Kevin @ 2017-09-18 14:54 UTC (permalink / raw) To: Yang, Zhiyong, Matej Vido, Yigit, Ferruh, dev <snip> > > -----Original Message----- > > From: Matej Vido [mailto:vido@cesnet.cz] > > Sent: Wednesday, September 13, 2017 4:14 PM > > To: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong > > <zhiyong.yang@intel.com>; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range > > > > On 11.09.2017 12:23, Ferruh Yigit wrote: > > > On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > > >> port_id is currently defined as uint8_t, which is limited to the > > >> range > > >> 0 to 255. A larger range is required for vdev scalability. > > >> > > >> It is necessary for a redefinition of port_id to extend it from > > >> 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id > > >> will be changed at the same time. > > >> > > >> Discussion about port_id is the following thread. > > >> http://www.dpdk.org/dev/patchwork/patch/23208/ > > >> > > >> Changes in V2: > > >> 1. cover more PMDs to increase port_id range. > > >> 2. cover more examples to increase port_id range. > > >> 3. add 17.11 release note. > > >> > > >> Changes in V3: > > >> 1. cover mlx4 and mlx5. > > >> 2. add to increase port_id range in test code. > > >> 3. The patch "librte_mbuf: modify port initialization value" is > > >> merged into the patchset. > > >> > > >> Zhiyong Yang (4): > > >> ethdev: increase port_id range > > >> test: increase port_id range > > >> examples: increase port_id range > > >> librte_mbuf: modify port initialization value > > >> <snip> Hi Zhiyong, Had a look over this patchset. Found that from patch 1/4 to 2/4 test-build fails, as expected, please note this in the cover letter. Similarly, from patch 1/4 to 3/4 examples fail to build, could also be noted in the cover letter. Also, there are some minor comment indentation inconsistencies in bnx2x_rxtx.h: bnx2x_rx_queue() bnx2x_tx_queue() In rte_port_ethdev.c , rte_port_ethdev_reader_create() has some modifications which are unrelated to the patchset. Other than that it looks good to me. Kevin. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-18 14:54 ` Laatz, Kevin @ 2017-09-19 1:39 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-19 1:39 UTC (permalink / raw) To: Laatz, Kevin, Matej Vido, Yigit, Ferruh, dev Hi kevin, > -----Original Message----- > From: Laatz, Kevin > Sent: Monday, September 18, 2017 10:54 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; Matej Vido <vido@cesnet.cz>; > Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v3 0/4] increase port_id range > > <snip> > > > > -----Original Message----- > > > From: Matej Vido [mailto:vido@cesnet.cz] > > > Sent: Wednesday, September 13, 2017 4:14 PM > > > To: Yigit, Ferruh <ferruh.yigit@intel.com>; Yang, Zhiyong > > > <zhiyong.yang@intel.com>; dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range > > > > > > On 11.09.2017 12:23, Ferruh Yigit wrote: > > > > On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > > > >> port_id is currently defined as uint8_t, which is limited to the > > > >> range > > > >> 0 to 255. A larger range is required for vdev scalability. > > > >> > > > >> It is necessary for a redefinition of port_id to extend it from > > > >> 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id > > > >> will be changed at the same time. > > > >> > > > >> Discussion about port_id is the following thread. > > > >> http://www.dpdk.org/dev/patchwork/patch/23208/ > > > >> > > > >> Changes in V2: > > > >> 1. cover more PMDs to increase port_id range. > > > >> 2. cover more examples to increase port_id range. > > > >> 3. add 17.11 release note. > > > >> > > > >> Changes in V3: > > > >> 1. cover mlx4 and mlx5. > > > >> 2. add to increase port_id range in test code. > > > >> 3. The patch "librte_mbuf: modify port initialization value" is > > > >> merged into the patchset. > > > >> > > > >> Zhiyong Yang (4): > > > >> ethdev: increase port_id range > > > >> test: increase port_id range > > > >> examples: increase port_id range > > > >> librte_mbuf: modify port initialization value > > > >> > > <snip> > > Hi Zhiyong, > > Had a look over this patchset. Found that from patch 1/4 to 2/4 test-build fails, > as expected, please note this in the cover letter. Similarly, from patch 1/4 to 3/4 > examples fail to build, could also be noted in the cover letter. > > Also, there are some minor comment indentation inconsistencies in > bnx2x_rxtx.h: > bnx2x_rx_queue() > bnx2x_tx_queue() > > In rte_port_ethdev.c , rte_port_ethdev_reader_create() has some modifications > which are unrelated to the patchset. > > Other than that it looks good to me. > Thanks for your reviews and comments, I will note them and modify the code next version. Thanks Zhiyong > Kevin. > ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang ` (4 preceding siblings ...) 2017-09-11 10:23 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Ferruh Yigit @ 2017-09-11 10:26 ` Ferruh Yigit 2017-09-11 10:55 ` Yang, Zhiyong 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang 6 siblings, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-11 10:26 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, hemant.agrawal, david.hunt On 9/9/2017 3:47 PM, Zhiyong Yang wrote: > port_id is currently defined as uint8_t, which is limited to the range > 0 to 255. A larger range is required for vdev scalability. > > It is necessary for a redefinition of port_id to extend it from > 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will > be changed at the same time. > > Discussion about port_id is the following thread. > http://www.dpdk.org/dev/patchwork/patch/23208/ > > Changes in V2: > 1. cover more PMDs to increase port_id range. > 2. cover more examples to increase port_id range. > 3. add 17.11 release note. > > Changes in V3: > 1. cover mlx4 and mlx5. > 2. add to increase port_id range in test code. > 3. The patch "librte_mbuf: modify port initialization value" is merged > into the patchset. > > Zhiyong Yang (4): > ethdev: increase port_id range > test: increase port_id range > examples: increase port_id range > librte_mbuf: modify port initialization value This breaks almost all rte_eth_dev APIs, and will effect almost all users! So please document this update in release notes. Thanks, ferruh ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-11 10:26 ` Ferruh Yigit @ 2017-09-11 10:55 ` Yang, Zhiyong 2017-09-11 11:24 ` Ferruh Yigit 0 siblings, 1 reply; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-11 10:55 UTC (permalink / raw) To: Yigit, Ferruh, dev; +Cc: thomas, hemant.agrawal, Hunt, David Hi Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Monday, September 11, 2017 6:27 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David > <david.hunt@intel.com> > Subject: Re: [PATCH v3 0/4] increase port_id range > > > 3. add 17.11 release note. > This breaks almost all rte_eth_dev APIs, and will effect almost all users! So > please document this update in release notes. > I have added release notes in 3/4 patch and will update the content according to Your suggestion. Thanks Zhiyong > Thanks, > ferruh ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/4] increase port_id range 2017-09-11 10:55 ` Yang, Zhiyong @ 2017-09-11 11:24 ` Ferruh Yigit 0 siblings, 0 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-09-11 11:24 UTC (permalink / raw) To: Yang, Zhiyong, dev; +Cc: thomas, hemant.agrawal, Hunt, David On 9/11/2017 11:55 AM, Yang, Zhiyong wrote: > Hi Ferruh, > >> -----Original Message----- >> From: Yigit, Ferruh >> Sent: Monday, September 11, 2017 6:27 PM >> To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org >> Cc: thomas@monjalon.net; hemant.agrawal@nxp.com; Hunt, David >> <david.hunt@intel.com> >> Subject: Re: [PATCH v3 0/4] increase port_id range >> >>> 3. add 17.11 release note. > >> This breaks almost all rte_eth_dev APIs, and will effect almost all users! So >> please document this update in release notes. >> > I have added release notes in 3/4 patch and will update the content according to > Your suggestion. Ahh, I missed it, thanks. ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v4 0/5] increase port_id range 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang ` (5 preceding siblings ...) 2017-09-11 10:26 ` Ferruh Yigit @ 2017-09-21 8:32 ` Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang ` (5 more replies) 6 siblings, 6 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-21 8:32 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit port_id is currently defined as uint8_t, which is limited to the range 0 to 255. A larger range is required for vdev scalability. It is necessary for a redefinition of port_id to extend it from 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will be changed at the same time. Discussion about port_id is the following thread. http://www.dpdk.org/dev/patchwork/patch/23208/ Changes in V2: 1. cover more PMDs to increase port_id range. 2. cover more examples to increase port_id range. 3. add 17.11 release note. Changes in V3: 1. cover mlx4 and mlx5. 2. add to increase port_id range in test code. 3. The patch "librte_mbuf: modify port initialization value" is merged into the patchset. Changes in V4: 1. Add a patch to remove bonding APIs using ABI versioning according to Ferruh's comments. 2. Unify to use typedef portid_t in testpmd code. 3. Update release note and deprecation doc in 2/5 4. Fix some issues according to comments. Note: 3/5 and 4/5 patches' compilling depends on 2/5 patch since 2/5 patch breaks lib/PMD API/ABI. Zhiyong Yang (5): net/bonding: remove bonding APIs using ABI versioning ethdev: increase port_id range examples: increase port_id range test: increase port_id range librte_mbuf: modify port initialization value app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 +-- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 18 +- app/test-pmd/testpmd.h | 4 +- doc/guides/rel_notes/deprecation.rst | 6 - doc/guides/rel_notes/release_17_11.rst | 18 +- drivers/net/af_packet/Makefile | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/Makefile | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/Makefile | 2 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnxt/Makefile | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 32 +-- drivers/net/bonding/Makefile | 2 +- drivers/net/bonding/rte_eth_bond.h | 42 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 193 +++-------------- drivers/net/bonding/rte_eth_bond_8023ad.h | 48 ++-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 62 +++--- drivers/net/bonding/rte_eth_bond_private.h | 45 ++-- drivers/net/bonding/rte_eth_bond_version.map | 4 - drivers/net/e1000/Makefile | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/Makefile | 2 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/Makefile | 2 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/Makefile | 2 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++-- drivers/net/ixgbe/Makefile | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 ++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 64 +++--- drivers/net/mlx5/mlx5_rxtx.h | 4 +- drivers/net/nfp/nfp_net.c | 16 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/Makefile | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/Makefile | 2 +- drivers/net/vhost/rte_eth_vhost.c | 6 +- drivers/net/vhost/rte_eth_vhost.h | 4 +- drivers/net/virtio/Makefile | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/vmxnet3/vmxnet3_ring.h | 4 +- examples/bond/main.c | 16 +- examples/distributor/main.c | 26 +-- examples/exception_path/main.c | 35 ++- examples/ip_fragmentation/main.c | 33 +-- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 +-- examples/ipv4_multicast/main.c | 30 +-- examples/kni/main.c | 30 +-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 +-- examples/l2fwd-keepalive/main.c | 50 ++--- examples/l2fwd/main.c | 47 ++-- examples/l3fwd-acl/main.c | 9 +- examples/l3fwd-power/main.c | 60 ++--- examples/l3fwd-vf/main.c | 50 +++-- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 15 +- examples/l3fwd/l3fwd_lpm.h | 4 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 +-- examples/link_status_interrupt/main.c | 9 +- examples/load_balancer/config.c | 14 +- examples/load_balancer/init.c | 34 ++- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 17 +- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 23 +- examples/netmap_compat/lib/compat_netmap.c | 52 +++-- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +- examples/performance-thread/l3fwd-thread/main.c | 143 ++++++------ examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +-- examples/qos_sched/main.c | 14 +- examples/qos_sched/main.h | 24 +- examples/qos_sched/stats.c | 16 +- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- lib/librte_bitratestats/Makefile | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/Makefile | 2 +- lib/librte_ether/rte_ethdev.c | 241 +++++++++++---------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++---------- lib/librte_ether/rte_flow.c | 2 +- lib/librte_ether/rte_flow_driver.h | 2 +- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 ++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/Makefile | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +- lib/librte_pdump/Makefile | 2 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/Makefile | 2 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- test/test/test_kni.c | 12 +- test/test/test_link_bonding.c | 40 ++-- test/test/test_link_bonding_mode4.c | 12 +- test/test/test_pmd_perf.c | 30 +-- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 +- test/test/virtual_pmd.h | 28 +-- 156 files changed, 1402 insertions(+), 1498 deletions(-) -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang @ 2017-09-21 8:32 ` Zhiyong Yang 2017-09-21 10:36 ` Ferruh Yigit 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range Zhiyong Yang ` (4 subsequent siblings) 5 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-09-21 8:32 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, Zhiyong Yang There are two bonding APIs using ABI versioning, and both have port_id as parameter. Since we are already breaking ABI, no need to keep older versions of APIs. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- drivers/net/bonding/rte_eth_bond_8023ad.c | 139 +-------------------------- drivers/net/bonding/rte_eth_bond_8023ad.h | 18 ---- drivers/net/bonding/rte_eth_bond_version.map | 4 - 3 files changed, 2 insertions(+), 159 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 20b5a8961..efb9c6e77 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1114,17 +1114,6 @@ bond_mode_8023ad_conf_get(struct rte_eth_dev *dev, } static void -bond_mode_8023ad_conf_get_v1607(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - bond_mode_8023ad_conf_get(dev, conf); - conf->slowrx_cb = mode4->slowrx_cb; -} - -static void bond_mode_8023ad_conf_get_v1708(struct rte_eth_dev *dev, struct rte_eth_bond_8023ad_conf *conf) { @@ -1171,27 +1160,6 @@ bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4, mode4->dedicated_queues.tx_qid = UINT16_MAX; } -static void -bond_mode_8023ad_setup_v20(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_bond_8023ad_conf def_conf; - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - if (conf == NULL) { - conf = &def_conf; - bond_mode_8023ad_conf_get_default(conf); - } - - bond_mode_8023ad_stop(dev); - bond_mode_8023ad_conf_assign(mode4, conf); - - if (dev->data->dev_started) - bond_mode_8023ad_start(dev); -} - - void bond_mode_8023ad_setup(struct rte_eth_dev *dev, struct rte_eth_bond_8023ad_conf *conf) @@ -1207,27 +1175,6 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev, bond_mode_8023ad_stop(dev); bond_mode_8023ad_conf_assign(mode4, conf); - - - if (dev->data->dev_started) - bond_mode_8023ad_start(dev); -} - -static void -bond_mode_8023ad_setup_v1708(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_bond_8023ad_conf def_conf; - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - if (conf == NULL) { - conf = &def_conf; - bond_mode_8023ad_conf_get_default(conf); - } - - bond_mode_8023ad_stop(dev); - bond_mode_8023ad_conf_assign(mode4, conf); mode4->slowrx_cb = conf->slowrx_cb; mode4->agg_selection = AGG_STABLE; @@ -1358,43 +1305,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; - - if (conf == NULL) - return -EINVAL; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_conf_get(bond_dev, conf); - return 0; -} -VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v20, 2.0); - -int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; - - if (conf == NULL) - return -EINVAL; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_conf_get_v1607(bond_dev, conf); - return 0; -} -VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1607, 16.07); - -int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1409,10 +1320,6 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, bond_mode_8023ad_conf_get_v1708(bond_dev, conf); return 0; } -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_conf_get(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf), - rte_eth_bond_8023ad_conf_get_v1708); -BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1708, 17.08); int rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, @@ -1483,25 +1390,7 @@ bond_8023ad_setup_validate(uint8_t port_id, } int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - int err; - - err = bond_8023ad_setup_validate(port_id, conf); - if (err != 0) - return err; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_setup_v20(bond_dev, conf); - - return 0; -} -VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v20, 2.0); - -int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1516,30 +1405,6 @@ rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, return 0; } -VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v1607, 16.07); - - -int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - int err; - - err = bond_8023ad_setup_validate(port_id, conf); - if (err != 0) - return err; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_setup_v1708(bond_dev, conf); - - return 0; -} -BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf), - rte_eth_bond_8023ad_setup_v1708); - diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 1d353c734..d609745e0 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -194,15 +194,6 @@ struct rte_eth_bond_8023ad_slave_info { int rte_eth_bond_8023ad_conf_get(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); /** * @internal @@ -218,15 +209,6 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, int rte_eth_bond_8023ad_setup(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); /** * @internal diff --git a/drivers/net/bonding/rte_eth_bond_version.map b/drivers/net/bonding/rte_eth_bond_version.map index 0f4e847da..ec3374b0f 100644 --- a/drivers/net/bonding/rte_eth_bond_version.map +++ b/drivers/net/bonding/rte_eth_bond_version.map @@ -1,8 +1,6 @@ DPDK_2.0 { global: - rte_eth_bond_8023ad_conf_get; - rte_eth_bond_8023ad_setup; rte_eth_bond_active_slaves_get; rte_eth_bond_create; rte_eth_bond_link_monitoring_set; @@ -39,8 +37,6 @@ DPDK_16.07 { rte_eth_bond_8023ad_ext_distrib; rte_eth_bond_8023ad_ext_distrib_get; rte_eth_bond_8023ad_ext_slowtx; - rte_eth_bond_8023ad_conf_get; - rte_eth_bond_8023ad_setup; } DPDK_16.04; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang @ 2017-09-21 10:36 ` Ferruh Yigit 2017-09-22 2:02 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-21 10:36 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas On 9/21/2017 9:32 AM, Zhiyong Yang wrote: > There are two bonding APIs using ABI versioning, and both have > port_id as parameter. Since we are already breaking ABI, no need > to keep older versions of APIs. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> <...> > -int > -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, > +rte_eth_bond_8023ad_conf_get(uint8_t port_id, > struct rte_eth_bond_8023ad_conf *conf) > { > struct rte_eth_dev *bond_dev; > @@ -1409,10 +1320,6 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, > bond_mode_8023ad_conf_get_v1708(bond_dev, conf); I am aware this is not focus of the patchset, but it would be good to rename this function too and remove _v1708 suffix. It seems there is already a function named "bond_mode_8023ad_conf_get" and after removed code, "bond_mode_8023ad_conf_get" only called by "bond_mode_8023ad_conf_get_v1708": bond_mode_8023ad_conf_get_v1708() bond_mode_8023ad_conf_get() So it is possible to merge them into name "bond_mode_8023ad_conf_get()" Thanks, ferruh ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning 2017-09-21 10:36 ` Ferruh Yigit @ 2017-09-22 2:02 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-22 2:02 UTC (permalink / raw) To: Yigit, Ferruh, dev; +Cc: thomas Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Thursday, September 21, 2017 6:37 PM > To: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org > Cc: thomas@monjalon.net > Subject: Re: [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI > versioning > > On 9/21/2017 9:32 AM, Zhiyong Yang wrote: > > There are two bonding APIs using ABI versioning, and both have port_id > > as parameter. Since we are already breaking ABI, no need to keep older > > versions of APIs. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > <...> > > > -int > > -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, > > +rte_eth_bond_8023ad_conf_get(uint8_t port_id, > > struct rte_eth_bond_8023ad_conf *conf) { > > struct rte_eth_dev *bond_dev; > > @@ -1409,10 +1320,6 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t > port_id, > > bond_mode_8023ad_conf_get_v1708(bond_dev, conf); > > I am aware this is not focus of the patchset, but it would be good to rename this > function too and remove _v1708 suffix. > > It seems there is already a function named "bond_mode_8023ad_conf_get" > and after removed code, "bond_mode_8023ad_conf_get" only called by > "bond_mode_8023ad_conf_get_v1708": > > bond_mode_8023ad_conf_get_v1708() > bond_mode_8023ad_conf_get() > > So it is possible to merge them into name "bond_mode_8023ad_conf_get()" > Ok. I will merge them into one. > Thanks, > Ferruh ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang @ 2017-09-21 8:32 ` Zhiyong Yang 2017-09-21 11:49 ` Adrien Mazarguil 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 3/5] examples: " Zhiyong Yang ` (3 subsequent siblings) 5 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-09-21 8:32 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, Zhiyong Yang Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. release_17_11 and deprecation have been updated in the patch. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 ++- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 18 +- app/test-pmd/testpmd.h | 4 +- doc/guides/rel_notes/deprecation.rst | 6 - doc/guides/rel_notes/release_17_11.rst | 18 +- drivers/net/af_packet/Makefile | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/Makefile | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/Makefile | 2 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnxt/Makefile | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 32 +-- drivers/net/bonding/Makefile | 2 +- drivers/net/bonding/rte_eth_bond.h | 42 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 60 +++--- drivers/net/bonding/rte_eth_bond_8023ad.h | 30 +-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 62 +++--- drivers/net/bonding/rte_eth_bond_private.h | 45 ++-- drivers/net/e1000/Makefile | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/Makefile | 2 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/Makefile | 2 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/Makefile | 2 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- drivers/net/ixgbe/Makefile | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 64 +++--- drivers/net/mlx5/mlx5_rxtx.h | 4 +- drivers/net/nfp/nfp_net.c | 16 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/Makefile | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/Makefile | 2 +- drivers/net/vhost/rte_eth_vhost.c | 6 +- drivers/net/vhost/rte_eth_vhost.h | 4 +- drivers/net/virtio/Makefile | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/vmxnet3/vmxnet3_ring.h | 4 +- lib/librte_bitratestats/Makefile | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/Makefile | 2 +- lib/librte_ether/rte_ethdev.c | 241 +++++++++++----------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- lib/librte_ether/rte_flow.c | 2 +- lib/librte_ether/rte_flow_driver.h | 2 +- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/Makefile | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_pdump/Makefile | 2 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/Makefile | 2 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- 92 files changed, 773 insertions(+), 747 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index 3b13753d9..090a50cfc 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -623,7 +623,7 @@ static void create_mp_ring_vdev(void) { int i; - uint8_t portid; + uint16_t portid; struct pdump_tuples *pt = NULL; struct rte_mempool *mbuf_pool = NULL; char vdev_args[SIZE]; diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index ccdf239d6..d9d083888 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4588,7 +4588,7 @@ struct cmd_show_bonding_config_result { cmdline_fixed_string_t show; cmdline_fixed_string_t bonding; cmdline_fixed_string_t config; - uint8_t port_id; + portid_t port_id; }; static void cmd_show_bonding_config_parsed(void *parsed_result, @@ -4597,7 +4597,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, { struct cmd_show_bonding_config_result *res = parsed_result; int bonding_mode, agg_mode; - uint8_t slaves[RTE_MAX_ETHPORTS]; + portid_t slaves[RTE_MAX_ETHPORTS]; int num_slaves, num_active_slaves; int primary_id; int i; @@ -11500,7 +11500,7 @@ struct cmd_vf_vlan_stripq_result { cmdline_fixed_string_t vf; cmdline_fixed_string_t vlan; cmdline_fixed_string_t stripq; - uint8_t port_id; + portid_t port_id; uint16_t vf_id; cmdline_fixed_string_t on_off; }; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3ae3e1cd8..155136dd5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -358,7 +358,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "RX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; @@ -391,7 +391,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "TX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 51170ee3e..91ee78646 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -86,12 +86,11 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index) struct timespec timestamp = {0, 0}; if (rte_eth_timesync_read_rx_timestamp(pi, ×tamp, index) < 0) { - printf("Port %u RX timestamp registers not valid\n", - (unsigned) pi); + printf("Port %u RX timestamp registers not valid\n", pi); return; } printf("Port %u RX timestamp value %lu s %lu ns\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec); + pi, timestamp.tv_sec, timestamp.tv_nsec); } #define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */ @@ -110,12 +109,12 @@ port_ieee1588_tx_timestamp_check(portid_t pi) if (wait_us >= MAX_TX_TMST_WAIT_MICROSECS) { printf("Port %u TX timestamp registers not valid after " "%u micro-seconds\n", - (unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS); + pi, MAX_TX_TMST_WAIT_MICROSECS); return; } printf("Port %u TX timestamp value %lu s %lu ns validated after " "%u micro-second%s\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, + pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, (wait_us == 1) ? "" : "s"); } @@ -148,11 +147,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type == ETHER_TYPE_1588) { printf("Port %u Received PTP packet not filtered" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); } else { printf("Port %u Received non PTP packet type=0x%4x " "len=%u\n", - (unsigned) fs->rx_port, eth_type, + fs->rx_port, eth_type, (unsigned) mb->pkt_len); } rte_pktmbuf_free(mb); @@ -161,7 +160,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type != ETHER_TYPE_1588) { printf("Port %u Received NON PTP packet incorrectly" " detected by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -175,19 +174,19 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (ptp_hdr->version != 0x02) { printf("Port %u Received PTP V2 Ethernet frame with wrong PTP" " protocol version 0x%x (should be 0x02)\n", - (unsigned) fs->rx_port, ptp_hdr->version); + fs->rx_port, ptp_hdr->version); rte_pktmbuf_free(mb); return; } if (ptp_hdr->msg_id != PTP_SYNC_MESSAGE) { printf("Port %u Received PTP V2 Ethernet frame with unexpected" " message ID 0x%x (expected 0x0 - PTP_SYNC_MESSAGE)\n", - (unsigned) fs->rx_port, ptp_hdr->msg_id); + fs->rx_port, ptp_hdr->msg_id); rte_pktmbuf_free(mb); return; } printf("Port %u IEEE1588 PTP V2 SYNC Message filtered by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); /* * Check that the received PTP packet has been timestamped by the @@ -196,7 +195,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (! (mb->ol_flags & PKT_RX_IEEE1588_TMST)) { printf("Port %u Received PTP packet not timestamped" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -216,8 +215,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) mb->ol_flags |= PKT_TX_IEEE1588_TMST; fs->tx_packets += 1; if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) { - printf("Port %u sent PTP packet dropped\n", - (unsigned) fs->rx_port); + printf("Port %u sent PTP packet dropped\n", fs->rx_port); fs->fwd_dropped += 1; rte_pktmbuf_free(mb); return; diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 2f7f70fd6..31287d71d 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -734,7 +734,7 @@ launch_args_parse(int argc, char** argv) if (!strcmp(lgopts[opt_idx].name, "nb-ports")) { n = atoi(optarg); if (n > 0 && n <= nb_ports) - nb_fwd_ports = (uint8_t) n; + nb_fwd_ports = n; else rte_exit(EXIT_FAILURE, "Invalid port %d\n", n); diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index 5ef021905..57df01468 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -122,7 +122,7 @@ pkt_burst_receive(struct fwd_stream *fs) */ if (verbose_level > 0) printf("port %u/queue %u: received %u packets\n", - (unsigned) fs->rx_port, + fs->rx_port, (unsigned) fs->rx_queue, (unsigned) nb_rx); for (i = 0; i < nb_rx; i++) { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e097ee04e..477e2e7ad 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -390,7 +390,7 @@ struct gro_status gro_ports[RTE_MAX_ETHPORTS]; /* Forward function declarations */ static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port); static void check_all_ports_link_status(uint32_t port_mask); -static int eth_event_callback(uint8_t port_id, +static int eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); @@ -1816,7 +1816,8 @@ check_all_ports_link_status(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; + portid_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("Checking link statuses...\n"); @@ -1831,14 +1832,13 @@ check_all_ports_link_status(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 */ @@ -1885,7 +1885,7 @@ rmv_event_callback(void *arg) /* This function is used by the interrupt thread */ static int -eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, +eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param) { static const char * const event_desc[] = { @@ -2328,7 +2328,7 @@ int main(int argc, char** argv) { int diag; - uint8_t port_id; + portid_t port_id; signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 1d1ee7587..657c1235c 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -78,7 +78,7 @@ #define UMA_NO_CONFIG 0xFF typedef uint8_t lcoreid_t; -typedef uint8_t portid_t; +typedef uint16_t portid_t; typedef uint16_t queueid_t; typedef uint16_t streamid_t; @@ -283,7 +283,7 @@ enum dcb_mode_enable #define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */ struct queue_stats_mappings { - uint8_t port_id; + portid_t port_id; uint16_t queue_id; uint8_t stats_counter_id; } __rte_cache_aligned; diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 3362f3350..45eb5c4a9 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -76,12 +76,6 @@ Deprecation Notices done by the EAL and not by the ``ethdev`` layer anymore. Users relying on this flag being present only have to remove their checks to follow the change. -* ABI/API changes are planned for 17.11 in all structures which include port_id - definition such as "rte_eth_dev_data", "rte_port_ethdev_reader_params", - "rte_port_ethdev_writer_params", and so on. The definition of port_id will be - changed from 8 bits to 16 bits in order to support more than 256 ports in - DPDK. All APIs which have port_id parameter will be changed at the same time. - * ethdev: An ABI change is planned for 17.11 for the structure rte_eth_dev_data. The size of the unique name will increase RTE_ETH_NAME_MAX_LEN from 32 to 64 characters to allow using a globally unique identifier (GUID) in this field. diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst index 8bf91bd40..6ff730e9e 100644 --- a/doc/guides/rel_notes/release_17_11.rst +++ b/doc/guides/rel_notes/release_17_11.rst @@ -41,6 +41,11 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range from uint8_t to uint16_t.** + + Increased port_id range from 8 bits to 16 bits in order to support more than + 256 ports in dpdk. All ethdev APIs which have port_id parameter are changed + in the meantime. Resolved Issues --------------- @@ -144,7 +149,10 @@ ABI Changes Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range.** + The size of the field ``port_id`` in the ``rte_eth_dev_data`` structure + changed, as described in the `New Features` section. Shared Library Versions ----------------------- @@ -165,19 +173,19 @@ The libraries prepended with a plus sign were incremented in this version. .. code-block:: diff librte_acl.so.2 - librte_bitratestats.so.1 + librte_bitratestats.so.2 librte_cfgfile.so.2 librte_cmdline.so.2 librte_cryptodev.so.3 librte_distributor.so.1 librte_eal.so.5 - librte_ethdev.so.7 + librte_ethdev.so.8 librte_eventdev.so.2 librte_gro.so.1 librte_hash.so.2 librte_ip_frag.so.1 librte_jobstats.so.1 - librte_kni.so.2 + librte_kni.so.3 librte_kvargs.so.1 librte_latencystats.so.1 librte_lpm.so.2 @@ -186,11 +194,11 @@ The libraries prepended with a plus sign were incremented in this version. librte_meter.so.1 librte_metrics.so.1 librte_net.so.1 - librte_pdump.so.1 + librte_pdump.so.2 librte_pipeline.so.3 librte_pmd_bond.so.1 librte_pmd_ring.so.2 - librte_port.so.3 + librte_port.so.4 librte_power.so.1 librte_reorder.so.1 librte_ring.so.1 diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile index 70d517c16..4d62b7dbd 100644 --- a/drivers/net/af_packet/Makefile +++ b/drivers/net/af_packet/Makefile @@ -40,7 +40,7 @@ LIB = librte_pmd_af_packet.a EXPORT_MAP := rte_pmd_af_packet_version.map -LIBABIVER := 1 +LIBABIVER := 2 CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 9a47852ca..483b0c107 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -75,7 +75,7 @@ struct pkt_rx_queue { unsigned int framenum; struct rte_mempool *mb_pool; - uint8_t in_port; + uint16_t in_port; volatile unsigned long rx_pkts; volatile unsigned long err_pkts; diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 6db362b04..893284733 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -641,7 +641,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_tx_queues; i++) { status = eth_ark_tx_queue_stop(dev, i); if (status != 0) { - uint8_t port = dev->data->port_id; + uint16_t port = dev->data->port_id; PMD_DRV_LOG(ERR, "tx_queue stop anomaly" " port %u, queue %u\n", diff --git a/drivers/net/avp/Makefile b/drivers/net/avp/Makefile index cd465aac9..7ffb4d172 100644 --- a/drivers/net/avp/Makefile +++ b/drivers/net/avp/Makefile @@ -42,7 +42,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) EXPORT_MAP := rte_pmd_avp_version.map -LIBABIVER := 1 +LIBABIVER := 2 # install public header files to enable compilation of the hypervisor level # dpdk application diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index c746a0e2c..b5cc955f2 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -190,7 +190,7 @@ struct avp_dev { struct rte_eth_dev_data *dev_data; /**< Back pointer to ethernet device data */ volatile uint32_t flags; /**< Device operational flags */ - uint8_t port_id; /**< Ethernet port identifier */ + uint16_t port_id; /**< Ethernet port identifier */ struct rte_mempool *pool; /**< pkt mbuf mempool */ unsigned int guest_mbuf_size; /**< local pool mbuf size */ unsigned int host_mbuf_size; /**< host mbuf size */ diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile index e12310691..7a1c77523 100644 --- a/drivers/net/bnx2x/Makefile +++ b/drivers/net/bnx2x/Makefile @@ -12,7 +12,7 @@ LDLIBS += -lz EXPORT_MAP := rte_pmd_bnx2x_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) CFLAGS += -wd188 #188: enumerated type mixed with another type diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index 2e38ec26a..9600e0f1c 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -41,7 +41,7 @@ struct bnx2x_rx_queue { uint16_t rx_cq_head; /**< Index of current rcq bd. */ uint16_t rx_cq_tail; /**< Index of last rcq bd. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data. */ }; @@ -62,7 +62,7 @@ struct bnx2x_tx_queue { uint16_t nb_tx_avail; /**< Number of TX descriptors available. */ uint16_t nb_tx_pages; /**< number of TX pages */ uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data */ }; diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile index b03f65dc9..55b49b538 100644 --- a/drivers/net/bnxt/Makefile +++ b/drivers/net/bnxt/Makefile @@ -40,7 +40,7 @@ LIB = librte_pmd_bnxt.a EXPORT_MAP := rte_pmd_bnxt_version.map -LIBABIVER := 1 +LIBABIVER := 2 CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 405d94deb..26a9018b5 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -126,7 +126,7 @@ struct bnxt_pf_info { #define BNXT_FIRST_VF_FID 128 #define BNXT_PF_RINGS_USED(bp) bnxt_get_num_queues(bp) #define BNXT_PF_RINGS_AVAIL(bp) (bp->pf.max_cp_rings - BNXT_PF_RINGS_USED(bp)) - uint8_t port_id; + uint16_t port_id; uint16_t first_vf_id; uint16_t active_vfs; uint16_t max_vfs; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index c9d11228b..2e817535e 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -489,13 +489,13 @@ static void bnxt_print_link_info(struct rte_eth_dev *eth_dev) if (link->link_status) RTE_LOG(INFO, PMD, "Port %d Link Up - speed %u Mbps - %s\n", - (uint8_t)(eth_dev->data->port_id), + eth_dev->data->port_id, (uint32_t)link->link_speed, (link->link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex\n")); else RTE_LOG(INFO, PMD, "Port %d Link Down\n", - (uint8_t)(eth_dev->data->port_id)); + eth_dev->data->port_id); } static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev) diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h index 01aaa007f..cea0785d1 100644 --- a/drivers/net/bnxt/bnxt_rxq.h +++ b/drivers/net/bnxt/bnxt_rxq.h @@ -48,7 +48,7 @@ struct bnxt_rx_queue { uint16_t rx_free_thresh; /* max free RX desc to hold */ uint16_t queue_id; /* RX queue index */ uint16_t reg_idx; /* RX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ struct bnxt *bp; diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h index 16f3a0bdd..f753c10f2 100644 --- a/drivers/net/bnxt/bnxt_txq.h +++ b/drivers/net/bnxt/bnxt_txq.h @@ -46,7 +46,7 @@ struct bnxt_tx_queue { uint16_t tx_next_rs; /* next desc to set RS bit */ uint16_t queue_id; /* TX queue index */ uint16_t reg_idx; /* TX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t pthresh; /* Prefetch threshold register */ uint8_t hthresh; /* Host threshold register */ uint8_t wthresh; /* Write-back threshold reg */ diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c343d9033..63fc27911 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -67,7 +67,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) true : false; } -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -108,7 +108,7 @@ rte_pmd_bnxt_set_all_queues_drop_en_cb(struct bnxt_vnic_info *vnic, void *onptr) vnic->bd_stall = !(*on); } -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -159,7 +159,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -191,7 +191,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *eth_dev; @@ -241,7 +241,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -294,7 +294,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -350,7 +350,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq_cb(struct bnxt_vnic_info *vnic, void *onptr) } int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -385,7 +385,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -477,7 +477,7 @@ static int bnxt_set_vf_table(struct bnxt *bp, uint16_t vf) return rc; } -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct bnxt_vlan_table_entry *ve; @@ -570,7 +570,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, return rc; } -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -598,7 +598,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, return bnxt_hwrm_func_qstats(bp, bp->pf.first_vf_id + vf_id, stats); } -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -625,7 +625,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, return bnxt_hwrm_func_clr_stats(bp, bp->pf.first_vf_id + vf_id); } -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -651,7 +651,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) return bnxt_vf_vnic_count(bp, vf_id); } -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count) { struct rte_eth_dev *dev; @@ -679,7 +679,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, count); } -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr, uint32_t vf_id) { struct rte_eth_dev *dev; @@ -756,7 +756,7 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, } int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -793,7 +793,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h index c4c4770e3..f881d30d6 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.h +++ b/drivers/net/bnxt/rte_pmd_bnxt.h @@ -78,7 +78,7 @@ struct rte_pmd_bnxt_mb_event_param { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set the VF MAC address. @@ -94,7 +94,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -115,7 +115,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -134,7 +134,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -156,7 +156,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); /** @@ -173,7 +173,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -189,7 +189,7 @@ int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * Set the VF rate limit. @@ -207,7 +207,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); /** @@ -226,7 +226,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -242,7 +242,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -261,7 +261,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set RX L2 Filtering mode of a VF of an Ethernet device. @@ -280,7 +280,7 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); /** @@ -297,7 +297,7 @@ int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, * - (-ENOMEM) on an allocation failure * - (-1) firmware interface error */ -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id); /** * Queries the TX drop counter for the function @@ -313,7 +313,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); * - (-EINVAL) invalid vf_id specified. * - (-ENOTSUP) Ethernet device is not a PF */ -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count); /** @@ -331,7 +331,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, * - (-ENOTSUP) Ethernet device is not a PF * - (-ENOMEM) on an allocation failure */ -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t vf_id); /** @@ -350,5 +350,5 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on); #endif /* _PMD_BNXT_H_ */ diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile index 910c932da..ffc0c3cf7 100644 --- a/drivers/net/bonding/Makefile +++ b/drivers/net/bonding/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_eth_bond_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 8efbf0713..36b4e0643 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -151,7 +151,7 @@ rte_eth_bond_free(const char *name); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Remove a slave rte_eth_dev device from the bonded device @@ -163,7 +163,7 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Set link bonding mode of bonded device @@ -175,7 +175,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode); /** * Get link bonding mode of bonded device @@ -186,7 +186,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); * link bonding mode on success, negative value otherwise */ int -rte_eth_bond_mode_get(uint8_t bonded_port_id); +rte_eth_bond_mode_get(uint16_t bonded_port_id); /** * Set slave rte_eth_dev as primary slave of bonded device @@ -198,7 +198,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Get primary slave of bonded device @@ -209,7 +209,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); * Port Id of primary slave on success, -1 on failure */ int -rte_eth_bond_primary_get(uint8_t bonded_port_id); +rte_eth_bond_primary_get(uint16_t bonded_port_id); /** * Populate an array with list of the slaves port id's of the bonded device @@ -223,7 +223,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id); * negative value otherwise */ int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Populate an array with list of the active slaves port id's of the bonded @@ -238,8 +239,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); * negative value otherwise */ int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len); +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Set explicit MAC address to use on bonded device and it's slaves. @@ -252,7 +253,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr); /** @@ -265,7 +266,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id); /** * Set the transmit policy for bonded device to use when it is operating in @@ -279,7 +280,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy); /** * Get the transmit policy set on bonded device for balance mode operation @@ -290,7 +291,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); * Balance transmit policy on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of @@ -304,7 +305,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); */ int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link @@ -316,8 +317,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); * Monitoring interval on success, negative value otherwise. */ int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); - +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the disabling of a bonded link @@ -330,7 +330,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the disabling of a bonded @@ -342,7 +343,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the enabling of a bonded link @@ -355,7 +356,8 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the enabling of a bonded @@ -367,7 +369,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); #ifdef __cplusplus diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index efb9c6e77..c0a0b6e21 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -209,7 +209,7 @@ set_warning_flags(struct port *port, uint16_t flags) } static void -show_warnings(uint8_t slave_id) +show_warnings(uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; uint8_t warnings; @@ -278,7 +278,7 @@ record_default(struct port *port) * @param port Port on which LACPDU was received. */ static void -rx_machine(struct bond_dev_private *internals, uint8_t slave_id, +rx_machine(struct bond_dev_private *internals, uint16_t slave_id, struct lacpdu *lacp) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -399,7 +399,7 @@ rx_machine(struct bond_dev_private *internals, uint8_t slave_id, * @param port Port to handle state machine. */ static void -periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) +periodic_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; /* Calculate if either site is LACP enabled */ @@ -461,7 +461,7 @@ periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port Port to handle state machine. */ static void -mux_machine(struct bond_dev_private *internals, uint8_t slave_id) +mux_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; @@ -564,7 +564,7 @@ mux_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port */ static void -tx_machine(struct bond_dev_private *internals, uint8_t slave_id) +tx_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -688,11 +688,11 @@ static void selection_logic(struct bond_dev_private *internals, uint8_t slave_id) { struct port *agg, *port; - uint8_t slaves_count, new_agg_id, i, j = 0; - uint8_t *slaves; + uint16_t slaves_count, new_agg_id, i, j = 0; + uint16_t *slaves; uint64_t agg_bandwidth[8] = {0}; uint64_t agg_count[8] = {0}; - uint8_t default_slave = 0; + uint16_t default_slave = 0; uint8_t mode_count_id, mode_band_id; struct rte_eth_link link_info; @@ -923,7 +923,8 @@ bond_mode_8023ad_periodic_cb(void *arg) } void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) +bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; @@ -951,7 +952,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) memcpy(&port->actor, &initial, sizeof(struct port_params)); /* Standard requires that port ID must be grater than 0. * Add 1 do get corresponding port_number */ - port->actor.port_number = rte_cpu_to_be_16((uint16_t)slave_id + 1); + port->actor.port_number = rte_cpu_to_be_16(slave_id + 1); memcpy(&port->partner, &initial, sizeof(struct port_params)); @@ -1022,12 +1023,12 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) int bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev, - uint8_t slave_id) + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; void *pkt = NULL; struct port *port; - uint8_t i; + uint16_t i; /* Given slave must be in active list */ RTE_ASSERT(find_slave_by_id(internals->active_slaves, @@ -1066,7 +1067,7 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) struct bond_dev_private *internals = bond_dev->data->dev_private; struct ether_addr slave_addr; struct port *slave, *agg_slave; - uint8_t slave_id, i, j; + uint16_t slave_id, i, j; bond_mode_8023ad_stop(bond_dev); @@ -1224,7 +1225,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev) void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt) + uint16_t slave_id, struct rte_mbuf *pkt) { struct mode8023ad_private *mode4 = &internals->mode4; struct port *port = &mode_8023ad_ports[slave_id]; @@ -1305,7 +1306,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } int -rte_eth_bond_8023ad_conf_get(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1322,7 +1323,7 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id, } int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection) { struct rte_eth_dev *bond_dev; @@ -1344,7 +1345,7 @@ rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, return 0; } -int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) +int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1365,7 +1366,7 @@ int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) static int -bond_8023ad_setup_validate(uint8_t port_id, +bond_8023ad_setup_validate(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { if (valid_bonded_port_id(port_id) != 0) @@ -1389,8 +1390,9 @@ bond_8023ad_setup_validate(uint8_t port_id, return 0; } + int -rte_eth_bond_8023ad_setup(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1411,7 +1413,7 @@ rte_eth_bond_8023ad_setup(uint8_t port_id, int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *info) { struct rte_eth_dev *bond_dev; @@ -1444,7 +1446,7 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, } static int -bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) +bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1472,7 +1474,8 @@ bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1492,7 +1495,8 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) } int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1512,7 +1516,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) } int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1526,7 +1530,7 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1540,7 +1544,7 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct port *port; @@ -1601,7 +1605,7 @@ bond_mode_8023ad_ext_periodic_cb(void *arg) } int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; @@ -1625,7 +1629,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) } int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index d609745e0..2874336d3 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -64,7 +64,7 @@ extern "C" { #define MARKER_TLV_TYPE_INFO 0x01 #define MARKER_TLV_TYPE_RESP 0x02 -typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint8_t slave_id, +typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t slave_id, struct rte_mbuf *lacp_pkt); enum rte_bond_8023ad_selection { @@ -176,7 +176,7 @@ struct rte_eth_bond_8023ad_slave_info { struct port_params actor; uint8_t partner_state; struct port_params partner; - uint8_t agg_port_id; + uint16_t agg_port_id; }; /** @@ -192,7 +192,7 @@ struct rte_eth_bond_8023ad_slave_info { * -EINVAL if conf is NULL */ int -rte_eth_bond_8023ad_conf_get(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -207,7 +207,7 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id, * -EINVAL if configuration is invalid. */ int -rte_eth_bond_8023ad_setup(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -223,7 +223,7 @@ rte_eth_bond_8023ad_setup(uint8_t port_id, * bonded device or is not inactive). */ int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *conf); #ifdef __cplusplus @@ -241,7 +241,8 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get COLLECTING flag from slave port actor state. @@ -254,7 +255,7 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id); /** * Configure a slave port to start distributing. @@ -267,7 +268,8 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get DISTRIBUTING flag from slave port actor state. @@ -280,7 +282,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id); /** * LACPDU transmit path for external 802.3ad state machine. Caller retains @@ -294,7 +296,7 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, struct rte_mbuf *lacp_pkt); /** @@ -320,7 +322,7 @@ rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id); /** * Disable slow queue on slaves @@ -337,7 +339,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); * */ int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port_id); /* * Get aggregator mode for 8023ad @@ -347,7 +349,7 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); * agregator mode on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); +rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id); /** * Set aggregator mode for 8023ad @@ -356,6 +358,6 @@ rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h index d46e44a84..9ee5ca23d 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h @@ -279,7 +279,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *dev); */ void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt); + uint16_t slave_id, struct rte_mbuf *pkt); /** * @internal @@ -293,7 +293,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, * 0 on success, negative value otherwise. */ void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); +bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint16_t port_id); /** * @internal @@ -307,7 +307,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); * 0 on success, negative value otherwise. */ int -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint8_t slave_pos); +bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint16_t slave_pos); /** * Updates state when MAC was changed on bonded device or one of its slaves. @@ -318,12 +318,12 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev); int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port); + uint16_t slave_port); int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port); +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port); int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id); +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index d9d37495d..f7efbb78e 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -148,7 +148,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, rte_spinlock_unlock(&internals->mode6.lock); } -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals) { @@ -220,13 +220,13 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, return internals->current_primary_port; } -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals) { struct ether_hdr *eth_h; struct arp_hdr *arp_h; - uint8_t slave_idx; + uint16_t slave_idx; rte_spinlock_lock(&internals->mode6.lock); eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h index fd7c3aeb4..9f17f7c85 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.h +++ b/drivers/net/bonding/rte_eth_bond_alb.h @@ -51,7 +51,7 @@ struct client_data { uint32_t cli_ip; /**< Client IP address */ - uint8_t slave_idx; + uint16_t slave_idx; /**< Index of slave on which we connect with that client */ uint8_t in_use; /**< Flag indicating if entry in client table is currently used */ @@ -113,7 +113,7 @@ bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slave on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals); @@ -127,7 +127,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slawe on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals); diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index de1d9e0db..957390f71 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -56,14 +56,14 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) } int -valid_bonded_port_id(uint8_t port_id) +valid_bonded_port_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return check_for_bonded_ethdev(&rte_eth_devices[port_id]); } int -valid_slave_port_id(uint8_t port_id, uint8_t mode) +valid_slave_port_id(uint16_t port_id, uint8_t mode) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); @@ -80,7 +80,7 @@ valid_slave_port_id(uint8_t port_id, uint8_t mode) } void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -107,11 +107,11 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) } void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { - uint8_t slave_pos; + uint16_t slave_pos; struct bond_dev_private *internals = eth_dev->data->dev_private; - uint8_t active_count = internals->active_slave_count; + uint16_t active_count = internals->active_slave_count; if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_stop(eth_dev); @@ -153,7 +153,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) { struct bond_dev_private *internals; char devargs[52]; - uint8_t port_id; + uint16_t port_id; int ret; if (name == NULL) { @@ -193,7 +193,7 @@ rte_eth_bond_free(const char *name) } static int -slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) +slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -233,7 +233,7 @@ slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev; struct bond_dev_private *internals; @@ -363,7 +363,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -387,7 +387,8 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_remove_lock_free(uint16_t bonded_port_id, + uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -466,7 +467,7 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -488,7 +489,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) { if (valid_bonded_port_id(bonded_port_id) != 0) return -1; @@ -497,7 +498,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) } int -rte_eth_bond_mode_get(uint8_t bonded_port_id) +rte_eth_bond_mode_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -510,7 +511,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id) } int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct bond_dev_private *internals; @@ -531,7 +532,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_primary_get(uint8_t bonded_port_id) +rte_eth_bond_primary_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -547,7 +548,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id) } int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; uint8_t i; @@ -570,8 +572,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) } int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len) +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; @@ -586,13 +588,14 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], if (internals->active_slave_count > len) return -1; - memcpy(slaves, internals->active_slaves, internals->active_slave_count); + memcpy(slaves, internals->active_slaves, + internals->active_slave_count * sizeof(internals->active_slaves[0])); return internals->active_slave_count; } int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *bonded_eth_dev; @@ -618,7 +621,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, } int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -647,7 +650,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) } int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) { struct bond_dev_private *internals; @@ -677,7 +680,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) } int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -690,7 +693,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms) { struct bond_dev_private *internals; @@ -704,7 +707,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) } int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -717,7 +720,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms) { struct bond_dev_private *internals; @@ -732,7 +736,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -745,7 +749,7 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; @@ -760,7 +764,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index bb634c62e..04d1f4e8f 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -153,7 +153,7 @@ bond_ethdev_parse_slave_port_kvarg(const char *key, return -1; } else slave_ports->slaves[slave_ports->slave_count++] = - (uint8_t)port_id; + port_id; } return 0; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 3ee70baa0..0566e25ba 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -174,7 +174,7 @@ const struct rte_flow_attr flow_attr_8023ad = { int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port) { + uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); @@ -202,12 +202,12 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, } int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { struct rte_eth_dev *bond_dev = &rte_eth_devices[port_id]; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); struct rte_eth_dev_info bond_info, slave_info; - uint8_t idx; + uint16_t idx; /* Verify if all slaves in bonding supports flow director and */ if (internals->slave_count > 0) { @@ -230,7 +230,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { } int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port) { +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) @@ -270,10 +270,10 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; struct bond_dev_private *internals = bd_rx_q->dev_private; uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count; - uint8_t i, idx; + uint16_t i, idx; /* Copy slave list to protect against slave up/down changes during tx * bursting */ @@ -302,8 +302,8 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -394,8 +394,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW); uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count, idx; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count, idx; uint8_t collecting; /* current slave collecting status */ const uint8_t promisc = internals->promiscuous_en; @@ -673,8 +673,8 @@ bond_ethdev_tx_burst_round_robin(void *queue, struct rte_mbuf **bufs, struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts]; uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] = { 0 }; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave; @@ -904,7 +904,7 @@ bandwidth_cmp(const void *a, const void *b) } static void -bandwidth_left(uint8_t port_id, uint64_t load, uint8_t update_idx, +bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx, struct bwg_slave *bwg_slave) { struct rte_eth_link link_status; @@ -970,10 +970,10 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct rte_eth_dev *primary_port = &rte_eth_devices[internals->primary_port]; uint16_t num_tx_total = 0; - uint8_t i, j; + uint16_t i, j; - uint8_t num_of_slaves = internals->active_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves = internals->active_slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct ether_hdr *ether_hdr; struct ether_addr primary_slave_addr; @@ -1059,7 +1059,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t num_send, num_not_send = 0; uint16_t num_tx_total = 0; - uint8_t slave_idx; + uint16_t slave_idx; int i, j; @@ -1178,8 +1178,8 @@ bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave = 0, tx_fail_total = 0; @@ -1239,8 +1239,8 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -1333,7 +1333,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs, struct bond_tx_queue *bd_tx_q; uint8_t tx_failed_flag = 0, num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t max_nb_of_tx_pkts = 0; @@ -1861,7 +1861,7 @@ slave_add(struct bond_dev_private *internals, void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id) + uint16_t slave_port_id) { int i; @@ -2125,7 +2125,7 @@ static int bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { int res; - uint8_t i; + uint16_t i; struct bond_dev_private *internals = dev->data->dev_private; /* don't do this while a slave is being added */ @@ -2137,7 +2137,7 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) rte_bitmap_clear(internals->vlan_filter_bmp, vlan_id); for (i = 0; i < internals->slave_count; i++) { - uint8_t port_id = internals->slaves[i].port_id; + uint16_t port_id = internals->slaves[i].port_id; res = rte_eth_dev_vlan_filter(port_id, vlan_id, on); if (res == ENOTSUP) @@ -2277,7 +2277,7 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) static int bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) { - void (*link_update)(uint8_t port_id, struct rte_eth_link *eth_link); + void (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); struct bond_dev_private *bond_ctx; struct rte_eth_link slave_link; @@ -2466,7 +2466,7 @@ bond_ethdev_delayed_lsc_propagation(void *arg) } int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param __rte_unused) { struct rte_eth_dev *bonded_eth_dev; @@ -2951,7 +2951,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) struct bond_dev_private *internals = dev->data->dev_private; struct rte_kvargs *kvlist = internals->kvlist; int arg_count; - uint8_t port_id = dev - rte_eth_devices; + uint16_t port_id = dev - rte_eth_devices; uint8_t agg_mode; static const uint8_t default_rss_key[40] = { @@ -3086,7 +3086,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Parse/set primary slave port id*/ arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); if (arg_count == 1) { - uint8_t primary_slave_port_id; + uint16_t primary_slave_port_id; if (rte_kvargs_process(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG, @@ -3099,7 +3099,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } /* Set balance mode transmit policy*/ - if (rte_eth_bond_primary_set(port_id, (uint8_t)primary_slave_port_id) + if (rte_eth_bond_primary_set(port_id, primary_slave_port_id) != 0) { RTE_LOG(ERR, EAL, "Failed to set primary slave port %d on bonded device %s\n", diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 1fe6ff880..9362cffac 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -93,12 +93,12 @@ struct bond_tx_queue { /** Bonded slave devices structure */ struct bond_ethdev_slave_ports { - uint8_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ - uint8_t slave_count; /**< Number of slaves */ + uint16_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ + uint16_t slave_count; /**< Number of slaves */ }; struct bond_slave_details { - uint8_t port_id; + uint16_t port_id; uint8_t link_status_poll_enabled; uint8_t link_status_wait_to_complete; @@ -114,14 +114,14 @@ typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count) /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { - uint8_t port_id; /**< Port Id of Bonded Port */ + uint16_t port_id; /**< Port Id of Bonded Port */ uint8_t mode; /**< Link Bonding Mode */ rte_spinlock_t lock; - uint8_t primary_port; /**< Primary Slave Port */ - uint8_t current_primary_port; /**< Primary Slave Port */ - uint8_t user_defined_primary_port; + uint16_t primary_port; /**< Primary Slave Port */ + uint16_t current_primary_port; /**< Primary Slave Port */ + uint16_t user_defined_primary_port; /**< Flag for whether primary port is user defined or not */ uint8_t balance_xmit_policy; @@ -144,16 +144,17 @@ struct bond_dev_private { uint16_t nb_rx_queues; /**< Total number of rx queues */ uint16_t nb_tx_queues; /**< Total number of tx queues*/ - uint8_t active_slave; /**< Next active_slave to poll */ - uint8_t active_slave_count; /**< Number of active slaves */ - uint8_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ + uint16_t active_slave; /**< Next active_slave to poll */ + uint16_t active_slave_count; /**< Number of active slaves */ + uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ - uint8_t slave_count; /**< Number of bonded slaves */ + uint16_t slave_count; /**< Number of bonded slaves */ struct bond_slave_details slaves[RTE_MAX_ETHPORTS]; /**< Arary of bonded slaves details */ struct mode8023ad_private mode4; - uint8_t tlb_slaves_order[RTE_MAX_ETHPORTS]; /* TLB active slaves send order */ + /**< TLB active slaves send order */ + uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS]; struct mode_alb_private mode6; uint32_t rx_offload_capa; /** Rx offload capability */ @@ -186,10 +187,10 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); /* Search given slave array to find position of given id. * Return slave pos or slaves_count if not found. */ -static inline uint8_t -find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { +static inline uint16_t +find_slave_by_id(uint16_t *slaves, uint16_t slaves_count, uint16_t slave_id) { - uint8_t pos; + uint16_t pos; for (pos = 0; pos < slaves_count; pos++) { if (slave_id == slaves[pos]) break; @@ -199,19 +200,19 @@ find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { } int -valid_port_id(uint8_t port_id); +valid_port_id(uint16_t port_id); int -valid_bonded_port_id(uint8_t port_id); +valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(uint8_t port_id, uint8_t mode); +valid_slave_port_id(uint16_t port_id, uint8_t mode); void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void link_properties_set(struct rte_eth_dev *bonded_eth_dev, @@ -255,10 +256,10 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count); void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id); + uint16_t slave_port_id); int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); int diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile index ffdf36d37..a94ac7605 100644 --- a/drivers/net/e1000/Makefile +++ b/drivers/net/e1000/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_e1000_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) # diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 3d4ab9368..a59947d78 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1624,7 +1624,7 @@ eth_em_interrupt_action(struct rte_eth_dev *dev, rte_em_dev_atomic_read_link_status(dev, &link); if (link.link_status) { PMD_INIT_LOG(INFO, " Port %d: Link Up - speed %u Mbps - %s", - dev->data->port_id, (unsigned)link.link_speed, + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); } else { diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 31819c5bd..06ba68e39 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -119,7 +119,7 @@ struct em_rx_queue { uint16_t nb_rx_hold; /**< number of held free RX desc. */ uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -186,7 +186,7 @@ struct em_tx_queue { /** Total number of TX descriptors ready to be allocated. */ uint16_t nb_tx_free; uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 1c80a2a1b..a800d9c2b 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -122,7 +122,7 @@ struct igb_rx_queue { uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -191,7 +191,7 @@ struct igb_tx_queue { /**< Index of first used TX descriptor. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/failsafe/Makefile b/drivers/net/failsafe/Makefile index d516d3621..e6bfad728 100644 --- a/drivers/net/failsafe/Makefile +++ b/drivers/net/failsafe/Makefile @@ -36,7 +36,7 @@ LIB = librte_pmd_failsafe.a EXPORT_MAP := rte_pmd_failsafe_version.map -LIBABIVER := 1 +LIBABIVER := 2 # Sources are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe.c diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index a3a8cce95..1c8a9337e 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -400,7 +400,7 @@ failsafe_eth_dev_state_sync(struct rte_eth_dev *dev) } int -failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_rmv_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { @@ -419,7 +419,7 @@ failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, } int -failsafe_eth_lsc_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 0361cf434..4ae6e6c5f 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -180,10 +180,10 @@ int failsafe_eal_uninit(struct rte_eth_dev *dev); int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev); void failsafe_dev_remove(struct rte_eth_dev *dev); -int failsafe_eth_rmv_event_callback(uint8_t port_id, +int failsafe_eth_rmv_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *arg, void *out); -int failsafe_eth_lsc_event_callback(uint8_t port_id, +int failsafe_eth_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *out); diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile index e0024f052..5034064e4 100644 --- a/drivers/net/fm10k/Makefile +++ b/drivers/net/fm10k/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_fm10k_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) # diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h index 8e1a95062..060982b10 100644 --- a/drivers/net/fm10k/fm10k.h +++ b/drivers/net/fm10k/fm10k.h @@ -204,7 +204,7 @@ struct fm10k_rx_queue { uint16_t rxrearm_nb; /* number of remaining to be re-armed */ uint16_t rxrearm_start; /* the idx we start the re-arming from */ uint16_t rx_using_sse; /* indicates that vector RX is in use */ - uint8_t port_id; + uint16_t port_id; uint8_t drop_en; uint8_t rx_deferred_start; /* don't start this queue in dev start. */ uint16_t rx_ftag_en; /* indicates FTAG RX supported */ @@ -241,7 +241,7 @@ struct fm10k_tx_queue { volatile uint32_t *tail_ptr; uint32_t txq_flags; /* Holds flags for this TXq */ uint16_t nb_desc; - uint8_t port_id; + uint16_t port_id; uint8_t tx_deferred_start; /** don't start this queue in dev start. */ uint16_t queue_id; uint16_t tx_ftag_en; /* indicates FTAG TX supported */ @@ -289,7 +289,7 @@ static inline uint16_t fifo_remove(struct fifo *fifo) } static inline void -fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint8_t in_port) +fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint16_t in_port) { rte_mbuf_refcnt_set(mb, 1); mb->next = NULL; diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index 55c79a60a..1290d7f32 100644 --- a/drivers/net/i40e/Makefile +++ b/drivers/net/i40e/Makefile @@ -42,7 +42,7 @@ CFLAGS += -DX722_A0_SUPPORT EXPORT_MAP := rte_pmd_i40e_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # Add extra flags for base driver files (also known as shared code) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f12aefa5d..c4c6aec1d 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1920,8 +1920,9 @@ i40e_dev_start(struct rte_eth_dev *dev) hw->adapter_stopped = 0; if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; autonegotiation disabled", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, autonegotiation disabled", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index 20084d649..ff2ab8575 100644 --- a/drivers/net/i40e/i40e_rxtx.h +++ b/drivers/net/i40e/i40e_rxtx.h @@ -121,7 +121,7 @@ struct i40e_rx_queue { uint16_t rxrearm_start; /**< the idx we start the re-arming from */ uint64_t mbuf_initializer; /**< value to init mbufs */ - uint8_t port_id; /**< device port ID */ + uint16_t port_id; /**< device port ID */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise */ uint16_t queue_id; /**< RX queue index */ uint16_t reg_idx; /**< RX queue register index */ @@ -167,7 +167,7 @@ struct i40e_tx_queue { uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; uint32_t txq_flags; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index f12b7f4a1..3728d39b9 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -41,7 +41,7 @@ #include "rte_pmd_i40e.h" int -rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) +rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -66,7 +66,7 @@ rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) } int -rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -170,7 +170,7 @@ i40e_add_rm_all_vlan_filter(struct i40e_vsi *vsi, uint8_t add) } int -rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -430,7 +430,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on) } int -rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -473,7 +473,7 @@ rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -514,7 +514,7 @@ rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -555,7 +555,7 @@ rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr) { struct i40e_mac_filter *f; @@ -598,7 +598,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, /* Set vlan strip on/off for specific VF from host */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -633,7 +633,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) return ret; } -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -698,7 +698,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; @@ -764,7 +764,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on) +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -858,7 +858,7 @@ i40e_vlan_filter_count(struct i40e_vsi *vsi) return count; } -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -941,7 +941,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, } int -rte_pmd_i40e_get_vf_stats(uint8_t port, +rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -986,7 +986,7 @@ rte_pmd_i40e_get_vf_stats(uint8_t port, } int -rte_pmd_i40e_reset_vf_stats(uint8_t port, +rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -1020,7 +1020,7 @@ rte_pmd_i40e_reset_vf_stats(uint8_t port, } int -rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) +rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1109,7 +1109,7 @@ rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) } int -rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight) { struct rte_eth_dev *dev; @@ -1223,7 +1223,7 @@ rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw) { struct rte_eth_dev *dev; @@ -1341,7 +1341,7 @@ rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map) +rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1513,7 +1513,7 @@ i40e_add_rm_profile_info(struct i40e_hw *hw, uint8_t *profile_info_sec) /* Check if the profile info exists */ static int -i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) +i40e_check_profile_info(uint16_t port, uint8_t *profile_info_sec) { struct rte_eth_dev *dev = &rte_eth_devices[port]; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1557,7 +1557,7 @@ i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) } int -rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op) { @@ -1863,7 +1863,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg_buff, uint32_t pkg_size, } int -rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size) +rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size) { struct rte_eth_dev *dev; struct i40e_hw *hw; @@ -1991,7 +1991,7 @@ static int check_invalid_ptype_mapping( int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive) @@ -2027,7 +2027,7 @@ rte_pmd_i40e_ptype_mapping_update( return 0; } -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port) { struct rte_eth_dev *dev; @@ -2044,7 +2044,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) } int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -2078,7 +2078,7 @@ int rte_pmd_i40e_ptype_mapping_get( return 0; } -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type) diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h index 356fa89d7..7f32a59b1 100644 --- a/drivers/net/i40e/rte_pmd_i40e.h +++ b/drivers/net/i40e/rte_pmd_i40e.h @@ -157,7 +157,7 @@ struct rte_pmd_i40e_ptype_mapping { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); +int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf); /** * Enable/Disable VF MAC anti spoofing. @@ -174,7 +174,7 @@ int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -193,7 +193,7 @@ int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -210,7 +210,7 @@ int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_tx_loopback(uint8_t port, +int rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on); /** @@ -228,7 +228,7 @@ int rte_pmd_i40e_set_tx_loopback(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -247,7 +247,7 @@ int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -271,7 +271,7 @@ int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr); /** @@ -291,7 +291,7 @@ int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, * - (-EINVAL) if bad parameter. */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -309,7 +309,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id); /** @@ -328,7 +328,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on); /** @@ -347,7 +347,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on); /** * Enable/Disable VF VLAN filter @@ -368,7 +368,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on); /** @@ -393,7 +393,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_vf_stats(uint8_t port, +int rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -409,7 +409,7 @@ int rte_pmd_i40e_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_reset_vf_stats(uint8_t port, +int rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -434,7 +434,7 @@ int rte_pmd_i40e_reset_vf_stats(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw); @@ -459,7 +459,7 @@ int rte_pmd_i40e_set_vf_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, +int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight); @@ -484,7 +484,7 @@ int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw); @@ -502,7 +502,7 @@ int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); +int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map); /** * Load/Unload a ddp package @@ -523,7 +523,7 @@ int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); * - (-EACCES) if profile does not exist. * - (-ENOTSUP) if operation not supported. */ -int rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op); @@ -561,7 +561,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); +int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size); /** * Update hardware defined ptype to software defined packet type @@ -581,7 +581,7 @@ int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); * set other PTYPEs maps to PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive); @@ -593,7 +593,7 @@ int rte_pmd_i40e_ptype_mapping_update( * @param port * pointer to port identifier of the device */ -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port); /** * Get hardware defined ptype to software defined ptype @@ -612,7 +612,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -632,7 +632,7 @@ int rte_pmd_i40e_ptype_mapping_get( * @param pkt_type * the new packet type to overwrite */ -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type); diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index 5e57cb353..18ad4feca 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_ixgbe_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) # diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 9ca5cbcd3..d873c409f 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2508,8 +2508,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev) * - fixed speed: TODO implement */ if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; fix speed not supported", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, fix speed not supported", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 85feb0bdc..81c527fad 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -148,7 +148,7 @@ struct ixgbe_rx_queue { uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ uint16_t pkt_type_mask; /**< Packet type mask for different NICs. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise. */ uint8_t drop_en; /**< If not 0, set SRRCTL.Drop_En. */ uint8_t rx_deferred_start; /**< not in global dev start. */ @@ -237,7 +237,7 @@ struct ixgbe_tx_queue { uint16_t tx_next_rs; /**< next desc to set RS bit */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 79897ff64..f12737857 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -38,7 +38,7 @@ #include "rte_pmd_ixgbe.h" int -rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct ixgbe_hw *hw; @@ -73,7 +73,7 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) +rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf) { struct ixgbe_hw *hw; struct ixgbe_vf_info *vfinfo; @@ -105,7 +105,7 @@ rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) } int -rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -135,7 +135,7 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -164,7 +164,7 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) +rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -200,7 +200,7 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) } int -rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -230,7 +230,7 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -260,7 +260,7 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -295,7 +295,7 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -342,7 +342,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { int val = 0; @@ -389,7 +389,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -439,7 +439,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -489,7 +489,7 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct rte_eth_dev *dev; @@ -524,7 +524,7 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, } int -rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *dev; @@ -540,7 +540,7 @@ rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) +rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -623,7 +623,7 @@ rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) } int -rte_pmd_ixgbe_macsec_disable(uint8_t port) +rte_pmd_ixgbe_macsec_disable(uint16_t port) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -687,7 +687,7 @@ rte_pmd_ixgbe_macsec_disable(uint8_t port) } int -rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) +rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -712,7 +712,7 @@ rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) } int -rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) +rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -738,7 +738,7 @@ rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) } int -rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -794,7 +794,7 @@ rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -837,7 +837,7 @@ rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight) { @@ -911,7 +911,7 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, #ifdef RTE_LIBRTE_IXGBE_BYPASS int -rte_pmd_ixgbe_bypass_init(uint8_t port_id) +rte_pmd_ixgbe_bypass_init(uint16_t port_id) { struct rte_eth_dev *dev; @@ -926,7 +926,7 @@ rte_pmd_ixgbe_bypass_init(uint8_t port_id) } int -rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) +rte_pmd_ixgbe_bypass_state_show(uint16_t port_id, uint32_t *state) { struct rte_eth_dev *dev; @@ -940,7 +940,7 @@ rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) } int -rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) +rte_pmd_ixgbe_bypass_state_set(uint16_t port_id, uint32_t *new_state) { struct rte_eth_dev *dev; @@ -954,7 +954,7 @@ rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) } int -rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_show(uint16_t port_id, uint32_t event, uint32_t *state) { @@ -970,7 +970,7 @@ rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_store(uint16_t port_id, uint32_t event, uint32_t state) { @@ -986,7 +986,7 @@ rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) +rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port_id, uint32_t timeout) { struct rte_eth_dev *dev; @@ -1000,7 +1000,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) } int -rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) +rte_pmd_ixgbe_bypass_ver_show(uint16_t port_id, uint32_t *ver) { struct rte_eth_dev *dev; @@ -1014,7 +1014,7 @@ rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) } int -rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) +rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port_id, uint32_t *wd_timeout) { struct rte_eth_dev *dev; @@ -1028,7 +1028,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) } int -rte_pmd_ixgbe_bypass_wd_reset(uint8_t port_id) +rte_pmd_ixgbe_bypass_wd_reset(uint16_t port_id) { struct rte_eth_dev *dev; diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index d33c285db..81b18f876 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -53,7 +53,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); +int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf); /** * Set the VF MAC address. @@ -69,7 +69,7 @@ int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -87,7 +87,8 @@ int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, + uint8_t on); /** * Enable/Disable VF MAC anti spoofing. @@ -104,7 +105,7 @@ int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -122,7 +123,7 @@ int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -139,7 +140,7 @@ int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -155,7 +156,7 @@ int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * set drop enable bit in the VF split rx control register @@ -174,7 +175,7 @@ int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan strip for all queues in a pool @@ -194,7 +195,7 @@ int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable MACsec offload. @@ -212,7 +213,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); +int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp); /** * Disable MACsec offload. @@ -224,7 +225,7 @@ int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_disable(uint8_t port); +int rte_pmd_ixgbe_macsec_disable(uint16_t port); /** * Configure Tx SC (Secure Connection). @@ -238,7 +239,7 @@ int rte_pmd_ixgbe_macsec_disable(uint8_t port); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); +int rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac); /** * Configure Rx SC (Secure Connection). @@ -254,7 +255,7 @@ int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); +int rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi); /** * Enable Tx SA (Secure Association). @@ -275,7 +276,7 @@ int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +int rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key); /** @@ -297,7 +298,7 @@ int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key); /** @@ -323,7 +324,8 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, + uint8_t on); /** * Enable or disable a VF traffic receive of an Ethernet device. @@ -342,7 +344,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable or disable a VF traffic transmit of the Ethernet device. @@ -361,7 +363,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable hardware VF VLAN filtering by an Ethernet device of @@ -383,7 +385,8 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, + uint64_t vf_mask, uint8_t vlan_on); /** * Set the rate limitation for a vf on an Ethernet device. @@ -402,7 +405,8 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); +int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, + uint16_t tx_rate, uint64_t q_msk); /** * Set all the TCs' bandwidth weight. @@ -423,7 +427,7 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +int rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight); @@ -439,7 +443,7 @@ int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_init(uint8_t port); +int rte_pmd_ixgbe_bypass_init(uint16_t port); /** * Return bypass state. @@ -456,7 +460,7 @@ int rte_pmd_ixgbe_bypass_init(uint8_t port); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); +int rte_pmd_ixgbe_bypass_state_show(uint16_t port, uint32_t *state); /** * Set bypass state @@ -473,7 +477,7 @@ int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); +int rte_pmd_ixgbe_bypass_state_set(uint16_t port, uint32_t *new_state); /** * Return bypass state when given event occurs. @@ -497,7 +501,7 @@ int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_show(uint8_t port, +int rte_pmd_ixgbe_bypass_event_show(uint16_t port, uint32_t event, uint32_t *state); @@ -523,7 +527,7 @@ int rte_pmd_ixgbe_bypass_event_show(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_store(uint8_t port, +int rte_pmd_ixgbe_bypass_event_store(uint16_t port, uint32_t event, uint32_t state); @@ -547,7 +551,7 @@ int rte_pmd_ixgbe_bypass_event_store(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port, uint32_t timeout); /** * Get bypass firmware version. @@ -561,7 +565,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); +int rte_pmd_ixgbe_bypass_ver_show(uint16_t port, uint32_t *ver); /** * Return bypass watchdog timeout in seconds @@ -583,7 +587,7 @@ int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port, uint32_t *wd_timeout); /** * Reset bypass watchdog timer @@ -595,7 +599,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_reset(uint8_t port); +int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port); /** diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 7de1d1086..238a64f43 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -112,14 +112,14 @@ struct rxq { unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ unsigned int cqe_n:4; /* Log 2 of CQ elements. */ unsigned int elts_n:4; /* Log 2 of Mbufs. */ - unsigned int port_id:8; unsigned int rss_hash:1; /* RSS hash result is enabled. */ unsigned int mark:1; /* Marked flow available on the queue. */ unsigned int pending_err:1; /* CQE error needs to be handled. */ unsigned int trim_elts:1; /* Whether elts needs clean-up. */ - unsigned int :6; /* Remaining bits. */ + unsigned int :14; /* Remaining bits. */ volatile uint32_t *rq_db; volatile uint32_t *cq_db; + uint16_t port_id; uint16_t rq_ci; uint16_t rq_pi; uint16_t cq_ci; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 92b03c4cb..f1b968fc2 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1240,12 +1240,12 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev) nfp_net_dev_atomic_read_link_status(dev, &link); if (link.link_status) RTE_LOG(INFO, PMD, "Port %d: Link Up - speed %u Mbps - %s\n", - (int)(dev->data->port_id), (unsigned)link.link_speed, + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); else RTE_LOG(INFO, PMD, " Port %d: Link Down\n", - (int)(dev->data->port_id)); + dev->data->port_id); RTE_LOG(INFO, PMD, "PCI Address: %04d:%02d:%02d:%d\n", pci_dev->addr.domain, pci_dev->addr.bus, @@ -1549,7 +1549,7 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, "tx_free_thresh must be less than the number of TX " "descriptors. (tx_free_thresh=%u port=%d " "queue=%d)\n", (unsigned int)tx_free_thresh, - (int)dev->data->port_id, (int)queue_idx); + dev->data->port_id, (int)queue_idx); return -(EINVAL); } @@ -1847,9 +1847,9 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) */ new_mb = rte_pktmbuf_alloc(rxq->mem_pool); if (unlikely(new_mb == NULL)) { - RTE_LOG_DP(DEBUG, PMD, "RX mbuf alloc failed port_id=%u " - "queue_id=%u\n", (unsigned)rxq->port_id, - (unsigned)rxq->qidx); + RTE_LOG_DP(DEBUG, PMD, + "RX mbuf alloc failed port_id=%u queue_id=%u\n", + rxq->port_id, (unsigned int)rxq->qidx); nfp_net_mbuf_alloc_failed(rxq); break; } @@ -1933,7 +1933,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) return nb_hold; PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, nb_hold); + rxq->port_id, (unsigned int)rxq->qidx, nb_hold); nb_hold += rxq->nb_rx_hold; @@ -1944,7 +1944,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rte_wmb(); if (nb_hold > rxq->rx_free_thresh) { PMD_RX_LOG(DEBUG, "port=%u queue=%u nb_hold=%u avail=%u\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, + rxq->port_id, (unsigned int)rxq->qidx, (unsigned)nb_hold, (unsigned)avail); nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, nb_hold); nb_hold = 0; diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h index eec56bc1c..828d0d35b 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -250,7 +250,7 @@ struct nfp_net_txq { uint32_t tx_hthresh; /* not used by now. Future? */ uint32_t tx_wthresh; /* not used by now. Future? */ uint32_t txq_flags; /* not used by now. Future? */ - uint8_t port_id; + uint16_t port_id; int qidx; int tx_qcidx; __le64 dma; diff --git a/drivers/net/null/Makefile b/drivers/net/null/Makefile index 77810bced..fdd7c5813 100644 --- a/drivers/net/null/Makefile +++ b/drivers/net/null/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_null_version.map -LIBABIVER := 2 +LIBABIVER := 3 # # all source are stored in SRCS-y diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 5aef0591e..fa9313dec 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -68,7 +68,7 @@ struct null_queue { struct pmd_internals { unsigned packet_size; unsigned packet_copy; - uint8_t port_id; + uint16_t port_id; struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT]; struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT]; diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile index 7ebd0bef2..f731b126e 100644 --- a/drivers/net/pcap/Makefile +++ b/drivers/net/pcap/Makefile @@ -43,7 +43,7 @@ LDLIBS += -lpcap EXPORT_MAP := rte_pmd_pcap_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index defb3b419..b51f16cbd 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -75,7 +75,7 @@ struct queue_stat { struct pcap_rx_queue { pcap_t *pcap; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; struct queue_stat rx_stat; char name[PATH_MAX]; diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h index 9864bb448..96f0d351d 100644 --- a/drivers/net/qede/qede_if.h +++ b/drivers/net/qede/qede_if.h @@ -97,7 +97,7 @@ struct qed_link_output { uint32_t speed; /* In Mb/s */ uint32_t adv_speed; /* Speed mask */ uint8_t duplex; /* In DUPLEX defs */ - uint8_t port; /* In PORT defs */ + uint16_t port; /* In PORT defs */ bool autoneg; uint32_t pause_config; }; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 464d3d384..e3fa7b0e2 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -394,7 +394,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], }; char args_str[32] = { 0 }; char ring_name[32] = { 0 }; - uint8_t port_id = RTE_MAX_ETHPORTS; + uint16_t port_id = RTE_MAX_ETHPORTS; int ret; /* do some parameter checking */ diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 9c0d57cc1..d141acf0e 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -71,7 +71,7 @@ struct szedata2_rx_queue { struct szedata *sze; uint8_t rx_channel; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; volatile uint64_t rx_pkts; volatile uint64_t rx_bytes; diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h index 4ee6c3bb0..e54a96f8e 100644 --- a/drivers/net/thunderx/nicvf_struct.h +++ b/drivers/net/thunderx/nicvf_struct.h @@ -100,7 +100,7 @@ struct nicvf_rxq { uint16_t queue_id; uint16_t precharge_cnt; uint8_t rx_drop_en; - uint8_t port_id; + uint16_t port_id; uint8_t rbptr_offset; } __rte_cache_aligned; diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile index 3ba8ad64f..258a917c7 100644 --- a/drivers/net/vhost/Makefile +++ b/drivers/net/vhost/Makefile @@ -43,7 +43,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_vhost_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 0dac5e60e..04179b4db 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -105,7 +105,7 @@ struct vhost_queue { rte_atomic32_t while_queuing; struct pmd_internal *internal; struct rte_mempool *mb_pool; - uint8_t port; + uint16_t port; uint16_t virtqueue_id; struct vhost_stats stats; }; @@ -705,7 +705,7 @@ static struct vhost_device_ops vhost_ops = { }; int -rte_eth_vhost_get_queue_event(uint8_t port_id, +rte_eth_vhost_get_queue_event(uint16_t port_id, struct rte_eth_vhost_queue_event *event) { struct rte_vhost_vring_state *state; @@ -742,7 +742,7 @@ rte_eth_vhost_get_queue_event(uint8_t port_id, } int -rte_eth_vhost_get_vid_from_port_id(uint8_t port_id) +rte_eth_vhost_get_vid_from_port_id(uint16_t port_id) { struct internal_list *list; struct rte_eth_dev *eth_dev; diff --git a/drivers/net/vhost/rte_eth_vhost.h b/drivers/net/vhost/rte_eth_vhost.h index 39ca77197..948f3c810 100644 --- a/drivers/net/vhost/rte_eth_vhost.h +++ b/drivers/net/vhost/rte_eth_vhost.h @@ -69,7 +69,7 @@ struct rte_eth_vhost_queue_event { * - On success, zero. * - On failure, a negative value. */ -int rte_eth_vhost_get_queue_event(uint8_t port_id, +int rte_eth_vhost_get_queue_event(uint16_t port_id, struct rte_eth_vhost_queue_event *event); /** @@ -79,7 +79,7 @@ int rte_eth_vhost_get_queue_event(uint8_t port_id, * - On success, the 'vid' associated with 'port_id'. * - On failure, a negative value. */ -int rte_eth_vhost_get_vid_from_port_id(uint8_t port_id); +int rte_eth_vhost_get_vid_from_port_id(uint16_t port_id); #ifdef __cplusplus } diff --git a/drivers/net/virtio/Makefile b/drivers/net/virtio/Makefile index b21b87814..ad4b695a3 100644 --- a/drivers/net/virtio/Makefile +++ b/drivers/net/virtio/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_virtio_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 18caebdd7..330ee94be 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -260,7 +260,7 @@ struct virtio_hw { uint8_t use_msix; uint8_t modern; uint8_t use_simple_rxtx; - uint8_t port_id; + uint16_t port_id; uint8_t mac_addr[ETHER_ADDR_LEN]; uint32_t notify_off_multiplier; uint8_t *isr; diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h index 28f82d6a8..198b2d8fb 100644 --- a/drivers/net/virtio/virtio_rxtx.h +++ b/drivers/net/virtio/virtio_rxtx.h @@ -54,7 +54,7 @@ struct virtnet_rx { struct rte_mempool *mpool; /**< mempool for mbuf allocation */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -69,7 +69,7 @@ struct virtnet_tx { phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -82,7 +82,7 @@ struct virtnet_ctl { /**< memzone to populate hdr. */ const struct rte_memzone *virtio_net_hdr_mz; phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ const struct rte_memzone *mz; /**< mem zone to populate RX ring. */ }; diff --git a/drivers/net/vmxnet3/vmxnet3_ring.h b/drivers/net/vmxnet3/vmxnet3_ring.h index d2e8323ba..a6fa93ac7 100644 --- a/drivers/net/vmxnet3/vmxnet3_ring.h +++ b/drivers/net/vmxnet3/vmxnet3_ring.h @@ -144,7 +144,7 @@ typedef struct vmxnet3_tx_queue { const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t txdata_desc_size; } vmxnet3_tx_queue_t; @@ -179,7 +179,7 @@ typedef struct vmxnet3_rx_queue { const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ } vmxnet3_rx_queue_t; #endif /* _VMXNET3_RING_H_ */ diff --git a/lib/librte_bitratestats/Makefile b/lib/librte_bitratestats/Makefile index 58a20ea09..a079cced7 100644 --- a/lib/librte_bitratestats/Makefile +++ b/lib/librte_bitratestats/Makefile @@ -38,7 +38,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_bitratestats_version.map -LIBABIVER := 1 +LIBABIVER := 2 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) := rte_bitrate.c diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index 3ceb35166..f373697a7 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -84,7 +84,7 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data) int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id) + uint16_t port_id) { struct rte_stats_bitrate *port_data; struct rte_eth_stats eth_stats; diff --git a/lib/librte_bitratestats/rte_bitrate.h b/lib/librte_bitratestats/rte_bitrate.h index 15fc270a3..16467221b 100644 --- a/lib/librte_bitratestats/rte_bitrate.h +++ b/lib/librte_bitratestats/rte_bitrate.h @@ -85,7 +85,7 @@ int rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data); * - Negative value on error */ int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id); + uint16_t port_id); #ifdef __cplusplus } diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile index 27d9766a8..0bacc8b3f 100644 --- a/lib/librte_ether/Makefile +++ b/lib/librte_ether/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_ethdev_version.map -LIBABIVER := 6 +LIBABIVER := 7 SRCS-y += rte_ethdev.c SRCS-y += rte_flow.c diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index a88916f2a..e756dbc46 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -138,8 +138,8 @@ enum { STAT_QMAP_RX }; -uint8_t -rte_eth_find_next(uint8_t port_id) +uint16_t +rte_eth_find_next(uint16_t port_id) { while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED) @@ -187,7 +187,7 @@ rte_eth_dev_allocated(const char *name) return NULL; } -static uint8_t +static uint16_t rte_eth_dev_find_free_port(void) { unsigned i; @@ -200,7 +200,7 @@ rte_eth_dev_find_free_port(void) } static struct rte_eth_dev * -eth_dev_get(uint8_t port_id) +eth_dev_get(uint16_t port_id) { struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id]; @@ -216,7 +216,7 @@ eth_dev_get(uint8_t port_id) struct rte_eth_dev * rte_eth_dev_allocate(const char *name) { - uint8_t port_id; + uint16_t port_id; struct rte_eth_dev *eth_dev; port_id = rte_eth_dev_find_free_port(); @@ -251,7 +251,7 @@ rte_eth_dev_allocate(const char *name) struct rte_eth_dev * rte_eth_dev_attach_secondary(const char *name) { - uint8_t i; + uint16_t i; struct rte_eth_dev *eth_dev; if (rte_eth_dev_data == NULL) @@ -285,7 +285,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) } int -rte_eth_dev_is_valid_port(uint8_t port_id) +rte_eth_dev_is_valid_port(uint16_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && @@ -296,17 +296,17 @@ rte_eth_dev_is_valid_port(uint8_t port_id) } int -rte_eth_dev_socket_id(uint8_t port_id) +rte_eth_dev_socket_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; } -uint8_t +uint16_t rte_eth_dev_count(void) { - uint8_t p; - uint8_t count; + uint16_t p; + uint16_t count; count = 0; @@ -317,7 +317,7 @@ rte_eth_dev_count(void) } int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name) { const char *tmp; @@ -336,7 +336,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) } int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) { int ret; int i; @@ -361,7 +361,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) } static int -rte_eth_dev_is_detachable(uint8_t port_id) +rte_eth_dev_is_detachable(uint16_t port_id) { uint32_t dev_flags; @@ -377,7 +377,7 @@ rte_eth_dev_is_detachable(uint8_t port_id) /* attach the new device, then store port_id of the device */ int -rte_eth_dev_attach(const char *devargs, uint8_t *port_id) +rte_eth_dev_attach(const char *devargs, uint16_t *port_id) { int ret = -1; int current = rte_eth_dev_count(); @@ -423,7 +423,7 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id) /* detach the device, then store the name of the device */ int -rte_eth_dev_detach(uint8_t port_id, char *name) +rte_eth_dev_detach(uint16_t port_id, char *name) { int ret = -1; @@ -501,7 +501,7 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) } int -rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -527,7 +527,7 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -553,7 +553,7 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -579,7 +579,7 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) } int -rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -688,7 +688,7 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) } int -rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf) { struct rte_eth_dev *dev; @@ -839,7 +839,7 @@ _rte_eth_dev_reset(struct rte_eth_dev *dev) } static void -rte_eth_dev_config_restore(uint8_t port_id) +rte_eth_dev_config_restore(uint16_t port_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -894,7 +894,7 @@ rte_eth_dev_config_restore(uint8_t port_id) } int -rte_eth_dev_start(uint8_t port_id) +rte_eth_dev_start(uint16_t port_id) { struct rte_eth_dev *dev; int diag; @@ -906,7 +906,7 @@ rte_eth_dev_start(uint8_t port_id) RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP); if (dev->data->dev_started != 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already started\n", port_id); return 0; @@ -928,7 +928,7 @@ rte_eth_dev_start(uint8_t port_id) } void -rte_eth_dev_stop(uint8_t port_id) +rte_eth_dev_stop(uint16_t port_id) { struct rte_eth_dev *dev; @@ -938,7 +938,7 @@ rte_eth_dev_stop(uint8_t port_id) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop); if (dev->data->dev_started == 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already stopped\n", port_id); return; @@ -949,7 +949,7 @@ rte_eth_dev_stop(uint8_t port_id) } int -rte_eth_dev_set_link_up(uint8_t port_id) +rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; @@ -962,7 +962,7 @@ rte_eth_dev_set_link_up(uint8_t port_id) } int -rte_eth_dev_set_link_down(uint8_t port_id) +rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; @@ -975,7 +975,7 @@ rte_eth_dev_set_link_down(uint8_t port_id) } void -rte_eth_dev_close(uint8_t port_id) +rte_eth_dev_close(uint16_t port_id) { struct rte_eth_dev *dev; @@ -995,7 +995,7 @@ rte_eth_dev_close(uint8_t port_id) } int -rte_eth_dev_reset(uint8_t port_id) +rte_eth_dev_reset(uint16_t port_id) { struct rte_eth_dev *dev; int ret; @@ -1012,7 +1012,7 @@ rte_eth_dev_reset(uint8_t port_id) } int -rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) @@ -1103,7 +1103,7 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) { @@ -1207,7 +1207,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) } int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -1221,7 +1221,7 @@ rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) } void -rte_eth_promiscuous_enable(uint8_t port_id) +rte_eth_promiscuous_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1234,7 +1234,7 @@ rte_eth_promiscuous_enable(uint8_t port_id) } void -rte_eth_promiscuous_disable(uint8_t port_id) +rte_eth_promiscuous_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1247,7 +1247,7 @@ rte_eth_promiscuous_disable(uint8_t port_id) } int -rte_eth_promiscuous_get(uint8_t port_id) +rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1258,7 +1258,7 @@ rte_eth_promiscuous_get(uint8_t port_id) } void -rte_eth_allmulticast_enable(uint8_t port_id) +rte_eth_allmulticast_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1271,7 +1271,7 @@ rte_eth_allmulticast_enable(uint8_t port_id) } void -rte_eth_allmulticast_disable(uint8_t port_id) +rte_eth_allmulticast_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1284,7 +1284,7 @@ rte_eth_allmulticast_disable(uint8_t port_id) } int -rte_eth_allmulticast_get(uint8_t port_id) +rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1309,7 +1309,7 @@ rte_eth_dev_atomic_read_link_status(struct rte_eth_dev *dev, } void -rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1326,7 +1326,7 @@ rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) } void -rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1343,7 +1343,7 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) } int -rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) +rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; @@ -1359,7 +1359,7 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) } void -rte_eth_stats_reset(uint8_t port_id) +rte_eth_stats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1372,7 +1372,7 @@ rte_eth_stats_reset(uint8_t port_id) } static int -get_xstats_count(uint8_t port_id) +get_xstats_count(uint16_t port_id) { struct rte_eth_dev *dev; int count; @@ -1401,7 +1401,7 @@ get_xstats_count(uint8_t port_id) } int -rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id) { int cnt_xstats, idx_xstat; @@ -1445,7 +1445,7 @@ rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, } int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids) { @@ -1562,7 +1562,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, } int -rte_eth_xstats_get_names(uint8_t port_id, +rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size) { @@ -1628,8 +1628,8 @@ rte_eth_xstats_get_names(uint8_t port_id, /* retrieve ethdev extended statistics */ int -rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, - unsigned int n) +rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, + uint64_t *values, unsigned int n) { /* If need all xstats */ if (!ids) { @@ -1754,7 +1754,7 @@ rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, } int -rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n) { struct rte_eth_stats eth_stats; @@ -1836,7 +1836,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, /* reset ethdev extended statistics */ void -rte_eth_xstats_reset(uint8_t port_id) +rte_eth_xstats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1854,7 +1854,7 @@ rte_eth_xstats_reset(uint8_t port_id) } static int -set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, +set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx) { struct rte_eth_dev *dev; @@ -1870,7 +1870,7 @@ set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, int -rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, @@ -1879,7 +1879,7 @@ rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, int -rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, @@ -1887,7 +1887,7 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) +rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; @@ -1899,7 +1899,7 @@ rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) } void -rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) +rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; const struct rte_eth_desc_lim lim = { @@ -1923,7 +1923,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) } int -rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num) { int i, j; @@ -1949,7 +1949,7 @@ rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, } void -rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) +rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -1960,7 +1960,7 @@ rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) int -rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) +rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) { struct rte_eth_dev *dev; @@ -1972,7 +1972,7 @@ rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) } int -rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) +rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) { int ret; struct rte_eth_dev *dev; @@ -1989,7 +1989,7 @@ rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) } int -rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) +rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) { struct rte_eth_dev *dev; int ret; @@ -2028,7 +2028,8 @@ rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) } int -rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int on) +rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, + int on) { struct rte_eth_dev *dev; @@ -2046,7 +2047,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int o } int -rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tpid) { @@ -2060,7 +2061,7 @@ rte_eth_dev_set_vlan_ether_type(uint8_t port_id, } int -rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) +rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) { struct rte_eth_dev *dev; int ret = 0; @@ -2103,7 +2104,7 @@ rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) } int -rte_eth_dev_get_vlan_offload(uint8_t port_id) +rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; int ret = 0; @@ -2124,7 +2125,7 @@ rte_eth_dev_get_vlan_offload(uint8_t port_id) } int -rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) +rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; @@ -2137,7 +2138,7 @@ rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) } int -rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2149,7 +2150,7 @@ rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2165,7 +2166,8 @@ rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf) +rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, + struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; @@ -2231,7 +2233,7 @@ rte_eth_check_reta_entry(struct rte_eth_rss_reta_entry64 *reta_conf, } int -rte_eth_dev_rss_reta_update(uint8_t port_id, +rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2257,7 +2259,7 @@ rte_eth_dev_rss_reta_update(uint8_t port_id, } int -rte_eth_dev_rss_reta_query(uint8_t port_id, +rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2277,7 +2279,8 @@ rte_eth_dev_rss_reta_query(uint8_t port_id, } int -rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) +rte_eth_dev_rss_hash_update(uint16_t port_id, + struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; uint16_t rss_hash_protos; @@ -2296,7 +2299,7 @@ rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) } int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; @@ -2308,7 +2311,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2330,7 +2333,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2353,7 +2356,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, } int -rte_eth_led_on(uint8_t port_id) +rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2364,7 +2367,7 @@ rte_eth_led_on(uint8_t port_id) } int -rte_eth_led_off(uint8_t port_id) +rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2379,7 +2382,7 @@ rte_eth_led_off(uint8_t port_id) * an empty spot. */ static int -get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2398,7 +2401,7 @@ get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) static const struct ether_addr null_mac_addr; int -rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, uint32_t pool) { struct rte_eth_dev *dev; @@ -2451,7 +2454,7 @@ rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; int index; @@ -2480,7 +2483,7 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) } int -rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; @@ -2506,7 +2509,7 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) * an empty spot. */ static int -get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2525,7 +2528,7 @@ get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) } int -rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, uint8_t on) { int index; @@ -2577,7 +2580,7 @@ rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) +rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; @@ -2589,7 +2592,7 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) return (*dev->dev_ops->uc_all_hash_table_set)(dev, on); } -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate) { struct rte_eth_dev *dev; @@ -2620,7 +2623,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, } int -rte_eth_mirror_rule_set(uint8_t port_id, +rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) { @@ -2658,7 +2661,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, } int -rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) +rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id) { struct rte_eth_dev *dev; @@ -2671,7 +2674,7 @@ rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) } int -rte_eth_dev_callback_register(uint8_t port_id, +rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2711,7 +2714,7 @@ rte_eth_dev_callback_register(uint8_t port_id, } int -rte_eth_dev_callback_unregister(uint8_t port_id, +rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2783,7 +2786,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, } int -rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) +rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) { uint32_t vec; struct rte_eth_dev *dev; @@ -2844,7 +2847,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, } int -rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data) { uint32_t vec; @@ -2884,7 +2887,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_rx_intr_enable(uint8_t port_id, +rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2898,7 +2901,7 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id, } int -rte_eth_dev_rx_intr_disable(uint8_t port_id, +rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2913,7 +2916,8 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id, int -rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) +rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type) { struct rte_eth_dev *dev; @@ -2926,7 +2930,7 @@ rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) } int -rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { struct rte_eth_dev *dev; @@ -2939,7 +2943,7 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, } void * -rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2981,7 +2985,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3016,7 +3020,7 @@ rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3059,7 +3063,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3093,7 +3097,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3127,7 +3131,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo) { struct rte_eth_dev *dev; @@ -3151,7 +3155,7 @@ rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo) { struct rte_eth_dev *dev; @@ -3175,7 +3179,7 @@ rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_set_mc_addr_list(uint8_t port_id, +rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) { @@ -3189,7 +3193,7 @@ rte_eth_dev_set_mc_addr_list(uint8_t port_id, } int -rte_eth_timesync_enable(uint8_t port_id) +rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3201,7 +3205,7 @@ rte_eth_timesync_enable(uint8_t port_id) } int -rte_eth_timesync_disable(uint8_t port_id) +rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3213,7 +3217,7 @@ rte_eth_timesync_disable(uint8_t port_id) } int -rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, +rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; @@ -3226,7 +3230,8 @@ rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, } int -rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_tx_timestamp(uint16_t port_id, + struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3238,7 +3243,7 @@ rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) +rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; @@ -3250,7 +3255,7 @@ rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) } int -rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3262,7 +3267,7 @@ rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) +rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3274,7 +3279,7 @@ rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) } int -rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) +rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; @@ -3286,7 +3291,7 @@ rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) } int -rte_eth_dev_get_eeprom_length(uint8_t port_id) +rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3298,7 +3303,7 @@ rte_eth_dev_get_eeprom_length(uint8_t port_id) } int -rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3310,7 +3315,7 @@ rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3322,7 +3327,7 @@ rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_get_dcb_info(uint8_t port_id, +rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; @@ -3337,7 +3342,7 @@ rte_eth_dev_get_dcb_info(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) { struct rte_eth_dev *dev; @@ -3360,7 +3365,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en) @@ -3404,7 +3409,7 @@ rte_eth_dev_adjust_nb_desc(uint16_t *nb_desc, } int -rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 99cdd54d4..34f729ab8 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1572,7 +1572,7 @@ struct eth_dev_ops { * @return * The number of packets returned to the user. */ -typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); @@ -1596,7 +1596,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, * @return * The number of packets to be written to the NIC. */ -typedef uint16_t (*rte_tx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param); /** @@ -1699,7 +1699,7 @@ struct rte_eth_dev_data { /** bitmap array of associating Ethernet MAC addresses to pools */ struct ether_addr* hash_mac_addrs; /** Device Ethernet MAC addresses of hash filtering. */ - uint8_t port_id; /**< Device [external] port identifier. */ + uint16_t port_id; /**< Device [external] port identifier. */ __extension__ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */ scattered_rx : 1, /**< RX of scattered packets is ON(1) / OFF(0) */ @@ -1741,7 +1741,7 @@ extern struct rte_eth_dev rte_eth_devices[]; * @return * Next valid port id, RTE_MAX_ETHPORTS if there is none. */ -uint8_t rte_eth_find_next(uint8_t port_id); +uint16_t rte_eth_find_next(uint16_t port_id); /** * Macro to iterate over all enabled ethdev ports. @@ -1764,7 +1764,7 @@ uint8_t rte_eth_find_next(uint8_t port_id); * @return * - The total number of usable Ethernet devices. */ -uint8_t rte_eth_dev_count(void); +uint16_t rte_eth_dev_count(void); /** * @internal @@ -1825,7 +1825,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * @return * 0 on success and port_id is filled, negative on error */ -int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); +int rte_eth_dev_attach(const char *devargs, uint16_t *port_id); /** * Detach a Ethernet device specified by port identifier. @@ -1840,7 +1840,7 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); * @return * 0 on success and devname is filled, negative on error */ -int rte_eth_dev_detach(uint8_t port_id, char *devname); +int rte_eth_dev_detach(uint16_t port_id, char *devname); /** * Convert a numerical speed in Mbps to a bitmap flag that can be used in @@ -1884,7 +1884,7 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex); * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, +int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf); /** @@ -1939,7 +1939,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * allocate network memory buffers from the memory pool when * initializing receive descriptors. */ -int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); @@ -1987,7 +1987,7 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, * - 0: Success, the transmit queue is correctly set up. * - -ENOMEM: Unable to allocate the transmit ring descriptors. */ -int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); @@ -2001,7 +2001,7 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, * a default of zero if the socket could not be determined. * -1 is returned is the port_id value is out of range. */ -int rte_eth_dev_socket_id(uint8_t port_id); +int rte_eth_dev_socket_id(uint16_t port_id); /** * Check if port_id of device is attached @@ -2012,7 +2012,7 @@ int rte_eth_dev_socket_id(uint8_t port_id); * - 0 if port is out of range or not attached * - 1 if device is attached */ -int rte_eth_dev_is_valid_port(uint8_t port_id); +int rte_eth_dev_is_valid_port(uint16_t port_id); /** * Start specified RX queue of a port. It is used when rx_deferred_start @@ -2029,7 +2029,7 @@ int rte_eth_dev_is_valid_port(uint8_t port_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); /** * Stop specified RX queue of a port @@ -2045,7 +2045,7 @@ int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); /** * Start TX for specified queue of a port. It is used when tx_deferred_start @@ -2062,7 +2062,7 @@ int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); /** * Stop specified TX queue of a port @@ -2078,7 +2078,7 @@ int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id); @@ -2097,7 +2097,7 @@ int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); * - 0: Success, Ethernet device started. * - <0: Error code of the driver device start function. */ -int rte_eth_dev_start(uint8_t port_id); +int rte_eth_dev_start(uint16_t port_id); /** * Stop an Ethernet device. The device can be restarted with a call to @@ -2106,7 +2106,7 @@ int rte_eth_dev_start(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_stop(uint8_t port_id); +void rte_eth_dev_stop(uint16_t port_id); /** @@ -2121,7 +2121,7 @@ void rte_eth_dev_stop(uint8_t port_id); * - 0: Success, Ethernet device linked up. * - <0: Error code of the driver device link up function. */ -int rte_eth_dev_set_link_up(uint8_t port_id); +int rte_eth_dev_set_link_up(uint16_t port_id); /** * Link down an Ethernet device. @@ -2132,7 +2132,7 @@ int rte_eth_dev_set_link_up(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_set_link_down(uint8_t port_id); +int rte_eth_dev_set_link_down(uint16_t port_id); /** * Close a stopped Ethernet device. The device cannot be restarted! @@ -2142,7 +2142,7 @@ int rte_eth_dev_set_link_down(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_close(uint8_t port_id); +void rte_eth_dev_close(uint16_t port_id); /** * Reset a Ethernet device and keep its port id. @@ -2172,7 +2172,7 @@ void rte_eth_dev_close(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_reset(uint8_t port_id); +int rte_eth_dev_reset(uint16_t port_id); /** * Enable receipt in promiscuous mode for an Ethernet device. @@ -2180,7 +2180,7 @@ int rte_eth_dev_reset(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_enable(uint8_t port_id); +void rte_eth_promiscuous_enable(uint16_t port_id); /** * Disable receipt in promiscuous mode for an Ethernet device. @@ -2188,7 +2188,7 @@ void rte_eth_promiscuous_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_disable(uint8_t port_id); +void rte_eth_promiscuous_disable(uint16_t port_id); /** * Return the value of promiscuous mode for an Ethernet device. @@ -2200,7 +2200,7 @@ void rte_eth_promiscuous_disable(uint8_t port_id); * - (0) if promiscuous is disabled. * - (-1) on error */ -int rte_eth_promiscuous_get(uint8_t port_id); +int rte_eth_promiscuous_get(uint16_t port_id); /** * Enable the receipt of any multicast frame by an Ethernet device. @@ -2208,7 +2208,7 @@ int rte_eth_promiscuous_get(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_enable(uint8_t port_id); +void rte_eth_allmulticast_enable(uint16_t port_id); /** * Disable the receipt of all multicast frames by an Ethernet device. @@ -2216,7 +2216,7 @@ void rte_eth_allmulticast_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_disable(uint8_t port_id); +void rte_eth_allmulticast_disable(uint16_t port_id); /** * Return the value of allmulticast mode for an Ethernet device. @@ -2228,7 +2228,7 @@ void rte_eth_allmulticast_disable(uint8_t port_id); * - (0) if allmulticast is disabled. * - (-1) on error */ -int rte_eth_allmulticast_get(uint8_t port_id); +int rte_eth_allmulticast_get(uint16_t port_id); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2241,7 +2241,7 @@ int rte_eth_allmulticast_get(uint8_t port_id); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2254,7 +2254,7 @@ void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the general I/O statistics of an Ethernet device. @@ -2273,7 +2273,7 @@ void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); +int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. @@ -2281,7 +2281,7 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_stats_reset(uint8_t port_id); +void rte_eth_stats_reset(uint16_t port_id); /** * Retrieve names of extended statistics of an Ethernet device. @@ -2303,7 +2303,7 @@ void rte_eth_stats_reset(uint8_t port_id); * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_names(uint8_t port_id, +int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size); @@ -2329,7 +2329,7 @@ int rte_eth_xstats_get_names(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n); /** @@ -2355,7 +2355,7 @@ int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, * - A negative value on error (invalid port id). */ int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids); @@ -2382,7 +2382,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, +int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, uint64_t *values, unsigned int n); /** @@ -2402,7 +2402,7 @@ int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, * -ENODEV for invalid port_id, * -EINVAL if the xstat_name doesn't exist in port_id */ -int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id); /** @@ -2411,7 +2411,7 @@ int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_xstats_reset(uint8_t port_id); +void rte_eth_xstats_reset(uint16_t port_id); /** * Set a mapping for the specified transmit queue to the specified per-queue @@ -2430,7 +2430,7 @@ void rte_eth_xstats_reset(uint8_t port_id); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx); /** @@ -2450,7 +2450,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx); @@ -2463,7 +2463,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. */ -void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -2474,7 +2474,7 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); * A pointer to a structure of type *rte_eth_dev_info* to be filled with * the contextual information of the Ethernet device. */ -void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); +void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info); /** * Retrieve the firmware version of a device. @@ -2494,7 +2494,7 @@ void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); * - (>0) if *fw_size* is not enough to store firmware version, return * the size of the non truncated string. */ -int rte_eth_dev_fw_version_get(uint8_t port_id, +int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size); /** @@ -2535,7 +2535,7 @@ int rte_eth_dev_fw_version_get(uint8_t port_id, * count of supported ptypes will be returned. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num); /** @@ -2549,7 +2549,7 @@ int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); +int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu); /** * Change the MTU of an Ethernet device. @@ -2565,7 +2565,7 @@ int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); * - (-EINVAL) if *mtu* invalid. * - (-EBUSY) if operation is not allowed when the port is running */ -int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); +int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu); /** * Enable/Disable hardware filtering by an Ethernet device of received @@ -2585,7 +2585,7 @@ int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); * - (-ENOSYS) if VLAN filtering on *port_id* disabled. * - (-EINVAL) if *vlan_id* > 4095. */ -int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); +int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on); /** * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. @@ -2606,7 +2606,7 @@ int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *rx_queue_id* invalid. */ -int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on); /** @@ -2625,7 +2625,7 @@ int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type); @@ -2649,7 +2649,7 @@ int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); +int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); /** * Read VLAN Offload configuration from an Ethernet device @@ -2663,7 +2663,7 @@ int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); * ETH_VLAN_EXTEND_OFFLOAD * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_vlan_offload(uint8_t port_id); +int rte_eth_dev_get_vlan_offload(uint16_t port_id); /** * Set port based TX VLAN insertion on or off. @@ -2679,7 +2679,7 @@ int rte_eth_dev_get_vlan_offload(uint8_t port_id); * - (0) if successful. * - negative if failed. */ -int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); +int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); /** * @@ -2764,7 +2764,7 @@ int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); * *rx_pkts* array. */ static inline uint16_t -rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2809,7 +2809,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, * (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) +rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2838,7 +2838,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) * - (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) +rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); @@ -2885,7 +2885,7 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) * - (-ENODEV) bad port or queue (only if compiled with debug). */ static inline int -rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2942,7 +2942,7 @@ rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, * - (-ENOTSUP) if the device does not support this function. * - (-ENODEV) bad port or queue (only if compiled with debug). */ -static inline int rte_eth_tx_descriptor_status(uint8_t port_id, +static inline int rte_eth_tx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -3026,7 +3026,7 @@ static inline int rte_eth_tx_descriptor_status(uint8_t port_id, * *tx_pkts* parameter when the transmit ring is full or has been filled up. */ static inline uint16_t -rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3115,7 +3115,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, #ifndef RTE_ETHDEV_TX_PREPARE_NOOP static inline uint16_t -rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev; @@ -3157,7 +3157,8 @@ rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, */ static inline uint16_t -rte_eth_tx_prepare(__rte_unused uint8_t port_id, __rte_unused uint16_t queue_id, +rte_eth_tx_prepare(__rte_unused uint16_t port_id, + __rte_unused uint16_t queue_id, __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { return nb_pkts; @@ -3226,7 +3227,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size); * callback is called for any packets which could not be sent. */ static inline uint16_t -rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer) { uint16_t sent; @@ -3278,7 +3279,7 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, * the rest. */ static __rte_always_inline uint16_t -rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt) { buffer->pkts[buffer->length++] = tx_pkt; @@ -3394,7 +3395,7 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, * are in use. */ int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt); +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt); /** * The eth device event type for interrupt, and maybe others in the future. @@ -3412,7 +3413,7 @@ enum rte_eth_event_type { RTE_ETH_EVENT_MAX /**< max value of this enum */ }; -typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, +typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param); /**< user application callback to be registered for interrupts */ @@ -3434,7 +3435,7 @@ typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_register(uint8_t port_id, +int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3455,7 +3456,7 @@ int rte_eth_dev_callback_register(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_unregister(uint8_t port_id, +int rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3501,7 +3502,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id); /** * When lcore wakes up from rx interrupt indicating packet coming, disable rx @@ -3522,7 +3523,7 @@ int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id); /** * RX Interrupt control per port. @@ -3541,7 +3542,7 @@ int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); +int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data); /** * RX Interrupt control per queue. @@ -3564,7 +3565,7 @@ int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data); /** @@ -3579,7 +3580,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_on(uint8_t port_id); +int rte_eth_led_on(uint16_t port_id); /** * Turn off the LED on the Ethernet device. @@ -3593,7 +3594,7 @@ int rte_eth_led_on(uint8_t port_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_off(uint8_t port_id); +int rte_eth_led_off(uint16_t port_id); /** * Get current status of the Ethernet link flow control for Ethernet device @@ -3607,7 +3608,7 @@ int rte_eth_led_off(uint8_t port_id); * - (-ENOTSUP) if hardware doesn't support flow control. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_flow_ctrl_get(uint8_t port_id, +int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3624,7 +3625,7 @@ int rte_eth_dev_flow_ctrl_get(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3642,7 +3643,7 @@ int rte_eth_dev_flow_ctrl_set(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf); /** @@ -3663,7 +3664,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t pool); /** @@ -3679,7 +3680,7 @@ int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EADDRINUSE) if attempting to remove the default MAC address */ -int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr); /** * Set the default MAC address. @@ -3694,8 +3695,8 @@ int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); - +int rte_eth_dev_default_mac_addr_set(uint16_t port, + struct ether_addr *mac_addr); /** * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device. @@ -3712,7 +3713,7 @@ int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_update(uint8_t port, +int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3731,7 +3732,7 @@ int rte_eth_dev_rss_reta_update(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_query(uint8_t port, +int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3753,8 +3754,8 @@ int rte_eth_dev_rss_reta_query(uint8_t port, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, - uint8_t on); +int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, + uint8_t on); /** * Updates all unicast hash bitmaps for receiving packet with any Unicast @@ -3773,7 +3774,7 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); +int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on); /** * Set a traffic mirroring rule on an Ethernet device @@ -3796,7 +3797,7 @@ int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if the mr_conf information is not correct. */ -int rte_eth_mirror_rule_set(uint8_t port_id, +int rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on); @@ -3814,7 +3815,7 @@ int rte_eth_mirror_rule_set(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_mirror_rule_reset(uint8_t port_id, +int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id); /** @@ -3832,7 +3833,7 @@ int rte_eth_mirror_rule_reset(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate); /** @@ -3848,7 +3849,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_hash_update(uint8_t port_id, +int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3865,7 +3866,7 @@ int rte_eth_dev_rss_hash_update(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support RSS. */ int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3886,7 +3887,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3908,7 +3909,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3924,7 +3925,8 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support this filter type. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type); +int rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type); /** * Take operations to assigned filter type on an Ethernet device. @@ -3944,7 +3946,7 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg); /** @@ -3959,7 +3961,7 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, * - (-ENODEV) if port identifier is invalid. * - (-ENOTSUP) if hardware doesn't support. */ -int rte_eth_dev_get_dcb_info(uint8_t port_id, +int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info); /** @@ -3986,7 +3988,7 @@ int rte_eth_dev_get_dcb_info(uint8_t port_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4014,7 +4016,7 @@ void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4041,7 +4043,7 @@ void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param); /** @@ -4074,7 +4076,7 @@ void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4107,7 +4109,7 @@ int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4127,7 +4129,7 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); /** @@ -4147,7 +4149,7 @@ int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo); /** @@ -4166,7 +4168,7 @@ int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); +int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info); /** * Retrieve size of device EEPROM @@ -4179,7 +4181,7 @@ int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom_length(uint8_t port_id); +int rte_eth_dev_get_eeprom_length(uint16_t port_id); /** * Retrieve EEPROM and EEPROM attribute @@ -4195,7 +4197,7 @@ int rte_eth_dev_get_eeprom_length(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Program EEPROM with provided data @@ -4211,7 +4213,7 @@ int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Set the list of multicast addresses to filter on an Ethernet device. @@ -4230,7 +4232,7 @@ int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering. * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ -int rte_eth_dev_set_mc_addr_list(uint8_t port_id, +int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr); @@ -4245,7 +4247,7 @@ int rte_eth_dev_set_mc_addr_list(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_enable(uint8_t port_id); +int rte_eth_timesync_enable(uint16_t port_id); /** * Disable IEEE1588/802.1AS timestamping for an Ethernet device. @@ -4258,7 +4260,7 @@ int rte_eth_timesync_enable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_disable(uint8_t port_id); +int rte_eth_timesync_disable(uint16_t port_id); /** * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device. @@ -4277,7 +4279,7 @@ int rte_eth_timesync_disable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags); /** @@ -4294,7 +4296,7 @@ int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp); /** @@ -4313,7 +4315,7 @@ int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); +int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta); /** * Read the time from the timesync clock on an Ethernet device. @@ -4329,7 +4331,7 @@ int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); * @return * - 0: Success. */ -int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); +int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time); /** * Set the time of the timesync clock on an Ethernet device. @@ -4348,7 +4350,7 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time); +int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time); /** * Create memzone for HW rings. @@ -4389,7 +4391,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel); /** @@ -4416,7 +4418,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en); @@ -4434,7 +4436,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, * - (-ENODEV or -EINVAL) on failure. */ int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id); /** * Get the device name from port id @@ -4448,7 +4450,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); * - (-EINVAL) on failure. */ int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name); /** * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from @@ -4466,7 +4468,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); * - (0) if successful. * - (-ENOTSUP, -ENODEV or -EINVAL) on failure. */ -int rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc); diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c index 2001fbbf4..95d9ee007 100644 --- a/lib/librte_ether/rte_flow.c +++ b/lib/librte_ether/rte_flow.c @@ -108,7 +108,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = { /* Get generic flow operations structure from a port. */ const struct rte_flow_ops * -rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error) +rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops; diff --git a/lib/librte_ether/rte_flow_driver.h b/lib/librte_ether/rte_flow_driver.h index 4d95391d8..8573cefa3 100644 --- a/lib/librte_ether/rte_flow_driver.h +++ b/lib/librte_ether/rte_flow_driver.h @@ -178,7 +178,7 @@ rte_flow_error_set(struct rte_flow_error *error, * additional details. */ const struct rte_flow_ops * -rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error); +rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error); #ifdef __cplusplus } diff --git a/lib/librte_ether/rte_tm.c b/lib/librte_ether/rte_tm.c index 71679650e..ceac34115 100644 --- a/lib/librte_ether/rte_tm.c +++ b/lib/librte_ether/rte_tm.c @@ -40,7 +40,7 @@ /* Get generic traffic manager operations structure from a port. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_tm_ops *ops; @@ -87,7 +87,7 @@ rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) /* Get number of leaf nodes */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error) { @@ -113,7 +113,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, /* Check node type (leaf or non-leaf) */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error) @@ -124,7 +124,7 @@ rte_tm_node_type_get(uint8_t port_id, } /* Get capabilities */ -int rte_tm_capabilities_get(uint8_t port_id, +int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error) { @@ -134,7 +134,7 @@ int rte_tm_capabilities_get(uint8_t port_id, } /* Get level capabilities */ -int rte_tm_level_capabilities_get(uint8_t port_id, +int rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error) @@ -145,7 +145,7 @@ int rte_tm_level_capabilities_get(uint8_t port_id, } /* Get node capabilities */ -int rte_tm_node_capabilities_get(uint8_t port_id, +int rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error) @@ -156,7 +156,7 @@ int rte_tm_node_capabilities_get(uint8_t port_id, } /* Add WRED profile */ -int rte_tm_wred_profile_add(uint8_t port_id, +int rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error) @@ -167,7 +167,7 @@ int rte_tm_wred_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_wred_profile_delete(uint8_t port_id, +int rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error) { @@ -177,7 +177,7 @@ int rte_tm_wred_profile_delete(uint8_t port_id, } /* Add/update shared WRED context */ -int rte_tm_shared_wred_context_add_update(uint8_t port_id, +int rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -188,7 +188,7 @@ int rte_tm_shared_wred_context_add_update(uint8_t port_id, } /* Delete shared WRED context */ -int rte_tm_shared_wred_context_delete(uint8_t port_id, +int rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error) { @@ -198,7 +198,7 @@ int rte_tm_shared_wred_context_delete(uint8_t port_id, } /* Add shaper profile */ -int rte_tm_shaper_profile_add(uint8_t port_id, +int rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error) @@ -209,7 +209,7 @@ int rte_tm_shaper_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_shaper_profile_delete(uint8_t port_id, +int rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error) { @@ -219,7 +219,7 @@ int rte_tm_shaper_profile_delete(uint8_t port_id, } /* Add shared shaper */ -int rte_tm_shared_shaper_add_update(uint8_t port_id, +int rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -230,7 +230,7 @@ int rte_tm_shared_shaper_add_update(uint8_t port_id, } /* Delete shared shaper */ -int rte_tm_shared_shaper_delete(uint8_t port_id, +int rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error) { @@ -240,7 +240,7 @@ int rte_tm_shared_shaper_delete(uint8_t port_id, } /* Add node to port traffic manager hierarchy */ -int rte_tm_node_add(uint8_t port_id, +int rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -256,7 +256,7 @@ int rte_tm_node_add(uint8_t port_id, } /* Delete node from traffic manager hierarchy */ -int rte_tm_node_delete(uint8_t port_id, +int rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -266,7 +266,7 @@ int rte_tm_node_delete(uint8_t port_id, } /* Suspend node */ -int rte_tm_node_suspend(uint8_t port_id, +int rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -276,7 +276,7 @@ int rte_tm_node_suspend(uint8_t port_id, } /* Resume node */ -int rte_tm_node_resume(uint8_t port_id, +int rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -286,7 +286,7 @@ int rte_tm_node_resume(uint8_t port_id, } /* Commit the initial port traffic manager hierarchy */ -int rte_tm_hierarchy_commit(uint8_t port_id, +int rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error) { @@ -296,7 +296,7 @@ int rte_tm_hierarchy_commit(uint8_t port_id, } /* Update node parent */ -int rte_tm_node_parent_update(uint8_t port_id, +int rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -309,7 +309,7 @@ int rte_tm_node_parent_update(uint8_t port_id, } /* Update node private shaper */ -int rte_tm_node_shaper_update(uint8_t port_id, +int rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -320,7 +320,7 @@ int rte_tm_node_shaper_update(uint8_t port_id, } /* Update node shared shapers */ -int rte_tm_node_shared_shaper_update(uint8_t port_id, +int rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -332,7 +332,7 @@ int rte_tm_node_shared_shaper_update(uint8_t port_id, } /* Update node stats */ -int rte_tm_node_stats_update(uint8_t port_id, +int rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error) @@ -343,7 +343,7 @@ int rte_tm_node_stats_update(uint8_t port_id, } /* Update WFQ weight mode */ -int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -355,7 +355,7 @@ int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, } /* Update node congestion management mode */ -int rte_tm_node_cman_update(uint8_t port_id, +int rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error) @@ -366,7 +366,7 @@ int rte_tm_node_cman_update(uint8_t port_id, } /* Update node private WRED context */ -int rte_tm_node_wred_context_update(uint8_t port_id, +int rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -377,7 +377,7 @@ int rte_tm_node_wred_context_update(uint8_t port_id, } /* Update node shared WRED context */ -int rte_tm_node_shared_wred_context_update(uint8_t port_id, +int rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -389,7 +389,7 @@ int rte_tm_node_shared_wred_context_update(uint8_t port_id, } /* Read and/or clear stats counters for specific node */ -int rte_tm_node_stats_read(uint8_t port_id, +int rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -402,7 +402,7 @@ int rte_tm_node_stats_read(uint8_t port_id, } /* Packet marking - VLAN DEI */ -int rte_tm_mark_vlan_dei(uint8_t port_id, +int rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -414,7 +414,7 @@ int rte_tm_mark_vlan_dei(uint8_t port_id, } /* Packet marking - IPv4/IPv6 ECN */ -int rte_tm_mark_ip_ecn(uint8_t port_id, +int rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -426,7 +426,7 @@ int rte_tm_mark_ip_ecn(uint8_t port_id, } /* Packet marking - IPv4/IPv6 DSCP */ -int rte_tm_mark_ip_dscp(uint8_t port_id, +int rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm.h b/lib/librte_ether/rte_tm.h index ebbfa1eec..2b25a8715 100644 --- a/lib/librte_ether/rte_tm.h +++ b/lib/librte_ether/rte_tm.h @@ -1040,7 +1040,7 @@ struct rte_tm_error { * 0 on success, non-zero error code otherwise. */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error); @@ -1064,7 +1064,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error); @@ -1082,7 +1082,7 @@ rte_tm_node_type_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_capabilities_get(uint8_t port_id, +rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error); @@ -1102,7 +1102,7 @@ rte_tm_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_level_capabilities_get(uint8_t port_id, +rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error); @@ -1122,7 +1122,7 @@ rte_tm_level_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_capabilities_get(uint8_t port_id, +rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error); @@ -1147,7 +1147,7 @@ rte_tm_node_capabilities_get(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_add(uint8_t port_id, +rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error); @@ -1170,7 +1170,7 @@ rte_tm_wred_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_delete(uint8_t port_id, +rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1201,7 +1201,7 @@ rte_tm_wred_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_add_update(uint8_t port_id, +rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1225,7 +1225,7 @@ rte_tm_shared_wred_context_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_delete(uint8_t port_id, +rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error); @@ -1249,7 +1249,7 @@ rte_tm_shared_wred_context_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_add(uint8_t port_id, +rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error); @@ -1272,7 +1272,7 @@ rte_tm_shaper_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_delete(uint8_t port_id, +rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1301,7 +1301,7 @@ rte_tm_shaper_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_add_update(uint8_t port_id, +rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1324,7 +1324,7 @@ rte_tm_shared_shaper_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_delete(uint8_t port_id, +rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error); @@ -1392,7 +1392,7 @@ rte_tm_shared_shaper_delete(uint8_t port_id, * @see struct rte_tm_capabilities */ int -rte_tm_node_add(uint8_t port_id, +rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1425,7 +1425,7 @@ rte_tm_node_add(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_ADD_DELETE */ int -rte_tm_node_delete(uint8_t port_id, +rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1449,7 +1449,7 @@ rte_tm_node_delete(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_suspend(uint8_t port_id, +rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1472,7 +1472,7 @@ rte_tm_node_suspend(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_resume(uint8_t port_id, +rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1513,7 +1513,7 @@ rte_tm_node_resume(uint8_t port_id, * @see rte_tm_node_delete() */ int -rte_tm_hierarchy_commit(uint8_t port_id, +rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error); @@ -1549,7 +1549,7 @@ rte_tm_hierarchy_commit(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_PARENT_CHANGE_LEVEL */ int -rte_tm_node_parent_update(uint8_t port_id, +rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1578,7 +1578,7 @@ rte_tm_node_parent_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_private_n_max */ int -rte_tm_node_shaper_update(uint8_t port_id, +rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1605,7 +1605,7 @@ rte_tm_node_shaper_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_node_shared_shaper_update(uint8_t port_id, +rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -1632,7 +1632,7 @@ rte_tm_node_shared_shaper_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_STATS */ int -rte_tm_node_stats_update(uint8_t port_id, +rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error); @@ -1660,7 +1660,7 @@ rte_tm_node_stats_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_N_SP_PRIORITIES */ int -rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -1683,7 +1683,7 @@ rte_tm_node_wfq_weight_mode_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_CMAN */ int -rte_tm_node_cman_update(uint8_t port_id, +rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error); @@ -1707,7 +1707,7 @@ rte_tm_node_cman_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_private_n_max */ int -rte_tm_node_wred_context_update(uint8_t port_id, +rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1732,7 +1732,7 @@ rte_tm_node_wred_context_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_node_shared_wred_context_update(uint8_t port_id, +rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -1764,7 +1764,7 @@ rte_tm_node_shared_wred_context_update(uint8_t port_id, * @see enum rte_tm_stats_type */ int -rte_tm_node_stats_read(uint8_t port_id, +rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -1801,7 +1801,7 @@ rte_tm_node_stats_read(uint8_t port_id, * @see struct rte_tm_capabilities::mark_vlan_dei_supported */ int -rte_tm_mark_vlan_dei(uint8_t port_id, +rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1851,7 +1851,7 @@ rte_tm_mark_vlan_dei(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_ecn_sctp_supported */ int -rte_tm_mark_ip_ecn(uint8_t port_id, +rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1899,7 +1899,7 @@ rte_tm_mark_ip_ecn(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_dscp_supported */ int -rte_tm_mark_ip_dscp(uint8_t port_id, +rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm_driver.h b/lib/librte_ether/rte_tm_driver.h index a5b698fe0..b2e8ccf80 100644 --- a/lib/librte_ether/rte_tm_driver.h +++ b/lib/librte_ether/rte_tm_driver.h @@ -357,7 +357,7 @@ rte_tm_error_set(struct rte_tm_error *error, * success, NULL otherwise. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error); +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error); #ifdef __cplusplus } diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile index 70f1ca8f6..43c115ddd 100644 --- a/lib/librte_kni/Makefile +++ b/lib/librte_kni/Makefile @@ -38,7 +38,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing EXPORT_MAP := rte_kni_version.map -LIBABIVER := 2 +LIBABIVER := 3 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 37deb4727..87812cd55 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -63,13 +63,13 @@ struct rte_mbuf; * Structure which has the function pointers for KNI interface. */ struct rte_kni_ops { - uint8_t port_id; /* Port ID */ + uint16_t port_id; /* Port ID */ /* Pointer to function of changing MTU */ - int (*change_mtu)(uint8_t port_id, unsigned new_mtu); + int (*change_mtu)(uint16_t port_id, unsigned int new_mtu); /* Pointer to function of configuring network interface */ - int (*config_network_if)(uint8_t port_id, uint8_t if_up); + int (*config_network_if)(uint16_t port_id, uint8_t if_up); }; /** diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c index ce029a12c..d6ad13c4e 100644 --- a/lib/librte_latencystats/rte_latencystats.c +++ b/lib/librte_latencystats/rte_latencystats.c @@ -135,7 +135,7 @@ rte_latencystats_fill_values(struct rte_metric_value *values) } static uint16_t -add_time_stamps(uint8_t pid __rte_unused, +add_time_stamps(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -165,7 +165,7 @@ add_time_stamps(uint8_t pid __rte_unused, } static uint16_t -calc_latency(uint8_t pid __rte_unused, +calc_latency(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -226,10 +226,10 @@ rte_latencystats_init(uint64_t app_samp_intvl, rte_latency_stats_flow_type_fn user_cb) { unsigned int i; - uint8_t pid; + uint16_t pid; uint16_t qid; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const char *ptr_strings[NUM_LATENCY_STATS] = {0}; const struct rte_memzone *mz = NULL; const unsigned int flags = 0; @@ -290,11 +290,11 @@ rte_latencystats_init(uint64_t app_samp_intvl, int rte_latencystats_uninit(void) { - uint8_t pid; + uint16_t pid; uint16_t qid; int ret = 0; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); /** De register Rx/Tx callbacks */ for (pid = 0; pid < nb_ports; pid++) { diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile index 1c03bcbb7..6b21c62e5 100644 --- a/lib/librte_pdump/Makefile +++ b/lib/librte_pdump/Makefile @@ -40,7 +40,7 @@ LDLIBS += -lpthread EXPORT_MAP := rte_pdump_version.map -LIBABIVER := 1 +LIBABIVER := 2 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) := rte_pdump.c diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 729e79a36..e6182d35c 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -207,7 +207,7 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) } static uint16_t -pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_params) @@ -217,7 +217,7 @@ pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static uint16_t -pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) { pdump_copy(pkts, nb_pkts, user_params); @@ -225,7 +225,7 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static int -pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -279,7 +279,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, } static int -pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -337,7 +337,7 @@ static int set_pdump_rxtx_cbs(struct pdump_request *p) { uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue; - uint8_t port; + uint16_t port; int ret = 0; uint32_t flags; uint16_t operation; @@ -764,7 +764,7 @@ pdump_validate_flags(uint32_t flags) } static int -pdump_validate_port(uint8_t port, char *name) +pdump_validate_port(uint16_t port, char *name) { int ret = 0; @@ -828,7 +828,7 @@ pdump_prepare_client_request(char *device, uint16_t queue, } int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter) @@ -876,7 +876,7 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue, } int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags) +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags) { int ret = 0; char name[DEVICE_ID_SIZE]; diff --git a/lib/librte_pdump/rte_pdump.h b/lib/librte_pdump/rte_pdump.h index ba6e39b09..4ec0a106f 100644 --- a/lib/librte_pdump/rte_pdump.h +++ b/lib/librte_pdump/rte_pdump.h @@ -113,7 +113,7 @@ rte_pdump_uninit(void); */ int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter); @@ -136,7 +136,7 @@ rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, */ int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags); +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags); /** * Enables packet capturing on given device id and queue. diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile index 76629a13a..c2b1b2ce4 100644 --- a/lib/librte_port/Makefile +++ b/lib/librte_port/Makefile @@ -44,7 +44,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_port_version.map -LIBABIVER := 3 +LIBABIVER := 4 # # all source are stored in SRCS-y diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c index d5c5fba55..4ed10f276 100644 --- a/lib/librte_port/rte_port_ethdev.c +++ b/lib/librte_port/rte_port_ethdev.c @@ -60,7 +60,7 @@ struct rte_port_ethdev_reader { struct rte_port_in_stats stats; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -156,7 +156,7 @@ struct rte_port_ethdev_writer { uint16_t tx_buf_count; uint64_t bsz_mask; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -337,7 +337,7 @@ struct rte_port_ethdev_writer_nodrop { uint64_t bsz_mask; uint64_t n_retries; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * diff --git a/lib/librte_port/rte_port_ethdev.h b/lib/librte_port/rte_port_ethdev.h index 201a79e41..f5ed9ab2d 100644 --- a/lib/librte_port/rte_port_ethdev.h +++ b/lib/librte_port/rte_port_ethdev.h @@ -54,7 +54,7 @@ extern "C" { /** ethdev_reader port parameters */ struct rte_port_ethdev_reader_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -66,7 +66,7 @@ extern struct rte_port_in_ops rte_port_ethdev_reader_ops; /** ethdev_writer port parameters */ struct rte_port_ethdev_writer_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -82,7 +82,7 @@ extern struct rte_port_out_ops rte_port_ethdev_writer_ops; /** ethdev_writer_nodrop port parameters */ struct rte_port_ethdev_writer_nodrop_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range Zhiyong Yang @ 2017-09-21 11:49 ` Adrien Mazarguil 2017-10-06 14:34 ` Nélio Laranjeiro 0 siblings, 1 reply; 101+ messages in thread From: Adrien Mazarguil @ 2017-09-21 11:49 UTC (permalink / raw) To: Zhiyong Yang; +Cc: dev, thomas, ferruh.yigit On Thu, Sep 21, 2017 at 04:32:40PM +0800, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib and drivers > data structures, specifically rte_eth_dev_data. Modify the APIs, > drivers and app using port_id at the same time. > > Fix some checkpatch issues from the original code and remove some > unnecessary cast operations. > > release_17_11 and deprecation have been updated in the patch. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > --- <snip> > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index 7de1d1086..238a64f43 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -112,14 +112,14 @@ struct rxq { > unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ > unsigned int cqe_n:4; /* Log 2 of CQ elements. */ > unsigned int elts_n:4; /* Log 2 of Mbufs. */ > - unsigned int port_id:8; > unsigned int rss_hash:1; /* RSS hash result is enabled. */ > unsigned int mark:1; /* Marked flow available on the queue. */ > unsigned int pending_err:1; /* CQE error needs to be handled. */ > unsigned int trim_elts:1; /* Whether elts needs clean-up. */ > - unsigned int :6; /* Remaining bits. */ > + unsigned int :14; /* Remaining bits. */ > volatile uint32_t *rq_db; > volatile uint32_t *cq_db; > + uint16_t port_id; > uint16_t rq_ci; > uint16_t rq_pi; > uint16_t cq_ci; <snip> Can't speak for the other PMDs, but it looks OK as far as mlx4/mlx5 are affected. This is my ack for this specific change: Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> -- Adrien Mazarguil 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range 2017-09-21 11:49 ` Adrien Mazarguil @ 2017-10-06 14:34 ` Nélio Laranjeiro 0 siblings, 0 replies; 101+ messages in thread From: Nélio Laranjeiro @ 2017-10-06 14:34 UTC (permalink / raw) To: ferruh.yigit; +Cc: Zhiyong Yang, dev, thomas, Adrien Mazarguil On Thu, Sep 21, 2017 at 01:49:28PM +0200, Adrien Mazarguil wrote: > On Thu, Sep 21, 2017 at 04:32:40PM +0800, Zhiyong Yang wrote: > > Extend port_id definition from uint8_t to uint16_t in lib and drivers > > data structures, specifically rte_eth_dev_data. Modify the APIs, > > drivers and app using port_id at the same time. > > > > Fix some checkpatch issues from the original code and remove some > > unnecessary cast operations. > > > > release_17_11 and deprecation have been updated in the patch. > > > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > > --- > <snip> > > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > > index 7de1d1086..238a64f43 100644 > > --- a/drivers/net/mlx5/mlx5_rxtx.h > > +++ b/drivers/net/mlx5/mlx5_rxtx.h > > @@ -112,14 +112,14 @@ struct rxq { > > unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ > > unsigned int cqe_n:4; /* Log 2 of CQ elements. */ > > unsigned int elts_n:4; /* Log 2 of Mbufs. */ > > - unsigned int port_id:8; > > unsigned int rss_hash:1; /* RSS hash result is enabled. */ > > unsigned int mark:1; /* Marked flow available on the queue. */ > > unsigned int pending_err:1; /* CQE error needs to be handled. */ > > unsigned int trim_elts:1; /* Whether elts needs clean-up. */ > > - unsigned int :6; /* Remaining bits. */ > > + unsigned int :14; /* Remaining bits. */ > > volatile uint32_t *rq_db; > > volatile uint32_t *cq_db; > > + uint16_t port_id; > > uint16_t rq_ci; > > uint16_t rq_pi; > > uint16_t cq_ci; > <snip> > > Can't speak for the other PMDs, but it looks OK as far as mlx4/mlx5 are > affected. This is my ack for this specific change: > > Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> > > -- > Adrien Mazarguil > 6WIND Ferruh, the patch applied on master-net does not match this version of mlx5_rxtx.h causing a performance issue. Regards, -- Nélio Laranjeiro 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v4 3/5] examples: increase port_id range 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range Zhiyong Yang @ 2017-09-21 8:32 ` Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 4/5] test: " Zhiyong Yang ` (2 subsequent siblings) 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-21 8:32 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, Zhiyong Yang Modify port_id related code in examples accordingly since port_id definition in lib and pmd changes. Fix some original checkpatch issues and remove some unnecessary cast at the same time. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- examples/bond/main.c | 16 +-- examples/distributor/main.c | 26 ++-- examples/exception_path/main.c | 35 +++-- examples/ip_fragmentation/main.c | 33 ++--- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 ++--- examples/ipv4_multicast/main.c | 30 ++--- examples/kni/main.c | 30 +++-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 ++--- examples/l2fwd-keepalive/main.c | 50 +++---- examples/l2fwd/main.c | 47 +++---- examples/l3fwd-acl/main.c | 9 +- examples/l3fwd-power/main.c | 60 +++++---- examples/l3fwd-vf/main.c | 50 +++---- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 15 ++- examples/l3fwd/l3fwd_lpm.h | 4 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 ++--- examples/link_status_interrupt/main.c | 9 +- examples/load_balancer/config.c | 14 +- examples/load_balancer/init.c | 34 +++-- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 17 +-- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 23 ++-- examples/netmap_compat/lib/compat_netmap.c | 52 ++++---- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +-- examples/performance-thread/l3fwd-thread/main.c | 143 +++++++++++---------- examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +++-- examples/qos_sched/main.c | 14 +- examples/qos_sched/main.h | 24 ++-- examples/qos_sched/stats.c | 16 ++- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- 54 files changed, 551 insertions(+), 520 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index 2d019d433..cb55552c2 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -141,10 +141,10 @@ addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], \ addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]) -uint8_t slaves[RTE_MAX_ETHPORTS]; -uint8_t slaves_count; +uint16_t slaves[RTE_MAX_ETHPORTS]; +uint16_t slaves_count; -static uint8_t BOND_PORT = 0xff; +static uint16_t BOND_PORT = 0xffff; static struct rte_mempool *mbuf_pool; @@ -171,7 +171,7 @@ static struct rte_eth_conf port_conf = { }; static void -slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) +slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) { int retval; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; @@ -215,7 +215,7 @@ slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) struct ether_addr addr; rte_eth_macaddr_get(portid, &addr); - printf("Port %u MAC: ", (unsigned)portid); + printf("Port %u MAC: ", portid); PRINT_MAC(addr); printf("\n"); } @@ -234,7 +234,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "Faled to create bond port\n"); - BOND_PORT = (uint8_t)retval; + BOND_PORT = retval; retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); if (retval != 0) @@ -675,10 +675,10 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result, struct cmdline *cl, __attribute__((unused)) void *data) { - uint8_t slaves[16] = {0}; + uint16_t slaves[16] = {0}; uint8_t len = 16; struct ether_addr addr; - uint8_t i = 0; + uint16_t i = 0; while (i < slaves_count) { rte_eth_macaddr_get(i, &addr); diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 87603d039..108efc8a6 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -132,7 +132,7 @@ static void print_stats(void); * 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_conf port_conf = port_conf_default; const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1; @@ -175,13 +175,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) struct rte_eth_link link; rte_eth_link_get_nowait(port, &link); while (!link.link_status) { - printf("Waiting for Link up on port %"PRIu8"\n", port); + printf("Waiting for Link up on port %"PRIu16"\n", port); sleep(1); rte_eth_link_get_nowait(port, &link); } if (!link.link_status) { - printf("Link down on port %"PRIu8"\n", port); + printf("Link down on port %"PRIu16"\n", port); return 0; } @@ -189,7 +189,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -210,7 +210,7 @@ struct lcore_params { static int lcore_rx(struct lcore_params *p) { - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); uint8_t port; struct rte_mbuf *bufs[BURST_SIZE*2]; @@ -312,9 +312,9 @@ flush_one_port(struct output_buffer *outbuf, uint8_t outp) } static inline void -flush_all_ports(struct output_buffer *tx_buffers, uint8_t nb_ports) +flush_all_ports(struct output_buffer *tx_buffers, uint16_t nb_ports) { - uint8_t outp; + uint16_t outp; for (outp = 0; outp < nb_ports; outp++) { /* skip ports that are not enabled */ @@ -384,9 +384,9 @@ static int lcore_tx(struct rte_ring *in_r) { static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS]; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); - uint8_t port; + uint16_t port; for (port = 0; port < nb_ports; port++) { /* skip ports that are not enabled */ @@ -668,8 +668,8 @@ main(int argc, char *argv[]) struct rte_ring *rx_dist_ring; unsigned lcore_id, worker_id = 0; unsigned nb_ports; - uint8_t portid; - uint8_t nb_ports_available; + uint16_t portid; + uint16_t nb_ports_available; uint64_t t, freq; /* catch ctrl-c so we can print on exit */ @@ -719,10 +719,10 @@ main(int argc, char *argv[]) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) portid); + printf("Initializing port %u... done\n", portid); if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", + rte_exit(EXIT_FAILURE, "Cannot initialize port %u\n", portid); } diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index e551e6d11..c85a86c10 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -135,7 +135,7 @@ static uint64_t input_cores_mask = 0; static uint64_t output_cores_mask = 0; /* Array storing port_id that is associated with each lcore */ -static uint8_t port_ids[RTE_MAX_LCORE]; +static uint16_t port_ids[RTE_MAX_LCORE]; /* Structure type for recording lcore-specific stats */ struct stats { @@ -360,8 +360,8 @@ static void setup_port_lcore_affinities(void) { unsigned long i; - uint8_t tx_port = 0; - uint8_t rx_port = 0; + uint16_t tx_port = 0; + uint16_t rx_port = 0; /* Setup port_ids[] array, and check masks were ok */ RTE_LCORE_FOREACH(i) { @@ -451,17 +451,16 @@ init_port(uint8_t port) uint16_t nb_txd = NB_TXD; /* Initialise device and RX/TX queues */ - PRINT_INFO("Initialising port %u ...", (unsigned)port); + PRINT_INFO("Initialising port %u ...", port); fflush(stdout); ret = rte_eth_dev_configure(port, 1, 1, &port_conf); if (ret < 0) - FATAL_ERROR("Could not configure port%u (%d)", - (unsigned)port, ret); + FATAL_ERROR("Could not configure port%u (%d)", port, ret); ret = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd); if (ret < 0) FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, rte_eth_dev_socket_id(port), @@ -469,29 +468,30 @@ init_port(uint8_t port) pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_tx_queue_setup(port, 0, nb_txd, rte_eth_dev_socket_id(port), NULL); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_dev_start(port); if (ret < 0) - FATAL_ERROR("Could not start port%u (%d)", (unsigned)port, ret); + FATAL_ERROR("Could not start port%u (%d)", port, ret); rte_eth_promiscuous_enable(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"); @@ -506,14 +506,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 */ @@ -546,7 +545,7 @@ main(int argc, char** argv) { int ret; unsigned i,high_port; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; /* Associate signal_hanlder function with USR signals */ signal(SIGUSR1, signal_handler); diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8c0e17911..de252760f 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -154,7 +154,7 @@ struct rx_queue { struct rte_mempool *indirect_pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; #define MAX_RX_QUEUE_PER_LCORE 16 @@ -240,7 +240,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -261,11 +261,12 @@ send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) static inline void l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, - uint8_t queueid, uint8_t port_in) + uint8_t queueid, uint16_t port_in) { struct rx_queue *rxq; uint32_t i, len, next_hop; - uint8_t port_out, ipv6; + uint8_t ipv6; + uint16_t port_out; int32_t len2; ipv6 = 0; @@ -403,7 +404,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -423,7 +424,7 @@ main_loop(__attribute__((unused)) void *dummy) portid = qconf->rx_queue_list[i].portid; RTE_LOG(INFO, IP_FRAG, " -- lcoreid=%u portid=%d\n", lcore_id, - (int) portid); + portid); } while (1) { @@ -600,11 +601,12 @@ print_ethaddr(const char *name, 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"); @@ -619,14 +621,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 */ @@ -708,7 +709,7 @@ parse_ptype(struct rte_mbuf *m) /* callback function to detect packet type for a queue of a port */ static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -876,7 +877,7 @@ main(int argc, char **argv) uint16_t queueid = 0; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1035,7 +1036,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - 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/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 7cde49a47..ca59baf40 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -1236,7 +1236,7 @@ app_init_tap(struct app_params *app) #ifdef RTE_LIBRTE_KNI 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; if (port_id >= rte_eth_dev_count()) @@ -1250,7 +1250,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) { } static int -kni_change_mtu(uint8_t port_id, unsigned new_mtu) { +kni_change_mtu(uint16_t port_id, unsigned int new_mtu) { int ret; if (port_id >= rte_eth_dev_count()) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index e62636cb4..cadf4c5bd 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -166,7 +166,7 @@ struct rx_queue { struct rte_mempool *pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; struct tx_lcore_stat { @@ -277,7 +277,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; * send burst of packets on an output interface. */ static inline uint32_t -send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint16_t port) { uint32_t fill, len, k, n; struct mbuf_table *txmb; @@ -307,7 +307,7 @@ send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) /* 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 fill, lcore_id, len; struct lcore_queue_conf *qconf; @@ -337,7 +337,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) } static inline void -reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, +reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct lcore_queue_conf *qconf, uint64_t tms) { struct ether_hdr *eth_hdr; @@ -346,7 +346,7 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, struct rx_queue *rxq; void *d_addr_bytes; uint32_t next_hop; - uint8_t dst_port; + uint16_t dst_port; rxq = &qconf->rx_queue_list[queue]; @@ -454,7 +454,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t diff_tsc, cur_tsc, prev_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -473,7 +473,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].portid; - RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%hhu\n", lcore_id, + RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%u\n", lcore_id, portid); } @@ -732,11 +732,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"); @@ -751,14 +752,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 */ @@ -987,7 +987,7 @@ queue_dump_stat(void) qconf = &lcore_queue_conf[lcore]; for (i = 0; i < qconf->n_rx_queue; i++) { - fprintf(stdout, " -- lcoreid=%u portid=%hhu " + fprintf(stdout, " -- lcoreid=%u portid=%u " "frag tbl stat:\n", lcore, qconf->rx_queue_list[i].portid); rte_ip_frag_table_statistics_dump(stdout, @@ -1024,7 +1024,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1177,7 +1177,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); signal(SIGUSR1, signal_handler); signal(SIGTERM, signal_handler); diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 9a13d3530..1b6feae3e 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -116,7 +116,7 @@ static struct ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; -static uint8_t nb_ports = 0; +static uint16_t nb_ports; static int rx_queue_per_lcore = 1; @@ -195,7 +195,7 @@ static struct mcast_group_params mcast_group_table[] = { /* Send burst of packets on an output interface */ static void -send_burst(struct lcore_queue_conf *qconf, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t port) { struct rte_mbuf **m_table; uint16_t n, queueid; @@ -312,7 +312,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) */ static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, - struct lcore_queue_conf *qconf, uint8_t port) + struct lcore_queue_conf *qconf, uint16_t port) { struct ether_hdr *ethdr; uint16_t len; @@ -343,7 +343,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) struct ipv4_hdr *iphdr; uint32_t dest_addr, port_mask, port_num, use_clone; int32_t hash; - uint8_t port; + uint16_t port; union { uint64_t as_int; struct ether_addr as_addr; @@ -407,7 +407,7 @@ static inline void send_timeout_burst(struct lcore_queue_conf *qconf) { uint64_t cur_tsc; - uint8_t portid; + uint16_t portid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; cur_tsc = rte_rdtsc(); @@ -428,7 +428,7 @@ main_loop(__rte_unused void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; unsigned lcore_id; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; lcore_id = rte_lcore_id(); @@ -448,7 +448,7 @@ main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i]; RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%d\n", - lcore_id, (int) portid); + lcore_id, portid); } while (1) { @@ -610,11 +610,12 @@ init_mcast_hash(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -629,14 +630,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 */ @@ -673,7 +673,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/kni/main.c b/examples/kni/main.c index e3bc2fb78..c2c9e04d3 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -110,7 +110,7 @@ * Structure of port parameters */ struct kni_port_params { - uint8_t port_id;/* Port ID */ + uint16_t port_id;/* Port ID */ unsigned lcore_rx; /* lcore ID for RX */ unsigned lcore_tx; /* lcore ID for TX */ uint32_t nb_lcore_k; /* Number of lcores for KNI multi kernel threads */ @@ -162,8 +162,8 @@ struct kni_interface_stats { /* kni device statistics array */ static struct kni_interface_stats kni_stats[RTE_MAX_ETHPORTS]; -static int kni_change_mtu(uint8_t port_id, unsigned new_mtu); -static int kni_config_network_interface(uint8_t port_id, uint8_t if_up); +static int kni_change_mtu(uint16_t port_id, unsigned int new_mtu); +static int kni_config_network_interface(uint16_t port_id, uint8_t if_up); static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); @@ -171,7 +171,7 @@ static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); static void print_stats(void) { - uint8_t i; + uint16_t i; printf("\n**KNI example application statistics**\n" "====== ============== ============ ============ ============ ============\n" @@ -238,7 +238,8 @@ kni_burst_free_mbufs(struct rte_mbuf **pkts, unsigned num) static void kni_ingress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_rx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -274,7 +275,8 @@ kni_ingress(struct kni_port_params *p) static void kni_egress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_tx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -416,7 +418,7 @@ parse_config(const char *arg) 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)); while (((p = strchr(p0, '(')) != NULL) && @@ -445,7 +447,7 @@ parse_config(const char *arg) } i = 0; - port_id = (uint8_t)int_fld[i++]; + port_id = int_fld[i++]; if (port_id >= RTE_MAX_ETHPORTS) { printf("Port ID %d could not exceed the maximum %d\n", port_id, RTE_MAX_ETHPORTS); @@ -698,7 +700,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) /* 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 int new_mtu) { int ret; struct rte_eth_conf conf; @@ -741,7 +743,7 @@ kni_change_mtu(uint8_t port_id, unsigned new_mtu) /* 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; @@ -766,7 +768,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) } static int -kni_alloc(uint8_t port_id) +kni_alloc(uint16_t port_id) { uint8_t i; struct rte_kni *kni; @@ -790,7 +792,7 @@ kni_alloc(uint8_t port_id) } else snprintf(conf.name, RTE_KNI_NAMESIZE, "vEth%u", port_id); - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; /* * The first KNI device associated to a port @@ -825,7 +827,7 @@ kni_alloc(uint8_t port_id) } static int -kni_free_kni(uint8_t port_id) +kni_free_kni(uint16_t port_id) { uint8_t i; struct kni_port_params **p = kni_port_params_array; @@ -848,7 +850,7 @@ int main(int argc, char** argv) { int ret; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; unsigned i; /* Associate signal_hanlder function with USR signals */ diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index c293bd9c9..b10ac896f 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -59,7 +59,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -106,7 +106,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -124,8 +124,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -181,7 +181,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -217,7 +217,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 989362067..9511156d8 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -776,9 +776,9 @@ main(int argc, char **argv) unsigned nb_ports_in_mask = 0; int ret; char name[RTE_JOBSTATS_NAMESIZE]; - uint8_t nb_ports; - uint8_t nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; uint8_t i; /* init EAL */ @@ -861,7 +861,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -870,24 +870,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -899,7 +899,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -907,8 +907,9 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid), NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup:err=%d, port=%u\n", + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -916,7 +917,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -924,21 +925,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done:\n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 83bc542c1..2f543d31d 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -157,7 +157,7 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, __attribute__((unused)) void *ptr_data) { uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -299,7 +299,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -479,11 +479,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"); @@ -498,14 +499,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 */ @@ -560,9 +560,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; struct sigaction signal_handler; @@ -653,7 +653,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; printf("Lcore %u: RX port %u\n", - rx_lcore_id, (unsigned) portid); + rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -662,26 +662,25 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", - (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -694,7 +693,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -704,7 +703,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -712,7 +711,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -720,21 +719,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: " "%02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 142633584..3bf3b28b1 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -304,7 +304,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -480,11 +480,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"); @@ -503,14 +504,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 */ @@ -553,9 +553,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; @@ -644,7 +644,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -653,24 +653,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]); @@ -682,7 +682,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -691,7 +691,7 @@ main(int argc, char **argv) NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -699,7 +699,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -707,21 +707,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done: \n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 8eff4de41..77f83cd6d 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -121,7 +121,7 @@ static int promiscuous_on; /**< Ports set in promiscuous mode off by default. */ static int numa_on = 1; /**< NUMA is enabled by default. */ struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -131,7 +131,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -1358,7 +1358,8 @@ 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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; int socketid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -1381,7 +1382,7 @@ 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-power/main.c b/examples/l3fwd-power/main.c index fd442f5ef..8a8f34b50 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -174,7 +174,7 @@ enum freq_scale_hint_t }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; enum freq_scale_hint_t freq_up_hint; uint32_t zero_rx_packet_count; @@ -190,7 +190,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -308,8 +308,8 @@ static lookup_struct_t *ipv6_l3fwd_lookup_struct[NB_SOCKETS]; #define IPV6_L3FWD_NUM_ROUTES \ (sizeof(ipv6_l3fwd_route_array) / sizeof(ipv6_l3fwd_route_array[0])) -static uint8_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; -static uint8_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) @@ -370,7 +370,7 @@ static struct rte_timer power_timers[RTE_MAX_LCORE]; static inline uint32_t power_idle_heuristic(uint32_t zero_rx_packet_count); static inline enum freq_scale_hint_t power_freq_scaleup_heuristic( \ - unsigned lcore_id, uint8_t port_id, uint16_t queue_id); + unsigned int lcore_id, uint16_t port_id, uint16_t queue_id); /* exit signal handler */ static void @@ -523,8 +523,8 @@ print_ipv6_key(struct ipv6_5tuple key) key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t * ipv4_l3fwd_lookup_struct) { struct ipv4_5tuple key; @@ -559,11 +559,11 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, /* 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 -get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { struct ipv6_5tuple key; @@ -599,18 +599,18 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid); } @@ -634,7 +634,7 @@ parse_ptype_one(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -648,7 +648,7 @@ cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, } static int -add_cb_parse_ptype(uint8_t portid, uint16_t queueid) +add_cb_parse_ptype(uint16_t portid, uint16_t queueid) { printf("Port %d: softly parse packet type info\n", portid); if (rte_eth_add_rx_callback(portid, queueid, cb_parse_ptype, NULL)) @@ -665,7 +665,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *d_addr_bytes; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -758,7 +758,7 @@ power_idle_heuristic(uint32_t zero_rx_packet_count) static inline enum freq_scale_hint_t power_freq_scaleup_heuristic(unsigned lcore_id, - uint8_t port_id, + uint16_t port_id, uint16_t queue_id) { /** @@ -805,7 +805,8 @@ sleep_until_rx_interrupt(int num) { struct rte_epoll_event event[num]; int n, i; - uint8_t port_id, queue_id; + uint16_t port_id; + uint8_t queue_id; void *data; RTE_LOG(INFO, L3FWD_POWER, @@ -832,7 +833,8 @@ static void turn_on_intr(struct lcore_conf *qconf) { int i; struct lcore_rx_queue *rx_queue; - uint8_t port_id, queue_id; + uint8_t queue_id; + uint16_t port_id; for (i = 0; i < qconf->n_rx_queue; ++i) { rx_queue = &(qconf->rx_queue_list[i]); @@ -848,7 +850,8 @@ static void turn_on_intr(struct lcore_conf *qconf) static int event_register(struct lcore_conf *qconf) { struct lcore_rx_queue *rx_queue; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; uint32_t data; int ret; int i; @@ -879,7 +882,8 @@ main_loop(__attribute__((unused)) void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; uint64_t prev_tsc_power = 0, cur_tsc_power, diff_tsc_power; int i, j, nb_rx; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; enum freq_scale_hint_t lcore_scaleup_hint; @@ -904,7 +908,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%hhu " + RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%u " "rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -1541,11 +1545,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; + uint8_t count, all_ports_up, print_flag = 0; + uint16_t portid; struct rte_eth_link link; printf("\nChecking link status"); @@ -1651,7 +1656,8 @@ main(int argc, char **argv) uint64_t hz; uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + uint16_t portid; uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ @@ -1751,7 +1757,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (qconf->tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Can't allocate tx buffer for port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(qconf->tx_buffer[portid], MAX_PKT_BURST); } diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 34e4a6bef..a84339115 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -155,7 +155,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -165,7 +165,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -300,7 +300,7 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE]; static rte_spinlock_t spinlock_conf[RTE_MAX_ETHPORTS] = {RTE_SPINLOCK_INITIALIZER}; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -324,7 +324,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 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; uint16_t len; @@ -396,8 +396,9 @@ print_key(struct ipv4_5tuple key) (unsigned)key.ip_dst, (unsigned)key.ip_src, key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint16_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ipv4_5tuple key; struct tcp_hdr *tcp; @@ -430,29 +431,31 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd /* Find destination port */ ret = rte_hash_lookup(l3fwd_lookup_struct, (const void *)&key); - return (uint8_t)((ret < 0)? portid : l3fwd_out_if[ret]); + return ((ret < 0) ? portid : l3fwd_out_if[ret]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint32_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(l3fwd_lookup_struct, - rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? - next_hop : portid); + return ((rte_lpm_lookup(l3fwd_lookup_struct, + rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0) ? + next_hop : portid); } #endif static inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *tmp; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -496,7 +499,8 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, 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; @@ -516,8 +520,8 @@ 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", lcore_id, - portid, queueid); + RTE_LOG(INFO, L3FWD, " --lcoreid=%u portid=%u rxqueueid=%hhu\n", + lcore_id, portid, queueid); } while (1) { @@ -624,7 +628,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; @@ -676,8 +680,8 @@ print_usage(const char *prgname) static void signal_handler(int signum) { - uint8_t portid; - uint8_t nb_ports = rte_eth_dev_count(); + uint16_t portid; + uint16_t nb_ports = rte_eth_dev_count(); /* When we receive a SIGINT signal */ if (signum == SIGINT) { @@ -749,7 +753,7 @@ parse_config(const char *q_arg) nb_lcore_params); return -1; } - lcore_params_array[nb_lcore_params].port_id = (uint8_t)int_fld[FLD_PORT]; + lcore_params_array[nb_lcore_params].port_id = int_fld[FLD_PORT]; lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = (uint8_t)int_fld[FLD_LCORE]; ++nb_lcore_params; @@ -953,11 +957,11 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t nb_lcores; uint16_t n_tx_queue; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; signal(SIGINT, signal_handler); /* init EAL */ diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index 011ba148b..4bb15943c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -83,7 +83,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -117,7 +117,7 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE]; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -139,7 +139,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 int send_single_packet(struct lcore_conf *qconf, - struct rte_mbuf *m, uint8_t port) + struct rte_mbuf *m, uint16_t port) { uint16_t len; @@ -212,11 +212,11 @@ int lpm_check_ptype(int portid); uint16_t -em_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +em_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); uint16_t -lpm_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); int diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h index 2867365d0..7002a43a4 100644 --- a/examples/l3fwd/l3fwd_common.h +++ b/examples/l3fwd/l3fwd_common.h @@ -207,7 +207,7 @@ static const struct { }; static __rte_always_inline void -send_packetsx4(struct lcore_conf *qconf, uint8_t port, struct rte_mbuf *m[], +send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 53d081bd7..df38a1362 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -628,7 +628,7 @@ em_parse_ptype(struct rte_mbuf *m) } uint16_t -em_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h index d509a1fcd..302291d71 100644 --- a/examples/l3fwd/l3fwd_em.h +++ b/examples/l3fwd/l3fwd_em.h @@ -35,12 +35,12 @@ #define __L3FWD_EM_H__ static __rte_always_inline void -l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; uint32_t tcp_or_udp; uint32_t l3_ptypes; @@ -112,7 +112,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, */ static inline void l3fwd_em_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h index 520672d51..9d7afe053 100644 --- a/examples/l3fwd/l3fwd_em_hlm.h +++ b/examples/l3fwd/l3fwd_em_hlm.h @@ -52,7 +52,7 @@ static __rte_always_inline void em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -68,7 +68,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv4_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -79,7 +79,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], static __rte_always_inline void em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -95,7 +95,7 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv6_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -106,9 +106,9 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], 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; + uint16_t next_hop; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; uint32_t tcp_or_udp; @@ -158,7 +158,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, pos; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index ff1e40355..a809e0649 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -105,7 +105,7 @@ struct rte_lpm *ipv4_l3fwd_lpm_lookup_struct[NB_SOCKETS]; struct rte_lpm6 *ipv6_l3fwd_lpm_lookup_struct[NB_SOCKETS]; static inline uint16_t -lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm *ipv4_l3fwd_lookup_struct = @@ -117,7 +117,7 @@ lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) } static inline uint16_t -lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm6 *ipv6_l3fwd_lookup_struct = @@ -130,7 +130,7 @@ lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) static __rte_always_inline uint16_t lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint8_t portid) + uint16_t portid) { struct ipv6_hdr *ipv6_hdr; struct ipv4_hdr *ipv4_hdr; @@ -162,7 +162,7 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, */ static __rte_always_inline uint16_t lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint32_t dst_ipv4, uint8_t portid) + uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -203,7 +203,8 @@ lpm_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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -225,7 +226,7 @@ lpm_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); } @@ -413,7 +414,7 @@ lpm_parse_ptype(struct rte_mbuf *m) } uint16_t -lpm_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h index 55c3e8329..53b7fc805 100644 --- a/examples/l3fwd/l3fwd_lpm.h +++ b/examples/l3fwd/l3fwd_lpm.h @@ -35,7 +35,7 @@ #define __L3FWD_LPM_H__ static __rte_always_inline void -l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; @@ -104,7 +104,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, static inline void l3fwd_lpm_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h index baedbfe84..85f314d1e 100644 --- a/examples/l3fwd/l3fwd_lpm_neon.h +++ b/examples/l3fwd/l3fwd_lpm_neon.h @@ -82,7 +82,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, int32x4_t dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -115,7 +115,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 = 0, j = 0; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h index 4e294c844..d474396ed 100644 --- a/examples/l3fwd/l3fwd_lpm_sse.h +++ b/examples/l3fwd/l3fwd_lpm_sse.h @@ -79,7 +79,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, __m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -112,7 +112,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 j; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 81995fdbe..a5e55baae 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -124,7 +124,7 @@ uint32_t hash_entry_number = HASH_ENTRY_NUMBER_DEFAULT; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -245,7 +245,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { @@ -263,7 +263,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; @@ -445,7 +445,7 @@ parse_config(const char *q_arg) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -750,11 +750,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"); @@ -773,14 +774,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 */ @@ -818,7 +818,7 @@ signal_handler(int signum) } static int -prepare_ptype_parser(uint8_t portid, uint16_t queueid) +prepare_ptype_parser(uint16_t portid, uint16_t queueid) { if (parse_ptype) { printf("Port %d: softly parse packet type info\n", portid); @@ -847,10 +847,10 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1048,7 +1048,7 @@ main(int argc, char **argv) } - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); ret = 0; /* launch per-lcore init on every lcore */ diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f4e3969a6..c83a62fa4 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -145,7 +145,7 @@ print_stats(void) { struct rte_eth_link link; uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -165,7 +165,7 @@ print_stats(void) continue; memset(&link, 0, sizeof(link)); - rte_eth_link_get_nowait((uint8_t)portid, &link); + rte_eth_link_get_nowait(portid, &link); printf("\nStatistics for port %u ------------------------------" "\nLink status: %25s" "\nLink speed: %26u" @@ -470,7 +470,7 @@ lsi_parse_args(int argc, char **argv) * int. */ static int -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, void *ret_param) { struct rte_eth_link link; @@ -498,7 +498,8 @@ check_all_ports_link_status(uint8_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"); diff --git a/examples/load_balancer/config.c b/examples/load_balancer/config.c index 503250951..ae234de82 100644 --- a/examples/load_balancer/config.c +++ b/examples/load_balancer/config.c @@ -240,7 +240,7 @@ parse_arg_rx(const char *arg) if (lp->io.rx.n_nic_queues >= APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE) { return -9; } - lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = (uint8_t) port; + lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = port; lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].queue = (uint8_t) queue; lp->io.rx.n_nic_queues ++; @@ -318,7 +318,7 @@ parse_arg_tx(const char *arg) if (lp->io.tx.n_nic_ports >= APP_MAX_NIC_TX_PORTS_PER_IO_LCORE) { return -9; } - lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = (uint8_t) port; + lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = port; lp->io.tx.n_nic_ports ++; n_tuples ++; @@ -488,7 +488,7 @@ app_check_lpm_table(void) static int app_check_every_rx_port_is_tx_enabled(void) { - uint8_t port; + uint16_t port; for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { if ((app_get_nic_rx_queues_per_port(port) > 0) && (app.nic_tx_port_mask[port] == 0)) { @@ -762,7 +762,7 @@ app_parse_args(int argc, char **argv) } int -app_get_nic_rx_queues_per_port(uint8_t port) +app_get_nic_rx_queues_per_port(uint16_t port) { uint32_t i, count; @@ -781,7 +781,7 @@ app_get_nic_rx_queues_per_port(uint8_t port) } int -app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) +app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, uint32_t *lcore_out) { uint32_t lcore; @@ -808,7 +808,7 @@ app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) } int -app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out) +app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out) { uint32_t lcore; @@ -901,7 +901,7 @@ app_print_params(void) /* Print NIC RX configuration */ printf("NIC RX ports: "); for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { - uint32_t n_rx_queues = app_get_nic_rx_queues_per_port((uint8_t) port); + uint32_t n_rx_queues = app_get_nic_rx_queues_per_port(port); if (n_rx_queues == 0) { continue; diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 717232e6e..5f9b0df2a 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -308,7 +308,7 @@ app_init_rings_tx(void) continue; } - if (app_get_lcore_for_nic_tx((uint8_t) port, &lcore_io) < 0) { + if (app_get_lcore_for_nic_tx(port, &lcore_io) < 0) { rte_panic("Algorithmic error (no I/O core to handle TX of port %u)\n", port); } @@ -359,11 +359,12 @@ app_init_rings_tx(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; uint32_t n_rx_queues, n_tx_queues; @@ -383,14 +384,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 */ @@ -422,7 +422,8 @@ app_init_nics(void) { unsigned socket; uint32_t lcore; - uint8_t port, queue; + uint16_t port; + uint8_t queue; int ret; uint32_t n_rx_queues, n_tx_queues; @@ -440,14 +441,14 @@ app_init_nics(void) } /* Init port */ - printf("Initializing NIC port %u ...\n", (unsigned) port); + printf("Initializing NIC port %u ...\n", port); ret = rte_eth_dev_configure( port, (uint8_t) n_rx_queues, (uint8_t) n_tx_queues, &port_conf); if (ret < 0) { - rte_panic("Cannot init NIC port %u (%d)\n", (unsigned) port, ret); + rte_panic("Cannot init NIC port %u (%d)\n", port, ret); } rte_eth_promiscuous_enable(port); @@ -457,7 +458,7 @@ app_init_nics(void) port, &nic_rx_ring_size, &nic_tx_ring_size); if (ret < 0) { rte_panic("Cannot adjust number of descriptors for port %u (%d)\n", - (unsigned) port, ret); + port, ret); } app.nic_rx_ring_size = nic_rx_ring_size; app.nic_tx_ring_size = nic_tx_ring_size; @@ -473,8 +474,7 @@ app_init_nics(void) pool = app.lcore_params[lcore].pool; printf("Initializing NIC port %u RX queue %u ...\n", - (unsigned) port, - (unsigned) queue); + port, queue); ret = rte_eth_rx_queue_setup( port, queue, @@ -484,9 +484,7 @@ app_init_nics(void) pool); if (ret < 0) { rte_panic("Cannot init RX queue %u for port %u (%d)\n", - (unsigned) queue, - (unsigned) port, - ret); + queue, port, ret); } } @@ -495,7 +493,7 @@ app_init_nics(void) app_get_lcore_for_nic_tx(port, &lcore); socket = rte_lcore_to_socket_id(lcore); printf("Initializing NIC port %u TX queue 0 ...\n", - (unsigned) port); + port); ret = rte_eth_tx_queue_setup( port, 0, diff --git a/examples/load_balancer/main.h b/examples/load_balancer/main.h index dc407555d..bef2ba041 100644 --- a/examples/load_balancer/main.h +++ b/examples/load_balancer/main.h @@ -248,7 +248,7 @@ struct app_lcore_params_io { struct { /* NIC */ struct { - uint8_t port; + uint16_t port; uint8_t queue; } nic_queues[APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE]; uint32_t n_nic_queues; @@ -275,7 +275,7 @@ struct app_lcore_params_io { struct rte_ring *rings[APP_MAX_NIC_PORTS][APP_MAX_WORKER_LCORES]; /* NIC */ - uint8_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; + uint16_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; uint32_t n_nic_ports; /* Internal buffers */ @@ -368,9 +368,10 @@ void app_print_usage(void); void app_init(void); int app_lcore_main_loop(void *arg); -int app_get_nic_rx_queues_per_port(uint8_t port); -int app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out); -int app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out); +int app_get_nic_rx_queues_per_port(uint16_t port); +int app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, + uint32_t *lcore_out); +int app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out); int app_is_socket_used(uint32_t socket); uint32_t app_get_lcores_io_rx(void); uint32_t app_get_lcores_worker(void); diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index e54b78510..b342e755f 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -188,7 +188,7 @@ app_lcore_io_rx( uint32_t i; for (i = 0; i < lp->rx.n_nic_queues; i ++) { - uint8_t port = lp->rx.nic_queues[i].port; + uint16_t port = lp->rx.nic_queues[i].port; uint8_t queue = lp->rx.nic_queues[i].queue; uint32_t n_mbufs, j; @@ -213,7 +213,7 @@ app_lcore_io_rx( printf("I/O RX %u in (NIC port %u): NIC drop ratio = %.2f avg burst size = %.2f\n", lcore, - (unsigned) port, + port, (double) stats.imissed / (double) (stats.imissed + stats.ipackets), ((double) lp->rx.nic_queues_count[i]) / ((double) lp->rx.nic_queues_iters[i])); lp->rx.nic_queues_iters[i] = 0; @@ -339,7 +339,7 @@ app_lcore_io_tx( uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i ++) { - uint8_t port = lp->tx.nic_ports[i]; + uint16_t port = lp->tx.nic_ports[i]; struct rte_ring *ring = lp->tx.rings[port][worker]; uint32_t n_mbufs, n_pkts; int ret; @@ -395,7 +395,7 @@ app_lcore_io_tx( printf("\t\t\tI/O TX %u out (port %u): avg burst size = %.2f\n", lcore, - (unsigned) port, + port, ((double) lp->tx.nic_ports_count[port]) / ((double) lp->tx.nic_ports_iters[port])); lp->tx.nic_ports_iters[port] = 0; lp->tx.nic_ports_count[port] = 0; @@ -418,7 +418,7 @@ app_lcore_io_tx( static inline void app_lcore_io_tx_flush(struct app_lcore_params_io *lp) { - uint8_t port; + uint16_t port; uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i++) { @@ -569,7 +569,7 @@ app_lcore_worker( if (lp->rings_out_iters[port] == APP_STATS){ printf("\t\tWorker %u out (NIC port %u): enq success rate = %.2f\n", (unsigned) lp->worker_id, - (unsigned) port, + port, ((double) lp->rings_out_count[port]) / ((double) lp->rings_out_iters[port])); lp->rings_out_iters[port] = 0; lp->rings_out_count[port] = 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 f8453e57a..59f36af08 100644 --- a/examples/multi_process/client_server_mp/mp_client/client.c +++ b/examples/multi_process/client_server_mp/mp_client/client.c @@ -74,7 +74,7 @@ static uint8_t client_id = 0; #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]; @@ -150,7 +150,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; @@ -161,7 +161,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; @@ -171,15 +171,16 @@ configure_tx_buffer(uint8_t port_id, uint16_t size) 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) port_id); + 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) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } /* @@ -195,8 +196,8 @@ configure_output_ports(const struct port_info *ports) rte_exit(EXIT_FAILURE, "Too many ethernet ports. RTE_MAX_ETHPORTS = %u\n", (unsigned)RTE_MAX_ETHPORTS); for (i = 0; i < ports->num_ports - 1; i+=2){ - uint8_t p1 = ports->id[i]; - uint8_t p2 = ports->id[i+1]; + uint16_t p1 = ports->id[i]; + uint16_t p2 = ports->id[i+1]; output_ports[p1] = p2; output_ports[p2] = p1; diff --git a/examples/multi_process/client_server_mp/mp_server/args.c b/examples/multi_process/client_server_mp/mp_server/args.c index bf8c666c2..a65884fd9 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.c +++ b/examples/multi_process/client_server_mp/mp_server/args.c @@ -74,7 +74,7 @@ parse_portmask(uint8_t max_ports, const char *portmask) { char *end = NULL; unsigned long pm; - uint8_t count = 0; + uint16_t count = 0; if (portmask == NULL || *portmask == '\0') return -1; @@ -128,7 +128,7 @@ parse_num_clients(const char *clients) * on error. */ int -parse_app_args(uint8_t max_ports, int argc, char *argv[]) +parse_app_args(uint16_t max_ports, int argc, char *argv[]) { int option_index, opt; char **argvopt = argv; diff --git a/examples/multi_process/client_server_mp/mp_server/args.h b/examples/multi_process/client_server_mp/mp_server/args.h index 23af1bd38..33888b894 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.h +++ b/examples/multi_process/client_server_mp/mp_server/args.h @@ -34,6 +34,6 @@ #ifndef _ARGS_H_ #define _ARGS_H_ -int parse_app_args(uint8_t max_ports, int argc, char *argv[]); +int parse_app_args(uint16_t max_ports, int argc, char *argv[]); #endif /* ifndef _ARGS_H_ */ diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index 0bc929217..cacf4e0d5 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -114,7 +114,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 = { @@ -129,7 +129,7 @@ init_port(uint8_t port_num) uint16_t q; int retval; - printf("Port %u init ... ", (unsigned)port_num); + printf("Port %u init ... ", port_num); fflush(stdout); /* Standard DPDK port initialisation - config port, then set up @@ -200,11 +200,12 @@ init_shm_rings(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -262,7 +263,7 @@ init(int argc, char *argv[]) { int retval; const struct rte_memzone *mz; - uint8_t i, total_ports; + uint16_t i, total_ports; /* init EAL, parsing EAL args */ retval = rte_eal_init(argc, argv); diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index 7055b543a..121383f8c 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -88,7 +88,7 @@ struct client_rx_buf { static struct client_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/multi_process/client_server_mp/shared/common.h b/examples/multi_process/client_server_mp/shared/common.h index 631c46325..35a3b01d0 100644 --- a/examples/multi_process/client_server_mp/shared/common.h +++ b/examples/multi_process/client_server_mp/shared/common.h @@ -57,8 +57,8 @@ struct tx_stats{ } __rte_cache_aligned; struct port_info { - uint8_t num_ports; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t num_ports; + uint16_t id[RTE_MAX_ETHPORTS]; volatile struct rx_stats rx_stats; volatile struct tx_stats tx_stats[MAX_CLIENTS]; }; diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index f8a626ba7..238b7f67b 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -140,7 +140,8 @@ struct lcore_resource_struct { /* ring[1] for slave send ack, master read */ struct rte_ring *ring[2]; int port_num; /* Total port numbers */ - uint8_t port[RTE_MAX_ETHPORTS]; /* Port id for that lcore to receive packets */ + /* Port id for that lcore to receive packets */ + uint16_t port[RTE_MAX_ETHPORTS]; }__attribute__((packed)) __rte_cache_aligned; static struct lcore_resource_struct lcore_resource[RTE_MAX_LCORE]; @@ -871,11 +872,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"); @@ -890,14 +892,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 */ @@ -930,9 +931,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned rx_lcore_id; unsigned nb_ports_in_mask = 0; unsigned i; diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index af2d9f3f7..98fbd74d1 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -129,7 +129,7 @@ static void netmap_unregif(uint32_t idx, uint32_t port); static int32_t -ifname_to_portid(const char *ifname, uint8_t *port) +ifname_to_portid(const char *ifname, uint16_t *port) { char *endptr; uint64_t portid; @@ -140,7 +140,7 @@ ifname_to_portid(const char *ifname, uint8_t *port) portid >= RTE_DIM(ports) || errno != 0) return -EINVAL; - *port = (uint8_t)portid; + *port = portid; return 0; } @@ -222,10 +222,10 @@ fd_release(int32_t fd) } static int -check_nmreq(struct nmreq *req, uint8_t *port) +check_nmreq(struct nmreq *req, uint16_t *port) { int32_t rc; - uint8_t portid; + uint16_t portid; if (req == NULL) return -EINVAL; @@ -242,7 +242,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) } if (ports[portid].pool == NULL) { - RTE_LOG(ERR, USER1, "Misconfigured portid %hhu\n", portid); + RTE_LOG(ERR, USER1, "Misconfigured portid %u\n", portid); return -EINVAL; } @@ -262,7 +262,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) static int ioctl_niocginfo(__rte_unused int fd, void * param) { - uint8_t portid; + uint16_t portid; struct nmreq *req; int32_t rc; @@ -283,7 +283,7 @@ ioctl_niocginfo(__rte_unused int fd, void * param) } static void -netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, +netmap_ring_setup(struct netmap_ring *ring, uint16_t port, uint32_t ringid, uint32_t num_slots) { uint32_t j; @@ -305,7 +305,7 @@ netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, } static int -netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) +netmap_regif(struct nmreq *req, uint32_t idx, uint16_t port) { struct netmap_if *nmif; struct netmap_ring *ring; @@ -313,7 +313,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) int32_t rc; if (ports[port].fd < RTE_DIM(fd_port)) { - RTE_LOG(ERR, USER1, "port %hhu already in use by fd: %u\n", + RTE_LOG(ERR, USER1, "port %u already in use by fd: %u\n", port, IDX_TO_FD(ports[port].fd)); return -EBUSY; } @@ -399,7 +399,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) static int ioctl_niocregif(int32_t fd, void * param) { - uint8_t portid; + uint16_t portid; int32_t rc; uint32_t idx; struct nmreq *req; @@ -422,7 +422,7 @@ netmap_unregif(uint32_t idx, uint32_t port) { fd_port[idx].port = FD_PORT_RSRV; ports[port].fd = UINT32_MAX; - rte_eth_dev_stop((uint8_t)port); + rte_eth_dev_stop(port); } /** @@ -460,7 +460,7 @@ ioctl_niocunregif(int fd) * packets as it can hold coming from its dpdk port. */ static inline int -rx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +rx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, uint16_t max_burst) { int32_t i, n_rx; @@ -513,7 +513,7 @@ rx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_rx_rings + 1; i++) { r = NETMAP_RXRING(nifp, i); - rx_sync_ring(r, (uint8_t)port, (uint16_t)i, burst); + rx_sync_ring(r, port, (uint16_t)i, burst); rc += r->avail; } @@ -542,7 +542,7 @@ ioctl_niocrxsync(int fd) * buffers into rte_mbufs and sending them out on the rings's dpdk port. */ static int -tx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +tx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, struct rte_mempool *pool, uint16_t max_burst) { uint32_t i, n_tx; @@ -608,7 +608,7 @@ tx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_tx_rings + 1; i++) { r = NETMAP_TXRING(nifp, i); - tx_sync_ring(r, (uint8_t)port, (uint16_t)i, mp, burst); + tx_sync_ring(r, port, (uint16_t)i, mp, burst); rc += r->avail; } @@ -686,7 +686,7 @@ rte_netmap_init(const struct rte_netmap_conf *conf) int -rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) +rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) { int32_t ret; uint16_t i; @@ -696,17 +696,17 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) portid >= RTE_DIM(ports) || conf->nr_tx_rings > netmap.conf.max_rings || conf->nr_rx_rings > netmap.conf.max_rings) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } - rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); - tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); + rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); + tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); if (tx_slots > netmap.conf.max_slots || rx_slots > netmap.conf.max_slots) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } @@ -715,15 +715,15 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) conf->nr_tx_rings, conf->eth_conf); if (ret < 0) { - RTE_LOG(ERR, USER1, "Couldn't configure port %hhu\n", portid); - return ret; + RTE_LOG(ERR, USER1, "Couldn't configure port %u\n", portid); + return ret; } ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_slots, &tx_slots); if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't ot adjust number of descriptors for port %hhu\n", + "Couldn't ot adjust number of descriptors for port %u\n", portid); return ret; } @@ -734,8 +734,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure TX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure TX queue %u of port %u\n", i, portid); return ret; } @@ -745,8 +744,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure RX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure RX queue %u of port %u\n", i, portid); return ret; } diff --git a/examples/netmap_compat/lib/compat_netmap.h b/examples/netmap_compat/lib/compat_netmap.h index 3dc7a2f40..76b2d2b4c 100644 --- a/examples/netmap_compat/lib/compat_netmap.h +++ b/examples/netmap_compat/lib/compat_netmap.h @@ -67,7 +67,7 @@ struct rte_netmap_port_conf { }; int rte_netmap_init(const struct rte_netmap_conf *conf); -int rte_netmap_init_port(uint8_t portid, +int rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf); int rte_netmap_close(int fd); diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index b26c33df5..3add7be47 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -269,21 +269,22 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) 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) port_id); + port_id); rte_eth_tx_buffer_init(tx_buffer[port_id], MAX_PKTS_BURST); ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id], flush_tx_error_callback, NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } return 0; } static inline int -configure_eth_port(uint8_t port_id) +configure_eth_port(uint16_t port_id) { struct ether_addr addr; const uint16_t rxRings = 1, txRings = 1; @@ -326,7 +327,7 @@ configure_eth_port(uint8_t port_id) rte_eth_macaddr_get(port_id, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port_id, + port_id, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -401,7 +402,7 @@ rx_thread(struct rte_ring *ring_out) uint32_t seqn = 0; uint16_t i, ret = 0; uint16_t nb_rx_pkts; - uint8_t port_id; + uint16_t port_id; struct rte_mbuf *pkts[MAX_PKTS_BURST]; RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__, @@ -632,8 +633,8 @@ main(int argc, char **argv) int ret; unsigned nb_ports; unsigned int lcore_id, last_lcore_id, master_lcore_id; - uint8_t port_id; - uint8_t nb_ports_available; + uint16_t port_id; + uint16_t nb_ports_available; struct worker_thread_args worker_args = {NULL, NULL}; struct send_thread_args send_args = {NULL, NULL}; struct rte_ring *rx_to_workers; @@ -687,7 +688,7 @@ main(int argc, char **argv) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) port_id); + printf("Initializing port %u... done\n", port_id); if (configure_eth_port(port_id) != 0) rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 7954b9744..9a1eef61a 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -140,7 +140,7 @@ parse_ptype(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(__rte_unused uint8_t port, __rte_unused uint16_t queue, +cb_parse_ptype(__rte_unused uint16_t port, __rte_unused uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, __rte_unused uint16_t max_pkts, __rte_unused void *user_param) { @@ -277,7 +277,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -287,7 +287,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct rx_thread_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; uint8_t thread_id; @@ -648,7 +648,7 @@ struct thread_tx_conf tx_thread[MAX_TX_THREAD]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct thread_tx_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -669,7 +669,7 @@ send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) /* 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) { uint16_t len; struct thread_tx_conf *qconf; @@ -696,7 +696,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) #if ((APP_LOOKUP_METHOD == APP_LOOKUP_LPM) && \ (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline void -send_packetsx4(uint8_t port, +send_packetsx4(uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; @@ -832,8 +832,8 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len) static __m128i mask0; static __m128i mask1; static __m128i mask2; -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { int ret = 0; @@ -846,11 +846,11 @@ get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, key.xmm = _mm_and_si128(data, mask0); /* 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 -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { int ret = 0; @@ -873,36 +873,36 @@ get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t)((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(((struct ipv4_hdr *)ipv4_hdr)->dst_addr), &next_hop) == 0) ? next_hop : portid); } -static inline uint8_t -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, lookup6_struct_t *ipv6_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, + return ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) == 0) ? next_hop : portid); } #endif -static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) __attribute__((unused)); #if ((APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH) && \ @@ -919,11 +919,11 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) #define EXCLUDE_8TH_PKT 0x7f static inline void -simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { struct ether_hdr *eth_hdr[8]; struct ipv4_hdr *ipv4_hdr[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; int32_t ret[8]; union ipv4_5tuple_host key[8]; __m128i data[8]; @@ -1042,14 +1042,14 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv4_lookup_struct, &key_array[0], 8, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1146,10 +1146,10 @@ static inline void get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0, } static inline void -simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { int32_t ret[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; struct ether_hdr *eth_hdr[8]; union ipv6_5tuple_host key[8]; @@ -1196,14 +1196,14 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv6_lookup_struct, &key_array[0], 4, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1250,24 +1250,24 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) ether_addr_copy(&ports_eth_addr[dst_port[6]], ð_hdr[6]->s_addr); ether_addr_copy(&ports_eth_addr[dst_port[7]], ð_hdr[7]->s_addr); - send_single_packet(m[0], (uint8_t)dst_port[0]); - send_single_packet(m[1], (uint8_t)dst_port[1]); - send_single_packet(m[2], (uint8_t)dst_port[2]); - send_single_packet(m[3], (uint8_t)dst_port[3]); - send_single_packet(m[4], (uint8_t)dst_port[4]); - send_single_packet(m[5], (uint8_t)dst_port[5]); - send_single_packet(m[6], (uint8_t)dst_port[6]); - send_single_packet(m[7], (uint8_t)dst_port[7]); + send_single_packet(m[0], dst_port[0]); + send_single_packet(m[1], dst_port[1]); + send_single_packet(m[2], dst_port[2]); + send_single_packet(m[3], dst_port[3]); + send_single_packet(m[4], dst_port[4]); + send_single_packet(m[5], dst_port[5]); + send_single_packet(m[6], dst_port[6]); + send_single_packet(m[7], dst_port[7]); } #endif /* APP_LOOKUP_METHOD */ static __rte_always_inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -1379,7 +1379,7 @@ rfc1812_process(struct ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype) (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline uint16_t -get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) +get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -1406,7 +1406,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) } static inline void -process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint8_t portid) +process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; @@ -1473,7 +1473,7 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], static inline void processx4_step2(__m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -1716,7 +1716,8 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2) static void process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx, - uint8_t portid) { + uint16_t portid) +{ int j; @@ -2091,7 +2092,7 @@ lthread_tx(void *args) struct lthread *lt; unsigned lcore_id; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; tx_conf = (struct thread_tx_conf *)args; @@ -2138,7 +2139,8 @@ lthread_rx(void *dummy) int ret; uint16_t nb_rx; int i; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; int worker_id; int len[RTE_MAX_LCORE] = { 0 }; int old_len, new_len; @@ -2164,7 +2166,8 @@ lthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", rte_lcore_id(), portid, queueid); } @@ -2323,7 +2326,7 @@ pthread_tx(void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; uint64_t prev_tsc, diff_tsc, cur_tsc; int nb_rx; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -2392,7 +2395,8 @@ pthread_rx(void *dummy) uint32_t n; uint32_t nb_rx; unsigned lcore_id; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct thread_rx_conf *rx_conf; @@ -2411,7 +2415,8 @@ pthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -2769,7 +2774,7 @@ parse_rx_config(const char *q_arg) return -1; } rx_thread_params_array[nb_rx_thread_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + int_fld[FLD_PORT]; rx_thread_params_array[nb_rx_thread_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; rx_thread_params_array[nb_rx_thread_params].lcore_id = @@ -2853,7 +2858,7 @@ parse_stat_lcore(const char *stat_lcore) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -3440,7 +3445,8 @@ check_all_ports_link_status(uint8_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"); @@ -3455,14 +3461,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 */ @@ -3497,10 +3502,10 @@ main(int argc, char **argv) int ret; int i; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index ddfcdb832..c495e7508 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -158,12 +158,12 @@ struct ptpv2_data_slave_ordinary { struct clock_id master_clock_id; struct timeval new_adj; int64_t delta; - uint8_t portid; + uint16_t portid; uint16_t seqID_SYNC; uint16_t seqID_FOLLOWUP; uint8_t ptpset; uint8_t kernel_time_set; - uint8_t current_ptp_port; + uint16_t current_ptp_port; }; static struct ptpv2_data_slave_ordinary ptp_data; diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 2350d64f4..203a34704 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -252,8 +252,8 @@ app_parse_flow_conf(const char *conf_str) pconf = &qos_conf[nb_pfc]; - pconf->rx_port = (uint8_t)vals[0]; - pconf->tx_port = (uint8_t)vals[1]; + pconf->rx_port = vals[0]; + pconf->tx_port = vals[1]; pconf->rx_core = (uint8_t)vals[2]; pconf->wt_core = (uint8_t)vals[3]; if (ret == 5) @@ -267,19 +267,19 @@ app_parse_flow_conf(const char *conf_str) } if (pconf->rx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu16" index\n", nb_pfc, pconf->rx_port); return -1; } if (pconf->tx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu16" index\n", nb_pfc, pconf->tx_port); return -1; } mask = 1lu << pconf->rx_port; if (app_used_rx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu16" is used already\n", nb_pfc, pconf->rx_port); return -1; } @@ -288,7 +288,7 @@ app_parse_flow_conf(const char *conf_str) mask = 1lu << pconf->tx_port; if (app_used_tx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: port %"PRIu16" is used already\n", nb_pfc, pconf->tx_port); return -1; } diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index a82cbd7d5..004ac54e7 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -100,7 +100,7 @@ static const struct rte_eth_conf port_conf = { }; static int -app_init_port(uint8_t portid, struct rte_mempool *mp) +app_init_port(uint16_t portid, struct rte_mempool *mp) { int ret; struct rte_eth_link link; @@ -127,19 +127,21 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; /* init port */ - RTE_LOG(INFO, APP, "Initializing port %"PRIu8"... ", portid); + RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot configure device: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "Cannot configure device: err=%d, port=%u\n", + ret, portid); rx_size = ring_conf.rx_size; tx_size = ring_conf.tx_size; ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_size, &tx_size); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_dev_adjust_nb_rx_tx_desc: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_dev_adjust_nb_rx_tx_desc: err=%d,port=%u\n", + ret, portid); ring_conf.rx_size = rx_size; ring_conf.tx_size = tx_size; @@ -148,22 +150,25 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size, rte_eth_dev_socket_id(portid), &rx_conf, mp); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u\n", + ret, portid); /* init one TX queue */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, (uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, " - "port=%"PRIu8" queue=%d\n", ret, portid, 0); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n", + ret, portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_pmd_port_start: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_pmd_port_start: err=%d, port=%u\n", + ret, portid); printf("done: "); @@ -256,7 +261,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) uint32_t pipe, subport; int err; - rte_eth_link_get((uint8_t)portid, &link); + rte_eth_link_get(portid, &link); port_params.socket = socketid; port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8; diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index e10cfd448..1e2fb189b 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -125,8 +125,7 @@ app_main_loop(__attribute__((unused))void *dummy) /* initialize mbuf memory */ if (mode == APP_RX_MODE) { for (i = 0; i < rx_idx; i++) { - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "reading port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u reading port%u\n", i, lcore_id, rx_confs[i]->rx_port); } @@ -140,8 +139,8 @@ app_main_loop(__attribute__((unused))void *dummy) if (wt_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u sched+write " - "port %"PRIu8"\n", + RTE_LOG(INFO, APP, + "flow %u lcoreid %u sched+write port %u\n", i, lcore_id, wt_confs[i]->tx_port); } @@ -155,8 +154,7 @@ app_main_loop(__attribute__((unused))void *dummy) if (tx_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "writing port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u write port%u\n", i, lcore_id, tx_confs[i]->tx_port); } @@ -186,7 +184,7 @@ app_stat(void) struct flow_conf *flow = &qos_conf[i]; rte_eth_stats_get(flow->rx_port, &stats); - printf("\nRX port %"PRIu8": rx: %"PRIu64 " err: %"PRIu64 + printf("\nRX port %"PRIu16": rx: %"PRIu64 " err: %"PRIu64 " no_mbuf: %"PRIu64 "\n", flow->rx_port, stats.ipackets - rx_stats[i].ipackets, @@ -195,7 +193,7 @@ app_stat(void) memcpy(&rx_stats[i], &stats, sizeof(stats)); rte_eth_stats_get(flow->tx_port, &stats); - printf("TX port %"PRIu8": tx: %" PRIu64 " err: %" PRIu64 "\n", + printf("TX port %"PRIu16": tx: %" PRIu64 " err: %" PRIu64 "\n", flow->tx_port, stats.opackets - tx_stats[i].opackets, stats.oerrors - tx_stats[i].oerrors); diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h index 8d02e1ade..77b6e3ee7 100644 --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -106,8 +106,8 @@ struct thread_conf uint32_t n_mbufs; struct rte_mbuf **m_table; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -125,8 +125,8 @@ struct flow_conf uint32_t rx_core; uint32_t wt_core; uint32_t tx_core; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -188,13 +188,15 @@ void app_worker_thread(struct thread_conf **qconf); void app_mixed_thread(struct thread_conf **qconf); void app_stat(void); -int subport_stat(uint8_t port_id, uint32_t subport_id); -int pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q); -int qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc); -int qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc); -int qavg_subport(uint8_t port_id, uint32_t subport_id); +int subport_stat(uint16_t port_id, uint32_t subport_id); +int pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc, uint8_t q); +int qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc); +int qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc); +int qavg_subport(uint16_t port_id, uint32_t subport_id); #ifdef __cplusplus } diff --git a/examples/qos_sched/stats.c b/examples/qos_sched/stats.c index 5c894455b..b5545e10c 100644 --- a/examples/qos_sched/stats.c +++ b/examples/qos_sched/stats.c @@ -37,7 +37,8 @@ #include "main.h" int -qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q) +qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, + uint8_t q) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -74,7 +75,8 @@ qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8 } int -qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) +qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -114,7 +116,7 @@ qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) } int -qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -153,7 +155,7 @@ qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) } int -qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) +qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -195,7 +197,7 @@ qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) } int -qavg_subport(uint8_t port_id, uint32_t subport_id) +qavg_subport(uint16_t port_id, uint32_t subport_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -237,7 +239,7 @@ qavg_subport(uint8_t port_id, uint32_t subport_id) } int -subport_stat(uint8_t port_id, uint32_t subport_id) +subport_stat(uint16_t port_id, uint32_t subport_id) { struct rte_sched_subport_stats stats; struct rte_sched_port *port; @@ -273,7 +275,7 @@ subport_stat(uint8_t port_id, uint32_t subport_id) } int -pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 083a37a92..415b68bb9 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -156,12 +156,12 @@ void init_ring(int lcore_id, uint8_t port_id) void pair_ports(void) { - uint8_t i, j; + uint16_t i, j; /* Pair ports with their "closest neighbour" in the portmask */ for (i = 0; i < RTE_MAX_ETHPORTS; i++) if (is_bit_set(i, portmask)) - for (j = (uint8_t) (i + 1); j < RTE_MAX_ETHPORTS; j++) + for (j = i + 1; j < RTE_MAX_ETHPORTS; j++) if (is_bit_set(j, portmask)) { port_pairs[i] = j; port_pairs[j] = i; diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c index d4fcfde48..e5ecdb1cf 100644 --- a/examples/quota_watermark/qw/main.c +++ b/examples/quota_watermark/qw/main.c @@ -155,7 +155,7 @@ receive_stage(__attribute__((unused)) void *args) { int i, ret; - uint8_t port_id; + uint16_t port_id; uint16_t nb_rx_pkts; unsigned int lcore_id; @@ -216,7 +216,7 @@ pipeline_stage(__attribute__((unused)) void *args) int i, ret; int nb_dq_pkts; - uint8_t port_id; + uint16_t port_id; unsigned int lcore_id, previous_lcore_id; unsigned int free; @@ -279,8 +279,8 @@ send_stage(__attribute__((unused)) void *args) { uint16_t nb_dq_pkts; - uint8_t port_id; - uint8_t dest_port_id; + uint16_t port_id; + uint16_t dest_port_id; unsigned int lcore_id, previous_lcore_id; @@ -324,7 +324,7 @@ main(int argc, char **argv) int ret; unsigned int lcore_id, master_lcore_id, last_lcore_id; - uint8_t port_id; + uint16_t port_id; rte_log_set_global_level(RTE_LOG_INFO); diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 669924055..e66f16f25 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -59,7 +59,7 @@ static struct { 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, uint16_t max_pkts __rte_unused, void *_ __rte_unused) { @@ -72,7 +72,7 @@ add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } 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; @@ -97,7 +97,7 @@ calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused, * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; - uint8_t portid; + uint16_t portid; /* init EAL */ int ret = rte_eal_init(argc, argv); diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index dcdc0a48b..382a2ded8 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -95,7 +95,7 @@ struct efd_stats { static struct node_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/server_node_efd/shared/common.h b/examples/server_node_efd/shared/common.h index 8a1347993..b1e0abe52 100644 --- a/examples/server_node_efd/shared/common.h +++ b/examples/server_node_efd/shared/common.h @@ -65,9 +65,9 @@ struct filter_stats { struct shared_info { uint8_t num_nodes; - uint8_t num_ports; + uint16_t num_ports; uint32_t num_flows; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t id[RTE_MAX_ETHPORTS]; struct rx_stats rx_stats; struct tx_stats tx_stats[MAX_NODES]; struct filter_stats filter_stats[MAX_NODES]; diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index b4d50de89..e623754cf 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -57,7 +57,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -104,7 +104,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -122,8 +122,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -179,7 +179,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -204,7 +204,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 4d1589d06..89a61f0e5 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -177,7 +177,7 @@ static 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 = 0; /**< The number of ports specified in command line */ static uint16_t num_pf_queues, num_vmdq_queues; static uint16_t vmdq_pool_base, vmdq_queue_base; @@ -265,7 +265,7 @@ validate_num_devices(uint32_t max_nb_devices) * coming from the mbuf_pool passed as parameter */ static inline int -port_init(uint8_t port) +port_init(uint16_t port) { struct rte_eth_dev_info dev_info; struct rte_eth_conf port_conf; @@ -392,7 +392,7 @@ port_init(uint8_t port) RTE_LOG(INFO, VHOST_PORT, "Max virtio devices supported: %u\n", num_devices); RTE_LOG(INFO, VHOST_PORT, "Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, vmdq_ports_eth_addr[port].addr_bytes[0], vmdq_ports_eth_addr[port].addr_bytes[1], vmdq_ports_eth_addr[port].addr_bytes[2], @@ -667,7 +667,7 @@ us_vhost_parse_args(int argc, char **argv) for (i = 0; i < RTE_MAX_ETHPORTS; i++) { if (enabled_port_mask & (1 << i)) - ports[num_ports++] = (uint8_t)i; + ports[num_ports++] = i; } if ((num_ports == 0) || (num_ports > MAX_SUP_PORTS)) { @@ -1443,7 +1443,7 @@ main(int argc, char *argv[]) unsigned lcore_id, core_id = 0; unsigned nb_ports, valid_num_ports; int ret, i; - uint8_t portid; + uint16_t portid; static pthread_t tid; char thread_name[RTE_MAX_THREAD_NAME_LEN]; uint64_t flags = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v4 4/5] test: increase port_id range 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang ` (2 preceding siblings ...) 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 3/5] examples: " Zhiyong Yang @ 2017-09-21 8:32 ` Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 5/5] librte_mbuf: modify port initialization value Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-21 8:32 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, Zhiyong Yang Increase port_id range from 8 bit to 16 bits in test code, and remove some unnecessary cast operations. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- test/test/test_kni.c | 12 +++++------ test/test/test_link_bonding.c | 40 ++++++++++++++++++------------------- test/test/test_link_bonding_mode4.c | 12 +++++------ test/test/test_pmd_perf.c | 30 ++++++++++++++-------------- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 +++++++++++----------- test/test/virtual_pmd.h | 28 ++++++++++++++------------ 7 files changed, 75 insertions(+), 73 deletions(-) diff --git a/test/test/test_kni.c b/test/test/test_kni.c index db17fdf30..2450c9ff5 100644 --- a/test/test/test_kni.c +++ b/test/test/test_kni.c @@ -132,7 +132,7 @@ test_kni_lookup_mempool(void) } /* 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 int new_mtu) { printf("Change MTU of port %d to %u\n", port_id, new_mtu); kni_pkt_mtu = new_mtu; @@ -362,7 +362,7 @@ test_kni_register_handler_mp(void) } static int -test_kni_processing(uint8_t port_id, struct rte_mempool *mp) +test_kni_processing(uint16_t port_id, struct rte_mempool *mp) { int ret = 0; unsigned i; @@ -387,7 +387,7 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp) conf.core_id = 1; conf.force_bind = 1; conf.mbuf_size = MAX_PACKET_SZ; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; ops = kni_ops; ops.port_id = port_id; @@ -472,7 +472,7 @@ static int test_kni(void) { int ret = -1; - uint8_t nb_ports, port_id; + uint16_t nb_ports, port_id; struct rte_kni *kni; struct rte_mempool *mp; struct rte_kni_conf conf; @@ -538,7 +538,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; @@ -567,7 +567,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c index dc28cea59..e41ab60d2 100644 --- a/test/test/test_link_bonding.c +++ b/test/test/test_link_bonding.c @@ -94,9 +94,9 @@ uint8_t slave_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; uint8_t bonded_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; struct link_bonding_unittest_params { - int8_t bonded_port_id; - int8_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; - uint8_t bonded_slave_count; + int16_t bonded_port_id; + int16_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; + uint16_t bonded_slave_count; uint8_t bonding_mode; uint16_t nb_rx_q; @@ -317,7 +317,7 @@ test_create_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Don't try to recreate bonded device if re-running test suite*/ if (test_params->bonded_port_id == -1) { @@ -387,7 +387,7 @@ test_add_slave_to_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count]), @@ -434,7 +434,7 @@ test_remove_slave_from_bonded_device(void) { int current_slave_count; struct ether_addr read_mac_addr, *mac_addr; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count-1]), @@ -496,7 +496,7 @@ static int test_add_already_bonded_slave_to_bonded_device(void) { int port_id, current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; char pmd_name[RTE_ETH_NAME_MAX_LEN]; test_add_slave_to_bonded_device(); @@ -528,7 +528,7 @@ static int test_get_slaves_from_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), "Failed to add slave to bonded device"); @@ -609,7 +609,7 @@ test_start_bonded_device(void) struct rte_eth_link link_status; int current_slave_count, current_bonding_mode, primary_port; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Add slave to bonded device*/ TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), @@ -658,7 +658,7 @@ static int test_stop_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct rte_eth_link link_status; @@ -932,7 +932,7 @@ test_set_bonded_port_initialization_mac_assignment(void) { int i, slave_count, bonded_port_id; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; struct ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; @@ -1114,7 +1114,7 @@ test_set_bonded_port_initialization_mac_assignment(void) static int initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr, - uint8_t number_of_slaves, uint8_t enable_slave) + uint16_t number_of_slaves, uint8_t enable_slave) { /* Configure bonded device */ TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, @@ -1179,7 +1179,7 @@ int test_lsc_interrupt_count; static int -test_bonding_lsc_event_callback(uint8_t port_id __rte_unused, +test_bonding_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type type __rte_unused, void *param __rte_unused, void *ret_param __rte_unused) @@ -1224,7 +1224,7 @@ static int test_status_interrupt(void) { int slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* initialized bonding device with T slaves */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( @@ -1313,7 +1313,7 @@ test_status_interrupt(void) static int generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size, uint8_t vlan, uint8_t ipv4, uint8_t toggle_dst_mac, - uint8_t toggle_ip_addr, uint8_t toggle_udp_port) + uint8_t toggle_ip_addr, uint16_t toggle_udp_port) { uint16_t pktlen, generated_burst_size, ether_type; void *ip_hdr; @@ -1854,7 +1854,7 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -2408,7 +2408,7 @@ test_activebackup_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; @@ -3302,7 +3302,7 @@ test_balance_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -3861,7 +3861,7 @@ test_broadcast_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -4373,7 +4373,7 @@ test_tlb_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; diff --git a/test/test/test_link_bonding_mode4.c b/test/test/test_link_bonding_mode4.c index 8e9e23db5..77ec09c54 100644 --- a/test/test/test_link_bonding_mode4.c +++ b/test/test/test_link_bonding_mode4.c @@ -325,7 +325,7 @@ remove_slave(struct slave_conf *slave) } static void -lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) +lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; @@ -343,7 +343,7 @@ lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) } static int -initialize_bonded_device_with_slaves(uint8_t slave_count, uint8_t external_sm) +initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) { uint8_t i; @@ -379,8 +379,8 @@ remove_slaves_and_stop_bonded_device(void) { struct slave_conf *slave; int retval; - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t i; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t i; rte_eth_dev_stop(test_params.bonded_port_id); @@ -411,7 +411,7 @@ test_setup(void) char name[RTE_ETH_NAME_MAX_LEN]; struct slave_conf *port; const uint8_t socket_id = rte_socket_id(); - uint8_t i; + uint16_t i; if (test_params.mbuf_pool == NULL) { nb_mbuf_per_pool = TEST_RX_DESC_MAX + DEF_PKT_BURST + @@ -1521,7 +1521,7 @@ check_environment(void) { struct slave_conf *port; uint8_t i, env_state; - uint8_t slaves[RTE_DIM(test_params.slave_ports)]; + uint16_t slaves[RTE_DIM(test_params.slave_ports)]; int slaves_count; env_state = 0; diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c index 1ffd65a52..a3e29ed9e 100644 --- a/test/test/test_pmd_perf.c +++ b/test/test/test_pmd_perf.c @@ -50,7 +50,7 @@ #define MAX_PKT_BURST (32) #define RTE_TEST_RX_DESC_DEFAULT (128) #define RTE_TEST_TX_DESC_DEFAULT (512) -#define RTE_PORT_ALL (~(uint8_t)0x0) +#define RTE_PORT_ALL (~(uint16_t)0x0) /* how long test would take at full line rate */ #define RTE_TEST_DURATION (2) @@ -143,7 +143,7 @@ struct lcore_conf { uint8_t status; uint8_t socketid; uint16_t nb_ports; - uint8_t portlist[RTE_MAX_ETHPORTS]; + uint16_t portlist[RTE_MAX_ETHPORTS]; } __rte_cache_aligned; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; @@ -160,11 +160,12 @@ static uint32_t sc_flag; /* Check the link status of all ports in up to 3s, 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 30 /* 3s (30 * 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("Checking link statuses...\n"); @@ -179,16 +180,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", (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")); if (link_mbps == 0) link_mbps = link.link_speed; } 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 */ @@ -335,7 +335,7 @@ reset_count(void) } static void -stats_display(uint8_t port_id) +stats_display(uint16_t port_id) { struct rte_eth_stats stats; rte_eth_stats_get(port_id, &stats); @@ -383,7 +383,7 @@ measure_rxtx(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -422,7 +422,7 @@ measure_rxonly(struct lcore_conf *conf, portid = conf->portlist[i]; cur_tsc = rte_rdtsc(); - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -459,7 +459,7 @@ measure_txonly(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -537,7 +537,7 @@ main_loop(__rte_unused void *args) portid = conf->portlist[i]; int nb_free = pkt_per_port; do { /* dry out */ - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); nb_tx = 0; while (nb_tx < nb_rx) @@ -600,7 +600,7 @@ poll_burst(void *args) while (total) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, &pkts_burst[next[portid]], MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { diff --git a/test/test/test_pmd_ring_perf.c b/test/test/test_pmd_ring_perf.c index 004882af1..8e9cd3310 100644 --- a/test/test/test_pmd_ring_perf.c +++ b/test/test/test_pmd_ring_perf.c @@ -54,7 +54,7 @@ static const volatile unsigned bulk_sizes[] = { 1, 8, 32 }; /* The ring structure used for tests */ static struct rte_ring *r; -static uint8_t ring_ethdev_port; +static uint16_t ring_ethdev_port; /* Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */ static void diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c index 9d46ad564..6568cb5b9 100644 --- a/test/test/virtual_pmd.c +++ b/test/test/virtual_pmd.c @@ -261,7 +261,7 @@ static const struct eth_dev_ops virtual_ethdev_default_dev_ops = { void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -275,7 +275,7 @@ virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -288,7 +288,7 @@ virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -301,7 +301,7 @@ virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -314,7 +314,7 @@ virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -430,7 +430,7 @@ virtual_ethdev_tx_burst_fail(void *queue, struct rte_mbuf **bufs, void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -442,7 +442,7 @@ virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct virtual_ethdev_private *dev_private = NULL; struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -458,7 +458,7 @@ virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count) { struct virtual_ethdev_private *dev_private = NULL; @@ -470,7 +470,7 @@ virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, } void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -478,7 +478,7 @@ virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) } void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -490,7 +490,7 @@ virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, } int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -502,7 +502,7 @@ virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, } int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct virtual_ethdev_private *dev_private; diff --git a/test/test/virtual_pmd.h b/test/test/virtual_pmd.h index de001884d..7c53dd346 100644 --- a/test/test/virtual_pmd.h +++ b/test/test/virtual_pmd.h @@ -48,53 +48,55 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, uint8_t socket_id, uint8_t isr_support); void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status); +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status); void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status); int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkts_burst, int burst_length); int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length); /** Control methods for the dev_ops functions pointer to control the behavior * of the Virtual PMD */ void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_stop_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_stop_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success); /* if a value greater than zero is set for packet_fail_count then virtual * device tx burst function will fail that many packet from burst or all * packets if packet_fail_count is greater than the number of packets in the * burst */ void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count); #ifdef __cplusplus -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v4 5/5] librte_mbuf: modify port initialization value 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang ` (3 preceding siblings ...) 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 4/5] test: " Zhiyong Yang @ 2017-09-21 8:32 ` Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-21 8:32 UTC (permalink / raw) To: dev; +Cc: thomas, ferruh.yigit, Zhiyong Yang In order to support more than 256 virtual ports, the field "port" in rte_mbuf has been increased to 16 bits. The initialization/reset value of the field "port" should be changed from 0xff to 0xffff accordingly. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 26a62b8e1..bcf4e2fcf 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp, /* init some constant fields */ m->pool = mp; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; rte_mbuf_refcnt_set(m, 1); m->next = NULL; } diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eaed7eee0..cc380400d 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1087,6 +1087,8 @@ static inline void rte_pktmbuf_reset_headroom(struct rte_mbuf *m) * @param m * The packet mbuf to be resetted. */ +#define MBUF_INVALID_PORT UINT16_MAX + static inline void rte_pktmbuf_reset(struct rte_mbuf *m) { m->next = NULL; @@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m) m->vlan_tci = 0; m->vlan_tci_outer = 0; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; m->ol_flags = 0; m->packet_type = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v5 0/5] increase port_id range 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang ` (4 preceding siblings ...) 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 5/5] librte_mbuf: modify port initialization value Zhiyong Yang @ 2017-09-25 3:22 ` Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang ` (5 more replies) 5 siblings, 6 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-25 3:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, adrien.mazarguil port_id is currently defined as uint8_t, which is limited to the range 0 to 255. A larger range is required for vdev scalability. It is necessary for a redefinition of port_id to extend it from 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will be changed at the same time. Discussion about port_id is the following thread. http://www.dpdk.org/dev/patchwork/patch/23208/ Changes in V2: 1. cover more PMDs to increase port_id range. 2. cover more examples to increase port_id range. 3. add 17.11 release note. Changes in V3: 1. cover mlx4 and mlx5. 2. add to increase port_id range in test code. 3. The patch "librte_mbuf: modify port initialization value" is merged into the patchset. Changes in V4: 1. Add a patch to remove bonding APIs using ABI versioning according to Ferruh's comments. 2. Unify to use typedef portid_t in testpmd code. 3. update release note deprecation doc in 2/5 4. fix some issues according to comments. Changes in V5: 1. For 1/5, bond_mode_8023ad_conf_get_v1708() and bond_mode_8023ad_conf_get() are merged into one function bond_mode_8023ad_conf_get. Note: 3/5 and 4/5 patches' compilling depends on 2/5 patch since 2/5 patch breaks lib/PMD API/ABI. Zhiyong Yang (5): net/bonding: remove bonding APIs using ABI versioning ethdev: increase port_id range examples: increase port_id range test: increase port_id range librte_mbuf: modify port initialization value app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 +-- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 18 +- app/test-pmd/testpmd.h | 4 +- doc/guides/rel_notes/deprecation.rst | 6 - doc/guides/rel_notes/release_17_11.rst | 18 +- drivers/net/af_packet/Makefile | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/Makefile | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/Makefile | 2 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnxt/Makefile | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 32 +-- drivers/net/bonding/Makefile | 2 +- drivers/net/bonding/rte_eth_bond.h | 41 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 203 +++-------------- drivers/net/bonding/rte_eth_bond_8023ad.h | 48 ++-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 62 +++--- drivers/net/bonding/rte_eth_bond_private.h | 45 ++-- drivers/net/bonding/rte_eth_bond_version.map | 4 - drivers/net/e1000/Makefile | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/Makefile | 2 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/Makefile | 2 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/Makefile | 2 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++-- drivers/net/ixgbe/Makefile | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 ++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 64 +++--- drivers/net/mlx5/mlx5_rxtx.h | 4 +- drivers/net/nfp/nfp_net.c | 16 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/Makefile | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/Makefile | 2 +- drivers/net/vhost/rte_eth_vhost.c | 6 +- drivers/net/vhost/rte_eth_vhost.h | 4 +- drivers/net/virtio/Makefile | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/vmxnet3/vmxnet3_ring.h | 4 +- examples/bond/main.c | 16 +- examples/distributor/main.c | 26 +-- examples/exception_path/main.c | 35 ++- examples/ip_fragmentation/main.c | 33 +-- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 +-- examples/ipv4_multicast/main.c | 30 +-- examples/kni/main.c | 30 +-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 +-- examples/l2fwd-keepalive/main.c | 50 ++--- examples/l2fwd/main.c | 47 ++-- examples/l3fwd-acl/main.c | 9 +- examples/l3fwd-power/main.c | 60 ++--- examples/l3fwd-vf/main.c | 50 +++-- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 15 +- examples/l3fwd/l3fwd_lpm.h | 4 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 +-- examples/link_status_interrupt/main.c | 9 +- examples/load_balancer/config.c | 14 +- examples/load_balancer/init.c | 34 ++- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 17 +- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 23 +- examples/netmap_compat/lib/compat_netmap.c | 52 +++-- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +- examples/performance-thread/l3fwd-thread/main.c | 143 ++++++------ examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +-- examples/qos_sched/main.c | 14 +- examples/qos_sched/main.h | 24 +- examples/qos_sched/stats.c | 16 +- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- lib/librte_bitratestats/Makefile | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/Makefile | 2 +- lib/librte_ether/rte_ethdev.c | 241 +++++++++++---------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++---------- lib/librte_ether/rte_flow.c | 2 +- lib/librte_ether/rte_flow_driver.h | 2 +- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 ++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/Makefile | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +- lib/librte_pdump/Makefile | 2 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/Makefile | 2 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- test/test/test_kni.c | 12 +- test/test/test_link_bonding.c | 40 ++-- test/test/test_link_bonding_mode4.c | 12 +- test/test/test_pmd_perf.c | 30 +-- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 +- test/test/virtual_pmd.h | 28 +-- 156 files changed, 1402 insertions(+), 1507 deletions(-) -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang @ 2017-09-25 3:22 ` Zhiyong Yang 2017-09-25 11:34 ` Ferruh Yigit 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range Zhiyong Yang ` (4 subsequent siblings) 5 siblings, 1 reply; 101+ messages in thread From: Zhiyong Yang @ 2017-09-25 3:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, adrien.mazarguil, Zhiyong Yang There are two bonding APIs using ABI versioning, and both have port_id as parameter. Since we are already breaking ABI, no need to keep older versions of APIs. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- drivers/net/bonding/rte_eth_bond_8023ad.c | 149 +-------------------------- drivers/net/bonding/rte_eth_bond_8023ad.h | 18 ---- drivers/net/bonding/rte_eth_bond_version.map | 4 - 3 files changed, 2 insertions(+), 169 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 20b5a8961..c2b9e053c 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1111,27 +1111,6 @@ bond_mode_8023ad_conf_get(struct rte_eth_dev *dev, conf->tx_period_ms = mode4->tx_period_timeout / ms_ticks; conf->update_timeout_ms = mode4->update_timeout_us / 1000; conf->rx_marker_period_ms = mode4->rx_marker_timeout / ms_ticks; -} - -static void -bond_mode_8023ad_conf_get_v1607(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - bond_mode_8023ad_conf_get(dev, conf); - conf->slowrx_cb = mode4->slowrx_cb; -} - -static void -bond_mode_8023ad_conf_get_v1708(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - bond_mode_8023ad_conf_get(dev, conf); conf->slowrx_cb = mode4->slowrx_cb; conf->agg_selection = mode4->agg_selection; } @@ -1171,27 +1150,6 @@ bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4, mode4->dedicated_queues.tx_qid = UINT16_MAX; } -static void -bond_mode_8023ad_setup_v20(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_bond_8023ad_conf def_conf; - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - if (conf == NULL) { - conf = &def_conf; - bond_mode_8023ad_conf_get_default(conf); - } - - bond_mode_8023ad_stop(dev); - bond_mode_8023ad_conf_assign(mode4, conf); - - if (dev->data->dev_started) - bond_mode_8023ad_start(dev); -} - - void bond_mode_8023ad_setup(struct rte_eth_dev *dev, struct rte_eth_bond_8023ad_conf *conf) @@ -1207,27 +1165,6 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev, bond_mode_8023ad_stop(dev); bond_mode_8023ad_conf_assign(mode4, conf); - - - if (dev->data->dev_started) - bond_mode_8023ad_start(dev); -} - -static void -bond_mode_8023ad_setup_v1708(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_bond_8023ad_conf def_conf; - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - if (conf == NULL) { - conf = &def_conf; - bond_mode_8023ad_conf_get_default(conf); - } - - bond_mode_8023ad_stop(dev); - bond_mode_8023ad_conf_assign(mode4, conf); mode4->slowrx_cb = conf->slowrx_cb; mode4->agg_selection = AGG_STABLE; @@ -1358,7 +1295,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1373,46 +1310,6 @@ rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, bond_mode_8023ad_conf_get(bond_dev, conf); return 0; } -VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v20, 2.0); - -int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; - - if (conf == NULL) - return -EINVAL; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_conf_get_v1607(bond_dev, conf); - return 0; -} -VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1607, 16.07); - -int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; - - if (conf == NULL) - return -EINVAL; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_conf_get_v1708(bond_dev, conf); - return 0; -} -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_conf_get(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf), - rte_eth_bond_8023ad_conf_get_v1708); -BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1708, 17.08); int rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, @@ -1483,25 +1380,7 @@ bond_8023ad_setup_validate(uint8_t port_id, } int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - int err; - - err = bond_8023ad_setup_validate(port_id, conf); - if (err != 0) - return err; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_setup_v20(bond_dev, conf); - - return 0; -} -VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v20, 2.0); - -int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1516,30 +1395,6 @@ rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, return 0; } -VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v1607, 16.07); - - -int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - int err; - - err = bond_8023ad_setup_validate(port_id, conf); - if (err != 0) - return err; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_setup_v1708(bond_dev, conf); - - return 0; -} -BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf), - rte_eth_bond_8023ad_setup_v1708); - diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 1d353c734..d609745e0 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -194,15 +194,6 @@ struct rte_eth_bond_8023ad_slave_info { int rte_eth_bond_8023ad_conf_get(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); /** * @internal @@ -218,15 +209,6 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, int rte_eth_bond_8023ad_setup(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); /** * @internal diff --git a/drivers/net/bonding/rte_eth_bond_version.map b/drivers/net/bonding/rte_eth_bond_version.map index 0f4e847da..ec3374b0f 100644 --- a/drivers/net/bonding/rte_eth_bond_version.map +++ b/drivers/net/bonding/rte_eth_bond_version.map @@ -1,8 +1,6 @@ DPDK_2.0 { global: - rte_eth_bond_8023ad_conf_get; - rte_eth_bond_8023ad_setup; rte_eth_bond_active_slaves_get; rte_eth_bond_create; rte_eth_bond_link_monitoring_set; @@ -39,8 +37,6 @@ DPDK_16.07 { rte_eth_bond_8023ad_ext_distrib; rte_eth_bond_8023ad_ext_distrib_get; rte_eth_bond_8023ad_ext_slowtx; - rte_eth_bond_8023ad_conf_get; - rte_eth_bond_8023ad_setup; } DPDK_16.04; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang @ 2017-09-25 11:34 ` Ferruh Yigit 0 siblings, 0 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-09-25 11:34 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, adrien.mazarguil On 9/25/2017 4:22 AM, Zhiyong Yang wrote: > There are two bonding APIs using ABI versioning, and both have > port_id as parameter. Since we are already breaking ABI, no need > to keep older versions of APIs. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang @ 2017-09-25 3:22 ` Zhiyong Yang 2017-09-25 11:37 ` Ferruh Yigit 2017-09-25 12:06 ` Ferruh Yigit 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 3/5] examples: " Zhiyong Yang ` (3 subsequent siblings) 5 siblings, 2 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-25 3:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, adrien.mazarguil, Zhiyong Yang Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. release_17_11 and deprecation have been updated in this patch. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> --- app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 ++- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 18 +- app/test-pmd/testpmd.h | 4 +- doc/guides/rel_notes/deprecation.rst | 6 - doc/guides/rel_notes/release_17_11.rst | 18 +- drivers/net/af_packet/Makefile | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/Makefile | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/Makefile | 2 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnxt/Makefile | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 32 +-- drivers/net/bonding/Makefile | 2 +- drivers/net/bonding/rte_eth_bond.h | 41 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 60 +++--- drivers/net/bonding/rte_eth_bond_8023ad.h | 30 +-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 62 +++--- drivers/net/bonding/rte_eth_bond_private.h | 45 ++-- drivers/net/e1000/Makefile | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/Makefile | 2 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/Makefile | 2 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/Makefile | 2 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- drivers/net/ixgbe/Makefile | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 64 +++--- drivers/net/mlx5/mlx5_rxtx.h | 4 +- drivers/net/nfp/nfp_net.c | 16 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/Makefile | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/Makefile | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/Makefile | 2 +- drivers/net/vhost/rte_eth_vhost.c | 6 +- drivers/net/vhost/rte_eth_vhost.h | 4 +- drivers/net/virtio/Makefile | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/vmxnet3/vmxnet3_ring.h | 4 +- lib/librte_bitratestats/Makefile | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/Makefile | 2 +- lib/librte_ether/rte_ethdev.c | 241 +++++++++++----------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- lib/librte_ether/rte_flow.c | 2 +- lib/librte_ether/rte_flow_driver.h | 2 +- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/Makefile | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_pdump/Makefile | 2 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/Makefile | 2 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- 92 files changed, 773 insertions(+), 746 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index 3b13753d9..090a50cfc 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -623,7 +623,7 @@ static void create_mp_ring_vdev(void) { int i; - uint8_t portid; + uint16_t portid; struct pdump_tuples *pt = NULL; struct rte_mempool *mbuf_pool = NULL; char vdev_args[SIZE]; diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index ccdf239d6..d9d083888 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4588,7 +4588,7 @@ struct cmd_show_bonding_config_result { cmdline_fixed_string_t show; cmdline_fixed_string_t bonding; cmdline_fixed_string_t config; - uint8_t port_id; + portid_t port_id; }; static void cmd_show_bonding_config_parsed(void *parsed_result, @@ -4597,7 +4597,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, { struct cmd_show_bonding_config_result *res = parsed_result; int bonding_mode, agg_mode; - uint8_t slaves[RTE_MAX_ETHPORTS]; + portid_t slaves[RTE_MAX_ETHPORTS]; int num_slaves, num_active_slaves; int primary_id; int i; @@ -11500,7 +11500,7 @@ struct cmd_vf_vlan_stripq_result { cmdline_fixed_string_t vf; cmdline_fixed_string_t vlan; cmdline_fixed_string_t stripq; - uint8_t port_id; + portid_t port_id; uint16_t vf_id; cmdline_fixed_string_t on_off; }; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3ae3e1cd8..155136dd5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -358,7 +358,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "RX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; @@ -391,7 +391,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "TX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 51170ee3e..91ee78646 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -86,12 +86,11 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index) struct timespec timestamp = {0, 0}; if (rte_eth_timesync_read_rx_timestamp(pi, ×tamp, index) < 0) { - printf("Port %u RX timestamp registers not valid\n", - (unsigned) pi); + printf("Port %u RX timestamp registers not valid\n", pi); return; } printf("Port %u RX timestamp value %lu s %lu ns\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec); + pi, timestamp.tv_sec, timestamp.tv_nsec); } #define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */ @@ -110,12 +109,12 @@ port_ieee1588_tx_timestamp_check(portid_t pi) if (wait_us >= MAX_TX_TMST_WAIT_MICROSECS) { printf("Port %u TX timestamp registers not valid after " "%u micro-seconds\n", - (unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS); + pi, MAX_TX_TMST_WAIT_MICROSECS); return; } printf("Port %u TX timestamp value %lu s %lu ns validated after " "%u micro-second%s\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, + pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, (wait_us == 1) ? "" : "s"); } @@ -148,11 +147,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type == ETHER_TYPE_1588) { printf("Port %u Received PTP packet not filtered" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); } else { printf("Port %u Received non PTP packet type=0x%4x " "len=%u\n", - (unsigned) fs->rx_port, eth_type, + fs->rx_port, eth_type, (unsigned) mb->pkt_len); } rte_pktmbuf_free(mb); @@ -161,7 +160,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type != ETHER_TYPE_1588) { printf("Port %u Received NON PTP packet incorrectly" " detected by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -175,19 +174,19 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (ptp_hdr->version != 0x02) { printf("Port %u Received PTP V2 Ethernet frame with wrong PTP" " protocol version 0x%x (should be 0x02)\n", - (unsigned) fs->rx_port, ptp_hdr->version); + fs->rx_port, ptp_hdr->version); rte_pktmbuf_free(mb); return; } if (ptp_hdr->msg_id != PTP_SYNC_MESSAGE) { printf("Port %u Received PTP V2 Ethernet frame with unexpected" " message ID 0x%x (expected 0x0 - PTP_SYNC_MESSAGE)\n", - (unsigned) fs->rx_port, ptp_hdr->msg_id); + fs->rx_port, ptp_hdr->msg_id); rte_pktmbuf_free(mb); return; } printf("Port %u IEEE1588 PTP V2 SYNC Message filtered by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); /* * Check that the received PTP packet has been timestamped by the @@ -196,7 +195,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (! (mb->ol_flags & PKT_RX_IEEE1588_TMST)) { printf("Port %u Received PTP packet not timestamped" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -216,8 +215,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) mb->ol_flags |= PKT_TX_IEEE1588_TMST; fs->tx_packets += 1; if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) { - printf("Port %u sent PTP packet dropped\n", - (unsigned) fs->rx_port); + printf("Port %u sent PTP packet dropped\n", fs->rx_port); fs->fwd_dropped += 1; rte_pktmbuf_free(mb); return; diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 2f7f70fd6..31287d71d 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -734,7 +734,7 @@ launch_args_parse(int argc, char** argv) if (!strcmp(lgopts[opt_idx].name, "nb-ports")) { n = atoi(optarg); if (n > 0 && n <= nb_ports) - nb_fwd_ports = (uint8_t) n; + nb_fwd_ports = n; else rte_exit(EXIT_FAILURE, "Invalid port %d\n", n); diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index 5ef021905..57df01468 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -122,7 +122,7 @@ pkt_burst_receive(struct fwd_stream *fs) */ if (verbose_level > 0) printf("port %u/queue %u: received %u packets\n", - (unsigned) fs->rx_port, + fs->rx_port, (unsigned) fs->rx_queue, (unsigned) nb_rx); for (i = 0; i < nb_rx; i++) { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e097ee04e..477e2e7ad 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -390,7 +390,7 @@ struct gro_status gro_ports[RTE_MAX_ETHPORTS]; /* Forward function declarations */ static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port); static void check_all_ports_link_status(uint32_t port_mask); -static int eth_event_callback(uint8_t port_id, +static int eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); @@ -1816,7 +1816,8 @@ check_all_ports_link_status(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; + portid_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("Checking link statuses...\n"); @@ -1831,14 +1832,13 @@ check_all_ports_link_status(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 */ @@ -1885,7 +1885,7 @@ rmv_event_callback(void *arg) /* This function is used by the interrupt thread */ static int -eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, +eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param) { static const char * const event_desc[] = { @@ -2328,7 +2328,7 @@ int main(int argc, char** argv) { int diag; - uint8_t port_id; + portid_t port_id; signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 1d1ee7587..657c1235c 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -78,7 +78,7 @@ #define UMA_NO_CONFIG 0xFF typedef uint8_t lcoreid_t; -typedef uint8_t portid_t; +typedef uint16_t portid_t; typedef uint16_t queueid_t; typedef uint16_t streamid_t; @@ -283,7 +283,7 @@ enum dcb_mode_enable #define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */ struct queue_stats_mappings { - uint8_t port_id; + portid_t port_id; uint16_t queue_id; uint8_t stats_counter_id; } __rte_cache_aligned; diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 3362f3350..45eb5c4a9 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -76,12 +76,6 @@ Deprecation Notices done by the EAL and not by the ``ethdev`` layer anymore. Users relying on this flag being present only have to remove their checks to follow the change. -* ABI/API changes are planned for 17.11 in all structures which include port_id - definition such as "rte_eth_dev_data", "rte_port_ethdev_reader_params", - "rte_port_ethdev_writer_params", and so on. The definition of port_id will be - changed from 8 bits to 16 bits in order to support more than 256 ports in - DPDK. All APIs which have port_id parameter will be changed at the same time. - * ethdev: An ABI change is planned for 17.11 for the structure rte_eth_dev_data. The size of the unique name will increase RTE_ETH_NAME_MAX_LEN from 32 to 64 characters to allow using a globally unique identifier (GUID) in this field. diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst index 8bf91bd40..39f75aced 100644 --- a/doc/guides/rel_notes/release_17_11.rst +++ b/doc/guides/rel_notes/release_17_11.rst @@ -41,6 +41,11 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range from uint8_t to uint16_t.** + + Increased port_id range from 8 bits to 16 bits in order to support more than + 256 ports in dpdk. All ethdev APIs which have port_id as parameter are changed + in the meantime. Resolved Issues --------------- @@ -144,7 +149,10 @@ ABI Changes Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range.** + The size of the field ``port_id`` in the ``rte_eth_dev_data`` structure + changed, as described in the `New Features` section. Shared Library Versions ----------------------- @@ -165,19 +173,19 @@ The libraries prepended with a plus sign were incremented in this version. .. code-block:: diff librte_acl.so.2 - librte_bitratestats.so.1 + librte_bitratestats.so.2 librte_cfgfile.so.2 librte_cmdline.so.2 librte_cryptodev.so.3 librte_distributor.so.1 librte_eal.so.5 - librte_ethdev.so.7 + librte_ethdev.so.8 librte_eventdev.so.2 librte_gro.so.1 librte_hash.so.2 librte_ip_frag.so.1 librte_jobstats.so.1 - librte_kni.so.2 + librte_kni.so.3 librte_kvargs.so.1 librte_latencystats.so.1 librte_lpm.so.2 @@ -186,11 +194,11 @@ The libraries prepended with a plus sign were incremented in this version. librte_meter.so.1 librte_metrics.so.1 librte_net.so.1 - librte_pdump.so.1 + librte_pdump.so.2 librte_pipeline.so.3 librte_pmd_bond.so.1 librte_pmd_ring.so.2 - librte_port.so.3 + librte_port.so.4 librte_power.so.1 librte_reorder.so.1 librte_ring.so.1 diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile index 70d517c16..4d62b7dbd 100644 --- a/drivers/net/af_packet/Makefile +++ b/drivers/net/af_packet/Makefile @@ -40,7 +40,7 @@ LIB = librte_pmd_af_packet.a EXPORT_MAP := rte_pmd_af_packet_version.map -LIBABIVER := 1 +LIBABIVER := 2 CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 9a47852ca..483b0c107 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -75,7 +75,7 @@ struct pkt_rx_queue { unsigned int framenum; struct rte_mempool *mb_pool; - uint8_t in_port; + uint16_t in_port; volatile unsigned long rx_pkts; volatile unsigned long err_pkts; diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 6db362b04..893284733 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -641,7 +641,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_tx_queues; i++) { status = eth_ark_tx_queue_stop(dev, i); if (status != 0) { - uint8_t port = dev->data->port_id; + uint16_t port = dev->data->port_id; PMD_DRV_LOG(ERR, "tx_queue stop anomaly" " port %u, queue %u\n", diff --git a/drivers/net/avp/Makefile b/drivers/net/avp/Makefile index cd465aac9..7ffb4d172 100644 --- a/drivers/net/avp/Makefile +++ b/drivers/net/avp/Makefile @@ -42,7 +42,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) EXPORT_MAP := rte_pmd_avp_version.map -LIBABIVER := 1 +LIBABIVER := 2 # install public header files to enable compilation of the hypervisor level # dpdk application diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index c746a0e2c..b5cc955f2 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -190,7 +190,7 @@ struct avp_dev { struct rte_eth_dev_data *dev_data; /**< Back pointer to ethernet device data */ volatile uint32_t flags; /**< Device operational flags */ - uint8_t port_id; /**< Ethernet port identifier */ + uint16_t port_id; /**< Ethernet port identifier */ struct rte_mempool *pool; /**< pkt mbuf mempool */ unsigned int guest_mbuf_size; /**< local pool mbuf size */ unsigned int host_mbuf_size; /**< host mbuf size */ diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile index e12310691..7a1c77523 100644 --- a/drivers/net/bnx2x/Makefile +++ b/drivers/net/bnx2x/Makefile @@ -12,7 +12,7 @@ LDLIBS += -lz EXPORT_MAP := rte_pmd_bnx2x_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) CFLAGS += -wd188 #188: enumerated type mixed with another type diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index 2e38ec26a..9600e0f1c 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -41,7 +41,7 @@ struct bnx2x_rx_queue { uint16_t rx_cq_head; /**< Index of current rcq bd. */ uint16_t rx_cq_tail; /**< Index of last rcq bd. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data. */ }; @@ -62,7 +62,7 @@ struct bnx2x_tx_queue { uint16_t nb_tx_avail; /**< Number of TX descriptors available. */ uint16_t nb_tx_pages; /**< number of TX pages */ uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data */ }; diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile index b03f65dc9..55b49b538 100644 --- a/drivers/net/bnxt/Makefile +++ b/drivers/net/bnxt/Makefile @@ -40,7 +40,7 @@ LIB = librte_pmd_bnxt.a EXPORT_MAP := rte_pmd_bnxt_version.map -LIBABIVER := 1 +LIBABIVER := 2 CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 405d94deb..26a9018b5 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -126,7 +126,7 @@ struct bnxt_pf_info { #define BNXT_FIRST_VF_FID 128 #define BNXT_PF_RINGS_USED(bp) bnxt_get_num_queues(bp) #define BNXT_PF_RINGS_AVAIL(bp) (bp->pf.max_cp_rings - BNXT_PF_RINGS_USED(bp)) - uint8_t port_id; + uint16_t port_id; uint16_t first_vf_id; uint16_t active_vfs; uint16_t max_vfs; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index c9d11228b..2e817535e 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -489,13 +489,13 @@ static void bnxt_print_link_info(struct rte_eth_dev *eth_dev) if (link->link_status) RTE_LOG(INFO, PMD, "Port %d Link Up - speed %u Mbps - %s\n", - (uint8_t)(eth_dev->data->port_id), + eth_dev->data->port_id, (uint32_t)link->link_speed, (link->link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex\n")); else RTE_LOG(INFO, PMD, "Port %d Link Down\n", - (uint8_t)(eth_dev->data->port_id)); + eth_dev->data->port_id); } static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev) diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h index 01aaa007f..cea0785d1 100644 --- a/drivers/net/bnxt/bnxt_rxq.h +++ b/drivers/net/bnxt/bnxt_rxq.h @@ -48,7 +48,7 @@ struct bnxt_rx_queue { uint16_t rx_free_thresh; /* max free RX desc to hold */ uint16_t queue_id; /* RX queue index */ uint16_t reg_idx; /* RX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ struct bnxt *bp; diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h index 16f3a0bdd..f753c10f2 100644 --- a/drivers/net/bnxt/bnxt_txq.h +++ b/drivers/net/bnxt/bnxt_txq.h @@ -46,7 +46,7 @@ struct bnxt_tx_queue { uint16_t tx_next_rs; /* next desc to set RS bit */ uint16_t queue_id; /* TX queue index */ uint16_t reg_idx; /* TX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t pthresh; /* Prefetch threshold register */ uint8_t hthresh; /* Host threshold register */ uint8_t wthresh; /* Write-back threshold reg */ diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c343d9033..63fc27911 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -67,7 +67,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) true : false; } -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -108,7 +108,7 @@ rte_pmd_bnxt_set_all_queues_drop_en_cb(struct bnxt_vnic_info *vnic, void *onptr) vnic->bd_stall = !(*on); } -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -159,7 +159,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -191,7 +191,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *eth_dev; @@ -241,7 +241,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -294,7 +294,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -350,7 +350,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq_cb(struct bnxt_vnic_info *vnic, void *onptr) } int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -385,7 +385,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -477,7 +477,7 @@ static int bnxt_set_vf_table(struct bnxt *bp, uint16_t vf) return rc; } -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct bnxt_vlan_table_entry *ve; @@ -570,7 +570,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, return rc; } -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -598,7 +598,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, return bnxt_hwrm_func_qstats(bp, bp->pf.first_vf_id + vf_id, stats); } -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -625,7 +625,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, return bnxt_hwrm_func_clr_stats(bp, bp->pf.first_vf_id + vf_id); } -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -651,7 +651,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) return bnxt_vf_vnic_count(bp, vf_id); } -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count) { struct rte_eth_dev *dev; @@ -679,7 +679,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, count); } -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr, uint32_t vf_id) { struct rte_eth_dev *dev; @@ -756,7 +756,7 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, } int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -793,7 +793,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h index c4c4770e3..f881d30d6 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.h +++ b/drivers/net/bnxt/rte_pmd_bnxt.h @@ -78,7 +78,7 @@ struct rte_pmd_bnxt_mb_event_param { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set the VF MAC address. @@ -94,7 +94,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -115,7 +115,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -134,7 +134,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -156,7 +156,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); /** @@ -173,7 +173,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -189,7 +189,7 @@ int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * Set the VF rate limit. @@ -207,7 +207,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); /** @@ -226,7 +226,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -242,7 +242,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -261,7 +261,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set RX L2 Filtering mode of a VF of an Ethernet device. @@ -280,7 +280,7 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); /** @@ -297,7 +297,7 @@ int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, * - (-ENOMEM) on an allocation failure * - (-1) firmware interface error */ -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id); /** * Queries the TX drop counter for the function @@ -313,7 +313,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); * - (-EINVAL) invalid vf_id specified. * - (-ENOTSUP) Ethernet device is not a PF */ -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count); /** @@ -331,7 +331,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, * - (-ENOTSUP) Ethernet device is not a PF * - (-ENOMEM) on an allocation failure */ -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t vf_id); /** @@ -350,5 +350,5 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on); #endif /* _PMD_BNXT_H_ */ diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile index 910c932da..ffc0c3cf7 100644 --- a/drivers/net/bonding/Makefile +++ b/drivers/net/bonding/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_eth_bond_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 8efbf0713..87ff29173 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -151,7 +151,7 @@ rte_eth_bond_free(const char *name); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Remove a slave rte_eth_dev device from the bonded device @@ -163,7 +163,7 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Set link bonding mode of bonded device @@ -175,7 +175,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode); /** * Get link bonding mode of bonded device @@ -186,7 +186,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); * link bonding mode on success, negative value otherwise */ int -rte_eth_bond_mode_get(uint8_t bonded_port_id); +rte_eth_bond_mode_get(uint16_t bonded_port_id); /** * Set slave rte_eth_dev as primary slave of bonded device @@ -198,7 +198,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Get primary slave of bonded device @@ -209,7 +209,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); * Port Id of primary slave on success, -1 on failure */ int -rte_eth_bond_primary_get(uint8_t bonded_port_id); +rte_eth_bond_primary_get(uint16_t bonded_port_id); /** * Populate an array with list of the slaves port id's of the bonded device @@ -223,7 +223,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id); * negative value otherwise */ int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Populate an array with list of the active slaves port id's of the bonded @@ -238,8 +239,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); * negative value otherwise */ int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len); +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Set explicit MAC address to use on bonded device and it's slaves. @@ -252,7 +253,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr); /** @@ -265,7 +266,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id); /** * Set the transmit policy for bonded device to use when it is operating in @@ -279,7 +280,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy); /** * Get the transmit policy set on bonded device for balance mode operation @@ -290,7 +291,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); * Balance transmit policy on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of @@ -304,7 +305,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); */ int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link @@ -316,7 +317,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); * Monitoring interval on success, negative value otherwise. */ int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id); /** @@ -330,7 +331,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the disabling of a bonded @@ -342,7 +344,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the enabling of a bonded link @@ -355,7 +357,8 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the enabling of a bonded @@ -367,7 +370,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); #ifdef __cplusplus diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index c2b9e053c..c1873aa13 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -209,7 +209,7 @@ set_warning_flags(struct port *port, uint16_t flags) } static void -show_warnings(uint8_t slave_id) +show_warnings(uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; uint8_t warnings; @@ -278,7 +278,7 @@ record_default(struct port *port) * @param port Port on which LACPDU was received. */ static void -rx_machine(struct bond_dev_private *internals, uint8_t slave_id, +rx_machine(struct bond_dev_private *internals, uint16_t slave_id, struct lacpdu *lacp) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -399,7 +399,7 @@ rx_machine(struct bond_dev_private *internals, uint8_t slave_id, * @param port Port to handle state machine. */ static void -periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) +periodic_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; /* Calculate if either site is LACP enabled */ @@ -461,7 +461,7 @@ periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port Port to handle state machine. */ static void -mux_machine(struct bond_dev_private *internals, uint8_t slave_id) +mux_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; @@ -564,7 +564,7 @@ mux_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port */ static void -tx_machine(struct bond_dev_private *internals, uint8_t slave_id) +tx_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -688,11 +688,11 @@ static void selection_logic(struct bond_dev_private *internals, uint8_t slave_id) { struct port *agg, *port; - uint8_t slaves_count, new_agg_id, i, j = 0; - uint8_t *slaves; + uint16_t slaves_count, new_agg_id, i, j = 0; + uint16_t *slaves; uint64_t agg_bandwidth[8] = {0}; uint64_t agg_count[8] = {0}; - uint8_t default_slave = 0; + uint16_t default_slave = 0; uint8_t mode_count_id, mode_band_id; struct rte_eth_link link_info; @@ -923,7 +923,8 @@ bond_mode_8023ad_periodic_cb(void *arg) } void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) +bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; @@ -951,7 +952,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) memcpy(&port->actor, &initial, sizeof(struct port_params)); /* Standard requires that port ID must be grater than 0. * Add 1 do get corresponding port_number */ - port->actor.port_number = rte_cpu_to_be_16((uint16_t)slave_id + 1); + port->actor.port_number = rte_cpu_to_be_16(slave_id + 1); memcpy(&port->partner, &initial, sizeof(struct port_params)); @@ -1022,12 +1023,12 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) int bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev, - uint8_t slave_id) + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; void *pkt = NULL; struct port *port; - uint8_t i; + uint16_t i; /* Given slave must be in active list */ RTE_ASSERT(find_slave_by_id(internals->active_slaves, @@ -1066,7 +1067,7 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) struct bond_dev_private *internals = bond_dev->data->dev_private; struct ether_addr slave_addr; struct port *slave, *agg_slave; - uint8_t slave_id, i, j; + uint16_t slave_id, i, j; bond_mode_8023ad_stop(bond_dev); @@ -1214,7 +1215,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev) void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt) + uint16_t slave_id, struct rte_mbuf *pkt) { struct mode8023ad_private *mode4 = &internals->mode4; struct port *port = &mode_8023ad_ports[slave_id]; @@ -1295,7 +1296,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } int -rte_eth_bond_8023ad_conf_get(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1312,7 +1313,7 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id, } int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection) { struct rte_eth_dev *bond_dev; @@ -1334,7 +1335,7 @@ rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, return 0; } -int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) +int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1355,7 +1356,7 @@ int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) static int -bond_8023ad_setup_validate(uint8_t port_id, +bond_8023ad_setup_validate(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { if (valid_bonded_port_id(port_id) != 0) @@ -1379,8 +1380,9 @@ bond_8023ad_setup_validate(uint8_t port_id, return 0; } + int -rte_eth_bond_8023ad_setup(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1401,7 +1403,7 @@ rte_eth_bond_8023ad_setup(uint8_t port_id, int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *info) { struct rte_eth_dev *bond_dev; @@ -1434,7 +1436,7 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, } static int -bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) +bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1462,7 +1464,8 @@ bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1482,7 +1485,8 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) } int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1502,7 +1506,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) } int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1516,7 +1520,7 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1530,7 +1534,7 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct port *port; @@ -1591,7 +1595,7 @@ bond_mode_8023ad_ext_periodic_cb(void *arg) } int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; @@ -1615,7 +1619,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) } int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index d609745e0..2874336d3 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -64,7 +64,7 @@ extern "C" { #define MARKER_TLV_TYPE_INFO 0x01 #define MARKER_TLV_TYPE_RESP 0x02 -typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint8_t slave_id, +typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t slave_id, struct rte_mbuf *lacp_pkt); enum rte_bond_8023ad_selection { @@ -176,7 +176,7 @@ struct rte_eth_bond_8023ad_slave_info { struct port_params actor; uint8_t partner_state; struct port_params partner; - uint8_t agg_port_id; + uint16_t agg_port_id; }; /** @@ -192,7 +192,7 @@ struct rte_eth_bond_8023ad_slave_info { * -EINVAL if conf is NULL */ int -rte_eth_bond_8023ad_conf_get(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -207,7 +207,7 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id, * -EINVAL if configuration is invalid. */ int -rte_eth_bond_8023ad_setup(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -223,7 +223,7 @@ rte_eth_bond_8023ad_setup(uint8_t port_id, * bonded device or is not inactive). */ int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *conf); #ifdef __cplusplus @@ -241,7 +241,8 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get COLLECTING flag from slave port actor state. @@ -254,7 +255,7 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id); /** * Configure a slave port to start distributing. @@ -267,7 +268,8 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get DISTRIBUTING flag from slave port actor state. @@ -280,7 +282,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id); /** * LACPDU transmit path for external 802.3ad state machine. Caller retains @@ -294,7 +296,7 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, struct rte_mbuf *lacp_pkt); /** @@ -320,7 +322,7 @@ rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id); /** * Disable slow queue on slaves @@ -337,7 +339,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); * */ int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port_id); /* * Get aggregator mode for 8023ad @@ -347,7 +349,7 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); * agregator mode on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); +rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id); /** * Set aggregator mode for 8023ad @@ -356,6 +358,6 @@ rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h index d46e44a84..433c7000d 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h @@ -279,7 +279,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *dev); */ void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt); + uint16_t slave_id, struct rte_mbuf *pkt); /** * @internal @@ -293,7 +293,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, * 0 on success, negative value otherwise. */ void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); +bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint16_t port_id); /** * @internal @@ -307,7 +307,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); * 0 on success, negative value otherwise. */ int -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint8_t slave_pos); +bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint16_t slave_pos); /** * Updates state when MAC was changed on bonded device or one of its slaves. @@ -318,12 +318,12 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev); int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port); + uint16_t slave_port); int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port); +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port); int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id); +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index d9d37495d..f7efbb78e 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -148,7 +148,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, rte_spinlock_unlock(&internals->mode6.lock); } -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals) { @@ -220,13 +220,13 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, return internals->current_primary_port; } -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals) { struct ether_hdr *eth_h; struct arp_hdr *arp_h; - uint8_t slave_idx; + uint16_t slave_idx; rte_spinlock_lock(&internals->mode6.lock); eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h index fd7c3aeb4..9f17f7c85 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.h +++ b/drivers/net/bonding/rte_eth_bond_alb.h @@ -51,7 +51,7 @@ struct client_data { uint32_t cli_ip; /**< Client IP address */ - uint8_t slave_idx; + uint16_t slave_idx; /**< Index of slave on which we connect with that client */ uint8_t in_use; /**< Flag indicating if entry in client table is currently used */ @@ -113,7 +113,7 @@ bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slave on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals); @@ -127,7 +127,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slawe on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals); diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index de1d9e0db..529aae34e 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -56,14 +56,14 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) } int -valid_bonded_port_id(uint8_t port_id) +valid_bonded_port_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return check_for_bonded_ethdev(&rte_eth_devices[port_id]); } int -valid_slave_port_id(uint8_t port_id, uint8_t mode) +valid_slave_port_id(uint16_t port_id, uint8_t mode) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); @@ -80,7 +80,7 @@ valid_slave_port_id(uint8_t port_id, uint8_t mode) } void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -107,11 +107,11 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) } void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { - uint8_t slave_pos; + uint16_t slave_pos; struct bond_dev_private *internals = eth_dev->data->dev_private; - uint8_t active_count = internals->active_slave_count; + uint16_t active_count = internals->active_slave_count; if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_stop(eth_dev); @@ -153,7 +153,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) { struct bond_dev_private *internals; char devargs[52]; - uint8_t port_id; + uint16_t port_id; int ret; if (name == NULL) { @@ -193,7 +193,7 @@ rte_eth_bond_free(const char *name) } static int -slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) +slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -233,7 +233,7 @@ slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev; struct bond_dev_private *internals; @@ -363,7 +363,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -387,7 +387,8 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_remove_lock_free(uint16_t bonded_port_id, + uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -466,7 +467,7 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -488,7 +489,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) { if (valid_bonded_port_id(bonded_port_id) != 0) return -1; @@ -497,7 +498,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) } int -rte_eth_bond_mode_get(uint8_t bonded_port_id) +rte_eth_bond_mode_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -510,7 +511,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id) } int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct bond_dev_private *internals; @@ -531,7 +532,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_primary_get(uint8_t bonded_port_id) +rte_eth_bond_primary_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -547,7 +548,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id) } int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; uint8_t i; @@ -570,8 +572,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) } int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len) +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; @@ -586,13 +588,14 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], if (internals->active_slave_count > len) return -1; - memcpy(slaves, internals->active_slaves, internals->active_slave_count); + memcpy(slaves, internals->active_slaves, + internals->active_slave_count * sizeof(internals->active_slaves[0])); return internals->active_slave_count; } int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *bonded_eth_dev; @@ -618,7 +621,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, } int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -647,7 +650,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) } int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) { struct bond_dev_private *internals; @@ -677,7 +680,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) } int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -690,7 +693,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms) { struct bond_dev_private *internals; @@ -704,7 +707,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) } int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -717,7 +720,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms) { struct bond_dev_private *internals; @@ -732,7 +736,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -745,7 +749,7 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; @@ -760,7 +764,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index bb634c62e..04d1f4e8f 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -153,7 +153,7 @@ bond_ethdev_parse_slave_port_kvarg(const char *key, return -1; } else slave_ports->slaves[slave_ports->slave_count++] = - (uint8_t)port_id; + port_id; } return 0; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 3ee70baa0..2d680e3fb 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -174,7 +174,7 @@ const struct rte_flow_attr flow_attr_8023ad = { int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port) { + uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); @@ -202,12 +202,12 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, } int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { struct rte_eth_dev *bond_dev = &rte_eth_devices[port_id]; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); struct rte_eth_dev_info bond_info, slave_info; - uint8_t idx; + uint16_t idx; /* Verify if all slaves in bonding supports flow director and */ if (internals->slave_count > 0) { @@ -230,7 +230,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { } int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port) { +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) @@ -270,10 +270,10 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; struct bond_dev_private *internals = bd_rx_q->dev_private; uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count; - uint8_t i, idx; + uint16_t i, idx; /* Copy slave list to protect against slave up/down changes during tx * bursting */ @@ -302,8 +302,8 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -394,8 +394,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW); uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count, idx; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count, idx; uint8_t collecting; /* current slave collecting status */ const uint8_t promisc = internals->promiscuous_en; @@ -673,8 +673,8 @@ bond_ethdev_tx_burst_round_robin(void *queue, struct rte_mbuf **bufs, struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts]; uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] = { 0 }; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave; @@ -904,7 +904,7 @@ bandwidth_cmp(const void *a, const void *b) } static void -bandwidth_left(uint8_t port_id, uint64_t load, uint8_t update_idx, +bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx, struct bwg_slave *bwg_slave) { struct rte_eth_link link_status; @@ -970,10 +970,10 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct rte_eth_dev *primary_port = &rte_eth_devices[internals->primary_port]; uint16_t num_tx_total = 0; - uint8_t i, j; + uint16_t i, j; - uint8_t num_of_slaves = internals->active_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves = internals->active_slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct ether_hdr *ether_hdr; struct ether_addr primary_slave_addr; @@ -1059,7 +1059,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t num_send, num_not_send = 0; uint16_t num_tx_total = 0; - uint8_t slave_idx; + uint16_t slave_idx; int i, j; @@ -1178,8 +1178,8 @@ bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave = 0, tx_fail_total = 0; @@ -1239,8 +1239,8 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -1333,7 +1333,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs, struct bond_tx_queue *bd_tx_q; uint8_t tx_failed_flag = 0, num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t max_nb_of_tx_pkts = 0; @@ -1861,7 +1861,7 @@ slave_add(struct bond_dev_private *internals, void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id) + uint16_t slave_port_id) { int i; @@ -2125,7 +2125,7 @@ static int bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { int res; - uint8_t i; + uint16_t i; struct bond_dev_private *internals = dev->data->dev_private; /* don't do this while a slave is being added */ @@ -2137,7 +2137,7 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) rte_bitmap_clear(internals->vlan_filter_bmp, vlan_id); for (i = 0; i < internals->slave_count; i++) { - uint8_t port_id = internals->slaves[i].port_id; + uint16_t port_id = internals->slaves[i].port_id; res = rte_eth_dev_vlan_filter(port_id, vlan_id, on); if (res == ENOTSUP) @@ -2277,7 +2277,7 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) static int bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) { - void (*link_update)(uint8_t port_id, struct rte_eth_link *eth_link); + void (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); struct bond_dev_private *bond_ctx; struct rte_eth_link slave_link; @@ -2466,7 +2466,7 @@ bond_ethdev_delayed_lsc_propagation(void *arg) } int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param __rte_unused) { struct rte_eth_dev *bonded_eth_dev; @@ -2951,7 +2951,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) struct bond_dev_private *internals = dev->data->dev_private; struct rte_kvargs *kvlist = internals->kvlist; int arg_count; - uint8_t port_id = dev - rte_eth_devices; + uint16_t port_id = dev - rte_eth_devices; uint8_t agg_mode; static const uint8_t default_rss_key[40] = { @@ -3086,7 +3086,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Parse/set primary slave port id*/ arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); if (arg_count == 1) { - uint8_t primary_slave_port_id; + uint16_t primary_slave_port_id; if (rte_kvargs_process(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG, @@ -3099,7 +3099,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } /* Set balance mode transmit policy*/ - if (rte_eth_bond_primary_set(port_id, (uint8_t)primary_slave_port_id) + if (rte_eth_bond_primary_set(port_id, primary_slave_port_id) != 0) { RTE_LOG(ERR, EAL, "Failed to set primary slave port %d on bonded device %s\n", diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 1fe6ff880..1392da98d 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -93,12 +93,12 @@ struct bond_tx_queue { /** Bonded slave devices structure */ struct bond_ethdev_slave_ports { - uint8_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ - uint8_t slave_count; /**< Number of slaves */ + uint16_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ + uint16_t slave_count; /**< Number of slaves */ }; struct bond_slave_details { - uint8_t port_id; + uint16_t port_id; uint8_t link_status_poll_enabled; uint8_t link_status_wait_to_complete; @@ -114,14 +114,14 @@ typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count) /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { - uint8_t port_id; /**< Port Id of Bonded Port */ + uint16_t port_id; /**< Port Id of Bonded Port */ uint8_t mode; /**< Link Bonding Mode */ rte_spinlock_t lock; - uint8_t primary_port; /**< Primary Slave Port */ - uint8_t current_primary_port; /**< Primary Slave Port */ - uint8_t user_defined_primary_port; + uint16_t primary_port; /**< Primary Slave Port */ + uint16_t current_primary_port; /**< Primary Slave Port */ + uint16_t user_defined_primary_port; /**< Flag for whether primary port is user defined or not */ uint8_t balance_xmit_policy; @@ -144,16 +144,17 @@ struct bond_dev_private { uint16_t nb_rx_queues; /**< Total number of rx queues */ uint16_t nb_tx_queues; /**< Total number of tx queues*/ - uint8_t active_slave; /**< Next active_slave to poll */ - uint8_t active_slave_count; /**< Number of active slaves */ - uint8_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ + uint16_t active_slave; /**< Next active_slave to poll */ + uint16_t active_slave_count; /**< Number of active slaves */ + uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ - uint8_t slave_count; /**< Number of bonded slaves */ + uint16_t slave_count; /**< Number of bonded slaves */ struct bond_slave_details slaves[RTE_MAX_ETHPORTS]; /**< Arary of bonded slaves details */ struct mode8023ad_private mode4; - uint8_t tlb_slaves_order[RTE_MAX_ETHPORTS]; /* TLB active slaves send order */ + uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS]; + /**< TLB active slaves send order */ struct mode_alb_private mode6; uint32_t rx_offload_capa; /** Rx offload capability */ @@ -186,10 +187,10 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); /* Search given slave array to find position of given id. * Return slave pos or slaves_count if not found. */ -static inline uint8_t -find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { +static inline uint16_t +find_slave_by_id(uint16_t *slaves, uint16_t slaves_count, uint16_t slave_id) { - uint8_t pos; + uint16_t pos; for (pos = 0; pos < slaves_count; pos++) { if (slave_id == slaves[pos]) break; @@ -199,19 +200,19 @@ find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { } int -valid_port_id(uint8_t port_id); +valid_port_id(uint16_t port_id); int -valid_bonded_port_id(uint8_t port_id); +valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(uint8_t port_id, uint8_t mode); +valid_slave_port_id(uint16_t port_id, uint8_t mode); void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void link_properties_set(struct rte_eth_dev *bonded_eth_dev, @@ -255,10 +256,10 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count); void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id); + uint16_t slave_port_id); int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); int diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile index ffdf36d37..a94ac7605 100644 --- a/drivers/net/e1000/Makefile +++ b/drivers/net/e1000/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_e1000_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) # diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 3d4ab9368..a59947d78 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1624,7 +1624,7 @@ eth_em_interrupt_action(struct rte_eth_dev *dev, rte_em_dev_atomic_read_link_status(dev, &link); if (link.link_status) { PMD_INIT_LOG(INFO, " Port %d: Link Up - speed %u Mbps - %s", - dev->data->port_id, (unsigned)link.link_speed, + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); } else { diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 31819c5bd..06ba68e39 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -119,7 +119,7 @@ struct em_rx_queue { uint16_t nb_rx_hold; /**< number of held free RX desc. */ uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -186,7 +186,7 @@ struct em_tx_queue { /** Total number of TX descriptors ready to be allocated. */ uint16_t nb_tx_free; uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 1c80a2a1b..a800d9c2b 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -122,7 +122,7 @@ struct igb_rx_queue { uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -191,7 +191,7 @@ struct igb_tx_queue { /**< Index of first used TX descriptor. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/failsafe/Makefile b/drivers/net/failsafe/Makefile index d516d3621..e6bfad728 100644 --- a/drivers/net/failsafe/Makefile +++ b/drivers/net/failsafe/Makefile @@ -36,7 +36,7 @@ LIB = librte_pmd_failsafe.a EXPORT_MAP := rte_pmd_failsafe_version.map -LIBABIVER := 1 +LIBABIVER := 2 # Sources are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += failsafe.c diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index a3a8cce95..1c8a9337e 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -400,7 +400,7 @@ failsafe_eth_dev_state_sync(struct rte_eth_dev *dev) } int -failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_rmv_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { @@ -419,7 +419,7 @@ failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, } int -failsafe_eth_lsc_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 0361cf434..4ae6e6c5f 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -180,10 +180,10 @@ int failsafe_eal_uninit(struct rte_eth_dev *dev); int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev); void failsafe_dev_remove(struct rte_eth_dev *dev); -int failsafe_eth_rmv_event_callback(uint8_t port_id, +int failsafe_eth_rmv_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *arg, void *out); -int failsafe_eth_lsc_event_callback(uint8_t port_id, +int failsafe_eth_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *out); diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile index e0024f052..5034064e4 100644 --- a/drivers/net/fm10k/Makefile +++ b/drivers/net/fm10k/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_fm10k_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) # diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h index 8e1a95062..060982b10 100644 --- a/drivers/net/fm10k/fm10k.h +++ b/drivers/net/fm10k/fm10k.h @@ -204,7 +204,7 @@ struct fm10k_rx_queue { uint16_t rxrearm_nb; /* number of remaining to be re-armed */ uint16_t rxrearm_start; /* the idx we start the re-arming from */ uint16_t rx_using_sse; /* indicates that vector RX is in use */ - uint8_t port_id; + uint16_t port_id; uint8_t drop_en; uint8_t rx_deferred_start; /* don't start this queue in dev start. */ uint16_t rx_ftag_en; /* indicates FTAG RX supported */ @@ -241,7 +241,7 @@ struct fm10k_tx_queue { volatile uint32_t *tail_ptr; uint32_t txq_flags; /* Holds flags for this TXq */ uint16_t nb_desc; - uint8_t port_id; + uint16_t port_id; uint8_t tx_deferred_start; /** don't start this queue in dev start. */ uint16_t queue_id; uint16_t tx_ftag_en; /* indicates FTAG TX supported */ @@ -289,7 +289,7 @@ static inline uint16_t fifo_remove(struct fifo *fifo) } static inline void -fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint8_t in_port) +fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint16_t in_port) { rte_mbuf_refcnt_set(mb, 1); mb->next = NULL; diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index 55c79a60a..1290d7f32 100644 --- a/drivers/net/i40e/Makefile +++ b/drivers/net/i40e/Makefile @@ -42,7 +42,7 @@ CFLAGS += -DX722_A0_SUPPORT EXPORT_MAP := rte_pmd_i40e_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # Add extra flags for base driver files (also known as shared code) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f12aefa5d..c4c6aec1d 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1920,8 +1920,9 @@ i40e_dev_start(struct rte_eth_dev *dev) hw->adapter_stopped = 0; if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; autonegotiation disabled", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, autonegotiation disabled", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index 20084d649..ff2ab8575 100644 --- a/drivers/net/i40e/i40e_rxtx.h +++ b/drivers/net/i40e/i40e_rxtx.h @@ -121,7 +121,7 @@ struct i40e_rx_queue { uint16_t rxrearm_start; /**< the idx we start the re-arming from */ uint64_t mbuf_initializer; /**< value to init mbufs */ - uint8_t port_id; /**< device port ID */ + uint16_t port_id; /**< device port ID */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise */ uint16_t queue_id; /**< RX queue index */ uint16_t reg_idx; /**< RX queue register index */ @@ -167,7 +167,7 @@ struct i40e_tx_queue { uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; uint32_t txq_flags; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index f12b7f4a1..3728d39b9 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -41,7 +41,7 @@ #include "rte_pmd_i40e.h" int -rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) +rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -66,7 +66,7 @@ rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) } int -rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -170,7 +170,7 @@ i40e_add_rm_all_vlan_filter(struct i40e_vsi *vsi, uint8_t add) } int -rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -430,7 +430,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on) } int -rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -473,7 +473,7 @@ rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -514,7 +514,7 @@ rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -555,7 +555,7 @@ rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr) { struct i40e_mac_filter *f; @@ -598,7 +598,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, /* Set vlan strip on/off for specific VF from host */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -633,7 +633,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) return ret; } -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -698,7 +698,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; @@ -764,7 +764,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on) +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -858,7 +858,7 @@ i40e_vlan_filter_count(struct i40e_vsi *vsi) return count; } -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -941,7 +941,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, } int -rte_pmd_i40e_get_vf_stats(uint8_t port, +rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -986,7 +986,7 @@ rte_pmd_i40e_get_vf_stats(uint8_t port, } int -rte_pmd_i40e_reset_vf_stats(uint8_t port, +rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -1020,7 +1020,7 @@ rte_pmd_i40e_reset_vf_stats(uint8_t port, } int -rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) +rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1109,7 +1109,7 @@ rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) } int -rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight) { struct rte_eth_dev *dev; @@ -1223,7 +1223,7 @@ rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw) { struct rte_eth_dev *dev; @@ -1341,7 +1341,7 @@ rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map) +rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1513,7 +1513,7 @@ i40e_add_rm_profile_info(struct i40e_hw *hw, uint8_t *profile_info_sec) /* Check if the profile info exists */ static int -i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) +i40e_check_profile_info(uint16_t port, uint8_t *profile_info_sec) { struct rte_eth_dev *dev = &rte_eth_devices[port]; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1557,7 +1557,7 @@ i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) } int -rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op) { @@ -1863,7 +1863,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg_buff, uint32_t pkg_size, } int -rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size) +rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size) { struct rte_eth_dev *dev; struct i40e_hw *hw; @@ -1991,7 +1991,7 @@ static int check_invalid_ptype_mapping( int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive) @@ -2027,7 +2027,7 @@ rte_pmd_i40e_ptype_mapping_update( return 0; } -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port) { struct rte_eth_dev *dev; @@ -2044,7 +2044,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) } int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -2078,7 +2078,7 @@ int rte_pmd_i40e_ptype_mapping_get( return 0; } -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type) diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h index 356fa89d7..7f32a59b1 100644 --- a/drivers/net/i40e/rte_pmd_i40e.h +++ b/drivers/net/i40e/rte_pmd_i40e.h @@ -157,7 +157,7 @@ struct rte_pmd_i40e_ptype_mapping { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); +int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf); /** * Enable/Disable VF MAC anti spoofing. @@ -174,7 +174,7 @@ int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -193,7 +193,7 @@ int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -210,7 +210,7 @@ int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_tx_loopback(uint8_t port, +int rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on); /** @@ -228,7 +228,7 @@ int rte_pmd_i40e_set_tx_loopback(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -247,7 +247,7 @@ int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -271,7 +271,7 @@ int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr); /** @@ -291,7 +291,7 @@ int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, * - (-EINVAL) if bad parameter. */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -309,7 +309,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id); /** @@ -328,7 +328,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on); /** @@ -347,7 +347,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on); /** * Enable/Disable VF VLAN filter @@ -368,7 +368,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on); /** @@ -393,7 +393,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_vf_stats(uint8_t port, +int rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -409,7 +409,7 @@ int rte_pmd_i40e_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_reset_vf_stats(uint8_t port, +int rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -434,7 +434,7 @@ int rte_pmd_i40e_reset_vf_stats(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw); @@ -459,7 +459,7 @@ int rte_pmd_i40e_set_vf_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, +int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight); @@ -484,7 +484,7 @@ int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw); @@ -502,7 +502,7 @@ int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); +int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map); /** * Load/Unload a ddp package @@ -523,7 +523,7 @@ int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); * - (-EACCES) if profile does not exist. * - (-ENOTSUP) if operation not supported. */ -int rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op); @@ -561,7 +561,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); +int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size); /** * Update hardware defined ptype to software defined packet type @@ -581,7 +581,7 @@ int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); * set other PTYPEs maps to PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive); @@ -593,7 +593,7 @@ int rte_pmd_i40e_ptype_mapping_update( * @param port * pointer to port identifier of the device */ -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port); /** * Get hardware defined ptype to software defined ptype @@ -612,7 +612,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -632,7 +632,7 @@ int rte_pmd_i40e_ptype_mapping_get( * @param pkt_type * the new packet type to overwrite */ -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type); diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index 5e57cb353..18ad4feca 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_ixgbe_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) # diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 9ca5cbcd3..d873c409f 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2508,8 +2508,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev) * - fixed speed: TODO implement */ if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; fix speed not supported", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, fix speed not supported", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 85feb0bdc..81c527fad 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -148,7 +148,7 @@ struct ixgbe_rx_queue { uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ uint16_t pkt_type_mask; /**< Packet type mask for different NICs. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise. */ uint8_t drop_en; /**< If not 0, set SRRCTL.Drop_En. */ uint8_t rx_deferred_start; /**< not in global dev start. */ @@ -237,7 +237,7 @@ struct ixgbe_tx_queue { uint16_t tx_next_rs; /**< next desc to set RS bit */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 79897ff64..f12737857 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -38,7 +38,7 @@ #include "rte_pmd_ixgbe.h" int -rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct ixgbe_hw *hw; @@ -73,7 +73,7 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) +rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf) { struct ixgbe_hw *hw; struct ixgbe_vf_info *vfinfo; @@ -105,7 +105,7 @@ rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) } int -rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -135,7 +135,7 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -164,7 +164,7 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) +rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -200,7 +200,7 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) } int -rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -230,7 +230,7 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -260,7 +260,7 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -295,7 +295,7 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -342,7 +342,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { int val = 0; @@ -389,7 +389,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -439,7 +439,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -489,7 +489,7 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct rte_eth_dev *dev; @@ -524,7 +524,7 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, } int -rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *dev; @@ -540,7 +540,7 @@ rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) +rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -623,7 +623,7 @@ rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) } int -rte_pmd_ixgbe_macsec_disable(uint8_t port) +rte_pmd_ixgbe_macsec_disable(uint16_t port) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -687,7 +687,7 @@ rte_pmd_ixgbe_macsec_disable(uint8_t port) } int -rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) +rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -712,7 +712,7 @@ rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) } int -rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) +rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -738,7 +738,7 @@ rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) } int -rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -794,7 +794,7 @@ rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -837,7 +837,7 @@ rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight) { @@ -911,7 +911,7 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, #ifdef RTE_LIBRTE_IXGBE_BYPASS int -rte_pmd_ixgbe_bypass_init(uint8_t port_id) +rte_pmd_ixgbe_bypass_init(uint16_t port_id) { struct rte_eth_dev *dev; @@ -926,7 +926,7 @@ rte_pmd_ixgbe_bypass_init(uint8_t port_id) } int -rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) +rte_pmd_ixgbe_bypass_state_show(uint16_t port_id, uint32_t *state) { struct rte_eth_dev *dev; @@ -940,7 +940,7 @@ rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) } int -rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) +rte_pmd_ixgbe_bypass_state_set(uint16_t port_id, uint32_t *new_state) { struct rte_eth_dev *dev; @@ -954,7 +954,7 @@ rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) } int -rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_show(uint16_t port_id, uint32_t event, uint32_t *state) { @@ -970,7 +970,7 @@ rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_store(uint16_t port_id, uint32_t event, uint32_t state) { @@ -986,7 +986,7 @@ rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) +rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port_id, uint32_t timeout) { struct rte_eth_dev *dev; @@ -1000,7 +1000,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) } int -rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) +rte_pmd_ixgbe_bypass_ver_show(uint16_t port_id, uint32_t *ver) { struct rte_eth_dev *dev; @@ -1014,7 +1014,7 @@ rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) } int -rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) +rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port_id, uint32_t *wd_timeout) { struct rte_eth_dev *dev; @@ -1028,7 +1028,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) } int -rte_pmd_ixgbe_bypass_wd_reset(uint8_t port_id) +rte_pmd_ixgbe_bypass_wd_reset(uint16_t port_id) { struct rte_eth_dev *dev; diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index d33c285db..81b18f876 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -53,7 +53,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); +int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf); /** * Set the VF MAC address. @@ -69,7 +69,7 @@ int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -87,7 +87,8 @@ int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, + uint8_t on); /** * Enable/Disable VF MAC anti spoofing. @@ -104,7 +105,7 @@ int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -122,7 +123,7 @@ int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -139,7 +140,7 @@ int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -155,7 +156,7 @@ int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * set drop enable bit in the VF split rx control register @@ -174,7 +175,7 @@ int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan strip for all queues in a pool @@ -194,7 +195,7 @@ int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable MACsec offload. @@ -212,7 +213,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); +int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp); /** * Disable MACsec offload. @@ -224,7 +225,7 @@ int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_disable(uint8_t port); +int rte_pmd_ixgbe_macsec_disable(uint16_t port); /** * Configure Tx SC (Secure Connection). @@ -238,7 +239,7 @@ int rte_pmd_ixgbe_macsec_disable(uint8_t port); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); +int rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac); /** * Configure Rx SC (Secure Connection). @@ -254,7 +255,7 @@ int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); +int rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi); /** * Enable Tx SA (Secure Association). @@ -275,7 +276,7 @@ int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +int rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key); /** @@ -297,7 +298,7 @@ int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key); /** @@ -323,7 +324,8 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, + uint8_t on); /** * Enable or disable a VF traffic receive of an Ethernet device. @@ -342,7 +344,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable or disable a VF traffic transmit of the Ethernet device. @@ -361,7 +363,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable hardware VF VLAN filtering by an Ethernet device of @@ -383,7 +385,8 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, + uint64_t vf_mask, uint8_t vlan_on); /** * Set the rate limitation for a vf on an Ethernet device. @@ -402,7 +405,8 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); +int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, + uint16_t tx_rate, uint64_t q_msk); /** * Set all the TCs' bandwidth weight. @@ -423,7 +427,7 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +int rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight); @@ -439,7 +443,7 @@ int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_init(uint8_t port); +int rte_pmd_ixgbe_bypass_init(uint16_t port); /** * Return bypass state. @@ -456,7 +460,7 @@ int rte_pmd_ixgbe_bypass_init(uint8_t port); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); +int rte_pmd_ixgbe_bypass_state_show(uint16_t port, uint32_t *state); /** * Set bypass state @@ -473,7 +477,7 @@ int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); +int rte_pmd_ixgbe_bypass_state_set(uint16_t port, uint32_t *new_state); /** * Return bypass state when given event occurs. @@ -497,7 +501,7 @@ int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_show(uint8_t port, +int rte_pmd_ixgbe_bypass_event_show(uint16_t port, uint32_t event, uint32_t *state); @@ -523,7 +527,7 @@ int rte_pmd_ixgbe_bypass_event_show(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_store(uint8_t port, +int rte_pmd_ixgbe_bypass_event_store(uint16_t port, uint32_t event, uint32_t state); @@ -547,7 +551,7 @@ int rte_pmd_ixgbe_bypass_event_store(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port, uint32_t timeout); /** * Get bypass firmware version. @@ -561,7 +565,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); +int rte_pmd_ixgbe_bypass_ver_show(uint16_t port, uint32_t *ver); /** * Return bypass watchdog timeout in seconds @@ -583,7 +587,7 @@ int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port, uint32_t *wd_timeout); /** * Reset bypass watchdog timer @@ -595,7 +599,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_reset(uint8_t port); +int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port); /** diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 7de1d1086..238a64f43 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -112,14 +112,14 @@ struct rxq { unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ unsigned int cqe_n:4; /* Log 2 of CQ elements. */ unsigned int elts_n:4; /* Log 2 of Mbufs. */ - unsigned int port_id:8; unsigned int rss_hash:1; /* RSS hash result is enabled. */ unsigned int mark:1; /* Marked flow available on the queue. */ unsigned int pending_err:1; /* CQE error needs to be handled. */ unsigned int trim_elts:1; /* Whether elts needs clean-up. */ - unsigned int :6; /* Remaining bits. */ + unsigned int :14; /* Remaining bits. */ volatile uint32_t *rq_db; volatile uint32_t *cq_db; + uint16_t port_id; uint16_t rq_ci; uint16_t rq_pi; uint16_t cq_ci; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 92b03c4cb..f1b968fc2 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1240,12 +1240,12 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev) nfp_net_dev_atomic_read_link_status(dev, &link); if (link.link_status) RTE_LOG(INFO, PMD, "Port %d: Link Up - speed %u Mbps - %s\n", - (int)(dev->data->port_id), (unsigned)link.link_speed, + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); else RTE_LOG(INFO, PMD, " Port %d: Link Down\n", - (int)(dev->data->port_id)); + dev->data->port_id); RTE_LOG(INFO, PMD, "PCI Address: %04d:%02d:%02d:%d\n", pci_dev->addr.domain, pci_dev->addr.bus, @@ -1549,7 +1549,7 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, "tx_free_thresh must be less than the number of TX " "descriptors. (tx_free_thresh=%u port=%d " "queue=%d)\n", (unsigned int)tx_free_thresh, - (int)dev->data->port_id, (int)queue_idx); + dev->data->port_id, (int)queue_idx); return -(EINVAL); } @@ -1847,9 +1847,9 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) */ new_mb = rte_pktmbuf_alloc(rxq->mem_pool); if (unlikely(new_mb == NULL)) { - RTE_LOG_DP(DEBUG, PMD, "RX mbuf alloc failed port_id=%u " - "queue_id=%u\n", (unsigned)rxq->port_id, - (unsigned)rxq->qidx); + RTE_LOG_DP(DEBUG, PMD, + "RX mbuf alloc failed port_id=%u queue_id=%u\n", + rxq->port_id, (unsigned int)rxq->qidx); nfp_net_mbuf_alloc_failed(rxq); break; } @@ -1933,7 +1933,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) return nb_hold; PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, nb_hold); + rxq->port_id, (unsigned int)rxq->qidx, nb_hold); nb_hold += rxq->nb_rx_hold; @@ -1944,7 +1944,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rte_wmb(); if (nb_hold > rxq->rx_free_thresh) { PMD_RX_LOG(DEBUG, "port=%u queue=%u nb_hold=%u avail=%u\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, + rxq->port_id, (unsigned int)rxq->qidx, (unsigned)nb_hold, (unsigned)avail); nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, nb_hold); nb_hold = 0; diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h index eec56bc1c..828d0d35b 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -250,7 +250,7 @@ struct nfp_net_txq { uint32_t tx_hthresh; /* not used by now. Future? */ uint32_t tx_wthresh; /* not used by now. Future? */ uint32_t txq_flags; /* not used by now. Future? */ - uint8_t port_id; + uint16_t port_id; int qidx; int tx_qcidx; __le64 dma; diff --git a/drivers/net/null/Makefile b/drivers/net/null/Makefile index 77810bced..fdd7c5813 100644 --- a/drivers/net/null/Makefile +++ b/drivers/net/null/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_null_version.map -LIBABIVER := 2 +LIBABIVER := 3 # # all source are stored in SRCS-y diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 5aef0591e..fa9313dec 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -68,7 +68,7 @@ struct null_queue { struct pmd_internals { unsigned packet_size; unsigned packet_copy; - uint8_t port_id; + uint16_t port_id; struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT]; struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT]; diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile index 7ebd0bef2..f731b126e 100644 --- a/drivers/net/pcap/Makefile +++ b/drivers/net/pcap/Makefile @@ -43,7 +43,7 @@ LDLIBS += -lpcap EXPORT_MAP := rte_pmd_pcap_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index defb3b419..b51f16cbd 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -75,7 +75,7 @@ struct queue_stat { struct pcap_rx_queue { pcap_t *pcap; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; struct queue_stat rx_stat; char name[PATH_MAX]; diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h index 9864bb448..96f0d351d 100644 --- a/drivers/net/qede/qede_if.h +++ b/drivers/net/qede/qede_if.h @@ -97,7 +97,7 @@ struct qed_link_output { uint32_t speed; /* In Mb/s */ uint32_t adv_speed; /* Speed mask */ uint8_t duplex; /* In DUPLEX defs */ - uint8_t port; /* In PORT defs */ + uint16_t port; /* In PORT defs */ bool autoneg; uint32_t pause_config; }; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 464d3d384..e3fa7b0e2 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -394,7 +394,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], }; char args_str[32] = { 0 }; char ring_name[32] = { 0 }; - uint8_t port_id = RTE_MAX_ETHPORTS; + uint16_t port_id = RTE_MAX_ETHPORTS; int ret; /* do some parameter checking */ diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 9c0d57cc1..d141acf0e 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -71,7 +71,7 @@ struct szedata2_rx_queue { struct szedata *sze; uint8_t rx_channel; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; volatile uint64_t rx_pkts; volatile uint64_t rx_bytes; diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h index 4ee6c3bb0..e54a96f8e 100644 --- a/drivers/net/thunderx/nicvf_struct.h +++ b/drivers/net/thunderx/nicvf_struct.h @@ -100,7 +100,7 @@ struct nicvf_rxq { uint16_t queue_id; uint16_t precharge_cnt; uint8_t rx_drop_en; - uint8_t port_id; + uint16_t port_id; uint8_t rbptr_offset; } __rte_cache_aligned; diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile index 3ba8ad64f..258a917c7 100644 --- a/drivers/net/vhost/Makefile +++ b/drivers/net/vhost/Makefile @@ -43,7 +43,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_vhost_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 0dac5e60e..04179b4db 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -105,7 +105,7 @@ struct vhost_queue { rte_atomic32_t while_queuing; struct pmd_internal *internal; struct rte_mempool *mb_pool; - uint8_t port; + uint16_t port; uint16_t virtqueue_id; struct vhost_stats stats; }; @@ -705,7 +705,7 @@ static struct vhost_device_ops vhost_ops = { }; int -rte_eth_vhost_get_queue_event(uint8_t port_id, +rte_eth_vhost_get_queue_event(uint16_t port_id, struct rte_eth_vhost_queue_event *event) { struct rte_vhost_vring_state *state; @@ -742,7 +742,7 @@ rte_eth_vhost_get_queue_event(uint8_t port_id, } int -rte_eth_vhost_get_vid_from_port_id(uint8_t port_id) +rte_eth_vhost_get_vid_from_port_id(uint16_t port_id) { struct internal_list *list; struct rte_eth_dev *eth_dev; diff --git a/drivers/net/vhost/rte_eth_vhost.h b/drivers/net/vhost/rte_eth_vhost.h index 39ca77197..948f3c810 100644 --- a/drivers/net/vhost/rte_eth_vhost.h +++ b/drivers/net/vhost/rte_eth_vhost.h @@ -69,7 +69,7 @@ struct rte_eth_vhost_queue_event { * - On success, zero. * - On failure, a negative value. */ -int rte_eth_vhost_get_queue_event(uint8_t port_id, +int rte_eth_vhost_get_queue_event(uint16_t port_id, struct rte_eth_vhost_queue_event *event); /** @@ -79,7 +79,7 @@ int rte_eth_vhost_get_queue_event(uint8_t port_id, * - On success, the 'vid' associated with 'port_id'. * - On failure, a negative value. */ -int rte_eth_vhost_get_vid_from_port_id(uint8_t port_id); +int rte_eth_vhost_get_vid_from_port_id(uint16_t port_id); #ifdef __cplusplus } diff --git a/drivers/net/virtio/Makefile b/drivers/net/virtio/Makefile index b21b87814..ad4b695a3 100644 --- a/drivers/net/virtio/Makefile +++ b/drivers/net/virtio/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_virtio_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 18caebdd7..330ee94be 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -260,7 +260,7 @@ struct virtio_hw { uint8_t use_msix; uint8_t modern; uint8_t use_simple_rxtx; - uint8_t port_id; + uint16_t port_id; uint8_t mac_addr[ETHER_ADDR_LEN]; uint32_t notify_off_multiplier; uint8_t *isr; diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h index 28f82d6a8..198b2d8fb 100644 --- a/drivers/net/virtio/virtio_rxtx.h +++ b/drivers/net/virtio/virtio_rxtx.h @@ -54,7 +54,7 @@ struct virtnet_rx { struct rte_mempool *mpool; /**< mempool for mbuf allocation */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -69,7 +69,7 @@ struct virtnet_tx { phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -82,7 +82,7 @@ struct virtnet_ctl { /**< memzone to populate hdr. */ const struct rte_memzone *virtio_net_hdr_mz; phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ const struct rte_memzone *mz; /**< mem zone to populate RX ring. */ }; diff --git a/drivers/net/vmxnet3/vmxnet3_ring.h b/drivers/net/vmxnet3/vmxnet3_ring.h index d2e8323ba..a6fa93ac7 100644 --- a/drivers/net/vmxnet3/vmxnet3_ring.h +++ b/drivers/net/vmxnet3/vmxnet3_ring.h @@ -144,7 +144,7 @@ typedef struct vmxnet3_tx_queue { const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t txdata_desc_size; } vmxnet3_tx_queue_t; @@ -179,7 +179,7 @@ typedef struct vmxnet3_rx_queue { const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ } vmxnet3_rx_queue_t; #endif /* _VMXNET3_RING_H_ */ diff --git a/lib/librte_bitratestats/Makefile b/lib/librte_bitratestats/Makefile index 58a20ea09..a079cced7 100644 --- a/lib/librte_bitratestats/Makefile +++ b/lib/librte_bitratestats/Makefile @@ -38,7 +38,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_bitratestats_version.map -LIBABIVER := 1 +LIBABIVER := 2 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) := rte_bitrate.c diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index 3ceb35166..f373697a7 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -84,7 +84,7 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data) int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id) + uint16_t port_id) { struct rte_stats_bitrate *port_data; struct rte_eth_stats eth_stats; diff --git a/lib/librte_bitratestats/rte_bitrate.h b/lib/librte_bitratestats/rte_bitrate.h index 15fc270a3..16467221b 100644 --- a/lib/librte_bitratestats/rte_bitrate.h +++ b/lib/librte_bitratestats/rte_bitrate.h @@ -85,7 +85,7 @@ int rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data); * - Negative value on error */ int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id); + uint16_t port_id); #ifdef __cplusplus } diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile index 27d9766a8..0bacc8b3f 100644 --- a/lib/librte_ether/Makefile +++ b/lib/librte_ether/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_ethdev_version.map -LIBABIVER := 6 +LIBABIVER := 7 SRCS-y += rte_ethdev.c SRCS-y += rte_flow.c diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index a88916f2a..e756dbc46 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -138,8 +138,8 @@ enum { STAT_QMAP_RX }; -uint8_t -rte_eth_find_next(uint8_t port_id) +uint16_t +rte_eth_find_next(uint16_t port_id) { while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED) @@ -187,7 +187,7 @@ rte_eth_dev_allocated(const char *name) return NULL; } -static uint8_t +static uint16_t rte_eth_dev_find_free_port(void) { unsigned i; @@ -200,7 +200,7 @@ rte_eth_dev_find_free_port(void) } static struct rte_eth_dev * -eth_dev_get(uint8_t port_id) +eth_dev_get(uint16_t port_id) { struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id]; @@ -216,7 +216,7 @@ eth_dev_get(uint8_t port_id) struct rte_eth_dev * rte_eth_dev_allocate(const char *name) { - uint8_t port_id; + uint16_t port_id; struct rte_eth_dev *eth_dev; port_id = rte_eth_dev_find_free_port(); @@ -251,7 +251,7 @@ rte_eth_dev_allocate(const char *name) struct rte_eth_dev * rte_eth_dev_attach_secondary(const char *name) { - uint8_t i; + uint16_t i; struct rte_eth_dev *eth_dev; if (rte_eth_dev_data == NULL) @@ -285,7 +285,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) } int -rte_eth_dev_is_valid_port(uint8_t port_id) +rte_eth_dev_is_valid_port(uint16_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && @@ -296,17 +296,17 @@ rte_eth_dev_is_valid_port(uint8_t port_id) } int -rte_eth_dev_socket_id(uint8_t port_id) +rte_eth_dev_socket_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; } -uint8_t +uint16_t rte_eth_dev_count(void) { - uint8_t p; - uint8_t count; + uint16_t p; + uint16_t count; count = 0; @@ -317,7 +317,7 @@ rte_eth_dev_count(void) } int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name) { const char *tmp; @@ -336,7 +336,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) } int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) { int ret; int i; @@ -361,7 +361,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) } static int -rte_eth_dev_is_detachable(uint8_t port_id) +rte_eth_dev_is_detachable(uint16_t port_id) { uint32_t dev_flags; @@ -377,7 +377,7 @@ rte_eth_dev_is_detachable(uint8_t port_id) /* attach the new device, then store port_id of the device */ int -rte_eth_dev_attach(const char *devargs, uint8_t *port_id) +rte_eth_dev_attach(const char *devargs, uint16_t *port_id) { int ret = -1; int current = rte_eth_dev_count(); @@ -423,7 +423,7 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id) /* detach the device, then store the name of the device */ int -rte_eth_dev_detach(uint8_t port_id, char *name) +rte_eth_dev_detach(uint16_t port_id, char *name) { int ret = -1; @@ -501,7 +501,7 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) } int -rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -527,7 +527,7 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -553,7 +553,7 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -579,7 +579,7 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) } int -rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -688,7 +688,7 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) } int -rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf) { struct rte_eth_dev *dev; @@ -839,7 +839,7 @@ _rte_eth_dev_reset(struct rte_eth_dev *dev) } static void -rte_eth_dev_config_restore(uint8_t port_id) +rte_eth_dev_config_restore(uint16_t port_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -894,7 +894,7 @@ rte_eth_dev_config_restore(uint8_t port_id) } int -rte_eth_dev_start(uint8_t port_id) +rte_eth_dev_start(uint16_t port_id) { struct rte_eth_dev *dev; int diag; @@ -906,7 +906,7 @@ rte_eth_dev_start(uint8_t port_id) RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP); if (dev->data->dev_started != 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already started\n", port_id); return 0; @@ -928,7 +928,7 @@ rte_eth_dev_start(uint8_t port_id) } void -rte_eth_dev_stop(uint8_t port_id) +rte_eth_dev_stop(uint16_t port_id) { struct rte_eth_dev *dev; @@ -938,7 +938,7 @@ rte_eth_dev_stop(uint8_t port_id) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop); if (dev->data->dev_started == 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already stopped\n", port_id); return; @@ -949,7 +949,7 @@ rte_eth_dev_stop(uint8_t port_id) } int -rte_eth_dev_set_link_up(uint8_t port_id) +rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; @@ -962,7 +962,7 @@ rte_eth_dev_set_link_up(uint8_t port_id) } int -rte_eth_dev_set_link_down(uint8_t port_id) +rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; @@ -975,7 +975,7 @@ rte_eth_dev_set_link_down(uint8_t port_id) } void -rte_eth_dev_close(uint8_t port_id) +rte_eth_dev_close(uint16_t port_id) { struct rte_eth_dev *dev; @@ -995,7 +995,7 @@ rte_eth_dev_close(uint8_t port_id) } int -rte_eth_dev_reset(uint8_t port_id) +rte_eth_dev_reset(uint16_t port_id) { struct rte_eth_dev *dev; int ret; @@ -1012,7 +1012,7 @@ rte_eth_dev_reset(uint8_t port_id) } int -rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) @@ -1103,7 +1103,7 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) { @@ -1207,7 +1207,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) } int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -1221,7 +1221,7 @@ rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) } void -rte_eth_promiscuous_enable(uint8_t port_id) +rte_eth_promiscuous_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1234,7 +1234,7 @@ rte_eth_promiscuous_enable(uint8_t port_id) } void -rte_eth_promiscuous_disable(uint8_t port_id) +rte_eth_promiscuous_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1247,7 +1247,7 @@ rte_eth_promiscuous_disable(uint8_t port_id) } int -rte_eth_promiscuous_get(uint8_t port_id) +rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1258,7 +1258,7 @@ rte_eth_promiscuous_get(uint8_t port_id) } void -rte_eth_allmulticast_enable(uint8_t port_id) +rte_eth_allmulticast_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1271,7 +1271,7 @@ rte_eth_allmulticast_enable(uint8_t port_id) } void -rte_eth_allmulticast_disable(uint8_t port_id) +rte_eth_allmulticast_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1284,7 +1284,7 @@ rte_eth_allmulticast_disable(uint8_t port_id) } int -rte_eth_allmulticast_get(uint8_t port_id) +rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1309,7 +1309,7 @@ rte_eth_dev_atomic_read_link_status(struct rte_eth_dev *dev, } void -rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1326,7 +1326,7 @@ rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) } void -rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1343,7 +1343,7 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) } int -rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) +rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; @@ -1359,7 +1359,7 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) } void -rte_eth_stats_reset(uint8_t port_id) +rte_eth_stats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1372,7 +1372,7 @@ rte_eth_stats_reset(uint8_t port_id) } static int -get_xstats_count(uint8_t port_id) +get_xstats_count(uint16_t port_id) { struct rte_eth_dev *dev; int count; @@ -1401,7 +1401,7 @@ get_xstats_count(uint8_t port_id) } int -rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id) { int cnt_xstats, idx_xstat; @@ -1445,7 +1445,7 @@ rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, } int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids) { @@ -1562,7 +1562,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, } int -rte_eth_xstats_get_names(uint8_t port_id, +rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size) { @@ -1628,8 +1628,8 @@ rte_eth_xstats_get_names(uint8_t port_id, /* retrieve ethdev extended statistics */ int -rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, - unsigned int n) +rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, + uint64_t *values, unsigned int n) { /* If need all xstats */ if (!ids) { @@ -1754,7 +1754,7 @@ rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, } int -rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n) { struct rte_eth_stats eth_stats; @@ -1836,7 +1836,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, /* reset ethdev extended statistics */ void -rte_eth_xstats_reset(uint8_t port_id) +rte_eth_xstats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1854,7 +1854,7 @@ rte_eth_xstats_reset(uint8_t port_id) } static int -set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, +set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx) { struct rte_eth_dev *dev; @@ -1870,7 +1870,7 @@ set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, int -rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, @@ -1879,7 +1879,7 @@ rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, int -rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, @@ -1887,7 +1887,7 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) +rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; @@ -1899,7 +1899,7 @@ rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) } void -rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) +rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; const struct rte_eth_desc_lim lim = { @@ -1923,7 +1923,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) } int -rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num) { int i, j; @@ -1949,7 +1949,7 @@ rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, } void -rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) +rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -1960,7 +1960,7 @@ rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) int -rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) +rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) { struct rte_eth_dev *dev; @@ -1972,7 +1972,7 @@ rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) } int -rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) +rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) { int ret; struct rte_eth_dev *dev; @@ -1989,7 +1989,7 @@ rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) } int -rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) +rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) { struct rte_eth_dev *dev; int ret; @@ -2028,7 +2028,8 @@ rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) } int -rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int on) +rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, + int on) { struct rte_eth_dev *dev; @@ -2046,7 +2047,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int o } int -rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tpid) { @@ -2060,7 +2061,7 @@ rte_eth_dev_set_vlan_ether_type(uint8_t port_id, } int -rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) +rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) { struct rte_eth_dev *dev; int ret = 0; @@ -2103,7 +2104,7 @@ rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) } int -rte_eth_dev_get_vlan_offload(uint8_t port_id) +rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; int ret = 0; @@ -2124,7 +2125,7 @@ rte_eth_dev_get_vlan_offload(uint8_t port_id) } int -rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) +rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; @@ -2137,7 +2138,7 @@ rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) } int -rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2149,7 +2150,7 @@ rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2165,7 +2166,8 @@ rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf) +rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, + struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; @@ -2231,7 +2233,7 @@ rte_eth_check_reta_entry(struct rte_eth_rss_reta_entry64 *reta_conf, } int -rte_eth_dev_rss_reta_update(uint8_t port_id, +rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2257,7 +2259,7 @@ rte_eth_dev_rss_reta_update(uint8_t port_id, } int -rte_eth_dev_rss_reta_query(uint8_t port_id, +rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2277,7 +2279,8 @@ rte_eth_dev_rss_reta_query(uint8_t port_id, } int -rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) +rte_eth_dev_rss_hash_update(uint16_t port_id, + struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; uint16_t rss_hash_protos; @@ -2296,7 +2299,7 @@ rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) } int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; @@ -2308,7 +2311,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2330,7 +2333,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2353,7 +2356,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, } int -rte_eth_led_on(uint8_t port_id) +rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2364,7 +2367,7 @@ rte_eth_led_on(uint8_t port_id) } int -rte_eth_led_off(uint8_t port_id) +rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2379,7 +2382,7 @@ rte_eth_led_off(uint8_t port_id) * an empty spot. */ static int -get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2398,7 +2401,7 @@ get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) static const struct ether_addr null_mac_addr; int -rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, uint32_t pool) { struct rte_eth_dev *dev; @@ -2451,7 +2454,7 @@ rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; int index; @@ -2480,7 +2483,7 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) } int -rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; @@ -2506,7 +2509,7 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) * an empty spot. */ static int -get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2525,7 +2528,7 @@ get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) } int -rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, uint8_t on) { int index; @@ -2577,7 +2580,7 @@ rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) +rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; @@ -2589,7 +2592,7 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) return (*dev->dev_ops->uc_all_hash_table_set)(dev, on); } -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate) { struct rte_eth_dev *dev; @@ -2620,7 +2623,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, } int -rte_eth_mirror_rule_set(uint8_t port_id, +rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) { @@ -2658,7 +2661,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, } int -rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) +rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id) { struct rte_eth_dev *dev; @@ -2671,7 +2674,7 @@ rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) } int -rte_eth_dev_callback_register(uint8_t port_id, +rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2711,7 +2714,7 @@ rte_eth_dev_callback_register(uint8_t port_id, } int -rte_eth_dev_callback_unregister(uint8_t port_id, +rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2783,7 +2786,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, } int -rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) +rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) { uint32_t vec; struct rte_eth_dev *dev; @@ -2844,7 +2847,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, } int -rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data) { uint32_t vec; @@ -2884,7 +2887,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_rx_intr_enable(uint8_t port_id, +rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2898,7 +2901,7 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id, } int -rte_eth_dev_rx_intr_disable(uint8_t port_id, +rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2913,7 +2916,8 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id, int -rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) +rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type) { struct rte_eth_dev *dev; @@ -2926,7 +2930,7 @@ rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) } int -rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { struct rte_eth_dev *dev; @@ -2939,7 +2943,7 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, } void * -rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2981,7 +2985,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3016,7 +3020,7 @@ rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3059,7 +3063,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3093,7 +3097,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3127,7 +3131,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo) { struct rte_eth_dev *dev; @@ -3151,7 +3155,7 @@ rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo) { struct rte_eth_dev *dev; @@ -3175,7 +3179,7 @@ rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_set_mc_addr_list(uint8_t port_id, +rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) { @@ -3189,7 +3193,7 @@ rte_eth_dev_set_mc_addr_list(uint8_t port_id, } int -rte_eth_timesync_enable(uint8_t port_id) +rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3201,7 +3205,7 @@ rte_eth_timesync_enable(uint8_t port_id) } int -rte_eth_timesync_disable(uint8_t port_id) +rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3213,7 +3217,7 @@ rte_eth_timesync_disable(uint8_t port_id) } int -rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, +rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; @@ -3226,7 +3230,8 @@ rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, } int -rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_tx_timestamp(uint16_t port_id, + struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3238,7 +3243,7 @@ rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) +rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; @@ -3250,7 +3255,7 @@ rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) } int -rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3262,7 +3267,7 @@ rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) +rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3274,7 +3279,7 @@ rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) } int -rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) +rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; @@ -3286,7 +3291,7 @@ rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) } int -rte_eth_dev_get_eeprom_length(uint8_t port_id) +rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3298,7 +3303,7 @@ rte_eth_dev_get_eeprom_length(uint8_t port_id) } int -rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3310,7 +3315,7 @@ rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3322,7 +3327,7 @@ rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_get_dcb_info(uint8_t port_id, +rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; @@ -3337,7 +3342,7 @@ rte_eth_dev_get_dcb_info(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) { struct rte_eth_dev *dev; @@ -3360,7 +3365,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en) @@ -3404,7 +3409,7 @@ rte_eth_dev_adjust_nb_desc(uint16_t *nb_desc, } int -rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 99cdd54d4..34f729ab8 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1572,7 +1572,7 @@ struct eth_dev_ops { * @return * The number of packets returned to the user. */ -typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); @@ -1596,7 +1596,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, * @return * The number of packets to be written to the NIC. */ -typedef uint16_t (*rte_tx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param); /** @@ -1699,7 +1699,7 @@ struct rte_eth_dev_data { /** bitmap array of associating Ethernet MAC addresses to pools */ struct ether_addr* hash_mac_addrs; /** Device Ethernet MAC addresses of hash filtering. */ - uint8_t port_id; /**< Device [external] port identifier. */ + uint16_t port_id; /**< Device [external] port identifier. */ __extension__ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */ scattered_rx : 1, /**< RX of scattered packets is ON(1) / OFF(0) */ @@ -1741,7 +1741,7 @@ extern struct rte_eth_dev rte_eth_devices[]; * @return * Next valid port id, RTE_MAX_ETHPORTS if there is none. */ -uint8_t rte_eth_find_next(uint8_t port_id); +uint16_t rte_eth_find_next(uint16_t port_id); /** * Macro to iterate over all enabled ethdev ports. @@ -1764,7 +1764,7 @@ uint8_t rte_eth_find_next(uint8_t port_id); * @return * - The total number of usable Ethernet devices. */ -uint8_t rte_eth_dev_count(void); +uint16_t rte_eth_dev_count(void); /** * @internal @@ -1825,7 +1825,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * @return * 0 on success and port_id is filled, negative on error */ -int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); +int rte_eth_dev_attach(const char *devargs, uint16_t *port_id); /** * Detach a Ethernet device specified by port identifier. @@ -1840,7 +1840,7 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); * @return * 0 on success and devname is filled, negative on error */ -int rte_eth_dev_detach(uint8_t port_id, char *devname); +int rte_eth_dev_detach(uint16_t port_id, char *devname); /** * Convert a numerical speed in Mbps to a bitmap flag that can be used in @@ -1884,7 +1884,7 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex); * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, +int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf); /** @@ -1939,7 +1939,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * allocate network memory buffers from the memory pool when * initializing receive descriptors. */ -int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); @@ -1987,7 +1987,7 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, * - 0: Success, the transmit queue is correctly set up. * - -ENOMEM: Unable to allocate the transmit ring descriptors. */ -int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); @@ -2001,7 +2001,7 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, * a default of zero if the socket could not be determined. * -1 is returned is the port_id value is out of range. */ -int rte_eth_dev_socket_id(uint8_t port_id); +int rte_eth_dev_socket_id(uint16_t port_id); /** * Check if port_id of device is attached @@ -2012,7 +2012,7 @@ int rte_eth_dev_socket_id(uint8_t port_id); * - 0 if port is out of range or not attached * - 1 if device is attached */ -int rte_eth_dev_is_valid_port(uint8_t port_id); +int rte_eth_dev_is_valid_port(uint16_t port_id); /** * Start specified RX queue of a port. It is used when rx_deferred_start @@ -2029,7 +2029,7 @@ int rte_eth_dev_is_valid_port(uint8_t port_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); /** * Stop specified RX queue of a port @@ -2045,7 +2045,7 @@ int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); /** * Start TX for specified queue of a port. It is used when tx_deferred_start @@ -2062,7 +2062,7 @@ int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); /** * Stop specified TX queue of a port @@ -2078,7 +2078,7 @@ int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id); @@ -2097,7 +2097,7 @@ int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); * - 0: Success, Ethernet device started. * - <0: Error code of the driver device start function. */ -int rte_eth_dev_start(uint8_t port_id); +int rte_eth_dev_start(uint16_t port_id); /** * Stop an Ethernet device. The device can be restarted with a call to @@ -2106,7 +2106,7 @@ int rte_eth_dev_start(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_stop(uint8_t port_id); +void rte_eth_dev_stop(uint16_t port_id); /** @@ -2121,7 +2121,7 @@ void rte_eth_dev_stop(uint8_t port_id); * - 0: Success, Ethernet device linked up. * - <0: Error code of the driver device link up function. */ -int rte_eth_dev_set_link_up(uint8_t port_id); +int rte_eth_dev_set_link_up(uint16_t port_id); /** * Link down an Ethernet device. @@ -2132,7 +2132,7 @@ int rte_eth_dev_set_link_up(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_set_link_down(uint8_t port_id); +int rte_eth_dev_set_link_down(uint16_t port_id); /** * Close a stopped Ethernet device. The device cannot be restarted! @@ -2142,7 +2142,7 @@ int rte_eth_dev_set_link_down(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_close(uint8_t port_id); +void rte_eth_dev_close(uint16_t port_id); /** * Reset a Ethernet device and keep its port id. @@ -2172,7 +2172,7 @@ void rte_eth_dev_close(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_reset(uint8_t port_id); +int rte_eth_dev_reset(uint16_t port_id); /** * Enable receipt in promiscuous mode for an Ethernet device. @@ -2180,7 +2180,7 @@ int rte_eth_dev_reset(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_enable(uint8_t port_id); +void rte_eth_promiscuous_enable(uint16_t port_id); /** * Disable receipt in promiscuous mode for an Ethernet device. @@ -2188,7 +2188,7 @@ void rte_eth_promiscuous_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_disable(uint8_t port_id); +void rte_eth_promiscuous_disable(uint16_t port_id); /** * Return the value of promiscuous mode for an Ethernet device. @@ -2200,7 +2200,7 @@ void rte_eth_promiscuous_disable(uint8_t port_id); * - (0) if promiscuous is disabled. * - (-1) on error */ -int rte_eth_promiscuous_get(uint8_t port_id); +int rte_eth_promiscuous_get(uint16_t port_id); /** * Enable the receipt of any multicast frame by an Ethernet device. @@ -2208,7 +2208,7 @@ int rte_eth_promiscuous_get(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_enable(uint8_t port_id); +void rte_eth_allmulticast_enable(uint16_t port_id); /** * Disable the receipt of all multicast frames by an Ethernet device. @@ -2216,7 +2216,7 @@ void rte_eth_allmulticast_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_disable(uint8_t port_id); +void rte_eth_allmulticast_disable(uint16_t port_id); /** * Return the value of allmulticast mode for an Ethernet device. @@ -2228,7 +2228,7 @@ void rte_eth_allmulticast_disable(uint8_t port_id); * - (0) if allmulticast is disabled. * - (-1) on error */ -int rte_eth_allmulticast_get(uint8_t port_id); +int rte_eth_allmulticast_get(uint16_t port_id); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2241,7 +2241,7 @@ int rte_eth_allmulticast_get(uint8_t port_id); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2254,7 +2254,7 @@ void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the general I/O statistics of an Ethernet device. @@ -2273,7 +2273,7 @@ void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); +int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. @@ -2281,7 +2281,7 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_stats_reset(uint8_t port_id); +void rte_eth_stats_reset(uint16_t port_id); /** * Retrieve names of extended statistics of an Ethernet device. @@ -2303,7 +2303,7 @@ void rte_eth_stats_reset(uint8_t port_id); * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_names(uint8_t port_id, +int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size); @@ -2329,7 +2329,7 @@ int rte_eth_xstats_get_names(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n); /** @@ -2355,7 +2355,7 @@ int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, * - A negative value on error (invalid port id). */ int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids); @@ -2382,7 +2382,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, +int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, uint64_t *values, unsigned int n); /** @@ -2402,7 +2402,7 @@ int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, * -ENODEV for invalid port_id, * -EINVAL if the xstat_name doesn't exist in port_id */ -int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id); /** @@ -2411,7 +2411,7 @@ int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_xstats_reset(uint8_t port_id); +void rte_eth_xstats_reset(uint16_t port_id); /** * Set a mapping for the specified transmit queue to the specified per-queue @@ -2430,7 +2430,7 @@ void rte_eth_xstats_reset(uint8_t port_id); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx); /** @@ -2450,7 +2450,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx); @@ -2463,7 +2463,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. */ -void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -2474,7 +2474,7 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); * A pointer to a structure of type *rte_eth_dev_info* to be filled with * the contextual information of the Ethernet device. */ -void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); +void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info); /** * Retrieve the firmware version of a device. @@ -2494,7 +2494,7 @@ void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); * - (>0) if *fw_size* is not enough to store firmware version, return * the size of the non truncated string. */ -int rte_eth_dev_fw_version_get(uint8_t port_id, +int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size); /** @@ -2535,7 +2535,7 @@ int rte_eth_dev_fw_version_get(uint8_t port_id, * count of supported ptypes will be returned. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num); /** @@ -2549,7 +2549,7 @@ int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); +int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu); /** * Change the MTU of an Ethernet device. @@ -2565,7 +2565,7 @@ int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); * - (-EINVAL) if *mtu* invalid. * - (-EBUSY) if operation is not allowed when the port is running */ -int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); +int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu); /** * Enable/Disable hardware filtering by an Ethernet device of received @@ -2585,7 +2585,7 @@ int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); * - (-ENOSYS) if VLAN filtering on *port_id* disabled. * - (-EINVAL) if *vlan_id* > 4095. */ -int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); +int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on); /** * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. @@ -2606,7 +2606,7 @@ int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *rx_queue_id* invalid. */ -int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on); /** @@ -2625,7 +2625,7 @@ int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type); @@ -2649,7 +2649,7 @@ int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); +int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); /** * Read VLAN Offload configuration from an Ethernet device @@ -2663,7 +2663,7 @@ int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); * ETH_VLAN_EXTEND_OFFLOAD * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_vlan_offload(uint8_t port_id); +int rte_eth_dev_get_vlan_offload(uint16_t port_id); /** * Set port based TX VLAN insertion on or off. @@ -2679,7 +2679,7 @@ int rte_eth_dev_get_vlan_offload(uint8_t port_id); * - (0) if successful. * - negative if failed. */ -int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); +int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); /** * @@ -2764,7 +2764,7 @@ int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); * *rx_pkts* array. */ static inline uint16_t -rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2809,7 +2809,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, * (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) +rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2838,7 +2838,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) * - (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) +rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); @@ -2885,7 +2885,7 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) * - (-ENODEV) bad port or queue (only if compiled with debug). */ static inline int -rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2942,7 +2942,7 @@ rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, * - (-ENOTSUP) if the device does not support this function. * - (-ENODEV) bad port or queue (only if compiled with debug). */ -static inline int rte_eth_tx_descriptor_status(uint8_t port_id, +static inline int rte_eth_tx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -3026,7 +3026,7 @@ static inline int rte_eth_tx_descriptor_status(uint8_t port_id, * *tx_pkts* parameter when the transmit ring is full or has been filled up. */ static inline uint16_t -rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3115,7 +3115,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, #ifndef RTE_ETHDEV_TX_PREPARE_NOOP static inline uint16_t -rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev; @@ -3157,7 +3157,8 @@ rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, */ static inline uint16_t -rte_eth_tx_prepare(__rte_unused uint8_t port_id, __rte_unused uint16_t queue_id, +rte_eth_tx_prepare(__rte_unused uint16_t port_id, + __rte_unused uint16_t queue_id, __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { return nb_pkts; @@ -3226,7 +3227,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size); * callback is called for any packets which could not be sent. */ static inline uint16_t -rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer) { uint16_t sent; @@ -3278,7 +3279,7 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, * the rest. */ static __rte_always_inline uint16_t -rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt) { buffer->pkts[buffer->length++] = tx_pkt; @@ -3394,7 +3395,7 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, * are in use. */ int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt); +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt); /** * The eth device event type for interrupt, and maybe others in the future. @@ -3412,7 +3413,7 @@ enum rte_eth_event_type { RTE_ETH_EVENT_MAX /**< max value of this enum */ }; -typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, +typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param); /**< user application callback to be registered for interrupts */ @@ -3434,7 +3435,7 @@ typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_register(uint8_t port_id, +int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3455,7 +3456,7 @@ int rte_eth_dev_callback_register(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_unregister(uint8_t port_id, +int rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3501,7 +3502,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id); /** * When lcore wakes up from rx interrupt indicating packet coming, disable rx @@ -3522,7 +3523,7 @@ int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id); /** * RX Interrupt control per port. @@ -3541,7 +3542,7 @@ int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); +int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data); /** * RX Interrupt control per queue. @@ -3564,7 +3565,7 @@ int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data); /** @@ -3579,7 +3580,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_on(uint8_t port_id); +int rte_eth_led_on(uint16_t port_id); /** * Turn off the LED on the Ethernet device. @@ -3593,7 +3594,7 @@ int rte_eth_led_on(uint8_t port_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_off(uint8_t port_id); +int rte_eth_led_off(uint16_t port_id); /** * Get current status of the Ethernet link flow control for Ethernet device @@ -3607,7 +3608,7 @@ int rte_eth_led_off(uint8_t port_id); * - (-ENOTSUP) if hardware doesn't support flow control. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_flow_ctrl_get(uint8_t port_id, +int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3624,7 +3625,7 @@ int rte_eth_dev_flow_ctrl_get(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3642,7 +3643,7 @@ int rte_eth_dev_flow_ctrl_set(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf); /** @@ -3663,7 +3664,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t pool); /** @@ -3679,7 +3680,7 @@ int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EADDRINUSE) if attempting to remove the default MAC address */ -int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr); /** * Set the default MAC address. @@ -3694,8 +3695,8 @@ int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); - +int rte_eth_dev_default_mac_addr_set(uint16_t port, + struct ether_addr *mac_addr); /** * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device. @@ -3712,7 +3713,7 @@ int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_update(uint8_t port, +int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3731,7 +3732,7 @@ int rte_eth_dev_rss_reta_update(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_query(uint8_t port, +int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3753,8 +3754,8 @@ int rte_eth_dev_rss_reta_query(uint8_t port, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, - uint8_t on); +int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, + uint8_t on); /** * Updates all unicast hash bitmaps for receiving packet with any Unicast @@ -3773,7 +3774,7 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); +int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on); /** * Set a traffic mirroring rule on an Ethernet device @@ -3796,7 +3797,7 @@ int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if the mr_conf information is not correct. */ -int rte_eth_mirror_rule_set(uint8_t port_id, +int rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on); @@ -3814,7 +3815,7 @@ int rte_eth_mirror_rule_set(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_mirror_rule_reset(uint8_t port_id, +int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id); /** @@ -3832,7 +3833,7 @@ int rte_eth_mirror_rule_reset(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate); /** @@ -3848,7 +3849,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_hash_update(uint8_t port_id, +int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3865,7 +3866,7 @@ int rte_eth_dev_rss_hash_update(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support RSS. */ int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3886,7 +3887,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3908,7 +3909,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3924,7 +3925,8 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support this filter type. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type); +int rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type); /** * Take operations to assigned filter type on an Ethernet device. @@ -3944,7 +3946,7 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg); /** @@ -3959,7 +3961,7 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, * - (-ENODEV) if port identifier is invalid. * - (-ENOTSUP) if hardware doesn't support. */ -int rte_eth_dev_get_dcb_info(uint8_t port_id, +int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info); /** @@ -3986,7 +3988,7 @@ int rte_eth_dev_get_dcb_info(uint8_t port_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4014,7 +4016,7 @@ void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4041,7 +4043,7 @@ void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param); /** @@ -4074,7 +4076,7 @@ void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4107,7 +4109,7 @@ int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4127,7 +4129,7 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); /** @@ -4147,7 +4149,7 @@ int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo); /** @@ -4166,7 +4168,7 @@ int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); +int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info); /** * Retrieve size of device EEPROM @@ -4179,7 +4181,7 @@ int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom_length(uint8_t port_id); +int rte_eth_dev_get_eeprom_length(uint16_t port_id); /** * Retrieve EEPROM and EEPROM attribute @@ -4195,7 +4197,7 @@ int rte_eth_dev_get_eeprom_length(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Program EEPROM with provided data @@ -4211,7 +4213,7 @@ int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Set the list of multicast addresses to filter on an Ethernet device. @@ -4230,7 +4232,7 @@ int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering. * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ -int rte_eth_dev_set_mc_addr_list(uint8_t port_id, +int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr); @@ -4245,7 +4247,7 @@ int rte_eth_dev_set_mc_addr_list(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_enable(uint8_t port_id); +int rte_eth_timesync_enable(uint16_t port_id); /** * Disable IEEE1588/802.1AS timestamping for an Ethernet device. @@ -4258,7 +4260,7 @@ int rte_eth_timesync_enable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_disable(uint8_t port_id); +int rte_eth_timesync_disable(uint16_t port_id); /** * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device. @@ -4277,7 +4279,7 @@ int rte_eth_timesync_disable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags); /** @@ -4294,7 +4296,7 @@ int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp); /** @@ -4313,7 +4315,7 @@ int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); +int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta); /** * Read the time from the timesync clock on an Ethernet device. @@ -4329,7 +4331,7 @@ int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); * @return * - 0: Success. */ -int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); +int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time); /** * Set the time of the timesync clock on an Ethernet device. @@ -4348,7 +4350,7 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time); +int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time); /** * Create memzone for HW rings. @@ -4389,7 +4391,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel); /** @@ -4416,7 +4418,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en); @@ -4434,7 +4436,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, * - (-ENODEV or -EINVAL) on failure. */ int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id); /** * Get the device name from port id @@ -4448,7 +4450,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); * - (-EINVAL) on failure. */ int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name); /** * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from @@ -4466,7 +4468,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); * - (0) if successful. * - (-ENOTSUP, -ENODEV or -EINVAL) on failure. */ -int rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc); diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c index 2001fbbf4..95d9ee007 100644 --- a/lib/librte_ether/rte_flow.c +++ b/lib/librte_ether/rte_flow.c @@ -108,7 +108,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = { /* Get generic flow operations structure from a port. */ const struct rte_flow_ops * -rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error) +rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops; diff --git a/lib/librte_ether/rte_flow_driver.h b/lib/librte_ether/rte_flow_driver.h index 4d95391d8..8573cefa3 100644 --- a/lib/librte_ether/rte_flow_driver.h +++ b/lib/librte_ether/rte_flow_driver.h @@ -178,7 +178,7 @@ rte_flow_error_set(struct rte_flow_error *error, * additional details. */ const struct rte_flow_ops * -rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error); +rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error); #ifdef __cplusplus } diff --git a/lib/librte_ether/rte_tm.c b/lib/librte_ether/rte_tm.c index 71679650e..ceac34115 100644 --- a/lib/librte_ether/rte_tm.c +++ b/lib/librte_ether/rte_tm.c @@ -40,7 +40,7 @@ /* Get generic traffic manager operations structure from a port. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_tm_ops *ops; @@ -87,7 +87,7 @@ rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) /* Get number of leaf nodes */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error) { @@ -113,7 +113,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, /* Check node type (leaf or non-leaf) */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error) @@ -124,7 +124,7 @@ rte_tm_node_type_get(uint8_t port_id, } /* Get capabilities */ -int rte_tm_capabilities_get(uint8_t port_id, +int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error) { @@ -134,7 +134,7 @@ int rte_tm_capabilities_get(uint8_t port_id, } /* Get level capabilities */ -int rte_tm_level_capabilities_get(uint8_t port_id, +int rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error) @@ -145,7 +145,7 @@ int rte_tm_level_capabilities_get(uint8_t port_id, } /* Get node capabilities */ -int rte_tm_node_capabilities_get(uint8_t port_id, +int rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error) @@ -156,7 +156,7 @@ int rte_tm_node_capabilities_get(uint8_t port_id, } /* Add WRED profile */ -int rte_tm_wred_profile_add(uint8_t port_id, +int rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error) @@ -167,7 +167,7 @@ int rte_tm_wred_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_wred_profile_delete(uint8_t port_id, +int rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error) { @@ -177,7 +177,7 @@ int rte_tm_wred_profile_delete(uint8_t port_id, } /* Add/update shared WRED context */ -int rte_tm_shared_wred_context_add_update(uint8_t port_id, +int rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -188,7 +188,7 @@ int rte_tm_shared_wred_context_add_update(uint8_t port_id, } /* Delete shared WRED context */ -int rte_tm_shared_wred_context_delete(uint8_t port_id, +int rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error) { @@ -198,7 +198,7 @@ int rte_tm_shared_wred_context_delete(uint8_t port_id, } /* Add shaper profile */ -int rte_tm_shaper_profile_add(uint8_t port_id, +int rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error) @@ -209,7 +209,7 @@ int rte_tm_shaper_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_shaper_profile_delete(uint8_t port_id, +int rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error) { @@ -219,7 +219,7 @@ int rte_tm_shaper_profile_delete(uint8_t port_id, } /* Add shared shaper */ -int rte_tm_shared_shaper_add_update(uint8_t port_id, +int rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -230,7 +230,7 @@ int rte_tm_shared_shaper_add_update(uint8_t port_id, } /* Delete shared shaper */ -int rte_tm_shared_shaper_delete(uint8_t port_id, +int rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error) { @@ -240,7 +240,7 @@ int rte_tm_shared_shaper_delete(uint8_t port_id, } /* Add node to port traffic manager hierarchy */ -int rte_tm_node_add(uint8_t port_id, +int rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -256,7 +256,7 @@ int rte_tm_node_add(uint8_t port_id, } /* Delete node from traffic manager hierarchy */ -int rte_tm_node_delete(uint8_t port_id, +int rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -266,7 +266,7 @@ int rte_tm_node_delete(uint8_t port_id, } /* Suspend node */ -int rte_tm_node_suspend(uint8_t port_id, +int rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -276,7 +276,7 @@ int rte_tm_node_suspend(uint8_t port_id, } /* Resume node */ -int rte_tm_node_resume(uint8_t port_id, +int rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -286,7 +286,7 @@ int rte_tm_node_resume(uint8_t port_id, } /* Commit the initial port traffic manager hierarchy */ -int rte_tm_hierarchy_commit(uint8_t port_id, +int rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error) { @@ -296,7 +296,7 @@ int rte_tm_hierarchy_commit(uint8_t port_id, } /* Update node parent */ -int rte_tm_node_parent_update(uint8_t port_id, +int rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -309,7 +309,7 @@ int rte_tm_node_parent_update(uint8_t port_id, } /* Update node private shaper */ -int rte_tm_node_shaper_update(uint8_t port_id, +int rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -320,7 +320,7 @@ int rte_tm_node_shaper_update(uint8_t port_id, } /* Update node shared shapers */ -int rte_tm_node_shared_shaper_update(uint8_t port_id, +int rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -332,7 +332,7 @@ int rte_tm_node_shared_shaper_update(uint8_t port_id, } /* Update node stats */ -int rte_tm_node_stats_update(uint8_t port_id, +int rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error) @@ -343,7 +343,7 @@ int rte_tm_node_stats_update(uint8_t port_id, } /* Update WFQ weight mode */ -int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -355,7 +355,7 @@ int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, } /* Update node congestion management mode */ -int rte_tm_node_cman_update(uint8_t port_id, +int rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error) @@ -366,7 +366,7 @@ int rte_tm_node_cman_update(uint8_t port_id, } /* Update node private WRED context */ -int rte_tm_node_wred_context_update(uint8_t port_id, +int rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -377,7 +377,7 @@ int rte_tm_node_wred_context_update(uint8_t port_id, } /* Update node shared WRED context */ -int rte_tm_node_shared_wred_context_update(uint8_t port_id, +int rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -389,7 +389,7 @@ int rte_tm_node_shared_wred_context_update(uint8_t port_id, } /* Read and/or clear stats counters for specific node */ -int rte_tm_node_stats_read(uint8_t port_id, +int rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -402,7 +402,7 @@ int rte_tm_node_stats_read(uint8_t port_id, } /* Packet marking - VLAN DEI */ -int rte_tm_mark_vlan_dei(uint8_t port_id, +int rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -414,7 +414,7 @@ int rte_tm_mark_vlan_dei(uint8_t port_id, } /* Packet marking - IPv4/IPv6 ECN */ -int rte_tm_mark_ip_ecn(uint8_t port_id, +int rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -426,7 +426,7 @@ int rte_tm_mark_ip_ecn(uint8_t port_id, } /* Packet marking - IPv4/IPv6 DSCP */ -int rte_tm_mark_ip_dscp(uint8_t port_id, +int rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm.h b/lib/librte_ether/rte_tm.h index ebbfa1eec..2b25a8715 100644 --- a/lib/librte_ether/rte_tm.h +++ b/lib/librte_ether/rte_tm.h @@ -1040,7 +1040,7 @@ struct rte_tm_error { * 0 on success, non-zero error code otherwise. */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error); @@ -1064,7 +1064,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error); @@ -1082,7 +1082,7 @@ rte_tm_node_type_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_capabilities_get(uint8_t port_id, +rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error); @@ -1102,7 +1102,7 @@ rte_tm_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_level_capabilities_get(uint8_t port_id, +rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error); @@ -1122,7 +1122,7 @@ rte_tm_level_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_capabilities_get(uint8_t port_id, +rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error); @@ -1147,7 +1147,7 @@ rte_tm_node_capabilities_get(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_add(uint8_t port_id, +rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error); @@ -1170,7 +1170,7 @@ rte_tm_wred_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_delete(uint8_t port_id, +rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1201,7 +1201,7 @@ rte_tm_wred_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_add_update(uint8_t port_id, +rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1225,7 +1225,7 @@ rte_tm_shared_wred_context_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_delete(uint8_t port_id, +rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error); @@ -1249,7 +1249,7 @@ rte_tm_shared_wred_context_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_add(uint8_t port_id, +rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error); @@ -1272,7 +1272,7 @@ rte_tm_shaper_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_delete(uint8_t port_id, +rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1301,7 +1301,7 @@ rte_tm_shaper_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_add_update(uint8_t port_id, +rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1324,7 +1324,7 @@ rte_tm_shared_shaper_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_delete(uint8_t port_id, +rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error); @@ -1392,7 +1392,7 @@ rte_tm_shared_shaper_delete(uint8_t port_id, * @see struct rte_tm_capabilities */ int -rte_tm_node_add(uint8_t port_id, +rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1425,7 +1425,7 @@ rte_tm_node_add(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_ADD_DELETE */ int -rte_tm_node_delete(uint8_t port_id, +rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1449,7 +1449,7 @@ rte_tm_node_delete(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_suspend(uint8_t port_id, +rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1472,7 +1472,7 @@ rte_tm_node_suspend(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_resume(uint8_t port_id, +rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1513,7 +1513,7 @@ rte_tm_node_resume(uint8_t port_id, * @see rte_tm_node_delete() */ int -rte_tm_hierarchy_commit(uint8_t port_id, +rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error); @@ -1549,7 +1549,7 @@ rte_tm_hierarchy_commit(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_PARENT_CHANGE_LEVEL */ int -rte_tm_node_parent_update(uint8_t port_id, +rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1578,7 +1578,7 @@ rte_tm_node_parent_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_private_n_max */ int -rte_tm_node_shaper_update(uint8_t port_id, +rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1605,7 +1605,7 @@ rte_tm_node_shaper_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_node_shared_shaper_update(uint8_t port_id, +rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -1632,7 +1632,7 @@ rte_tm_node_shared_shaper_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_STATS */ int -rte_tm_node_stats_update(uint8_t port_id, +rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error); @@ -1660,7 +1660,7 @@ rte_tm_node_stats_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_N_SP_PRIORITIES */ int -rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -1683,7 +1683,7 @@ rte_tm_node_wfq_weight_mode_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_CMAN */ int -rte_tm_node_cman_update(uint8_t port_id, +rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error); @@ -1707,7 +1707,7 @@ rte_tm_node_cman_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_private_n_max */ int -rte_tm_node_wred_context_update(uint8_t port_id, +rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1732,7 +1732,7 @@ rte_tm_node_wred_context_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_node_shared_wred_context_update(uint8_t port_id, +rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -1764,7 +1764,7 @@ rte_tm_node_shared_wred_context_update(uint8_t port_id, * @see enum rte_tm_stats_type */ int -rte_tm_node_stats_read(uint8_t port_id, +rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -1801,7 +1801,7 @@ rte_tm_node_stats_read(uint8_t port_id, * @see struct rte_tm_capabilities::mark_vlan_dei_supported */ int -rte_tm_mark_vlan_dei(uint8_t port_id, +rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1851,7 +1851,7 @@ rte_tm_mark_vlan_dei(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_ecn_sctp_supported */ int -rte_tm_mark_ip_ecn(uint8_t port_id, +rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1899,7 +1899,7 @@ rte_tm_mark_ip_ecn(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_dscp_supported */ int -rte_tm_mark_ip_dscp(uint8_t port_id, +rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm_driver.h b/lib/librte_ether/rte_tm_driver.h index a5b698fe0..b2e8ccf80 100644 --- a/lib/librte_ether/rte_tm_driver.h +++ b/lib/librte_ether/rte_tm_driver.h @@ -357,7 +357,7 @@ rte_tm_error_set(struct rte_tm_error *error, * success, NULL otherwise. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error); +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error); #ifdef __cplusplus } diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile index 70f1ca8f6..43c115ddd 100644 --- a/lib/librte_kni/Makefile +++ b/lib/librte_kni/Makefile @@ -38,7 +38,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing EXPORT_MAP := rte_kni_version.map -LIBABIVER := 2 +LIBABIVER := 3 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_KNI) := rte_kni.c diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 37deb4727..87812cd55 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -63,13 +63,13 @@ struct rte_mbuf; * Structure which has the function pointers for KNI interface. */ struct rte_kni_ops { - uint8_t port_id; /* Port ID */ + uint16_t port_id; /* Port ID */ /* Pointer to function of changing MTU */ - int (*change_mtu)(uint8_t port_id, unsigned new_mtu); + int (*change_mtu)(uint16_t port_id, unsigned int new_mtu); /* Pointer to function of configuring network interface */ - int (*config_network_if)(uint8_t port_id, uint8_t if_up); + int (*config_network_if)(uint16_t port_id, uint8_t if_up); }; /** diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c index ce029a12c..d6ad13c4e 100644 --- a/lib/librte_latencystats/rte_latencystats.c +++ b/lib/librte_latencystats/rte_latencystats.c @@ -135,7 +135,7 @@ rte_latencystats_fill_values(struct rte_metric_value *values) } static uint16_t -add_time_stamps(uint8_t pid __rte_unused, +add_time_stamps(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -165,7 +165,7 @@ add_time_stamps(uint8_t pid __rte_unused, } static uint16_t -calc_latency(uint8_t pid __rte_unused, +calc_latency(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -226,10 +226,10 @@ rte_latencystats_init(uint64_t app_samp_intvl, rte_latency_stats_flow_type_fn user_cb) { unsigned int i; - uint8_t pid; + uint16_t pid; uint16_t qid; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const char *ptr_strings[NUM_LATENCY_STATS] = {0}; const struct rte_memzone *mz = NULL; const unsigned int flags = 0; @@ -290,11 +290,11 @@ rte_latencystats_init(uint64_t app_samp_intvl, int rte_latencystats_uninit(void) { - uint8_t pid; + uint16_t pid; uint16_t qid; int ret = 0; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); /** De register Rx/Tx callbacks */ for (pid = 0; pid < nb_ports; pid++) { diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile index 1c03bcbb7..6b21c62e5 100644 --- a/lib/librte_pdump/Makefile +++ b/lib/librte_pdump/Makefile @@ -40,7 +40,7 @@ LDLIBS += -lpthread EXPORT_MAP := rte_pdump_version.map -LIBABIVER := 1 +LIBABIVER := 2 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) := rte_pdump.c diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 729e79a36..e6182d35c 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -207,7 +207,7 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) } static uint16_t -pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_params) @@ -217,7 +217,7 @@ pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static uint16_t -pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) { pdump_copy(pkts, nb_pkts, user_params); @@ -225,7 +225,7 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static int -pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -279,7 +279,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, } static int -pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -337,7 +337,7 @@ static int set_pdump_rxtx_cbs(struct pdump_request *p) { uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue; - uint8_t port; + uint16_t port; int ret = 0; uint32_t flags; uint16_t operation; @@ -764,7 +764,7 @@ pdump_validate_flags(uint32_t flags) } static int -pdump_validate_port(uint8_t port, char *name) +pdump_validate_port(uint16_t port, char *name) { int ret = 0; @@ -828,7 +828,7 @@ pdump_prepare_client_request(char *device, uint16_t queue, } int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter) @@ -876,7 +876,7 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue, } int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags) +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags) { int ret = 0; char name[DEVICE_ID_SIZE]; diff --git a/lib/librte_pdump/rte_pdump.h b/lib/librte_pdump/rte_pdump.h index ba6e39b09..4ec0a106f 100644 --- a/lib/librte_pdump/rte_pdump.h +++ b/lib/librte_pdump/rte_pdump.h @@ -113,7 +113,7 @@ rte_pdump_uninit(void); */ int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter); @@ -136,7 +136,7 @@ rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, */ int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags); +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags); /** * Enables packet capturing on given device id and queue. diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile index 76629a13a..c2b1b2ce4 100644 --- a/lib/librte_port/Makefile +++ b/lib/librte_port/Makefile @@ -44,7 +44,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_port_version.map -LIBABIVER := 3 +LIBABIVER := 4 # # all source are stored in SRCS-y diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c index d5c5fba55..4ed10f276 100644 --- a/lib/librte_port/rte_port_ethdev.c +++ b/lib/librte_port/rte_port_ethdev.c @@ -60,7 +60,7 @@ struct rte_port_ethdev_reader { struct rte_port_in_stats stats; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -156,7 +156,7 @@ struct rte_port_ethdev_writer { uint16_t tx_buf_count; uint64_t bsz_mask; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -337,7 +337,7 @@ struct rte_port_ethdev_writer_nodrop { uint64_t bsz_mask; uint64_t n_retries; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * diff --git a/lib/librte_port/rte_port_ethdev.h b/lib/librte_port/rte_port_ethdev.h index 201a79e41..f5ed9ab2d 100644 --- a/lib/librte_port/rte_port_ethdev.h +++ b/lib/librte_port/rte_port_ethdev.h @@ -54,7 +54,7 @@ extern "C" { /** ethdev_reader port parameters */ struct rte_port_ethdev_reader_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -66,7 +66,7 @@ extern struct rte_port_in_ops rte_port_ethdev_reader_ops; /** ethdev_writer port parameters */ struct rte_port_ethdev_writer_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -82,7 +82,7 @@ extern struct rte_port_out_ops rte_port_ethdev_writer_ops; /** ethdev_writer_nodrop port parameters */ struct rte_port_ethdev_writer_nodrop_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range Zhiyong Yang @ 2017-09-25 11:37 ` Ferruh Yigit 2017-09-25 12:06 ` Ferruh Yigit 1 sibling, 0 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-09-25 11:37 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, adrien.mazarguil On 9/25/2017 4:22 AM, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib and drivers > data structures, specifically rte_eth_dev_data. Modify the APIs, > drivers and app using port_id at the same time. > > Fix some checkpatch issues from the original code and remove some > unnecessary cast operations. > > release_17_11 and deprecation have been updated in this patch. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> This is very hard to be sure everything covered. Also this patch will cause lots of merge conflict against next-net. I would suggest getting this patch as soon as possible, to give more time to possible fixes. Thanks, ferruh ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range Zhiyong Yang 2017-09-25 11:37 ` Ferruh Yigit @ 2017-09-25 12:06 ` Ferruh Yigit 2017-09-26 7:01 ` Yang, Zhiyong 1 sibling, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-25 12:06 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, adrien.mazarguil On 9/25/2017 4:22 AM, Zhiyong Yang wrote: > Extend port_id definition from uint8_t to uint16_t in lib and drivers > data structures, specifically rte_eth_dev_data. Modify the APIs, > drivers and app using port_id at the same time. > > Fix some checkpatch issues from the original code and remove some > unnecessary cast operations. > > release_17_11 and deprecation have been updated in this patch. > > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> > Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> <...> > diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile > index 70d517c16..4d62b7dbd 100644 > --- a/drivers/net/af_packet/Makefile > +++ b/drivers/net/af_packet/Makefile > @@ -40,7 +40,7 @@ LIB = librte_pmd_af_packet.a > > EXPORT_MAP := rte_pmd_af_packet_version.map > > -LIBABIVER := 1 > +LIBABIVER := 2 I have just recognized this one. This shouldn't be updated. Only LIABIVER of the libraries that their API modified should be updated. The release notes "Shared Library Versions" updates and Makefile LIBABIVER updates should be compatible. I mean either both needs to be updated or both not updated. There is no way to split this patch more without breaking build right? It would be possible to do it if port_t used, but that has been decided not to... <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range 2017-09-25 12:06 ` Ferruh Yigit @ 2017-09-26 7:01 ` Yang, Zhiyong 2017-09-27 18:44 ` Ferruh Yigit 0 siblings, 1 reply; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-26 7:01 UTC (permalink / raw) To: Yigit, Ferruh, dev; +Cc: thomas, adrien.mazarguil Hi Ferruh, Thomas, > > @@ -40,7 +40,7 @@ LIB = librte_pmd_af_packet.a > > > > EXPORT_MAP := rte_pmd_af_packet_version.map > > > > -LIBABIVER := 1 > > +LIBABIVER := 2 > > I have just recognized this one. This shouldn't be updated. Only LIABIVER of the > libraries that their API modified should be updated. > > The release notes "Shared Library Versions" updates and Makefile LIBABIVER > updates should be compatible. I mean either both needs to be updated or both > not updated. > Ok. I will cleanup the unnecessary updates. Here are the list I will update . - librte_bitratestats.so.1 + librte_bitratestats.so.2 - librte_ethdev.so.7 + librte_ethdev.so.8 - librte_pdump.so.1 + librte_pdump.so.2 - librte_pmd_bond.so.1 + librte_pmd_bnxt.so.2 + librte_pmd_bond.so.2 + librte_pmd_failsafe.so.2 + librte_pmd_i40e.so.2 + librte_pmd_ixgbe.so.2 + librte_pmd_vhost.so.2 Among them, the following libs are added newly. + librte_pmd_bnxt.so.2 + librte_pmd_failsafe.so.2 + librte_pmd_i40e.so.2 + librte_pmd_ixgbe.so.2 + librte_pmd_vhost.so.2 One LIBABIVER need to be fixed. Could you apply your patch http://www.dpdk.org/dev/patchwork/patch/28738/ in the main tree firstly? I hope the patchset can be merged into main tree. How do you think about it? > There is no way to split this patch more without breaking build right? Yes. it is too hard to split it. thanks Zhiyong > It would be possible to do it if port_t used, but that has been decided not to... > > <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range 2017-09-26 7:01 ` Yang, Zhiyong @ 2017-09-27 18:44 ` Ferruh Yigit 2017-09-28 2:12 ` Yang, Zhiyong 0 siblings, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-09-27 18:44 UTC (permalink / raw) To: Yang, Zhiyong, dev; +Cc: thomas, adrien.mazarguil On 9/26/2017 8:01 AM, Yang, Zhiyong wrote: > Hi Ferruh, Thomas, > >>> @@ -40,7 +40,7 @@ LIB = librte_pmd_af_packet.a >>> >>> EXPORT_MAP := rte_pmd_af_packet_version.map >>> >>> -LIBABIVER := 1 >>> +LIBABIVER := 2 >> >> I have just recognized this one. This shouldn't be updated. Only LIABIVER of the >> libraries that their API modified should be updated. >> >> The release notes "Shared Library Versions" updates and Makefile LIBABIVER >> updates should be compatible. I mean either both needs to be updated or both >> not updated. >> > > Ok. I will cleanup the unnecessary updates. > > Here are the list I will update . > > - librte_bitratestats.so.1 > + librte_bitratestats.so.2 > - librte_ethdev.so.7 > + librte_ethdev.so.8 > - librte_pdump.so.1 > + librte_pdump.so.2 > - librte_pmd_bond.so.1 > + librte_pmd_bnxt.so.2 > + librte_pmd_bond.so.2 > + librte_pmd_failsafe.so.2 > + librte_pmd_i40e.so.2 > + librte_pmd_ixgbe.so.2 > + librte_pmd_vhost.so.2 > > Among them, the following libs are added newly. > > + librte_pmd_bnxt.so.2 > + librte_pmd_failsafe.so.2 > + librte_pmd_i40e.so.2 > + librte_pmd_ixgbe.so.2 > + librte_pmd_vhost.so.2 There is a patch to add missing ones [1], I think it would be better to add them with a separate patch. But I missed the "librte_pmd_vhost" one, I will send a new version soon. Also failsafe don't have any PMD specific API, no need to add it. [1] http://dpdk.org/dev/patchwork/patch/28598/ > > One LIBABIVER need to be fixed. > Could you apply your patch http://www.dpdk.org/dev/patchwork/patch/28738/ in the main tree firstly? > > I hope the patchset can be merged into main tree. How do you think about it? > >> There is no way to split this patch more without breaking build right? > > Yes. it is too hard to split it. > > thanks > Zhiyong > >> It would be possible to do it if port_t used, but that has been decided not to... >> >> <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range 2017-09-27 18:44 ` Ferruh Yigit @ 2017-09-28 2:12 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-09-28 2:12 UTC (permalink / raw) To: Yigit, Ferruh, dev; +Cc: thomas, adrien.mazarguil Ferruh, > There is a patch to add missing ones [1], I think it would be better to add them > with a separate patch. > > But I missed the "librte_pmd_vhost" one, I will send a new version soon. > > Also failsafe don't have any PMD specific API, no need to add it. > > > [1] > http://dpdk.org/dev/patchwork/patch/28598/ > http://dpdk.org/dev/patchwork/patch/28598/ http://www.dpdk.org/dev/patchwork/patch/28738/ Ok, Once these two patches have been applied , I will rebase the increase port_id range patchset to send V6 out. Thanks Zhiyong ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v5 3/5] examples: increase port_id range 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range Zhiyong Yang @ 2017-09-25 3:22 ` Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 4/5] test: " Zhiyong Yang ` (2 subsequent siblings) 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-25 3:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, adrien.mazarguil, Zhiyong Yang Modify port_id related code in examples accordingly since port_id definition in lib and pmd changes. Fix some original checkpatch issues and remove some unnecessary cast at the same time. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- examples/bond/main.c | 16 +-- examples/distributor/main.c | 26 ++-- examples/exception_path/main.c | 35 +++-- examples/ip_fragmentation/main.c | 33 ++--- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 ++--- examples/ipv4_multicast/main.c | 30 ++--- examples/kni/main.c | 30 +++-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 ++--- examples/l2fwd-keepalive/main.c | 50 +++---- examples/l2fwd/main.c | 47 +++---- examples/l3fwd-acl/main.c | 9 +- examples/l3fwd-power/main.c | 60 +++++---- examples/l3fwd-vf/main.c | 50 +++---- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 15 ++- examples/l3fwd/l3fwd_lpm.h | 4 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 ++--- examples/link_status_interrupt/main.c | 9 +- examples/load_balancer/config.c | 14 +- examples/load_balancer/init.c | 34 +++-- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 17 +-- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 23 ++-- examples/netmap_compat/lib/compat_netmap.c | 52 ++++---- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +-- examples/performance-thread/l3fwd-thread/main.c | 143 +++++++++++---------- examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +++-- examples/qos_sched/main.c | 14 +- examples/qos_sched/main.h | 24 ++-- examples/qos_sched/stats.c | 16 ++- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- 54 files changed, 551 insertions(+), 520 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index 2d019d433..cb55552c2 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -141,10 +141,10 @@ addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], \ addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]) -uint8_t slaves[RTE_MAX_ETHPORTS]; -uint8_t slaves_count; +uint16_t slaves[RTE_MAX_ETHPORTS]; +uint16_t slaves_count; -static uint8_t BOND_PORT = 0xff; +static uint16_t BOND_PORT = 0xffff; static struct rte_mempool *mbuf_pool; @@ -171,7 +171,7 @@ static struct rte_eth_conf port_conf = { }; static void -slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) +slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) { int retval; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; @@ -215,7 +215,7 @@ slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) struct ether_addr addr; rte_eth_macaddr_get(portid, &addr); - printf("Port %u MAC: ", (unsigned)portid); + printf("Port %u MAC: ", portid); PRINT_MAC(addr); printf("\n"); } @@ -234,7 +234,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "Faled to create bond port\n"); - BOND_PORT = (uint8_t)retval; + BOND_PORT = retval; retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); if (retval != 0) @@ -675,10 +675,10 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result, struct cmdline *cl, __attribute__((unused)) void *data) { - uint8_t slaves[16] = {0}; + uint16_t slaves[16] = {0}; uint8_t len = 16; struct ether_addr addr; - uint8_t i = 0; + uint16_t i = 0; while (i < slaves_count) { rte_eth_macaddr_get(i, &addr); diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 87603d039..108efc8a6 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -132,7 +132,7 @@ static void print_stats(void); * 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_conf port_conf = port_conf_default; const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1; @@ -175,13 +175,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) struct rte_eth_link link; rte_eth_link_get_nowait(port, &link); while (!link.link_status) { - printf("Waiting for Link up on port %"PRIu8"\n", port); + printf("Waiting for Link up on port %"PRIu16"\n", port); sleep(1); rte_eth_link_get_nowait(port, &link); } if (!link.link_status) { - printf("Link down on port %"PRIu8"\n", port); + printf("Link down on port %"PRIu16"\n", port); return 0; } @@ -189,7 +189,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -210,7 +210,7 @@ struct lcore_params { static int lcore_rx(struct lcore_params *p) { - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); uint8_t port; struct rte_mbuf *bufs[BURST_SIZE*2]; @@ -312,9 +312,9 @@ flush_one_port(struct output_buffer *outbuf, uint8_t outp) } static inline void -flush_all_ports(struct output_buffer *tx_buffers, uint8_t nb_ports) +flush_all_ports(struct output_buffer *tx_buffers, uint16_t nb_ports) { - uint8_t outp; + uint16_t outp; for (outp = 0; outp < nb_ports; outp++) { /* skip ports that are not enabled */ @@ -384,9 +384,9 @@ static int lcore_tx(struct rte_ring *in_r) { static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS]; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); - uint8_t port; + uint16_t port; for (port = 0; port < nb_ports; port++) { /* skip ports that are not enabled */ @@ -668,8 +668,8 @@ main(int argc, char *argv[]) struct rte_ring *rx_dist_ring; unsigned lcore_id, worker_id = 0; unsigned nb_ports; - uint8_t portid; - uint8_t nb_ports_available; + uint16_t portid; + uint16_t nb_ports_available; uint64_t t, freq; /* catch ctrl-c so we can print on exit */ @@ -719,10 +719,10 @@ main(int argc, char *argv[]) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) portid); + printf("Initializing port %u... done\n", portid); if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", + rte_exit(EXIT_FAILURE, "Cannot initialize port %u\n", portid); } diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index e551e6d11..c85a86c10 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -135,7 +135,7 @@ static uint64_t input_cores_mask = 0; static uint64_t output_cores_mask = 0; /* Array storing port_id that is associated with each lcore */ -static uint8_t port_ids[RTE_MAX_LCORE]; +static uint16_t port_ids[RTE_MAX_LCORE]; /* Structure type for recording lcore-specific stats */ struct stats { @@ -360,8 +360,8 @@ static void setup_port_lcore_affinities(void) { unsigned long i; - uint8_t tx_port = 0; - uint8_t rx_port = 0; + uint16_t tx_port = 0; + uint16_t rx_port = 0; /* Setup port_ids[] array, and check masks were ok */ RTE_LCORE_FOREACH(i) { @@ -451,17 +451,16 @@ init_port(uint8_t port) uint16_t nb_txd = NB_TXD; /* Initialise device and RX/TX queues */ - PRINT_INFO("Initialising port %u ...", (unsigned)port); + PRINT_INFO("Initialising port %u ...", port); fflush(stdout); ret = rte_eth_dev_configure(port, 1, 1, &port_conf); if (ret < 0) - FATAL_ERROR("Could not configure port%u (%d)", - (unsigned)port, ret); + FATAL_ERROR("Could not configure port%u (%d)", port, ret); ret = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd); if (ret < 0) FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, rte_eth_dev_socket_id(port), @@ -469,29 +468,30 @@ init_port(uint8_t port) pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_tx_queue_setup(port, 0, nb_txd, rte_eth_dev_socket_id(port), NULL); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_dev_start(port); if (ret < 0) - FATAL_ERROR("Could not start port%u (%d)", (unsigned)port, ret); + FATAL_ERROR("Could not start port%u (%d)", port, ret); rte_eth_promiscuous_enable(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"); @@ -506,14 +506,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 */ @@ -546,7 +545,7 @@ main(int argc, char** argv) { int ret; unsigned i,high_port; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; /* Associate signal_hanlder function with USR signals */ signal(SIGUSR1, signal_handler); diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8c0e17911..de252760f 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -154,7 +154,7 @@ struct rx_queue { struct rte_mempool *indirect_pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; #define MAX_RX_QUEUE_PER_LCORE 16 @@ -240,7 +240,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -261,11 +261,12 @@ send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) static inline void l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, - uint8_t queueid, uint8_t port_in) + uint8_t queueid, uint16_t port_in) { struct rx_queue *rxq; uint32_t i, len, next_hop; - uint8_t port_out, ipv6; + uint8_t ipv6; + uint16_t port_out; int32_t len2; ipv6 = 0; @@ -403,7 +404,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -423,7 +424,7 @@ main_loop(__attribute__((unused)) void *dummy) portid = qconf->rx_queue_list[i].portid; RTE_LOG(INFO, IP_FRAG, " -- lcoreid=%u portid=%d\n", lcore_id, - (int) portid); + portid); } while (1) { @@ -600,11 +601,12 @@ print_ethaddr(const char *name, 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"); @@ -619,14 +621,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 */ @@ -708,7 +709,7 @@ parse_ptype(struct rte_mbuf *m) /* callback function to detect packet type for a queue of a port */ static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -876,7 +877,7 @@ main(int argc, char **argv) uint16_t queueid = 0; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1035,7 +1036,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - 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/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 7cde49a47..ca59baf40 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -1236,7 +1236,7 @@ app_init_tap(struct app_params *app) #ifdef RTE_LIBRTE_KNI 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; if (port_id >= rte_eth_dev_count()) @@ -1250,7 +1250,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) { } static int -kni_change_mtu(uint8_t port_id, unsigned new_mtu) { +kni_change_mtu(uint16_t port_id, unsigned int new_mtu) { int ret; if (port_id >= rte_eth_dev_count()) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index e62636cb4..cadf4c5bd 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -166,7 +166,7 @@ struct rx_queue { struct rte_mempool *pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; struct tx_lcore_stat { @@ -277,7 +277,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; * send burst of packets on an output interface. */ static inline uint32_t -send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint16_t port) { uint32_t fill, len, k, n; struct mbuf_table *txmb; @@ -307,7 +307,7 @@ send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) /* 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 fill, lcore_id, len; struct lcore_queue_conf *qconf; @@ -337,7 +337,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) } static inline void -reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, +reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct lcore_queue_conf *qconf, uint64_t tms) { struct ether_hdr *eth_hdr; @@ -346,7 +346,7 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, struct rx_queue *rxq; void *d_addr_bytes; uint32_t next_hop; - uint8_t dst_port; + uint16_t dst_port; rxq = &qconf->rx_queue_list[queue]; @@ -454,7 +454,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t diff_tsc, cur_tsc, prev_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -473,7 +473,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].portid; - RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%hhu\n", lcore_id, + RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%u\n", lcore_id, portid); } @@ -732,11 +732,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"); @@ -751,14 +752,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 */ @@ -987,7 +987,7 @@ queue_dump_stat(void) qconf = &lcore_queue_conf[lcore]; for (i = 0; i < qconf->n_rx_queue; i++) { - fprintf(stdout, " -- lcoreid=%u portid=%hhu " + fprintf(stdout, " -- lcoreid=%u portid=%u " "frag tbl stat:\n", lcore, qconf->rx_queue_list[i].portid); rte_ip_frag_table_statistics_dump(stdout, @@ -1024,7 +1024,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1177,7 +1177,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); signal(SIGUSR1, signal_handler); signal(SIGTERM, signal_handler); diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 9a13d3530..1b6feae3e 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -116,7 +116,7 @@ static struct ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; -static uint8_t nb_ports = 0; +static uint16_t nb_ports; static int rx_queue_per_lcore = 1; @@ -195,7 +195,7 @@ static struct mcast_group_params mcast_group_table[] = { /* Send burst of packets on an output interface */ static void -send_burst(struct lcore_queue_conf *qconf, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t port) { struct rte_mbuf **m_table; uint16_t n, queueid; @@ -312,7 +312,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) */ static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, - struct lcore_queue_conf *qconf, uint8_t port) + struct lcore_queue_conf *qconf, uint16_t port) { struct ether_hdr *ethdr; uint16_t len; @@ -343,7 +343,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) struct ipv4_hdr *iphdr; uint32_t dest_addr, port_mask, port_num, use_clone; int32_t hash; - uint8_t port; + uint16_t port; union { uint64_t as_int; struct ether_addr as_addr; @@ -407,7 +407,7 @@ static inline void send_timeout_burst(struct lcore_queue_conf *qconf) { uint64_t cur_tsc; - uint8_t portid; + uint16_t portid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; cur_tsc = rte_rdtsc(); @@ -428,7 +428,7 @@ main_loop(__rte_unused void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; unsigned lcore_id; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; lcore_id = rte_lcore_id(); @@ -448,7 +448,7 @@ main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i]; RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%d\n", - lcore_id, (int) portid); + lcore_id, portid); } while (1) { @@ -610,11 +610,12 @@ init_mcast_hash(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -629,14 +630,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 */ @@ -673,7 +673,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/kni/main.c b/examples/kni/main.c index e3bc2fb78..c2c9e04d3 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -110,7 +110,7 @@ * Structure of port parameters */ struct kni_port_params { - uint8_t port_id;/* Port ID */ + uint16_t port_id;/* Port ID */ unsigned lcore_rx; /* lcore ID for RX */ unsigned lcore_tx; /* lcore ID for TX */ uint32_t nb_lcore_k; /* Number of lcores for KNI multi kernel threads */ @@ -162,8 +162,8 @@ struct kni_interface_stats { /* kni device statistics array */ static struct kni_interface_stats kni_stats[RTE_MAX_ETHPORTS]; -static int kni_change_mtu(uint8_t port_id, unsigned new_mtu); -static int kni_config_network_interface(uint8_t port_id, uint8_t if_up); +static int kni_change_mtu(uint16_t port_id, unsigned int new_mtu); +static int kni_config_network_interface(uint16_t port_id, uint8_t if_up); static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); @@ -171,7 +171,7 @@ static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); static void print_stats(void) { - uint8_t i; + uint16_t i; printf("\n**KNI example application statistics**\n" "====== ============== ============ ============ ============ ============\n" @@ -238,7 +238,8 @@ kni_burst_free_mbufs(struct rte_mbuf **pkts, unsigned num) static void kni_ingress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_rx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -274,7 +275,8 @@ kni_ingress(struct kni_port_params *p) static void kni_egress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_tx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -416,7 +418,7 @@ parse_config(const char *arg) 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)); while (((p = strchr(p0, '(')) != NULL) && @@ -445,7 +447,7 @@ parse_config(const char *arg) } i = 0; - port_id = (uint8_t)int_fld[i++]; + port_id = int_fld[i++]; if (port_id >= RTE_MAX_ETHPORTS) { printf("Port ID %d could not exceed the maximum %d\n", port_id, RTE_MAX_ETHPORTS); @@ -698,7 +700,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) /* 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 int new_mtu) { int ret; struct rte_eth_conf conf; @@ -741,7 +743,7 @@ kni_change_mtu(uint8_t port_id, unsigned new_mtu) /* 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; @@ -766,7 +768,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) } static int -kni_alloc(uint8_t port_id) +kni_alloc(uint16_t port_id) { uint8_t i; struct rte_kni *kni; @@ -790,7 +792,7 @@ kni_alloc(uint8_t port_id) } else snprintf(conf.name, RTE_KNI_NAMESIZE, "vEth%u", port_id); - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; /* * The first KNI device associated to a port @@ -825,7 +827,7 @@ kni_alloc(uint8_t port_id) } static int -kni_free_kni(uint8_t port_id) +kni_free_kni(uint16_t port_id) { uint8_t i; struct kni_port_params **p = kni_port_params_array; @@ -848,7 +850,7 @@ int main(int argc, char** argv) { int ret; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; unsigned i; /* Associate signal_hanlder function with USR signals */ diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index c293bd9c9..b10ac896f 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -59,7 +59,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -106,7 +106,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -124,8 +124,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -181,7 +181,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -217,7 +217,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 989362067..9511156d8 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -776,9 +776,9 @@ main(int argc, char **argv) unsigned nb_ports_in_mask = 0; int ret; char name[RTE_JOBSTATS_NAMESIZE]; - uint8_t nb_ports; - uint8_t nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; uint8_t i; /* init EAL */ @@ -861,7 +861,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -870,24 +870,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -899,7 +899,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -907,8 +907,9 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid), NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup:err=%d, port=%u\n", + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -916,7 +917,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -924,21 +925,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done:\n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 83bc542c1..2f543d31d 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -157,7 +157,7 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, __attribute__((unused)) void *ptr_data) { uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -299,7 +299,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -479,11 +479,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"); @@ -498,14 +499,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 */ @@ -560,9 +560,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; struct sigaction signal_handler; @@ -653,7 +653,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; printf("Lcore %u: RX port %u\n", - rx_lcore_id, (unsigned) portid); + rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -662,26 +662,25 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", - (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -694,7 +693,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -704,7 +703,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -712,7 +711,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -720,21 +719,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: " "%02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 142633584..3bf3b28b1 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -304,7 +304,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -480,11 +480,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"); @@ -503,14 +504,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 */ @@ -553,9 +553,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; @@ -644,7 +644,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -653,24 +653,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]); @@ -682,7 +682,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -691,7 +691,7 @@ main(int argc, char **argv) NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -699,7 +699,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -707,21 +707,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done: \n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 8eff4de41..77f83cd6d 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -121,7 +121,7 @@ static int promiscuous_on; /**< Ports set in promiscuous mode off by default. */ static int numa_on = 1; /**< NUMA is enabled by default. */ struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -131,7 +131,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -1358,7 +1358,8 @@ 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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; int socketid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -1381,7 +1382,7 @@ 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-power/main.c b/examples/l3fwd-power/main.c index fd442f5ef..8a8f34b50 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -174,7 +174,7 @@ enum freq_scale_hint_t }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; enum freq_scale_hint_t freq_up_hint; uint32_t zero_rx_packet_count; @@ -190,7 +190,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -308,8 +308,8 @@ static lookup_struct_t *ipv6_l3fwd_lookup_struct[NB_SOCKETS]; #define IPV6_L3FWD_NUM_ROUTES \ (sizeof(ipv6_l3fwd_route_array) / sizeof(ipv6_l3fwd_route_array[0])) -static uint8_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; -static uint8_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) @@ -370,7 +370,7 @@ static struct rte_timer power_timers[RTE_MAX_LCORE]; static inline uint32_t power_idle_heuristic(uint32_t zero_rx_packet_count); static inline enum freq_scale_hint_t power_freq_scaleup_heuristic( \ - unsigned lcore_id, uint8_t port_id, uint16_t queue_id); + unsigned int lcore_id, uint16_t port_id, uint16_t queue_id); /* exit signal handler */ static void @@ -523,8 +523,8 @@ print_ipv6_key(struct ipv6_5tuple key) key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t * ipv4_l3fwd_lookup_struct) { struct ipv4_5tuple key; @@ -559,11 +559,11 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, /* 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 -get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { struct ipv6_5tuple key; @@ -599,18 +599,18 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid); } @@ -634,7 +634,7 @@ parse_ptype_one(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -648,7 +648,7 @@ cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, } static int -add_cb_parse_ptype(uint8_t portid, uint16_t queueid) +add_cb_parse_ptype(uint16_t portid, uint16_t queueid) { printf("Port %d: softly parse packet type info\n", portid); if (rte_eth_add_rx_callback(portid, queueid, cb_parse_ptype, NULL)) @@ -665,7 +665,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *d_addr_bytes; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -758,7 +758,7 @@ power_idle_heuristic(uint32_t zero_rx_packet_count) static inline enum freq_scale_hint_t power_freq_scaleup_heuristic(unsigned lcore_id, - uint8_t port_id, + uint16_t port_id, uint16_t queue_id) { /** @@ -805,7 +805,8 @@ sleep_until_rx_interrupt(int num) { struct rte_epoll_event event[num]; int n, i; - uint8_t port_id, queue_id; + uint16_t port_id; + uint8_t queue_id; void *data; RTE_LOG(INFO, L3FWD_POWER, @@ -832,7 +833,8 @@ static void turn_on_intr(struct lcore_conf *qconf) { int i; struct lcore_rx_queue *rx_queue; - uint8_t port_id, queue_id; + uint8_t queue_id; + uint16_t port_id; for (i = 0; i < qconf->n_rx_queue; ++i) { rx_queue = &(qconf->rx_queue_list[i]); @@ -848,7 +850,8 @@ static void turn_on_intr(struct lcore_conf *qconf) static int event_register(struct lcore_conf *qconf) { struct lcore_rx_queue *rx_queue; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; uint32_t data; int ret; int i; @@ -879,7 +882,8 @@ main_loop(__attribute__((unused)) void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; uint64_t prev_tsc_power = 0, cur_tsc_power, diff_tsc_power; int i, j, nb_rx; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; enum freq_scale_hint_t lcore_scaleup_hint; @@ -904,7 +908,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%hhu " + RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%u " "rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -1541,11 +1545,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; + uint8_t count, all_ports_up, print_flag = 0; + uint16_t portid; struct rte_eth_link link; printf("\nChecking link status"); @@ -1651,7 +1656,8 @@ main(int argc, char **argv) uint64_t hz; uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + uint16_t portid; uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ @@ -1751,7 +1757,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (qconf->tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Can't allocate tx buffer for port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(qconf->tx_buffer[portid], MAX_PKT_BURST); } diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 34e4a6bef..a84339115 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -155,7 +155,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -165,7 +165,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -300,7 +300,7 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE]; static rte_spinlock_t spinlock_conf[RTE_MAX_ETHPORTS] = {RTE_SPINLOCK_INITIALIZER}; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -324,7 +324,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 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; uint16_t len; @@ -396,8 +396,9 @@ print_key(struct ipv4_5tuple key) (unsigned)key.ip_dst, (unsigned)key.ip_src, key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint16_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ipv4_5tuple key; struct tcp_hdr *tcp; @@ -430,29 +431,31 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd /* Find destination port */ ret = rte_hash_lookup(l3fwd_lookup_struct, (const void *)&key); - return (uint8_t)((ret < 0)? portid : l3fwd_out_if[ret]); + return ((ret < 0) ? portid : l3fwd_out_if[ret]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint32_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(l3fwd_lookup_struct, - rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? - next_hop : portid); + return ((rte_lpm_lookup(l3fwd_lookup_struct, + rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0) ? + next_hop : portid); } #endif static inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *tmp; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -496,7 +499,8 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, 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; @@ -516,8 +520,8 @@ 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", lcore_id, - portid, queueid); + RTE_LOG(INFO, L3FWD, " --lcoreid=%u portid=%u rxqueueid=%hhu\n", + lcore_id, portid, queueid); } while (1) { @@ -624,7 +628,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; @@ -676,8 +680,8 @@ print_usage(const char *prgname) static void signal_handler(int signum) { - uint8_t portid; - uint8_t nb_ports = rte_eth_dev_count(); + uint16_t portid; + uint16_t nb_ports = rte_eth_dev_count(); /* When we receive a SIGINT signal */ if (signum == SIGINT) { @@ -749,7 +753,7 @@ parse_config(const char *q_arg) nb_lcore_params); return -1; } - lcore_params_array[nb_lcore_params].port_id = (uint8_t)int_fld[FLD_PORT]; + lcore_params_array[nb_lcore_params].port_id = int_fld[FLD_PORT]; lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = (uint8_t)int_fld[FLD_LCORE]; ++nb_lcore_params; @@ -953,11 +957,11 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t nb_lcores; uint16_t n_tx_queue; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; signal(SIGINT, signal_handler); /* init EAL */ diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index 011ba148b..4bb15943c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -83,7 +83,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -117,7 +117,7 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE]; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -139,7 +139,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 int send_single_packet(struct lcore_conf *qconf, - struct rte_mbuf *m, uint8_t port) + struct rte_mbuf *m, uint16_t port) { uint16_t len; @@ -212,11 +212,11 @@ int lpm_check_ptype(int portid); uint16_t -em_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +em_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); uint16_t -lpm_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); int diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h index 2867365d0..7002a43a4 100644 --- a/examples/l3fwd/l3fwd_common.h +++ b/examples/l3fwd/l3fwd_common.h @@ -207,7 +207,7 @@ static const struct { }; static __rte_always_inline void -send_packetsx4(struct lcore_conf *qconf, uint8_t port, struct rte_mbuf *m[], +send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 53d081bd7..df38a1362 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -628,7 +628,7 @@ em_parse_ptype(struct rte_mbuf *m) } uint16_t -em_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h index d509a1fcd..302291d71 100644 --- a/examples/l3fwd/l3fwd_em.h +++ b/examples/l3fwd/l3fwd_em.h @@ -35,12 +35,12 @@ #define __L3FWD_EM_H__ static __rte_always_inline void -l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; uint32_t tcp_or_udp; uint32_t l3_ptypes; @@ -112,7 +112,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, */ static inline void l3fwd_em_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h index 520672d51..9d7afe053 100644 --- a/examples/l3fwd/l3fwd_em_hlm.h +++ b/examples/l3fwd/l3fwd_em_hlm.h @@ -52,7 +52,7 @@ static __rte_always_inline void em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -68,7 +68,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv4_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -79,7 +79,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], static __rte_always_inline void em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -95,7 +95,7 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv6_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -106,9 +106,9 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], 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; + uint16_t next_hop; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; uint32_t tcp_or_udp; @@ -158,7 +158,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, pos; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index ff1e40355..a809e0649 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -105,7 +105,7 @@ struct rte_lpm *ipv4_l3fwd_lpm_lookup_struct[NB_SOCKETS]; struct rte_lpm6 *ipv6_l3fwd_lpm_lookup_struct[NB_SOCKETS]; static inline uint16_t -lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm *ipv4_l3fwd_lookup_struct = @@ -117,7 +117,7 @@ lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) } static inline uint16_t -lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm6 *ipv6_l3fwd_lookup_struct = @@ -130,7 +130,7 @@ lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) static __rte_always_inline uint16_t lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint8_t portid) + uint16_t portid) { struct ipv6_hdr *ipv6_hdr; struct ipv4_hdr *ipv4_hdr; @@ -162,7 +162,7 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, */ static __rte_always_inline uint16_t lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint32_t dst_ipv4, uint8_t portid) + uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -203,7 +203,8 @@ lpm_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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -225,7 +226,7 @@ lpm_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); } @@ -413,7 +414,7 @@ lpm_parse_ptype(struct rte_mbuf *m) } uint16_t -lpm_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h index 55c3e8329..53b7fc805 100644 --- a/examples/l3fwd/l3fwd_lpm.h +++ b/examples/l3fwd/l3fwd_lpm.h @@ -35,7 +35,7 @@ #define __L3FWD_LPM_H__ static __rte_always_inline void -l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; @@ -104,7 +104,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, static inline void l3fwd_lpm_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h index baedbfe84..85f314d1e 100644 --- a/examples/l3fwd/l3fwd_lpm_neon.h +++ b/examples/l3fwd/l3fwd_lpm_neon.h @@ -82,7 +82,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, int32x4_t dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -115,7 +115,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 = 0, j = 0; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h index 4e294c844..d474396ed 100644 --- a/examples/l3fwd/l3fwd_lpm_sse.h +++ b/examples/l3fwd/l3fwd_lpm_sse.h @@ -79,7 +79,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, __m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -112,7 +112,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 j; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 81995fdbe..a5e55baae 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -124,7 +124,7 @@ uint32_t hash_entry_number = HASH_ENTRY_NUMBER_DEFAULT; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -245,7 +245,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { @@ -263,7 +263,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; @@ -445,7 +445,7 @@ parse_config(const char *q_arg) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -750,11 +750,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"); @@ -773,14 +774,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 */ @@ -818,7 +818,7 @@ signal_handler(int signum) } static int -prepare_ptype_parser(uint8_t portid, uint16_t queueid) +prepare_ptype_parser(uint16_t portid, uint16_t queueid) { if (parse_ptype) { printf("Port %d: softly parse packet type info\n", portid); @@ -847,10 +847,10 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1048,7 +1048,7 @@ main(int argc, char **argv) } - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); ret = 0; /* launch per-lcore init on every lcore */ diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f4e3969a6..c83a62fa4 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -145,7 +145,7 @@ print_stats(void) { struct rte_eth_link link; uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -165,7 +165,7 @@ print_stats(void) continue; memset(&link, 0, sizeof(link)); - rte_eth_link_get_nowait((uint8_t)portid, &link); + rte_eth_link_get_nowait(portid, &link); printf("\nStatistics for port %u ------------------------------" "\nLink status: %25s" "\nLink speed: %26u" @@ -470,7 +470,7 @@ lsi_parse_args(int argc, char **argv) * int. */ static int -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, void *ret_param) { struct rte_eth_link link; @@ -498,7 +498,8 @@ check_all_ports_link_status(uint8_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"); diff --git a/examples/load_balancer/config.c b/examples/load_balancer/config.c index 503250951..ae234de82 100644 --- a/examples/load_balancer/config.c +++ b/examples/load_balancer/config.c @@ -240,7 +240,7 @@ parse_arg_rx(const char *arg) if (lp->io.rx.n_nic_queues >= APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE) { return -9; } - lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = (uint8_t) port; + lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = port; lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].queue = (uint8_t) queue; lp->io.rx.n_nic_queues ++; @@ -318,7 +318,7 @@ parse_arg_tx(const char *arg) if (lp->io.tx.n_nic_ports >= APP_MAX_NIC_TX_PORTS_PER_IO_LCORE) { return -9; } - lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = (uint8_t) port; + lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = port; lp->io.tx.n_nic_ports ++; n_tuples ++; @@ -488,7 +488,7 @@ app_check_lpm_table(void) static int app_check_every_rx_port_is_tx_enabled(void) { - uint8_t port; + uint16_t port; for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { if ((app_get_nic_rx_queues_per_port(port) > 0) && (app.nic_tx_port_mask[port] == 0)) { @@ -762,7 +762,7 @@ app_parse_args(int argc, char **argv) } int -app_get_nic_rx_queues_per_port(uint8_t port) +app_get_nic_rx_queues_per_port(uint16_t port) { uint32_t i, count; @@ -781,7 +781,7 @@ app_get_nic_rx_queues_per_port(uint8_t port) } int -app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) +app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, uint32_t *lcore_out) { uint32_t lcore; @@ -808,7 +808,7 @@ app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) } int -app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out) +app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out) { uint32_t lcore; @@ -901,7 +901,7 @@ app_print_params(void) /* Print NIC RX configuration */ printf("NIC RX ports: "); for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { - uint32_t n_rx_queues = app_get_nic_rx_queues_per_port((uint8_t) port); + uint32_t n_rx_queues = app_get_nic_rx_queues_per_port(port); if (n_rx_queues == 0) { continue; diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 717232e6e..5f9b0df2a 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -308,7 +308,7 @@ app_init_rings_tx(void) continue; } - if (app_get_lcore_for_nic_tx((uint8_t) port, &lcore_io) < 0) { + if (app_get_lcore_for_nic_tx(port, &lcore_io) < 0) { rte_panic("Algorithmic error (no I/O core to handle TX of port %u)\n", port); } @@ -359,11 +359,12 @@ app_init_rings_tx(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; uint32_t n_rx_queues, n_tx_queues; @@ -383,14 +384,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 */ @@ -422,7 +422,8 @@ app_init_nics(void) { unsigned socket; uint32_t lcore; - uint8_t port, queue; + uint16_t port; + uint8_t queue; int ret; uint32_t n_rx_queues, n_tx_queues; @@ -440,14 +441,14 @@ app_init_nics(void) } /* Init port */ - printf("Initializing NIC port %u ...\n", (unsigned) port); + printf("Initializing NIC port %u ...\n", port); ret = rte_eth_dev_configure( port, (uint8_t) n_rx_queues, (uint8_t) n_tx_queues, &port_conf); if (ret < 0) { - rte_panic("Cannot init NIC port %u (%d)\n", (unsigned) port, ret); + rte_panic("Cannot init NIC port %u (%d)\n", port, ret); } rte_eth_promiscuous_enable(port); @@ -457,7 +458,7 @@ app_init_nics(void) port, &nic_rx_ring_size, &nic_tx_ring_size); if (ret < 0) { rte_panic("Cannot adjust number of descriptors for port %u (%d)\n", - (unsigned) port, ret); + port, ret); } app.nic_rx_ring_size = nic_rx_ring_size; app.nic_tx_ring_size = nic_tx_ring_size; @@ -473,8 +474,7 @@ app_init_nics(void) pool = app.lcore_params[lcore].pool; printf("Initializing NIC port %u RX queue %u ...\n", - (unsigned) port, - (unsigned) queue); + port, queue); ret = rte_eth_rx_queue_setup( port, queue, @@ -484,9 +484,7 @@ app_init_nics(void) pool); if (ret < 0) { rte_panic("Cannot init RX queue %u for port %u (%d)\n", - (unsigned) queue, - (unsigned) port, - ret); + queue, port, ret); } } @@ -495,7 +493,7 @@ app_init_nics(void) app_get_lcore_for_nic_tx(port, &lcore); socket = rte_lcore_to_socket_id(lcore); printf("Initializing NIC port %u TX queue 0 ...\n", - (unsigned) port); + port); ret = rte_eth_tx_queue_setup( port, 0, diff --git a/examples/load_balancer/main.h b/examples/load_balancer/main.h index dc407555d..bef2ba041 100644 --- a/examples/load_balancer/main.h +++ b/examples/load_balancer/main.h @@ -248,7 +248,7 @@ struct app_lcore_params_io { struct { /* NIC */ struct { - uint8_t port; + uint16_t port; uint8_t queue; } nic_queues[APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE]; uint32_t n_nic_queues; @@ -275,7 +275,7 @@ struct app_lcore_params_io { struct rte_ring *rings[APP_MAX_NIC_PORTS][APP_MAX_WORKER_LCORES]; /* NIC */ - uint8_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; + uint16_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; uint32_t n_nic_ports; /* Internal buffers */ @@ -368,9 +368,10 @@ void app_print_usage(void); void app_init(void); int app_lcore_main_loop(void *arg); -int app_get_nic_rx_queues_per_port(uint8_t port); -int app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out); -int app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out); +int app_get_nic_rx_queues_per_port(uint16_t port); +int app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, + uint32_t *lcore_out); +int app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out); int app_is_socket_used(uint32_t socket); uint32_t app_get_lcores_io_rx(void); uint32_t app_get_lcores_worker(void); diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index e54b78510..b342e755f 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -188,7 +188,7 @@ app_lcore_io_rx( uint32_t i; for (i = 0; i < lp->rx.n_nic_queues; i ++) { - uint8_t port = lp->rx.nic_queues[i].port; + uint16_t port = lp->rx.nic_queues[i].port; uint8_t queue = lp->rx.nic_queues[i].queue; uint32_t n_mbufs, j; @@ -213,7 +213,7 @@ app_lcore_io_rx( printf("I/O RX %u in (NIC port %u): NIC drop ratio = %.2f avg burst size = %.2f\n", lcore, - (unsigned) port, + port, (double) stats.imissed / (double) (stats.imissed + stats.ipackets), ((double) lp->rx.nic_queues_count[i]) / ((double) lp->rx.nic_queues_iters[i])); lp->rx.nic_queues_iters[i] = 0; @@ -339,7 +339,7 @@ app_lcore_io_tx( uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i ++) { - uint8_t port = lp->tx.nic_ports[i]; + uint16_t port = lp->tx.nic_ports[i]; struct rte_ring *ring = lp->tx.rings[port][worker]; uint32_t n_mbufs, n_pkts; int ret; @@ -395,7 +395,7 @@ app_lcore_io_tx( printf("\t\t\tI/O TX %u out (port %u): avg burst size = %.2f\n", lcore, - (unsigned) port, + port, ((double) lp->tx.nic_ports_count[port]) / ((double) lp->tx.nic_ports_iters[port])); lp->tx.nic_ports_iters[port] = 0; lp->tx.nic_ports_count[port] = 0; @@ -418,7 +418,7 @@ app_lcore_io_tx( static inline void app_lcore_io_tx_flush(struct app_lcore_params_io *lp) { - uint8_t port; + uint16_t port; uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i++) { @@ -569,7 +569,7 @@ app_lcore_worker( if (lp->rings_out_iters[port] == APP_STATS){ printf("\t\tWorker %u out (NIC port %u): enq success rate = %.2f\n", (unsigned) lp->worker_id, - (unsigned) port, + port, ((double) lp->rings_out_count[port]) / ((double) lp->rings_out_iters[port])); lp->rings_out_iters[port] = 0; lp->rings_out_count[port] = 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 f8453e57a..59f36af08 100644 --- a/examples/multi_process/client_server_mp/mp_client/client.c +++ b/examples/multi_process/client_server_mp/mp_client/client.c @@ -74,7 +74,7 @@ static uint8_t client_id = 0; #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]; @@ -150,7 +150,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; @@ -161,7 +161,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; @@ -171,15 +171,16 @@ configure_tx_buffer(uint8_t port_id, uint16_t size) 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) port_id); + 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) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } /* @@ -195,8 +196,8 @@ configure_output_ports(const struct port_info *ports) rte_exit(EXIT_FAILURE, "Too many ethernet ports. RTE_MAX_ETHPORTS = %u\n", (unsigned)RTE_MAX_ETHPORTS); for (i = 0; i < ports->num_ports - 1; i+=2){ - uint8_t p1 = ports->id[i]; - uint8_t p2 = ports->id[i+1]; + uint16_t p1 = ports->id[i]; + uint16_t p2 = ports->id[i+1]; output_ports[p1] = p2; output_ports[p2] = p1; diff --git a/examples/multi_process/client_server_mp/mp_server/args.c b/examples/multi_process/client_server_mp/mp_server/args.c index bf8c666c2..a65884fd9 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.c +++ b/examples/multi_process/client_server_mp/mp_server/args.c @@ -74,7 +74,7 @@ parse_portmask(uint8_t max_ports, const char *portmask) { char *end = NULL; unsigned long pm; - uint8_t count = 0; + uint16_t count = 0; if (portmask == NULL || *portmask == '\0') return -1; @@ -128,7 +128,7 @@ parse_num_clients(const char *clients) * on error. */ int -parse_app_args(uint8_t max_ports, int argc, char *argv[]) +parse_app_args(uint16_t max_ports, int argc, char *argv[]) { int option_index, opt; char **argvopt = argv; diff --git a/examples/multi_process/client_server_mp/mp_server/args.h b/examples/multi_process/client_server_mp/mp_server/args.h index 23af1bd38..33888b894 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.h +++ b/examples/multi_process/client_server_mp/mp_server/args.h @@ -34,6 +34,6 @@ #ifndef _ARGS_H_ #define _ARGS_H_ -int parse_app_args(uint8_t max_ports, int argc, char *argv[]); +int parse_app_args(uint16_t max_ports, int argc, char *argv[]); #endif /* ifndef _ARGS_H_ */ diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index 0bc929217..cacf4e0d5 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -114,7 +114,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 = { @@ -129,7 +129,7 @@ init_port(uint8_t port_num) uint16_t q; int retval; - printf("Port %u init ... ", (unsigned)port_num); + printf("Port %u init ... ", port_num); fflush(stdout); /* Standard DPDK port initialisation - config port, then set up @@ -200,11 +200,12 @@ init_shm_rings(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -262,7 +263,7 @@ init(int argc, char *argv[]) { int retval; const struct rte_memzone *mz; - uint8_t i, total_ports; + uint16_t i, total_ports; /* init EAL, parsing EAL args */ retval = rte_eal_init(argc, argv); diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index 7055b543a..121383f8c 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -88,7 +88,7 @@ struct client_rx_buf { static struct client_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/multi_process/client_server_mp/shared/common.h b/examples/multi_process/client_server_mp/shared/common.h index 631c46325..35a3b01d0 100644 --- a/examples/multi_process/client_server_mp/shared/common.h +++ b/examples/multi_process/client_server_mp/shared/common.h @@ -57,8 +57,8 @@ struct tx_stats{ } __rte_cache_aligned; struct port_info { - uint8_t num_ports; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t num_ports; + uint16_t id[RTE_MAX_ETHPORTS]; volatile struct rx_stats rx_stats; volatile struct tx_stats tx_stats[MAX_CLIENTS]; }; diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index f8a626ba7..238b7f67b 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -140,7 +140,8 @@ struct lcore_resource_struct { /* ring[1] for slave send ack, master read */ struct rte_ring *ring[2]; int port_num; /* Total port numbers */ - uint8_t port[RTE_MAX_ETHPORTS]; /* Port id for that lcore to receive packets */ + /* Port id for that lcore to receive packets */ + uint16_t port[RTE_MAX_ETHPORTS]; }__attribute__((packed)) __rte_cache_aligned; static struct lcore_resource_struct lcore_resource[RTE_MAX_LCORE]; @@ -871,11 +872,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"); @@ -890,14 +892,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 */ @@ -930,9 +931,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned rx_lcore_id; unsigned nb_ports_in_mask = 0; unsigned i; diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index af2d9f3f7..98fbd74d1 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -129,7 +129,7 @@ static void netmap_unregif(uint32_t idx, uint32_t port); static int32_t -ifname_to_portid(const char *ifname, uint8_t *port) +ifname_to_portid(const char *ifname, uint16_t *port) { char *endptr; uint64_t portid; @@ -140,7 +140,7 @@ ifname_to_portid(const char *ifname, uint8_t *port) portid >= RTE_DIM(ports) || errno != 0) return -EINVAL; - *port = (uint8_t)portid; + *port = portid; return 0; } @@ -222,10 +222,10 @@ fd_release(int32_t fd) } static int -check_nmreq(struct nmreq *req, uint8_t *port) +check_nmreq(struct nmreq *req, uint16_t *port) { int32_t rc; - uint8_t portid; + uint16_t portid; if (req == NULL) return -EINVAL; @@ -242,7 +242,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) } if (ports[portid].pool == NULL) { - RTE_LOG(ERR, USER1, "Misconfigured portid %hhu\n", portid); + RTE_LOG(ERR, USER1, "Misconfigured portid %u\n", portid); return -EINVAL; } @@ -262,7 +262,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) static int ioctl_niocginfo(__rte_unused int fd, void * param) { - uint8_t portid; + uint16_t portid; struct nmreq *req; int32_t rc; @@ -283,7 +283,7 @@ ioctl_niocginfo(__rte_unused int fd, void * param) } static void -netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, +netmap_ring_setup(struct netmap_ring *ring, uint16_t port, uint32_t ringid, uint32_t num_slots) { uint32_t j; @@ -305,7 +305,7 @@ netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, } static int -netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) +netmap_regif(struct nmreq *req, uint32_t idx, uint16_t port) { struct netmap_if *nmif; struct netmap_ring *ring; @@ -313,7 +313,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) int32_t rc; if (ports[port].fd < RTE_DIM(fd_port)) { - RTE_LOG(ERR, USER1, "port %hhu already in use by fd: %u\n", + RTE_LOG(ERR, USER1, "port %u already in use by fd: %u\n", port, IDX_TO_FD(ports[port].fd)); return -EBUSY; } @@ -399,7 +399,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) static int ioctl_niocregif(int32_t fd, void * param) { - uint8_t portid; + uint16_t portid; int32_t rc; uint32_t idx; struct nmreq *req; @@ -422,7 +422,7 @@ netmap_unregif(uint32_t idx, uint32_t port) { fd_port[idx].port = FD_PORT_RSRV; ports[port].fd = UINT32_MAX; - rte_eth_dev_stop((uint8_t)port); + rte_eth_dev_stop(port); } /** @@ -460,7 +460,7 @@ ioctl_niocunregif(int fd) * packets as it can hold coming from its dpdk port. */ static inline int -rx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +rx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, uint16_t max_burst) { int32_t i, n_rx; @@ -513,7 +513,7 @@ rx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_rx_rings + 1; i++) { r = NETMAP_RXRING(nifp, i); - rx_sync_ring(r, (uint8_t)port, (uint16_t)i, burst); + rx_sync_ring(r, port, (uint16_t)i, burst); rc += r->avail; } @@ -542,7 +542,7 @@ ioctl_niocrxsync(int fd) * buffers into rte_mbufs and sending them out on the rings's dpdk port. */ static int -tx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +tx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, struct rte_mempool *pool, uint16_t max_burst) { uint32_t i, n_tx; @@ -608,7 +608,7 @@ tx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_tx_rings + 1; i++) { r = NETMAP_TXRING(nifp, i); - tx_sync_ring(r, (uint8_t)port, (uint16_t)i, mp, burst); + tx_sync_ring(r, port, (uint16_t)i, mp, burst); rc += r->avail; } @@ -686,7 +686,7 @@ rte_netmap_init(const struct rte_netmap_conf *conf) int -rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) +rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) { int32_t ret; uint16_t i; @@ -696,17 +696,17 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) portid >= RTE_DIM(ports) || conf->nr_tx_rings > netmap.conf.max_rings || conf->nr_rx_rings > netmap.conf.max_rings) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } - rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); - tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); + rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); + tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); if (tx_slots > netmap.conf.max_slots || rx_slots > netmap.conf.max_slots) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } @@ -715,15 +715,15 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) conf->nr_tx_rings, conf->eth_conf); if (ret < 0) { - RTE_LOG(ERR, USER1, "Couldn't configure port %hhu\n", portid); - return ret; + RTE_LOG(ERR, USER1, "Couldn't configure port %u\n", portid); + return ret; } ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_slots, &tx_slots); if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't ot adjust number of descriptors for port %hhu\n", + "Couldn't ot adjust number of descriptors for port %u\n", portid); return ret; } @@ -734,8 +734,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure TX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure TX queue %u of port %u\n", i, portid); return ret; } @@ -745,8 +744,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure RX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure RX queue %u of port %u\n", i, portid); return ret; } diff --git a/examples/netmap_compat/lib/compat_netmap.h b/examples/netmap_compat/lib/compat_netmap.h index 3dc7a2f40..76b2d2b4c 100644 --- a/examples/netmap_compat/lib/compat_netmap.h +++ b/examples/netmap_compat/lib/compat_netmap.h @@ -67,7 +67,7 @@ struct rte_netmap_port_conf { }; int rte_netmap_init(const struct rte_netmap_conf *conf); -int rte_netmap_init_port(uint8_t portid, +int rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf); int rte_netmap_close(int fd); diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index b26c33df5..3add7be47 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -269,21 +269,22 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) 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) port_id); + port_id); rte_eth_tx_buffer_init(tx_buffer[port_id], MAX_PKTS_BURST); ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id], flush_tx_error_callback, NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } return 0; } static inline int -configure_eth_port(uint8_t port_id) +configure_eth_port(uint16_t port_id) { struct ether_addr addr; const uint16_t rxRings = 1, txRings = 1; @@ -326,7 +327,7 @@ configure_eth_port(uint8_t port_id) rte_eth_macaddr_get(port_id, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port_id, + port_id, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -401,7 +402,7 @@ rx_thread(struct rte_ring *ring_out) uint32_t seqn = 0; uint16_t i, ret = 0; uint16_t nb_rx_pkts; - uint8_t port_id; + uint16_t port_id; struct rte_mbuf *pkts[MAX_PKTS_BURST]; RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__, @@ -632,8 +633,8 @@ main(int argc, char **argv) int ret; unsigned nb_ports; unsigned int lcore_id, last_lcore_id, master_lcore_id; - uint8_t port_id; - uint8_t nb_ports_available; + uint16_t port_id; + uint16_t nb_ports_available; struct worker_thread_args worker_args = {NULL, NULL}; struct send_thread_args send_args = {NULL, NULL}; struct rte_ring *rx_to_workers; @@ -687,7 +688,7 @@ main(int argc, char **argv) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) port_id); + printf("Initializing port %u... done\n", port_id); if (configure_eth_port(port_id) != 0) rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 7954b9744..9a1eef61a 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -140,7 +140,7 @@ parse_ptype(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(__rte_unused uint8_t port, __rte_unused uint16_t queue, +cb_parse_ptype(__rte_unused uint16_t port, __rte_unused uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, __rte_unused uint16_t max_pkts, __rte_unused void *user_param) { @@ -277,7 +277,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -287,7 +287,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct rx_thread_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; uint8_t thread_id; @@ -648,7 +648,7 @@ struct thread_tx_conf tx_thread[MAX_TX_THREAD]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct thread_tx_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -669,7 +669,7 @@ send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) /* 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) { uint16_t len; struct thread_tx_conf *qconf; @@ -696,7 +696,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) #if ((APP_LOOKUP_METHOD == APP_LOOKUP_LPM) && \ (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline void -send_packetsx4(uint8_t port, +send_packetsx4(uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; @@ -832,8 +832,8 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len) static __m128i mask0; static __m128i mask1; static __m128i mask2; -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { int ret = 0; @@ -846,11 +846,11 @@ get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, key.xmm = _mm_and_si128(data, mask0); /* 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 -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { int ret = 0; @@ -873,36 +873,36 @@ get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t)((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(((struct ipv4_hdr *)ipv4_hdr)->dst_addr), &next_hop) == 0) ? next_hop : portid); } -static inline uint8_t -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, lookup6_struct_t *ipv6_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, + return ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) == 0) ? next_hop : portid); } #endif -static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) __attribute__((unused)); #if ((APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH) && \ @@ -919,11 +919,11 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) #define EXCLUDE_8TH_PKT 0x7f static inline void -simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { struct ether_hdr *eth_hdr[8]; struct ipv4_hdr *ipv4_hdr[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; int32_t ret[8]; union ipv4_5tuple_host key[8]; __m128i data[8]; @@ -1042,14 +1042,14 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv4_lookup_struct, &key_array[0], 8, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1146,10 +1146,10 @@ static inline void get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0, } static inline void -simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { int32_t ret[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; struct ether_hdr *eth_hdr[8]; union ipv6_5tuple_host key[8]; @@ -1196,14 +1196,14 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv6_lookup_struct, &key_array[0], 4, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1250,24 +1250,24 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) ether_addr_copy(&ports_eth_addr[dst_port[6]], ð_hdr[6]->s_addr); ether_addr_copy(&ports_eth_addr[dst_port[7]], ð_hdr[7]->s_addr); - send_single_packet(m[0], (uint8_t)dst_port[0]); - send_single_packet(m[1], (uint8_t)dst_port[1]); - send_single_packet(m[2], (uint8_t)dst_port[2]); - send_single_packet(m[3], (uint8_t)dst_port[3]); - send_single_packet(m[4], (uint8_t)dst_port[4]); - send_single_packet(m[5], (uint8_t)dst_port[5]); - send_single_packet(m[6], (uint8_t)dst_port[6]); - send_single_packet(m[7], (uint8_t)dst_port[7]); + send_single_packet(m[0], dst_port[0]); + send_single_packet(m[1], dst_port[1]); + send_single_packet(m[2], dst_port[2]); + send_single_packet(m[3], dst_port[3]); + send_single_packet(m[4], dst_port[4]); + send_single_packet(m[5], dst_port[5]); + send_single_packet(m[6], dst_port[6]); + send_single_packet(m[7], dst_port[7]); } #endif /* APP_LOOKUP_METHOD */ static __rte_always_inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -1379,7 +1379,7 @@ rfc1812_process(struct ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype) (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline uint16_t -get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) +get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -1406,7 +1406,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) } static inline void -process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint8_t portid) +process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; @@ -1473,7 +1473,7 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], static inline void processx4_step2(__m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -1716,7 +1716,8 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2) static void process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx, - uint8_t portid) { + uint16_t portid) +{ int j; @@ -2091,7 +2092,7 @@ lthread_tx(void *args) struct lthread *lt; unsigned lcore_id; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; tx_conf = (struct thread_tx_conf *)args; @@ -2138,7 +2139,8 @@ lthread_rx(void *dummy) int ret; uint16_t nb_rx; int i; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; int worker_id; int len[RTE_MAX_LCORE] = { 0 }; int old_len, new_len; @@ -2164,7 +2166,8 @@ lthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", rte_lcore_id(), portid, queueid); } @@ -2323,7 +2326,7 @@ pthread_tx(void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; uint64_t prev_tsc, diff_tsc, cur_tsc; int nb_rx; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -2392,7 +2395,8 @@ pthread_rx(void *dummy) uint32_t n; uint32_t nb_rx; unsigned lcore_id; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct thread_rx_conf *rx_conf; @@ -2411,7 +2415,8 @@ pthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -2769,7 +2774,7 @@ parse_rx_config(const char *q_arg) return -1; } rx_thread_params_array[nb_rx_thread_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + int_fld[FLD_PORT]; rx_thread_params_array[nb_rx_thread_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; rx_thread_params_array[nb_rx_thread_params].lcore_id = @@ -2853,7 +2858,7 @@ parse_stat_lcore(const char *stat_lcore) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -3440,7 +3445,8 @@ check_all_ports_link_status(uint8_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"); @@ -3455,14 +3461,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 */ @@ -3497,10 +3502,10 @@ main(int argc, char **argv) int ret; int i; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index ddfcdb832..c495e7508 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -158,12 +158,12 @@ struct ptpv2_data_slave_ordinary { struct clock_id master_clock_id; struct timeval new_adj; int64_t delta; - uint8_t portid; + uint16_t portid; uint16_t seqID_SYNC; uint16_t seqID_FOLLOWUP; uint8_t ptpset; uint8_t kernel_time_set; - uint8_t current_ptp_port; + uint16_t current_ptp_port; }; static struct ptpv2_data_slave_ordinary ptp_data; diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 2350d64f4..203a34704 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -252,8 +252,8 @@ app_parse_flow_conf(const char *conf_str) pconf = &qos_conf[nb_pfc]; - pconf->rx_port = (uint8_t)vals[0]; - pconf->tx_port = (uint8_t)vals[1]; + pconf->rx_port = vals[0]; + pconf->tx_port = vals[1]; pconf->rx_core = (uint8_t)vals[2]; pconf->wt_core = (uint8_t)vals[3]; if (ret == 5) @@ -267,19 +267,19 @@ app_parse_flow_conf(const char *conf_str) } if (pconf->rx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu16" index\n", nb_pfc, pconf->rx_port); return -1; } if (pconf->tx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu16" index\n", nb_pfc, pconf->tx_port); return -1; } mask = 1lu << pconf->rx_port; if (app_used_rx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu16" is used already\n", nb_pfc, pconf->rx_port); return -1; } @@ -288,7 +288,7 @@ app_parse_flow_conf(const char *conf_str) mask = 1lu << pconf->tx_port; if (app_used_tx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: port %"PRIu16" is used already\n", nb_pfc, pconf->tx_port); return -1; } diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index a82cbd7d5..004ac54e7 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -100,7 +100,7 @@ static const struct rte_eth_conf port_conf = { }; static int -app_init_port(uint8_t portid, struct rte_mempool *mp) +app_init_port(uint16_t portid, struct rte_mempool *mp) { int ret; struct rte_eth_link link; @@ -127,19 +127,21 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; /* init port */ - RTE_LOG(INFO, APP, "Initializing port %"PRIu8"... ", portid); + RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot configure device: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "Cannot configure device: err=%d, port=%u\n", + ret, portid); rx_size = ring_conf.rx_size; tx_size = ring_conf.tx_size; ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_size, &tx_size); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_dev_adjust_nb_rx_tx_desc: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_dev_adjust_nb_rx_tx_desc: err=%d,port=%u\n", + ret, portid); ring_conf.rx_size = rx_size; ring_conf.tx_size = tx_size; @@ -148,22 +150,25 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size, rte_eth_dev_socket_id(portid), &rx_conf, mp); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u\n", + ret, portid); /* init one TX queue */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, (uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, " - "port=%"PRIu8" queue=%d\n", ret, portid, 0); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n", + ret, portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_pmd_port_start: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_pmd_port_start: err=%d, port=%u\n", + ret, portid); printf("done: "); @@ -256,7 +261,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) uint32_t pipe, subport; int err; - rte_eth_link_get((uint8_t)portid, &link); + rte_eth_link_get(portid, &link); port_params.socket = socketid; port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8; diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index e10cfd448..1e2fb189b 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -125,8 +125,7 @@ app_main_loop(__attribute__((unused))void *dummy) /* initialize mbuf memory */ if (mode == APP_RX_MODE) { for (i = 0; i < rx_idx; i++) { - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "reading port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u reading port%u\n", i, lcore_id, rx_confs[i]->rx_port); } @@ -140,8 +139,8 @@ app_main_loop(__attribute__((unused))void *dummy) if (wt_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u sched+write " - "port %"PRIu8"\n", + RTE_LOG(INFO, APP, + "flow %u lcoreid %u sched+write port %u\n", i, lcore_id, wt_confs[i]->tx_port); } @@ -155,8 +154,7 @@ app_main_loop(__attribute__((unused))void *dummy) if (tx_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "writing port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u write port%u\n", i, lcore_id, tx_confs[i]->tx_port); } @@ -186,7 +184,7 @@ app_stat(void) struct flow_conf *flow = &qos_conf[i]; rte_eth_stats_get(flow->rx_port, &stats); - printf("\nRX port %"PRIu8": rx: %"PRIu64 " err: %"PRIu64 + printf("\nRX port %"PRIu16": rx: %"PRIu64 " err: %"PRIu64 " no_mbuf: %"PRIu64 "\n", flow->rx_port, stats.ipackets - rx_stats[i].ipackets, @@ -195,7 +193,7 @@ app_stat(void) memcpy(&rx_stats[i], &stats, sizeof(stats)); rte_eth_stats_get(flow->tx_port, &stats); - printf("TX port %"PRIu8": tx: %" PRIu64 " err: %" PRIu64 "\n", + printf("TX port %"PRIu16": tx: %" PRIu64 " err: %" PRIu64 "\n", flow->tx_port, stats.opackets - tx_stats[i].opackets, stats.oerrors - tx_stats[i].oerrors); diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h index 8d02e1ade..77b6e3ee7 100644 --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -106,8 +106,8 @@ struct thread_conf uint32_t n_mbufs; struct rte_mbuf **m_table; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -125,8 +125,8 @@ struct flow_conf uint32_t rx_core; uint32_t wt_core; uint32_t tx_core; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -188,13 +188,15 @@ void app_worker_thread(struct thread_conf **qconf); void app_mixed_thread(struct thread_conf **qconf); void app_stat(void); -int subport_stat(uint8_t port_id, uint32_t subport_id); -int pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q); -int qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc); -int qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc); -int qavg_subport(uint8_t port_id, uint32_t subport_id); +int subport_stat(uint16_t port_id, uint32_t subport_id); +int pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc, uint8_t q); +int qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc); +int qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc); +int qavg_subport(uint16_t port_id, uint32_t subport_id); #ifdef __cplusplus } diff --git a/examples/qos_sched/stats.c b/examples/qos_sched/stats.c index 5c894455b..b5545e10c 100644 --- a/examples/qos_sched/stats.c +++ b/examples/qos_sched/stats.c @@ -37,7 +37,8 @@ #include "main.h" int -qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q) +qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, + uint8_t q) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -74,7 +75,8 @@ qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8 } int -qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) +qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -114,7 +116,7 @@ qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) } int -qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -153,7 +155,7 @@ qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) } int -qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) +qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -195,7 +197,7 @@ qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) } int -qavg_subport(uint8_t port_id, uint32_t subport_id) +qavg_subport(uint16_t port_id, uint32_t subport_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -237,7 +239,7 @@ qavg_subport(uint8_t port_id, uint32_t subport_id) } int -subport_stat(uint8_t port_id, uint32_t subport_id) +subport_stat(uint16_t port_id, uint32_t subport_id) { struct rte_sched_subport_stats stats; struct rte_sched_port *port; @@ -273,7 +275,7 @@ subport_stat(uint8_t port_id, uint32_t subport_id) } int -pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 083a37a92..415b68bb9 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -156,12 +156,12 @@ void init_ring(int lcore_id, uint8_t port_id) void pair_ports(void) { - uint8_t i, j; + uint16_t i, j; /* Pair ports with their "closest neighbour" in the portmask */ for (i = 0; i < RTE_MAX_ETHPORTS; i++) if (is_bit_set(i, portmask)) - for (j = (uint8_t) (i + 1); j < RTE_MAX_ETHPORTS; j++) + for (j = i + 1; j < RTE_MAX_ETHPORTS; j++) if (is_bit_set(j, portmask)) { port_pairs[i] = j; port_pairs[j] = i; diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c index d4fcfde48..e5ecdb1cf 100644 --- a/examples/quota_watermark/qw/main.c +++ b/examples/quota_watermark/qw/main.c @@ -155,7 +155,7 @@ receive_stage(__attribute__((unused)) void *args) { int i, ret; - uint8_t port_id; + uint16_t port_id; uint16_t nb_rx_pkts; unsigned int lcore_id; @@ -216,7 +216,7 @@ pipeline_stage(__attribute__((unused)) void *args) int i, ret; int nb_dq_pkts; - uint8_t port_id; + uint16_t port_id; unsigned int lcore_id, previous_lcore_id; unsigned int free; @@ -279,8 +279,8 @@ send_stage(__attribute__((unused)) void *args) { uint16_t nb_dq_pkts; - uint8_t port_id; - uint8_t dest_port_id; + uint16_t port_id; + uint16_t dest_port_id; unsigned int lcore_id, previous_lcore_id; @@ -324,7 +324,7 @@ main(int argc, char **argv) int ret; unsigned int lcore_id, master_lcore_id, last_lcore_id; - uint8_t port_id; + uint16_t port_id; rte_log_set_global_level(RTE_LOG_INFO); diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 669924055..e66f16f25 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -59,7 +59,7 @@ static struct { 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, uint16_t max_pkts __rte_unused, void *_ __rte_unused) { @@ -72,7 +72,7 @@ add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } 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; @@ -97,7 +97,7 @@ calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused, * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; - uint8_t portid; + uint16_t portid; /* init EAL */ int ret = rte_eal_init(argc, argv); diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index dcdc0a48b..382a2ded8 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -95,7 +95,7 @@ struct efd_stats { static struct node_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/server_node_efd/shared/common.h b/examples/server_node_efd/shared/common.h index 8a1347993..b1e0abe52 100644 --- a/examples/server_node_efd/shared/common.h +++ b/examples/server_node_efd/shared/common.h @@ -65,9 +65,9 @@ struct filter_stats { struct shared_info { uint8_t num_nodes; - uint8_t num_ports; + uint16_t num_ports; uint32_t num_flows; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t id[RTE_MAX_ETHPORTS]; struct rx_stats rx_stats; struct tx_stats tx_stats[MAX_NODES]; struct filter_stats filter_stats[MAX_NODES]; diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index b4d50de89..e623754cf 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -57,7 +57,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -104,7 +104,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -122,8 +122,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -179,7 +179,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -204,7 +204,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 4d1589d06..89a61f0e5 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -177,7 +177,7 @@ static 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 = 0; /**< The number of ports specified in command line */ static uint16_t num_pf_queues, num_vmdq_queues; static uint16_t vmdq_pool_base, vmdq_queue_base; @@ -265,7 +265,7 @@ validate_num_devices(uint32_t max_nb_devices) * coming from the mbuf_pool passed as parameter */ static inline int -port_init(uint8_t port) +port_init(uint16_t port) { struct rte_eth_dev_info dev_info; struct rte_eth_conf port_conf; @@ -392,7 +392,7 @@ port_init(uint8_t port) RTE_LOG(INFO, VHOST_PORT, "Max virtio devices supported: %u\n", num_devices); RTE_LOG(INFO, VHOST_PORT, "Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, vmdq_ports_eth_addr[port].addr_bytes[0], vmdq_ports_eth_addr[port].addr_bytes[1], vmdq_ports_eth_addr[port].addr_bytes[2], @@ -667,7 +667,7 @@ us_vhost_parse_args(int argc, char **argv) for (i = 0; i < RTE_MAX_ETHPORTS; i++) { if (enabled_port_mask & (1 << i)) - ports[num_ports++] = (uint8_t)i; + ports[num_ports++] = i; } if ((num_ports == 0) || (num_ports > MAX_SUP_PORTS)) { @@ -1443,7 +1443,7 @@ main(int argc, char *argv[]) unsigned lcore_id, core_id = 0; unsigned nb_ports, valid_num_ports; int ret, i; - uint8_t portid; + uint16_t portid; static pthread_t tid; char thread_name[RTE_MAX_THREAD_NAME_LEN]; uint64_t flags = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v5 4/5] test: increase port_id range 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang ` (2 preceding siblings ...) 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 3/5] examples: " Zhiyong Yang @ 2017-09-25 3:22 ` Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 5/5] librte_mbuf: modify port initialization value Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-25 3:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, adrien.mazarguil, Zhiyong Yang Increase port_id range from 8 bit to 16 bits in test code, and remove some unnecessary cast operations. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- test/test/test_kni.c | 12 +++++------ test/test/test_link_bonding.c | 40 ++++++++++++++++++------------------- test/test/test_link_bonding_mode4.c | 12 +++++------ test/test/test_pmd_perf.c | 30 ++++++++++++++-------------- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 +++++++++++----------- test/test/virtual_pmd.h | 28 ++++++++++++++------------ 7 files changed, 75 insertions(+), 73 deletions(-) diff --git a/test/test/test_kni.c b/test/test/test_kni.c index db17fdf30..2450c9ff5 100644 --- a/test/test/test_kni.c +++ b/test/test/test_kni.c @@ -132,7 +132,7 @@ test_kni_lookup_mempool(void) } /* 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 int new_mtu) { printf("Change MTU of port %d to %u\n", port_id, new_mtu); kni_pkt_mtu = new_mtu; @@ -362,7 +362,7 @@ test_kni_register_handler_mp(void) } static int -test_kni_processing(uint8_t port_id, struct rte_mempool *mp) +test_kni_processing(uint16_t port_id, struct rte_mempool *mp) { int ret = 0; unsigned i; @@ -387,7 +387,7 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp) conf.core_id = 1; conf.force_bind = 1; conf.mbuf_size = MAX_PACKET_SZ; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; ops = kni_ops; ops.port_id = port_id; @@ -472,7 +472,7 @@ static int test_kni(void) { int ret = -1; - uint8_t nb_ports, port_id; + uint16_t nb_ports, port_id; struct rte_kni *kni; struct rte_mempool *mp; struct rte_kni_conf conf; @@ -538,7 +538,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; @@ -567,7 +567,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c index dc28cea59..e41ab60d2 100644 --- a/test/test/test_link_bonding.c +++ b/test/test/test_link_bonding.c @@ -94,9 +94,9 @@ uint8_t slave_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; uint8_t bonded_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; struct link_bonding_unittest_params { - int8_t bonded_port_id; - int8_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; - uint8_t bonded_slave_count; + int16_t bonded_port_id; + int16_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; + uint16_t bonded_slave_count; uint8_t bonding_mode; uint16_t nb_rx_q; @@ -317,7 +317,7 @@ test_create_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Don't try to recreate bonded device if re-running test suite*/ if (test_params->bonded_port_id == -1) { @@ -387,7 +387,7 @@ test_add_slave_to_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count]), @@ -434,7 +434,7 @@ test_remove_slave_from_bonded_device(void) { int current_slave_count; struct ether_addr read_mac_addr, *mac_addr; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count-1]), @@ -496,7 +496,7 @@ static int test_add_already_bonded_slave_to_bonded_device(void) { int port_id, current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; char pmd_name[RTE_ETH_NAME_MAX_LEN]; test_add_slave_to_bonded_device(); @@ -528,7 +528,7 @@ static int test_get_slaves_from_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), "Failed to add slave to bonded device"); @@ -609,7 +609,7 @@ test_start_bonded_device(void) struct rte_eth_link link_status; int current_slave_count, current_bonding_mode, primary_port; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Add slave to bonded device*/ TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), @@ -658,7 +658,7 @@ static int test_stop_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct rte_eth_link link_status; @@ -932,7 +932,7 @@ test_set_bonded_port_initialization_mac_assignment(void) { int i, slave_count, bonded_port_id; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; struct ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; @@ -1114,7 +1114,7 @@ test_set_bonded_port_initialization_mac_assignment(void) static int initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr, - uint8_t number_of_slaves, uint8_t enable_slave) + uint16_t number_of_slaves, uint8_t enable_slave) { /* Configure bonded device */ TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, @@ -1179,7 +1179,7 @@ int test_lsc_interrupt_count; static int -test_bonding_lsc_event_callback(uint8_t port_id __rte_unused, +test_bonding_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type type __rte_unused, void *param __rte_unused, void *ret_param __rte_unused) @@ -1224,7 +1224,7 @@ static int test_status_interrupt(void) { int slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* initialized bonding device with T slaves */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( @@ -1313,7 +1313,7 @@ test_status_interrupt(void) static int generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size, uint8_t vlan, uint8_t ipv4, uint8_t toggle_dst_mac, - uint8_t toggle_ip_addr, uint8_t toggle_udp_port) + uint8_t toggle_ip_addr, uint16_t toggle_udp_port) { uint16_t pktlen, generated_burst_size, ether_type; void *ip_hdr; @@ -1854,7 +1854,7 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -2408,7 +2408,7 @@ test_activebackup_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; @@ -3302,7 +3302,7 @@ test_balance_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -3861,7 +3861,7 @@ test_broadcast_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -4373,7 +4373,7 @@ test_tlb_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; diff --git a/test/test/test_link_bonding_mode4.c b/test/test/test_link_bonding_mode4.c index 8e9e23db5..77ec09c54 100644 --- a/test/test/test_link_bonding_mode4.c +++ b/test/test/test_link_bonding_mode4.c @@ -325,7 +325,7 @@ remove_slave(struct slave_conf *slave) } static void -lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) +lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; @@ -343,7 +343,7 @@ lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) } static int -initialize_bonded_device_with_slaves(uint8_t slave_count, uint8_t external_sm) +initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) { uint8_t i; @@ -379,8 +379,8 @@ remove_slaves_and_stop_bonded_device(void) { struct slave_conf *slave; int retval; - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t i; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t i; rte_eth_dev_stop(test_params.bonded_port_id); @@ -411,7 +411,7 @@ test_setup(void) char name[RTE_ETH_NAME_MAX_LEN]; struct slave_conf *port; const uint8_t socket_id = rte_socket_id(); - uint8_t i; + uint16_t i; if (test_params.mbuf_pool == NULL) { nb_mbuf_per_pool = TEST_RX_DESC_MAX + DEF_PKT_BURST + @@ -1521,7 +1521,7 @@ check_environment(void) { struct slave_conf *port; uint8_t i, env_state; - uint8_t slaves[RTE_DIM(test_params.slave_ports)]; + uint16_t slaves[RTE_DIM(test_params.slave_ports)]; int slaves_count; env_state = 0; diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c index 1ffd65a52..a3e29ed9e 100644 --- a/test/test/test_pmd_perf.c +++ b/test/test/test_pmd_perf.c @@ -50,7 +50,7 @@ #define MAX_PKT_BURST (32) #define RTE_TEST_RX_DESC_DEFAULT (128) #define RTE_TEST_TX_DESC_DEFAULT (512) -#define RTE_PORT_ALL (~(uint8_t)0x0) +#define RTE_PORT_ALL (~(uint16_t)0x0) /* how long test would take at full line rate */ #define RTE_TEST_DURATION (2) @@ -143,7 +143,7 @@ struct lcore_conf { uint8_t status; uint8_t socketid; uint16_t nb_ports; - uint8_t portlist[RTE_MAX_ETHPORTS]; + uint16_t portlist[RTE_MAX_ETHPORTS]; } __rte_cache_aligned; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; @@ -160,11 +160,12 @@ static uint32_t sc_flag; /* Check the link status of all ports in up to 3s, 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 30 /* 3s (30 * 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("Checking link statuses...\n"); @@ -179,16 +180,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", (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")); if (link_mbps == 0) link_mbps = link.link_speed; } 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 */ @@ -335,7 +335,7 @@ reset_count(void) } static void -stats_display(uint8_t port_id) +stats_display(uint16_t port_id) { struct rte_eth_stats stats; rte_eth_stats_get(port_id, &stats); @@ -383,7 +383,7 @@ measure_rxtx(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -422,7 +422,7 @@ measure_rxonly(struct lcore_conf *conf, portid = conf->portlist[i]; cur_tsc = rte_rdtsc(); - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -459,7 +459,7 @@ measure_txonly(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -537,7 +537,7 @@ main_loop(__rte_unused void *args) portid = conf->portlist[i]; int nb_free = pkt_per_port; do { /* dry out */ - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); nb_tx = 0; while (nb_tx < nb_rx) @@ -600,7 +600,7 @@ poll_burst(void *args) while (total) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, &pkts_burst[next[portid]], MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { diff --git a/test/test/test_pmd_ring_perf.c b/test/test/test_pmd_ring_perf.c index 004882af1..8e9cd3310 100644 --- a/test/test/test_pmd_ring_perf.c +++ b/test/test/test_pmd_ring_perf.c @@ -54,7 +54,7 @@ static const volatile unsigned bulk_sizes[] = { 1, 8, 32 }; /* The ring structure used for tests */ static struct rte_ring *r; -static uint8_t ring_ethdev_port; +static uint16_t ring_ethdev_port; /* Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */ static void diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c index 9d46ad564..6568cb5b9 100644 --- a/test/test/virtual_pmd.c +++ b/test/test/virtual_pmd.c @@ -261,7 +261,7 @@ static const struct eth_dev_ops virtual_ethdev_default_dev_ops = { void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -275,7 +275,7 @@ virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -288,7 +288,7 @@ virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -301,7 +301,7 @@ virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -314,7 +314,7 @@ virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -430,7 +430,7 @@ virtual_ethdev_tx_burst_fail(void *queue, struct rte_mbuf **bufs, void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -442,7 +442,7 @@ virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct virtual_ethdev_private *dev_private = NULL; struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -458,7 +458,7 @@ virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count) { struct virtual_ethdev_private *dev_private = NULL; @@ -470,7 +470,7 @@ virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, } void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -478,7 +478,7 @@ virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) } void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -490,7 +490,7 @@ virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, } int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -502,7 +502,7 @@ virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, } int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct virtual_ethdev_private *dev_private; diff --git a/test/test/virtual_pmd.h b/test/test/virtual_pmd.h index de001884d..7c53dd346 100644 --- a/test/test/virtual_pmd.h +++ b/test/test/virtual_pmd.h @@ -48,53 +48,55 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, uint8_t socket_id, uint8_t isr_support); void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status); +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status); void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status); int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkts_burst, int burst_length); int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length); /** Control methods for the dev_ops functions pointer to control the behavior * of the Virtual PMD */ void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_stop_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_stop_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success); /* if a value greater than zero is set for packet_fail_count then virtual * device tx burst function will fail that many packet from burst or all * packets if packet_fail_count is greater than the number of packets in the * burst */ void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count); #ifdef __cplusplus -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v5 5/5] librte_mbuf: modify port initialization value 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang ` (3 preceding siblings ...) 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 4/5] test: " Zhiyong Yang @ 2017-09-25 3:22 ` Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-25 3:22 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, adrien.mazarguil, Zhiyong Yang In order to support more than 256 virtual ports, the field "port" in rte_mbuf has been increased to 16 bits. The initialization/reset value of the field "port" should be changed from 0xff to 0xffff accordingly. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 26a62b8e1..bcf4e2fcf 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp, /* init some constant fields */ m->pool = mp; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; rte_mbuf_refcnt_set(m, 1); m->next = NULL; } diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eaed7eee0..cc380400d 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1087,6 +1087,8 @@ static inline void rte_pktmbuf_reset_headroom(struct rte_mbuf *m) * @param m * The packet mbuf to be resetted. */ +#define MBUF_INVALID_PORT UINT16_MAX + static inline void rte_pktmbuf_reset(struct rte_mbuf *m) { m->next = NULL; @@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m) m->vlan_tci = 0; m->vlan_tci_outer = 0; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; m->ol_flags = 0; m->packet_type = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v6 0/5] increase port_id range 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang ` (4 preceding siblings ...) 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 5/5] librte_mbuf: modify port initialization value Zhiyong Yang @ 2017-09-29 7:17 ` Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang ` (5 more replies) 5 siblings, 6 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-29 7:17 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas port_id is currently defined as uint8_t, which is limited to the range 0 to 255. A larger range is required for vdev scalability. It is necessary for a redefinition of port_id to extend it from 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will be changed at the same time. Discussion about port_id is the following thread. http://www.dpdk.org/dev/patchwork/patch/23208/ Changes in V2: 1. cover more PMDs to increase port_id range. 2. cover more examples to increase port_id range. 3. add 17.11 release note. Changes in V3: 1. cover mlx4 and mlx5. 2. add to increase port_id range in test code. 3. The patch "librte_mbuf: modify port initialization value" is merged into the patchset. Changes in V4: 1. Add a patch to remove bonding APIs using ABI versioning according to Ferruh's comments. 2. Unify to use typedef portid_t in testpmd code. 3. update release note deprecation doc in 2/5 4. fix some issues according to comments. Changes in V5: 1. For 1/5, bond_mode_8023ad_conf_get_v1708() and bond_mode_8023ad_conf _get() are merged into one function bond_mode_8023ad_conf_get. Changes in V6: 1. For 2/5, remove the unnecessary LIBABIVER in Makefile and update the release notes "Shared Library Versions". Note: The patchset have dependency on the following patch. http://www.dpdk.org/dev/patchwork/patch/28738/ http://www.dpdk.org/dev/patchwork/patch/29219/ Note: 3/5 and 4/5 patches' building depends on 2/5 patch since 2/5 patch breaks lib/PMD API/ABI. Zhiyong Yang (5): net/bonding: remove bonding APIs using ABI versioning ethdev: increase port_id range examples: increase port_id range test: increase port_id range librte_mbuf: modify port initialization value app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 +-- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 18 +- app/test-pmd/testpmd.h | 4 +- doc/guides/rel_notes/deprecation.rst | 6 - doc/guides/rel_notes/release_17_11.rst | 24 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnxt/Makefile | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 32 +-- drivers/net/bonding/Makefile | 2 +- drivers/net/bonding/rte_eth_bond.h | 41 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 203 +++-------------- drivers/net/bonding/rte_eth_bond_8023ad.h | 48 ++-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 62 +++--- drivers/net/bonding/rte_eth_bond_private.h | 45 ++-- drivers/net/bonding/rte_eth_bond_version.map | 4 - drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/Makefile | 2 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++-- drivers/net/ixgbe/Makefile | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 ++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 64 +++--- drivers/net/mlx5/mlx5_rxtx.h | 4 +- drivers/net/nfp/nfp_net.c | 16 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/Makefile | 2 +- drivers/net/vhost/rte_eth_vhost.c | 6 +- drivers/net/vhost/rte_eth_vhost.h | 4 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/vmxnet3/vmxnet3_ring.h | 4 +- examples/bond/main.c | 16 +- examples/distributor/main.c | 26 +-- examples/exception_path/main.c | 35 ++- examples/ip_fragmentation/main.c | 33 +-- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 +-- examples/ipv4_multicast/main.c | 30 +-- examples/kni/main.c | 30 +-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 +-- examples/l2fwd-keepalive/main.c | 50 ++--- examples/l2fwd/main.c | 47 ++-- examples/l3fwd-acl/main.c | 9 +- examples/l3fwd-power/main.c | 60 ++--- examples/l3fwd-vf/main.c | 50 +++-- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 15 +- examples/l3fwd/l3fwd_lpm.h | 4 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 +-- examples/link_status_interrupt/main.c | 9 +- examples/load_balancer/config.c | 14 +- examples/load_balancer/init.c | 34 ++- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 17 +- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 23 +- examples/netmap_compat/lib/compat_netmap.c | 52 +++-- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +- examples/performance-thread/l3fwd-thread/main.c | 143 ++++++------ examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +-- examples/qos_sched/main.c | 14 +- examples/qos_sched/main.h | 24 +- examples/qos_sched/stats.c | 16 +- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- lib/librte_bitratestats/Makefile | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/Makefile | 2 +- lib/librte_ether/rte_ethdev.c | 241 +++++++++++---------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++---------- lib/librte_ether/rte_flow.c | 2 +- lib/librte_ether/rte_flow_driver.h | 2 +- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 ++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +- lib/librte_pdump/Makefile | 2 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- test/test/test_kni.c | 12 +- test/test/test_link_bonding.c | 40 ++-- test/test/test_link_bonding_mode4.c | 12 +- test/test/test_pmd_perf.c | 30 +-- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 +- test/test/virtual_pmd.h | 28 +-- 145 files changed, 1394 insertions(+), 1499 deletions(-) -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v6 1/5] net/bonding: remove bonding APIs using ABI versioning 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang @ 2017-09-29 7:17 ` Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 2/5] ethdev: increase port_id range Zhiyong Yang ` (4 subsequent siblings) 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-29 7:17 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, Zhiyong Yang There are two bonding APIs using ABI versioning, and both have port_id as parameter. Since we are already breaking ABI, no need to keep older versions of APIs. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> --- drivers/net/bonding/rte_eth_bond_8023ad.c | 149 +-------------------------- drivers/net/bonding/rte_eth_bond_8023ad.h | 18 ---- drivers/net/bonding/rte_eth_bond_version.map | 4 - 3 files changed, 2 insertions(+), 169 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 20b5a8961..c2b9e053c 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1111,27 +1111,6 @@ bond_mode_8023ad_conf_get(struct rte_eth_dev *dev, conf->tx_period_ms = mode4->tx_period_timeout / ms_ticks; conf->update_timeout_ms = mode4->update_timeout_us / 1000; conf->rx_marker_period_ms = mode4->rx_marker_timeout / ms_ticks; -} - -static void -bond_mode_8023ad_conf_get_v1607(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - bond_mode_8023ad_conf_get(dev, conf); - conf->slowrx_cb = mode4->slowrx_cb; -} - -static void -bond_mode_8023ad_conf_get_v1708(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - bond_mode_8023ad_conf_get(dev, conf); conf->slowrx_cb = mode4->slowrx_cb; conf->agg_selection = mode4->agg_selection; } @@ -1171,27 +1150,6 @@ bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4, mode4->dedicated_queues.tx_qid = UINT16_MAX; } -static void -bond_mode_8023ad_setup_v20(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_bond_8023ad_conf def_conf; - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - if (conf == NULL) { - conf = &def_conf; - bond_mode_8023ad_conf_get_default(conf); - } - - bond_mode_8023ad_stop(dev); - bond_mode_8023ad_conf_assign(mode4, conf); - - if (dev->data->dev_started) - bond_mode_8023ad_start(dev); -} - - void bond_mode_8023ad_setup(struct rte_eth_dev *dev, struct rte_eth_bond_8023ad_conf *conf) @@ -1207,27 +1165,6 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev, bond_mode_8023ad_stop(dev); bond_mode_8023ad_conf_assign(mode4, conf); - - - if (dev->data->dev_started) - bond_mode_8023ad_start(dev); -} - -static void -bond_mode_8023ad_setup_v1708(struct rte_eth_dev *dev, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_bond_8023ad_conf def_conf; - struct bond_dev_private *internals = dev->data->dev_private; - struct mode8023ad_private *mode4 = &internals->mode4; - - if (conf == NULL) { - conf = &def_conf; - bond_mode_8023ad_conf_get_default(conf); - } - - bond_mode_8023ad_stop(dev); - bond_mode_8023ad_conf_assign(mode4, conf); mode4->slowrx_cb = conf->slowrx_cb; mode4->agg_selection = AGG_STABLE; @@ -1358,7 +1295,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1373,46 +1310,6 @@ rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, bond_mode_8023ad_conf_get(bond_dev, conf); return 0; } -VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v20, 2.0); - -int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; - - if (conf == NULL) - return -EINVAL; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_conf_get_v1607(bond_dev, conf); - return 0; -} -VERSION_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1607, 16.07); - -int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; - - if (conf == NULL) - return -EINVAL; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_conf_get_v1708(bond_dev, conf); - return 0; -} -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_conf_get(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf), - rte_eth_bond_8023ad_conf_get_v1708); -BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_conf_get, _v1708, 17.08); int rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, @@ -1483,25 +1380,7 @@ bond_8023ad_setup_validate(uint8_t port_id, } int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - int err; - - err = bond_8023ad_setup_validate(port_id, conf); - if (err != 0) - return err; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_setup_v20(bond_dev, conf); - - return 0; -} -VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v20, 2.0); - -int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1516,30 +1395,6 @@ rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, return 0; } -VERSION_SYMBOL(rte_eth_bond_8023ad_setup, _v1607, 16.07); - - -int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf) -{ - struct rte_eth_dev *bond_dev; - int err; - - err = bond_8023ad_setup_validate(port_id, conf); - if (err != 0) - return err; - - bond_dev = &rte_eth_devices[port_id]; - bond_mode_8023ad_setup_v1708(bond_dev, conf); - - return 0; -} -BIND_DEFAULT_SYMBOL(rte_eth_bond_8023ad_setup, _v1708, 17.08); -MAP_STATIC_SYMBOL(int rte_eth_bond_8023ad_setup(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf), - rte_eth_bond_8023ad_setup_v1708); - diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 1d353c734..d609745e0 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -194,15 +194,6 @@ struct rte_eth_bond_8023ad_slave_info { int rte_eth_bond_8023ad_conf_get(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); /** * @internal @@ -218,15 +209,6 @@ rte_eth_bond_8023ad_conf_get_v1708(uint8_t port_id, int rte_eth_bond_8023ad_setup(uint8_t port_id, struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v20(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v1607(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); -int -rte_eth_bond_8023ad_setup_v1708(uint8_t port_id, - struct rte_eth_bond_8023ad_conf *conf); /** * @internal diff --git a/drivers/net/bonding/rte_eth_bond_version.map b/drivers/net/bonding/rte_eth_bond_version.map index 0f4e847da..ec3374b0f 100644 --- a/drivers/net/bonding/rte_eth_bond_version.map +++ b/drivers/net/bonding/rte_eth_bond_version.map @@ -1,8 +1,6 @@ DPDK_2.0 { global: - rte_eth_bond_8023ad_conf_get; - rte_eth_bond_8023ad_setup; rte_eth_bond_active_slaves_get; rte_eth_bond_create; rte_eth_bond_link_monitoring_set; @@ -39,8 +37,6 @@ DPDK_16.07 { rte_eth_bond_8023ad_ext_distrib; rte_eth_bond_8023ad_ext_distrib_get; rte_eth_bond_8023ad_ext_slowtx; - rte_eth_bond_8023ad_conf_get; - rte_eth_bond_8023ad_setup; } DPDK_16.04; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v6 2/5] ethdev: increase port_id range 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang @ 2017-09-29 7:17 ` Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 3/5] examples: " Zhiyong Yang ` (3 subsequent siblings) 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-29 7:17 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, Zhiyong Yang Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. release_17_11 and deprecation docs have been updated in this patch. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com> --- app/pdump/main.c | 2 +- app/test-pmd/cmdline.c | 6 +- app/test-pmd/config.c | 4 +- app/test-pmd/ieee1588fwd.c | 26 ++- app/test-pmd/parameters.c | 2 +- app/test-pmd/rxonly.c | 2 +- app/test-pmd/testpmd.c | 18 +- app/test-pmd/testpmd.h | 4 +- doc/guides/rel_notes/deprecation.rst | 6 - doc/guides/rel_notes/release_17_11.rst | 24 ++- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnxt/Makefile | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 4 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 32 +-- drivers/net/bnxt/rte_pmd_bnxt.h | 32 +-- drivers/net/bonding/Makefile | 2 +- drivers/net/bonding/rte_eth_bond.h | 41 ++-- drivers/net/bonding/rte_eth_bond_8023ad.c | 60 +++--- drivers/net/bonding/rte_eth_bond_8023ad.h | 30 +-- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 12 +- drivers/net/bonding/rte_eth_bond_alb.c | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 6 +- drivers/net/bonding/rte_eth_bond_api.c | 64 +++--- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 62 +++--- drivers/net/bonding/rte_eth_bond_private.h | 45 ++-- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 4 +- drivers/net/e1000/igb_rxtx.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 6 +- drivers/net/i40e/Makefile | 2 +- drivers/net/i40e/i40e_ethdev.c | 5 +- drivers/net/i40e/i40e_rxtx.h | 4 +- drivers/net/i40e/rte_pmd_i40e.c | 50 ++--- drivers/net/i40e/rte_pmd_i40e.h | 48 ++--- drivers/net/ixgbe/Makefile | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +- drivers/net/ixgbe/ixgbe_rxtx.h | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 60 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.h | 64 +++--- drivers/net/mlx5/mlx5_rxtx.h | 4 +- drivers/net/nfp/nfp_net.c | 16 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vhost/Makefile | 2 +- drivers/net/vhost/rte_eth_vhost.c | 6 +- drivers/net/vhost/rte_eth_vhost.h | 4 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_rxtx.h | 6 +- drivers/net/vmxnet3/vmxnet3_ring.h | 4 +- lib/librte_bitratestats/Makefile | 2 +- lib/librte_bitratestats/rte_bitrate.c | 2 +- lib/librte_bitratestats/rte_bitrate.h | 2 +- lib/librte_ether/Makefile | 2 +- lib/librte_ether/rte_ethdev.c | 241 +++++++++++----------- lib/librte_ether/rte_ethdev.h | 238 ++++++++++----------- lib/librte_ether/rte_flow.c | 2 +- lib/librte_ether/rte_flow_driver.h | 2 +- lib/librte_ether/rte_tm.c | 62 +++--- lib/librte_ether/rte_tm.h | 60 +++--- lib/librte_ether/rte_tm_driver.h | 2 +- lib/librte_kni/rte_kni.h | 6 +- lib/librte_latencystats/rte_latencystats.c | 12 +- lib/librte_pdump/Makefile | 2 +- lib/librte_pdump/rte_pdump.c | 16 +- lib/librte_pdump/rte_pdump.h | 4 +- lib/librte_port/rte_port_ethdev.c | 6 +- lib/librte_port/rte_port_ethdev.h | 6 +- 81 files changed, 765 insertions(+), 738 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index 3b13753d9..090a50cfc 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -623,7 +623,7 @@ static void create_mp_ring_vdev(void) { int i; - uint8_t portid; + uint16_t portid; struct pdump_tuples *pt = NULL; struct rte_mempool *mbuf_pool = NULL; char vdev_args[SIZE]; diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index ccdf239d6..d9d083888 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4588,7 +4588,7 @@ struct cmd_show_bonding_config_result { cmdline_fixed_string_t show; cmdline_fixed_string_t bonding; cmdline_fixed_string_t config; - uint8_t port_id; + portid_t port_id; }; static void cmd_show_bonding_config_parsed(void *parsed_result, @@ -4597,7 +4597,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, { struct cmd_show_bonding_config_result *res = parsed_result; int bonding_mode, agg_mode; - uint8_t slaves[RTE_MAX_ETHPORTS]; + portid_t slaves[RTE_MAX_ETHPORTS]; int num_slaves, num_active_slaves; int primary_id; int i; @@ -11500,7 +11500,7 @@ struct cmd_vf_vlan_stripq_result { cmdline_fixed_string_t vf; cmdline_fixed_string_t vlan; cmdline_fixed_string_t stripq; - uint8_t port_id; + portid_t port_id; uint16_t vf_id; cmdline_fixed_string_t on_off; }; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3ae3e1cd8..155136dd5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -358,7 +358,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "RX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; @@ -391,7 +391,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo); if (rc != 0) { - printf("Failed to retrieve information for port: %hhu, " + printf("Failed to retrieve information for port: %u, " "TX queue: %hu\nerror desc: %s(%d)\n", port_id, queue_id, strerror(-rc), rc); return; diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 51170ee3e..91ee78646 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -86,12 +86,11 @@ port_ieee1588_rx_timestamp_check(portid_t pi, uint32_t index) struct timespec timestamp = {0, 0}; if (rte_eth_timesync_read_rx_timestamp(pi, ×tamp, index) < 0) { - printf("Port %u RX timestamp registers not valid\n", - (unsigned) pi); + printf("Port %u RX timestamp registers not valid\n", pi); return; } printf("Port %u RX timestamp value %lu s %lu ns\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec); + pi, timestamp.tv_sec, timestamp.tv_nsec); } #define MAX_TX_TMST_WAIT_MICROSECS 1000 /**< 1 milli-second */ @@ -110,12 +109,12 @@ port_ieee1588_tx_timestamp_check(portid_t pi) if (wait_us >= MAX_TX_TMST_WAIT_MICROSECS) { printf("Port %u TX timestamp registers not valid after " "%u micro-seconds\n", - (unsigned) pi, (unsigned) MAX_TX_TMST_WAIT_MICROSECS); + pi, MAX_TX_TMST_WAIT_MICROSECS); return; } printf("Port %u TX timestamp value %lu s %lu ns validated after " "%u micro-second%s\n", - (unsigned) pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, + pi, timestamp.tv_sec, timestamp.tv_nsec, wait_us, (wait_us == 1) ? "" : "s"); } @@ -148,11 +147,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type == ETHER_TYPE_1588) { printf("Port %u Received PTP packet not filtered" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); } else { printf("Port %u Received non PTP packet type=0x%4x " "len=%u\n", - (unsigned) fs->rx_port, eth_type, + fs->rx_port, eth_type, (unsigned) mb->pkt_len); } rte_pktmbuf_free(mb); @@ -161,7 +160,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (eth_type != ETHER_TYPE_1588) { printf("Port %u Received NON PTP packet incorrectly" " detected by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -175,19 +174,19 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (ptp_hdr->version != 0x02) { printf("Port %u Received PTP V2 Ethernet frame with wrong PTP" " protocol version 0x%x (should be 0x02)\n", - (unsigned) fs->rx_port, ptp_hdr->version); + fs->rx_port, ptp_hdr->version); rte_pktmbuf_free(mb); return; } if (ptp_hdr->msg_id != PTP_SYNC_MESSAGE) { printf("Port %u Received PTP V2 Ethernet frame with unexpected" " message ID 0x%x (expected 0x0 - PTP_SYNC_MESSAGE)\n", - (unsigned) fs->rx_port, ptp_hdr->msg_id); + fs->rx_port, ptp_hdr->msg_id); rte_pktmbuf_free(mb); return; } printf("Port %u IEEE1588 PTP V2 SYNC Message filtered by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); /* * Check that the received PTP packet has been timestamped by the @@ -196,7 +195,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) if (! (mb->ol_flags & PKT_RX_IEEE1588_TMST)) { printf("Port %u Received PTP packet not timestamped" " by hardware\n", - (unsigned) fs->rx_port); + fs->rx_port); rte_pktmbuf_free(mb); return; } @@ -216,8 +215,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) mb->ol_flags |= PKT_TX_IEEE1588_TMST; fs->tx_packets += 1; if (rte_eth_tx_burst(fs->rx_port, fs->tx_queue, &mb, 1) == 0) { - printf("Port %u sent PTP packet dropped\n", - (unsigned) fs->rx_port); + printf("Port %u sent PTP packet dropped\n", fs->rx_port); fs->fwd_dropped += 1; rte_pktmbuf_free(mb); return; diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 2f7f70fd6..31287d71d 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -734,7 +734,7 @@ launch_args_parse(int argc, char** argv) if (!strcmp(lgopts[opt_idx].name, "nb-ports")) { n = atoi(optarg); if (n > 0 && n <= nb_ports) - nb_fwd_ports = (uint8_t) n; + nb_fwd_ports = n; else rte_exit(EXIT_FAILURE, "Invalid port %d\n", n); diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index 5ef021905..57df01468 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -122,7 +122,7 @@ pkt_burst_receive(struct fwd_stream *fs) */ if (verbose_level > 0) printf("port %u/queue %u: received %u packets\n", - (unsigned) fs->rx_port, + fs->rx_port, (unsigned) fs->rx_queue, (unsigned) nb_rx); for (i = 0; i < nb_rx; i++) { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e097ee04e..477e2e7ad 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -390,7 +390,7 @@ struct gro_status gro_ports[RTE_MAX_ETHPORTS]; /* Forward function declarations */ static void map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port); static void check_all_ports_link_status(uint32_t port_mask); -static int eth_event_callback(uint8_t port_id, +static int eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); @@ -1816,7 +1816,8 @@ check_all_ports_link_status(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; + portid_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("Checking link statuses...\n"); @@ -1831,14 +1832,13 @@ check_all_ports_link_status(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 */ @@ -1885,7 +1885,7 @@ rmv_event_callback(void *arg) /* This function is used by the interrupt thread */ static int -eth_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param, +eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param, void *ret_param) { static const char * const event_desc[] = { @@ -2328,7 +2328,7 @@ int main(int argc, char** argv) { int diag; - uint8_t port_id; + portid_t port_id; signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 1d1ee7587..657c1235c 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -78,7 +78,7 @@ #define UMA_NO_CONFIG 0xFF typedef uint8_t lcoreid_t; -typedef uint8_t portid_t; +typedef uint16_t portid_t; typedef uint16_t queueid_t; typedef uint16_t streamid_t; @@ -283,7 +283,7 @@ enum dcb_mode_enable #define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */ struct queue_stats_mappings { - uint8_t port_id; + portid_t port_id; uint16_t queue_id; uint8_t stats_counter_id; } __rte_cache_aligned; diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 3362f3350..45eb5c4a9 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -76,12 +76,6 @@ Deprecation Notices done by the EAL and not by the ``ethdev`` layer anymore. Users relying on this flag being present only have to remove their checks to follow the change. -* ABI/API changes are planned for 17.11 in all structures which include port_id - definition such as "rte_eth_dev_data", "rte_port_ethdev_reader_params", - "rte_port_ethdev_writer_params", and so on. The definition of port_id will be - changed from 8 bits to 16 bits in order to support more than 256 ports in - DPDK. All APIs which have port_id parameter will be changed at the same time. - * ethdev: An ABI change is planned for 17.11 for the structure rte_eth_dev_data. The size of the unique name will increase RTE_ETH_NAME_MAX_LEN from 32 to 64 characters to allow using a globally unique identifier (GUID) in this field. diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst index f6f916928..4d2c9669d 100644 --- a/doc/guides/rel_notes/release_17_11.rst +++ b/doc/guides/rel_notes/release_17_11.rst @@ -41,6 +41,11 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range from uint8_t to uint16_t.** + + Increased port_id range from 8 bits to 16 bits in order to support more than + 256 ports in dpdk. All ethdev APIs which have port_id as parameter are changed + in the meantime. Resolved Issues --------------- @@ -144,7 +149,10 @@ ABI Changes Also, make sure to start the actual text at the margin. ========================================================= +* **Extended port_id range.** + The size of the field ``port_id`` in the ``rte_eth_dev_data`` structure + changed, as described in the `New Features` section. Shared Library Versions ----------------------- @@ -165,13 +173,13 @@ The libraries prepended with a plus sign were incremented in this version. .. code-block:: diff librte_acl.so.2 - librte_bitratestats.so.1 + librte_bitratestats.so.2 librte_cfgfile.so.2 librte_cmdline.so.2 librte_cryptodev.so.3 librte_distributor.so.1 librte_eal.so.5 - librte_ethdev.so.7 + librte_ethdev.so.8 librte_eventdev.so.2 librte_gro.so.1 librte_hash.so.2 @@ -186,14 +194,14 @@ The libraries prepended with a plus sign were incremented in this version. librte_meter.so.1 librte_metrics.so.1 librte_net.so.1 - librte_pdump.so.1 + librte_pdump.so.2 librte_pipeline.so.3 - librte_pmd_bnxt.so.1 - librte_pmd_bond.so.1 - librte_pmd_i40e.so.1 - librte_pmd_ixgbe.so.1 + librte_pmd_bnxt.so.2 + librte_pmd_bond.so.2 + librte_pmd_i40e.so.2 + librte_pmd_ixgbe.so.2 librte_pmd_ring.so.2 - librte_pmd_vhost.so.1 + librte_pmd_vhost.so.2 librte_port.so.3 librte_power.so.1 librte_reorder.so.1 diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 9a47852ca..483b0c107 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -75,7 +75,7 @@ struct pkt_rx_queue { unsigned int framenum; struct rte_mempool *mb_pool; - uint8_t in_port; + uint16_t in_port; volatile unsigned long rx_pkts; volatile unsigned long err_pkts; diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 6db362b04..893284733 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -641,7 +641,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_tx_queues; i++) { status = eth_ark_tx_queue_stop(dev, i); if (status != 0) { - uint8_t port = dev->data->port_id; + uint16_t port = dev->data->port_id; PMD_DRV_LOG(ERR, "tx_queue stop anomaly" " port %u, queue %u\n", diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index c746a0e2c..b5cc955f2 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -190,7 +190,7 @@ struct avp_dev { struct rte_eth_dev_data *dev_data; /**< Back pointer to ethernet device data */ volatile uint32_t flags; /**< Device operational flags */ - uint8_t port_id; /**< Ethernet port identifier */ + uint16_t port_id; /**< Ethernet port identifier */ struct rte_mempool *pool; /**< pkt mbuf mempool */ unsigned int guest_mbuf_size; /**< local pool mbuf size */ unsigned int host_mbuf_size; /**< host mbuf size */ diff --git a/drivers/net/bnx2x/bnx2x_rxtx.h b/drivers/net/bnx2x/bnx2x_rxtx.h index 2e38ec26a..9600e0f1c 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.h +++ b/drivers/net/bnx2x/bnx2x_rxtx.h @@ -41,7 +41,7 @@ struct bnx2x_rx_queue { uint16_t rx_cq_head; /**< Index of current rcq bd. */ uint16_t rx_cq_tail; /**< Index of last rcq bd. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data. */ }; @@ -62,7 +62,7 @@ struct bnx2x_tx_queue { uint16_t nb_tx_avail; /**< Number of TX descriptors available. */ uint16_t nb_tx_pages; /**< number of TX pages */ uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ struct bnx2x_softc *sc; /**< Ptr to dev_private data */ }; diff --git a/drivers/net/bnxt/Makefile b/drivers/net/bnxt/Makefile index b03f65dc9..55b49b538 100644 --- a/drivers/net/bnxt/Makefile +++ b/drivers/net/bnxt/Makefile @@ -40,7 +40,7 @@ LIB = librte_pmd_bnxt.a EXPORT_MAP := rte_pmd_bnxt_version.map -LIBABIVER := 1 +LIBABIVER := 2 CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 405d94deb..26a9018b5 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -126,7 +126,7 @@ struct bnxt_pf_info { #define BNXT_FIRST_VF_FID 128 #define BNXT_PF_RINGS_USED(bp) bnxt_get_num_queues(bp) #define BNXT_PF_RINGS_AVAIL(bp) (bp->pf.max_cp_rings - BNXT_PF_RINGS_USED(bp)) - uint8_t port_id; + uint16_t port_id; uint16_t first_vf_id; uint16_t active_vfs; uint16_t max_vfs; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index c9d11228b..2e817535e 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -489,13 +489,13 @@ static void bnxt_print_link_info(struct rte_eth_dev *eth_dev) if (link->link_status) RTE_LOG(INFO, PMD, "Port %d Link Up - speed %u Mbps - %s\n", - (uint8_t)(eth_dev->data->port_id), + eth_dev->data->port_id, (uint32_t)link->link_speed, (link->link_duplex == ETH_LINK_FULL_DUPLEX) ? ("full-duplex") : ("half-duplex\n")); else RTE_LOG(INFO, PMD, "Port %d Link Down\n", - (uint8_t)(eth_dev->data->port_id)); + eth_dev->data->port_id); } static int bnxt_dev_lsc_intr_setup(struct rte_eth_dev *eth_dev) diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h index 01aaa007f..cea0785d1 100644 --- a/drivers/net/bnxt/bnxt_rxq.h +++ b/drivers/net/bnxt/bnxt_rxq.h @@ -48,7 +48,7 @@ struct bnxt_rx_queue { uint16_t rx_free_thresh; /* max free RX desc to hold */ uint16_t queue_id; /* RX queue index */ uint16_t reg_idx; /* RX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ struct bnxt *bp; diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h index 16f3a0bdd..f753c10f2 100644 --- a/drivers/net/bnxt/bnxt_txq.h +++ b/drivers/net/bnxt/bnxt_txq.h @@ -46,7 +46,7 @@ struct bnxt_tx_queue { uint16_t tx_next_rs; /* next desc to set RS bit */ uint16_t queue_id; /* TX queue index */ uint16_t reg_idx; /* TX queue register index */ - uint8_t port_id; /* Device port identifier */ + uint16_t port_id; /* Device port identifier */ uint8_t pthresh; /* Prefetch threshold register */ uint8_t hthresh; /* Host threshold register */ uint8_t wthresh; /* Write-back threshold reg */ diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c343d9033..63fc27911 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -67,7 +67,7 @@ int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg) true : false; } -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -108,7 +108,7 @@ rte_pmd_bnxt_set_all_queues_drop_en_cb(struct bnxt_vnic_info *vnic, void *onptr) vnic->bd_stall = !(*on); } -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct rte_eth_dev *eth_dev; struct bnxt *bp; @@ -159,7 +159,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -191,7 +191,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *eth_dev; @@ -241,7 +241,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -294,7 +294,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; @@ -350,7 +350,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq_cb(struct bnxt_vnic_info *vnic, void *onptr) } int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -385,7 +385,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) return rc; } -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -477,7 +477,7 @@ static int bnxt_set_vf_table(struct bnxt *bp, uint16_t vf) return rc; } -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct bnxt_vlan_table_entry *ve; @@ -570,7 +570,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, return rc; } -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -598,7 +598,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, return bnxt_hwrm_func_qstats(bp, bp->pf.first_vf_id + vf_id, stats); } -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -625,7 +625,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, return bnxt_hwrm_func_clr_stats(bp, bp->pf.first_vf_id + vf_id); } -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -651,7 +651,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id) return bnxt_vf_vnic_count(bp, vf_id); } -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count) { struct rte_eth_dev *dev; @@ -679,7 +679,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, count); } -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr, uint32_t vf_id) { struct rte_eth_dev *dev; @@ -756,7 +756,7 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *addr, } int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -793,7 +793,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, return rc; } -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on) +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev; diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h index c4c4770e3..f881d30d6 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.h +++ b/drivers/net/bnxt/rte_pmd_bnxt.h @@ -78,7 +78,7 @@ struct rte_pmd_bnxt_mb_event_param { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set the VF MAC address. @@ -94,7 +94,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -115,7 +115,7 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_bnxt_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -134,7 +134,7 @@ rte_pmd_bnxt_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, +rte_pmd_bnxt_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -156,7 +156,7 @@ rte_pmd_bnxt_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); /** @@ -173,7 +173,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint8_t port, uint16_t vlan, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -189,7 +189,7 @@ int rte_pmd_bnxt_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * Set the VF rate limit. @@ -207,7 +207,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); /** @@ -226,7 +226,7 @@ int rte_pmd_bnxt_set_vf_rate_limit(uint8_t port, uint16_t vf, * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_get_vf_stats(uint8_t port, +int rte_pmd_bnxt_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -242,7 +242,7 @@ int rte_pmd_bnxt_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_reset_vf_stats(uint8_t port, +int rte_pmd_bnxt_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -261,7 +261,7 @@ int rte_pmd_bnxt_reset_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Set RX L2 Filtering mode of a VF of an Ethernet device. @@ -280,7 +280,7 @@ int rte_pmd_bnxt_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, +int rte_pmd_bnxt_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); /** @@ -297,7 +297,7 @@ int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf, * - (-ENOMEM) on an allocation failure * - (-1) firmware interface error */ -int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); +int rte_pmd_bnxt_get_vf_rx_status(uint16_t port, uint16_t vf_id); /** * Queries the TX drop counter for the function @@ -313,7 +313,7 @@ int rte_pmd_bnxt_get_vf_rx_status(uint8_t port, uint16_t vf_id); * - (-EINVAL) invalid vf_id specified. * - (-ENOTSUP) Ethernet device is not a PF */ -int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, +int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, uint64_t *count); /** @@ -331,7 +331,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint8_t port, uint16_t vf_id, * - (-ENOTSUP) Ethernet device is not a PF * - (-ENOMEM) on an allocation failure */ -int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t vf_id); /** @@ -350,5 +350,5 @@ int rte_pmd_bnxt_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_bnxt_set_vf_persist_stats(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_bnxt_set_vf_persist_stats(uint16_t port, uint16_t vf, uint8_t on); #endif /* _PMD_BNXT_H_ */ diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile index 910c932da..ffc0c3cf7 100644 --- a/drivers/net/bonding/Makefile +++ b/drivers/net/bonding/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_eth_bond_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 8efbf0713..87ff29173 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -151,7 +151,7 @@ rte_eth_bond_free(const char *name); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Remove a slave rte_eth_dev device from the bonded device @@ -163,7 +163,7 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Set link bonding mode of bonded device @@ -175,7 +175,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode); /** * Get link bonding mode of bonded device @@ -186,7 +186,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode); * link bonding mode on success, negative value otherwise */ int -rte_eth_bond_mode_get(uint8_t bonded_port_id); +rte_eth_bond_mode_get(uint16_t bonded_port_id); /** * Set slave rte_eth_dev as primary slave of bonded device @@ -198,7 +198,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id); /** * Get primary slave of bonded device @@ -209,7 +209,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id); * Port Id of primary slave on success, -1 on failure */ int -rte_eth_bond_primary_get(uint8_t bonded_port_id); +rte_eth_bond_primary_get(uint16_t bonded_port_id); /** * Populate an array with list of the slaves port id's of the bonded device @@ -223,7 +223,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id); * negative value otherwise */ int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Populate an array with list of the active slaves port id's of the bonded @@ -238,8 +239,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len); * negative value otherwise */ int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len); +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len); /** * Set explicit MAC address to use on bonded device and it's slaves. @@ -252,7 +253,7 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr); /** @@ -265,7 +266,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id); /** * Set the transmit policy for bonded device to use when it is operating in @@ -279,7 +280,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy); /** * Get the transmit policy set on bonded device for balance mode operation @@ -290,7 +291,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy); * Balance transmit policy on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of @@ -304,7 +305,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id); */ int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link @@ -316,7 +317,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms); * Monitoring interval on success, negative value otherwise. */ int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id); /** @@ -330,7 +331,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the disabling of a bonded @@ -342,7 +344,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id); /** * Set the period in milliseconds for delaying the enabling of a bonded link @@ -355,7 +357,8 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms); /** * Get the period in milliseconds set for delaying the enabling of a bonded @@ -367,7 +370,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms); * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id); +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); #ifdef __cplusplus diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index c2b9e053c..c1873aa13 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -209,7 +209,7 @@ set_warning_flags(struct port *port, uint16_t flags) } static void -show_warnings(uint8_t slave_id) +show_warnings(uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; uint8_t warnings; @@ -278,7 +278,7 @@ record_default(struct port *port) * @param port Port on which LACPDU was received. */ static void -rx_machine(struct bond_dev_private *internals, uint8_t slave_id, +rx_machine(struct bond_dev_private *internals, uint16_t slave_id, struct lacpdu *lacp) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -399,7 +399,7 @@ rx_machine(struct bond_dev_private *internals, uint8_t slave_id, * @param port Port to handle state machine. */ static void -periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) +periodic_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; /* Calculate if either site is LACP enabled */ @@ -461,7 +461,7 @@ periodic_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port Port to handle state machine. */ static void -mux_machine(struct bond_dev_private *internals, uint8_t slave_id) +mux_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *port = &mode_8023ad_ports[slave_id]; @@ -564,7 +564,7 @@ mux_machine(struct bond_dev_private *internals, uint8_t slave_id) * @param port */ static void -tx_machine(struct bond_dev_private *internals, uint8_t slave_id) +tx_machine(struct bond_dev_private *internals, uint16_t slave_id) { struct port *agg, *port = &mode_8023ad_ports[slave_id]; @@ -688,11 +688,11 @@ static void selection_logic(struct bond_dev_private *internals, uint8_t slave_id) { struct port *agg, *port; - uint8_t slaves_count, new_agg_id, i, j = 0; - uint8_t *slaves; + uint16_t slaves_count, new_agg_id, i, j = 0; + uint16_t *slaves; uint64_t agg_bandwidth[8] = {0}; uint64_t agg_count[8] = {0}; - uint8_t default_slave = 0; + uint16_t default_slave = 0; uint8_t mode_count_id, mode_band_id; struct rte_eth_link link_info; @@ -923,7 +923,8 @@ bond_mode_8023ad_periodic_cb(void *arg) } void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) +bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; @@ -951,7 +952,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) memcpy(&port->actor, &initial, sizeof(struct port_params)); /* Standard requires that port ID must be grater than 0. * Add 1 do get corresponding port_number */ - port->actor.port_number = rte_cpu_to_be_16((uint16_t)slave_id + 1); + port->actor.port_number = rte_cpu_to_be_16(slave_id + 1); memcpy(&port->partner, &initial, sizeof(struct port_params)); @@ -1022,12 +1023,12 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id) int bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev, - uint8_t slave_id) + uint16_t slave_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; void *pkt = NULL; struct port *port; - uint8_t i; + uint16_t i; /* Given slave must be in active list */ RTE_ASSERT(find_slave_by_id(internals->active_slaves, @@ -1066,7 +1067,7 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) struct bond_dev_private *internals = bond_dev->data->dev_private; struct ether_addr slave_addr; struct port *slave, *agg_slave; - uint8_t slave_id, i, j; + uint16_t slave_id, i, j; bond_mode_8023ad_stop(bond_dev); @@ -1214,7 +1215,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev) void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt) + uint16_t slave_id, struct rte_mbuf *pkt) { struct mode8023ad_private *mode4 = &internals->mode4; struct port *port = &mode_8023ad_ports[slave_id]; @@ -1295,7 +1296,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } int -rte_eth_bond_8023ad_conf_get(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1312,7 +1313,7 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id, } int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection) { struct rte_eth_dev *bond_dev; @@ -1334,7 +1335,7 @@ rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, return 0; } -int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) +int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1355,7 +1356,7 @@ int rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id) static int -bond_8023ad_setup_validate(uint8_t port_id, +bond_8023ad_setup_validate(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { if (valid_bonded_port_id(port_id) != 0) @@ -1379,8 +1380,9 @@ bond_8023ad_setup_validate(uint8_t port_id, return 0; } + int -rte_eth_bond_8023ad_setup(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { struct rte_eth_dev *bond_dev; @@ -1401,7 +1403,7 @@ rte_eth_bond_8023ad_setup(uint8_t port_id, int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *info) { struct rte_eth_dev *bond_dev; @@ -1434,7 +1436,7 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, } static int -bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) +bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1462,7 +1464,8 @@ bond_8023ad_ext_validate(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1482,7 +1485,8 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled) } int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled) { struct port *port; int res; @@ -1502,7 +1506,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled) } int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1516,7 +1520,7 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id) { struct port *port; int err; @@ -1530,7 +1534,7 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id) } int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct port *port; @@ -1591,7 +1595,7 @@ bond_mode_8023ad_ext_periodic_cb(void *arg) } int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; @@ -1615,7 +1619,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port) } int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port) +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) { int retval = 0; struct rte_eth_dev *dev = &rte_eth_devices[port]; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index d609745e0..2874336d3 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -64,7 +64,7 @@ extern "C" { #define MARKER_TLV_TYPE_INFO 0x01 #define MARKER_TLV_TYPE_RESP 0x02 -typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint8_t slave_id, +typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t slave_id, struct rte_mbuf *lacp_pkt); enum rte_bond_8023ad_selection { @@ -176,7 +176,7 @@ struct rte_eth_bond_8023ad_slave_info { struct port_params actor; uint8_t partner_state; struct port_params partner; - uint8_t agg_port_id; + uint16_t agg_port_id; }; /** @@ -192,7 +192,7 @@ struct rte_eth_bond_8023ad_slave_info { * -EINVAL if conf is NULL */ int -rte_eth_bond_8023ad_conf_get(uint8_t port_id, +rte_eth_bond_8023ad_conf_get(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -207,7 +207,7 @@ rte_eth_bond_8023ad_conf_get(uint8_t port_id, * -EINVAL if configuration is invalid. */ int -rte_eth_bond_8023ad_setup(uint8_t port_id, +rte_eth_bond_8023ad_setup(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf); /** @@ -223,7 +223,7 @@ rte_eth_bond_8023ad_setup(uint8_t port_id, * bonded device or is not inactive). */ int -rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, struct rte_eth_bond_8023ad_slave_info *conf); #ifdef __cplusplus @@ -241,7 +241,8 @@ rte_eth_bond_8023ad_slave_info(uint8_t port_id, uint8_t slave_id, * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get COLLECTING flag from slave port actor state. @@ -254,7 +255,7 @@ rte_eth_bond_8023ad_ext_collect(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id); /** * Configure a slave port to start distributing. @@ -267,7 +268,8 @@ rte_eth_bond_8023ad_ext_collect_get(uint8_t port_id, uint8_t slave_id); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, + int enabled); /** * Get DISTRIBUTING flag from slave port actor state. @@ -280,7 +282,7 @@ rte_eth_bond_8023ad_ext_distrib(uint8_t port_id, uint8_t slave_id, int enabled); * -EINVAL if slave is not valid. */ int -rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id); /** * LACPDU transmit path for external 802.3ad state machine. Caller retains @@ -294,7 +296,7 @@ rte_eth_bond_8023ad_ext_distrib_get(uint8_t port_id, uint8_t slave_id); * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, struct rte_mbuf *lacp_pkt); /** @@ -320,7 +322,7 @@ rte_eth_bond_8023ad_ext_slowtx(uint8_t port_id, uint8_t slave_id, * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id); /** * Disable slow queue on slaves @@ -337,7 +339,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint8_t port_id); * */ int -rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); +rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port_id); /* * Get aggregator mode for 8023ad @@ -347,7 +349,7 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint8_t port_id); * agregator mode on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); +rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id); /** * Set aggregator mode for 8023ad @@ -356,6 +358,6 @@ rte_eth_bond_8023ad_agg_selection_get(uint8_t port_id); * 0 on success, negative value otherwise */ int -rte_eth_bond_8023ad_agg_selection_set(uint8_t port_id, +rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, enum rte_bond_8023ad_agg_selection agg_selection); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h index d46e44a84..433c7000d 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h @@ -279,7 +279,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *dev); */ void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint8_t slave_id, struct rte_mbuf *pkt); + uint16_t slave_id, struct rte_mbuf *pkt); /** * @internal @@ -293,7 +293,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, * 0 on success, negative value otherwise. */ void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); +bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint16_t port_id); /** * @internal @@ -307,7 +307,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint8_t port_id); * 0 on success, negative value otherwise. */ int -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint8_t slave_pos); +bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint16_t slave_pos); /** * Updates state when MAC was changed on bonded device or one of its slaves. @@ -318,12 +318,12 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev); int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port); + uint16_t slave_port); int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port); +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port); int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id); +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id); #endif /* RTE_ETH_BOND_8023AD_H_ */ diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index d9d37495d..f7efbb78e 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -148,7 +148,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, rte_spinlock_unlock(&internals->mode6.lock); } -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals) { @@ -220,13 +220,13 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, return internals->current_primary_port; } -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals) { struct ether_hdr *eth_h; struct arp_hdr *arp_h; - uint8_t slave_idx; + uint16_t slave_idx; rte_spinlock_lock(&internals->mode6.lock); eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h index fd7c3aeb4..9f17f7c85 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.h +++ b/drivers/net/bonding/rte_eth_bond_alb.h @@ -51,7 +51,7 @@ struct client_data { uint32_t cli_ip; /**< Client IP address */ - uint8_t slave_idx; + uint16_t slave_idx; /**< Index of slave on which we connect with that client */ uint8_t in_use; /**< Flag indicating if entry in client table is currently used */ @@ -113,7 +113,7 @@ bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slave on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals); @@ -127,7 +127,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, * @return * Index of slawe on which packet should be sent. */ -uint8_t +uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals); diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index de1d9e0db..529aae34e 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -56,14 +56,14 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) } int -valid_bonded_port_id(uint8_t port_id) +valid_bonded_port_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return check_for_bonded_ethdev(&rte_eth_devices[port_id]); } int -valid_slave_port_id(uint8_t port_id, uint8_t mode) +valid_slave_port_id(uint16_t port_id, uint8_t mode) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); @@ -80,7 +80,7 @@ valid_slave_port_id(uint8_t port_id, uint8_t mode) } void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; uint8_t active_count = internals->active_slave_count; @@ -107,11 +107,11 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) } void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) { - uint8_t slave_pos; + uint16_t slave_pos; struct bond_dev_private *internals = eth_dev->data->dev_private; - uint8_t active_count = internals->active_slave_count; + uint16_t active_count = internals->active_slave_count; if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_stop(eth_dev); @@ -153,7 +153,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) { struct bond_dev_private *internals; char devargs[52]; - uint8_t port_id; + uint16_t port_id; int ret; if (name == NULL) { @@ -193,7 +193,7 @@ rte_eth_bond_free(const char *name) } static int -slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) +slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -233,7 +233,7 @@ slave_vlan_filter_set(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev; struct bond_dev_private *internals; @@ -363,7 +363,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -387,7 +387,8 @@ rte_eth_bond_slave_add(uint8_t bonded_port_id, uint8_t slave_port_id) } static int -__eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) +__eth_bond_slave_remove_lock_free(uint16_t bonded_port_id, + uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -466,7 +467,7 @@ __eth_bond_slave_remove_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -488,7 +489,7 @@ rte_eth_bond_slave_remove(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) +rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) { if (valid_bonded_port_id(bonded_port_id) != 0) return -1; @@ -497,7 +498,7 @@ rte_eth_bond_mode_set(uint8_t bonded_port_id, uint8_t mode) } int -rte_eth_bond_mode_get(uint8_t bonded_port_id) +rte_eth_bond_mode_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -510,7 +511,7 @@ rte_eth_bond_mode_get(uint8_t bonded_port_id) } int -rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) { struct bond_dev_private *internals; @@ -531,7 +532,7 @@ rte_eth_bond_primary_set(uint8_t bonded_port_id, uint8_t slave_port_id) } int -rte_eth_bond_primary_get(uint8_t bonded_port_id) +rte_eth_bond_primary_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -547,7 +548,8 @@ rte_eth_bond_primary_get(uint8_t bonded_port_id) } int -rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; uint8_t i; @@ -570,8 +572,8 @@ rte_eth_bond_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], uint8_t len) } int -rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], - uint8_t len) +rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], + uint16_t len) { struct bond_dev_private *internals; @@ -586,13 +588,14 @@ rte_eth_bond_active_slaves_get(uint8_t bonded_port_id, uint8_t slaves[], if (internals->active_slave_count > len) return -1; - memcpy(slaves, internals->active_slaves, internals->active_slave_count); + memcpy(slaves, internals->active_slaves, + internals->active_slave_count * sizeof(internals->active_slaves[0])); return internals->active_slave_count; } int -rte_eth_bond_mac_address_set(uint8_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *bonded_eth_dev; @@ -618,7 +621,7 @@ rte_eth_bond_mac_address_set(uint8_t bonded_port_id, } int -rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) +rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -647,7 +650,7 @@ rte_eth_bond_mac_address_reset(uint8_t bonded_port_id) } int -rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) +rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) { struct bond_dev_private *internals; @@ -677,7 +680,7 @@ rte_eth_bond_xmit_policy_set(uint8_t bonded_port_id, uint8_t policy) } int -rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) +rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -690,7 +693,7 @@ rte_eth_bond_xmit_policy_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) +rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms) { struct bond_dev_private *internals; @@ -704,7 +707,7 @@ rte_eth_bond_link_monitoring_set(uint8_t bonded_port_id, uint32_t internal_ms) } int -rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) +rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -717,7 +720,8 @@ rte_eth_bond_link_monitoring_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, + uint32_t delay_ms) { struct bond_dev_private *internals; @@ -732,7 +736,7 @@ rte_eth_bond_link_down_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; @@ -745,7 +749,7 @@ rte_eth_bond_link_down_prop_delay_get(uint8_t bonded_port_id) } int -rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; @@ -760,7 +764,7 @@ rte_eth_bond_link_up_prop_delay_set(uint8_t bonded_port_id, uint32_t delay_ms) } int -rte_eth_bond_link_up_prop_delay_get(uint8_t bonded_port_id) +rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id) { struct bond_dev_private *internals; diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index bb634c62e..04d1f4e8f 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -153,7 +153,7 @@ bond_ethdev_parse_slave_port_kvarg(const char *key, return -1; } else slave_ports->slaves[slave_ports->slave_count++] = - (uint8_t)port_id; + port_id; } return 0; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 3ee70baa0..2d680e3fb 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -174,7 +174,7 @@ const struct rte_flow_attr flow_attr_8023ad = { int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint8_t slave_port) { + uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); @@ -202,12 +202,12 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, } int -bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { +bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { struct rte_eth_dev *bond_dev = &rte_eth_devices[port_id]; struct bond_dev_private *internals = (struct bond_dev_private *) (bond_dev->data->dev_private); struct rte_eth_dev_info bond_info, slave_info; - uint8_t idx; + uint16_t idx; /* Verify if all slaves in bonding supports flow director and */ if (internals->slave_count > 0) { @@ -230,7 +230,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint8_t port_id) { } int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint8_t slave_port) { +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) { struct rte_flow_error error; struct bond_dev_private *internals = (struct bond_dev_private *) @@ -270,10 +270,10 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; struct bond_dev_private *internals = bd_rx_q->dev_private; uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count; - uint8_t i, idx; + uint16_t i, idx; /* Copy slave list to protect against slave up/down changes during tx * bursting */ @@ -302,8 +302,8 @@ bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -394,8 +394,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW); uint16_t num_rx_total = 0; /* Total number of received packets */ - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t slave_count, idx; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slave_count, idx; uint8_t collecting; /* current slave collecting status */ const uint8_t promisc = internals->promiscuous_en; @@ -673,8 +673,8 @@ bond_ethdev_tx_burst_round_robin(void *queue, struct rte_mbuf **bufs, struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts]; uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] = { 0 }; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave; @@ -904,7 +904,7 @@ bandwidth_cmp(const void *a, const void *b) } static void -bandwidth_left(uint8_t port_id, uint64_t load, uint8_t update_idx, +bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx, struct bwg_slave *bwg_slave) { struct rte_eth_link link_status; @@ -970,10 +970,10 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct rte_eth_dev *primary_port = &rte_eth_devices[internals->primary_port]; uint16_t num_tx_total = 0; - uint8_t i, j; + uint16_t i, j; - uint8_t num_of_slaves = internals->active_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves = internals->active_slave_count; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct ether_hdr *ether_hdr; struct ether_addr primary_slave_addr; @@ -1059,7 +1059,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t num_send, num_not_send = 0; uint16_t num_tx_total = 0; - uint8_t slave_idx; + uint16_t slave_idx; int i, j; @@ -1178,8 +1178,8 @@ bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t num_tx_total = 0, num_tx_slave = 0, tx_fail_total = 0; @@ -1239,8 +1239,8 @@ bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint8_t num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_slaves; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* positions in slaves, not ID */ uint8_t distributing_offsets[RTE_MAX_ETHPORTS]; uint8_t distributing_count; @@ -1333,7 +1333,7 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs, struct bond_tx_queue *bd_tx_q; uint8_t tx_failed_flag = 0, num_of_slaves; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; uint16_t max_nb_of_tx_pkts = 0; @@ -1861,7 +1861,7 @@ slave_add(struct bond_dev_private *internals, void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id) + uint16_t slave_port_id) { int i; @@ -2125,7 +2125,7 @@ static int bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) { int res; - uint8_t i; + uint16_t i; struct bond_dev_private *internals = dev->data->dev_private; /* don't do this while a slave is being added */ @@ -2137,7 +2137,7 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) rte_bitmap_clear(internals->vlan_filter_bmp, vlan_id); for (i = 0; i < internals->slave_count; i++) { - uint8_t port_id = internals->slaves[i].port_id; + uint16_t port_id = internals->slaves[i].port_id; res = rte_eth_dev_vlan_filter(port_id, vlan_id, on); if (res == ENOTSUP) @@ -2277,7 +2277,7 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) static int bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) { - void (*link_update)(uint8_t port_id, struct rte_eth_link *eth_link); + void (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); struct bond_dev_private *bond_ctx; struct rte_eth_link slave_link; @@ -2466,7 +2466,7 @@ bond_ethdev_delayed_lsc_propagation(void *arg) } int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param __rte_unused) { struct rte_eth_dev *bonded_eth_dev; @@ -2951,7 +2951,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) struct bond_dev_private *internals = dev->data->dev_private; struct rte_kvargs *kvlist = internals->kvlist; int arg_count; - uint8_t port_id = dev - rte_eth_devices; + uint16_t port_id = dev - rte_eth_devices; uint8_t agg_mode; static const uint8_t default_rss_key[40] = { @@ -3086,7 +3086,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Parse/set primary slave port id*/ arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); if (arg_count == 1) { - uint8_t primary_slave_port_id; + uint16_t primary_slave_port_id; if (rte_kvargs_process(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG, @@ -3099,7 +3099,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } /* Set balance mode transmit policy*/ - if (rte_eth_bond_primary_set(port_id, (uint8_t)primary_slave_port_id) + if (rte_eth_bond_primary_set(port_id, primary_slave_port_id) != 0) { RTE_LOG(ERR, EAL, "Failed to set primary slave port %d on bonded device %s\n", diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 1fe6ff880..1392da98d 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -93,12 +93,12 @@ struct bond_tx_queue { /** Bonded slave devices structure */ struct bond_ethdev_slave_ports { - uint8_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ - uint8_t slave_count; /**< Number of slaves */ + uint16_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ + uint16_t slave_count; /**< Number of slaves */ }; struct bond_slave_details { - uint8_t port_id; + uint16_t port_id; uint8_t link_status_poll_enabled; uint8_t link_status_wait_to_complete; @@ -114,14 +114,14 @@ typedef uint16_t (*xmit_hash_t)(const struct rte_mbuf *buf, uint8_t slave_count) /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { - uint8_t port_id; /**< Port Id of Bonded Port */ + uint16_t port_id; /**< Port Id of Bonded Port */ uint8_t mode; /**< Link Bonding Mode */ rte_spinlock_t lock; - uint8_t primary_port; /**< Primary Slave Port */ - uint8_t current_primary_port; /**< Primary Slave Port */ - uint8_t user_defined_primary_port; + uint16_t primary_port; /**< Primary Slave Port */ + uint16_t current_primary_port; /**< Primary Slave Port */ + uint16_t user_defined_primary_port; /**< Flag for whether primary port is user defined or not */ uint8_t balance_xmit_policy; @@ -144,16 +144,17 @@ struct bond_dev_private { uint16_t nb_rx_queues; /**< Total number of rx queues */ uint16_t nb_tx_queues; /**< Total number of tx queues*/ - uint8_t active_slave; /**< Next active_slave to poll */ - uint8_t active_slave_count; /**< Number of active slaves */ - uint8_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ + uint16_t active_slave; /**< Next active_slave to poll */ + uint16_t active_slave_count; /**< Number of active slaves */ + uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ - uint8_t slave_count; /**< Number of bonded slaves */ + uint16_t slave_count; /**< Number of bonded slaves */ struct bond_slave_details slaves[RTE_MAX_ETHPORTS]; /**< Arary of bonded slaves details */ struct mode8023ad_private mode4; - uint8_t tlb_slaves_order[RTE_MAX_ETHPORTS]; /* TLB active slaves send order */ + uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS]; + /**< TLB active slaves send order */ struct mode_alb_private mode6; uint32_t rx_offload_capa; /** Rx offload capability */ @@ -186,10 +187,10 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); /* Search given slave array to find position of given id. * Return slave pos or slaves_count if not found. */ -static inline uint8_t -find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { +static inline uint16_t +find_slave_by_id(uint16_t *slaves, uint16_t slaves_count, uint16_t slave_id) { - uint8_t pos; + uint16_t pos; for (pos = 0; pos < slaves_count; pos++) { if (slave_id == slaves[pos]) break; @@ -199,19 +200,19 @@ find_slave_by_id(uint8_t *slaves, uint8_t slaves_count, uint8_t slave_id) { } int -valid_port_id(uint8_t port_id); +valid_port_id(uint16_t port_id); int -valid_bonded_port_id(uint8_t port_id); +valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(uint8_t port_id, uint8_t mode); +valid_slave_port_id(uint16_t port_id, uint8_t mode); void -deactivate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void -activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id); +activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); void link_properties_set(struct rte_eth_dev *bonded_eth_dev, @@ -255,10 +256,10 @@ xmit_l34_hash(const struct rte_mbuf *buf, uint8_t slave_count); void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint8_t slave_port_id); + uint16_t slave_port_id); int -bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type, +bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); int diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 3d4ab9368..a59947d78 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -1624,7 +1624,7 @@ eth_em_interrupt_action(struct rte_eth_dev *dev, rte_em_dev_atomic_read_link_status(dev, &link); if (link.link_status) { PMD_INIT_LOG(INFO, " Port %d: Link Up - speed %u Mbps - %s", - dev->data->port_id, (unsigned)link.link_speed, + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); } else { diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 31819c5bd..06ba68e39 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -119,7 +119,7 @@ struct em_rx_queue { uint16_t nb_rx_hold; /**< number of held free RX desc. */ uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -186,7 +186,7 @@ struct em_tx_queue { /** Total number of TX descriptors ready to be allocated. */ uint16_t nb_tx_free; uint16_t queue_id; /**< TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 1c80a2a1b..a800d9c2b 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -122,7 +122,7 @@ struct igb_rx_queue { uint16_t rx_free_thresh; /**< max free RX desc to hold. */ uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ @@ -191,7 +191,7 @@ struct igb_tx_queue { /**< Index of first used TX descriptor. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold register. */ diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index a3a8cce95..1c8a9337e 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -400,7 +400,7 @@ failsafe_eth_dev_state_sync(struct rte_eth_dev *dev) } int -failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_rmv_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { @@ -419,7 +419,7 @@ failsafe_eth_rmv_event_callback(uint8_t port_id __rte_unused, } int -failsafe_eth_lsc_event_callback(uint8_t port_id __rte_unused, +failsafe_eth_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type event __rte_unused, void *cb_arg, void *out __rte_unused) { diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 0361cf434..4ae6e6c5f 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -180,10 +180,10 @@ int failsafe_eal_uninit(struct rte_eth_dev *dev); int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev); void failsafe_dev_remove(struct rte_eth_dev *dev); -int failsafe_eth_rmv_event_callback(uint8_t port_id, +int failsafe_eth_rmv_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *arg, void *out); -int failsafe_eth_lsc_event_callback(uint8_t port_id, +int failsafe_eth_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *out); diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h index 8e1a95062..060982b10 100644 --- a/drivers/net/fm10k/fm10k.h +++ b/drivers/net/fm10k/fm10k.h @@ -204,7 +204,7 @@ struct fm10k_rx_queue { uint16_t rxrearm_nb; /* number of remaining to be re-armed */ uint16_t rxrearm_start; /* the idx we start the re-arming from */ uint16_t rx_using_sse; /* indicates that vector RX is in use */ - uint8_t port_id; + uint16_t port_id; uint8_t drop_en; uint8_t rx_deferred_start; /* don't start this queue in dev start. */ uint16_t rx_ftag_en; /* indicates FTAG RX supported */ @@ -241,7 +241,7 @@ struct fm10k_tx_queue { volatile uint32_t *tail_ptr; uint32_t txq_flags; /* Holds flags for this TXq */ uint16_t nb_desc; - uint8_t port_id; + uint16_t port_id; uint8_t tx_deferred_start; /** don't start this queue in dev start. */ uint16_t queue_id; uint16_t tx_ftag_en; /* indicates FTAG TX supported */ @@ -289,7 +289,7 @@ static inline uint16_t fifo_remove(struct fifo *fifo) } static inline void -fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint8_t in_port) +fm10k_pktmbuf_reset(struct rte_mbuf *mb, uint16_t in_port) { rte_mbuf_refcnt_set(mb, 1); mb->next = NULL; diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index 55c79a60a..1290d7f32 100644 --- a/drivers/net/i40e/Makefile +++ b/drivers/net/i40e/Makefile @@ -42,7 +42,7 @@ CFLAGS += -DX722_A0_SUPPORT EXPORT_MAP := rte_pmd_i40e_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # Add extra flags for base driver files (also known as shared code) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f12aefa5d..c4c6aec1d 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1920,8 +1920,9 @@ i40e_dev_start(struct rte_eth_dev *dev) hw->adapter_stopped = 0; if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; autonegotiation disabled", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, autonegotiation disabled", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index 20084d649..ff2ab8575 100644 --- a/drivers/net/i40e/i40e_rxtx.h +++ b/drivers/net/i40e/i40e_rxtx.h @@ -121,7 +121,7 @@ struct i40e_rx_queue { uint16_t rxrearm_start; /**< the idx we start the re-arming from */ uint64_t mbuf_initializer; /**< value to init mbufs */ - uint8_t port_id; /**< device port ID */ + uint16_t port_id; /**< device port ID */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise */ uint16_t queue_id; /**< RX queue index */ uint16_t reg_idx; /**< RX queue register index */ @@ -167,7 +167,7 @@ struct i40e_tx_queue { uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; uint32_t txq_flags; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index f12b7f4a1..3728d39b9 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -41,7 +41,7 @@ #include "rte_pmd_i40e.h" int -rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) +rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -66,7 +66,7 @@ rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf) } int -rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -170,7 +170,7 @@ i40e_add_rm_all_vlan_filter(struct i40e_vsi *vsi, uint8_t add) } int -rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -430,7 +430,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on) } int -rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -473,7 +473,7 @@ rte_pmd_i40e_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -514,7 +514,7 @@ rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -555,7 +555,7 @@ rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, uint16_t vf_id, uint8_t on) } int -rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr) { struct i40e_mac_filter *f; @@ -598,7 +598,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, /* Set vlan strip on/off for specific VF from host */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -633,7 +633,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t on) return ret; } -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id) { struct rte_eth_dev *dev; @@ -698,7 +698,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; @@ -764,7 +764,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, return ret; } -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on) +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -858,7 +858,7 @@ i40e_vlan_filter_count(struct i40e_vsi *vsi) return count; } -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on) { struct rte_eth_dev *dev; @@ -941,7 +941,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, } int -rte_pmd_i40e_get_vf_stats(uint8_t port, +rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats) { @@ -986,7 +986,7 @@ rte_pmd_i40e_get_vf_stats(uint8_t port, } int -rte_pmd_i40e_reset_vf_stats(uint8_t port, +rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id) { struct rte_eth_dev *dev; @@ -1020,7 +1020,7 @@ rte_pmd_i40e_reset_vf_stats(uint8_t port, } int -rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) +rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1109,7 +1109,7 @@ rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw) } int -rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight) { struct rte_eth_dev *dev; @@ -1223,7 +1223,7 @@ rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, +rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw) { struct rte_eth_dev *dev; @@ -1341,7 +1341,7 @@ rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id, } int -rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map) +rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map) { struct rte_eth_dev *dev; struct i40e_pf *pf; @@ -1513,7 +1513,7 @@ i40e_add_rm_profile_info(struct i40e_hw *hw, uint8_t *profile_info_sec) /* Check if the profile info exists */ static int -i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) +i40e_check_profile_info(uint16_t port, uint8_t *profile_info_sec) { struct rte_eth_dev *dev = &rte_eth_devices[port]; struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1557,7 +1557,7 @@ i40e_check_profile_info(uint8_t port, uint8_t *profile_info_sec) } int -rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op) { @@ -1863,7 +1863,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg_buff, uint32_t pkg_size, } int -rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size) +rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size) { struct rte_eth_dev *dev; struct i40e_hw *hw; @@ -1991,7 +1991,7 @@ static int check_invalid_ptype_mapping( int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive) @@ -2027,7 +2027,7 @@ rte_pmd_i40e_ptype_mapping_update( return 0; } -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port) { struct rte_eth_dev *dev; @@ -2044,7 +2044,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port) } int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -2078,7 +2078,7 @@ int rte_pmd_i40e_ptype_mapping_get( return 0; } -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type) diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h index 356fa89d7..7f32a59b1 100644 --- a/drivers/net/i40e/rte_pmd_i40e.h +++ b/drivers/net/i40e/rte_pmd_i40e.h @@ -157,7 +157,7 @@ struct rte_pmd_i40e_ptype_mapping { * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); +int rte_pmd_i40e_ping_vfs(uint16_t port, uint16_t vf); /** * Enable/Disable VF MAC anti spoofing. @@ -174,7 +174,7 @@ int rte_pmd_i40e_ping_vfs(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -193,7 +193,7 @@ int rte_pmd_i40e_set_vf_mac_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, +int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on); @@ -210,7 +210,7 @@ int rte_pmd_i40e_set_vf_vlan_anti_spoof(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_tx_loopback(uint8_t port, +int rte_pmd_i40e_set_tx_loopback(uint16_t port, uint8_t on); /** @@ -228,7 +228,7 @@ int rte_pmd_i40e_set_tx_loopback(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_unicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -247,7 +247,7 @@ int rte_pmd_i40e_set_vf_unicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, +int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on); @@ -271,7 +271,7 @@ int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, struct ether_addr *mac_addr); /** @@ -291,7 +291,7 @@ int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, * - (-EINVAL) if bad parameter. */ int -rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_i40e_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -309,7 +309,7 @@ rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, uint16_t vlan_id); /** @@ -328,7 +328,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, +int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, uint8_t on); /** @@ -347,7 +347,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint8_t port, uint16_t vf_id, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); +int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on); /** * Enable/Disable VF VLAN filter @@ -368,7 +368,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t port, uint16_t vf_id, uint8_t on); * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, +int rte_pmd_i40e_set_vf_vlan_filter(uint16_t port, uint16_t vlan_id, uint64_t vf_mask, uint8_t on); /** @@ -393,7 +393,7 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_vf_stats(uint8_t port, +int rte_pmd_i40e_get_vf_stats(uint16_t port, uint16_t vf_id, struct rte_eth_stats *stats); @@ -409,7 +409,7 @@ int rte_pmd_i40e_get_vf_stats(uint8_t port, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_reset_vf_stats(uint8_t port, +int rte_pmd_i40e_reset_vf_stats(uint16_t port, uint16_t vf_id); /** @@ -434,7 +434,7 @@ int rte_pmd_i40e_reset_vf_stats(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_max_bw(uint16_t port, uint16_t vf_id, uint32_t bw); @@ -459,7 +459,7 @@ int rte_pmd_i40e_set_vf_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, +int rte_pmd_i40e_set_vf_tc_bw_alloc(uint16_t port, uint16_t vf_id, uint8_t tc_num, uint8_t *bw_weight); @@ -484,7 +484,7 @@ int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, +int rte_pmd_i40e_set_vf_tc_max_bw(uint16_t port, uint16_t vf_id, uint8_t tc_no, uint32_t bw); @@ -502,7 +502,7 @@ int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); +int rte_pmd_i40e_set_tc_strict_prio(uint16_t port, uint8_t tc_map); /** * Load/Unload a ddp package @@ -523,7 +523,7 @@ int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map); * - (-EACCES) if profile does not exist. * - (-ENOTSUP) if operation not supported. */ -int rte_pmd_i40e_process_ddp_package(uint8_t port, uint8_t *buff, +int rte_pmd_i40e_process_ddp_package(uint16_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op); @@ -561,7 +561,7 @@ int rte_pmd_i40e_get_ddp_info(uint8_t *pkg, uint32_t pkg_size, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); +int rte_pmd_i40e_get_ddp_list(uint16_t port, uint8_t *buff, uint32_t size); /** * Update hardware defined ptype to software defined packet type @@ -581,7 +581,7 @@ int rte_pmd_i40e_get_ddp_list(uint8_t port, uint8_t *buff, uint32_t size); * set other PTYPEs maps to PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_update( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t count, uint8_t exclusive); @@ -593,7 +593,7 @@ int rte_pmd_i40e_ptype_mapping_update( * @param port * pointer to port identifier of the device */ -int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); +int rte_pmd_i40e_ptype_mapping_reset(uint16_t port); /** * Get hardware defined ptype to software defined ptype @@ -612,7 +612,7 @@ int rte_pmd_i40e_ptype_mapping_reset(uint8_t port); * -(!0) only return mapping items which packet_type != RTE_PTYPE_UNKNOWN. */ int rte_pmd_i40e_ptype_mapping_get( - uint8_t port, + uint16_t port, struct rte_pmd_i40e_ptype_mapping *mapping_items, uint16_t size, uint16_t *count, @@ -632,7 +632,7 @@ int rte_pmd_i40e_ptype_mapping_get( * @param pkt_type * the new packet type to overwrite */ -int rte_pmd_i40e_ptype_mapping_replace(uint8_t port, +int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, uint32_t target, uint8_t mask, uint32_t pkt_type); diff --git a/drivers/net/ixgbe/Makefile b/drivers/net/ixgbe/Makefile index 5e57cb353..18ad4feca 100644 --- a/drivers/net/ixgbe/Makefile +++ b/drivers/net/ixgbe/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_ixgbe_version.map -LIBABIVER := 1 +LIBABIVER := 2 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) # diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 9ca5cbcd3..d873c409f 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2508,8 +2508,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev) * - fixed speed: TODO implement */ if (dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED) { - PMD_INIT_LOG(ERR, "Invalid link_speeds for port %hhu; fix speed not supported", - dev->data->port_id); + PMD_INIT_LOG(ERR, + "Invalid link_speeds for port %u, fix speed not supported", + dev->data->port_id); return -EINVAL; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 85feb0bdc..81c527fad 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -148,7 +148,7 @@ struct ixgbe_rx_queue { uint16_t queue_id; /**< RX queue index. */ uint16_t reg_idx; /**< RX queue register index. */ uint16_t pkt_type_mask; /**< Packet type mask for different NICs. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise. */ uint8_t drop_en; /**< If not 0, set SRRCTL.Drop_En. */ uint8_t rx_deferred_start; /**< not in global dev start. */ @@ -237,7 +237,7 @@ struct ixgbe_tx_queue { uint16_t tx_next_rs; /**< next desc to set RS bit */ uint16_t queue_id; /**< TX queue index. */ uint16_t reg_idx; /**< TX queue register index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint8_t pthresh; /**< Prefetch threshold register. */ uint8_t hthresh; /**< Host threshold register. */ uint8_t wthresh; /**< Write-back threshold reg. */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 79897ff64..f12737857 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -38,7 +38,7 @@ #include "rte_pmd_ixgbe.h" int -rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr) { struct ixgbe_hw *hw; @@ -73,7 +73,7 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) +rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf) { struct ixgbe_hw *hw; struct ixgbe_vf_info *vfinfo; @@ -105,7 +105,7 @@ rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf) } int -rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -135,7 +135,7 @@ rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; struct ixgbe_mac_info *mac; @@ -164,7 +164,7 @@ rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) +rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -200,7 +200,7 @@ rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, uint16_t vlan_id) } int -rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t ctrl; @@ -230,7 +230,7 @@ rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) +rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -260,7 +260,7 @@ rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on) } int -rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on) { struct ixgbe_hw *hw; uint32_t reg_value; @@ -295,7 +295,7 @@ rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -342,7 +342,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, uint8_t on) { int val = 0; @@ -389,7 +389,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -439,7 +439,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on) { struct rte_eth_dev *dev; struct rte_pci_device *pci_dev; @@ -489,7 +489,7 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on) } int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on) { struct rte_eth_dev *dev; @@ -524,7 +524,7 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, } int -rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, +rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk) { struct rte_eth_dev *dev; @@ -540,7 +540,7 @@ rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, } int -rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) +rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -623,7 +623,7 @@ rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp) } int -rte_pmd_ixgbe_macsec_disable(uint8_t port) +rte_pmd_ixgbe_macsec_disable(uint16_t port) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -687,7 +687,7 @@ rte_pmd_ixgbe_macsec_disable(uint8_t port) } int -rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) +rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -712,7 +712,7 @@ rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac) } int -rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) +rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi) { struct ixgbe_hw *hw; struct rte_eth_dev *dev; @@ -738,7 +738,7 @@ rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi) } int -rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -794,7 +794,7 @@ rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key) { struct ixgbe_hw *hw; @@ -837,7 +837,7 @@ rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, } int -rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight) { @@ -911,7 +911,7 @@ rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, #ifdef RTE_LIBRTE_IXGBE_BYPASS int -rte_pmd_ixgbe_bypass_init(uint8_t port_id) +rte_pmd_ixgbe_bypass_init(uint16_t port_id) { struct rte_eth_dev *dev; @@ -926,7 +926,7 @@ rte_pmd_ixgbe_bypass_init(uint8_t port_id) } int -rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) +rte_pmd_ixgbe_bypass_state_show(uint16_t port_id, uint32_t *state) { struct rte_eth_dev *dev; @@ -940,7 +940,7 @@ rte_pmd_ixgbe_bypass_state_show(uint8_t port_id, uint32_t *state) } int -rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) +rte_pmd_ixgbe_bypass_state_set(uint16_t port_id, uint32_t *new_state) { struct rte_eth_dev *dev; @@ -954,7 +954,7 @@ rte_pmd_ixgbe_bypass_state_set(uint8_t port_id, uint32_t *new_state) } int -rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_show(uint16_t port_id, uint32_t event, uint32_t *state) { @@ -970,7 +970,7 @@ rte_pmd_ixgbe_bypass_event_show(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, +rte_pmd_ixgbe_bypass_event_store(uint16_t port_id, uint32_t event, uint32_t state) { @@ -986,7 +986,7 @@ rte_pmd_ixgbe_bypass_event_store(uint8_t port_id, } int -rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) +rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port_id, uint32_t timeout) { struct rte_eth_dev *dev; @@ -1000,7 +1000,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port_id, uint32_t timeout) } int -rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) +rte_pmd_ixgbe_bypass_ver_show(uint16_t port_id, uint32_t *ver) { struct rte_eth_dev *dev; @@ -1014,7 +1014,7 @@ rte_pmd_ixgbe_bypass_ver_show(uint8_t port_id, uint32_t *ver) } int -rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) +rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port_id, uint32_t *wd_timeout) { struct rte_eth_dev *dev; @@ -1028,7 +1028,7 @@ rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port_id, uint32_t *wd_timeout) } int -rte_pmd_ixgbe_bypass_wd_reset(uint8_t port_id) +rte_pmd_ixgbe_bypass_wd_reset(uint16_t port_id) { struct rte_eth_dev *dev; diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index d33c285db..81b18f876 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -53,7 +53,7 @@ * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* invalid. */ -int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); +int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf); /** * Set the VF MAC address. @@ -69,7 +69,7 @@ int rte_pmd_ixgbe_ping_vf(uint8_t port, uint16_t vf); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ -int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, struct ether_addr *mac_addr); /** @@ -87,7 +87,8 @@ int rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, + uint8_t on); /** * Enable/Disable VF MAC anti spoofing. @@ -104,7 +105,7 @@ int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan insert @@ -122,7 +123,7 @@ int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, +int rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, uint16_t vlan_id); /** @@ -139,7 +140,7 @@ int rte_pmd_ixgbe_set_vf_vlan_insert(uint8_t port, uint16_t vf, * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on); /** * set all queues drop enable bit @@ -155,7 +156,7 @@ int rte_pmd_ixgbe_set_tx_loopback(uint8_t port, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); +int rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on); /** * set drop enable bit in the VF split rx control register @@ -174,7 +175,7 @@ int rte_pmd_ixgbe_set_all_queues_drop_en(uint8_t port, uint8_t on); * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); +int rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable vf vlan strip for all queues in a pool @@ -194,7 +195,7 @@ int rte_pmd_ixgbe_set_vf_split_drop_en(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); /** * Enable MACsec offload. @@ -212,7 +213,7 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); +int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp); /** * Disable MACsec offload. @@ -224,7 +225,7 @@ int rte_pmd_ixgbe_macsec_enable(uint8_t port, uint8_t en, uint8_t rp); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_disable(uint8_t port); +int rte_pmd_ixgbe_macsec_disable(uint16_t port); /** * Configure Tx SC (Secure Connection). @@ -238,7 +239,7 @@ int rte_pmd_ixgbe_macsec_disable(uint8_t port); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); +int rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac); /** * Configure Rx SC (Secure Connection). @@ -254,7 +255,7 @@ int rte_pmd_ixgbe_macsec_config_txsc(uint8_t port, uint8_t *mac); * - (-ENODEV) if *port* invalid. * - (-ENOTSUP) if hardware doesn't support this feature. */ -int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); +int rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi); /** * Enable Tx SA (Secure Association). @@ -275,7 +276,7 @@ int rte_pmd_ixgbe_macsec_config_rxsc(uint8_t port, uint8_t *mac, uint16_t pi); * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, +int rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key); /** @@ -297,7 +298,7 @@ int rte_pmd_ixgbe_macsec_select_txsa(uint8_t port, uint8_t idx, uint8_t an, * - (-ENOTSUP) if hardware doesn't support this feature. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, +int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, uint32_t pn, uint8_t *key); /** @@ -323,7 +324,8 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint8_t port, uint8_t idx, uint8_t an, * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on); +rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, + uint8_t on); /** * Enable or disable a VF traffic receive of an Ethernet device. @@ -342,7 +344,7 @@ rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable or disable a VF traffic transmit of the Ethernet device. @@ -361,7 +363,7 @@ rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); +rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on); /** * Enable/Disable hardware VF VLAN filtering by an Ethernet device of @@ -383,7 +385,8 @@ rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if bad parameter. */ int -rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on); +rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, + uint64_t vf_mask, uint8_t vlan_on); /** * Set the rate limitation for a vf on an Ethernet device. @@ -402,7 +405,8 @@ rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk); +int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, + uint16_t tx_rate, uint64_t q_msk); /** * Set all the TCs' bandwidth weight. @@ -423,7 +427,7 @@ int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, * - (-EINVAL) if bad parameter. * - (-ENOTSUP) not supported by firmware. */ -int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, +int rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, uint8_t tc_num, uint8_t *bw_weight); @@ -439,7 +443,7 @@ int rte_pmd_ixgbe_set_tc_bw_alloc(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_init(uint8_t port); +int rte_pmd_ixgbe_bypass_init(uint16_t port); /** * Return bypass state. @@ -456,7 +460,7 @@ int rte_pmd_ixgbe_bypass_init(uint8_t port); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); +int rte_pmd_ixgbe_bypass_state_show(uint16_t port, uint32_t *state); /** * Set bypass state @@ -473,7 +477,7 @@ int rte_pmd_ixgbe_bypass_state_show(uint8_t port, uint32_t *state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); +int rte_pmd_ixgbe_bypass_state_set(uint16_t port, uint32_t *new_state); /** * Return bypass state when given event occurs. @@ -497,7 +501,7 @@ int rte_pmd_ixgbe_bypass_state_set(uint8_t port, uint32_t *new_state); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_show(uint8_t port, +int rte_pmd_ixgbe_bypass_event_show(uint16_t port, uint32_t event, uint32_t *state); @@ -523,7 +527,7 @@ int rte_pmd_ixgbe_bypass_event_show(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_event_store(uint8_t port, +int rte_pmd_ixgbe_bypass_event_store(uint16_t port, uint32_t event, uint32_t state); @@ -547,7 +551,7 @@ int rte_pmd_ixgbe_bypass_event_store(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port, uint32_t timeout); /** * Get bypass firmware version. @@ -561,7 +565,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_store(uint8_t port, uint32_t timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); +int rte_pmd_ixgbe_bypass_ver_show(uint16_t port, uint32_t *ver); /** * Return bypass watchdog timeout in seconds @@ -583,7 +587,7 @@ int rte_pmd_ixgbe_bypass_ver_show(uint8_t port, uint32_t *ver); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); +int rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port, uint32_t *wd_timeout); /** * Reset bypass watchdog timer @@ -595,7 +599,7 @@ int rte_pmd_ixgbe_bypass_wd_timeout_show(uint8_t port, uint32_t *wd_timeout); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_pmd_ixgbe_bypass_wd_reset(uint8_t port); +int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port); /** diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 7de1d1086..238a64f43 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -112,14 +112,14 @@ struct rxq { unsigned int sges_n:2; /* Log 2 of SGEs (max buffers per packet). */ unsigned int cqe_n:4; /* Log 2 of CQ elements. */ unsigned int elts_n:4; /* Log 2 of Mbufs. */ - unsigned int port_id:8; unsigned int rss_hash:1; /* RSS hash result is enabled. */ unsigned int mark:1; /* Marked flow available on the queue. */ unsigned int pending_err:1; /* CQE error needs to be handled. */ unsigned int trim_elts:1; /* Whether elts needs clean-up. */ - unsigned int :6; /* Remaining bits. */ + unsigned int :14; /* Remaining bits. */ volatile uint32_t *rq_db; volatile uint32_t *cq_db; + uint16_t port_id; uint16_t rq_ci; uint16_t rq_pi; uint16_t cq_ci; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 92b03c4cb..f1b968fc2 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -1240,12 +1240,12 @@ nfp_net_dev_link_status_print(struct rte_eth_dev *dev) nfp_net_dev_atomic_read_link_status(dev, &link); if (link.link_status) RTE_LOG(INFO, PMD, "Port %d: Link Up - speed %u Mbps - %s\n", - (int)(dev->data->port_id), (unsigned)link.link_speed, + dev->data->port_id, link.link_speed, link.link_duplex == ETH_LINK_FULL_DUPLEX ? "full-duplex" : "half-duplex"); else RTE_LOG(INFO, PMD, " Port %d: Link Down\n", - (int)(dev->data->port_id)); + dev->data->port_id); RTE_LOG(INFO, PMD, "PCI Address: %04d:%02d:%02d:%d\n", pci_dev->addr.domain, pci_dev->addr.bus, @@ -1549,7 +1549,7 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, "tx_free_thresh must be less than the number of TX " "descriptors. (tx_free_thresh=%u port=%d " "queue=%d)\n", (unsigned int)tx_free_thresh, - (int)dev->data->port_id, (int)queue_idx); + dev->data->port_id, (int)queue_idx); return -(EINVAL); } @@ -1847,9 +1847,9 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) */ new_mb = rte_pktmbuf_alloc(rxq->mem_pool); if (unlikely(new_mb == NULL)) { - RTE_LOG_DP(DEBUG, PMD, "RX mbuf alloc failed port_id=%u " - "queue_id=%u\n", (unsigned)rxq->port_id, - (unsigned)rxq->qidx); + RTE_LOG_DP(DEBUG, PMD, + "RX mbuf alloc failed port_id=%u queue_id=%u\n", + rxq->port_id, (unsigned int)rxq->qidx); nfp_net_mbuf_alloc_failed(rxq); break; } @@ -1933,7 +1933,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) return nb_hold; PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, nb_hold); + rxq->port_id, (unsigned int)rxq->qidx, nb_hold); nb_hold += rxq->nb_rx_hold; @@ -1944,7 +1944,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rte_wmb(); if (nb_hold > rxq->rx_free_thresh) { PMD_RX_LOG(DEBUG, "port=%u queue=%u nb_hold=%u avail=%u\n", - (unsigned)rxq->port_id, (unsigned)rxq->qidx, + rxq->port_id, (unsigned int)rxq->qidx, (unsigned)nb_hold, (unsigned)avail); nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, nb_hold); nb_hold = 0; diff --git a/drivers/net/nfp/nfp_net_pmd.h b/drivers/net/nfp/nfp_net_pmd.h index eec56bc1c..828d0d35b 100644 --- a/drivers/net/nfp/nfp_net_pmd.h +++ b/drivers/net/nfp/nfp_net_pmd.h @@ -250,7 +250,7 @@ struct nfp_net_txq { uint32_t tx_hthresh; /* not used by now. Future? */ uint32_t tx_wthresh; /* not used by now. Future? */ uint32_t txq_flags; /* not used by now. Future? */ - uint8_t port_id; + uint16_t port_id; int qidx; int tx_qcidx; __le64 dma; diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 5aef0591e..fa9313dec 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -68,7 +68,7 @@ struct null_queue { struct pmd_internals { unsigned packet_size; unsigned packet_copy; - uint8_t port_id; + uint16_t port_id; struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT]; struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT]; diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index defb3b419..b51f16cbd 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -75,7 +75,7 @@ struct queue_stat { struct pcap_rx_queue { pcap_t *pcap; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; struct queue_stat rx_stat; char name[PATH_MAX]; diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h index 9864bb448..96f0d351d 100644 --- a/drivers/net/qede/qede_if.h +++ b/drivers/net/qede/qede_if.h @@ -97,7 +97,7 @@ struct qed_link_output { uint32_t speed; /* In Mb/s */ uint32_t adv_speed; /* Speed mask */ uint8_t duplex; /* In DUPLEX defs */ - uint8_t port; /* In PORT defs */ + uint16_t port; /* In PORT defs */ bool autoneg; uint32_t pause_config; }; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 464d3d384..e3fa7b0e2 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -394,7 +394,7 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[], }; char args_str[32] = { 0 }; char ring_name[32] = { 0 }; - uint8_t port_id = RTE_MAX_ETHPORTS; + uint16_t port_id = RTE_MAX_ETHPORTS; int ret; /* do some parameter checking */ diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 9c0d57cc1..d141acf0e 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -71,7 +71,7 @@ struct szedata2_rx_queue { struct szedata *sze; uint8_t rx_channel; - uint8_t in_port; + uint16_t in_port; struct rte_mempool *mb_pool; volatile uint64_t rx_pkts; volatile uint64_t rx_bytes; diff --git a/drivers/net/thunderx/nicvf_struct.h b/drivers/net/thunderx/nicvf_struct.h index 4ee6c3bb0..e54a96f8e 100644 --- a/drivers/net/thunderx/nicvf_struct.h +++ b/drivers/net/thunderx/nicvf_struct.h @@ -100,7 +100,7 @@ struct nicvf_rxq { uint16_t queue_id; uint16_t precharge_cnt; uint8_t rx_drop_en; - uint8_t port_id; + uint16_t port_id; uint8_t rbptr_offset; } __rte_cache_aligned; diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile index 3ba8ad64f..258a917c7 100644 --- a/drivers/net/vhost/Makefile +++ b/drivers/net/vhost/Makefile @@ -43,7 +43,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_pmd_vhost_version.map -LIBABIVER := 1 +LIBABIVER := 2 # # all source are stored in SRCS-y diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 0dac5e60e..04179b4db 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -105,7 +105,7 @@ struct vhost_queue { rte_atomic32_t while_queuing; struct pmd_internal *internal; struct rte_mempool *mb_pool; - uint8_t port; + uint16_t port; uint16_t virtqueue_id; struct vhost_stats stats; }; @@ -705,7 +705,7 @@ static struct vhost_device_ops vhost_ops = { }; int -rte_eth_vhost_get_queue_event(uint8_t port_id, +rte_eth_vhost_get_queue_event(uint16_t port_id, struct rte_eth_vhost_queue_event *event) { struct rte_vhost_vring_state *state; @@ -742,7 +742,7 @@ rte_eth_vhost_get_queue_event(uint8_t port_id, } int -rte_eth_vhost_get_vid_from_port_id(uint8_t port_id) +rte_eth_vhost_get_vid_from_port_id(uint16_t port_id) { struct internal_list *list; struct rte_eth_dev *eth_dev; diff --git a/drivers/net/vhost/rte_eth_vhost.h b/drivers/net/vhost/rte_eth_vhost.h index 39ca77197..948f3c810 100644 --- a/drivers/net/vhost/rte_eth_vhost.h +++ b/drivers/net/vhost/rte_eth_vhost.h @@ -69,7 +69,7 @@ struct rte_eth_vhost_queue_event { * - On success, zero. * - On failure, a negative value. */ -int rte_eth_vhost_get_queue_event(uint8_t port_id, +int rte_eth_vhost_get_queue_event(uint16_t port_id, struct rte_eth_vhost_queue_event *event); /** @@ -79,7 +79,7 @@ int rte_eth_vhost_get_queue_event(uint8_t port_id, * - On success, the 'vid' associated with 'port_id'. * - On failure, a negative value. */ -int rte_eth_vhost_get_vid_from_port_id(uint8_t port_id); +int rte_eth_vhost_get_vid_from_port_id(uint16_t port_id); #ifdef __cplusplus } diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 18caebdd7..330ee94be 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -260,7 +260,7 @@ struct virtio_hw { uint8_t use_msix; uint8_t modern; uint8_t use_simple_rxtx; - uint8_t port_id; + uint16_t port_id; uint8_t mac_addr[ETHER_ADDR_LEN]; uint32_t notify_off_multiplier; uint8_t *isr; diff --git a/drivers/net/virtio/virtio_rxtx.h b/drivers/net/virtio/virtio_rxtx.h index 28f82d6a8..198b2d8fb 100644 --- a/drivers/net/virtio/virtio_rxtx.h +++ b/drivers/net/virtio/virtio_rxtx.h @@ -54,7 +54,7 @@ struct virtnet_rx { struct rte_mempool *mpool; /**< mempool for mbuf allocation */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -69,7 +69,7 @@ struct virtnet_tx { phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ uint16_t queue_id; /**< DPDK queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ /* Statistics */ struct virtnet_stats stats; @@ -82,7 +82,7 @@ struct virtnet_ctl { /**< memzone to populate hdr. */ const struct rte_memzone *virtio_net_hdr_mz; phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ const struct rte_memzone *mz; /**< mem zone to populate RX ring. */ }; diff --git a/drivers/net/vmxnet3/vmxnet3_ring.h b/drivers/net/vmxnet3/vmxnet3_ring.h index d2e8323ba..a6fa93ac7 100644 --- a/drivers/net/vmxnet3/vmxnet3_ring.h +++ b/drivers/net/vmxnet3/vmxnet3_ring.h @@ -144,7 +144,7 @@ typedef struct vmxnet3_tx_queue { const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device TX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ uint16_t txdata_desc_size; } vmxnet3_tx_queue_t; @@ -179,7 +179,7 @@ typedef struct vmxnet3_rx_queue { const struct rte_memzone *mz; bool stopped; uint16_t queue_id; /**< Device RX queue index. */ - uint8_t port_id; /**< Device port identifier. */ + uint16_t port_id; /**< Device port identifier. */ } vmxnet3_rx_queue_t; #endif /* _VMXNET3_RING_H_ */ diff --git a/lib/librte_bitratestats/Makefile b/lib/librte_bitratestats/Makefile index 58a20ea09..a079cced7 100644 --- a/lib/librte_bitratestats/Makefile +++ b/lib/librte_bitratestats/Makefile @@ -38,7 +38,7 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 EXPORT_MAP := rte_bitratestats_version.map -LIBABIVER := 1 +LIBABIVER := 2 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) := rte_bitrate.c diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index 3ceb35166..f373697a7 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -84,7 +84,7 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data) int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id) + uint16_t port_id) { struct rte_stats_bitrate *port_data; struct rte_eth_stats eth_stats; diff --git a/lib/librte_bitratestats/rte_bitrate.h b/lib/librte_bitratestats/rte_bitrate.h index 15fc270a3..16467221b 100644 --- a/lib/librte_bitratestats/rte_bitrate.h +++ b/lib/librte_bitratestats/rte_bitrate.h @@ -85,7 +85,7 @@ int rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data); * - Negative value on error */ int rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, - uint8_t port_id); + uint16_t port_id); #ifdef __cplusplus } diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile index 201cb96fc..edcddf70d 100644 --- a/lib/librte_ether/Makefile +++ b/lib/librte_ether/Makefile @@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS) EXPORT_MAP := rte_ethdev_version.map -LIBABIVER := 7 +LIBABIVER := 8 SRCS-y += rte_ethdev.c SRCS-y += rte_flow.c diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 1849a3bdd..0779c0d08 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -139,8 +139,8 @@ enum { STAT_QMAP_RX }; -uint8_t -rte_eth_find_next(uint8_t port_id) +uint16_t +rte_eth_find_next(uint16_t port_id) { while (port_id < RTE_MAX_ETHPORTS && rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED) @@ -188,7 +188,7 @@ rte_eth_dev_allocated(const char *name) return NULL; } -static uint8_t +static uint16_t rte_eth_dev_find_free_port(void) { unsigned i; @@ -201,7 +201,7 @@ rte_eth_dev_find_free_port(void) } static struct rte_eth_dev * -eth_dev_get(uint8_t port_id) +eth_dev_get(uint16_t port_id) { struct rte_eth_dev *eth_dev = &rte_eth_devices[port_id]; @@ -217,7 +217,7 @@ eth_dev_get(uint8_t port_id) struct rte_eth_dev * rte_eth_dev_allocate(const char *name) { - uint8_t port_id; + uint16_t port_id; struct rte_eth_dev *eth_dev; port_id = rte_eth_dev_find_free_port(); @@ -252,7 +252,7 @@ rte_eth_dev_allocate(const char *name) struct rte_eth_dev * rte_eth_dev_attach_secondary(const char *name) { - uint8_t i; + uint16_t i; struct rte_eth_dev *eth_dev; if (rte_eth_dev_data == NULL) @@ -286,7 +286,7 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) } int -rte_eth_dev_is_valid_port(uint8_t port_id) +rte_eth_dev_is_valid_port(uint16_t port_id) { if (port_id >= RTE_MAX_ETHPORTS || (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED && @@ -297,17 +297,17 @@ rte_eth_dev_is_valid_port(uint8_t port_id) } int -rte_eth_dev_socket_id(uint8_t port_id) +rte_eth_dev_socket_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); return rte_eth_devices[port_id].data->numa_node; } -uint8_t +uint16_t rte_eth_dev_count(void) { - uint8_t p; - uint8_t count; + uint16_t p; + uint16_t count; count = 0; @@ -318,7 +318,7 @@ rte_eth_dev_count(void) } int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name) { const char *tmp; @@ -337,7 +337,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name) } int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id) { int ret; int i; @@ -362,7 +362,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) } static int -rte_eth_dev_is_detachable(uint8_t port_id) +rte_eth_dev_is_detachable(uint16_t port_id) { uint32_t dev_flags; @@ -378,7 +378,7 @@ rte_eth_dev_is_detachable(uint8_t port_id) /* attach the new device, then store port_id of the device */ int -rte_eth_dev_attach(const char *devargs, uint8_t *port_id) +rte_eth_dev_attach(const char *devargs, uint16_t *port_id) { int ret = -1; int current = rte_eth_dev_count(); @@ -424,7 +424,7 @@ rte_eth_dev_attach(const char *devargs, uint8_t *port_id) /* detach the device, then store the name of the device */ int -rte_eth_dev_detach(uint8_t port_id, char *name) +rte_eth_dev_detach(uint16_t port_id, char *name) { int ret = -1; @@ -502,7 +502,7 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) } int -rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -528,7 +528,7 @@ rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) +rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) { struct rte_eth_dev *dev; @@ -554,7 +554,7 @@ rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id) } int -rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -580,7 +580,7 @@ rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id) } int -rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id) +rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) { struct rte_eth_dev *dev; @@ -689,7 +689,7 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex) } int -rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, const struct rte_eth_conf *dev_conf) { struct rte_eth_dev *dev; @@ -850,7 +850,7 @@ _rte_eth_dev_reset(struct rte_eth_dev *dev) } static void -rte_eth_dev_config_restore(uint8_t port_id) +rte_eth_dev_config_restore(uint16_t port_id) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -905,7 +905,7 @@ rte_eth_dev_config_restore(uint8_t port_id) } int -rte_eth_dev_start(uint8_t port_id) +rte_eth_dev_start(uint16_t port_id) { struct rte_eth_dev *dev; int diag; @@ -917,7 +917,7 @@ rte_eth_dev_start(uint8_t port_id) RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_start, -ENOTSUP); if (dev->data->dev_started != 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already started\n", port_id); return 0; @@ -939,7 +939,7 @@ rte_eth_dev_start(uint8_t port_id) } void -rte_eth_dev_stop(uint8_t port_id) +rte_eth_dev_stop(uint16_t port_id) { struct rte_eth_dev *dev; @@ -949,7 +949,7 @@ rte_eth_dev_stop(uint8_t port_id) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_stop); if (dev->data->dev_started == 0) { - RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu8 + RTE_PMD_DEBUG_TRACE("Device with port_id=%" PRIu16 " already stopped\n", port_id); return; @@ -960,7 +960,7 @@ rte_eth_dev_stop(uint8_t port_id) } int -rte_eth_dev_set_link_up(uint8_t port_id) +rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; @@ -973,7 +973,7 @@ rte_eth_dev_set_link_up(uint8_t port_id) } int -rte_eth_dev_set_link_down(uint8_t port_id) +rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; @@ -986,7 +986,7 @@ rte_eth_dev_set_link_down(uint8_t port_id) } void -rte_eth_dev_close(uint8_t port_id) +rte_eth_dev_close(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1006,7 +1006,7 @@ rte_eth_dev_close(uint8_t port_id) } int -rte_eth_dev_reset(uint8_t port_id) +rte_eth_dev_reset(uint16_t port_id) { struct rte_eth_dev *dev; int ret; @@ -1023,7 +1023,7 @@ rte_eth_dev_reset(uint8_t port_id) } int -rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) @@ -1114,7 +1114,7 @@ rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf) { @@ -1218,7 +1218,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size) } int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -1232,7 +1232,7 @@ rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt) } void -rte_eth_promiscuous_enable(uint8_t port_id) +rte_eth_promiscuous_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1245,7 +1245,7 @@ rte_eth_promiscuous_enable(uint8_t port_id) } void -rte_eth_promiscuous_disable(uint8_t port_id) +rte_eth_promiscuous_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1258,7 +1258,7 @@ rte_eth_promiscuous_disable(uint8_t port_id) } int -rte_eth_promiscuous_get(uint8_t port_id) +rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1269,7 +1269,7 @@ rte_eth_promiscuous_get(uint8_t port_id) } void -rte_eth_allmulticast_enable(uint8_t port_id) +rte_eth_allmulticast_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1282,7 +1282,7 @@ rte_eth_allmulticast_enable(uint8_t port_id) } void -rte_eth_allmulticast_disable(uint8_t port_id) +rte_eth_allmulticast_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1295,7 +1295,7 @@ rte_eth_allmulticast_disable(uint8_t port_id) } int -rte_eth_allmulticast_get(uint8_t port_id) +rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1320,7 +1320,7 @@ rte_eth_dev_atomic_read_link_status(struct rte_eth_dev *dev, } void -rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1337,7 +1337,7 @@ rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) } void -rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) +rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *eth_link) { struct rte_eth_dev *dev; @@ -1354,7 +1354,7 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) } int -rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) +rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; @@ -1370,7 +1370,7 @@ rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) } void -rte_eth_stats_reset(uint8_t port_id) +rte_eth_stats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1383,7 +1383,7 @@ rte_eth_stats_reset(uint8_t port_id) } static int -get_xstats_count(uint8_t port_id) +get_xstats_count(uint16_t port_id) { struct rte_eth_dev *dev; int count; @@ -1412,7 +1412,7 @@ get_xstats_count(uint8_t port_id) } int -rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id) { int cnt_xstats, idx_xstat; @@ -1456,7 +1456,7 @@ rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, } int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids) { @@ -1573,7 +1573,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, } int -rte_eth_xstats_get_names(uint8_t port_id, +rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size) { @@ -1639,8 +1639,8 @@ rte_eth_xstats_get_names(uint8_t port_id, /* retrieve ethdev extended statistics */ int -rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, - unsigned int n) +rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, + uint64_t *values, unsigned int n) { /* If need all xstats */ if (!ids) { @@ -1765,7 +1765,7 @@ rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, } int -rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n) { struct rte_eth_stats eth_stats; @@ -1847,7 +1847,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, /* reset ethdev extended statistics */ void -rte_eth_xstats_reset(uint8_t port_id) +rte_eth_xstats_reset(uint16_t port_id) { struct rte_eth_dev *dev; @@ -1865,7 +1865,7 @@ rte_eth_xstats_reset(uint8_t port_id) } static int -set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, +set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx) { struct rte_eth_dev *dev; @@ -1881,7 +1881,7 @@ set_queue_stats_mapping(uint8_t port_id, uint16_t queue_id, uint8_t stat_idx, int -rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, +rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, @@ -1890,7 +1890,7 @@ rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, uint16_t tx_queue_id, int -rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, +rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { return set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, @@ -1898,7 +1898,7 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } int -rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) +rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size) { struct rte_eth_dev *dev; @@ -1910,7 +1910,7 @@ rte_eth_dev_fw_version_get(uint8_t port_id, char *fw_version, size_t fw_size) } void -rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) +rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; const struct rte_eth_desc_lim lim = { @@ -1934,7 +1934,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) } int -rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num) { int i, j; @@ -1960,7 +1960,7 @@ rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, } void -rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) +rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -1971,7 +1971,7 @@ rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr) int -rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) +rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu) { struct rte_eth_dev *dev; @@ -1983,7 +1983,7 @@ rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu) } int -rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) +rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu) { int ret; struct rte_eth_dev *dev; @@ -2000,7 +2000,7 @@ rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu) } int -rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) +rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on) { struct rte_eth_dev *dev; int ret; @@ -2039,7 +2039,8 @@ rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on) } int -rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int on) +rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, + int on) { struct rte_eth_dev *dev; @@ -2057,7 +2058,7 @@ rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, int o } int -rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tpid) { @@ -2071,7 +2072,7 @@ rte_eth_dev_set_vlan_ether_type(uint8_t port_id, } int -rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) +rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask) { struct rte_eth_dev *dev; int ret = 0; @@ -2114,7 +2115,7 @@ rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask) } int -rte_eth_dev_get_vlan_offload(uint8_t port_id) +rte_eth_dev_get_vlan_offload(uint16_t port_id) { struct rte_eth_dev *dev; int ret = 0; @@ -2135,7 +2136,7 @@ rte_eth_dev_get_vlan_offload(uint8_t port_id) } int -rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) +rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on) { struct rte_eth_dev *dev; @@ -2148,7 +2149,7 @@ rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on) } int -rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2160,7 +2161,7 @@ rte_eth_dev_flow_ctrl_get(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) +rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf) { struct rte_eth_dev *dev; @@ -2176,7 +2177,8 @@ rte_eth_dev_flow_ctrl_set(uint8_t port_id, struct rte_eth_fc_conf *fc_conf) } int -rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, struct rte_eth_pfc_conf *pfc_conf) +rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, + struct rte_eth_pfc_conf *pfc_conf) { struct rte_eth_dev *dev; @@ -2242,7 +2244,7 @@ rte_eth_check_reta_entry(struct rte_eth_rss_reta_entry64 *reta_conf, } int -rte_eth_dev_rss_reta_update(uint8_t port_id, +rte_eth_dev_rss_reta_update(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2268,7 +2270,7 @@ rte_eth_dev_rss_reta_update(uint8_t port_id, } int -rte_eth_dev_rss_reta_query(uint8_t port_id, +rte_eth_dev_rss_reta_query(uint16_t port_id, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) { @@ -2288,7 +2290,8 @@ rte_eth_dev_rss_reta_query(uint8_t port_id, } int -rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) +rte_eth_dev_rss_hash_update(uint16_t port_id, + struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; uint16_t rss_hash_protos; @@ -2307,7 +2310,7 @@ rte_eth_dev_rss_hash_update(uint8_t port_id, struct rte_eth_rss_conf *rss_conf) } int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf) { struct rte_eth_dev *dev; @@ -2319,7 +2322,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2341,7 +2344,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, } int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *udp_tunnel) { struct rte_eth_dev *dev; @@ -2364,7 +2367,7 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, } int -rte_eth_led_on(uint8_t port_id) +rte_eth_led_on(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2375,7 +2378,7 @@ rte_eth_led_on(uint8_t port_id) } int -rte_eth_led_off(uint8_t port_id) +rte_eth_led_off(uint16_t port_id) { struct rte_eth_dev *dev; @@ -2390,7 +2393,7 @@ rte_eth_led_off(uint8_t port_id) * an empty spot. */ static int -get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2409,7 +2412,7 @@ get_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) static const struct ether_addr null_mac_addr; int -rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, uint32_t pool) { struct rte_eth_dev *dev; @@ -2462,7 +2465,7 @@ rte_eth_dev_mac_addr_add(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; int index; @@ -2491,7 +2494,7 @@ rte_eth_dev_mac_addr_remove(uint8_t port_id, struct ether_addr *addr) } int -rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) +rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) { struct rte_eth_dev *dev; @@ -2517,7 +2520,7 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) * an empty spot. */ static int -get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) +get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2536,7 +2539,7 @@ get_hash_mac_addr_index(uint8_t port_id, const struct ether_addr *addr) } int -rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, +rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, uint8_t on) { int index; @@ -2588,7 +2591,7 @@ rte_eth_dev_uc_hash_table_set(uint8_t port_id, struct ether_addr *addr, } int -rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) +rte_eth_dev_uc_all_hash_table_set(uint16_t port_id, uint8_t on) { struct rte_eth_dev *dev; @@ -2600,7 +2603,7 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on) return (*dev->dev_ops->uc_all_hash_table_set)(dev, on); } -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate) { struct rte_eth_dev *dev; @@ -2631,7 +2634,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, } int -rte_eth_mirror_rule_set(uint8_t port_id, +rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on) { @@ -2669,7 +2672,7 @@ rte_eth_mirror_rule_set(uint8_t port_id, } int -rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) +rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id) { struct rte_eth_dev *dev; @@ -2682,7 +2685,7 @@ rte_eth_mirror_rule_reset(uint8_t port_id, uint8_t rule_id) } int -rte_eth_dev_callback_register(uint8_t port_id, +rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2722,7 +2725,7 @@ rte_eth_dev_callback_register(uint8_t port_id, } int -rte_eth_dev_callback_unregister(uint8_t port_id, +rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg) { @@ -2794,7 +2797,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev, } int -rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) +rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data) { uint32_t vec; struct rte_eth_dev *dev; @@ -2855,7 +2858,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, } int -rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data) { uint32_t vec; @@ -2895,7 +2898,7 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_rx_intr_enable(uint8_t port_id, +rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2909,7 +2912,7 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id, } int -rte_eth_dev_rx_intr_disable(uint8_t port_id, +rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2924,7 +2927,8 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id, int -rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) +rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type) { struct rte_eth_dev *dev; @@ -2937,7 +2941,7 @@ rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type) } int -rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg) { struct rte_eth_dev *dev; @@ -2950,7 +2954,7 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, } void * -rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -2992,7 +2996,7 @@ rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3027,7 +3031,7 @@ rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, } void * -rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3070,7 +3074,7 @@ rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3104,7 +3108,7 @@ rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb) { #ifndef RTE_ETHDEV_RXTX_CALLBACKS @@ -3138,7 +3142,7 @@ rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, } int -rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo) { struct rte_eth_dev *dev; @@ -3162,7 +3166,7 @@ rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo) { struct rte_eth_dev *dev; @@ -3186,7 +3190,7 @@ rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, } int -rte_eth_dev_set_mc_addr_list(uint8_t port_id, +rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) { @@ -3200,7 +3204,7 @@ rte_eth_dev_set_mc_addr_list(uint8_t port_id, } int -rte_eth_timesync_enable(uint8_t port_id) +rte_eth_timesync_enable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3212,7 +3216,7 @@ rte_eth_timesync_enable(uint8_t port_id) } int -rte_eth_timesync_disable(uint8_t port_id) +rte_eth_timesync_disable(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3224,7 +3228,7 @@ rte_eth_timesync_disable(uint8_t port_id) } int -rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, +rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags) { struct rte_eth_dev *dev; @@ -3237,7 +3241,8 @@ rte_eth_timesync_read_rx_timestamp(uint8_t port_id, struct timespec *timestamp, } int -rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_tx_timestamp(uint16_t port_id, + struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3249,7 +3254,7 @@ rte_eth_timesync_read_tx_timestamp(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) +rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta) { struct rte_eth_dev *dev; @@ -3261,7 +3266,7 @@ rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta) } int -rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) +rte_eth_timesync_read_time(uint16_t port_id, struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3273,7 +3278,7 @@ rte_eth_timesync_read_time(uint8_t port_id, struct timespec *timestamp) } int -rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) +rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *timestamp) { struct rte_eth_dev *dev; @@ -3285,7 +3290,7 @@ rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *timestamp) } int -rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) +rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) { struct rte_eth_dev *dev; @@ -3297,7 +3302,7 @@ rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info) } int -rte_eth_dev_get_eeprom_length(uint8_t port_id) +rte_eth_dev_get_eeprom_length(uint16_t port_id) { struct rte_eth_dev *dev; @@ -3309,7 +3314,7 @@ rte_eth_dev_get_eeprom_length(uint8_t port_id) } int -rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3321,7 +3326,7 @@ rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) +rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info) { struct rte_eth_dev *dev; @@ -3333,7 +3338,7 @@ rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info) } int -rte_eth_dev_get_dcb_info(uint8_t port_id, +rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info) { struct rte_eth_dev *dev; @@ -3348,7 +3353,7 @@ rte_eth_dev_get_dcb_info(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel) { struct rte_eth_dev *dev; @@ -3371,7 +3376,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, } int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en) @@ -3415,7 +3420,7 @@ rte_eth_dev_adjust_nb_desc(uint16_t *nb_desc, } int -rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc) { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 99cdd54d4..34f729ab8 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1572,7 +1572,7 @@ struct eth_dev_ops { * @return * The number of packets returned to the user. */ -typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_rx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); @@ -1596,7 +1596,7 @@ typedef uint16_t (*rte_rx_callback_fn)(uint8_t port, uint16_t queue, * @return * The number of packets to be written to the NIC. */ -typedef uint16_t (*rte_tx_callback_fn)(uint8_t port, uint16_t queue, +typedef uint16_t (*rte_tx_callback_fn)(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, void *user_param); /** @@ -1699,7 +1699,7 @@ struct rte_eth_dev_data { /** bitmap array of associating Ethernet MAC addresses to pools */ struct ether_addr* hash_mac_addrs; /** Device Ethernet MAC addresses of hash filtering. */ - uint8_t port_id; /**< Device [external] port identifier. */ + uint16_t port_id; /**< Device [external] port identifier. */ __extension__ uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). */ scattered_rx : 1, /**< RX of scattered packets is ON(1) / OFF(0) */ @@ -1741,7 +1741,7 @@ extern struct rte_eth_dev rte_eth_devices[]; * @return * Next valid port id, RTE_MAX_ETHPORTS if there is none. */ -uint8_t rte_eth_find_next(uint8_t port_id); +uint16_t rte_eth_find_next(uint16_t port_id); /** * Macro to iterate over all enabled ethdev ports. @@ -1764,7 +1764,7 @@ uint8_t rte_eth_find_next(uint8_t port_id); * @return * - The total number of usable Ethernet devices. */ -uint8_t rte_eth_dev_count(void); +uint16_t rte_eth_dev_count(void); /** * @internal @@ -1825,7 +1825,7 @@ int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev); * @return * 0 on success and port_id is filled, negative on error */ -int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); +int rte_eth_dev_attach(const char *devargs, uint16_t *port_id); /** * Detach a Ethernet device specified by port identifier. @@ -1840,7 +1840,7 @@ int rte_eth_dev_attach(const char *devargs, uint8_t *port_id); * @return * 0 on success and devname is filled, negative on error */ -int rte_eth_dev_detach(uint8_t port_id, char *devname); +int rte_eth_dev_detach(uint16_t port_id, char *devname); /** * Convert a numerical speed in Mbps to a bitmap flag that can be used in @@ -1884,7 +1884,7 @@ uint32_t rte_eth_speed_bitflag(uint32_t speed, int duplex); * - 0: Success, device configured. * - <0: Error code returned by the driver configuration function. */ -int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue, +int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf); /** @@ -1939,7 +1939,7 @@ void _rte_eth_dev_reset(struct rte_eth_dev *dev); * allocate network memory buffers from the memory pool when * initializing receive descriptors. */ -int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool); @@ -1987,7 +1987,7 @@ int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id, * - 0: Success, the transmit queue is correctly set up. * - -ENOMEM: Unable to allocate the transmit ring descriptors. */ -int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, +int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id, const struct rte_eth_txconf *tx_conf); @@ -2001,7 +2001,7 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, * a default of zero if the socket could not be determined. * -1 is returned is the port_id value is out of range. */ -int rte_eth_dev_socket_id(uint8_t port_id); +int rte_eth_dev_socket_id(uint16_t port_id); /** * Check if port_id of device is attached @@ -2012,7 +2012,7 @@ int rte_eth_dev_socket_id(uint8_t port_id); * - 0 if port is out of range or not attached * - 1 if device is attached */ -int rte_eth_dev_is_valid_port(uint8_t port_id); +int rte_eth_dev_is_valid_port(uint16_t port_id); /** * Start specified RX queue of a port. It is used when rx_deferred_start @@ -2029,7 +2029,7 @@ int rte_eth_dev_is_valid_port(uint8_t port_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); /** * Stop specified RX queue of a port @@ -2045,7 +2045,7 @@ int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); +int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); /** * Start TX for specified queue of a port. It is used when tx_deferred_start @@ -2062,7 +2062,7 @@ int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); /** * Stop specified TX queue of a port @@ -2078,7 +2078,7 @@ int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id); * - -EINVAL: The port_id or the queue_id out of range. * - -ENOTSUP: The function not supported in PMD driver. */ -int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); +int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id); @@ -2097,7 +2097,7 @@ int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id); * - 0: Success, Ethernet device started. * - <0: Error code of the driver device start function. */ -int rte_eth_dev_start(uint8_t port_id); +int rte_eth_dev_start(uint16_t port_id); /** * Stop an Ethernet device. The device can be restarted with a call to @@ -2106,7 +2106,7 @@ int rte_eth_dev_start(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_stop(uint8_t port_id); +void rte_eth_dev_stop(uint16_t port_id); /** @@ -2121,7 +2121,7 @@ void rte_eth_dev_stop(uint8_t port_id); * - 0: Success, Ethernet device linked up. * - <0: Error code of the driver device link up function. */ -int rte_eth_dev_set_link_up(uint8_t port_id); +int rte_eth_dev_set_link_up(uint16_t port_id); /** * Link down an Ethernet device. @@ -2132,7 +2132,7 @@ int rte_eth_dev_set_link_up(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_set_link_down(uint8_t port_id); +int rte_eth_dev_set_link_down(uint16_t port_id); /** * Close a stopped Ethernet device. The device cannot be restarted! @@ -2142,7 +2142,7 @@ int rte_eth_dev_set_link_down(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_dev_close(uint8_t port_id); +void rte_eth_dev_close(uint16_t port_id); /** * Reset a Ethernet device and keep its port id. @@ -2172,7 +2172,7 @@ void rte_eth_dev_close(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -int rte_eth_dev_reset(uint8_t port_id); +int rte_eth_dev_reset(uint16_t port_id); /** * Enable receipt in promiscuous mode for an Ethernet device. @@ -2180,7 +2180,7 @@ int rte_eth_dev_reset(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_enable(uint8_t port_id); +void rte_eth_promiscuous_enable(uint16_t port_id); /** * Disable receipt in promiscuous mode for an Ethernet device. @@ -2188,7 +2188,7 @@ void rte_eth_promiscuous_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_promiscuous_disable(uint8_t port_id); +void rte_eth_promiscuous_disable(uint16_t port_id); /** * Return the value of promiscuous mode for an Ethernet device. @@ -2200,7 +2200,7 @@ void rte_eth_promiscuous_disable(uint8_t port_id); * - (0) if promiscuous is disabled. * - (-1) on error */ -int rte_eth_promiscuous_get(uint8_t port_id); +int rte_eth_promiscuous_get(uint16_t port_id); /** * Enable the receipt of any multicast frame by an Ethernet device. @@ -2208,7 +2208,7 @@ int rte_eth_promiscuous_get(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_enable(uint8_t port_id); +void rte_eth_allmulticast_enable(uint16_t port_id); /** * Disable the receipt of all multicast frames by an Ethernet device. @@ -2216,7 +2216,7 @@ void rte_eth_allmulticast_enable(uint8_t port_id); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_allmulticast_disable(uint8_t port_id); +void rte_eth_allmulticast_disable(uint16_t port_id); /** * Return the value of allmulticast mode for an Ethernet device. @@ -2228,7 +2228,7 @@ void rte_eth_allmulticast_disable(uint8_t port_id); * - (0) if allmulticast is disabled. * - (-1) on error */ -int rte_eth_allmulticast_get(uint8_t port_id); +int rte_eth_allmulticast_get(uint16_t port_id); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2241,7 +2241,7 @@ int rte_eth_allmulticast_get(uint8_t port_id); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX @@ -2254,7 +2254,7 @@ void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link); * A pointer to an *rte_eth_link* structure to be filled with * the status, the speed and the mode of the Ethernet device link. */ -void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); +void rte_eth_link_get_nowait(uint16_t port_id, struct rte_eth_link *link); /** * Retrieve the general I/O statistics of an Ethernet device. @@ -2273,7 +2273,7 @@ void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); +int rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats); /** * Reset the general I/O statistics of an Ethernet device. @@ -2281,7 +2281,7 @@ int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats); * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_stats_reset(uint8_t port_id); +void rte_eth_stats_reset(uint16_t port_id); /** * Retrieve names of extended statistics of an Ethernet device. @@ -2303,7 +2303,7 @@ void rte_eth_stats_reset(uint8_t port_id); * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_names(uint8_t port_id, +int rte_eth_xstats_get_names(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size); @@ -2329,7 +2329,7 @@ int rte_eth_xstats_get_names(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, +int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, unsigned int n); /** @@ -2355,7 +2355,7 @@ int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstat *xstats, * - A negative value on error (invalid port id). */ int -rte_eth_xstats_get_names_by_id(uint8_t port_id, +rte_eth_xstats_get_names_by_id(uint16_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids); @@ -2382,7 +2382,7 @@ rte_eth_xstats_get_names_by_id(uint8_t port_id, * shall not be used by the caller. * - A negative value on error (invalid port id). */ -int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, +int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, uint64_t *values, unsigned int n); /** @@ -2402,7 +2402,7 @@ int rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, * -ENODEV for invalid port_id, * -EINVAL if the xstat_name doesn't exist in port_id */ -int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, +int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, uint64_t *id); /** @@ -2411,7 +2411,7 @@ int rte_eth_xstats_get_id_by_name(uint8_t port_id, const char *xstat_name, * @param port_id * The port identifier of the Ethernet device. */ -void rte_eth_xstats_reset(uint8_t port_id); +void rte_eth_xstats_reset(uint16_t port_id); /** * Set a mapping for the specified transmit queue to the specified per-queue @@ -2430,7 +2430,7 @@ void rte_eth_xstats_reset(uint8_t port_id); * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx); /** @@ -2450,7 +2450,7 @@ int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id, * @return * Zero if successful. Non-zero otherwise. */ -int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, +int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx); @@ -2463,7 +2463,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. */ -void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -2474,7 +2474,7 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); * A pointer to a structure of type *rte_eth_dev_info* to be filled with * the contextual information of the Ethernet device. */ -void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); +void rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info); /** * Retrieve the firmware version of a device. @@ -2494,7 +2494,7 @@ void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); * - (>0) if *fw_size* is not enough to store firmware version, return * the size of the non truncated string. */ -int rte_eth_dev_fw_version_get(uint8_t port_id, +int rte_eth_dev_fw_version_get(uint16_t port_id, char *fw_version, size_t fw_size); /** @@ -2535,7 +2535,7 @@ int rte_eth_dev_fw_version_get(uint8_t port_id, * count of supported ptypes will be returned. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, +int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, uint32_t *ptypes, int num); /** @@ -2549,7 +2549,7 @@ int rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); +int rte_eth_dev_get_mtu(uint16_t port_id, uint16_t *mtu); /** * Change the MTU of an Ethernet device. @@ -2565,7 +2565,7 @@ int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu); * - (-EINVAL) if *mtu* invalid. * - (-EBUSY) if operation is not allowed when the port is running */ -int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); +int rte_eth_dev_set_mtu(uint16_t port_id, uint16_t mtu); /** * Enable/Disable hardware filtering by an Ethernet device of received @@ -2585,7 +2585,7 @@ int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu); * - (-ENOSYS) if VLAN filtering on *port_id* disabled. * - (-EINVAL) if *vlan_id* > 4095. */ -int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); +int rte_eth_dev_vlan_filter(uint16_t port_id, uint16_t vlan_id, int on); /** * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device. @@ -2606,7 +2606,7 @@ int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *rx_queue_id* invalid. */ -int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, +int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, int on); /** @@ -2625,7 +2625,7 @@ int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id, * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, +int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, uint16_t tag_type); @@ -2649,7 +2649,7 @@ int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); +int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); /** * Read VLAN Offload configuration from an Ethernet device @@ -2663,7 +2663,7 @@ int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask); * ETH_VLAN_EXTEND_OFFLOAD * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_get_vlan_offload(uint8_t port_id); +int rte_eth_dev_get_vlan_offload(uint16_t port_id); /** * Set port based TX VLAN insertion on or off. @@ -2679,7 +2679,7 @@ int rte_eth_dev_get_vlan_offload(uint8_t port_id); * - (0) if successful. * - negative if failed. */ -int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); +int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); /** * @@ -2764,7 +2764,7 @@ int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on); * *rx_pkts* array. */ static inline uint16_t -rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -2809,7 +2809,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, * (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) +rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; @@ -2838,7 +2838,7 @@ rte_eth_rx_queue_count(uint8_t port_id, uint16_t queue_id) * - (-ENOTSUP) if the device does not support this function */ static inline int -rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) +rte_eth_rx_descriptor_done(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); @@ -2885,7 +2885,7 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset) * - (-ENODEV) bad port or queue (only if compiled with debug). */ static inline int -rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, +rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -2942,7 +2942,7 @@ rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id, * - (-ENOTSUP) if the device does not support this function. * - (-ENODEV) bad port or queue (only if compiled with debug). */ -static inline int rte_eth_tx_descriptor_status(uint8_t port_id, +static inline int rte_eth_tx_descriptor_status(uint16_t port_id, uint16_t queue_id, uint16_t offset) { struct rte_eth_dev *dev; @@ -3026,7 +3026,7 @@ static inline int rte_eth_tx_descriptor_status(uint8_t port_id, * *tx_pkts* parameter when the transmit ring is full or has been filled up. */ static inline uint16_t -rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3115,7 +3115,7 @@ rte_eth_tx_burst(uint8_t port_id, uint16_t queue_id, #ifndef RTE_ETHDEV_TX_PREPARE_NOOP static inline uint16_t -rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct rte_eth_dev *dev; @@ -3157,7 +3157,8 @@ rte_eth_tx_prepare(uint8_t port_id, uint16_t queue_id, */ static inline uint16_t -rte_eth_tx_prepare(__rte_unused uint8_t port_id, __rte_unused uint16_t queue_id, +rte_eth_tx_prepare(__rte_unused uint16_t port_id, + __rte_unused uint16_t queue_id, __rte_unused struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { return nb_pkts; @@ -3226,7 +3227,7 @@ rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size); * callback is called for any packets which could not be sent. */ static inline uint16_t -rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer_flush(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer) { uint16_t sent; @@ -3278,7 +3279,7 @@ rte_eth_tx_buffer_flush(uint8_t port_id, uint16_t queue_id, * the rest. */ static __rte_always_inline uint16_t -rte_eth_tx_buffer(uint8_t port_id, uint16_t queue_id, +rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id, struct rte_eth_dev_tx_buffer *buffer, struct rte_mbuf *tx_pkt) { buffer->pkts[buffer->length++] = tx_pkt; @@ -3394,7 +3395,7 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent, * are in use. */ int -rte_eth_tx_done_cleanup(uint8_t port_id, uint16_t queue_id, uint32_t free_cnt); +rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt); /** * The eth device event type for interrupt, and maybe others in the future. @@ -3412,7 +3413,7 @@ enum rte_eth_event_type { RTE_ETH_EVENT_MAX /**< max value of this enum */ }; -typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, +typedef int (*rte_eth_dev_cb_fn)(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *ret_param); /**< user application callback to be registered for interrupts */ @@ -3434,7 +3435,7 @@ typedef int (*rte_eth_dev_cb_fn)(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_register(uint8_t port_id, +int rte_eth_dev_callback_register(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3455,7 +3456,7 @@ int rte_eth_dev_callback_register(uint8_t port_id, * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_callback_unregister(uint8_t port_id, +int rte_eth_dev_callback_unregister(uint16_t port_id, enum rte_eth_event_type event, rte_eth_dev_cb_fn cb_fn, void *cb_arg); @@ -3501,7 +3502,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id); /** * When lcore wakes up from rx interrupt indicating packet coming, disable rx @@ -3522,7 +3523,7 @@ int rte_eth_dev_rx_intr_enable(uint8_t port_id, uint16_t queue_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); +int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id); /** * RX Interrupt control per port. @@ -3541,7 +3542,7 @@ int rte_eth_dev_rx_intr_disable(uint8_t port_id, uint16_t queue_id); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); +int rte_eth_dev_rx_intr_ctl(uint16_t port_id, int epfd, int op, void *data); /** * RX Interrupt control per queue. @@ -3564,7 +3565,7 @@ int rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data); * - On success, zero. * - On failure, a negative value. */ -int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, +int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, int epfd, int op, void *data); /** @@ -3579,7 +3580,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_on(uint8_t port_id); +int rte_eth_led_on(uint16_t port_id); /** * Turn off the LED on the Ethernet device. @@ -3593,7 +3594,7 @@ int rte_eth_led_on(uint8_t port_id); * that operation. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_led_off(uint8_t port_id); +int rte_eth_led_off(uint16_t port_id); /** * Get current status of the Ethernet link flow control for Ethernet device @@ -3607,7 +3608,7 @@ int rte_eth_led_off(uint8_t port_id); * - (-ENOTSUP) if hardware doesn't support flow control. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_flow_ctrl_get(uint8_t port_id, +int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3624,7 +3625,7 @@ int rte_eth_dev_flow_ctrl_get(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); /** @@ -3642,7 +3643,7 @@ int rte_eth_dev_flow_ctrl_set(uint8_t port_id, * - (-EINVAL) if bad parameter * - (-EIO) if flow control setup failure */ -int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, +int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf); /** @@ -3663,7 +3664,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint8_t port_id, * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, uint32_t pool); /** @@ -3679,7 +3680,7 @@ int rte_eth_dev_mac_addr_add(uint8_t port, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EADDRINUSE) if attempting to remove the default MAC address */ -int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port, struct ether_addr *mac_addr); /** * Set the default MAC address. @@ -3694,8 +3695,8 @@ int rte_eth_dev_mac_addr_remove(uint8_t port, struct ether_addr *mac_addr); * - (-ENODEV) if *port* invalid. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); - +int rte_eth_dev_default_mac_addr_set(uint16_t port, + struct ether_addr *mac_addr); /** * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device. @@ -3712,7 +3713,7 @@ int rte_eth_dev_default_mac_addr_set(uint8_t port, struct ether_addr *mac_addr); * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_update(uint8_t port, +int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3731,7 +3732,7 @@ int rte_eth_dev_rss_reta_update(uint8_t port, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_reta_query(uint8_t port, +int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); @@ -3753,8 +3754,8 @@ int rte_eth_dev_rss_reta_query(uint8_t port, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, - uint8_t on); +int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, + uint8_t on); /** * Updates all unicast hash bitmaps for receiving packet with any Unicast @@ -3773,7 +3774,7 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); +int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on); /** * Set a traffic mirroring rule on an Ethernet device @@ -3796,7 +3797,7 @@ int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on); * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if the mr_conf information is not correct. */ -int rte_eth_mirror_rule_set(uint8_t port_id, +int rte_eth_mirror_rule_set(uint16_t port_id, struct rte_eth_mirror_conf *mirror_conf, uint8_t rule_id, uint8_t on); @@ -3814,7 +3815,7 @@ int rte_eth_mirror_rule_set(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_mirror_rule_reset(uint8_t port_id, +int rte_eth_mirror_rule_reset(uint16_t port_id, uint8_t rule_id); /** @@ -3832,7 +3833,7 @@ int rte_eth_mirror_rule_reset(uint8_t port_id, * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter. */ -int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, +int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, uint16_t tx_rate); /** @@ -3848,7 +3849,7 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx, * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_rss_hash_update(uint8_t port_id, +int rte_eth_dev_rss_hash_update(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3865,7 +3866,7 @@ int rte_eth_dev_rss_hash_update(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support RSS. */ int -rte_eth_dev_rss_hash_conf_get(uint8_t port_id, +rte_eth_dev_rss_hash_conf_get(uint16_t port_id, struct rte_eth_rss_conf *rss_conf); /** @@ -3886,7 +3887,7 @@ rte_eth_dev_rss_hash_conf_get(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_add(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3908,7 +3909,7 @@ rte_eth_dev_udp_tunnel_port_add(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, +rte_eth_dev_udp_tunnel_port_delete(uint16_t port_id, struct rte_eth_udp_tunnel *tunnel_udp); /** @@ -3924,7 +3925,8 @@ rte_eth_dev_udp_tunnel_port_delete(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support this filter type. * - (-ENODEV) if *port_id* invalid. */ -int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_type); +int rte_eth_dev_filter_supported(uint16_t port_id, + enum rte_filter_type filter_type); /** * Take operations to assigned filter type on an Ethernet device. @@ -3944,7 +3946,7 @@ int rte_eth_dev_filter_supported(uint8_t port_id, enum rte_filter_type filter_ty * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, +int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg); /** @@ -3959,7 +3961,7 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type, * - (-ENODEV) if port identifier is invalid. * - (-ENOTSUP) if hardware doesn't support. */ -int rte_eth_dev_get_dcb_info(uint8_t port_id, +int rte_eth_dev_get_dcb_info(uint16_t port_id, struct rte_eth_dcb_info *dcb_info); /** @@ -3986,7 +3988,7 @@ int rte_eth_dev_get_dcb_info(uint8_t port_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4014,7 +4016,7 @@ void *rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_first_rx_callback(uint16_t port_id, uint16_t queue_id, rte_rx_callback_fn fn, void *user_param); /** @@ -4041,7 +4043,7 @@ void *rte_eth_add_first_rx_callback(uint8_t port_id, uint16_t queue_id, * NULL on error. * On success, a pointer value which can later be used to remove the callback. */ -void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, +void *rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, rte_tx_callback_fn fn, void *user_param); /** @@ -4074,7 +4076,7 @@ void *rte_eth_add_tx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4107,7 +4109,7 @@ int rte_eth_remove_rx_callback(uint8_t port_id, uint16_t queue_id, * - -EINVAL: The port_id or the queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ -int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, +int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxtx_callback *user_cb); /** @@ -4127,7 +4129,7 @@ int rte_eth_remove_tx_callback(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_rxq_info *qinfo); /** @@ -4147,7 +4149,7 @@ int rte_eth_rx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - -ENOTSUP: routine is not supported by the device PMD. * - -EINVAL: The port_id or the queue_id is out of range. */ -int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, +int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, struct rte_eth_txq_info *qinfo); /** @@ -4166,7 +4168,7 @@ int rte_eth_tx_queue_info_get(uint8_t port_id, uint16_t queue_id, * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); +int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info); /** * Retrieve size of device EEPROM @@ -4179,7 +4181,7 @@ int rte_eth_dev_get_reg_info(uint8_t port_id, struct rte_dev_reg_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom_length(uint8_t port_id); +int rte_eth_dev_get_eeprom_length(uint16_t port_id); /** * Retrieve EEPROM and EEPROM attribute @@ -4195,7 +4197,7 @@ int rte_eth_dev_get_eeprom_length(uint8_t port_id); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Program EEPROM with provided data @@ -4211,7 +4213,7 @@ int rte_eth_dev_get_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENODEV) if *port_id* invalid. * - others depends on the specific operations implementation. */ -int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); +int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); /** * Set the list of multicast addresses to filter on an Ethernet device. @@ -4230,7 +4232,7 @@ int rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info); * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering. * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ -int rte_eth_dev_set_mc_addr_list(uint8_t port_id, +int rte_eth_dev_set_mc_addr_list(uint16_t port_id, struct ether_addr *mc_addr_set, uint32_t nb_mc_addr); @@ -4245,7 +4247,7 @@ int rte_eth_dev_set_mc_addr_list(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_enable(uint8_t port_id); +int rte_eth_timesync_enable(uint16_t port_id); /** * Disable IEEE1588/802.1AS timestamping for an Ethernet device. @@ -4258,7 +4260,7 @@ int rte_eth_timesync_enable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_disable(uint8_t port_id); +int rte_eth_timesync_disable(uint16_t port_id); /** * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device. @@ -4277,7 +4279,7 @@ int rte_eth_timesync_disable(uint8_t port_id); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, struct timespec *timestamp, uint32_t flags); /** @@ -4294,7 +4296,7 @@ int rte_eth_timesync_read_rx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, +int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, struct timespec *timestamp); /** @@ -4313,7 +4315,7 @@ int rte_eth_timesync_read_tx_timestamp(uint8_t port_id, * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); +int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta); /** * Read the time from the timesync clock on an Ethernet device. @@ -4329,7 +4331,7 @@ int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta); * @return * - 0: Success. */ -int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); +int rte_eth_timesync_read_time(uint16_t port_id, struct timespec *time); /** * Set the time of the timesync clock on an Ethernet device. @@ -4348,7 +4350,7 @@ int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time); * - -ENODEV: The port ID is invalid. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ -int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time); +int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time); /** * Create memzone for HW rings. @@ -4389,7 +4391,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, +rte_eth_dev_l2_tunnel_eth_type_conf(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel); /** @@ -4416,7 +4418,7 @@ rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, +rte_eth_dev_l2_tunnel_offload_set(uint16_t port_id, struct rte_eth_l2_tunnel_conf *l2_tunnel, uint32_t mask, uint8_t en); @@ -4434,7 +4436,7 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, * - (-ENODEV or -EINVAL) on failure. */ int -rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); +rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id); /** * Get the device name from port id @@ -4448,7 +4450,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id); * - (-EINVAL) on failure. */ int -rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); +rte_eth_dev_get_name_by_port(uint16_t port_id, char *name); /** * Check that numbers of Rx and Tx descriptors satisfy descriptors limits from @@ -4466,7 +4468,7 @@ rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); * - (0) if successful. * - (-ENOTSUP, -ENODEV or -EINVAL) on failure. */ -int rte_eth_dev_adjust_nb_rx_tx_desc(uint8_t port_id, +int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, uint16_t *nb_rx_desc, uint16_t *nb_tx_desc); diff --git a/lib/librte_ether/rte_flow.c b/lib/librte_ether/rte_flow.c index 2001fbbf4..95d9ee007 100644 --- a/lib/librte_ether/rte_flow.c +++ b/lib/librte_ether/rte_flow.c @@ -108,7 +108,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = { /* Get generic flow operations structure from a port. */ const struct rte_flow_ops * -rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error) +rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_flow_ops *ops; diff --git a/lib/librte_ether/rte_flow_driver.h b/lib/librte_ether/rte_flow_driver.h index 4d95391d8..8573cefa3 100644 --- a/lib/librte_ether/rte_flow_driver.h +++ b/lib/librte_ether/rte_flow_driver.h @@ -178,7 +178,7 @@ rte_flow_error_set(struct rte_flow_error *error, * additional details. */ const struct rte_flow_ops * -rte_flow_ops_get(uint8_t port_id, struct rte_flow_error *error); +rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error); #ifdef __cplusplus } diff --git a/lib/librte_ether/rte_tm.c b/lib/librte_ether/rte_tm.c index 71679650e..ceac34115 100644 --- a/lib/librte_ether/rte_tm.c +++ b/lib/librte_ether/rte_tm.c @@ -40,7 +40,7 @@ /* Get generic traffic manager operations structure from a port. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; const struct rte_tm_ops *ops; @@ -87,7 +87,7 @@ rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error) /* Get number of leaf nodes */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error) { @@ -113,7 +113,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, /* Check node type (leaf or non-leaf) */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error) @@ -124,7 +124,7 @@ rte_tm_node_type_get(uint8_t port_id, } /* Get capabilities */ -int rte_tm_capabilities_get(uint8_t port_id, +int rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error) { @@ -134,7 +134,7 @@ int rte_tm_capabilities_get(uint8_t port_id, } /* Get level capabilities */ -int rte_tm_level_capabilities_get(uint8_t port_id, +int rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error) @@ -145,7 +145,7 @@ int rte_tm_level_capabilities_get(uint8_t port_id, } /* Get node capabilities */ -int rte_tm_node_capabilities_get(uint8_t port_id, +int rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error) @@ -156,7 +156,7 @@ int rte_tm_node_capabilities_get(uint8_t port_id, } /* Add WRED profile */ -int rte_tm_wred_profile_add(uint8_t port_id, +int rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error) @@ -167,7 +167,7 @@ int rte_tm_wred_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_wred_profile_delete(uint8_t port_id, +int rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error) { @@ -177,7 +177,7 @@ int rte_tm_wred_profile_delete(uint8_t port_id, } /* Add/update shared WRED context */ -int rte_tm_shared_wred_context_add_update(uint8_t port_id, +int rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -188,7 +188,7 @@ int rte_tm_shared_wred_context_add_update(uint8_t port_id, } /* Delete shared WRED context */ -int rte_tm_shared_wred_context_delete(uint8_t port_id, +int rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error) { @@ -198,7 +198,7 @@ int rte_tm_shared_wred_context_delete(uint8_t port_id, } /* Add shaper profile */ -int rte_tm_shaper_profile_add(uint8_t port_id, +int rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error) @@ -209,7 +209,7 @@ int rte_tm_shaper_profile_add(uint8_t port_id, } /* Delete WRED profile */ -int rte_tm_shaper_profile_delete(uint8_t port_id, +int rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error) { @@ -219,7 +219,7 @@ int rte_tm_shaper_profile_delete(uint8_t port_id, } /* Add shared shaper */ -int rte_tm_shared_shaper_add_update(uint8_t port_id, +int rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -230,7 +230,7 @@ int rte_tm_shared_shaper_add_update(uint8_t port_id, } /* Delete shared shaper */ -int rte_tm_shared_shaper_delete(uint8_t port_id, +int rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error) { @@ -240,7 +240,7 @@ int rte_tm_shared_shaper_delete(uint8_t port_id, } /* Add node to port traffic manager hierarchy */ -int rte_tm_node_add(uint8_t port_id, +int rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -256,7 +256,7 @@ int rte_tm_node_add(uint8_t port_id, } /* Delete node from traffic manager hierarchy */ -int rte_tm_node_delete(uint8_t port_id, +int rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -266,7 +266,7 @@ int rte_tm_node_delete(uint8_t port_id, } /* Suspend node */ -int rte_tm_node_suspend(uint8_t port_id, +int rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -276,7 +276,7 @@ int rte_tm_node_suspend(uint8_t port_id, } /* Resume node */ -int rte_tm_node_resume(uint8_t port_id, +int rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error) { @@ -286,7 +286,7 @@ int rte_tm_node_resume(uint8_t port_id, } /* Commit the initial port traffic manager hierarchy */ -int rte_tm_hierarchy_commit(uint8_t port_id, +int rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error) { @@ -296,7 +296,7 @@ int rte_tm_hierarchy_commit(uint8_t port_id, } /* Update node parent */ -int rte_tm_node_parent_update(uint8_t port_id, +int rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -309,7 +309,7 @@ int rte_tm_node_parent_update(uint8_t port_id, } /* Update node private shaper */ -int rte_tm_node_shaper_update(uint8_t port_id, +int rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error) @@ -320,7 +320,7 @@ int rte_tm_node_shaper_update(uint8_t port_id, } /* Update node shared shapers */ -int rte_tm_node_shared_shaper_update(uint8_t port_id, +int rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -332,7 +332,7 @@ int rte_tm_node_shared_shaper_update(uint8_t port_id, } /* Update node stats */ -int rte_tm_node_stats_update(uint8_t port_id, +int rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error) @@ -343,7 +343,7 @@ int rte_tm_node_stats_update(uint8_t port_id, } /* Update WFQ weight mode */ -int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +int rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -355,7 +355,7 @@ int rte_tm_node_wfq_weight_mode_update(uint8_t port_id, } /* Update node congestion management mode */ -int rte_tm_node_cman_update(uint8_t port_id, +int rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error) @@ -366,7 +366,7 @@ int rte_tm_node_cman_update(uint8_t port_id, } /* Update node private WRED context */ -int rte_tm_node_wred_context_update(uint8_t port_id, +int rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error) @@ -377,7 +377,7 @@ int rte_tm_node_wred_context_update(uint8_t port_id, } /* Update node shared WRED context */ -int rte_tm_node_shared_wred_context_update(uint8_t port_id, +int rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -389,7 +389,7 @@ int rte_tm_node_shared_wred_context_update(uint8_t port_id, } /* Read and/or clear stats counters for specific node */ -int rte_tm_node_stats_read(uint8_t port_id, +int rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -402,7 +402,7 @@ int rte_tm_node_stats_read(uint8_t port_id, } /* Packet marking - VLAN DEI */ -int rte_tm_mark_vlan_dei(uint8_t port_id, +int rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -414,7 +414,7 @@ int rte_tm_mark_vlan_dei(uint8_t port_id, } /* Packet marking - IPv4/IPv6 ECN */ -int rte_tm_mark_ip_ecn(uint8_t port_id, +int rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -426,7 +426,7 @@ int rte_tm_mark_ip_ecn(uint8_t port_id, } /* Packet marking - IPv4/IPv6 DSCP */ -int rte_tm_mark_ip_dscp(uint8_t port_id, +int rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm.h b/lib/librte_ether/rte_tm.h index ebbfa1eec..2b25a8715 100644 --- a/lib/librte_ether/rte_tm.h +++ b/lib/librte_ether/rte_tm.h @@ -1040,7 +1040,7 @@ struct rte_tm_error { * 0 on success, non-zero error code otherwise. */ int -rte_tm_get_number_of_leaf_nodes(uint8_t port_id, +rte_tm_get_number_of_leaf_nodes(uint16_t port_id, uint32_t *n_leaf_nodes, struct rte_tm_error *error); @@ -1064,7 +1064,7 @@ rte_tm_get_number_of_leaf_nodes(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_type_get(uint8_t port_id, +rte_tm_node_type_get(uint16_t port_id, uint32_t node_id, int *is_leaf, struct rte_tm_error *error); @@ -1082,7 +1082,7 @@ rte_tm_node_type_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_capabilities_get(uint8_t port_id, +rte_tm_capabilities_get(uint16_t port_id, struct rte_tm_capabilities *cap, struct rte_tm_error *error); @@ -1102,7 +1102,7 @@ rte_tm_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_level_capabilities_get(uint8_t port_id, +rte_tm_level_capabilities_get(uint16_t port_id, uint32_t level_id, struct rte_tm_level_capabilities *cap, struct rte_tm_error *error); @@ -1122,7 +1122,7 @@ rte_tm_level_capabilities_get(uint8_t port_id, * 0 on success, non-zero error code otherwise. */ int -rte_tm_node_capabilities_get(uint8_t port_id, +rte_tm_node_capabilities_get(uint16_t port_id, uint32_t node_id, struct rte_tm_node_capabilities *cap, struct rte_tm_error *error); @@ -1147,7 +1147,7 @@ rte_tm_node_capabilities_get(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_add(uint8_t port_id, +rte_tm_wred_profile_add(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_wred_params *profile, struct rte_tm_error *error); @@ -1170,7 +1170,7 @@ rte_tm_wred_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_n_max */ int -rte_tm_wred_profile_delete(uint8_t port_id, +rte_tm_wred_profile_delete(uint16_t port_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1201,7 +1201,7 @@ rte_tm_wred_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_add_update(uint8_t port_id, +rte_tm_shared_wred_context_add_update(uint16_t port_id, uint32_t shared_wred_context_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1225,7 +1225,7 @@ rte_tm_shared_wred_context_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_shared_wred_context_delete(uint8_t port_id, +rte_tm_shared_wred_context_delete(uint16_t port_id, uint32_t shared_wred_context_id, struct rte_tm_error *error); @@ -1249,7 +1249,7 @@ rte_tm_shared_wred_context_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_add(uint8_t port_id, +rte_tm_shaper_profile_add(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_shaper_params *profile, struct rte_tm_error *error); @@ -1272,7 +1272,7 @@ rte_tm_shaper_profile_add(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_n_max */ int -rte_tm_shaper_profile_delete(uint8_t port_id, +rte_tm_shaper_profile_delete(uint16_t port_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1301,7 +1301,7 @@ rte_tm_shaper_profile_delete(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_add_update(uint8_t port_id, +rte_tm_shared_shaper_add_update(uint16_t port_id, uint32_t shared_shaper_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1324,7 +1324,7 @@ rte_tm_shared_shaper_add_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_shared_shaper_delete(uint8_t port_id, +rte_tm_shared_shaper_delete(uint16_t port_id, uint32_t shared_shaper_id, struct rte_tm_error *error); @@ -1392,7 +1392,7 @@ rte_tm_shared_shaper_delete(uint8_t port_id, * @see struct rte_tm_capabilities */ int -rte_tm_node_add(uint8_t port_id, +rte_tm_node_add(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1425,7 +1425,7 @@ rte_tm_node_add(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_ADD_DELETE */ int -rte_tm_node_delete(uint8_t port_id, +rte_tm_node_delete(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1449,7 +1449,7 @@ rte_tm_node_delete(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_suspend(uint8_t port_id, +rte_tm_node_suspend(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1472,7 +1472,7 @@ rte_tm_node_suspend(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_SUSPEND_RESUME */ int -rte_tm_node_resume(uint8_t port_id, +rte_tm_node_resume(uint16_t port_id, uint32_t node_id, struct rte_tm_error *error); @@ -1513,7 +1513,7 @@ rte_tm_node_resume(uint8_t port_id, * @see rte_tm_node_delete() */ int -rte_tm_hierarchy_commit(uint8_t port_id, +rte_tm_hierarchy_commit(uint16_t port_id, int clear_on_fail, struct rte_tm_error *error); @@ -1549,7 +1549,7 @@ rte_tm_hierarchy_commit(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_PARENT_CHANGE_LEVEL */ int -rte_tm_node_parent_update(uint8_t port_id, +rte_tm_node_parent_update(uint16_t port_id, uint32_t node_id, uint32_t parent_node_id, uint32_t priority, @@ -1578,7 +1578,7 @@ rte_tm_node_parent_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_private_n_max */ int -rte_tm_node_shaper_update(uint8_t port_id, +rte_tm_node_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shaper_profile_id, struct rte_tm_error *error); @@ -1605,7 +1605,7 @@ rte_tm_node_shaper_update(uint8_t port_id, * @see struct rte_tm_capabilities::shaper_shared_n_max */ int -rte_tm_node_shared_shaper_update(uint8_t port_id, +rte_tm_node_shared_shaper_update(uint16_t port_id, uint32_t node_id, uint32_t shared_shaper_id, int add, @@ -1632,7 +1632,7 @@ rte_tm_node_shared_shaper_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_STATS */ int -rte_tm_node_stats_update(uint8_t port_id, +rte_tm_node_stats_update(uint16_t port_id, uint32_t node_id, uint64_t stats_mask, struct rte_tm_error *error); @@ -1660,7 +1660,7 @@ rte_tm_node_stats_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_N_SP_PRIORITIES */ int -rte_tm_node_wfq_weight_mode_update(uint8_t port_id, +rte_tm_node_wfq_weight_mode_update(uint16_t port_id, uint32_t node_id, int *wfq_weight_mode, uint32_t n_sp_priorities, @@ -1683,7 +1683,7 @@ rte_tm_node_wfq_weight_mode_update(uint8_t port_id, * @see RTE_TM_UPDATE_NODE_CMAN */ int -rte_tm_node_cman_update(uint8_t port_id, +rte_tm_node_cman_update(uint16_t port_id, uint32_t node_id, enum rte_tm_cman_mode cman, struct rte_tm_error *error); @@ -1707,7 +1707,7 @@ rte_tm_node_cman_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_private_n_max */ int -rte_tm_node_wred_context_update(uint8_t port_id, +rte_tm_node_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t wred_profile_id, struct rte_tm_error *error); @@ -1732,7 +1732,7 @@ rte_tm_node_wred_context_update(uint8_t port_id, * @see struct rte_tm_capabilities::cman_wred_context_shared_n_max */ int -rte_tm_node_shared_wred_context_update(uint8_t port_id, +rte_tm_node_shared_wred_context_update(uint16_t port_id, uint32_t node_id, uint32_t shared_wred_context_id, int add, @@ -1764,7 +1764,7 @@ rte_tm_node_shared_wred_context_update(uint8_t port_id, * @see enum rte_tm_stats_type */ int -rte_tm_node_stats_read(uint8_t port_id, +rte_tm_node_stats_read(uint16_t port_id, uint32_t node_id, struct rte_tm_node_stats *stats, uint64_t *stats_mask, @@ -1801,7 +1801,7 @@ rte_tm_node_stats_read(uint8_t port_id, * @see struct rte_tm_capabilities::mark_vlan_dei_supported */ int -rte_tm_mark_vlan_dei(uint8_t port_id, +rte_tm_mark_vlan_dei(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1851,7 +1851,7 @@ rte_tm_mark_vlan_dei(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_ecn_sctp_supported */ int -rte_tm_mark_ip_ecn(uint8_t port_id, +rte_tm_mark_ip_ecn(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, @@ -1899,7 +1899,7 @@ rte_tm_mark_ip_ecn(uint8_t port_id, * @see struct rte_tm_capabilities::mark_ip_dscp_supported */ int -rte_tm_mark_ip_dscp(uint8_t port_id, +rte_tm_mark_ip_dscp(uint16_t port_id, int mark_green, int mark_yellow, int mark_red, diff --git a/lib/librte_ether/rte_tm_driver.h b/lib/librte_ether/rte_tm_driver.h index a5b698fe0..b2e8ccf80 100644 --- a/lib/librte_ether/rte_tm_driver.h +++ b/lib/librte_ether/rte_tm_driver.h @@ -357,7 +357,7 @@ rte_tm_error_set(struct rte_tm_error *error, * success, NULL otherwise. */ const struct rte_tm_ops * -rte_tm_ops_get(uint8_t port_id, struct rte_tm_error *error); +rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error); #ifdef __cplusplus } diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h index 37deb4727..87812cd55 100644 --- a/lib/librte_kni/rte_kni.h +++ b/lib/librte_kni/rte_kni.h @@ -63,13 +63,13 @@ struct rte_mbuf; * Structure which has the function pointers for KNI interface. */ struct rte_kni_ops { - uint8_t port_id; /* Port ID */ + uint16_t port_id; /* Port ID */ /* Pointer to function of changing MTU */ - int (*change_mtu)(uint8_t port_id, unsigned new_mtu); + int (*change_mtu)(uint16_t port_id, unsigned int new_mtu); /* Pointer to function of configuring network interface */ - int (*config_network_if)(uint8_t port_id, uint8_t if_up); + int (*config_network_if)(uint16_t port_id, uint8_t if_up); }; /** diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c index ce029a12c..d6ad13c4e 100644 --- a/lib/librte_latencystats/rte_latencystats.c +++ b/lib/librte_latencystats/rte_latencystats.c @@ -135,7 +135,7 @@ rte_latencystats_fill_values(struct rte_metric_value *values) } static uint16_t -add_time_stamps(uint8_t pid __rte_unused, +add_time_stamps(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -165,7 +165,7 @@ add_time_stamps(uint8_t pid __rte_unused, } static uint16_t -calc_latency(uint8_t pid __rte_unused, +calc_latency(uint16_t pid __rte_unused, uint16_t qid __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, @@ -226,10 +226,10 @@ rte_latencystats_init(uint64_t app_samp_intvl, rte_latency_stats_flow_type_fn user_cb) { unsigned int i; - uint8_t pid; + uint16_t pid; uint16_t qid; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const char *ptr_strings[NUM_LATENCY_STATS] = {0}; const struct rte_memzone *mz = NULL; const unsigned int flags = 0; @@ -290,11 +290,11 @@ rte_latencystats_init(uint64_t app_samp_intvl, int rte_latencystats_uninit(void) { - uint8_t pid; + uint16_t pid; uint16_t qid; int ret = 0; struct rxtx_cbs *cbs = NULL; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); /** De register Rx/Tx callbacks */ for (pid = 0; pid < nb_ports; pid++) { diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile index 1c03bcbb7..6b21c62e5 100644 --- a/lib/librte_pdump/Makefile +++ b/lib/librte_pdump/Makefile @@ -40,7 +40,7 @@ LDLIBS += -lpthread EXPORT_MAP := rte_pdump_version.map -LIBABIVER := 1 +LIBABIVER := 2 # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) := rte_pdump.c diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index 729e79a36..e6182d35c 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -207,7 +207,7 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) } static uint16_t -pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_params) @@ -217,7 +217,7 @@ pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static uint16_t -pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, +pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params) { pdump_copy(pkts, nb_pkts, user_params); @@ -225,7 +225,7 @@ pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } static int -pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -279,7 +279,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, } static int -pdump_regitser_tx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue, +pdump_regitser_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -337,7 +337,7 @@ static int set_pdump_rxtx_cbs(struct pdump_request *p) { uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue; - uint8_t port; + uint16_t port; int ret = 0; uint32_t flags; uint16_t operation; @@ -764,7 +764,7 @@ pdump_validate_flags(uint32_t flags) } static int -pdump_validate_port(uint8_t port, char *name) +pdump_validate_port(uint16_t port, char *name) { int ret = 0; @@ -828,7 +828,7 @@ pdump_prepare_client_request(char *device, uint16_t queue, } int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter) @@ -876,7 +876,7 @@ rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue, } int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags) +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags) { int ret = 0; char name[DEVICE_ID_SIZE]; diff --git a/lib/librte_pdump/rte_pdump.h b/lib/librte_pdump/rte_pdump.h index ba6e39b09..4ec0a106f 100644 --- a/lib/librte_pdump/rte_pdump.h +++ b/lib/librte_pdump/rte_pdump.h @@ -113,7 +113,7 @@ rte_pdump_uninit(void); */ int -rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, +rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags, struct rte_ring *ring, struct rte_mempool *mp, void *filter); @@ -136,7 +136,7 @@ rte_pdump_enable(uint8_t port, uint16_t queue, uint32_t flags, */ int -rte_pdump_disable(uint8_t port, uint16_t queue, uint32_t flags); +rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags); /** * Enables packet capturing on given device id and queue. diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c index d5c5fba55..4ed10f276 100644 --- a/lib/librte_port/rte_port_ethdev.c +++ b/lib/librte_port/rte_port_ethdev.c @@ -60,7 +60,7 @@ struct rte_port_ethdev_reader { struct rte_port_in_stats stats; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -156,7 +156,7 @@ struct rte_port_ethdev_writer { uint16_t tx_buf_count; uint64_t bsz_mask; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * @@ -337,7 +337,7 @@ struct rte_port_ethdev_writer_nodrop { uint64_t bsz_mask; uint64_t n_retries; uint16_t queue_id; - uint8_t port_id; + uint16_t port_id; }; static void * diff --git a/lib/librte_port/rte_port_ethdev.h b/lib/librte_port/rte_port_ethdev.h index 201a79e41..f5ed9ab2d 100644 --- a/lib/librte_port/rte_port_ethdev.h +++ b/lib/librte_port/rte_port_ethdev.h @@ -54,7 +54,7 @@ extern "C" { /** ethdev_reader port parameters */ struct rte_port_ethdev_reader_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -66,7 +66,7 @@ extern struct rte_port_in_ops rte_port_ethdev_reader_ops; /** ethdev_writer port parameters */ struct rte_port_ethdev_writer_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; @@ -82,7 +82,7 @@ extern struct rte_port_out_ops rte_port_ethdev_writer_ops; /** ethdev_writer_nodrop port parameters */ struct rte_port_ethdev_writer_nodrop_params { /** NIC RX port ID */ - uint8_t port_id; + uint16_t port_id; /** NIC RX queue ID */ uint16_t queue_id; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v6 3/5] examples: increase port_id range 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 2/5] ethdev: increase port_id range Zhiyong Yang @ 2017-09-29 7:17 ` Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 4/5] test: " Zhiyong Yang ` (2 subsequent siblings) 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-29 7:17 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, Zhiyong Yang Modify port_id related code in examples accordingly since port_id definition in lib and pmd changes. Fix some original checkpatch issues and remove some unnecessary cast at the same time. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- examples/bond/main.c | 16 +-- examples/distributor/main.c | 26 ++-- examples/exception_path/main.c | 35 +++-- examples/ip_fragmentation/main.c | 33 ++--- examples/ip_pipeline/init.c | 4 +- examples/ip_reassembly/main.c | 34 ++--- examples/ipv4_multicast/main.c | 30 ++--- examples/kni/main.c | 30 +++-- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-jobstats/main.c | 34 ++--- examples/l2fwd-keepalive/main.c | 50 +++---- examples/l2fwd/main.c | 47 +++---- examples/l3fwd-acl/main.c | 9 +- examples/l3fwd-power/main.c | 60 +++++---- examples/l3fwd-vf/main.c | 50 +++---- examples/l3fwd/l3fwd.h | 10 +- examples/l3fwd/l3fwd_common.h | 2 +- examples/l3fwd/l3fwd_em.c | 2 +- examples/l3fwd/l3fwd_em.h | 6 +- examples/l3fwd/l3fwd_em_hlm.h | 14 +- examples/l3fwd/l3fwd_lpm.c | 15 ++- examples/l3fwd/l3fwd_lpm.h | 4 +- examples/l3fwd/l3fwd_lpm_neon.h | 4 +- examples/l3fwd/l3fwd_lpm_sse.h | 4 +- examples/l3fwd/main.c | 30 ++--- examples/link_status_interrupt/main.c | 9 +- examples/load_balancer/config.c | 14 +- examples/load_balancer/init.c | 34 +++-- examples/load_balancer/main.h | 11 +- examples/load_balancer/runtime.c | 12 +- .../client_server_mp/mp_client/client.c | 17 +-- .../client_server_mp/mp_server/args.c | 4 +- .../client_server_mp/mp_server/args.h | 2 +- .../client_server_mp/mp_server/init.c | 11 +- .../client_server_mp/mp_server/main.c | 2 +- .../multi_process/client_server_mp/shared/common.h | 4 +- examples/multi_process/l2fwd_fork/main.c | 23 ++-- examples/netmap_compat/lib/compat_netmap.c | 52 ++++---- examples/netmap_compat/lib/compat_netmap.h | 2 +- examples/packet_ordering/main.c | 19 +-- examples/performance-thread/l3fwd-thread/main.c | 143 +++++++++++---------- examples/ptpclient/ptpclient.c | 4 +- examples/qos_sched/args.c | 12 +- examples/qos_sched/init.c | 31 +++-- examples/qos_sched/main.c | 14 +- examples/qos_sched/main.h | 24 ++-- examples/qos_sched/stats.c | 16 ++- examples/quota_watermark/qw/init.c | 4 +- examples/quota_watermark/qw/main.c | 10 +- examples/rxtx_callbacks/main.c | 8 +- examples/server_node_efd/server/main.c | 2 +- examples/server_node_efd/shared/common.h | 4 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 10 +- 54 files changed, 551 insertions(+), 520 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index 2d019d433..cb55552c2 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -141,10 +141,10 @@ addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], \ addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]) -uint8_t slaves[RTE_MAX_ETHPORTS]; -uint8_t slaves_count; +uint16_t slaves[RTE_MAX_ETHPORTS]; +uint16_t slaves_count; -static uint8_t BOND_PORT = 0xff; +static uint16_t BOND_PORT = 0xffff; static struct rte_mempool *mbuf_pool; @@ -171,7 +171,7 @@ static struct rte_eth_conf port_conf = { }; static void -slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) +slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) { int retval; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; @@ -215,7 +215,7 @@ slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) struct ether_addr addr; rte_eth_macaddr_get(portid, &addr); - printf("Port %u MAC: ", (unsigned)portid); + printf("Port %u MAC: ", portid); PRINT_MAC(addr); printf("\n"); } @@ -234,7 +234,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "Faled to create bond port\n"); - BOND_PORT = (uint8_t)retval; + BOND_PORT = retval; retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf); if (retval != 0) @@ -675,10 +675,10 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result, struct cmdline *cl, __attribute__((unused)) void *data) { - uint8_t slaves[16] = {0}; + uint16_t slaves[16] = {0}; uint8_t len = 16; struct ether_addr addr; - uint8_t i = 0; + uint16_t i = 0; while (i < slaves_count) { rte_eth_macaddr_get(i, &addr); diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 87603d039..108efc8a6 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -132,7 +132,7 @@ static void print_stats(void); * 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_conf port_conf = port_conf_default; const uint16_t rxRings = 1, txRings = rte_lcore_count() - 1; @@ -175,13 +175,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) struct rte_eth_link link; rte_eth_link_get_nowait(port, &link); while (!link.link_status) { - printf("Waiting for Link up on port %"PRIu8"\n", port); + printf("Waiting for Link up on port %"PRIu16"\n", port); sleep(1); rte_eth_link_get_nowait(port, &link); } if (!link.link_status) { - printf("Link down on port %"PRIu8"\n", port); + printf("Link down on port %"PRIu16"\n", port); return 0; } @@ -189,7 +189,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -210,7 +210,7 @@ struct lcore_params { static int lcore_rx(struct lcore_params *p) { - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); uint8_t port; struct rte_mbuf *bufs[BURST_SIZE*2]; @@ -312,9 +312,9 @@ flush_one_port(struct output_buffer *outbuf, uint8_t outp) } static inline void -flush_all_ports(struct output_buffer *tx_buffers, uint8_t nb_ports) +flush_all_ports(struct output_buffer *tx_buffers, uint16_t nb_ports) { - uint8_t outp; + uint16_t outp; for (outp = 0; outp < nb_ports; outp++) { /* skip ports that are not enabled */ @@ -384,9 +384,9 @@ static int lcore_tx(struct rte_ring *in_r) { static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS]; - const uint8_t nb_ports = rte_eth_dev_count(); + const uint16_t nb_ports = rte_eth_dev_count(); const int socket_id = rte_socket_id(); - uint8_t port; + uint16_t port; for (port = 0; port < nb_ports; port++) { /* skip ports that are not enabled */ @@ -668,8 +668,8 @@ main(int argc, char *argv[]) struct rte_ring *rx_dist_ring; unsigned lcore_id, worker_id = 0; unsigned nb_ports; - uint8_t portid; - uint8_t nb_ports_available; + uint16_t portid; + uint16_t nb_ports_available; uint64_t t, freq; /* catch ctrl-c so we can print on exit */ @@ -719,10 +719,10 @@ main(int argc, char *argv[]) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) portid); + printf("Initializing port %u... done\n", portid); if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", + rte_exit(EXIT_FAILURE, "Cannot initialize port %u\n", portid); } diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index e551e6d11..c85a86c10 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -135,7 +135,7 @@ static uint64_t input_cores_mask = 0; static uint64_t output_cores_mask = 0; /* Array storing port_id that is associated with each lcore */ -static uint8_t port_ids[RTE_MAX_LCORE]; +static uint16_t port_ids[RTE_MAX_LCORE]; /* Structure type for recording lcore-specific stats */ struct stats { @@ -360,8 +360,8 @@ static void setup_port_lcore_affinities(void) { unsigned long i; - uint8_t tx_port = 0; - uint8_t rx_port = 0; + uint16_t tx_port = 0; + uint16_t rx_port = 0; /* Setup port_ids[] array, and check masks were ok */ RTE_LCORE_FOREACH(i) { @@ -451,17 +451,16 @@ init_port(uint8_t port) uint16_t nb_txd = NB_TXD; /* Initialise device and RX/TX queues */ - PRINT_INFO("Initialising port %u ...", (unsigned)port); + PRINT_INFO("Initialising port %u ...", port); fflush(stdout); ret = rte_eth_dev_configure(port, 1, 1, &port_conf); if (ret < 0) - FATAL_ERROR("Could not configure port%u (%d)", - (unsigned)port, ret); + FATAL_ERROR("Could not configure port%u (%d)", port, ret); ret = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd); if (ret < 0) FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, rte_eth_dev_socket_id(port), @@ -469,29 +468,30 @@ init_port(uint8_t port) pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_tx_queue_setup(port, 0, nb_txd, rte_eth_dev_socket_id(port), NULL); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", - (unsigned)port, ret); + port, ret); ret = rte_eth_dev_start(port); if (ret < 0) - FATAL_ERROR("Could not start port%u (%d)", (unsigned)port, ret); + FATAL_ERROR("Could not start port%u (%d)", port, ret); rte_eth_promiscuous_enable(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"); @@ -506,14 +506,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 */ @@ -546,7 +545,7 @@ main(int argc, char** argv) { int ret; unsigned i,high_port; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; /* Associate signal_hanlder function with USR signals */ signal(SIGUSR1, signal_handler); diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 8c0e17911..de252760f 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -154,7 +154,7 @@ struct rx_queue { struct rte_mempool *indirect_pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; #define MAX_RX_QUEUE_PER_LCORE 16 @@ -240,7 +240,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -261,11 +261,12 @@ send_burst(struct lcore_queue_conf *qconf, uint16_t n, uint8_t port) static inline void l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, - uint8_t queueid, uint8_t port_in) + uint8_t queueid, uint16_t port_in) { struct rx_queue *rxq; uint32_t i, len, next_hop; - uint8_t port_out, ipv6; + uint8_t ipv6; + uint16_t port_out; int32_t len2; ipv6 = 0; @@ -403,7 +404,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -423,7 +424,7 @@ main_loop(__attribute__((unused)) void *dummy) portid = qconf->rx_queue_list[i].portid; RTE_LOG(INFO, IP_FRAG, " -- lcoreid=%u portid=%d\n", lcore_id, - (int) portid); + portid); } while (1) { @@ -600,11 +601,12 @@ print_ethaddr(const char *name, 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"); @@ -619,14 +621,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 */ @@ -708,7 +709,7 @@ parse_ptype(struct rte_mbuf *m) /* callback function to detect packet type for a queue of a port */ static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -876,7 +877,7 @@ main(int argc, char **argv) uint16_t queueid = 0; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1035,7 +1036,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - 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/ip_pipeline/init.c b/examples/ip_pipeline/init.c index 7cde49a47..ca59baf40 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -1236,7 +1236,7 @@ app_init_tap(struct app_params *app) #ifdef RTE_LIBRTE_KNI 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; if (port_id >= rte_eth_dev_count()) @@ -1250,7 +1250,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) { } static int -kni_change_mtu(uint8_t port_id, unsigned new_mtu) { +kni_change_mtu(uint16_t port_id, unsigned int new_mtu) { int ret; if (port_id >= rte_eth_dev_count()) diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index e62636cb4..cadf4c5bd 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -166,7 +166,7 @@ struct rx_queue { struct rte_mempool *pool; struct rte_lpm *lpm; struct rte_lpm6 *lpm6; - uint8_t portid; + uint16_t portid; }; struct tx_lcore_stat { @@ -277,7 +277,7 @@ static struct rte_lpm6 *socket_lpm6[RTE_MAX_NUMA_NODES]; * send burst of packets on an output interface. */ static inline uint32_t -send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint16_t port) { uint32_t fill, len, k, n; struct mbuf_table *txmb; @@ -307,7 +307,7 @@ send_burst(struct lcore_queue_conf *qconf, uint32_t thresh, uint8_t port) /* 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 fill, lcore_id, len; struct lcore_queue_conf *qconf; @@ -337,7 +337,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) } static inline void -reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, +reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct lcore_queue_conf *qconf, uint64_t tms) { struct ether_hdr *eth_hdr; @@ -346,7 +346,7 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue, struct rx_queue *rxq; void *d_addr_bytes; uint32_t next_hop; - uint8_t dst_port; + uint16_t dst_port; rxq = &qconf->rx_queue_list[queue]; @@ -454,7 +454,7 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t diff_tsc, cur_tsc, prev_tsc; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -473,7 +473,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].portid; - RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%hhu\n", lcore_id, + RTE_LOG(INFO, IP_RSMBL, " -- lcoreid=%u portid=%u\n", lcore_id, portid); } @@ -732,11 +732,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"); @@ -751,14 +752,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 */ @@ -987,7 +987,7 @@ queue_dump_stat(void) qconf = &lcore_queue_conf[lcore]; for (i = 0; i < qconf->n_rx_queue; i++) { - fprintf(stdout, " -- lcoreid=%u portid=%hhu " + fprintf(stdout, " -- lcoreid=%u portid=%u " "frag tbl stat:\n", lcore, qconf->rx_queue_list[i].portid); rte_ip_frag_table_statistics_dump(stdout, @@ -1024,7 +1024,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1177,7 +1177,7 @@ main(int argc, char **argv) if (init_routing_table() < 0) rte_exit(EXIT_FAILURE, "Cannot init routing table\n"); - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); signal(SIGUSR1, signal_handler); signal(SIGTERM, signal_handler); diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 9a13d3530..1b6feae3e 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -116,7 +116,7 @@ static struct ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; -static uint8_t nb_ports = 0; +static uint16_t nb_ports; static int rx_queue_per_lcore = 1; @@ -195,7 +195,7 @@ static struct mcast_group_params mcast_group_table[] = { /* Send burst of packets on an output interface */ static void -send_burst(struct lcore_queue_conf *qconf, uint8_t port) +send_burst(struct lcore_queue_conf *qconf, uint16_t port) { struct rte_mbuf **m_table; uint16_t n, queueid; @@ -312,7 +312,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) */ static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, - struct lcore_queue_conf *qconf, uint8_t port) + struct lcore_queue_conf *qconf, uint16_t port) { struct ether_hdr *ethdr; uint16_t len; @@ -343,7 +343,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) struct ipv4_hdr *iphdr; uint32_t dest_addr, port_mask, port_num, use_clone; int32_t hash; - uint8_t port; + uint16_t port; union { uint64_t as_int; struct ether_addr as_addr; @@ -407,7 +407,7 @@ static inline void send_timeout_burst(struct lcore_queue_conf *qconf) { uint64_t cur_tsc; - uint8_t portid; + uint16_t portid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; cur_tsc = rte_rdtsc(); @@ -428,7 +428,7 @@ main_loop(__rte_unused void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; unsigned lcore_id; int i, j, nb_rx; - uint8_t portid; + uint16_t portid; struct lcore_queue_conf *qconf; lcore_id = rte_lcore_id(); @@ -448,7 +448,7 @@ main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i]; RTE_LOG(INFO, IPv4_MULTICAST, " -- lcoreid=%u portid=%d\n", - lcore_id, (int) portid); + lcore_id, portid); } while (1) { @@ -610,11 +610,12 @@ init_mcast_hash(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -629,14 +630,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 */ @@ -673,7 +673,7 @@ main(int argc, char **argv) uint16_t queueid; unsigned lcore_id = 0, rx_lcore_id = 0; uint32_t n_tx_queue, nb_lcores; - uint8_t portid; + uint16_t portid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/kni/main.c b/examples/kni/main.c index e3bc2fb78..c2c9e04d3 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -110,7 +110,7 @@ * Structure of port parameters */ struct kni_port_params { - uint8_t port_id;/* Port ID */ + uint16_t port_id;/* Port ID */ unsigned lcore_rx; /* lcore ID for RX */ unsigned lcore_tx; /* lcore ID for TX */ uint32_t nb_lcore_k; /* Number of lcores for KNI multi kernel threads */ @@ -162,8 +162,8 @@ struct kni_interface_stats { /* kni device statistics array */ static struct kni_interface_stats kni_stats[RTE_MAX_ETHPORTS]; -static int kni_change_mtu(uint8_t port_id, unsigned new_mtu); -static int kni_config_network_interface(uint8_t port_id, uint8_t if_up); +static int kni_change_mtu(uint16_t port_id, unsigned int new_mtu); +static int kni_config_network_interface(uint16_t port_id, uint8_t if_up); static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); @@ -171,7 +171,7 @@ static rte_atomic32_t kni_stop = RTE_ATOMIC32_INIT(0); static void print_stats(void) { - uint8_t i; + uint16_t i; printf("\n**KNI example application statistics**\n" "====== ============== ============ ============ ============ ============\n" @@ -238,7 +238,8 @@ kni_burst_free_mbufs(struct rte_mbuf **pkts, unsigned num) static void kni_ingress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_rx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -274,7 +275,8 @@ kni_ingress(struct kni_port_params *p) static void kni_egress(struct kni_port_params *p) { - uint8_t i, port_id; + uint8_t i; + uint16_t port_id; unsigned nb_tx, num; uint32_t nb_kni; struct rte_mbuf *pkts_burst[PKT_BURST_SZ]; @@ -416,7 +418,7 @@ parse_config(const char *arg) 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)); while (((p = strchr(p0, '(')) != NULL) && @@ -445,7 +447,7 @@ parse_config(const char *arg) } i = 0; - port_id = (uint8_t)int_fld[i++]; + port_id = int_fld[i++]; if (port_id >= RTE_MAX_ETHPORTS) { printf("Port ID %d could not exceed the maximum %d\n", port_id, RTE_MAX_ETHPORTS); @@ -698,7 +700,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) /* 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 int new_mtu) { int ret; struct rte_eth_conf conf; @@ -741,7 +743,7 @@ kni_change_mtu(uint8_t port_id, unsigned new_mtu) /* 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; @@ -766,7 +768,7 @@ kni_config_network_interface(uint8_t port_id, uint8_t if_up) } static int -kni_alloc(uint8_t port_id) +kni_alloc(uint16_t port_id) { uint8_t i; struct rte_kni *kni; @@ -790,7 +792,7 @@ kni_alloc(uint8_t port_id) } else snprintf(conf.name, RTE_KNI_NAMESIZE, "vEth%u", port_id); - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; /* * The first KNI device associated to a port @@ -825,7 +827,7 @@ kni_alloc(uint8_t port_id) } static int -kni_free_kni(uint8_t port_id) +kni_free_kni(uint16_t port_id) { uint8_t i; struct kni_port_params **p = kni_port_params_array; @@ -848,7 +850,7 @@ int main(int argc, char** argv) { int ret; - uint8_t nb_sys_ports, port; + uint16_t nb_sys_ports, port; unsigned i; /* Associate signal_hanlder function with USR signals */ diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index c293bd9c9..b10ac896f 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -59,7 +59,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -106,7 +106,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -124,8 +124,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -181,7 +181,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -217,7 +217,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 989362067..9511156d8 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -776,9 +776,9 @@ main(int argc, char **argv) unsigned nb_ports_in_mask = 0; int ret; char name[RTE_JOBSTATS_NAMESIZE]; - uint8_t nb_ports; - uint8_t nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; uint8_t i; /* init EAL */ @@ -861,7 +861,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -870,24 +870,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -899,7 +899,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -907,8 +907,9 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid), NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup:err=%d, port=%u\n", + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -916,7 +917,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -924,21 +925,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done:\n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 83bc542c1..2f543d31d 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -157,7 +157,7 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, __attribute__((unused)) void *ptr_data) { uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -299,7 +299,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -479,11 +479,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"); @@ -498,14 +499,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 */ @@ -560,9 +560,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; struct sigaction signal_handler; @@ -653,7 +653,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; printf("Lcore %u: RX port %u\n", - rx_lcore_id, (unsigned) portid); + rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -662,26 +662,25 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", - (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]); @@ -694,7 +693,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -704,7 +703,7 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -712,7 +711,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -720,21 +719,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: " "%02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 142633584..3bf3b28b1 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -304,7 +304,7 @@ l2fwd_main_loop(void) for (i = 0; i < qconf->n_rx_port; i++) { portid = qconf->rx_port_list[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); port_statistics[portid].rx += nb_rx; @@ -480,11 +480,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"); @@ -503,14 +504,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 */ @@ -553,9 +553,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned lcore_id, rx_lcore_id; unsigned nb_ports_in_mask = 0; @@ -644,7 +644,7 @@ main(int argc, char **argv) qconf->rx_port_list[qconf->n_rx_port] = portid; qconf->n_rx_port++; - printf("Lcore %u: RX port %u\n", rx_lcore_id, (unsigned) portid); + printf("Lcore %u: RX port %u\n", rx_lcore_id, portid); } nb_ports_available = nb_ports; @@ -653,24 +653,24 @@ main(int argc, char **argv) for (portid = 0; portid < nb_ports; portid++) { /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { - printf("Skipping disabled port %u\n", (unsigned) portid); + printf("Skipping disabled port %u\n", portid); nb_ports_available--; continue; } /* init port */ - printf("Initializing port %u... ", (unsigned) portid); + printf("Initializing port %u... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot adjust number of descriptors: err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]); @@ -682,7 +682,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* init one TX queue on each port */ fflush(stdout); @@ -691,7 +691,7 @@ main(int argc, char **argv) NULL); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); /* Initialize TX buffers */ tx_buffer[portid] = rte_zmalloc_socket("tx_buffer", @@ -699,7 +699,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST); @@ -707,21 +707,22 @@ main(int argc, char **argv) rte_eth_tx_buffer_count_callback, &port_statistics[portid].dropped); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) portid); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_dev_start:err=%d, port=%u\n", - ret, (unsigned) portid); + ret, portid); printf("done: \n"); rte_eth_promiscuous_enable(portid); printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", - (unsigned) portid, + portid, l2fwd_ports_eth_addr[portid].addr_bytes[0], l2fwd_ports_eth_addr[portid].addr_bytes[1], l2fwd_ports_eth_addr[portid].addr_bytes[2], diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 8eff4de41..77f83cd6d 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -121,7 +121,7 @@ static int promiscuous_on; /**< Ports set in promiscuous mode off by default. */ static int numa_on = 1; /**< NUMA is enabled by default. */ struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -131,7 +131,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -1358,7 +1358,8 @@ 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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; int socketid; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) @@ -1381,7 +1382,7 @@ 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-power/main.c b/examples/l3fwd-power/main.c index fd442f5ef..8a8f34b50 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -174,7 +174,7 @@ enum freq_scale_hint_t }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; enum freq_scale_hint_t freq_up_hint; uint32_t zero_rx_packet_count; @@ -190,7 +190,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -308,8 +308,8 @@ static lookup_struct_t *ipv6_l3fwd_lookup_struct[NB_SOCKETS]; #define IPV6_L3FWD_NUM_ROUTES \ (sizeof(ipv6_l3fwd_route_array) / sizeof(ipv6_l3fwd_route_array[0])) -static uint8_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; -static uint8_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv4_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; +static uint16_t ipv6_l3fwd_out_if[L3FWD_HASH_ENTRIES] __rte_cache_aligned; #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) @@ -370,7 +370,7 @@ static struct rte_timer power_timers[RTE_MAX_LCORE]; static inline uint32_t power_idle_heuristic(uint32_t zero_rx_packet_count); static inline enum freq_scale_hint_t power_freq_scaleup_heuristic( \ - unsigned lcore_id, uint8_t port_id, uint16_t queue_id); + unsigned int lcore_id, uint16_t port_id, uint16_t queue_id); /* exit signal handler */ static void @@ -523,8 +523,8 @@ print_ipv6_key(struct ipv6_5tuple key) key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t * ipv4_l3fwd_lookup_struct) { struct ipv4_5tuple key; @@ -559,11 +559,11 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, /* 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 -get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { struct ipv6_5tuple key; @@ -599,18 +599,18 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid); } @@ -634,7 +634,7 @@ parse_ptype_one(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) @@ -648,7 +648,7 @@ cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, } static int -add_cb_parse_ptype(uint8_t portid, uint16_t queueid) +add_cb_parse_ptype(uint16_t portid, uint16_t queueid) { printf("Port %d: softly parse packet type info\n", portid); if (rte_eth_add_rx_callback(portid, queueid, cb_parse_ptype, NULL)) @@ -665,7 +665,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *d_addr_bytes; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -758,7 +758,7 @@ power_idle_heuristic(uint32_t zero_rx_packet_count) static inline enum freq_scale_hint_t power_freq_scaleup_heuristic(unsigned lcore_id, - uint8_t port_id, + uint16_t port_id, uint16_t queue_id) { /** @@ -805,7 +805,8 @@ sleep_until_rx_interrupt(int num) { struct rte_epoll_event event[num]; int n, i; - uint8_t port_id, queue_id; + uint16_t port_id; + uint8_t queue_id; void *data; RTE_LOG(INFO, L3FWD_POWER, @@ -832,7 +833,8 @@ static void turn_on_intr(struct lcore_conf *qconf) { int i; struct lcore_rx_queue *rx_queue; - uint8_t port_id, queue_id; + uint8_t queue_id; + uint16_t port_id; for (i = 0; i < qconf->n_rx_queue; ++i) { rx_queue = &(qconf->rx_queue_list[i]); @@ -848,7 +850,8 @@ static void turn_on_intr(struct lcore_conf *qconf) static int event_register(struct lcore_conf *qconf) { struct lcore_rx_queue *rx_queue; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; uint32_t data; int ret; int i; @@ -879,7 +882,8 @@ main_loop(__attribute__((unused)) void *dummy) uint64_t prev_tsc, diff_tsc, cur_tsc; uint64_t prev_tsc_power = 0, cur_tsc_power, diff_tsc_power; int i, j, nb_rx; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct lcore_conf *qconf; struct lcore_rx_queue *rx_queue; enum freq_scale_hint_t lcore_scaleup_hint; @@ -904,7 +908,7 @@ main_loop(__attribute__((unused)) void *dummy) for (i = 0; i < qconf->n_rx_queue; i++) { portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%hhu " + RTE_LOG(INFO, L3FWD_POWER, " -- lcoreid=%u portid=%u " "rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -1541,11 +1545,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; + uint8_t count, all_ports_up, print_flag = 0; + uint16_t portid; struct rte_eth_link link; printf("\nChecking link status"); @@ -1651,7 +1656,8 @@ main(int argc, char **argv) uint64_t hz; uint32_t n_tx_queue, nb_lcores; uint32_t dev_rxq_num, dev_txq_num; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; + uint16_t portid; uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ @@ -1751,7 +1757,7 @@ main(int argc, char **argv) rte_eth_dev_socket_id(portid)); if (qconf->tx_buffer[portid] == NULL) rte_exit(EXIT_FAILURE, "Can't allocate tx buffer for port %u\n", - (unsigned) portid); + portid); rte_eth_tx_buffer_init(qconf->tx_buffer[portid], MAX_PKT_BURST); } diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 34e4a6bef..a84339115 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -155,7 +155,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -165,7 +165,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -300,7 +300,7 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE]; static rte_spinlock_t spinlock_conf[RTE_MAX_ETHPORTS] = {RTE_SPINLOCK_INITIALIZER}; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -324,7 +324,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 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; uint16_t len; @@ -396,8 +396,9 @@ print_key(struct ipv4_5tuple key) (unsigned)key.ip_dst, (unsigned)key.ip_src, key.port_dst, key.port_src, key.proto); } -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint16_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ipv4_5tuple key; struct tcp_hdr *tcp; @@ -430,29 +431,31 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd /* Find destination port */ ret = rte_hash_lookup(l3fwd_lookup_struct, (const void *)&key); - return (uint8_t)((ret < 0)? portid : l3fwd_out_if[ret]); + return ((ret < 0) ? portid : l3fwd_out_if[ret]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_dst_port(struct ipv4_hdr *ipv4_hdr, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +static inline uint32_t +get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm_lookup(l3fwd_lookup_struct, - rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? - next_hop : portid); + return ((rte_lpm_lookup(l3fwd_lookup_struct, + rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0) ? + next_hop : portid); } #endif static inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid, lookup_struct_t * l3fwd_lookup_struct) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, + lookup_struct_t *l3fwd_lookup_struct) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *tmp; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -496,7 +499,8 @@ main_loop(__attribute__((unused)) void *dummy) unsigned lcore_id; uint64_t prev_tsc, diff_tsc, cur_tsc; int i, j, 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; @@ -516,8 +520,8 @@ 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", lcore_id, - portid, queueid); + RTE_LOG(INFO, L3FWD, " --lcoreid=%u portid=%u rxqueueid=%hhu\n", + lcore_id, portid, queueid); } while (1) { @@ -624,7 +628,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; @@ -676,8 +680,8 @@ print_usage(const char *prgname) static void signal_handler(int signum) { - uint8_t portid; - uint8_t nb_ports = rte_eth_dev_count(); + uint16_t portid; + uint16_t nb_ports = rte_eth_dev_count(); /* When we receive a SIGINT signal */ if (signum == SIGINT) { @@ -749,7 +753,7 @@ parse_config(const char *q_arg) nb_lcore_params); return -1; } - lcore_params_array[nb_lcore_params].port_id = (uint8_t)int_fld[FLD_PORT]; + lcore_params_array[nb_lcore_params].port_id = int_fld[FLD_PORT]; lcore_params_array[nb_lcore_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; lcore_params_array[nb_lcore_params].lcore_id = (uint8_t)int_fld[FLD_LCORE]; ++nb_lcore_params; @@ -953,11 +957,11 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t nb_lcores; uint16_t n_tx_queue; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; signal(SIGINT, signal_handler); /* init EAL */ diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index 011ba148b..4bb15943c 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -83,7 +83,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -117,7 +117,7 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE]; /* Send burst of packets on an output interface */ static inline int -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; int ret; @@ -139,7 +139,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 int send_single_packet(struct lcore_conf *qconf, - struct rte_mbuf *m, uint8_t port) + struct rte_mbuf *m, uint16_t port) { uint16_t len; @@ -212,11 +212,11 @@ int lpm_check_ptype(int portid); uint16_t -em_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +em_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); uint16_t -lpm_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[], +lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts, void *user_param); int diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h index 2867365d0..7002a43a4 100644 --- a/examples/l3fwd/l3fwd_common.h +++ b/examples/l3fwd/l3fwd_common.h @@ -207,7 +207,7 @@ static const struct { }; static __rte_always_inline void -send_packetsx4(struct lcore_conf *qconf, uint8_t port, struct rte_mbuf *m[], +send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 53d081bd7..df38a1362 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -628,7 +628,7 @@ em_parse_ptype(struct rte_mbuf *m) } uint16_t -em_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h index d509a1fcd..302291d71 100644 --- a/examples/l3fwd/l3fwd_em.h +++ b/examples/l3fwd/l3fwd_em.h @@ -35,12 +35,12 @@ #define __L3FWD_EM_H__ static __rte_always_inline void -l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; uint32_t tcp_or_udp; uint32_t l3_ptypes; @@ -112,7 +112,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint8_t portid, */ static inline void l3fwd_em_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h index 520672d51..9d7afe053 100644 --- a/examples/l3fwd/l3fwd_em_hlm.h +++ b/examples/l3fwd/l3fwd_em_hlm.h @@ -52,7 +52,7 @@ static __rte_always_inline void em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -68,7 +68,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv4_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -79,7 +79,7 @@ em_get_dst_port_ipv4xN(struct lcore_conf *qconf, struct rte_mbuf *m[], static __rte_always_inline void em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], - uint8_t portid, uint16_t dst_port[]) + uint16_t portid, uint16_t dst_port[]) { int i; int32_t ret[EM_HASH_LOOKUP_COUNT]; @@ -95,7 +95,7 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], EM_HASH_LOOKUP_COUNT, ret); for (i = 0; i < EM_HASH_LOOKUP_COUNT; i++) { - dst_port[i] = (uint8_t) ((ret[i] < 0) ? + dst_port[i] = ((ret[i] < 0) ? portid : ipv6_l3fwd_out_if[ret[i]]); if (dst_port[i] >= RTE_MAX_ETHPORTS || @@ -106,9 +106,9 @@ em_get_dst_port_ipv6xN(struct lcore_conf *qconf, struct rte_mbuf *m[], 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; + uint16_t next_hop; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; uint32_t tcp_or_udp; @@ -158,7 +158,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, pos; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index ff1e40355..a809e0649 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -105,7 +105,7 @@ struct rte_lpm *ipv4_l3fwd_lpm_lookup_struct[NB_SOCKETS]; struct rte_lpm6 *ipv6_l3fwd_lpm_lookup_struct[NB_SOCKETS]; static inline uint16_t -lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm *ipv4_l3fwd_lookup_struct = @@ -117,7 +117,7 @@ lpm_get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, void *lookup_struct) } static inline uint16_t -lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) +lpm_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct) { uint32_t next_hop; struct rte_lpm6 *ipv6_l3fwd_lookup_struct = @@ -130,7 +130,7 @@ lpm_get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, void *lookup_struct) static __rte_always_inline uint16_t lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint8_t portid) + uint16_t portid) { struct ipv6_hdr *ipv6_hdr; struct ipv4_hdr *ipv4_hdr; @@ -162,7 +162,7 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, */ static __rte_always_inline uint16_t lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, - uint32_t dst_ipv4, uint8_t portid) + uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -203,7 +203,8 @@ lpm_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; + uint16_t portid; + uint8_t queueid; struct lcore_conf *qconf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US; @@ -225,7 +226,7 @@ lpm_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); } @@ -413,7 +414,7 @@ lpm_parse_ptype(struct rte_mbuf *m) } uint16_t -lpm_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused, +lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused, struct rte_mbuf *pkts[], uint16_t nb_pkts, uint16_t max_pkts __rte_unused, void *user_param __rte_unused) diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h index 55c3e8329..53b7fc805 100644 --- a/examples/l3fwd/l3fwd_lpm.h +++ b/examples/l3fwd/l3fwd_lpm.h @@ -35,7 +35,7 @@ #define __L3FWD_LPM_H__ static __rte_always_inline void -l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, +l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { struct ether_hdr *eth_hdr; @@ -104,7 +104,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint8_t portid, static inline void l3fwd_lpm_no_opt_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 j; diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h index baedbfe84..85f314d1e 100644 --- a/examples/l3fwd/l3fwd_lpm_neon.h +++ b/examples/l3fwd/l3fwd_lpm_neon.h @@ -82,7 +82,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, int32x4_t dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -115,7 +115,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 = 0, j = 0; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h index 4e294c844..d474396ed 100644 --- a/examples/l3fwd/l3fwd_lpm_sse.h +++ b/examples/l3fwd/l3fwd_lpm_sse.h @@ -79,7 +79,7 @@ static inline void processx4_step2(const struct lcore_conf *qconf, __m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -112,7 +112,7 @@ processx4_step2(const struct lcore_conf *qconf, */ static inline void l3fwd_lpm_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 j; uint16_t dst_port[MAX_PKT_BURST]; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 81995fdbe..a5e55baae 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -124,7 +124,7 @@ uint32_t hash_entry_number = HASH_ENTRY_NUMBER_DEFAULT; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; struct lcore_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; } __rte_cache_aligned; @@ -245,7 +245,7 @@ check_lcore_params(void) static int check_port_config(const unsigned nb_ports) { - unsigned portid; + uint16_t portid; uint16_t i; for (i = 0; i < nb_lcore_params; ++i) { @@ -263,7 +263,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; @@ -445,7 +445,7 @@ parse_config(const char *q_arg) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -750,11 +750,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"); @@ -773,14 +774,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 */ @@ -818,7 +818,7 @@ signal_handler(int signum) } static int -prepare_ptype_parser(uint8_t portid, uint16_t queueid) +prepare_ptype_parser(uint16_t portid, uint16_t queueid) { if (parse_ptype) { printf("Port %d: softly parse packet type info\n", portid); @@ -847,10 +847,10 @@ main(int argc, char **argv) struct rte_eth_txconf *txconf; int ret; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); @@ -1048,7 +1048,7 @@ main(int argc, char **argv) } - check_all_ports_link_status((uint8_t)nb_ports, enabled_port_mask); + check_all_ports_link_status(nb_ports, enabled_port_mask); ret = 0; /* launch per-lcore init on every lcore */ diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f4e3969a6..c83a62fa4 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -145,7 +145,7 @@ print_stats(void) { struct rte_eth_link link; uint64_t total_packets_dropped, total_packets_tx, total_packets_rx; - unsigned portid; + uint16_t portid; total_packets_dropped = 0; total_packets_tx = 0; @@ -165,7 +165,7 @@ print_stats(void) continue; memset(&link, 0, sizeof(link)); - rte_eth_link_get_nowait((uint8_t)portid, &link); + rte_eth_link_get_nowait(portid, &link); printf("\nStatistics for port %u ------------------------------" "\nLink status: %25s" "\nLink speed: %26u" @@ -470,7 +470,7 @@ lsi_parse_args(int argc, char **argv) * int. */ static int -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, void *ret_param) { struct rte_eth_link link; @@ -498,7 +498,8 @@ check_all_ports_link_status(uint8_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"); diff --git a/examples/load_balancer/config.c b/examples/load_balancer/config.c index 503250951..ae234de82 100644 --- a/examples/load_balancer/config.c +++ b/examples/load_balancer/config.c @@ -240,7 +240,7 @@ parse_arg_rx(const char *arg) if (lp->io.rx.n_nic_queues >= APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE) { return -9; } - lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = (uint8_t) port; + lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].port = port; lp->io.rx.nic_queues[lp->io.rx.n_nic_queues].queue = (uint8_t) queue; lp->io.rx.n_nic_queues ++; @@ -318,7 +318,7 @@ parse_arg_tx(const char *arg) if (lp->io.tx.n_nic_ports >= APP_MAX_NIC_TX_PORTS_PER_IO_LCORE) { return -9; } - lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = (uint8_t) port; + lp->io.tx.nic_ports[lp->io.tx.n_nic_ports] = port; lp->io.tx.n_nic_ports ++; n_tuples ++; @@ -488,7 +488,7 @@ app_check_lpm_table(void) static int app_check_every_rx_port_is_tx_enabled(void) { - uint8_t port; + uint16_t port; for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { if ((app_get_nic_rx_queues_per_port(port) > 0) && (app.nic_tx_port_mask[port] == 0)) { @@ -762,7 +762,7 @@ app_parse_args(int argc, char **argv) } int -app_get_nic_rx_queues_per_port(uint8_t port) +app_get_nic_rx_queues_per_port(uint16_t port) { uint32_t i, count; @@ -781,7 +781,7 @@ app_get_nic_rx_queues_per_port(uint8_t port) } int -app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) +app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, uint32_t *lcore_out) { uint32_t lcore; @@ -808,7 +808,7 @@ app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out) } int -app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out) +app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out) { uint32_t lcore; @@ -901,7 +901,7 @@ app_print_params(void) /* Print NIC RX configuration */ printf("NIC RX ports: "); for (port = 0; port < APP_MAX_NIC_PORTS; port ++) { - uint32_t n_rx_queues = app_get_nic_rx_queues_per_port((uint8_t) port); + uint32_t n_rx_queues = app_get_nic_rx_queues_per_port(port); if (n_rx_queues == 0) { continue; diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c index 717232e6e..5f9b0df2a 100644 --- a/examples/load_balancer/init.c +++ b/examples/load_balancer/init.c @@ -308,7 +308,7 @@ app_init_rings_tx(void) continue; } - if (app_get_lcore_for_nic_tx((uint8_t) port, &lcore_io) < 0) { + if (app_get_lcore_for_nic_tx(port, &lcore_io) < 0) { rte_panic("Algorithmic error (no I/O core to handle TX of port %u)\n", port); } @@ -359,11 +359,12 @@ app_init_rings_tx(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; uint32_t n_rx_queues, n_tx_queues; @@ -383,14 +384,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 */ @@ -422,7 +422,8 @@ app_init_nics(void) { unsigned socket; uint32_t lcore; - uint8_t port, queue; + uint16_t port; + uint8_t queue; int ret; uint32_t n_rx_queues, n_tx_queues; @@ -440,14 +441,14 @@ app_init_nics(void) } /* Init port */ - printf("Initializing NIC port %u ...\n", (unsigned) port); + printf("Initializing NIC port %u ...\n", port); ret = rte_eth_dev_configure( port, (uint8_t) n_rx_queues, (uint8_t) n_tx_queues, &port_conf); if (ret < 0) { - rte_panic("Cannot init NIC port %u (%d)\n", (unsigned) port, ret); + rte_panic("Cannot init NIC port %u (%d)\n", port, ret); } rte_eth_promiscuous_enable(port); @@ -457,7 +458,7 @@ app_init_nics(void) port, &nic_rx_ring_size, &nic_tx_ring_size); if (ret < 0) { rte_panic("Cannot adjust number of descriptors for port %u (%d)\n", - (unsigned) port, ret); + port, ret); } app.nic_rx_ring_size = nic_rx_ring_size; app.nic_tx_ring_size = nic_tx_ring_size; @@ -473,8 +474,7 @@ app_init_nics(void) pool = app.lcore_params[lcore].pool; printf("Initializing NIC port %u RX queue %u ...\n", - (unsigned) port, - (unsigned) queue); + port, queue); ret = rte_eth_rx_queue_setup( port, queue, @@ -484,9 +484,7 @@ app_init_nics(void) pool); if (ret < 0) { rte_panic("Cannot init RX queue %u for port %u (%d)\n", - (unsigned) queue, - (unsigned) port, - ret); + queue, port, ret); } } @@ -495,7 +493,7 @@ app_init_nics(void) app_get_lcore_for_nic_tx(port, &lcore); socket = rte_lcore_to_socket_id(lcore); printf("Initializing NIC port %u TX queue 0 ...\n", - (unsigned) port); + port); ret = rte_eth_tx_queue_setup( port, 0, diff --git a/examples/load_balancer/main.h b/examples/load_balancer/main.h index dc407555d..bef2ba041 100644 --- a/examples/load_balancer/main.h +++ b/examples/load_balancer/main.h @@ -248,7 +248,7 @@ struct app_lcore_params_io { struct { /* NIC */ struct { - uint8_t port; + uint16_t port; uint8_t queue; } nic_queues[APP_MAX_NIC_RX_QUEUES_PER_IO_LCORE]; uint32_t n_nic_queues; @@ -275,7 +275,7 @@ struct app_lcore_params_io { struct rte_ring *rings[APP_MAX_NIC_PORTS][APP_MAX_WORKER_LCORES]; /* NIC */ - uint8_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; + uint16_t nic_ports[APP_MAX_NIC_TX_PORTS_PER_IO_LCORE]; uint32_t n_nic_ports; /* Internal buffers */ @@ -368,9 +368,10 @@ void app_print_usage(void); void app_init(void); int app_lcore_main_loop(void *arg); -int app_get_nic_rx_queues_per_port(uint8_t port); -int app_get_lcore_for_nic_rx(uint8_t port, uint8_t queue, uint32_t *lcore_out); -int app_get_lcore_for_nic_tx(uint8_t port, uint32_t *lcore_out); +int app_get_nic_rx_queues_per_port(uint16_t port); +int app_get_lcore_for_nic_rx(uint16_t port, uint8_t queue, + uint32_t *lcore_out); +int app_get_lcore_for_nic_tx(uint16_t port, uint32_t *lcore_out); int app_is_socket_used(uint32_t socket); uint32_t app_get_lcores_io_rx(void); uint32_t app_get_lcores_worker(void); diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index e54b78510..b342e755f 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -188,7 +188,7 @@ app_lcore_io_rx( uint32_t i; for (i = 0; i < lp->rx.n_nic_queues; i ++) { - uint8_t port = lp->rx.nic_queues[i].port; + uint16_t port = lp->rx.nic_queues[i].port; uint8_t queue = lp->rx.nic_queues[i].queue; uint32_t n_mbufs, j; @@ -213,7 +213,7 @@ app_lcore_io_rx( printf("I/O RX %u in (NIC port %u): NIC drop ratio = %.2f avg burst size = %.2f\n", lcore, - (unsigned) port, + port, (double) stats.imissed / (double) (stats.imissed + stats.ipackets), ((double) lp->rx.nic_queues_count[i]) / ((double) lp->rx.nic_queues_iters[i])); lp->rx.nic_queues_iters[i] = 0; @@ -339,7 +339,7 @@ app_lcore_io_tx( uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i ++) { - uint8_t port = lp->tx.nic_ports[i]; + uint16_t port = lp->tx.nic_ports[i]; struct rte_ring *ring = lp->tx.rings[port][worker]; uint32_t n_mbufs, n_pkts; int ret; @@ -395,7 +395,7 @@ app_lcore_io_tx( printf("\t\t\tI/O TX %u out (port %u): avg burst size = %.2f\n", lcore, - (unsigned) port, + port, ((double) lp->tx.nic_ports_count[port]) / ((double) lp->tx.nic_ports_iters[port])); lp->tx.nic_ports_iters[port] = 0; lp->tx.nic_ports_count[port] = 0; @@ -418,7 +418,7 @@ app_lcore_io_tx( static inline void app_lcore_io_tx_flush(struct app_lcore_params_io *lp) { - uint8_t port; + uint16_t port; uint32_t i; for (i = 0; i < lp->tx.n_nic_ports; i++) { @@ -569,7 +569,7 @@ app_lcore_worker( if (lp->rings_out_iters[port] == APP_STATS){ printf("\t\tWorker %u out (NIC port %u): enq success rate = %.2f\n", (unsigned) lp->worker_id, - (unsigned) port, + port, ((double) lp->rings_out_count[port]) / ((double) lp->rings_out_iters[port])); lp->rings_out_iters[port] = 0; lp->rings_out_count[port] = 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 f8453e57a..59f36af08 100644 --- a/examples/multi_process/client_server_mp/mp_client/client.c +++ b/examples/multi_process/client_server_mp/mp_client/client.c @@ -74,7 +74,7 @@ static uint8_t client_id = 0; #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]; @@ -150,7 +150,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; @@ -161,7 +161,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; @@ -171,15 +171,16 @@ configure_tx_buffer(uint8_t port_id, uint16_t size) 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) port_id); + 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) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } /* @@ -195,8 +196,8 @@ configure_output_ports(const struct port_info *ports) rte_exit(EXIT_FAILURE, "Too many ethernet ports. RTE_MAX_ETHPORTS = %u\n", (unsigned)RTE_MAX_ETHPORTS); for (i = 0; i < ports->num_ports - 1; i+=2){ - uint8_t p1 = ports->id[i]; - uint8_t p2 = ports->id[i+1]; + uint16_t p1 = ports->id[i]; + uint16_t p2 = ports->id[i+1]; output_ports[p1] = p2; output_ports[p2] = p1; diff --git a/examples/multi_process/client_server_mp/mp_server/args.c b/examples/multi_process/client_server_mp/mp_server/args.c index bf8c666c2..a65884fd9 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.c +++ b/examples/multi_process/client_server_mp/mp_server/args.c @@ -74,7 +74,7 @@ parse_portmask(uint8_t max_ports, const char *portmask) { char *end = NULL; unsigned long pm; - uint8_t count = 0; + uint16_t count = 0; if (portmask == NULL || *portmask == '\0') return -1; @@ -128,7 +128,7 @@ parse_num_clients(const char *clients) * on error. */ int -parse_app_args(uint8_t max_ports, int argc, char *argv[]) +parse_app_args(uint16_t max_ports, int argc, char *argv[]) { int option_index, opt; char **argvopt = argv; diff --git a/examples/multi_process/client_server_mp/mp_server/args.h b/examples/multi_process/client_server_mp/mp_server/args.h index 23af1bd38..33888b894 100644 --- a/examples/multi_process/client_server_mp/mp_server/args.h +++ b/examples/multi_process/client_server_mp/mp_server/args.h @@ -34,6 +34,6 @@ #ifndef _ARGS_H_ #define _ARGS_H_ -int parse_app_args(uint8_t max_ports, int argc, char *argv[]); +int parse_app_args(uint16_t max_ports, int argc, char *argv[]); #endif /* ifndef _ARGS_H_ */ diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c index 0bc929217..cacf4e0d5 100644 --- a/examples/multi_process/client_server_mp/mp_server/init.c +++ b/examples/multi_process/client_server_mp/mp_server/init.c @@ -114,7 +114,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 = { @@ -129,7 +129,7 @@ init_port(uint8_t port_num) uint16_t q; int retval; - printf("Port %u init ... ", (unsigned)port_num); + printf("Port %u init ... ", port_num); fflush(stdout); /* Standard DPDK port initialisation - config port, then set up @@ -200,11 +200,12 @@ init_shm_rings(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; + uint16_t portid; + uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; printf("\nChecking link status"); @@ -262,7 +263,7 @@ init(int argc, char *argv[]) { int retval; const struct rte_memzone *mz; - uint8_t i, total_ports; + uint16_t i, total_ports; /* init EAL, parsing EAL args */ retval = rte_eal_init(argc, argv); diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index 7055b543a..121383f8c 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -88,7 +88,7 @@ struct client_rx_buf { static struct client_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/multi_process/client_server_mp/shared/common.h b/examples/multi_process/client_server_mp/shared/common.h index 631c46325..35a3b01d0 100644 --- a/examples/multi_process/client_server_mp/shared/common.h +++ b/examples/multi_process/client_server_mp/shared/common.h @@ -57,8 +57,8 @@ struct tx_stats{ } __rte_cache_aligned; struct port_info { - uint8_t num_ports; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t num_ports; + uint16_t id[RTE_MAX_ETHPORTS]; volatile struct rx_stats rx_stats; volatile struct tx_stats tx_stats[MAX_CLIENTS]; }; diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index f8a626ba7..238b7f67b 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -140,7 +140,8 @@ struct lcore_resource_struct { /* ring[1] for slave send ack, master read */ struct rte_ring *ring[2]; int port_num; /* Total port numbers */ - uint8_t port[RTE_MAX_ETHPORTS]; /* Port id for that lcore to receive packets */ + /* Port id for that lcore to receive packets */ + uint16_t port[RTE_MAX_ETHPORTS]; }__attribute__((packed)) __rte_cache_aligned; static struct lcore_resource_struct lcore_resource[RTE_MAX_LCORE]; @@ -871,11 +872,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"); @@ -890,14 +892,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 */ @@ -930,9 +931,9 @@ 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 nb_ports_available; - uint8_t portid, last_port; + uint16_t nb_ports; + uint16_t nb_ports_available; + uint16_t portid, last_port; unsigned rx_lcore_id; unsigned nb_ports_in_mask = 0; unsigned i; diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index af2d9f3f7..98fbd74d1 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -129,7 +129,7 @@ static void netmap_unregif(uint32_t idx, uint32_t port); static int32_t -ifname_to_portid(const char *ifname, uint8_t *port) +ifname_to_portid(const char *ifname, uint16_t *port) { char *endptr; uint64_t portid; @@ -140,7 +140,7 @@ ifname_to_portid(const char *ifname, uint8_t *port) portid >= RTE_DIM(ports) || errno != 0) return -EINVAL; - *port = (uint8_t)portid; + *port = portid; return 0; } @@ -222,10 +222,10 @@ fd_release(int32_t fd) } static int -check_nmreq(struct nmreq *req, uint8_t *port) +check_nmreq(struct nmreq *req, uint16_t *port) { int32_t rc; - uint8_t portid; + uint16_t portid; if (req == NULL) return -EINVAL; @@ -242,7 +242,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) } if (ports[portid].pool == NULL) { - RTE_LOG(ERR, USER1, "Misconfigured portid %hhu\n", portid); + RTE_LOG(ERR, USER1, "Misconfigured portid %u\n", portid); return -EINVAL; } @@ -262,7 +262,7 @@ check_nmreq(struct nmreq *req, uint8_t *port) static int ioctl_niocginfo(__rte_unused int fd, void * param) { - uint8_t portid; + uint16_t portid; struct nmreq *req; int32_t rc; @@ -283,7 +283,7 @@ ioctl_niocginfo(__rte_unused int fd, void * param) } static void -netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, +netmap_ring_setup(struct netmap_ring *ring, uint16_t port, uint32_t ringid, uint32_t num_slots) { uint32_t j; @@ -305,7 +305,7 @@ netmap_ring_setup(struct netmap_ring *ring, uint8_t port, uint32_t ringid, } static int -netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) +netmap_regif(struct nmreq *req, uint32_t idx, uint16_t port) { struct netmap_if *nmif; struct netmap_ring *ring; @@ -313,7 +313,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) int32_t rc; if (ports[port].fd < RTE_DIM(fd_port)) { - RTE_LOG(ERR, USER1, "port %hhu already in use by fd: %u\n", + RTE_LOG(ERR, USER1, "port %u already in use by fd: %u\n", port, IDX_TO_FD(ports[port].fd)); return -EBUSY; } @@ -399,7 +399,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port) static int ioctl_niocregif(int32_t fd, void * param) { - uint8_t portid; + uint16_t portid; int32_t rc; uint32_t idx; struct nmreq *req; @@ -422,7 +422,7 @@ netmap_unregif(uint32_t idx, uint32_t port) { fd_port[idx].port = FD_PORT_RSRV; ports[port].fd = UINT32_MAX; - rte_eth_dev_stop((uint8_t)port); + rte_eth_dev_stop(port); } /** @@ -460,7 +460,7 @@ ioctl_niocunregif(int fd) * packets as it can hold coming from its dpdk port. */ static inline int -rx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +rx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, uint16_t max_burst) { int32_t i, n_rx; @@ -513,7 +513,7 @@ rx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_rx_rings + 1; i++) { r = NETMAP_RXRING(nifp, i); - rx_sync_ring(r, (uint8_t)port, (uint16_t)i, burst); + rx_sync_ring(r, port, (uint16_t)i, burst); rc += r->avail; } @@ -542,7 +542,7 @@ ioctl_niocrxsync(int fd) * buffers into rte_mbufs and sending them out on the rings's dpdk port. */ static int -tx_sync_ring(struct netmap_ring *ring, uint8_t port, uint16_t ring_number, +tx_sync_ring(struct netmap_ring *ring, uint16_t port, uint16_t ring_number, struct rte_mempool *pool, uint16_t max_burst) { uint32_t i, n_tx; @@ -608,7 +608,7 @@ tx_sync_if(uint32_t port) for (i = 0; i < nifp->ni_tx_rings + 1; i++) { r = NETMAP_TXRING(nifp, i); - tx_sync_ring(r, (uint8_t)port, (uint16_t)i, mp, burst); + tx_sync_ring(r, port, (uint16_t)i, mp, burst); rc += r->avail; } @@ -686,7 +686,7 @@ rte_netmap_init(const struct rte_netmap_conf *conf) int -rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) +rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf) { int32_t ret; uint16_t i; @@ -696,17 +696,17 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) portid >= RTE_DIM(ports) || conf->nr_tx_rings > netmap.conf.max_rings || conf->nr_rx_rings > netmap.conf.max_rings) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } - rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); - tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); + rx_slots = (uint16_t)rte_align32pow2(conf->nr_rx_slots); + tx_slots = (uint16_t)rte_align32pow2(conf->nr_tx_slots); if (tx_slots > netmap.conf.max_slots || rx_slots > netmap.conf.max_slots) { - RTE_LOG(ERR, USER1, "%s(%hhu): invalid parameters\n", + RTE_LOG(ERR, USER1, "%s(%u): invalid parameters\n", __func__, portid); return -EINVAL; } @@ -715,15 +715,15 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) conf->nr_tx_rings, conf->eth_conf); if (ret < 0) { - RTE_LOG(ERR, USER1, "Couldn't configure port %hhu\n", portid); - return ret; + RTE_LOG(ERR, USER1, "Couldn't configure port %u\n", portid); + return ret; } ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_slots, &tx_slots); if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't ot adjust number of descriptors for port %hhu\n", + "Couldn't ot adjust number of descriptors for port %u\n", portid); return ret; } @@ -734,8 +734,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure TX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure TX queue %u of port %u\n", i, portid); return ret; } @@ -745,8 +744,7 @@ rte_netmap_init_port(uint8_t portid, const struct rte_netmap_port_conf *conf) if (ret < 0) { RTE_LOG(ERR, USER1, - "Couldn't configure RX queue %"PRIu16" of " - "port %"PRIu8"\n", + "fail to configure RX queue %u of port %u\n", i, portid); return ret; } diff --git a/examples/netmap_compat/lib/compat_netmap.h b/examples/netmap_compat/lib/compat_netmap.h index 3dc7a2f40..76b2d2b4c 100644 --- a/examples/netmap_compat/lib/compat_netmap.h +++ b/examples/netmap_compat/lib/compat_netmap.h @@ -67,7 +67,7 @@ struct rte_netmap_port_conf { }; int rte_netmap_init(const struct rte_netmap_conf *conf); -int rte_netmap_init_port(uint8_t portid, +int rte_netmap_init_port(uint16_t portid, const struct rte_netmap_port_conf *conf); int rte_netmap_close(int fd); diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index b26c33df5..3add7be47 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -269,21 +269,22 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) 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) port_id); + port_id); rte_eth_tx_buffer_init(tx_buffer[port_id], MAX_PKTS_BURST); ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[port_id], flush_tx_error_callback, NULL); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot set error callback for " - "tx buffer on port %u\n", (unsigned) port_id); + rte_exit(EXIT_FAILURE, + "Cannot set error callback for tx buffer on port %u\n", + port_id); } return 0; } static inline int -configure_eth_port(uint8_t port_id) +configure_eth_port(uint16_t port_id) { struct ether_addr addr; const uint16_t rxRings = 1, txRings = 1; @@ -326,7 +327,7 @@ configure_eth_port(uint8_t port_id) rte_eth_macaddr_get(port_id, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port_id, + port_id, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -401,7 +402,7 @@ rx_thread(struct rte_ring *ring_out) uint32_t seqn = 0; uint16_t i, ret = 0; uint16_t nb_rx_pkts; - uint8_t port_id; + uint16_t port_id; struct rte_mbuf *pkts[MAX_PKTS_BURST]; RTE_LOG(INFO, REORDERAPP, "%s() started on lcore %u\n", __func__, @@ -632,8 +633,8 @@ main(int argc, char **argv) int ret; unsigned nb_ports; unsigned int lcore_id, last_lcore_id, master_lcore_id; - uint8_t port_id; - uint8_t nb_ports_available; + uint16_t port_id; + uint16_t nb_ports_available; struct worker_thread_args worker_args = {NULL, NULL}; struct send_thread_args send_args = {NULL, NULL}; struct rte_ring *rx_to_workers; @@ -687,7 +688,7 @@ main(int argc, char **argv) continue; } /* init port */ - printf("Initializing port %u... done\n", (unsigned) port_id); + printf("Initializing port %u... done\n", port_id); if (configure_eth_port(port_id) != 0) rte_exit(EXIT_FAILURE, "Cannot initialize port %"PRIu8"\n", diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 7954b9744..9a1eef61a 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -140,7 +140,7 @@ parse_ptype(struct rte_mbuf *m) } static uint16_t -cb_parse_ptype(__rte_unused uint8_t port, __rte_unused uint16_t queue, +cb_parse_ptype(__rte_unused uint16_t port, __rte_unused uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, __rte_unused uint16_t max_pkts, __rte_unused void *user_param) { @@ -277,7 +277,7 @@ struct mbuf_table { }; struct lcore_rx_queue { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; } __rte_cache_aligned; @@ -287,7 +287,7 @@ struct lcore_rx_queue { #define MAX_LCORE_PARAMS 1024 struct rx_thread_params { - uint8_t port_id; + uint16_t port_id; uint8_t queue_id; uint8_t lcore_id; uint8_t thread_id; @@ -648,7 +648,7 @@ struct thread_tx_conf tx_thread[MAX_TX_THREAD]; /* Send burst of packets on an output interface */ static inline int -send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) +send_burst(struct thread_tx_conf *qconf, uint16_t n, uint16_t port) { struct rte_mbuf **m_table; int ret; @@ -669,7 +669,7 @@ send_burst(struct thread_tx_conf *qconf, uint16_t n, uint8_t port) /* 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) { uint16_t len; struct thread_tx_conf *qconf; @@ -696,7 +696,7 @@ send_single_packet(struct rte_mbuf *m, uint8_t port) #if ((APP_LOOKUP_METHOD == APP_LOOKUP_LPM) && \ (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline void -send_packetsx4(uint8_t port, +send_packetsx4(uint16_t port, struct rte_mbuf *m[], uint32_t num) { uint32_t len, j, n; @@ -832,8 +832,8 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len) static __m128i mask0; static __m128i mask1; static __m128i mask2; -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { int ret = 0; @@ -846,11 +846,11 @@ get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, key.xmm = _mm_and_si128(data, mask0); /* 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 -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) { int ret = 0; @@ -873,36 +873,36 @@ get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, /* 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]); } #endif #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM) -static inline uint8_t -get_ipv4_dst_port(void *ipv4_hdr, uint8_t portid, +static inline uint16_t +get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t)((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, + return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(((struct ipv4_hdr *)ipv4_hdr)->dst_addr), &next_hop) == 0) ? next_hop : portid); } -static inline uint8_t -get_ipv6_dst_port(void *ipv6_hdr, uint8_t portid, +static inline uint16_t +get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, lookup6_struct_t *ipv6_l3fwd_lookup_struct) { uint32_t next_hop; - return (uint8_t) ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, + return ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct, ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) == 0) ? next_hop : portid); } #endif -static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) __attribute__((unused)); #if ((APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH) && \ @@ -919,11 +919,11 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) #define EXCLUDE_8TH_PKT 0x7f static inline void -simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { struct ether_hdr *eth_hdr[8]; struct ipv4_hdr *ipv4_hdr[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; int32_t ret[8]; union ipv4_5tuple_host key[8]; __m128i data[8]; @@ -1042,14 +1042,14 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv4_lookup_struct, &key_array[0], 8, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv4_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv4_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv4_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv4_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv4_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv4_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv4_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv4_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1146,10 +1146,10 @@ static inline void get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0, } static inline void -simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) +simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { int32_t ret[8]; - uint8_t dst_port[8]; + uint16_t dst_port[8]; struct ether_hdr *eth_hdr[8]; union ipv6_5tuple_host key[8]; @@ -1196,14 +1196,14 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) rte_hash_lookup_bulk(RTE_PER_LCORE(lcore_conf)->ipv6_lookup_struct, &key_array[0], 4, ret); - dst_port[0] = (uint8_t) ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); - dst_port[1] = (uint8_t) ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); - dst_port[2] = (uint8_t) ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); - dst_port[3] = (uint8_t) ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); - dst_port[4] = (uint8_t) ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); - dst_port[5] = (uint8_t) ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); - dst_port[6] = (uint8_t) ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); - dst_port[7] = (uint8_t) ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); + dst_port[0] = ((ret[0] < 0) ? portid : ipv6_l3fwd_out_if[ret[0]]); + dst_port[1] = ((ret[1] < 0) ? portid : ipv6_l3fwd_out_if[ret[1]]); + dst_port[2] = ((ret[2] < 0) ? portid : ipv6_l3fwd_out_if[ret[2]]); + dst_port[3] = ((ret[3] < 0) ? portid : ipv6_l3fwd_out_if[ret[3]]); + dst_port[4] = ((ret[4] < 0) ? portid : ipv6_l3fwd_out_if[ret[4]]); + dst_port[5] = ((ret[5] < 0) ? portid : ipv6_l3fwd_out_if[ret[5]]); + dst_port[6] = ((ret[6] < 0) ? portid : ipv6_l3fwd_out_if[ret[6]]); + dst_port[7] = ((ret[7] < 0) ? portid : ipv6_l3fwd_out_if[ret[7]]); if (dst_port[0] >= RTE_MAX_ETHPORTS || (enabled_port_mask & 1 << dst_port[0]) == 0) @@ -1250,24 +1250,24 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint8_t portid) ether_addr_copy(&ports_eth_addr[dst_port[6]], ð_hdr[6]->s_addr); ether_addr_copy(&ports_eth_addr[dst_port[7]], ð_hdr[7]->s_addr); - send_single_packet(m[0], (uint8_t)dst_port[0]); - send_single_packet(m[1], (uint8_t)dst_port[1]); - send_single_packet(m[2], (uint8_t)dst_port[2]); - send_single_packet(m[3], (uint8_t)dst_port[3]); - send_single_packet(m[4], (uint8_t)dst_port[4]); - send_single_packet(m[5], (uint8_t)dst_port[5]); - send_single_packet(m[6], (uint8_t)dst_port[6]); - send_single_packet(m[7], (uint8_t)dst_port[7]); + send_single_packet(m[0], dst_port[0]); + send_single_packet(m[1], dst_port[1]); + send_single_packet(m[2], dst_port[2]); + send_single_packet(m[3], dst_port[3]); + send_single_packet(m[4], dst_port[4]); + send_single_packet(m[5], dst_port[5]); + send_single_packet(m[6], dst_port[6]); + send_single_packet(m[7], dst_port[7]); } #endif /* APP_LOOKUP_METHOD */ static __rte_always_inline void -l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid) +l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; - uint8_t dst_port; + uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); @@ -1379,7 +1379,7 @@ rfc1812_process(struct ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype) (ENABLE_MULTI_BUFFER_OPTIMIZE == 1)) static __rte_always_inline uint16_t -get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) +get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; @@ -1406,7 +1406,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint8_t portid) } static inline void -process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint8_t portid) +process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint16_t portid) { struct ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; @@ -1473,7 +1473,7 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], static inline void processx4_step2(__m128i dip, uint32_t ipv4_flag, - uint8_t portid, + uint16_t portid, struct rte_mbuf *pkt[FWDSTEP], uint16_t dprt[FWDSTEP]) { @@ -1716,7 +1716,8 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2) static void process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx, - uint8_t portid) { + uint16_t portid) +{ int j; @@ -2091,7 +2092,7 @@ lthread_tx(void *args) struct lthread *lt; unsigned lcore_id; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; tx_conf = (struct thread_tx_conf *)args; @@ -2138,7 +2139,8 @@ lthread_rx(void *dummy) int ret; uint16_t nb_rx; int i; - uint8_t portid, queueid; + uint16_t portid; + uint8_t queueid; int worker_id; int len[RTE_MAX_LCORE] = { 0 }; int old_len, new_len; @@ -2164,7 +2166,8 @@ lthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", rte_lcore_id(), portid, queueid); } @@ -2323,7 +2326,7 @@ pthread_tx(void *dummy) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; uint64_t prev_tsc, diff_tsc, cur_tsc; int nb_rx; - uint8_t portid; + uint16_t portid; struct thread_tx_conf *tx_conf; const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / @@ -2392,7 +2395,8 @@ pthread_rx(void *dummy) uint32_t n; uint32_t nb_rx; unsigned lcore_id; - uint8_t portid, queueid; + uint8_t queueid; + uint16_t portid; struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct thread_rx_conf *rx_conf; @@ -2411,7 +2415,8 @@ pthread_rx(void *dummy) portid = rx_conf->rx_queue_list[i].port_id; queueid = rx_conf->rx_queue_list[i].queue_id; - RTE_LOG(INFO, L3FWD, " -- lcoreid=%u portid=%hhu rxqueueid=%hhu\n", + RTE_LOG(INFO, L3FWD, + " -- lcoreid=%u portid=%u rxqueueid=%hhu\n", lcore_id, portid, queueid); } @@ -2769,7 +2774,7 @@ parse_rx_config(const char *q_arg) return -1; } rx_thread_params_array[nb_rx_thread_params].port_id = - (uint8_t)int_fld[FLD_PORT]; + int_fld[FLD_PORT]; rx_thread_params_array[nb_rx_thread_params].queue_id = (uint8_t)int_fld[FLD_QUEUE]; rx_thread_params_array[nb_rx_thread_params].lcore_id = @@ -2853,7 +2858,7 @@ parse_stat_lcore(const char *stat_lcore) static void parse_eth_dest(const char *optarg) { - uint8_t portid; + uint16_t portid; char *port_end; uint8_t c, *dest, peer_addr[6]; @@ -3440,7 +3445,8 @@ check_all_ports_link_status(uint8_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"); @@ -3455,14 +3461,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 */ @@ -3497,10 +3502,10 @@ main(int argc, char **argv) int ret; int i; unsigned nb_ports; - uint16_t queueid; + uint16_t queueid, portid; unsigned lcore_id; uint32_t n_tx_queue, nb_lcores; - uint8_t portid, nb_rx_queue, queue, socketid; + uint8_t nb_rx_queue, queue, socketid; /* init EAL */ ret = rte_eal_init(argc, argv); diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index ddfcdb832..c495e7508 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -158,12 +158,12 @@ struct ptpv2_data_slave_ordinary { struct clock_id master_clock_id; struct timeval new_adj; int64_t delta; - uint8_t portid; + uint16_t portid; uint16_t seqID_SYNC; uint16_t seqID_FOLLOWUP; uint8_t ptpset; uint8_t kernel_time_set; - uint8_t current_ptp_port; + uint16_t current_ptp_port; }; static struct ptpv2_data_slave_ordinary ptp_data; diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 2350d64f4..203a34704 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -252,8 +252,8 @@ app_parse_flow_conf(const char *conf_str) pconf = &qos_conf[nb_pfc]; - pconf->rx_port = (uint8_t)vals[0]; - pconf->tx_port = (uint8_t)vals[1]; + pconf->rx_port = vals[0]; + pconf->tx_port = vals[1]; pconf->rx_core = (uint8_t)vals[2]; pconf->wt_core = (uint8_t)vals[3]; if (ret == 5) @@ -267,19 +267,19 @@ app_parse_flow_conf(const char *conf_str) } if (pconf->rx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu16" index\n", nb_pfc, pconf->rx_port); return -1; } if (pconf->tx_port >= RTE_MAX_ETHPORTS) { - RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu8" index\n", + RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu16" index\n", nb_pfc, pconf->tx_port); return -1; } mask = 1lu << pconf->rx_port; if (app_used_rx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu16" is used already\n", nb_pfc, pconf->rx_port); return -1; } @@ -288,7 +288,7 @@ app_parse_flow_conf(const char *conf_str) mask = 1lu << pconf->tx_port; if (app_used_tx_port_mask & mask) { - RTE_LOG(ERR, APP, "pfc %u: port %"PRIu8" is used already\n", + RTE_LOG(ERR, APP, "pfc %u: port %"PRIu16" is used already\n", nb_pfc, pconf->tx_port); return -1; } diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index a82cbd7d5..004ac54e7 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -100,7 +100,7 @@ static const struct rte_eth_conf port_conf = { }; static int -app_init_port(uint8_t portid, struct rte_mempool *mp) +app_init_port(uint16_t portid, struct rte_mempool *mp) { int ret; struct rte_eth_link link; @@ -127,19 +127,21 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; /* init port */ - RTE_LOG(INFO, APP, "Initializing port %"PRIu8"... ", portid); + RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid); fflush(stdout); ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "Cannot configure device: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "Cannot configure device: err=%d, port=%u\n", + ret, portid); rx_size = ring_conf.rx_size; tx_size = ring_conf.tx_size; ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &rx_size, &tx_size); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_dev_adjust_nb_rx_tx_desc: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_dev_adjust_nb_rx_tx_desc: err=%d,port=%u\n", + ret, portid); ring_conf.rx_size = rx_size; ring_conf.tx_size = tx_size; @@ -148,22 +150,25 @@ app_init_port(uint8_t portid, struct rte_mempool *mp) ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size, rte_eth_dev_socket_id(portid), &rx_conf, mp); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u\n", + ret, portid); /* init one TX queue */ fflush(stdout); ret = rte_eth_tx_queue_setup(portid, 0, (uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, " - "port=%"PRIu8" queue=%d\n", ret, portid, 0); + rte_exit(EXIT_FAILURE, + "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n", + ret, portid, 0); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_pmd_port_start: " - "err=%d, port=%"PRIu8"\n", ret, portid); + rte_exit(EXIT_FAILURE, + "rte_pmd_port_start: err=%d, port=%u\n", + ret, portid); printf("done: "); @@ -256,7 +261,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid) uint32_t pipe, subport; int err; - rte_eth_link_get((uint8_t)portid, &link); + rte_eth_link_get(portid, &link); port_params.socket = socketid; port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8; diff --git a/examples/qos_sched/main.c b/examples/qos_sched/main.c index e10cfd448..1e2fb189b 100644 --- a/examples/qos_sched/main.c +++ b/examples/qos_sched/main.c @@ -125,8 +125,7 @@ app_main_loop(__attribute__((unused))void *dummy) /* initialize mbuf memory */ if (mode == APP_RX_MODE) { for (i = 0; i < rx_idx; i++) { - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "reading port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u reading port%u\n", i, lcore_id, rx_confs[i]->rx_port); } @@ -140,8 +139,8 @@ app_main_loop(__attribute__((unused))void *dummy) if (wt_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u sched+write " - "port %"PRIu8"\n", + RTE_LOG(INFO, APP, + "flow %u lcoreid %u sched+write port %u\n", i, lcore_id, wt_confs[i]->tx_port); } @@ -155,8 +154,7 @@ app_main_loop(__attribute__((unused))void *dummy) if (tx_confs[i]->m_table == NULL) rte_panic("flow %u unable to allocate memory buffer\n", i); - RTE_LOG(INFO, APP, "flow %u lcoreid %u " - "writing port %"PRIu8"\n", + RTE_LOG(INFO, APP, "flow%u lcoreid%u write port%u\n", i, lcore_id, tx_confs[i]->tx_port); } @@ -186,7 +184,7 @@ app_stat(void) struct flow_conf *flow = &qos_conf[i]; rte_eth_stats_get(flow->rx_port, &stats); - printf("\nRX port %"PRIu8": rx: %"PRIu64 " err: %"PRIu64 + printf("\nRX port %"PRIu16": rx: %"PRIu64 " err: %"PRIu64 " no_mbuf: %"PRIu64 "\n", flow->rx_port, stats.ipackets - rx_stats[i].ipackets, @@ -195,7 +193,7 @@ app_stat(void) memcpy(&rx_stats[i], &stats, sizeof(stats)); rte_eth_stats_get(flow->tx_port, &stats); - printf("TX port %"PRIu8": tx: %" PRIu64 " err: %" PRIu64 "\n", + printf("TX port %"PRIu16": tx: %" PRIu64 " err: %" PRIu64 "\n", flow->tx_port, stats.opackets - tx_stats[i].opackets, stats.oerrors - tx_stats[i].oerrors); diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h index 8d02e1ade..77b6e3ee7 100644 --- a/examples/qos_sched/main.h +++ b/examples/qos_sched/main.h @@ -106,8 +106,8 @@ struct thread_conf uint32_t n_mbufs; struct rte_mbuf **m_table; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -125,8 +125,8 @@ struct flow_conf uint32_t rx_core; uint32_t wt_core; uint32_t tx_core; - uint8_t rx_port; - uint8_t tx_port; + uint16_t rx_port; + uint16_t tx_port; uint16_t rx_queue; uint16_t tx_queue; struct rte_ring *rx_ring; @@ -188,13 +188,15 @@ void app_worker_thread(struct thread_conf **qconf); void app_mixed_thread(struct thread_conf **qconf); void app_stat(void); -int subport_stat(uint8_t port_id, uint32_t subport_id); -int pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q); -int qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc); -int qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id); -int qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc); -int qavg_subport(uint8_t port_id, uint32_t subport_id); +int subport_stat(uint16_t port_id, uint32_t subport_id); +int pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc, uint8_t q); +int qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc); +int qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id); +int qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc); +int qavg_subport(uint16_t port_id, uint32_t subport_id); #ifdef __cplusplus } diff --git a/examples/qos_sched/stats.c b/examples/qos_sched/stats.c index 5c894455b..b5545e10c 100644 --- a/examples/qos_sched/stats.c +++ b/examples/qos_sched/stats.c @@ -37,7 +37,8 @@ #include "main.h" int -qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8_t q) +qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, + uint8_t q) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -74,7 +75,8 @@ qavg_q(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc, uint8 } int -qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) +qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, + uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -114,7 +116,7 @@ qavg_tcpipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc) } int -qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -153,7 +155,7 @@ qavg_pipe(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) } int -qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) +qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -195,7 +197,7 @@ qavg_tcsubport(uint8_t port_id, uint32_t subport_id, uint8_t tc) } int -qavg_subport(uint8_t port_id, uint32_t subport_id) +qavg_subport(uint16_t port_id, uint32_t subport_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; @@ -237,7 +239,7 @@ qavg_subport(uint8_t port_id, uint32_t subport_id) } int -subport_stat(uint8_t port_id, uint32_t subport_id) +subport_stat(uint16_t port_id, uint32_t subport_id) { struct rte_sched_subport_stats stats; struct rte_sched_port *port; @@ -273,7 +275,7 @@ subport_stat(uint8_t port_id, uint32_t subport_id) } int -pipe_stat(uint8_t port_id, uint32_t subport_id, uint32_t pipe_id) +pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id) { struct rte_sched_queue_stats stats; struct rte_sched_port *port; diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 083a37a92..415b68bb9 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -156,12 +156,12 @@ void init_ring(int lcore_id, uint8_t port_id) void pair_ports(void) { - uint8_t i, j; + uint16_t i, j; /* Pair ports with their "closest neighbour" in the portmask */ for (i = 0; i < RTE_MAX_ETHPORTS; i++) if (is_bit_set(i, portmask)) - for (j = (uint8_t) (i + 1); j < RTE_MAX_ETHPORTS; j++) + for (j = i + 1; j < RTE_MAX_ETHPORTS; j++) if (is_bit_set(j, portmask)) { port_pairs[i] = j; port_pairs[j] = i; diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c index d4fcfde48..e5ecdb1cf 100644 --- a/examples/quota_watermark/qw/main.c +++ b/examples/quota_watermark/qw/main.c @@ -155,7 +155,7 @@ receive_stage(__attribute__((unused)) void *args) { int i, ret; - uint8_t port_id; + uint16_t port_id; uint16_t nb_rx_pkts; unsigned int lcore_id; @@ -216,7 +216,7 @@ pipeline_stage(__attribute__((unused)) void *args) int i, ret; int nb_dq_pkts; - uint8_t port_id; + uint16_t port_id; unsigned int lcore_id, previous_lcore_id; unsigned int free; @@ -279,8 +279,8 @@ send_stage(__attribute__((unused)) void *args) { uint16_t nb_dq_pkts; - uint8_t port_id; - uint8_t dest_port_id; + uint16_t port_id; + uint16_t dest_port_id; unsigned int lcore_id, previous_lcore_id; @@ -324,7 +324,7 @@ main(int argc, char **argv) int ret; unsigned int lcore_id, master_lcore_id, last_lcore_id; - uint8_t port_id; + uint16_t port_id; rte_log_set_global_level(RTE_LOG_INFO); diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 669924055..e66f16f25 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -59,7 +59,7 @@ static struct { 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, uint16_t max_pkts __rte_unused, void *_ __rte_unused) { @@ -72,7 +72,7 @@ add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused, } 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; @@ -97,7 +97,7 @@ calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused, * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; - uint8_t portid; + uint16_t portid; /* init EAL */ int ret = rte_eal_init(argc, argv); diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index dcdc0a48b..382a2ded8 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -95,7 +95,7 @@ struct efd_stats { static struct node_rx_buf *cl_rx_buf; static const char * -get_printable_mac_addr(uint8_t port) +get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; diff --git a/examples/server_node_efd/shared/common.h b/examples/server_node_efd/shared/common.h index 8a1347993..b1e0abe52 100644 --- a/examples/server_node_efd/shared/common.h +++ b/examples/server_node_efd/shared/common.h @@ -65,9 +65,9 @@ struct filter_stats { struct shared_info { uint8_t num_nodes; - uint8_t num_ports; + uint16_t num_ports; uint32_t num_flows; - uint8_t id[RTE_MAX_ETHPORTS]; + uint16_t id[RTE_MAX_ETHPORTS]; struct rx_stats rx_stats; struct tx_stats tx_stats[MAX_NODES]; struct filter_stats filter_stats[MAX_NODES]; diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index b4d50de89..e623754cf 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -57,7 +57,7 @@ static const struct rte_eth_conf port_conf_default = { * 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_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; @@ -104,7 +104,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", - (unsigned)port, + port, addr.addr_bytes[0], addr.addr_bytes[1], addr.addr_bytes[2], addr.addr_bytes[3], addr.addr_bytes[4], addr.addr_bytes[5]); @@ -122,8 +122,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) 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 @@ -179,7 +179,7 @@ main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool; unsigned nb_ports; - uint8_t portid; + uint16_t portid; /* Initialize the Environment Abstraction Layer (EAL). */ int ret = rte_eal_init(argc, argv); @@ -204,7 +204,7 @@ main(int argc, char *argv[]) /* Initialize all ports. */ for (portid = 0; portid < nb_ports; portid++) if (port_init(portid, mbuf_pool) != 0) - rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", + rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n", portid); if (rte_lcore_count() > 1) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 4d1589d06..89a61f0e5 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -177,7 +177,7 @@ static 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 = 0; /**< The number of ports specified in command line */ static uint16_t num_pf_queues, num_vmdq_queues; static uint16_t vmdq_pool_base, vmdq_queue_base; @@ -265,7 +265,7 @@ validate_num_devices(uint32_t max_nb_devices) * coming from the mbuf_pool passed as parameter */ static inline int -port_init(uint8_t port) +port_init(uint16_t port) { struct rte_eth_dev_info dev_info; struct rte_eth_conf port_conf; @@ -392,7 +392,7 @@ port_init(uint8_t port) RTE_LOG(INFO, VHOST_PORT, "Max virtio devices supported: %u\n", num_devices); RTE_LOG(INFO, VHOST_PORT, "Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", - (unsigned)port, + port, vmdq_ports_eth_addr[port].addr_bytes[0], vmdq_ports_eth_addr[port].addr_bytes[1], vmdq_ports_eth_addr[port].addr_bytes[2], @@ -667,7 +667,7 @@ us_vhost_parse_args(int argc, char **argv) for (i = 0; i < RTE_MAX_ETHPORTS; i++) { if (enabled_port_mask & (1 << i)) - ports[num_ports++] = (uint8_t)i; + ports[num_ports++] = i; } if ((num_ports == 0) || (num_ports > MAX_SUP_PORTS)) { @@ -1443,7 +1443,7 @@ main(int argc, char *argv[]) unsigned lcore_id, core_id = 0; unsigned nb_ports, valid_num_ports; int ret, i; - uint8_t portid; + uint16_t portid; static pthread_t tid; char thread_name[RTE_MAX_THREAD_NAME_LEN]; uint64_t flags = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v6 4/5] test: increase port_id range 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang ` (2 preceding siblings ...) 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 3/5] examples: " Zhiyong Yang @ 2017-09-29 7:17 ` Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 5/5] librte_mbuf: modify port initialization value Zhiyong Yang 2017-10-06 2:15 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-29 7:17 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, Zhiyong Yang Increase port_id range from 8 bit to 16 bits in test code, and remove some unnecessary cast operations. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- test/test/test_kni.c | 12 +++++------ test/test/test_link_bonding.c | 40 ++++++++++++++++++------------------- test/test/test_link_bonding_mode4.c | 12 +++++------ test/test/test_pmd_perf.c | 30 ++++++++++++++-------------- test/test/test_pmd_ring_perf.c | 2 +- test/test/virtual_pmd.c | 24 +++++++++++----------- test/test/virtual_pmd.h | 28 ++++++++++++++------------ 7 files changed, 75 insertions(+), 73 deletions(-) diff --git a/test/test/test_kni.c b/test/test/test_kni.c index db17fdf30..2450c9ff5 100644 --- a/test/test/test_kni.c +++ b/test/test/test_kni.c @@ -132,7 +132,7 @@ test_kni_lookup_mempool(void) } /* 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 int new_mtu) { printf("Change MTU of port %d to %u\n", port_id, new_mtu); kni_pkt_mtu = new_mtu; @@ -362,7 +362,7 @@ test_kni_register_handler_mp(void) } static int -test_kni_processing(uint8_t port_id, struct rte_mempool *mp) +test_kni_processing(uint16_t port_id, struct rte_mempool *mp) { int ret = 0; unsigned i; @@ -387,7 +387,7 @@ test_kni_processing(uint8_t port_id, struct rte_mempool *mp) conf.core_id = 1; conf.force_bind = 1; conf.mbuf_size = MAX_PACKET_SZ; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; ops = kni_ops; ops.port_id = port_id; @@ -472,7 +472,7 @@ static int test_kni(void) { int ret = -1; - uint8_t nb_ports, port_id; + uint16_t nb_ports, port_id; struct rte_kni *kni; struct rte_mempool *mp; struct rte_kni_conf conf; @@ -538,7 +538,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; @@ -567,7 +567,7 @@ test_kni(void) rte_eth_dev_info_get(port_id, &info); conf.addr = info.pci_dev->addr; conf.id = info.pci_dev->id; - conf.group_id = (uint16_t)port_id; + conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; ops = kni_ops; diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c index dc28cea59..e41ab60d2 100644 --- a/test/test/test_link_bonding.c +++ b/test/test/test_link_bonding.c @@ -94,9 +94,9 @@ uint8_t slave_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; uint8_t bonded_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; struct link_bonding_unittest_params { - int8_t bonded_port_id; - int8_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; - uint8_t bonded_slave_count; + int16_t bonded_port_id; + int16_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; + uint16_t bonded_slave_count; uint8_t bonding_mode; uint16_t nb_rx_q; @@ -317,7 +317,7 @@ test_create_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Don't try to recreate bonded device if re-running test suite*/ if (test_params->bonded_port_id == -1) { @@ -387,7 +387,7 @@ test_add_slave_to_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count]), @@ -434,7 +434,7 @@ test_remove_slave_from_bonded_device(void) { int current_slave_count; struct ether_addr read_mac_addr, *mac_addr; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params->bonded_port_id, test_params->slave_port_ids[test_params->bonded_slave_count-1]), @@ -496,7 +496,7 @@ static int test_add_already_bonded_slave_to_bonded_device(void) { int port_id, current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; char pmd_name[RTE_ETH_NAME_MAX_LEN]; test_add_slave_to_bonded_device(); @@ -528,7 +528,7 @@ static int test_get_slaves_from_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), "Failed to add slave to bonded device"); @@ -609,7 +609,7 @@ test_start_bonded_device(void) struct rte_eth_link link_status; int current_slave_count, current_bonding_mode, primary_port; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* Add slave to bonded device*/ TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), @@ -658,7 +658,7 @@ static int test_stop_bonded_device(void) { int current_slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; struct rte_eth_link link_status; @@ -932,7 +932,7 @@ test_set_bonded_port_initialization_mac_assignment(void) { int i, slave_count, bonded_port_id; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; struct ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; @@ -1114,7 +1114,7 @@ test_set_bonded_port_initialization_mac_assignment(void) static int initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr, - uint8_t number_of_slaves, uint8_t enable_slave) + uint16_t number_of_slaves, uint8_t enable_slave) { /* Configure bonded device */ TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, @@ -1179,7 +1179,7 @@ int test_lsc_interrupt_count; static int -test_bonding_lsc_event_callback(uint8_t port_id __rte_unused, +test_bonding_lsc_event_callback(uint16_t port_id __rte_unused, enum rte_eth_event_type type __rte_unused, void *param __rte_unused, void *ret_param __rte_unused) @@ -1224,7 +1224,7 @@ static int test_status_interrupt(void) { int slave_count; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; /* initialized bonding device with T slaves */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( @@ -1313,7 +1313,7 @@ test_status_interrupt(void) static int generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size, uint8_t vlan, uint8_t ipv4, uint8_t toggle_dst_mac, - uint8_t toggle_ip_addr, uint8_t toggle_udp_port) + uint8_t toggle_ip_addr, uint16_t toggle_udp_port) { uint16_t pktlen, generated_burst_size, ether_type; void *ip_hdr; @@ -1854,7 +1854,7 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -2408,7 +2408,7 @@ test_activebackup_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; @@ -3302,7 +3302,7 @@ test_balance_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -3861,7 +3861,7 @@ test_broadcast_verify_slave_link_status_change_behaviour(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count; @@ -4373,7 +4373,7 @@ test_tlb_verify_slave_link_status_change_failover(void) struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint8_t slaves[RTE_MAX_ETHPORTS]; + uint16_t slaves[RTE_MAX_ETHPORTS]; int i, burst_size, slave_count, primary_port; diff --git a/test/test/test_link_bonding_mode4.c b/test/test/test_link_bonding_mode4.c index 8e9e23db5..77ec09c54 100644 --- a/test/test/test_link_bonding_mode4.c +++ b/test/test/test_link_bonding_mode4.c @@ -325,7 +325,7 @@ remove_slave(struct slave_conf *slave) } static void -lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) +lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt) { struct ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; @@ -343,7 +343,7 @@ lacp_recv_cb(uint8_t slave_id, struct rte_mbuf *lacp_pkt) } static int -initialize_bonded_device_with_slaves(uint8_t slave_count, uint8_t external_sm) +initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) { uint8_t i; @@ -379,8 +379,8 @@ remove_slaves_and_stop_bonded_device(void) { struct slave_conf *slave; int retval; - uint8_t slaves[RTE_MAX_ETHPORTS]; - uint8_t i; + uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t i; rte_eth_dev_stop(test_params.bonded_port_id); @@ -411,7 +411,7 @@ test_setup(void) char name[RTE_ETH_NAME_MAX_LEN]; struct slave_conf *port; const uint8_t socket_id = rte_socket_id(); - uint8_t i; + uint16_t i; if (test_params.mbuf_pool == NULL) { nb_mbuf_per_pool = TEST_RX_DESC_MAX + DEF_PKT_BURST + @@ -1521,7 +1521,7 @@ check_environment(void) { struct slave_conf *port; uint8_t i, env_state; - uint8_t slaves[RTE_DIM(test_params.slave_ports)]; + uint16_t slaves[RTE_DIM(test_params.slave_ports)]; int slaves_count; env_state = 0; diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c index 1ffd65a52..a3e29ed9e 100644 --- a/test/test/test_pmd_perf.c +++ b/test/test/test_pmd_perf.c @@ -50,7 +50,7 @@ #define MAX_PKT_BURST (32) #define RTE_TEST_RX_DESC_DEFAULT (128) #define RTE_TEST_TX_DESC_DEFAULT (512) -#define RTE_PORT_ALL (~(uint8_t)0x0) +#define RTE_PORT_ALL (~(uint16_t)0x0) /* how long test would take at full line rate */ #define RTE_TEST_DURATION (2) @@ -143,7 +143,7 @@ struct lcore_conf { uint8_t status; uint8_t socketid; uint16_t nb_ports; - uint8_t portlist[RTE_MAX_ETHPORTS]; + uint16_t portlist[RTE_MAX_ETHPORTS]; } __rte_cache_aligned; struct lcore_conf lcore_conf[RTE_MAX_LCORE]; @@ -160,11 +160,12 @@ static uint32_t sc_flag; /* Check the link status of all ports in up to 3s, 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 30 /* 3s (30 * 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("Checking link statuses...\n"); @@ -179,16 +180,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", (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")); if (link_mbps == 0) link_mbps = link.link_speed; } 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 */ @@ -335,7 +335,7 @@ reset_count(void) } static void -stats_display(uint8_t port_id) +stats_display(uint16_t port_id) { struct rte_eth_stats stats; rte_eth_stats_get(port_id, &stats); @@ -383,7 +383,7 @@ measure_rxtx(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -422,7 +422,7 @@ measure_rxonly(struct lcore_conf *conf, portid = conf->portlist[i]; cur_tsc = rte_rdtsc(); - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -459,7 +459,7 @@ measure_txonly(struct lcore_conf *conf, while (likely(!stop)) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { idle++; @@ -537,7 +537,7 @@ main_loop(__rte_unused void *args) portid = conf->portlist[i]; int nb_free = pkt_per_port; do { /* dry out */ - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, pkts_burst, MAX_PKT_BURST); nb_tx = 0; while (nb_tx < nb_rx) @@ -600,7 +600,7 @@ poll_burst(void *args) while (total) { for (i = 0; i < conf->nb_ports; i++) { portid = conf->portlist[i]; - nb_rx = rte_eth_rx_burst((uint8_t) portid, 0, + nb_rx = rte_eth_rx_burst(portid, 0, &pkts_burst[next[portid]], MAX_PKT_BURST); if (unlikely(nb_rx == 0)) { diff --git a/test/test/test_pmd_ring_perf.c b/test/test/test_pmd_ring_perf.c index 004882af1..8e9cd3310 100644 --- a/test/test/test_pmd_ring_perf.c +++ b/test/test/test_pmd_ring_perf.c @@ -54,7 +54,7 @@ static const volatile unsigned bulk_sizes[] = { 1, 8, 32 }; /* The ring structure used for tests */ static struct rte_ring *r; -static uint8_t ring_ethdev_port; +static uint16_t ring_ethdev_port; /* Get cycle counts for dequeuing from an empty ring. Should be 2 or 3 cycles */ static void diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c index 9d46ad564..6568cb5b9 100644 --- a/test/test/virtual_pmd.c +++ b/test/test/virtual_pmd.c @@ -261,7 +261,7 @@ static const struct eth_dev_ops virtual_ethdev_default_dev_ops = { void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -275,7 +275,7 @@ virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -288,7 +288,7 @@ virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -301,7 +301,7 @@ virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -314,7 +314,7 @@ virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; struct virtual_ethdev_private *dev_private = dev->data->dev_private; @@ -430,7 +430,7 @@ virtual_ethdev_tx_burst_fail(void *queue, struct rte_mbuf **bufs, void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -442,7 +442,7 @@ virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success) void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success) { struct virtual_ethdev_private *dev_private = NULL; struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -458,7 +458,7 @@ virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success) } void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count) { struct virtual_ethdev_private *dev_private = NULL; @@ -470,7 +470,7 @@ virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, } void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -478,7 +478,7 @@ virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status) } void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -490,7 +490,7 @@ virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, } int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct rte_eth_dev *vrtl_eth_dev = &rte_eth_devices[port_id]; @@ -502,7 +502,7 @@ virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, } int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length) { struct virtual_ethdev_private *dev_private; diff --git a/test/test/virtual_pmd.h b/test/test/virtual_pmd.h index de001884d..7c53dd346 100644 --- a/test/test/virtual_pmd.h +++ b/test/test/virtual_pmd.h @@ -48,53 +48,55 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, uint8_t socket_id, uint8_t isr_support); void -virtual_ethdev_set_link_status(uint8_t port_id, uint8_t link_status); +virtual_ethdev_set_link_status(uint16_t port_id, uint8_t link_status); void -virtual_ethdev_simulate_link_status_interrupt(uint8_t port_id, +virtual_ethdev_simulate_link_status_interrupt(uint16_t port_id, uint8_t link_status); int -virtual_ethdev_add_mbufs_to_rx_queue(uint8_t port_id, +virtual_ethdev_add_mbufs_to_rx_queue(uint16_t port_id, struct rte_mbuf **pkts_burst, int burst_length); int -virtual_ethdev_get_mbufs_from_tx_queue(uint8_t port_id, +virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, struct rte_mbuf **pkt_burst, int burst_length); /** Control methods for the dev_ops functions pointer to control the behavior * of the Virtual PMD */ void -virtual_ethdev_start_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_start_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_stop_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_stop_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_configure_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_configure_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_tx_queue_setup_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_queue_setup_fn_set_success(uint16_t port_id, + uint8_t success); void -virtual_ethdev_link_update_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_link_update_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_rx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_rx_burst_fn_set_success(uint16_t port_id, uint8_t success); void -virtual_ethdev_tx_burst_fn_set_success(uint8_t port_id, uint8_t success); +virtual_ethdev_tx_burst_fn_set_success(uint16_t port_id, uint8_t success); /* if a value greater than zero is set for packet_fail_count then virtual * device tx burst function will fail that many packet from burst or all * packets if packet_fail_count is greater than the number of packets in the * burst */ void -virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint8_t port_id, +virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(uint16_t port_id, uint8_t packet_fail_count); #ifdef __cplusplus -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* [dpdk-dev] [PATCH v6 5/5] librte_mbuf: modify port initialization value 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang ` (3 preceding siblings ...) 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 4/5] test: " Zhiyong Yang @ 2017-09-29 7:17 ` Zhiyong Yang 2017-10-06 2:15 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit 5 siblings, 0 replies; 101+ messages in thread From: Zhiyong Yang @ 2017-09-29 7:17 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, thomas, Zhiyong Yang In order to support more than 256 virtual ports, the field "port" in rte_mbuf has been increased to 16 bits. The initialization/reset value of the field "port" should be changed from 0xff to 0xffff accordingly. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> --- lib/librte_mbuf/rte_mbuf.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 26a62b8e1..bcf4e2fcf 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -144,7 +144,7 @@ rte_pktmbuf_init(struct rte_mempool *mp, /* init some constant fields */ m->pool = mp; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; rte_mbuf_refcnt_set(m, 1); m->next = NULL; } diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eaed7eee0..cc380400d 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1087,6 +1087,8 @@ static inline void rte_pktmbuf_reset_headroom(struct rte_mbuf *m) * @param m * The packet mbuf to be resetted. */ +#define MBUF_INVALID_PORT UINT16_MAX + static inline void rte_pktmbuf_reset(struct rte_mbuf *m) { m->next = NULL; @@ -1095,7 +1097,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m) m->vlan_tci = 0; m->vlan_tci_outer = 0; m->nb_segs = 1; - m->port = 0xff; + m->port = MBUF_INVALID_PORT; m->ol_flags = 0; m->packet_type = 0; -- 2.13.3 ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v6 0/5] increase port_id range 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang ` (4 preceding siblings ...) 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 5/5] librte_mbuf: modify port initialization value Zhiyong Yang @ 2017-10-06 2:15 ` Ferruh Yigit 2017-10-06 13:31 ` Gaëtan Rivet ` (3 more replies) 5 siblings, 4 replies; 101+ messages in thread From: Ferruh Yigit @ 2017-10-06 2:15 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, Nelio Laranjeiro, Gaetan Rivet, Declan Doherty On 9/29/2017 8:17 AM, Zhiyong Yang wrote: > port_id is currently defined as uint8_t, which is limited to the range > 0 to 255. A larger range is required for vdev scalability. > > It is necessary for a redefinition of port_id to extend it from > 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will > be changed at the same time. > > Discussion about port_id is the following thread. > http://www.dpdk.org/dev/patchwork/patch/23208/ > > Changes in V2: > 1. cover more PMDs to increase port_id range. > 2. cover more examples to increase port_id range. > 3. add 17.11 release note. > > Changes in V3: > 1. cover mlx4 and mlx5. > 2. add to increase port_id range in test code. > 3. The patch "librte_mbuf: modify port initialization value" is merged > into the patchset. > > Changes in V4: > 1. Add a patch to remove bonding APIs using ABI versioning according to > Ferruh's comments. > 2. Unify to use typedef portid_t in testpmd code. > 3. update release note deprecation doc in 2/5 > 4. fix some issues according to comments. > > Changes in V5: > 1. For 1/5, bond_mode_8023ad_conf_get_v1708() and bond_mode_8023ad_conf > _get() are merged into one function bond_mode_8023ad_conf_get. > > Changes in V6: > 1. For 2/5, remove the unnecessary LIBABIVER in Makefile and update > the release notes "Shared Library Versions". > Note: The patchset have dependency on the following patch. > http://www.dpdk.org/dev/patchwork/patch/28738/ > http://www.dpdk.org/dev/patchwork/patch/29219/ > > Note: 3/5 and 4/5 patches' building depends on 2/5 patch since 2/5 patch > breaks lib/PMD API/ABI. > > Zhiyong Yang (5): > net/bonding: remove bonding APIs using ABI versioning > ethdev: increase port_id range > examples: increase port_id range > test: increase port_id range > librte_mbuf: modify port initialization value Series applied to dpdk-next-net/master, thanks. There was merge conflict for: rte_eth_bond_pmd.c failsafe_private.h mlx5_rxtx.h Maintainers of these files cc'ed, can you please double check latest files in next-net? ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v6 0/5] increase port_id range 2017-10-06 2:15 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit @ 2017-10-06 13:31 ` Gaëtan Rivet 2017-10-06 14:29 ` Thomas Monjalon ` (2 subsequent siblings) 3 siblings, 0 replies; 101+ messages in thread From: Gaëtan Rivet @ 2017-10-06 13:31 UTC (permalink / raw) To: Ferruh Yigit; +Cc: Zhiyong Yang, dev, thomas, Nelio Laranjeiro, Declan Doherty On Fri, Oct 06, 2017 at 03:15:40AM +0100, Ferruh Yigit wrote: > On 9/29/2017 8:17 AM, Zhiyong Yang wrote: > > port_id is currently defined as uint8_t, which is limited to the range > > 0 to 255. A larger range is required for vdev scalability. > > > > It is necessary for a redefinition of port_id to extend it from > > 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will > > be changed at the same time. > > > > Discussion about port_id is the following thread. > > http://www.dpdk.org/dev/patchwork/patch/23208/ > > > > Changes in V2: > > 1. cover more PMDs to increase port_id range. > > 2. cover more examples to increase port_id range. > > 3. add 17.11 release note. > > > > Changes in V3: > > 1. cover mlx4 and mlx5. > > 2. add to increase port_id range in test code. > > 3. The patch "librte_mbuf: modify port initialization value" is merged > > into the patchset. > > > > Changes in V4: > > 1. Add a patch to remove bonding APIs using ABI versioning according to > > Ferruh's comments. > > 2. Unify to use typedef portid_t in testpmd code. > > 3. update release note deprecation doc in 2/5 > > 4. fix some issues according to comments. > > > > Changes in V5: > > 1. For 1/5, bond_mode_8023ad_conf_get_v1708() and bond_mode_8023ad_conf > > _get() are merged into one function bond_mode_8023ad_conf_get. > > > > Changes in V6: > > 1. For 2/5, remove the unnecessary LIBABIVER in Makefile and update > > the release notes "Shared Library Versions". > > Note: The patchset have dependency on the following patch. > > http://www.dpdk.org/dev/patchwork/patch/28738/ > > http://www.dpdk.org/dev/patchwork/patch/29219/ > > > > Note: 3/5 and 4/5 patches' building depends on 2/5 patch since 2/5 patch > > breaks lib/PMD API/ABI. > > > > Zhiyong Yang (5): > > net/bonding: remove bonding APIs using ABI versioning > > ethdev: increase port_id range > > examples: increase port_id range > > test: increase port_id range > > librte_mbuf: modify port initialization value > > Series applied to dpdk-next-net/master, thanks. > > There was merge conflict for: > rte_eth_bond_pmd.c > failsafe_private.h > mlx5_rxtx.h > > Maintainers of these files cc'ed, can you please double check latest > files in next-net? Hello Ferruh, The only potential conflicts I see are on the event callbacks 8<----- int failsafe_eth_rmv_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *arg, void *out); int failsafe_eth_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type event, void *cb_arg, void *out); ----->8 and I see no issue there on next-net. Let me know if you want me to check something specific. Regards, -- Gaëtan Rivet 6WIND ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v6 0/5] increase port_id range 2017-10-06 2:15 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit 2017-10-06 13:31 ` Gaëtan Rivet @ 2017-10-06 14:29 ` Thomas Monjalon 2017-10-06 16:02 ` Thomas Monjalon 2017-10-11 21:21 ` Ferruh Yigit 3 siblings, 0 replies; 101+ messages in thread From: Thomas Monjalon @ 2017-10-06 14:29 UTC (permalink / raw) To: Ferruh Yigit, Zhiyong Yang Cc: dev, Nelio Laranjeiro, Gaetan Rivet, Declan Doherty 06/10/2017 04:15, Ferruh Yigit: > On 9/29/2017 8:17 AM, Zhiyong Yang wrote: > > port_id is currently defined as uint8_t, which is limited to the range > > 0 to 255. A larger range is required for vdev scalability. > > > > It is necessary for a redefinition of port_id to extend it from > > 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will > > be changed at the same time. > > > > Discussion about port_id is the following thread. > > http://www.dpdk.org/dev/patchwork/patch/23208/ > > > > Changes in V2: > > 1. cover more PMDs to increase port_id range. > > 2. cover more examples to increase port_id range. > > 3. add 17.11 release note. > > > > Changes in V3: > > 1. cover mlx4 and mlx5. > > 2. add to increase port_id range in test code. > > 3. The patch "librte_mbuf: modify port initialization value" is merged > > into the patchset. > > > > Changes in V4: > > 1. Add a patch to remove bonding APIs using ABI versioning according to > > Ferruh's comments. > > 2. Unify to use typedef portid_t in testpmd code. > > 3. update release note deprecation doc in 2/5 > > 4. fix some issues according to comments. > > > > Changes in V5: > > 1. For 1/5, bond_mode_8023ad_conf_get_v1708() and bond_mode_8023ad_conf > > _get() are merged into one function bond_mode_8023ad_conf_get. > > > > Changes in V6: > > 1. For 2/5, remove the unnecessary LIBABIVER in Makefile and update > > the release notes "Shared Library Versions". > > Note: The patchset have dependency on the following patch. > > http://www.dpdk.org/dev/patchwork/patch/28738/ > > http://www.dpdk.org/dev/patchwork/patch/29219/ > > > > Note: 3/5 and 4/5 patches' building depends on 2/5 patch since 2/5 patch > > breaks lib/PMD API/ABI. > > > > Zhiyong Yang (5): > > net/bonding: remove bonding APIs using ABI versioning > > ethdev: increase port_id range > > examples: increase port_id range > > test: increase port_id range > > librte_mbuf: modify port initialization value > > Series applied to dpdk-next-net/master, thanks. The patches 2, 3, 4 must be squashed, otherwise compilation fails. Will squash in master branch. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v6 0/5] increase port_id range 2017-10-06 2:15 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit 2017-10-06 13:31 ` Gaëtan Rivet 2017-10-06 14:29 ` Thomas Monjalon @ 2017-10-06 16:02 ` Thomas Monjalon 2017-10-11 21:21 ` Ferruh Yigit 3 siblings, 0 replies; 101+ messages in thread From: Thomas Monjalon @ 2017-10-06 16:02 UTC (permalink / raw) To: Ferruh Yigit, Nelio Laranjeiro Cc: dev, Zhiyong Yang, Gaetan Rivet, Declan Doherty 06/10/2017 04:15, Ferruh Yigit: > On 9/29/2017 8:17 AM, Zhiyong Yang wrote: > > Zhiyong Yang (5): > > net/bonding: remove bonding APIs using ABI versioning > > ethdev: increase port_id range > > examples: increase port_id range > > test: increase port_id range > > librte_mbuf: modify port initialization value > > Series applied to dpdk-next-net/master, thanks. > > There was merge conflict for: > rte_eth_bond_pmd.c > failsafe_private.h > mlx5_rxtx.h > > Maintainers of these files cc'ed, can you please double check latest > files in next-net? I have re-done the merge of this series in master because it was wrong for mlx5, as notified by Nelio. ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v6 0/5] increase port_id range 2017-10-06 2:15 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit ` (2 preceding siblings ...) 2017-10-06 16:02 ` Thomas Monjalon @ 2017-10-11 21:21 ` Ferruh Yigit 2017-10-12 1:33 ` Yang, Zhiyong 3 siblings, 1 reply; 101+ messages in thread From: Ferruh Yigit @ 2017-10-11 21:21 UTC (permalink / raw) To: Zhiyong Yang, dev; +Cc: thomas, Nelio Laranjeiro, Gaetan Rivet, Declan Doherty On 10/6/2017 3:15 AM, Ferruh Yigit wrote: > On 9/29/2017 8:17 AM, Zhiyong Yang wrote: >> port_id is currently defined as uint8_t, which is limited to the range >> 0 to 255. A larger range is required for vdev scalability. >> >> It is necessary for a redefinition of port_id to extend it from >> 1 bytes to 2 bytes. All ethdev APIs and usages related to port_id will >> be changed at the same time. >> >> Discussion about port_id is the following thread. >> http://www.dpdk.org/dev/patchwork/patch/23208/ >> >> Changes in V2: >> 1. cover more PMDs to increase port_id range. >> 2. cover more examples to increase port_id range. >> 3. add 17.11 release note. >> >> Changes in V3: >> 1. cover mlx4 and mlx5. >> 2. add to increase port_id range in test code. >> 3. The patch "librte_mbuf: modify port initialization value" is merged >> into the patchset. >> >> Changes in V4: >> 1. Add a patch to remove bonding APIs using ABI versioning according to >> Ferruh's comments. >> 2. Unify to use typedef portid_t in testpmd code. >> 3. update release note deprecation doc in 2/5 >> 4. fix some issues according to comments. >> >> Changes in V5: >> 1. For 1/5, bond_mode_8023ad_conf_get_v1708() and bond_mode_8023ad_conf >> _get() are merged into one function bond_mode_8023ad_conf_get. >> >> Changes in V6: >> 1. For 2/5, remove the unnecessary LIBABIVER in Makefile and update >> the release notes "Shared Library Versions". >> Note: The patchset have dependency on the following patch. >> http://www.dpdk.org/dev/patchwork/patch/28738/ >> http://www.dpdk.org/dev/patchwork/patch/29219/ >> >> Note: 3/5 and 4/5 patches' building depends on 2/5 patch since 2/5 patch >> breaks lib/PMD API/ABI. >> >> Zhiyong Yang (5): >> net/bonding: remove bonding APIs using ABI versioning >> ethdev: increase port_id range >> examples: increase port_id range >> test: increase port_id range >> librte_mbuf: modify port initialization value > > Series applied to dpdk-next-net/master, thanks. Hi Zhiyong, I can see there are more "uint8_t port_id" usage in testpmd: $ git grep -c "uint8_t port_id" cmdline.c:93 config.c:7 testpmd.c:4 testpmd.h:8 I believe there can be false-positives, but can you please check and send a fix patch if required? Thanks, ferruh <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
* Re: [dpdk-dev] [PATCH v6 0/5] increase port_id range 2017-10-11 21:21 ` Ferruh Yigit @ 2017-10-12 1:33 ` Yang, Zhiyong 0 siblings, 0 replies; 101+ messages in thread From: Yang, Zhiyong @ 2017-10-12 1:33 UTC (permalink / raw) To: Yigit, Ferruh, dev Cc: thomas, Nelio Laranjeiro, Gaetan Rivet, Doherty, Declan Hi ferruh, > >> Zhiyong Yang (5): > >> net/bonding: remove bonding APIs using ABI versioning > >> ethdev: increase port_id range > >> examples: increase port_id range > >> test: increase port_id range > >> librte_mbuf: modify port initialization value > > > > Series applied to dpdk-next-net/master, thanks. > > Hi Zhiyong, > > I can see there are more "uint8_t port_id" usage in testpmd: > > $ git grep -c "uint8_t port_id" > cmdline.c:93 > config.c:7 > testpmd.c:4 > testpmd.h:8 > > I believe there can be false-positives, but can you please check and send a fix > patch if required? > Ok. thanks Zhiyong > Thanks, > ferruh > > <...> ^ permalink raw reply [flat|nested] 101+ messages in thread
end of thread, other threads:[~2017-10-12 1:33 UTC | newest] Thread overview: 101+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-08-09 8:42 [dpdk-dev] [PATCH 0/2] increase port_id range Zhiyong Yang 2017-08-09 8:42 ` [dpdk-dev] [PATCH 1/2] ethdev: " Zhiyong Yang 2017-08-09 12:52 ` Ferruh Yigit 2017-08-09 12:57 ` Wiles, Keith 2017-08-10 0:53 ` Yang, Zhiyong 2017-08-10 0:51 ` Yang, Zhiyong 2017-08-09 8:42 ` [dpdk-dev] [PATCH 2/2] examples: " Zhiyong Yang 2017-08-09 14:48 ` Stephen Hemminger 2017-08-10 1:03 ` Yang, Zhiyong 2017-08-09 9:00 ` [dpdk-dev] [PATCH 0/2] " De Lara Guarch, Pablo 2017-08-09 9:17 ` Yang, Zhiyong 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang 2017-09-04 9:06 ` Bruce Richardson 2017-09-04 9:29 ` Ferruh Yigit 2017-09-04 9:47 ` Yang, Zhiyong 2017-09-04 13:12 ` Adrien Mazarguil 2017-09-04 13:17 ` Richardson, Bruce 2017-09-04 13:36 ` Adrien Mazarguil 2017-09-04 13:59 ` Yang, Zhiyong 2017-09-04 14:41 ` Adrien Mazarguil 2017-09-05 6:51 ` Yang, Zhiyong 2017-09-06 8:32 ` Hemant Agrawal 2017-09-06 8:48 ` Yang, Zhiyong [not found] ` <CALZ3Guikt9x8sz-oEKCuDCSp_wtKa64bSXTrMhqcWyg7f_dS7g@mail.gmail.com> 2017-09-07 0:45 ` Yang, Zhiyong 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 2/4] examples: " Zhiyong Yang 2017-09-04 14:15 ` Hunt, David 2017-09-04 15:01 ` Yang, Zhiyong 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 Zhiyong Yang 2017-09-04 7:46 ` Yao, Lei A 2017-09-04 7:59 ` Yang, Zhiyong 2017-09-04 9:09 ` Bruce Richardson 2017-09-04 10:05 ` Yang, Zhiyong 2017-09-04 10:27 ` Ananyev, Konstantin 2017-09-04 14:18 ` Yang, Zhiyong 2017-09-06 8:42 ` Hemant Agrawal 2017-09-06 8:52 ` Yang, Zhiyong 2017-09-04 10:29 ` Bruce Richardson 2017-09-04 9:27 ` Ananyev, Konstantin 2017-09-04 5:57 ` [dpdk-dev] [PATCH v2 4/4] testpmd: add flexibility to mbuf allocation Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang 2017-09-11 9:37 ` Adrien Mazarguil 2017-09-11 10:51 ` Yang, Zhiyong 2017-09-11 10:21 ` Ferruh Yigit 2017-09-13 2:26 ` Yang, Zhiyong 2017-09-13 11:56 ` Ferruh Yigit 2017-09-13 12:15 ` Yang, Zhiyong 2017-09-13 12:18 ` Thomas Monjalon 2017-09-13 13:33 ` Ferruh Yigit 2017-09-19 6:05 ` Yang, Zhiyong 2017-09-19 12:30 ` Wiles, Keith 2017-09-14 12:49 ` Ferruh Yigit 2017-09-15 5:11 ` Yang, Zhiyong 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 2/4] test: " Zhiyong Yang 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 3/4] examples: " Zhiyong Yang 2017-09-14 14:41 ` Ferruh Yigit 2017-09-09 14:47 ` [dpdk-dev] [PATCH v3 4/4] librte_mbuf: modify port initialization value Zhiyong Yang 2017-09-11 10:23 ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Ferruh Yigit 2017-09-11 11:25 ` Yang, Zhiyong 2017-09-13 8:14 ` Matej Vido 2017-09-13 8:21 ` Yang, Zhiyong 2017-09-18 14:54 ` Laatz, Kevin 2017-09-19 1:39 ` Yang, Zhiyong 2017-09-11 10:26 ` Ferruh Yigit 2017-09-11 10:55 ` Yang, Zhiyong 2017-09-11 11:24 ` Ferruh Yigit 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang 2017-09-21 10:36 ` Ferruh Yigit 2017-09-22 2:02 ` Yang, Zhiyong 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range Zhiyong Yang 2017-09-21 11:49 ` Adrien Mazarguil 2017-10-06 14:34 ` Nélio Laranjeiro 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 3/5] examples: " Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 4/5] test: " Zhiyong Yang 2017-09-21 8:32 ` [dpdk-dev] [PATCH v4 5/5] librte_mbuf: modify port initialization value Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang 2017-09-25 11:34 ` Ferruh Yigit 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range Zhiyong Yang 2017-09-25 11:37 ` Ferruh Yigit 2017-09-25 12:06 ` Ferruh Yigit 2017-09-26 7:01 ` Yang, Zhiyong 2017-09-27 18:44 ` Ferruh Yigit 2017-09-28 2:12 ` Yang, Zhiyong 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 3/5] examples: " Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 4/5] test: " Zhiyong Yang 2017-09-25 3:22 ` [dpdk-dev] [PATCH v5 5/5] librte_mbuf: modify port initialization value Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 2/5] ethdev: increase port_id range Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 3/5] examples: " Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 4/5] test: " Zhiyong Yang 2017-09-29 7:17 ` [dpdk-dev] [PATCH v6 5/5] librte_mbuf: modify port initialization value Zhiyong Yang 2017-10-06 2:15 ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit 2017-10-06 13:31 ` Gaëtan Rivet 2017-10-06 14:29 ` Thomas Monjalon 2017-10-06 16:02 ` Thomas Monjalon 2017-10-11 21:21 ` Ferruh Yigit 2017-10-12 1:33 ` Yang, Zhiyong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).