Skip to contentSkip to conversation

net/ixgbe: stop link setup alarm handler before device start

PATCH Applied Ilya Maximets 3 participants 3 messages Nov 8, 2018 1 message not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20181108102407eucas1p1333804da3f477295a691da4d82b018ed@eucas1p1.samsung.com

#1 lore raw

PATCH 1/1 net/ixgbe: stop link setup alarm handler before device start

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")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +18 -4
index c9e82d515..8148577f5 100644
@@ -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;
 }
 
Signature · 1 line
2.17.1
Tested-by on v1 1/1
#2 lore raw
Quoted 8 lines · Ilya Maximets

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

---

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

Signature · 2 lines
Thanks,
Anatoly
Acked-by Applied
#3 lore raw
Quoted 22 lines

-----Original Message-----
From: Burakov, Anatoly
Sent: Thursday, November 8, 2018 4:16 AM
To: Ilya Maximets <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Cc: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Laurent Hardy <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: stop link setup alarm handler before device start

Quoted 7 lines · Ilya Maximets

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: [email protected]

Quoted 7 lines
Quoted 2 lines

---

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

Applied to dpdk-next-net-intel.

Thanks for fix and testing.
Qi

Quoted 4 lines

--
Thanks,
Anatoly