[dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators

Ferruh Yigit ferruh.yigit at intel.com
Wed Apr 3 01:42:27 CEST 2019


On 4/1/2019 3:26 AM, Thomas Monjalon wrote:
> 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 at monjalon.net>

<...>

> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Iterates over ethdev ports of a specified device.
> + *
> + * @param port_id_start
> + *   The id of the next possible valid port.
> + * @param parent
> + *   The generic device behind the ports to iterate.
> + * @return
> + *   Next port id of the device, possibly port_id_start,
> + *   RTE_MAX_ETHPORTS if there is none.
> + */
> +__rte_experimental
> +uint16_t rte_eth_find_next_of(uint16_t port_id_start,
> +		const struct rte_device *parent);

Minor nit, but other instances using the tag as:

uint16_t __rte_experimental
rte_eth_find_next_of(uint16_t port_id_start,
		const struct rte_device *parent);

What do you think updating it for consistency? Same for two APIs.


More information about the dev mailing list