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 changes the rte_eth_dev_owner_get function so that it can be used to test for any 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. v3 - use rte_eth_dev_owner_get directly, and change the function return rework port setup in tep_termination example v2 - rename the helper function and use rte_eth_dev_owner_get Stephen Hemminger (6): rte_ethdev: change rte_eth_dev_owner_get to return error if unowned examples/l2fwd-cat: make applicaton aware of port ownership examples/l3fwd: make applicaton aware of port ownership examples/l3fwd-acl: make applicaton aware of port ownership examples/l3fwd-power: make applicaton aware of port ownership examples/tep_termination: rework the port setup logic drivers/net/failsafe/failsafe_eal.c | 4 +- drivers/net/netvsc/hn_vf.c | 11 ++--- 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 | 70 ++++++++++------------------ examples/tep_termination/meson.build | 1 + lib/librte_ethdev/rte_ethdev.c | 4 +- lib/librte_ethdev/rte_ethdev.h | 6 ++- 17 files changed, 69 insertions(+), 56 deletions(-) -- 2.20.1