All of lore.kernel.org
 help / color / mirror / Atom feed
From: wangyunjian <wangyunjian@huawei.com>
To: "Rybalchenko, Kirill" <kirill.rybalchenko@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: caihe <caihe@huawei.com>
Subject: Re: [PATCH v2] net/i40e: fix intr callback unregister by	adding retry
Date: Wed, 14 Mar 2018 11:50:54 +0000	[thread overview]
Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60C749269@dggemm513-mbs.china.huawei.com> (raw)
In-Reply-To: <696B43C21188DF4F9C9091AAE4789B824E2D62F3@IRSMSX108.ger.corp.intel.com>



> -----Original Message-----
> From: Rybalchenko, Kirill [mailto:kirill.rybalchenko@intel.com]
> Sent: Wednesday, March 14, 2018 7:04 PM
> To: wangyunjian <wangyunjian@huawei.com>; dev@dpdk.org
> Cc: caihe <caihe@huawei.com>
> Subject: RE: [dpdk-dev] [PATCH v2] net/i40e: fix intr callback unregister by
> adding retry
> 
> Hi Yunjian,
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wangyunjian
> > Sent: Tuesday 13 March 2018 06:53
> > To: dev@dpdk.org
> > Cc: caihe@huawei.com; Yunjian Wang <wangyunjian@huawei.com>
> > Subject: [dpdk-dev] [PATCH v2] net/i40e: fix intr callback unregister
> > by adding retry
> >
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > The nic's interrupt source has some active callbacks, when the port hotplug.
> > Add a retry to give more port's a chance to uninit before returning an error.
> >
> > Fixes: d42aaf30008b ("i40e: support port hotplug")
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> > v2:
> > * Fix return value check
> > ---
> >  drivers/net/i40e/i40e_ethdev.c | 16 ++++++++++++++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> > b/drivers/net/i40e/i40e_ethdev.c index 508b417..0a29fdd 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -1533,6 +1533,7 @@ void i40e_flex_payload_reg_set_default(struct
> > i40e_hw *hw)
> >  	struct rte_flow *p_flow;
> >  	int ret;
> >  	uint8_t aq_fail = 0;
> > +	int retries = 0;
> >
> >  	PMD_INIT_FUNC_TRACE();
> >
> > @@ -1575,8 +1576,19 @@ void i40e_flex_payload_reg_set_default(struct
> > i40e_hw *hw)
> >  	rte_intr_disable(intr_handle);
> >
> >  	/* register callback func to eal lib */
> 
> 
> It's not a part of your patch, but I believe it makes sense to fix this:
> /* unregister callback func from eal lib */

Thanks,  I will send the v3 to fix this later.

> 
> > -	rte_intr_callback_unregister(intr_handle,
> > -				     i40e_dev_interrupt_handler, dev);
> > +	do {
> > +		ret = rte_intr_callback_unregister(intr_handle,
> > +				i40e_dev_interrupt_handler, dev);
> > +		if (ret >= 0) {
> > +			break;
> > +		} else if (ret != -EAGAIN) {
> > +			PMD_INIT_LOG(ERR,
> > +				 "intr callback unregister failed: %d",
> > +				 ret);
> > +			return ret;
> > +		}
> > +		i40e_msec_delay(100);
> > +	} while (retries++ < 5);
> >
> >  	i40e_rm_ethtype_filter_list(pf);
> >  	i40e_rm_tunnel_filter_list(pf);
> > --
> > 1.8.3.1
> >

      reply	other threads:[~2018-03-14 11:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13  6:53 [PATCH v2] net/i40e: fix intr callback unregister by adding retry wangyunjian
2018-03-14 11:04 ` Rybalchenko, Kirill
2018-03-14 11:50   ` wangyunjian [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34EFBCA9F01B0748BEB6B629CE643AE60C749269@dggemm513-mbs.china.huawei.com \
    --to=wangyunjian@huawei.com \
    --cc=caihe@huawei.com \
    --cc=dev@dpdk.org \
    --cc=kirill.rybalchenko@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.