[v3,12/13] net/ngbe: fix interrupt lost in legacy or MSI mode
Checks
Commit Message
When interrupt is legacy or MSI mode, shared interrupt may cause the
interrupt cannot be re-enabled. So fix to read the shared interrupt.
Fixes: b9246b8fa280 ("net/ngbe: support link update")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/ngbe/ngbe_ethdev.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
@@ -2193,6 +2193,19 @@ ngbe_dev_interrupt_get_status(struct rte_eth_dev *dev)
struct ngbe_hw *hw = ngbe_dev_hw(dev);
struct ngbe_interrupt *intr = ngbe_dev_intr(dev);
+ eicr = ((u32 *)hw->isb_mem)[NGBE_ISB_VEC0];
+ if (!eicr) {
+ /*
+ * shared interrupt alert!
+ * make sure interrupts are enabled because the read will
+ * have disabled interrupts.
+ */
+ if (!hw->adapter_stopped)
+ ngbe_enable_intr(dev);
+ return 0;
+ }
+ ((u32 *)hw->isb_mem)[NGBE_ISB_VEC0] = 0;
+
/* read-on-clear nic registers here */
eicr = ((u32 *)hw->isb_mem)[NGBE_ISB_MISC];
PMD_DRV_LOG(DEBUG, "eicr %x", eicr);