volatile int test_done = 1; /* stop packet forwarding when set to 1. */
-struct queue_stats_mappings tx_queue_stats_mappings_array[MAX_TX_QUEUE_STATS_MAPPINGS];
-struct queue_stats_mappings rx_queue_stats_mappings_array[MAX_RX_QUEUE_STATS_MAPPINGS];
-
-struct queue_stats_mappings *tx_queue_stats_mappings = tx_queue_stats_mappings_array;
-struct queue_stats_mappings *rx_queue_stats_mappings = rx_queue_stats_mappings_array;
-
-uint16_t nb_tx_queue_stats_mappings = 0;
-uint16_t nb_rx_queue_stats_mappings = 0;
-
/*
* Display zero values by default for xstats
*/
/* Forward function declarations */
static void setup_attached_port(portid_t pi);
-static void map_port_queue_stats_mapping_registers(portid_t pi,
- struct rte_port *port);
static void check_all_ports_link_status(uint32_t port_mask);
static int eth_event_callback(portid_t port_id,
enum rte_eth_event_type type,
struct rte_gro_param gro_param;
uint32_t gso_types;
uint16_t data_size;
+ uint16_t eth_overhead;
bool warning = 0;
int k;
int ret;
rte_exit(EXIT_FAILURE,
"rte_eth_dev_info_get() failed\n");
+ /* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */
+ if (port->dev_info.max_mtu != UINT16_MAX &&
+ port->dev_info.max_rx_pktlen > port->dev_info.max_mtu)
+ eth_overhead = port->dev_info.max_rx_pktlen -
+ port->dev_info.max_mtu;
+ else
+ eth_overhead =
+ RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
+
+ if (port->dev_conf.rxmode.max_rx_pkt_len <=
+ (uint32_t)(RTE_ETHER_MTU + eth_overhead))
+ port->dev_conf.rxmode.max_rx_pkt_len =
+ RTE_ETHER_MTU + eth_overhead;
+ else
+ port->dev_conf.rxmode.offloads |=
+ DEV_RX_OFFLOAD_JUMBO_FRAME;
+
if (!(port->dev_info.tx_offload_capa &
DEV_TX_OFFLOAD_MBUF_FAST_FREE))
port->dev_conf.txmode.offloads &=
fwd_cycles += fs->core_cycles;
}
for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- uint8_t j;
-
pt_id = fwd_ports_ids[i];
port = &ports[pt_id];
printf("\n %s Forward statistics for port %-2d %s\n",
fwd_stats_border, pt_id, fwd_stats_border);
- if (!port->rx_queue_stats_mapping_enabled &&
- !port->tx_queue_stats_mapping_enabled) {
- printf(" RX-packets: %-14"PRIu64
- " RX-dropped: %-14"PRIu64
- "RX-total: %-"PRIu64"\n",
- stats.ipackets, stats.imissed,
- stats.ipackets + stats.imissed);
-
- if (cur_fwd_eng == &csum_fwd_engine)
- printf(" Bad-ipcsum: %-14"PRIu64
- " Bad-l4csum: %-14"PRIu64
- "Bad-outer-l4csum: %-14"PRIu64"\n",
- ports_stats[pt_id].rx_bad_ip_csum,
- ports_stats[pt_id].rx_bad_l4_csum,
- ports_stats[pt_id].rx_bad_outer_l4_csum);
- if (stats.ierrors + stats.rx_nombuf > 0) {
- printf(" RX-error: %-"PRIu64"\n",
- stats.ierrors);
- printf(" RX-nombufs: %-14"PRIu64"\n",
- stats.rx_nombuf);
- }
-
- printf(" TX-packets: %-14"PRIu64
- " TX-dropped: %-14"PRIu64
- "TX-total: %-"PRIu64"\n",
- stats.opackets, ports_stats[pt_id].tx_dropped,
- stats.opackets + ports_stats[pt_id].tx_dropped);
- } else {
- printf(" RX-packets: %14"PRIu64
- " RX-dropped:%14"PRIu64
- " RX-total:%14"PRIu64"\n",
- stats.ipackets, stats.imissed,
- stats.ipackets + stats.imissed);
-
- if (cur_fwd_eng == &csum_fwd_engine)
- printf(" Bad-ipcsum:%14"PRIu64
- " Bad-l4csum:%14"PRIu64
- " Bad-outer-l4csum: %-14"PRIu64"\n",
- ports_stats[pt_id].rx_bad_ip_csum,
- ports_stats[pt_id].rx_bad_l4_csum,
- ports_stats[pt_id].rx_bad_outer_l4_csum);
- if ((stats.ierrors + stats.rx_nombuf) > 0) {
- printf(" RX-error:%"PRIu64"\n", stats.ierrors);
- printf(" RX-nombufs: %14"PRIu64"\n",
- stats.rx_nombuf);
- }
+ printf(" RX-packets: %-14"PRIu64" RX-dropped: %-14"PRIu64
+ "RX-total: %-"PRIu64"\n", stats.ipackets, stats.imissed,
+ stats.ipackets + stats.imissed);
- printf(" TX-packets: %14"PRIu64
- " TX-dropped:%14"PRIu64
- " TX-total:%14"PRIu64"\n",
- stats.opackets, ports_stats[pt_id].tx_dropped,
- stats.opackets + ports_stats[pt_id].tx_dropped);
+ if (cur_fwd_eng == &csum_fwd_engine)
+ printf(" Bad-ipcsum: %-14"PRIu64
+ " Bad-l4csum: %-14"PRIu64
+ "Bad-outer-l4csum: %-14"PRIu64"\n",
+ ports_stats[pt_id].rx_bad_ip_csum,
+ ports_stats[pt_id].rx_bad_l4_csum,
+ ports_stats[pt_id].rx_bad_outer_l4_csum);
+ if (stats.ierrors + stats.rx_nombuf > 0) {
+ printf(" RX-error: %-"PRIu64"\n", stats.ierrors);
+ printf(" RX-nombufs: %-14"PRIu64"\n", stats.rx_nombuf);
}
+ printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64
+ "TX-total: %-"PRIu64"\n",
+ stats.opackets, ports_stats[pt_id].tx_dropped,
+ stats.opackets + ports_stats[pt_id].tx_dropped);
+
if (record_burst_stats) {
if (ports_stats[pt_id].rx_stream)
pkt_burst_stats_display("RX",
&ports_stats[pt_id].rx_stream->rx_burst_stats);
if (ports_stats[pt_id].tx_stream)
pkt_burst_stats_display("TX",
- &ports_stats[pt_id].tx_stream->tx_burst_stats);
- }
-
- if (port->rx_queue_stats_mapping_enabled) {
- printf("\n");
- for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
- printf(" Stats reg %2d RX-packets:%14"PRIu64
- " RX-errors:%14"PRIu64
- " RX-bytes:%14"PRIu64"\n",
- j, stats.q_ipackets[j],
- stats.q_errors[j], stats.q_ibytes[j]);
- }
- printf("\n");
- }
- if (port->tx_queue_stats_mapping_enabled) {
- for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
- printf(" Stats reg %2d TX-packets:%14"PRIu64
- " TX-bytes:%14"
- PRIu64"\n",
- j, stats.q_opackets[j],
- stats.q_obytes[j]);
- }
+ &ports_stats[pt_id].tx_stream->tx_burst_stats);
}
printf(" %s--------------------------------%s\n",
rxtx_config_display();
fwd_stats_reset();
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
- port = &ports[pt_id];
- map_port_queue_stats_mapping_registers(pt_id, port);
- }
if (with_tx_first) {
port_fwd_begin = tx_only_engine.port_fwd_begin;
if (port_fwd_begin != NULL) {
}
}
+ if (port->flow_list)
+ port_flow_flush(pi);
+
if (rte_eth_dev_stop(pi) != 0)
RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n",
pi);
}
}
-static int
-set_tx_queue_stats_mapping_registers(portid_t port_id, struct rte_port *port)
-{
- uint16_t i;
- int diag;
- uint8_t mapping_found = 0;
-
- for (i = 0; i < nb_tx_queue_stats_mappings; i++) {
- if ((tx_queue_stats_mappings[i].port_id == port_id) &&
- (tx_queue_stats_mappings[i].queue_id < nb_txq )) {
- diag = rte_eth_dev_set_tx_queue_stats_mapping(port_id,
- tx_queue_stats_mappings[i].queue_id,
- tx_queue_stats_mappings[i].stats_counter_id);
- if (diag != 0)
- return diag;
- mapping_found = 1;
- }
- }
- if (mapping_found)
- port->tx_queue_stats_mapping_enabled = 1;
- return 0;
-}
-
-static int
-set_rx_queue_stats_mapping_registers(portid_t port_id, struct rte_port *port)
-{
- uint16_t i;
- int diag;
- uint8_t mapping_found = 0;
-
- for (i = 0; i < nb_rx_queue_stats_mappings; i++) {
- if ((rx_queue_stats_mappings[i].port_id == port_id) &&
- (rx_queue_stats_mappings[i].queue_id < nb_rxq )) {
- diag = rte_eth_dev_set_rx_queue_stats_mapping(port_id,
- rx_queue_stats_mappings[i].queue_id,
- rx_queue_stats_mappings[i].stats_counter_id);
- if (diag != 0)
- return diag;
- mapping_found = 1;
- }
- }
- if (mapping_found)
- port->rx_queue_stats_mapping_enabled = 1;
- return 0;
-}
-
-static void
-map_port_queue_stats_mapping_registers(portid_t pi, struct rte_port *port)
-{
- int diag = 0;
-
- diag = set_tx_queue_stats_mapping_registers(pi, port);
- if (diag != 0) {
- if (diag == -ENOTSUP) {
- port->tx_queue_stats_mapping_enabled = 0;
- printf("TX queue stats mapping not supported port id=%d\n", pi);
- }
- else
- rte_exit(EXIT_FAILURE,
- "set_tx_queue_stats_mapping_registers "
- "failed for port id=%d diag=%d\n",
- pi, diag);
- }
-
- diag = set_rx_queue_stats_mapping_registers(pi, port);
- if (diag != 0) {
- if (diag == -ENOTSUP) {
- port->rx_queue_stats_mapping_enabled = 0;
- printf("RX queue stats mapping not supported port id=%d\n", pi);
- }
- else
- rte_exit(EXIT_FAILURE,
- "set_rx_queue_stats_mapping_registers "
- "failed for port id=%d diag=%d\n",
- pi, diag);
- }
-}
-
static void
rxtx_port_config(struct rte_port *port)
{
if (ret != 0)
return;
- map_port_queue_stats_mapping_registers(pid, port);
#if defined RTE_NET_IXGBE && defined RTE_LIBRTE_IXGBE_BYPASS
rte_pmd_ixgbe_bypass_init(pid);
#endif
if (retval != 0)
return retval;
- map_port_queue_stats_mapping_registers(pid, rte_port);
-
rte_port->dcb_flag = 1;
return 0;