- /* no point looking at eth_dev_last_created_port if no port exists */
- if (!nb_ports) {
- RTE_LOG(ERR, EAL, "No ports found for device (%s)\n", name);
+ /* no point looking at the port count if no port exists */
+ if (!rte_eth_dev_count()) {
+ RTE_LOG(ERR, EAL, "No port found for device (%s)\n", name);