From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 99942A0096
	for <public@inbox.dpdk.org>; Wed,  8 May 2019 14:52:01 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 777F7374C;
	Wed,  8 May 2019 14:52:00 +0200 (CEST)
Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191])
 by dpdk.org (Postfix) with ESMTP id CDF6334F0;
 Wed,  8 May 2019 14:51:57 +0200 (CEST)
Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60])
 by Forcepoint Email with ESMTP id A240571777612666275C;
 Wed,  8 May 2019 20:51:55 +0800 (CST)
Received: from localhost (10.177.24.66) by DGGEMS405-HUB.china.huawei.com
 (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Wed, 8 May 2019
 20:51:49 +0800
From: wangyunjian <wangyunjian@huawei.com>
To: <dev@dpdk.org>
CC: <i.maximets@samsung.com>, <xudingke@huawei.com>, Yunjian Wang
 <wangyunjian@huawei.com>, <stable@dpdk.org>
Date: Wed, 8 May 2019 20:51:38 +0800
Message-ID: <1557319898-9588-1-git-send-email-wangyunjian@huawei.com>
X-Mailer: git-send-email 1.9.5.msysgit.1
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Originating-IP: [10.177.24.66]
X-CFilter-Loop: Reflected
Subject: [dpdk-dev] [PATCH] net/ixgbe: fix cancel link handler when port is
	being removed
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190508125138.G3BU__9678KOMHPFC9PPycTd45AIkLUTx4eeBZjspno@z>

From: Yunjian Wang <wangyunjian@huawei.com>

The nic's interrupt source has some active handler, which maybe call
ixgbe_dev_link_update() to set link handler. We should cancel the
link handler before remove dev to prevent executing the link handler.
It triggers segfault.

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

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

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 975fa47..2470c89 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1344,6 +1344,9 @@ struct rte_ixgbe_xstats_name_off {
 	/* cancel the delay handler before remove dev */
 	rte_eal_alarm_cancel(ixgbe_dev_interrupt_delayed_handler, eth_dev);
 
+	/* cancel the link handler before remove dev */
+	rte_eal_alarm_cancel(ixgbe_dev_setup_link_alarm_handler, eth_dev);
+
 	/* uninitialize PF if max_vfs not zero */
 	ixgbe_pf_host_uninit(eth_dev);
 
-- 
1.8.3.1