Skip to content

Commit

Permalink
net/ice: fix interrupt handler unregister
Browse files Browse the repository at this point in the history
[ upstream commit 63bd264 ]

rte_intr_callback_unregister may fail when irq cb is in handling,
use sync version to make sure unregister successfully.

Fixes: cf911d9 ("net/ice: support link update")

Signed-off-by: Frank Du <frank.du@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
frankdjx authored and kevintraynor committed Nov 23, 2022
1 parent 1f77635 commit b0df64d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/net/ice/ice_ethdev.c
Expand Up @@ -2456,12 +2456,17 @@ ice_dev_close(struct rte_eth_dev *dev)
return 0;

/* Since stop will make link down, then the link event will be
* triggered, disable the irq firstly to avoid the port_infoe etc
* resources deallocation causing the interrupt service thread
* crash.
* triggered, disable the irq firstly.
*/
ice_pf_disable_irq0(hw);

/* Unregister callback func from eal lib, use sync version to
* make sure all active interrupt callbacks is done, then it's
* safe to free all resources.
*/
rte_intr_callback_unregister_sync(intr_handle,
ice_interrupt_handler, dev);

ret = ice_dev_stop(dev);

if (!ad->is_safe_mode)
Expand Down Expand Up @@ -2493,10 +2498,6 @@ ice_dev_close(struct rte_eth_dev *dev)
/* disable uio intr before callback unregister */
rte_intr_disable(intr_handle);

/* unregister callback func from eal lib */
rte_intr_callback_unregister(intr_handle,
ice_interrupt_handler, dev);

return ret;
}

Expand Down

0 comments on commit b0df64d

Please sign in to comment.