MAX_PKT_BURST, NULL);
}
- if (nb_dq <= 0)
+ if ((int32_t) nb_dq <= 0)
return;
if (copy_mode == COPY_MODE_IOAT_NUM)
{
uint16_t portid;
struct rte_eth_link link;
- int retval = 0;
+ int ret, link_status = 0;
printf("\nChecking link status\n");
RTE_ETH_FOREACH_DEV(portid) {
continue;
memset(&link, 0, sizeof(link));
- rte_eth_link_get(portid, &link);
+ ret = rte_eth_link_get(portid, &link);
+ if (ret < 0) {
+ printf("Port %u link get failed: err=%d\n",
+ portid, ret);
+ continue;
+ }
/* Print link status */
if (link.link_status) {
portid, link.link_speed,
(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
("full-duplex") : ("half-duplex\n"));
- retval = 1;
+ link_status = 1;
} else
printf("Port %d Link Down\n", portid);
}
- return retval;
+ return link_status;
}
static void
if (rdev_id == rte_rawdev_count())
goto end;
rte_rawdev_info_get(rdev_id++, &rdev_info);
- } while (strcmp(rdev_info.driver_name,
- IOAT_PMD_RAWDEV_NAME_STR) != 0);
+ } while (rdev_info.driver_name == NULL ||
+ strcmp(rdev_info.driver_name,
+ IOAT_PMD_RAWDEV_NAME_STR) != 0);
cfg.ports[i].ioat_ids[j] = rdev_id - 1;
configure_rawdev_queue(cfg.ports[i].ioat_ids[j]);
/* Init port */
printf("Initializing port %u... ", 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, "Cannot get device info: %s, port=%u\n",
+ rte_strerror(-ret), portid);
+
local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
dev_info.flow_type_rss_offloads;
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)