[dpdk-stable] [PATCH 7/7] examples/vhost: block attempts to use owned ports

Stephen Hemminger stephen at networkplumber.org
Thu Mar 12 18:20:47 CET 2020


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: matan at mellanox.com
Cc: stable at dpdk.org
Signed-off-by: Stephen Hemminger <stephen at 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



More information about the stable mailing list