/* init port */
printf("Initializing port %u... ", port_id);
fflush(stdout);
- rte_eth_dev_info_get(port_id, &dev_info);
+
+ ret = rte_eth_dev_info_get(port_id, &dev_info);
+ if (ret != 0)
+ rte_panic("Error during getting device (port %u) info: %s\n",
+ port_id, 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;
/* Get the core which has least number of services running. */
while (slcore_count--) {
/* Reset default mapping */
- rte_service_map_lcore_set(service_id,
- slcore_array[slcore_count], 0);
+ if (rte_service_map_lcore_set(service_id,
+ slcore_array[slcore_count], 0) != 0)
+ return -ENOENT;
service_count = rte_service_lcore_count_services(
slcore_array[slcore_count]);
if (service_count < min_service_count) {
min_service_count = service_count;
}
}
- if (rte_service_map_lcore_set(service_id, slcore, 1))
+ if (rte_service_map_lcore_set(service_id, slcore, 1) != 0)
return -ENOENT;
rte_service_lcore_start(slcore);
uint16_t port_id;
uint8_t count, all_ports_up, print_flag = 0;
struct rte_eth_link link;
+ int ret;
printf("\nChecking link status...");
fflush(stdout);
if ((port_mask & (1 << port_id)) == 0)
continue;
memset(&link, 0, sizeof(link));
- rte_eth_link_get_nowait(port_id, &link);
+ ret = rte_eth_link_get_nowait(port_id, &link);
+ if (ret < 0) {
+ all_ports_up = 0;
+ if (print_flag == 1)
+ printf("Port %u link get failed: %s\n",
+ port_id, rte_strerror(-ret));
+ continue;
+ }
/* print link status if flag set */
if (print_flag == 1) {
if (link.link_status)