[7/7] examples/vhost: block attempts to use owned ports
Checks
Commit Message
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@mellanox.com
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/vhost/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -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]);