[dpdk-dev] [PATCH 12/13] i40e: return -errno when intr setup fails

Michał Mirosław mirq-linux at rere.qmqm.pl
Fri Dec 23 02:55:13 CET 2016


On Thu, Dec 22, 2016 at 03:45:35PM +0000, Ferruh Yigit wrote:
> On 12/13/2016 1:08 AM, Michał Mirosław wrote:
> > Signed-off-by: Michał Mirosław <michal.miroslaw at atendesoftware.pl>
> > ---
> >  drivers/net/i40e/i40e_ethdev.c               | 5 +++--
> >  lib/librte_eal/linuxapp/eal/eal_interrupts.c | 2 +-
> >  2 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> > index 67778ba..39fbcfe 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -1692,8 +1692,9 @@ i40e_dev_start(struct rte_eth_dev *dev)
> >  	     !RTE_ETH_DEV_SRIOV(dev).active) &&
> >  	    dev->data->dev_conf.intr_conf.rxq != 0) {
> >  		intr_vector = dev->data->nb_rx_queues;
> > -		if (rte_intr_efd_enable(intr_handle, intr_vector))
> > -			return -1;
> > +		ret = rte_intr_efd_enable(intr_handle, intr_vector);
> > +		if (ret)
> > +			return ret;
> 
> What is the benefit of returning -errno instead of -1?

Information. Besides, all other error returns from i40e_dev_start return
negated error code (-1 happens to be -EPERM, which further confuses
the poor developer who's diagnosing the failure).

Best Regards,
Michał Mirosław


More information about the dev mailing list