From: Yunjian Wang Date: Tue, 20 Mar 2018 07:01:24 +0000 (+0800) Subject: net/i40e: fix intr callback unregister by adding retry X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0264539dce2d40d8abaed474d4b1b526ca3ed2e4;p=dpdk.git net/i40e: fix intr callback unregister by adding retry 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") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Reviewed-by: Kirill Rybalchenko Acked-by: Qi Zhang --- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index f9408b0e74..d0bf4e349d 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1505,6 +1505,7 @@ eth_i40e_dev_uninit(struct rte_eth_dev *dev) struct rte_flow *p_flow; int ret; uint8_t aq_fail = 0; + int retries = 0; PMD_INIT_FUNC_TRACE(); @@ -1546,9 +1547,20 @@ eth_i40e_dev_uninit(struct rte_eth_dev *dev) /* disable uio intr before callback unregister */ rte_intr_disable(intr_handle); - /* register callback func to eal lib */ - rte_intr_callback_unregister(intr_handle, - i40e_dev_interrupt_handler, dev); + /* unregister callback func to eal lib */ + 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(500); + } while (retries++ < 5); i40e_rm_ethtype_filter_list(pf); i40e_rm_tunnel_filter_list(pf);