DPDK patches and discussions
 help / color / mirror / Atom feed
From: wangyunjian <wangyunjian@huawei.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: caihe <caihe@huawei.com>
Subject: Re: [dpdk-dev] net/i40e: fix intr callback unregister by adding retry
Date: Tue, 13 Mar 2018 06:59:18 +0000	[thread overview]
Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60C747C37@dggemm513-mbs.china.huawei.com> (raw)
In-Reply-To: <1520664643-13808-1-git-send-email-wangyunjian@huawei.com>



> -----Original Message-----
> From: wangyunjian
> Sent: Saturday, March 10, 2018 2:51 PM
> To: dev@dpdk.org
> Cc: caihe <caihe@huawei.com>; wangyunjian <wangyunjian@huawei.com>
> Subject: [dpdk-dev] 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>
> ---
>  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..a73d4df 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 */
> -	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) {

This check is wrong. I will send the v2 later.

> +			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
> 

      parent reply	other threads:[~2018-03-13  6:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10  6:50 wangyunjian
2018-03-10  7:31 ` wangyunjian
2018-03-13  6:59 ` 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=34EFBCA9F01B0748BEB6B629CE643AE60C747C37@dggemm513-mbs.china.huawei.com \
    --to=wangyunjian@huawei.com \
    --cc=caihe@huawei.com \
    --cc=dev@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).