/* init port */
RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid);
fflush(stdout);
- rte_eth_dev_info_get(portid, &dev_info);
+
+ ret = rte_eth_dev_info_get(portid, &dev_info);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Error during getting device (port %u) info: %s\n",
+ portid, strerror(-ret));
+
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
printf("done: ");
/* get link status */
- rte_eth_link_get(portid, &link);
+ ret = rte_eth_link_get(portid, &link);
+ if (ret < 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_link_get: err=%d, port=%u: %s\n",
+ ret, portid, rte_strerror(-ret));
+
if (link.link_status) {
printf(" Link Up - speed %u Mbps - %s\n",
(uint32_t) link.link_speed,
} 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;
uint32_t pipe, subport;
int err;
- rte_eth_link_get(portid, &link);
+ err = rte_eth_link_get(portid, &link);
+ if (err < 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_link_get: err=%d, port=%u: %s\n",
+ err, portid, rte_strerror(-err));
port_params.socket = socketid;
port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8;