If a ethdev port is in use for a sub device, then it should not
be allowed in the portmask of application.

Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
Cc: ma...@mellanox.com
Cc: sta...@dpdk.org
Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 examples/vhost/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index ab649bf147e1..d759581f1904 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -669,7 +669,7 @@ static unsigned check_ports_num(unsigned nb_ports)
        }
 
        for (portid = 0; portid < num_ports; portid ++) {
-               if (!rte_eth_dev_is_valid_port(ports[portid])) {
+               if (!rte_eth_dev_is_owned_by(portid, RTE_ETH_DEV_NO_OWNER)) {
                        RTE_LOG(INFO, VHOST_PORT,
                                "\nSpecified port ID(%u) is not valid\n",
                                ports[portid]);
-- 
2.20.1

Reply via email to