The failsafe, bonding, and netvsc PMD use eth dev port ownership to control sub devices. These sub devices are hidden in the normal iteration over ports but some applications use a direct port mask. In these cases, user may still (incorrectly) try to directly use the sub devices.
This patch set introduces a helper function to check if a port is under ownership. And the follow on patches use that. An alternative proposed in earlier discussion is to have each application try and own the port. But this solution would be more invasive, and does not handle the case if secondary process exits prematurely without releasing ownership. It makes more sense to keep the concept of ownership as strictly part of the device model and not part of the application layer. v2 - rename the helper function and use rte_eth_dev_owner_get Stephen Hemminger (6): rte_ethdev: add function to check if device is owned examples/l2fwd-cat: block attempts to use owned ports examples/l3fwd: block attempts to use owned ports examples/l3fwd-acl: block attempts to use owned ports examples/l3fwd-power: block attempts to use owned ports examples/tep_termination: block attempts to use owned ports examples/l2fwd-cat/Makefile | 2 ++ examples/l2fwd-cat/l2fwd-cat.c | 3 +++ examples/l2fwd-cat/meson.build | 1 + examples/l3fwd-acl/Makefile | 3 +++ examples/l3fwd-acl/main.c | 4 ++++ examples/l3fwd-acl/meson.build | 1 + examples/l3fwd-power/main.c | 4 ++++ examples/l3fwd/Makefile | 3 +++ examples/l3fwd/main.c | 5 +++++ examples/l3fwd/meson.build | 1 + examples/tep_termination/Makefile | 2 ++ examples/tep_termination/main.c | 2 +- examples/tep_termination/meson.build | 1 + lib/librte_ethdev/rte_ethdev.c | 12 ++++++++++++ lib/librte_ethdev/rte_ethdev.h | 13 +++++++++++++ lib/librte_ethdev/rte_ethdev_version.map | 3 +++ 16 files changed, 59 insertions(+), 1 deletion(-) -- 2.20.1