ethdev: avoid explicit check of valid port state
authorThomas Monjalon <thomas@monjalon.net>
Wed, 17 Apr 2019 22:59:27 +0000 (00:59 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 19 Apr 2019 12:51:55 +0000 (14:51 +0200)
commit5294b800295a34e7c70ea1e8be985932743f910d
tree0113d78de0227570c6555783ca539625162f017b
parentb7ed955a20eee5979eaecc9fab500a176e2741c5
ethdev: avoid explicit check of valid port state

Some port iterations are manually checking against RTE_ETH_DEV_UNUSED
instead of using the iterators based on rte_eth_find_next().

A new macro RTE_ETH_FOREACH_VALID_DEV() is introduced, but kept private
because there should be no need of iterating over all devices in the
API. The public iterators have additional filters for ownership, parent
device or sibling ports.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
drivers/net/mlx5/mlx5.c
lib/librte_ethdev/rte_ethdev.c