[dpdk-dev] [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool

Matan Azrad matan at mellanox.com
Sun Aug 26 09:49:53 CEST 2018



From: Stephen Hemminger 
> On Tue, 21 Aug 2018 15:48:19 +0000
> Matan Azrad <matan at mellanox.com> wrote:
> 
> > Hi
> >
> > From: Stephen Hemminger
> > > On Tue, 21 Aug 2018 10:20:43 +0000
> > > Matan Azrad <matan at mellanox.com> wrote:
> > >
> > > > From: Stephen Hemminger
> > > > > Function is boolean so use that.
> > > >
> > > > Ethdev is not using bool type, see also:
> > > > rte_eth_dev_is_valid_port
> > > > rte_eth_dev_is_removed
> > > > rte_eth_dev_pool_ops_supported
> > > >
> > > > I think it should be a full solution to all.
> > > >
> > > > > Signed-off-by: Stephen Hemminger <sthemmin at microsoft.com>
> > >
> > > I didn't want change type of visible (exported by ABI) functions.
> > >
> > Since ethdev now is not using bool type I think it's better not to change it
> only for this API.
> 
> I hate to pick nits but there is already a bool usage in internal function (static)
> in ethdev.
> 
> 
> static bool
> is_allocated(const struct rte_eth_dev *ethdev) {
> 	return ethdev->data->name[0] != '\0';
> }
> 
> Using bool functions doesn't really generate different code. It is is more
> about using modern C conventions.

Agree, but I think it should be the same API at least as  rte_eth_dev_is_valid_port, just for ethdev convention.

Let's give to the maintainer the decision.




More information about the dev mailing list