ethdev: add siblings iterators
authorThomas Monjalon <thomas@monjalon.net>
Mon, 1 Apr 2019 02:26:58 +0000 (04:26 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 5 Apr 2019 15:45:22 +0000 (17:45 +0200)
commit7f98942886bcb80a504f8bfb99638bb14a8ba14d
treeb03a81072301699bb146f3aabea30fc5773115ea
parenta52aa40b4161a027ce1b31bde7c6f47b93bb26b7
ethdev: add siblings iterators

If multiple ports share the same hardware device (rte_device),
they are siblings and can be found thanks to the new functions
and loop macros.
One iterator takes a port id as reference,
while the other one directly refers to the parent device.

The ownership is not checked because siblings may have
different owners.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
lib/librte_ethdev/rte_ethdev.c
lib/librte_ethdev/rte_ethdev.h
lib/librte_ethdev/rte_ethdev_version.map