From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 669F4493D for ; Thu, 8 Nov 2018 11:24:11 +0100 (CET) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181108102409euoutp016cacb299d39883d4a27179672ad3ff6e~lHxsuxjUO2579925799euoutp01i for ; Thu, 8 Nov 2018 10:24:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181108102409euoutp016cacb299d39883d4a27179672ad3ff6e~lHxsuxjUO2579925799euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1541672649; bh=8iNgEseDX7J/hg4ZLDseRtP+3vO8NuWutBx4kmfUzpE=; h=From:To:Cc:Subject:Date:References:From; b=CEiwIQ20QSmUpad0dsJjEuHF6J9OjzfvgMvJfg+6Id0ZG0AiBcDl+5ivWwIVQlpha XtWQ+md46j9MHxm6Pa0bvhOzhPiAknMrPv0kid569RzOIydP1QGOu5Ah8ahjebxTXm ekt9++eq0EIIXL27fDMdWrdn9J6+7ZP/TfD0UngE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181108102408eucas1p165b9651f6a97b6b8655c803e065b4b25~lHxsYnozj1201012010eucas1p1z; Thu, 8 Nov 2018 10:24:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 2C.1C.04806.8CE04EB5; Thu, 8 Nov 2018 10:24:08 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181108102407eucas1p1333804da3f477295a691da4d82b018ed~lHxrsja6t1201012010eucas1p1y; Thu, 8 Nov 2018 10:24:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181108102407eusmtrp2d341ada8696e7ff4f33d0e45ab8c8696~lHxrgucDT0696506965eusmtrp2H; Thu, 8 Nov 2018 10:24:07 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-30-5be40ec8a30d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1F.23.04284.7CE04EB5; Thu, 8 Nov 2018 10:24:07 +0000 (GMT) Received: from imaximets.rnd.samsung.ru (unknown [106.109.129.180]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181108102406eusmtip2117c5d2d47ae1ea8aa423c35caf00a6a~lHxqujRSy0545705457eusmtip2b; Thu, 8 Nov 2018 10:24:06 +0000 (GMT) From: Ilya Maximets To: dev@dpdk.org, Qi Zhang Cc: Wenzhuo Lu , Konstantin Ananyev , Laurent Hardy , Ferruh Yigit , Ilya Maximets , stable@dpdk.org Date: Thu, 8 Nov 2018 13:24:01 +0300 Message-Id: <20181108102401.23599-1-i.maximets@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLIsWRmVeSWpSXmKPExsWy7djPc7on+J5EG1y8Lm3x7tN2Jos7e0+z W1xp/8lu8f7PIhaLy2ems1hM39DPZvGv4w+7xdYzfxkdODwu9t9h9Pi1YCmrx+I9L5k8+ras YgxgieKySUnNySxLLdK3S+DK6J34lr3gvlDF+UUvWRoYF/J3MXJySAiYSBz6dYwdxBYSWMEo 8XMXbxcjF5D9hVFi78lWNojEZ0aJFVttYBpe73jKClG0nFFi8eImJgjnB6PErHl7mEGq2AR0 JE6tPsIIYosIGEqsuf+GBaSIWeA5o8SvjzfB9gkL+EusmvgLrIFFQFXiwpqdTCA2r4C1xNcL m5kh1slLrN5wgBmkWULgPpvE+u63QEUcQI6LxIJbdRA1whKvjm9hh7Bl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hqaG5haWhubG5sZqEkznveoDJKSCA9 sSQ1OzW1ILUIpo+Jg1OqgTGb+VfRG+9vuXWypy8zFn/+ce9tsvx5H9cNS/fmVGcsqbVh5Pvz JC8mWPHOkZ/lc3Yd+L6Joe9abRzL5+t2irvZzpuX67JzrzM4a1Dme37Pb8PcL+YF/ccPvDM+ KrZKvdi/foIX190dz5I+T7Fa9P/MUcEk0UNqjFdPrvv2uM7R6Wdj76NDB5OUWIozEg21mIuK EwHGJLZyWQIAAA== X-CMS-MailID: 20181108102407eucas1p1333804da3f477295a691da4d82b018ed X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181108102407eucas1p1333804da3f477295a691da4d82b018ed X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181108102407eucas1p1333804da3f477295a691da4d82b018ed References: Subject: [dpdk-dev] [PATCH] net/ixgbe: stop link setup alarm handler before device start X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 10:24:11 -0000 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 --- 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