]> git.droids-corp.org - dpdk.git/blobdiff - examples/tep_termination/main.c
ethdev: deprecate port count function
[dpdk.git] / examples / tep_termination / main.c
index cc12cd87ac95ed1c25f74c8aa51133229e275ed7..8543a98030d34a4321bb59929e22f01c1c7eb5f6 100644 (file)
@@ -515,11 +515,10 @@ check_ports_num(unsigned max_nb_ports)
        }
 
        for (portid = 0; portid < nb_ports; portid++) {
-               if (ports[portid] >= max_nb_ports) {
+               if (!rte_eth_dev_is_valid_port(ports[portid])) {
                        RTE_LOG(INFO, VHOST_PORT,
-                               "\nSpecified port ID(%u) exceeds max "
-                               " system port ID(%u)\n",
-                               ports[portid], (max_nb_ports - 1));
+                               "\nSpecified port ID(%u) is not valid\n",
+                               ports[portid]);
                        ports[portid] = INVALID_PORT_ID;
                        valid_nb_ports--;
                }
@@ -1157,7 +1156,7 @@ main(int argc, char *argv[])
        nb_switching_cores = rte_lcore_count()-1;
 
        /* Get the number of physical ports. */
-       nb_ports = rte_eth_dev_count();
+       nb_ports = rte_eth_dev_count_avail();
 
        /*
         * Update the global var NB_PORTS and global array PORTS