patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@samsung.com>
To: stable@dpdk.org, Yongseok Koh <yskoh@mellanox.com>
Cc: Qi Zhang <qi.z.zhang@intel.com>, Wei Zhao <wei.zhao1@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Ilya Maximets <i.maximets@samsung.com>
Subject: [dpdk-stable] [PATCH 17.11 2/2] net/ixgbe: stop link setup alarm handler before device start
Date: Tue, 22 Jan 2019 13:13:41 +0300	[thread overview]
Message-ID: <20190122101341.9556-3-i.maximets@samsung.com> (raw)
In-Reply-To: <20190122101341.9556-1-i.maximets@samsung.com>

[ backported from upstream commit 916193dda6fb400114c0ffc5615e74ca13d50720 ]

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>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index be836beeb..f047db83c 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2533,6 +2533,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);
 
@@ -2734,6 +2737,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:
@@ -5042,6 +5051,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);
@@ -5114,6 +5126,12 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
 	/* Re-enable interrupt for VF */
 	ixgbevf_intr_enable(hw);
 
+	/*
+	 * 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

  parent reply	other threads:[~2019-01-22 10:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190122101355eucas1p23f870cf5906167bcd9f9b0bdb9687219@eucas1p2.samsung.com>
2019-01-22 10:13 ` [dpdk-stable] [PATCH 17.11 0/2] net/ixgbe: busy polling fix backport Ilya Maximets
     [not found]   ` <CGME20190122101400eucas1p2210f3181b9b91b4061d45111b6565ab4@eucas1p2.samsung.com>
2019-01-22 10:13     ` [dpdk-stable] [PATCH 17.11 1/2] net/ixgbe: fix busy polling while fiber link update Ilya Maximets
     [not found]   ` <CGME20190122101405eucas1p250262f33d08bed8919096c6c46f41ed4@eucas1p2.samsung.com>
2019-01-22 10:13     ` Ilya Maximets [this message]
2019-01-23  5:41   ` [dpdk-stable] [PATCH 17.11 0/2] net/ixgbe: busy polling fix backport Yongseok Koh

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=20190122101341.9556-3-i.maximets@samsung.com \
    --to=i.maximets@samsung.com \
    --cc=anatoly.burakov@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wei.zhao1@intel.com \
    --cc=yskoh@mellanox.com \
    /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).