ethdev: increase port id range

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>
This commit is contained in:
Zhiyong Yang 2017-09-29 15:17:24 +08:00 committed by Thomas Monjalon
parent 2db978d04b
commit f8244c6399
142 changed files with 1392 additions and 1331 deletions

View File

@ -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];

View File

@ -4602,7 +4602,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,
@ -4611,7 +4611,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;
@ -11527,7 +11527,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;
};

View File

@ -360,7 +360,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;
@ -393,7 +393,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;

View File

@ -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, &timestamp, 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;

View File

@ -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);

View File

@ -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++) {

View File

@ -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);

View File

@ -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;

View File

@ -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.

View File

@ -41,6 +41,12 @@ 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.
* **nfp: Added PF support.**
Previously Netronome's NFP PMD had just support for VFs. PF support is
@ -161,7 +167,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
-----------------------
@ -182,13 +191,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
@ -203,14 +212,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

View File

@ -76,7 +76,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;

View File

@ -646,7 +646,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",

View File

@ -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 */

View File

@ -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 */
};

View File

@ -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)

View File

@ -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;

View File

@ -548,13 +548,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)

View File

@ -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;

View File

@ -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 */

View File

@ -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;
@ -476,7 +476,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;
@ -569,7 +569,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)
{
@ -597,7 +597,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;
@ -624,7 +624,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;
@ -650,7 +650,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;
@ -678,7 +678,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;
@ -755,7 +755,7 @@ exit:
}
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;
@ -792,7 +792,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;

View File

@ -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_ */

View File

@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_bond_version.map
LIBABIVER := 1
LIBABIVER := 2
#
# all source are stored in SRCS-y

View File

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

View File

@ -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 @@ free_out:
}
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];

View File

@ -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_ */

View File

@ -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_ */

View File

@ -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 *);

View File

@ -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);

View File

@ -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;

View File

@ -166,7 +166,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;
}

View File

@ -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_eth_dev_info slave_info;
struct rte_flow_error error;
struct bond_dev_private *internals = (struct bond_dev_private *)
@ -216,12 +216,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;
uint8_t idx;
uint16_t idx;
/* Verify if all slaves in bonding supports flow director and */
if (internals->slave_count > 0) {
@ -241,7 +241,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 *)
@ -281,10 +281,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 */
@ -313,8 +313,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;
@ -405,8 +405,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;
@ -684,8 +684,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;
@ -915,7 +915,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;
@ -981,10 +981,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;
@ -1070,7 +1070,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;
@ -1189,8 +1189,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;
@ -1250,8 +1250,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;
@ -1344,7 +1344,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;
@ -1872,7 +1872,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;
@ -2136,7 +2136,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 */
@ -2148,7 +2148,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)
@ -2288,7 +2288,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;
@ -2477,7 +2477,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;
@ -2962,7 +2962,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] = {
@ -3097,7 +3097,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,
@ -3110,7 +3110,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",

View File

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

View File

@ -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 {

View File

@ -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. */

View File

@ -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. */

View File

@ -434,7 +434,7 @@ failsafe_stats_increment(struct rte_eth_stats *to, struct rte_eth_stats *from)
}
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)
{
@ -453,7 +453,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)
{

View File

@ -185,10 +185,10 @@ int failsafe_eth_dev_state_sync(struct rte_eth_dev *dev);
void failsafe_dev_remove(struct rte_eth_dev *dev);
void failsafe_stats_increment(struct rte_eth_stats *to,
struct rte_eth_stats *from);
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);

View File

@ -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;

View File

@ -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)

View File

@ -1950,8 +1950,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;
}

View File

@ -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;

View File

@ -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;
@ -600,7 +600,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;
@ -635,7 +635,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;
@ -700,7 +700,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;
@ -766,7 +766,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;
@ -860,7 +860,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;
@ -943,7 +943,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)
{
@ -988,7 +988,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;
@ -1022,7 +1022,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;
@ -1111,7 +1111,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;
@ -1225,7 +1225,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;
@ -1343,7 +1343,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;
@ -1515,7 +1515,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);
@ -1559,7 +1559,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)
{
@ -2038,7 +2038,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;
@ -2168,7 +2168,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)
@ -2204,7 +2204,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;
@ -2221,7 +2221,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,
@ -2255,7 +2255,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)

View File

@ -182,7 +182,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.
@ -199,7 +199,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);
@ -218,7 +218,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);
@ -235,7 +235,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);
/**
@ -253,7 +253,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);
@ -272,7 +272,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);
@ -296,7 +296,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);
/**
@ -316,7 +316,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
@ -334,7 +334,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);
/**
@ -353,7 +353,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);
/**
@ -372,7 +372,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
@ -393,7 +393,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);
/**
@ -418,7 +418,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);
@ -434,7 +434,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);
/**
@ -459,7 +459,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);
@ -484,7 +484,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);
@ -509,7 +509,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);
@ -527,7 +527,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
@ -548,7 +548,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);
@ -586,7 +586,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
@ -606,7 +606,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);
@ -618,7 +618,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
@ -637,7 +637,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,
@ -657,7 +657,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);

View File

@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
EXPORT_MAP := rte_pmd_ixgbe_version.map
LIBABIVER := 1
LIBABIVER := 2
ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
#

View File

@ -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;
}

View File

@ -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. */

View File

@ -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;

View File

@ -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);
/**

View File

@ -106,13 +106,13 @@ 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 :7; /* Remaining bits. */
unsigned int :15; /* 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;

View File

@ -1353,12 +1353,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,
@ -1662,7 +1662,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);
}
@ -2001,9 +2001,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;
}
@ -2087,7 +2087,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;
@ -2098,7 +2098,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;

View File

@ -256,7 +256,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;

View File

@ -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];

View File

@ -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];

View File

@ -104,7 +104,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;

View File

@ -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 */

View File

@ -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;

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -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
}

View File

@ -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;

View File

@ -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. */
};

View File

@ -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_ */

View File

@ -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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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())

View File

@ -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);

View File

@ -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);

View File

@ -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 */

View File

@ -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)

View File

@ -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],

View File

@ -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],

View File

@ -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],

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 */

View File

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

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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];

View File

@ -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)

View File

@ -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;

View File

@ -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];

View File

@ -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];

View File

@ -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 */

View File

@ -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");

View File

@ -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;

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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_ */

View File

@ -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);

View File

@ -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)];

View File

@ -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];
};

View File

@ -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;

Some files were not shown because too many files have changed in this diff Show More