}
}
- rte_eth_promiscuous_enable(port_id);
+ ret = rte_eth_promiscuous_enable(port_id);
+ if (ret != 0) {
+ printf("Cannot enable promiscuous mode: err=%s, port=%u\n",
+ rte_strerror(-ret), port_id);
+ return ret;
+ }
rte_eth_macaddr_get(port_id, &bbdev_port_eth_addr);
print_mac(port_id, &bbdev_port_eth_addr);
rte_exit(-1, "\nFailed to activate slaves\n");
}
- rte_eth_promiscuous_enable(BOND_PORT);
+ retval = rte_eth_promiscuous_enable(BOND_PORT);
+ if (retval != 0) {
+ rte_exit(EXIT_FAILURE,
+ "port %u: promiscuous mode enable failed: %s\n",
+ BOND_PORT, rte_strerror(-retval));
+ return;
+ }
struct rte_ether_addr addr;
addr.addr_bytes[2], addr.addr_bytes[3],
addr.addr_bytes[4], addr.addr_bytes[5]);
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
return 0;
}
addr.addr_bytes[4], addr.addr_bytes[5]);
/* Enable RX in promiscuous mode for the Ethernet device. */
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
return 0;
}
if (ret < 0)
FATAL_ERROR("Could not start port%u (%d)", port, ret);
- rte_eth_promiscuous_enable(port);
+ ret = rte_eth_promiscuous_enable(port);
+ if (ret != 0)
+ FATAL_ERROR("Could not enable promiscuous mode for port%u (%s)",
+ port, rte_strerror(-ret));
}
/* Check the link status of all ports in up to 9s, and print them finally */
addr.addr_bytes[4], addr.addr_bytes[5]);
/* Enable RX in promiscuous mode for the Ethernet device. */
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
return 0;
}
}
}
- rte_eth_promiscuous_enable(port_id);
+ ret = rte_eth_promiscuous_enable(port_id);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ ":: promiscuous mode enable failed: err=%s, port=%u\n",
+ rte_strerror(-ret), port_id);
+
ret = rte_eth_dev_start(port_id);
if (ret < 0) {
rte_exit(EXIT_FAILURE,
rte_exit(EXIT_FAILURE, "rte_eth_dev_start: err=%d, port=%d\n",
ret, portid);
- rte_eth_promiscuous_enable(portid);
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%d\n",
+ rte_strerror(-ret), portid);
if (check_ptype(portid) == 0) {
rte_eth_add_rx_callback(portid, 0, cb_parse_ptype, NULL);
if (status < 0)
return NULL;
- if (params->promiscuous)
- rte_eth_promiscuous_enable(port_id);
+ if (params->promiscuous) {
+ status = rte_eth_promiscuous_enable(port_id);
+ if (status != 0)
+ return NULL;
+ }
/* Port RX */
for (i = 0; i < params->rx.n_queues; i++) {
rte_exit(EXIT_FAILURE, "rte_eth_dev_start: err=%d, port=%d\n",
ret, portid);
- rte_eth_promiscuous_enable(portid);
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%d\n",
+ rte_strerror(-ret), portid);
}
if (init_routing_table() < 0)
* to itself through 2 cross-connected ports of the
* target machine.
*/
- if (promiscuous_on)
- rte_eth_promiscuous_enable(portid);
+ if (promiscuous_on) {
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%d\n",
+ rte_strerror(-ret), portid);
+ }
rte_eth_dev_callback_register(portid,
RTE_ETH_EVENT_IPSEC, inline_ipsec_event_callback, NULL);
addr.addr_bytes[4], addr.addr_bytes[5]);
/* Enable RX in promiscuous mode for the Ethernet device. */
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
return 0;
}
return -1;
}
- rte_eth_promiscuous_enable(portid);
+ retval = rte_eth_promiscuous_enable(portid);
+ if (retval != 0) {
+ printf("rte_eth_promiscuous_enable:err=%s, port=%u\n",
+ rte_strerror(-retval), portid);
+ return -1;
+ }
rte_eth_macaddr_get(portid, &l2fwd_ports_eth_addr[portid]);
printf("done:\n");
- rte_eth_promiscuous_enable(portid);
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0) {
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable:err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
+ return ret;
+
+ }
printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
portid,
"rte_eth_dev_start:err=%d, port=%u\n",
ret, portid);
- rte_eth_promiscuous_enable(portid);
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable:err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
printf("Port %u, MAC address: "
"%02X:%02X:%02X:%02X:%02X:%02X\n\n",
printf("done: \n");
- rte_eth_promiscuous_enable(portid);
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable:err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
portid,
* to itself through 2 cross-connected ports of the
* target machine.
*/
- if (promiscuous_on)
- rte_eth_promiscuous_enable(portid);
+ if (promiscuous_on) {
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
+ }
}
check_all_ports_link_status(enabled_port_mask);
* to itself through 2 cross-connected ports of the
* target machine.
*/
- if (promiscuous_on)
- rte_eth_promiscuous_enable(portid);
+ if (promiscuous_on) {
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
+ }
/* initialize spinlock for each port */
rte_spinlock_init(&(locks[portid]));
}
* to itself through 2 cross-connected ports of the
* target machine.
*/
- if (promiscuous_on)
- rte_eth_promiscuous_enable(portid);
+ if (promiscuous_on) {
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
+ }
}
printf("\n");
ret, (unsigned) portid);
printf("done:\n");
- rte_eth_promiscuous_enable(portid);
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
(unsigned) portid,
if (ret < 0) {
rte_panic("Cannot init NIC port %u (%d)\n", port, ret);
}
- rte_eth_promiscuous_enable(port);
+
+ ret = rte_eth_promiscuous_enable(port);
+ if (ret != 0)
+ rte_panic("Cannot enable promiscuous mode on port %u (%s)\n",
+ port, rte_strerror(-ret));
nic_rx_ring_size = app.nic_rx_ring_size;
nic_tx_ring_size = app.nic_tx_ring_size;
if (retval < 0) return retval;
}
- rte_eth_promiscuous_enable(port_num);
+ retval = rte_eth_promiscuous_enable(port_num);
+ if (retval < 0)
+ return retval;
retval = rte_eth_dev_start(port_num);
if (retval < 0) return retval;
return retval;
}
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
retval = rte_eth_dev_start(port);
if (retval < 0)
rte_exit(EXIT_FAILURE, "Couldn't setup port %hhu\n",
ports.p[i].id);
- rte_eth_promiscuous_enable(ports.p[i].id);
+ err = rte_eth_promiscuous_enable(ports.p[i].id);
+ if (err != 0)
+ rte_exit(EXIT_FAILURE,
+ "Couldn't enable promiscuous mode on port %u: %s\n",
+ ports.p[i].id, rte_strerror(-err));
}
for (i = 0; i != ports.num; i++) {
addr.addr_bytes[2], addr.addr_bytes[3],
addr.addr_bytes[4], addr.addr_bytes[5]);
- rte_eth_promiscuous_enable(port_id);
+ ret = rte_eth_promiscuous_enable(port_id);
+ if (ret != 0)
+ return ret;
return 0;
}
* to itself through 2 cross-connected ports of the
* target machine.
*/
- if (promiscuous_on)
- rte_eth_promiscuous_enable(portid);
+ if (promiscuous_on) {
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
+ }
}
for (i = 0; i < n_rx_thread; i++) {
}
/* Enable RX in promiscuous mode for the Ethernet device. */
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0) {
+ printf("Promiscuous mode enable failed: %s\n",
+ rte_strerror(-retval));
+ return retval;
+ }
return 0;
}
if (ret < 0)
rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
- rte_eth_promiscuous_enable(port_rx);
+ ret = rte_eth_promiscuous_enable(port_rx);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Port %d promiscuous mode enable error (%s)\n",
+ port_rx, rte_strerror(-ret));
- rte_eth_promiscuous_enable(port_tx);
+ ret = rte_eth_promiscuous_enable(port_tx);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Port %d promiscuous mode enable error (%s)\n",
+ port_rx, rte_strerror(-ret));
/* App configuration */
ret = app_configure_flow_table();
} else {
printf(" Link Down\n");
}
- rte_eth_promiscuous_enable(portid);
+ ret = rte_eth_promiscuous_enable(portid);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_promiscuous_enable: err=%s, port=%u\n",
+ rte_strerror(-ret), portid);
/* mark port as initialized */
app_inited_port_mask |= 1u << portid;
(unsigned int) port_id, ret);
/* Put it in promiscuous mode */
- rte_eth_promiscuous_enable(port_id);
+ ret = rte_eth_promiscuous_enable(port_id);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Failed to enable promiscuous mode for port %u: %s\n",
+ port_id, rte_strerror(-ret));
}
void
addr.addr_bytes[2], addr.addr_bytes[3],
addr.addr_bytes[4], addr.addr_bytes[5]);
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
+
rte_eth_add_rx_callback(port, 0, add_timestamps, NULL);
rte_eth_add_tx_callback(port, 0, calc_latency, NULL);
return retval;
}
- rte_eth_promiscuous_enable(port_num);
+ retval = rte_eth_promiscuous_enable(port_num);
+ if (retval != 0)
+ return retval;
retval = rte_eth_dev_start(port_num);
if (retval < 0)
addr.addr_bytes[4], addr.addr_bytes[5]);
/* Enable RX in promiscuous mode for the Ethernet device. */
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
return 0;
}
return retval;
}
- if (promiscuous)
- rte_eth_promiscuous_enable(port);
+ if (promiscuous) {
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0) {
+ RTE_LOG(ERR, VHOST_PORT,
+ "Failed to enable promiscuous mode on port %u: %s\n",
+ port, rte_strerror(-retval));
+ return retval;
+ }
+ }
rte_eth_macaddr_get(port, &vmdq_ports_eth_addr[port]);
RTE_LOG(INFO, VHOST_PORT, "Max virtio devices supported: %u\n", num_devices);
addr.addr_bytes[4], addr.addr_bytes[5]);
/* Enable RX in promiscuous mode for the Ethernet device. */
- rte_eth_promiscuous_enable(port);
+ retval = rte_eth_promiscuous_enable(port);
+ if (retval != 0)
+ return retval;
return 0;