#include "l2fwd_common.h"
int
l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
{
uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
.split_hdr_size = 0,
},
.txmode = {
},
};
uint16_t nb_ports_available = 0;
uint16_t port_id;
int ret;
if (rsrc->event_mode) {
}
if ((rsrc->enabled_port_mask & (1 << port_id)) == 0) {
printf("Skipping disabled port %u\n", port_id);
continue;
}
nb_ports_available++;
printf("Initializing port %u... ", port_id);
fflush(stdout);
if (ret != 0)
rte_panic(
"Error during getting device (port %u) info: %s\n",
port_id, strerror(-ret));
printf("Port %u modified RSS hash function based on hardware support,"
"requested:%#"PRIx64" configured:%#"PRIx64"",
port_id,
}
if (ret < 0)
rte_panic(
"Cannot configure device: err=%d, port=%u\n",
ret, port_id);
&nb_txd);
if (ret < 0)
rte_panic(
"Cannot adjust number of descriptors: err=%d, port=%u\n",
ret, port_id);
fflush(stdout);
&rxq_conf,
rsrc->pktmbuf_pool);
if (ret < 0)
rte_panic(
"rte_eth_rx_queue_setup:err=%d, port=%u\n",
ret, port_id);
fflush(stdout);
&txq_conf);
if (ret < 0)
rte_panic(
"rte_eth_tx_queue_setup:err=%d, port=%u\n",
ret, port_id);
printf("Port %u,MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
port_id,
rsrc->eth_addr[port_id].addr_bytes[0],
rsrc->eth_addr[port_id].addr_bytes[1],
rsrc->eth_addr[port_id].addr_bytes[2],
rsrc->eth_addr[port_id].addr_bytes[3],
rsrc->eth_addr[port_id].addr_bytes[4],
rsrc->eth_addr[port_id].addr_bytes[5]);
}
return nb_ports_available;
}