net/ixgbe: fix unexpected link handler
authorYunjian Wang <wangyunjian@huawei.com>
Wed, 8 May 2019 12:51:38 +0000 (20:51 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 May 2019 16:40:06 +0000 (18:40 +0200)
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>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index 975fa47..2470c89 100644 (file)
@@ -1344,6 +1344,9 @@ eth_ixgbe_dev_uninit(struct rte_eth_dev *eth_dev)
        /* 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);