net/tap: fix unexpected link handler
authorYunjian Wang <wangyunjian@huawei.com>
Thu, 16 Apr 2020 13:50:52 +0000 (21:50 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:08 +0000 (13:57 +0200)
commitdc1a4d86c63732e57e9593919504e8c81f46fcdf
treecb17f417e03dca834cca593e1a41868d20ccd7ca
parent14faf8e998297aed331f2eb4687bd9917c4e82ce
net/tap: fix unexpected link handler

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

Call Trace:
   0x00007f15e08dad99 in __rte_panic (Error adding fd %d epoll_ctl, %s\n")
   0x00007f15e08e9b87 in eal_intr_thread_main ()
   0x00007f15e249be15 in start_thread ()
   0x00007f15d5322f9d in clone ()

Fixes: c0bddd3a057f ("net/tap: add link status notification")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/tap/rte_eth_tap.c