[dpdk-dev,v2] nfp: unregister interrupt callback when closing

Message ID 1474024274-27550-1-git-send-email-alejandro.lucero@netronome.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Alejandro Lucero Sept. 16, 2016, 11:11 a.m. UTC
  With an app using hotplug feature, when a device is unplugged without
unregistering makes the interrupt handling unstable.

Fixes: 6c53f87b3497 ("nfp: add link status interrupt")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Bruce Richardson Sept. 21, 2016, 10:07 a.m. UTC | #1
On Fri, Sep 16, 2016 at 12:11:14PM +0100, Alejandro Lucero wrote:
> With an app using hotplug feature, when a device is unplugged without
> unregistering makes the interrupt handling unstable.
> 
> Fixes: 6c53f87b3497 ("nfp: add link status interrupt")
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Applied to dpdk-next-net/rel_16_11

/Bruce
  

Patch

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index d79f0a1..f78eb82 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -733,6 +733,11 @@  nfp_net_close(struct rte_eth_dev *dev)
 	rte_intr_disable(&dev->pci_dev->intr_handle);
 	nn_cfg_writeb(hw, NFP_NET_CFG_LSC, 0xff);
 
+	/* unregister callback func from eal lib */
+	rte_intr_callback_unregister(&dev->pci_dev->intr_handle,
+				     nfp_net_dev_interrupt_handler,
+				     (void *)dev);
+
 	/*
 	 * The ixgbe PMD driver disables the pcie master on the
 	 * device. The i40e does not...