From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 99942A0096 for ; 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 To: CC: , , Yunjian Wang , 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190508125138.G3BU__9678KOMHPFC9PPycTd45AIkLUTx4eeBZjspno@z> From: Yunjian Wang 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 --- 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