patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/ixgbe: stop link setup alarm handler before device start
       [not found] <CGME20181108102407eucas1p1333804da3f477295a691da4d82b018ed@eucas1p1.samsung.com>
@ 2018-11-08 10:24 ` Ilya Maximets
  2018-11-08 11:16   ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Maximets @ 2018-11-08 10:24 UTC (permalink / raw)
  To: dev, Qi Zhang
  Cc: Wenzhuo Lu, Konstantin Ananyev, Laurent Hardy, Ferruh Yigit,
	Ilya Maximets, stable

We should stop alarm handler before resetting the HW to
avoid concurrent device reconfiguration.

Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update")
CC: stable@dpdk.org

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index c9e82d515..8148577f5 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2549,6 +2549,9 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 		return -EINVAL;
 	}
 
+	/* Stop the link setup handler before resetting the HW. */
+	rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev);
+
 	/* disable uio/vfio intr/eventfd mapping */
 	rte_intr_disable(intr_handle);
 
@@ -2731,8 +2734,6 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 	if (err)
 		goto error;
 
-	ixgbe_dev_link_update(dev, 0);
-
 skip_link_setup:
 
 	if (rte_intr_allow_others(intr_handle)) {
@@ -2768,6 +2769,12 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 			    "please call hierarchy_commit() "
 			    "before starting the port");
 
+	/*
+	 * Update link status right before return, because it may
+	 * start link configuration process in a separate thread.
+	 */
+	ixgbe_dev_link_update(dev, 0);
+
 	return 0;
 
 error:
@@ -5061,6 +5068,9 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 
 	PMD_INIT_FUNC_TRACE();
 
+	/* Stop the link setup handler before resetting the HW. */
+	rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, dev);
+
 	err = hw->mac.ops.reset_hw(hw);
 	if (err) {
 		PMD_INIT_LOG(ERR, "Unable to reset vf hardware (%d)", err);
@@ -5096,8 +5106,6 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 
 	ixgbevf_dev_rxtx_start(dev);
 
-	ixgbevf_dev_link_update(dev, 0);
-
 	/* check and configure queue intr-vector mapping */
 	if (rte_intr_cap_multiple(intr_handle) &&
 	    dev->data->dev_conf.intr_conf.rxq) {
@@ -5135,6 +5143,12 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	/* Re-enable interrupt for VF */
 	ixgbevf_intr_enable(dev);
 
+	/*
+	 * Update link status right before return, because it may
+	 * start link configuration process in a separate thread.
+	 */
+	ixgbevf_dev_link_update(dev, 0);
+
 	return 0;
 }
 
-- 
2.17.1

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/ixgbe: stop link setup alarm handler before device start
  2018-11-08 10:24 ` [dpdk-stable] [PATCH] net/ixgbe: stop link setup alarm handler before device start Ilya Maximets
@ 2018-11-08 11:16   ` Burakov, Anatoly
  2018-11-08 20:52     ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Burakov, Anatoly @ 2018-11-08 11:16 UTC (permalink / raw)
  To: Ilya Maximets, dev, Qi Zhang
  Cc: Wenzhuo Lu, Konstantin Ananyev, Laurent Hardy, Ferruh Yigit, stable

On 08-Nov-18 10:24 AM, Ilya Maximets wrote:
> We should stop alarm handler before resetting the HW to
> avoid concurrent device reconfiguration.
> 
> Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update")
> CC: stable@dpdk.org
> 
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---

Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>

I can confirm that this fixes issue with pktgen where init was failing 
if the link wasn't up.

-- 
Thanks,
Anatoly

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/ixgbe: stop link setup alarm handler before device start
  2018-11-08 11:16   ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
@ 2018-11-08 20:52     ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2018-11-08 20:52 UTC (permalink / raw)
  To: Burakov, Anatoly, Ilya Maximets, dev
  Cc: Lu, Wenzhuo, Ananyev, Konstantin, Laurent Hardy, Yigit, Ferruh, stable



> -----Original Message-----
> From: Burakov, Anatoly
> Sent: Thursday, November 8, 2018 4:16 AM
> To: Ilya Maximets <i.maximets@samsung.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Laurent Hardy
> <laurent.hardy@6wind.com>; Yigit, Ferruh <ferruh.yigit@intel.com>;
> stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: stop link setup alarm handler
> before device start
> 
> On 08-Nov-18 10:24 AM, Ilya Maximets wrote:
> > We should stop alarm handler before resetting the HW to avoid
> > concurrent device reconfiguration.
> >
> > Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link
> > update")
> > CC: stable@dpdk.org
> >
> > Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> > ---
> 
> Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
> 
> I can confirm that this fixes issue with pktgen where init was failing if the link
> wasn't up.

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

Applied to dpdk-next-net-intel.

Thanks for fix and testing.
Qi
> 
> --
> Thanks,
> Anatoly

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

end of thread, other threads:[~2018-11-08 20:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20181108102407eucas1p1333804da3f477295a691da4d82b018ed@eucas1p1.samsung.com>
2018-11-08 10:24 ` [dpdk-stable] [PATCH] net/ixgbe: stop link setup alarm handler before device start Ilya Maximets
2018-11-08 11:16   ` [dpdk-stable] [dpdk-dev] " Burakov, Anatoly
2018-11-08 20:52     ` Zhang, Qi Z

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