fix ethdev port id validation
[dpdk.git] / examples / eventdev_pipeline / main.c
index bbab995..48358a7 100644 (file)
@@ -285,7 +285,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
        struct rte_eth_dev_info dev_info;
        struct rte_eth_txconf txconf;
 
-       if (port >= rte_eth_dev_count())
+       if (!rte_eth_dev_is_valid_port(port))
                return -1;
 
        rte_eth_dev_info_get(port, &dev_info);