fix ethdev port id validation
[dpdk.git] / examples / distributor / main.c
index 62831a0..2e6b09d 100644 (file)
@@ -116,7 +116,7 @@ port_init(uint16_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);