[dpdk-dev] [PATCH 07/11] ethdev: add lock to port allocation check

Thomas Monjalon thomas at monjalon.net
Fri May 11 00:13:29 CEST 2018


10/05/2018 22:35, Stephen Hemminger:
> On Wed, 9 May 2018 14:21:17 +0200
> Gaëtan Rivet <gaetan.rivet at 6wind.com> wrote:
> 
> > A suggestion about the naming here.
> > Reading subsequent patches, we can see this function being used during
> > ethdev allocation routines. The _lock_free suffix is a little
> > misleading, as for an instant one can think that there is something
> > being freed about an allocated ethdev lock.
> > 
> > I would suggest
> > 
> >   * rte_eth_dev_allocated_nolock
> >     or
> >   * rte_eth_dev_allocated_lockless
> >     (or even rte_eth_lockless_dev_allocated)
> > 
> > instead.
> 
> Personally, used to the convention of:
>     rte_eth_dev_find(name)
> and
>     _rte_eth_dev_find(name)
> 
> The _ implies internal version without lock.

It is a matter of taste.
We have chosen "nolock" in v2, and I think it is explicit.

> Also allocated to me implies a boolean test only.

Yes, the name is a bit strange.
But it is old and out of the scope of this patch.
If we want to change it, it is an API deprecation.




More information about the dev mailing list