DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: fix intr callback unregister by adding retry
@ 2018-03-21 12:28 wangyunjian
  2018-03-28  0:56 ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: wangyunjian @ 2018-03-21 12:28 UTC (permalink / raw)
  To: dev; +Cc: caihe, Yunjian Wang

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: 2866c5f1b87e ("ixgbe: support port hotplug")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 4483258..6c01683 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1339,6 +1339,8 @@ struct rte_ixgbe_xstats_name_off {
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
 	struct ixgbe_hw *hw;
+	int retries = 0;
+	int ret;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -1359,8 +1361,20 @@ struct rte_ixgbe_xstats_name_off {
 
 	/* disable uio intr before callback unregister */
 	rte_intr_disable(intr_handle);
-	rte_intr_callback_unregister(intr_handle,
-				     ixgbe_dev_interrupt_handler, eth_dev);
+
+	do {
+		ret = rte_intr_callback_unregister(intr_handle,
+				ixgbe_dev_interrupt_handler, eth_dev);
+		if (ret >= 0) {
+			break;
+		} else if (ret != -EAGAIN) {
+			PMD_INIT_LOG(ERR,
+				"intr callback unregister failed: %d",
+				ret);
+			return ret;
+		}
+		rte_delay_ms(100);
+	} while (retries++ < (10 + IXGBE_LINK_UP_TIME));
 
 	/* uninitialize PF if max_vfs not zero */
 	ixgbe_pf_host_uninit(eth_dev);
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix intr callback unregister by adding retry
  2018-03-21 12:28 [dpdk-dev] [PATCH] net/ixgbe: fix intr callback unregister by adding retry wangyunjian
@ 2018-03-28  0:56 ` Zhang, Qi Z
  2018-03-29  5:07   ` Zhang, Helin
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Qi Z @ 2018-03-28  0:56 UTC (permalink / raw)
  To: wangyunjian, dev; +Cc: caihe

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wangyunjian
> Sent: Wednesday, March 21, 2018 8:28 PM
> To: dev@dpdk.org
> Cc: caihe@huawei.com; Yunjian Wang <wangyunjian@huawei.com>
> Subject: [dpdk-dev] [PATCH] net/ixgbe: 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: 2866c5f1b87e ("ixgbe: support port hotplug")
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix intr callback unregister by adding retry
  2018-03-28  0:56 ` Zhang, Qi Z
@ 2018-03-29  5:07   ` Zhang, Helin
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Helin @ 2018-03-29  5:07 UTC (permalink / raw)
  To: Zhang, Qi Z, wangyunjian, dev; +Cc: caihe



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Wednesday, March 28, 2018 8:56 AM
> To: wangyunjian; dev@dpdk.org
> Cc: caihe@huawei.com
> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix intr callback unregister by adding
> retry
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of wangyunjian
> > Sent: Wednesday, March 21, 2018 8:28 PM
> > To: dev@dpdk.org
> > Cc: caihe@huawei.com; Yunjian Wang <wangyunjian@huawei.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbe: 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: 2866c5f1b87e ("ixgbe: support port hotplug")
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel, thanks!

/Helin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-29  5:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 12:28 [dpdk-dev] [PATCH] net/ixgbe: fix intr callback unregister by adding retry wangyunjian
2018-03-28  0:56 ` Zhang, Qi Z
2018-03-29  5:07   ` Zhang, Helin

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).