[dpdk-dev] [PATCH 08/11] ethdev: fix port visibility before initialization

Thomas Monjalon thomas at monjalon.net
Fri May 11 00:18:49 CEST 2018


10/05/2018 22:40, Stephen Hemminger:
> On Wed,  9 May 2018 11:43:34 +0200
> Thomas Monjalon <thomas at monjalon.net> wrote:
> 
> > The port was set to the state ATTACHED during allocation.
> > The consequence was to iterate over ports which are not initialized.
> > 
> > The state ATTACHED is now set as the last step of probing.
> > 
> > The uniqueness of port name is now checked before the availability
> > of a port id for allocation (order reversed).
> > 
> > As the state is not set on allocation anymore, it is also not checked
> > in the function telling whether a port is allocated or not.
> > The name of the port is set on allocation, so it is enough as a check.
> > 
> > Fixes: 5588909af21b ("ethdev: add device iterator")
> > Cc: stable at dpdk.org
> > 
> > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> > Signed-off-by: Matan Azrad <matan at mellanox.com>
> 
> Could these states be described somewhere in the documentation.

It is in this patchset:
	ethdev: add doxygen comments for each state

> Maybe some doc/guides? Maybe even exposed in API under rte_eth_dev_info.

It is an internal state. It should not be used by the application.

> Ideally, the device states could be aligned to the SNMP MIB for
> interfaces (RFC2863) which defines complex state model appropriate for devices
> and tunnels.

Something to be discussed, MIB compliance would be a totally new feature
I guess. I think it is a huge work with not a lot of interest.




More information about the dev mailing list