From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 14DA869D4; Wed, 13 Feb 2019 03:49:38 +0100 (CET) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C2C5B7509D2B4B8B3F8C; Wed, 13 Feb 2019 10:49:36 +0800 (CST) Received: from localhost (10.177.24.66) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.408.0; Wed, 13 Feb 2019 10:49:29 +0800 From: wangyunjian To: CC: , , Yunjian Wang , Date: Wed, 13 Feb 2019 10:48:52 +0800 Message-ID: <1550026132-9244-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 X-Originating-IP: [10.177.24.66] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/ixgbe: fix crash when on remove 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: Wed, 13 Feb 2019 02:49:39 -0000 From: Yunjian Wang The nic's interrupt source has some active handler, when the port remove. We should cancel the delay handler before remove dev to prevent executing the delay handler. Call Trace: #0 ixgbe_disable_intr (hw=0x0, hw=0x0) at /usr/src/debug/dpdk-18.11/drivers/net/ixgbe/ixgbe_ethdev.c:852 #1 ixgbe_dev_interrupt_delayed_handler (param=0xadb9c0 ) at /usr/src/debug/dpdk-18.11/drivers/net/ixgbe/ixgbe_ethdev.c:4386 #2 0x00007f05782147af in eal_alarm_callback (arg=) at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/ eal_alarm.c:90 #3 0x00007f057821320a in eal_intr_process_interrupts (nfds=1, events=0x7f056cbf3e88) at /usr/src/debug/dpdk-18.11/lib/ librte_eal/linuxapp/eal/eal_interrupts.c:838 #4 eal_intr_handle_interrupts (totalfds=, pfd=18) at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/ eal_interrupts.c:885 #5 eal_intr_thread_main (arg=) at /usr/src/debug/dpdk-18.11/lib/librte_eal/linuxapp/eal/ eal_interrupts.c:965 #6 0x00007f05708a0e45 in start_thread () from /usr/lib64/libpthread.so.0 #7 0x00007f056eb4ab5d in clone () from /usr/lib64/libc.so.6 Fixes: 2866c5f1b87e ("ixgbe: support port hotplug") 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 7493110..e9533e5 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1336,6 +1336,9 @@ struct rte_ixgbe_xstats_name_off { rte_delay_ms(100); } while (retries++ < (10 + IXGBE_LINK_UP_TIME)); + /* cancel the delay handler before remove dev */ + rte_eal_alarm_cancel(ixgbe_dev_interrupt_delayed_handler, eth_dev); + /* uninitialize PF if max_vfs not zero */ ixgbe_pf_host_uninit(eth_dev); -- 1.8.3.1