[dpdk-dev] [PATCH v2 0/3] ethdev: fix ports enumeration

Thomas Monjalon thomas at monjalon.net
Wed Apr 18 00:22:47 CEST 2018


05/04/2018 17:33, Thomas Monjalon:
> Some DPDK applications wrongly assume these requirements:
>   - no hotplug, i.e. ports are never detached
>   - all allocated ports are available to the application
> 
> Such application iterates over ports by its own mean.
> The most common pattern is to request the port count and
> assume ports with index in the range [0..count[ can be used.
> 
> There are three consequences when using such wrong design:
>   - new ports having an index higher than the port count won't be seen
>   - old ports being detached (RTE_ETH_DEV_UNUSED) can be seen as ghosts
>   - failsafe sub-devices (RTE_ETH_DEV_DEFERRED) will be seen by the application
> 
> Such mistake will be less common with growing hotplug awareness.
> All applications and examples inside this repository - except testpmd -
> must be fixed to use the iterator RTE_ETH_FOREACH_DEV,
> and to use the function rte_eth_dev_is_valid_port.
> 
> In order to fix this common mistake in all external applications,
> the function rte_eth_dev_count is deprecated, while introducing
> the new functions rte_eth_dev_count_avail and rte_eth_dev_count_total.


The RFC was sent on 9th of March, and this v2 is available since 5th of April,
without any comment.

Applied




More information about the dev mailing list