int ret;
RTE_ETH_FOREACH_DEV(pid) {
- struct rte_eth_dev *dev =
- &rte_eth_devices[pid];
+ struct rte_eth_dev_info dev_info;
- ret = rte_dev_dma_unmap(dev->device, memhdr->addr, 0,
- memhdr->len);
+ ret = eth_dev_info_get_print_err(pid, &dev_info);
+ if (ret != 0) {
+ TESTPMD_LOG(DEBUG,
+ "unable to get device info for port %d on addr 0x%p,"
+ "mempool unmapping will not be performed\n",
+ pid, memhdr->addr);
+ continue;
+ }
+
+ ret = rte_dev_dma_unmap(dev_info.device, memhdr->addr, 0, memhdr->len);
if (ret) {
TESTPMD_LOG(DEBUG,
"unable to DMA unmap addr 0x%p "
"for device %s\n",
- memhdr->addr, dev->data->name);
+ memhdr->addr, dev_info.device->name);
}
}
ret = rte_extmem_unregister(memhdr->addr, memhdr->len);
return;
}
RTE_ETH_FOREACH_DEV(pid) {
- struct rte_eth_dev *dev =
- &rte_eth_devices[pid];
+ struct rte_eth_dev_info dev_info;
- ret = rte_dev_dma_map(dev->device, memhdr->addr, 0,
- memhdr->len);
+ ret = eth_dev_info_get_print_err(pid, &dev_info);
+ if (ret != 0) {
+ TESTPMD_LOG(DEBUG,
+ "unable to get device info for port %d on addr 0x%p,"
+ "mempool mapping will not be performed\n",
+ pid, memhdr->addr);
+ continue;
+ }
+ ret = rte_dev_dma_map(dev_info.device, memhdr->addr, 0, memhdr->len);
if (ret) {
TESTPMD_LOG(DEBUG,
"unable to DMA map addr 0x%p "
"for device %s\n",
- memhdr->addr, dev->data->name);
+ memhdr->addr, dev_info.device->name);
}
}
}
if (new_socket_id(socket_id)) {
if (!warning_once && numa_support)
- printf("Warning: NUMA should be configured manually by"
- " using --port-numa-config and"
- " --ring-numa-config parameters along with"
- " --numa.\n");
+ fprintf(stderr,
+ "Warning: NUMA should be configured manually by using --port-numa-config and --ring-numa-config parameters along with --numa.\n");
warning_once = 1;
return -1;
}
allowed_max_rxq = get_allowed_max_nb_rxq(&pid);
if (rxq > allowed_max_rxq) {
- printf("Fail: input rxq (%u) can't be greater "
- "than max_rx_queues (%u) of port %u\n",
- rxq,
- allowed_max_rxq,
- pid);
+ fprintf(stderr,
+ "Fail: input rxq (%u) can't be greater than max_rx_queues (%u) of port %u\n",
+ rxq, allowed_max_rxq, pid);
return -1;
}
return 0;
allowed_max_txq = get_allowed_max_nb_txq(&pid);
if (txq > allowed_max_txq) {
- printf("Fail: input txq (%u) can't be greater "
- "than max_tx_queues (%u) of port %u\n",
- txq,
- allowed_max_txq,
- pid);
+ fprintf(stderr,
+ "Fail: input txq (%u) can't be greater than max_tx_queues (%u) of port %u\n",
+ txq, allowed_max_txq, pid);
return -1;
}
return 0;
allowed_max_rxd = get_allowed_max_nb_rxd(&pid);
if (rxd > allowed_max_rxd) {
- printf("Fail: input rxd (%u) can't be greater "
- "than max_rxds (%u) of port %u\n",
- rxd,
- allowed_max_rxd,
- pid);
+ fprintf(stderr,
+ "Fail: input rxd (%u) can't be greater than max_rxds (%u) of port %u\n",
+ rxd, allowed_max_rxd, pid);
return -1;
}
allowed_min_rxd = get_allowed_min_nb_rxd(&pid);
if (rxd < allowed_min_rxd) {
- printf("Fail: input rxd (%u) can't be less "
- "than min_rxds (%u) of port %u\n",
- rxd,
- allowed_min_rxd,
- pid);
+ fprintf(stderr,
+ "Fail: input rxd (%u) can't be less than min_rxds (%u) of port %u\n",
+ rxd, allowed_min_rxd, pid);
return -1;
}
allowed_max_txd = get_allowed_max_nb_txd(&pid);
if (txd > allowed_max_txd) {
- printf("Fail: input txd (%u) can't be greater "
- "than max_txds (%u) of port %u\n",
- txd,
- allowed_max_txd,
- pid);
+ fprintf(stderr,
+ "Fail: input txd (%u) can't be greater than max_txds (%u) of port %u\n",
+ txd, allowed_max_txd, pid);
return -1;
}
allowed_min_txd = get_allowed_min_nb_txd(&pid);
if (txd < allowed_min_txd) {
- printf("Fail: input txd (%u) can't be less "
- "than min_txds (%u) of port %u\n",
- txd,
- allowed_min_txd,
- pid);
+ fprintf(stderr,
+ "Fail: input txd (%u) can't be less than min_txds (%u) of port %u\n",
+ txd, allowed_min_txd, pid);
return -1;
}
return 0;
allowed_max_hairpinq = get_allowed_max_nb_hairpinq(&pid);
if (hairpinq > allowed_max_hairpinq) {
- printf("Fail: input hairpin (%u) can't be greater "
- "than max_hairpin_queues (%u) of port %u\n",
- hairpinq, allowed_max_hairpinq, pid);
+ fprintf(stderr,
+ "Fail: input hairpin (%u) can't be greater than max_hairpin_queues (%u) of port %u\n",
+ hairpinq, allowed_max_hairpinq, pid);
return -1;
}
return 0;
ret = update_jumbo_frame_offload(pid);
if (ret != 0)
- printf("Updating jumbo frame offload failed for port %u\n",
+ fprintf(stderr,
+ "Updating jumbo frame offload failed for port %u\n",
pid);
if (!(port->dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE))
RTE_ETH_FOREACH_DEV(pid) {
port = &ports[pid];
if (nb_rxq > port->dev_info.max_rx_queues) {
- printf("Fail: nb_rxq(%d) is greater than "
- "max_rx_queues(%d)\n", nb_rxq,
- port->dev_info.max_rx_queues);
+ fprintf(stderr,
+ "Fail: nb_rxq(%d) is greater than max_rx_queues(%d)\n",
+ nb_rxq, port->dev_info.max_rx_queues);
return -1;
}
if (nb_txq > port->dev_info.max_tx_queues) {
- printf("Fail: nb_txq(%d) is greater than "
- "max_tx_queues(%d)\n", nb_txq,
- port->dev_info.max_tx_queues);
+ fprintf(stderr,
+ "Fail: nb_txq(%d) is greater than max_tx_queues(%d)\n",
+ nb_txq, port->dev_info.max_tx_queues);
return -1;
}
if (numa_support) {
q = RTE_MAX(nb_rxq, nb_txq);
if (q == 0) {
- printf("Fail: Cannot allocate fwd streams as number of queues is 0\n");
+ fprintf(stderr,
+ "Fail: Cannot allocate fwd streams as number of queues is 0\n");
return -1;
}
nb_fwd_streams_new = (streamid_t)(nb_ports * q);
diag = rte_eal_remote_launch(pkt_fwd_on_lcore,
fwd_lcores[i], lc_id);
if (diag != 0)
- printf("launch lcore %u failed - diag=%d\n",
- lc_id, diag);
+ fprintf(stderr,
+ "launch lcore %u failed - diag=%d\n",
+ lc_id, diag);
}
}
}
cur_fwd_eng->fwd_mode_name);
if (all_ports_started() == 0) {
- printf("Not all ports were started\n");
+ fprintf(stderr, "Not all ports were started\n");
return;
}
if (test_done == 0) {
- printf("Packet forwarding already started\n");
+ fprintf(stderr, "Packet forwarding already started\n");
return;
}
test_done = 0;
int i;
if (test_done) {
- printf("Packet forwarding not started\n");
+ fprintf(stderr, "Packet forwarding not started\n");
return;
}
printf("Telling cores to stop...");
dev_set_link_up(portid_t pid)
{
if (rte_eth_dev_set_link_up(pid) < 0)
- printf("\nSet link up fail.\n");
+ fprintf(stderr, "\nSet link up fail.\n");
}
void
dev_set_link_down(portid_t pid)
{
if (rte_eth_dev_set_link_down(pid) < 0)
- printf("\nSet link down fail.\n");
+ fprintf(stderr, "\nSet link down fail.\n");
}
static int
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING,
RTE_PORT_STOPPED) == 0)
- printf("Port %d can not be set back "
- "to stopped\n", pi);
- printf("Fail to configure port %d hairpin "
- "queues\n", pi);
+ fprintf(stderr,
+ "Port %d can not be set back to stopped\n", pi);
+ fprintf(stderr, "Fail to configure port %d hairpin queues\n",
+ pi);
/* try to reconfigure queues next time */
port->need_reconfig_queues = 1;
return -1;
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING,
RTE_PORT_STOPPED) == 0)
- printf("Port %d can not be set back "
- "to stopped\n", pi);
- printf("Fail to configure port %d hairpin "
- "queues\n", pi);
+ fprintf(stderr,
+ "Port %d can not be set back to stopped\n", pi);
+ fprintf(stderr, "Fail to configure port %d hairpin queues\n",
+ pi);
/* try to reconfigure queues next time */
port->need_reconfig_queues = 1;
return -1;
port = &ports[pi];
if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STOPPED,
RTE_PORT_HANDLING) == 0) {
- printf("Port %d is now not stopped\n", pi);
+ fprintf(stderr, "Port %d is now not stopped\n", pi);
continue;
}
if (flow_isolate_all) {
int ret = port_flow_isolate(pi, 1);
if (ret) {
- printf("Failed to apply isolated"
- " mode on port %d\n", pi);
+ fprintf(stderr,
+ "Failed to apply isolated mode on port %d\n",
+ pi);
return -1;
}
}
port->socket_id);
if (nb_hairpinq > 0 &&
rte_eth_dev_hairpin_capability_get(pi, &cap)) {
- printf("Port %d doesn't support hairpin "
- "queues\n", pi);
+ fprintf(stderr,
+ "Port %d doesn't support hairpin queues\n",
+ pi);
return -1;
}
/* configure port */
if (diag != 0) {
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
- printf("Port %d can not be set back "
- "to stopped\n", pi);
- printf("Fail to configure port %d\n", pi);
+ fprintf(stderr,
+ "Port %d can not be set back to stopped\n",
+ pi);
+ fprintf(stderr, "Fail to configure port %d\n",
+ pi);
/* try to reconfigure port next time */
port->need_reconfig = 1;
return -1;
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING,
RTE_PORT_STOPPED) == 0)
- printf("Port %d can not be set back "
- "to stopped\n", pi);
- printf("Fail to configure port %d tx queues\n",
- pi);
+ fprintf(stderr,
+ "Port %d can not be set back to stopped\n",
+ pi);
+ fprintf(stderr,
+ "Fail to configure port %d tx queues\n",
+ pi);
/* try to reconfigure queues next time */
port->need_reconfig_queues = 1;
return -1;
mbuf_pool_find
(rxring_numa[pi], 0);
if (mp == NULL) {
- printf("Failed to setup RX queue:"
- "No mempool allocation"
- " on the socket %d\n",
+ fprintf(stderr,
+ "Failed to setup RX queue: No mempool allocation on the socket %d\n",
rxring_numa[pi]);
return -1;
}
mbuf_pool_find
(port->socket_id, 0);
if (mp == NULL) {
- printf("Failed to setup RX queue:"
- "No mempool allocation"
- " on the socket %d\n",
+ fprintf(stderr,
+ "Failed to setup RX queue: No mempool allocation on the socket %d\n",
port->socket_id);
return -1;
}
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING,
RTE_PORT_STOPPED) == 0)
- printf("Port %d can not be set back "
- "to stopped\n", pi);
- printf("Fail to configure port %d rx queues\n",
- pi);
+ fprintf(stderr,
+ "Port %d can not be set back to stopped\n",
+ pi);
+ fprintf(stderr,
+ "Fail to configure port %d rx queues\n",
+ pi);
/* try to reconfigure queues next time */
port->need_reconfig_queues = 1;
return -1;
diag = rte_eth_dev_set_ptypes(pi, RTE_PTYPE_UNKNOWN,
NULL, 0);
if (diag < 0)
- printf(
- "Port %d: Failed to disable Ptype parsing\n",
- pi);
+ fprintf(stderr,
+ "Port %d: Failed to disable Ptype parsing\n",
+ pi);
}
p_pi = pi;
/* start port */
diag = rte_eth_dev_start(pi);
if (diag < 0) {
- printf("Fail to start port %d: %s\n", pi,
- rte_strerror(-diag));
+ fprintf(stderr, "Fail to start port %d: %s\n",
+ pi, rte_strerror(-diag));
/* Fail to setup rx queue, return */
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
- printf("Port %d can not be set back to "
- "stopped\n", pi);
+ fprintf(stderr,
+ "Port %d can not be set back to stopped\n",
+ pi);
continue;
}
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING, RTE_PORT_STARTED) == 0)
- printf("Port %d can not be set into started\n", pi);
+ fprintf(stderr, "Port %d can not be set into started\n",
+ pi);
if (eth_macaddr_get_print_err(pi, &port->eth_addr) == 0)
printf("Port %d: %02X:%02X:%02X:%02X:%02X:%02X\n", pi,
if (need_check_link_status == 1 && !no_link_check)
check_all_ports_link_status(RTE_PORT_ALL);
else if (need_check_link_status == 0)
- printf("Please stop the ports first\n");
+ fprintf(stderr, "Please stop the ports first\n");
if (hairpin_mode & 0xf) {
uint16_t i;
continue;
diag = rte_eth_hairpin_bind(pi, peer_pl[j]);
if (diag < 0) {
- printf("Error during binding hairpin"
- " Tx port %u to %u: %s\n",
- pi, peer_pl[j],
- rte_strerror(-diag));
+ fprintf(stderr,
+ "Error during binding hairpin Tx port %u to %u: %s\n",
+ pi, peer_pl[j],
+ rte_strerror(-diag));
return -1;
}
}
continue;
diag = rte_eth_hairpin_bind(peer_pl[j], pi);
if (diag < 0) {
- printf("Error during binding hairpin"
- " Tx port %u to %u: %s\n",
- peer_pl[j], pi,
- rte_strerror(-diag));
+ fprintf(stderr,
+ "Error during binding hairpin Tx port %u to %u: %s\n",
+ peer_pl[j], pi,
+ rte_strerror(-diag));
return -1;
}
}
continue;
if (port_is_forwarding(pi) != 0 && test_done == 0) {
- printf("Please remove port %d from forwarding configuration.\n", pi);
+ fprintf(stderr,
+ "Please remove port %d from forwarding configuration.\n",
+ pi);
continue;
}
if (port_is_bonding_slave(pi)) {
- printf("Please remove port %d from bonded device.\n", pi);
+ fprintf(stderr,
+ "Please remove port %d from bonded device.\n",
+ pi);
continue;
}
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)
- printf("Port %d can not be set into stopped\n", pi);
+ fprintf(stderr, "Port %d can not be set into stopped\n",
+ pi);
need_check_link_status = 1;
}
if (need_check_link_status && !no_link_check)
continue;
if (port_is_forwarding(pi) != 0 && test_done == 0) {
- printf("Please remove port %d from forwarding configuration.\n", pi);
+ fprintf(stderr,
+ "Please remove port %d from forwarding configuration.\n",
+ pi);
continue;
}
if (port_is_bonding_slave(pi)) {
- printf("Please remove port %d from bonded device.\n", pi);
+ fprintf(stderr,
+ "Please remove port %d from bonded device.\n",
+ pi);
continue;
}
port = &ports[pi];
if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_CLOSED, RTE_PORT_CLOSED) == 1) {
- printf("Port %d is already closed\n", pi);
+ fprintf(stderr, "Port %d is already closed\n", pi);
continue;
}
if ((pid == (portid_t)RTE_PORT_ALL && !all_ports_stopped()) ||
(pid != (portid_t)RTE_PORT_ALL && !port_is_stopped(pid))) {
- printf("Can not reset port(s), please stop port(s) first.\n");
+ fprintf(stderr,
+ "Can not reset port(s), please stop port(s) first.\n");
return;
}
continue;
if (port_is_forwarding(pi) != 0 && test_done == 0) {
- printf("Please remove port %d from forwarding "
- "configuration.\n", pi);
+ fprintf(stderr,
+ "Please remove port %d from forwarding configuration.\n",
+ pi);
continue;
}
if (port_is_bonding_slave(pi)) {
- printf("Please remove port %d from bonded device.\n",
- pi);
+ fprintf(stderr,
+ "Please remove port %d from bonded device.\n",
+ pi);
continue;
}
port->need_reconfig = 1;
port->need_reconfig_queues = 1;
} else {
- printf("Failed to reset port %d. diag=%d\n", pi, diag);
+ fprintf(stderr, "Failed to reset port %d. diag=%d\n",
+ pi, diag);
}
}
printf("Attaching a new port...\n");
if (identifier == NULL) {
- printf("Invalid parameters are specified\n");
+ fprintf(stderr, "Invalid parameters are specified\n");
return;
}
reconfig(pi, socket_id);
ret = rte_eth_promiscuous_enable(pi);
if (ret != 0)
- printf("Error during enabling promiscuous mode for port %u: %s - ignore\n",
+ fprintf(stderr,
+ "Error during enabling promiscuous mode for port %u: %s - ignore\n",
pi, rte_strerror(-ret));
ports_ids[nb_ports++] = pi;
portid_t sibling;
if (dev == NULL) {
- printf("Device already removed\n");
+ fprintf(stderr, "Device already removed\n");
return;
}
RTE_ETH_FOREACH_DEV_OF(sibling, dev) {
if (ports[sibling].port_status != RTE_PORT_CLOSED) {
if (ports[sibling].port_status != RTE_PORT_STOPPED) {
- printf("Port %u not stopped\n", sibling);
+ fprintf(stderr, "Port %u not stopped\n",
+ sibling);
return;
}
port_flow_flush(sibling);
void
detach_port_device(portid_t port_id)
{
+ int ret;
+ struct rte_eth_dev_info dev_info;
+
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
if (ports[port_id].port_status != RTE_PORT_CLOSED) {
if (ports[port_id].port_status != RTE_PORT_STOPPED) {
- printf("Port not stopped\n");
+ fprintf(stderr, "Port not stopped\n");
return;
}
- printf("Port was not closed\n");
+ fprintf(stderr, "Port was not closed\n");
}
- detach_device(rte_eth_devices[port_id].device);
+ ret = eth_dev_info_get_print_err(port_id, &dev_info);
+ if (ret != 0) {
+ TESTPMD_LOG(ERR,
+ "Failed to get device info for port %d, not detaching\n",
+ port_id);
+ return;
+ }
+ detach_device(dev_info.device);
}
void
memset(&da, 0, sizeof(da));
if (rte_devargs_parsef(&da, "%s", identifier)) {
- printf("cannot parse identifier\n");
+ fprintf(stderr, "cannot parse identifier\n");
return;
}
RTE_ETH_FOREACH_MATCHING_DEV(port_id, identifier, &iterator) {
if (ports[port_id].port_status != RTE_PORT_CLOSED) {
if (ports[port_id].port_status != RTE_PORT_STOPPED) {
- printf("Port %u not stopped\n", port_id);
+ fprintf(stderr, "Port %u not stopped\n",
+ port_id);
rte_eth_iterator_cleanup(&iterator);
rte_devargs_reset(&da);
return;
if (ret < 0) {
all_ports_up = 0;
if (print_flag == 1)
- printf("Port %u link get failed: %s\n",
+ fprintf(stderr,
+ "Port %u link get failed: %s\n",
portid, rte_strerror(-ret));
continue;
}
int need_to_start = 0;
int org_no_link_check = no_link_check;
portid_t port_id = (intptr_t)arg;
- struct rte_device *dev;
+ struct rte_eth_dev_info dev_info;
+ int ret;
RTE_ETH_VALID_PORTID_OR_RET(port_id);
stop_port(port_id);
no_link_check = org_no_link_check;
- /* Save rte_device pointer before closing ethdev port */
- dev = rte_eth_devices[port_id].device;
- close_port(port_id);
- detach_device(dev); /* might be already removed or have more ports */
-
+ ret = eth_dev_info_get_print_err(port_id, &dev_info);
+ if (ret != 0)
+ TESTPMD_LOG(ERR,
+ "Failed to get device info for port %d, not detaching\n",
+ port_id);
+ else {
+ struct rte_device *device = dev_info.device;
+ close_port(port_id);
+ detach_device(device); /* might be already removed or have more ports */
+ }
if (need_to_start)
start_packet_forwarding(0);
}
RTE_SET_USED(ret_param);
if (type >= RTE_ETH_EVENT_MAX) {
- fprintf(stderr, "\nPort %" PRIu16 ": %s called upon invalid event %d\n",
+ fprintf(stderr,
+ "\nPort %" PRIu16 ": %s called upon invalid event %d\n",
port_id, __func__, type);
fflush(stderr);
} else if (event_print_mask & (UINT32_C(1) << type)) {
break;
if (rte_eal_alarm_set(100000,
rmv_port_callback, (void *)(intptr_t)port_id))
- fprintf(stderr, "Could not set up deferred device removal\n");
+ fprintf(stderr,
+ "Could not set up deferred device removal\n");
break;
case RTE_ETH_EVENT_DESTROY:
ports[port_id].port_status = RTE_PORT_CLOSED;
on = false;
} else {
if ((port->dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) == 0) {
- printf("Frame size (%u) is not supported by port %u\n",
+ fprintf(stderr,
+ "Frame size (%u) is not supported by port %u\n",
port->dev_conf.rxmode.max_rx_pkt_len,
portid);
return -1;
ret = rte_eth_dev_set_mtu(portid,
port->dev_conf.rxmode.max_rx_pkt_len - eth_overhead);
if (ret)
- printf("Failed to set MTU to %u for port %u\n",
+ fprintf(stderr,
+ "Failed to set MTU to %u for port %u\n",
port->dev_conf.rxmode.max_rx_pkt_len - eth_overhead,
portid);
}
rte_pmd_ixgbe_bypass_init(pid);
#endif
- if (lsc_interrupt &&
- (rte_eth_devices[pid].data->dev_flags &
- RTE_ETH_DEV_INTR_LSC))
+ if (lsc_interrupt && (*port->dev_info.dev_flags & RTE_ETH_DEV_INTR_LSC))
port->dev_conf.intr_conf.lsc = 1;
- if (rmv_interrupt &&
- (rte_eth_devices[pid].data->dev_flags &
- RTE_ETH_DEV_INTR_RMV))
+ if (rmv_interrupt && (*port->dev_info.dev_flags & RTE_ETH_DEV_INTR_RMV))
port->dev_conf.intr_conf.rmv = 1;
}
}
uint8_t port_is_bonding_slave(portid_t slave_pid)
{
struct rte_port *port;
+ struct rte_eth_dev_info dev_info;
+ int ret;
port = &ports[slave_pid];
- if ((rte_eth_devices[slave_pid].data->dev_flags &
- RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
+ ret = eth_dev_info_get_print_err(slave_pid, &dev_info);
+ if (ret != 0) {
+ TESTPMD_LOG(ERR,
+ "Failed to get device info for port id %d,"
+ "cannot determine if the port is a bonded slave",
+ slave_pid);
+ return 0;
+ }
+ if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1))
return 1;
return 0;
}
*/
if (dcb_mode == DCB_VT_ENABLED &&
rte_port->dev_info.vmdq_pool_base > 0) {
- printf("VMDQ_DCB multi-queue mode is nonsensical"
- " for port %d.", pid);
+ fprintf(stderr,
+ "VMDQ_DCB multi-queue mode is nonsensical for port %d.\n",
+ pid);
return -1;
}
signal_handler(int signum)
{
if (signum == SIGINT || signum == SIGTERM) {
- printf("\nSignal %d received, preparing to exit...\n",
- signum);
+ fprintf(stderr, "\nSignal %d received, preparing to exit...\n",
+ signum);
#ifdef RTE_LIB_PDUMP
/* uninitialize packet capture framework */
rte_pdump_uninit();
"interactive mode.\n");
if (tx_first && lsc_interrupt) {
- printf("Warning: lsc_interrupt needs to be off when "
- " using tx_first. Disabling.\n");
+ fprintf(stderr,
+ "Warning: lsc_interrupt needs to be off when using tx_first. Disabling.\n");
lsc_interrupt = 0;
}
if (!nb_rxq && !nb_txq)
- printf("Warning: Either rx or tx queues should be non-zero\n");
+ fprintf(stderr,
+ "Warning: Either rx or tx queues should be non-zero\n");
if (nb_rxq > 1 && nb_rxq > nb_txq)
- printf("Warning: nb_rxq=%d enables RSS configuration, "
- "but nb_txq=%d will prevent to fully test it.\n",
- nb_rxq, nb_txq);
+ fprintf(stderr,
+ "Warning: nb_rxq=%d enables RSS configuration, but nb_txq=%d will prevent to fully test it.\n",
+ nb_rxq, nb_txq);
init_config();
RTE_ETH_FOREACH_DEV(port_id) {
ret = rte_eth_promiscuous_enable(port_id);
if (ret != 0)
- printf("Error during enabling promiscuous mode for port %u: %s - ignore\n",
+ fprintf(stderr,
+ "Error during enabling promiscuous mode for port %u: %s - ignore\n",
port_id, rte_strerror(-ret));
}
if (latencystats_enabled != 0) {
int ret = rte_latencystats_init(1, NULL);
if (ret)
- printf("Warning: latencystats init()"
- " returned error %d\n", ret);
- printf("Latencystats running on lcore %d\n",
+ fprintf(stderr,
+ "Warning: latencystats init() returned error %d\n",
+ ret);
+ fprintf(stderr, "Latencystats running on lcore %d\n",
latencystats_lcore_id);
}
#endif