[v3,12/13] net/ngbe: fix interrupt lost in legacy or MSI mode

Message ID 20241104023007.782475-13-jiawenwu@trustnetic.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Wangxun fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jiawen Wu Nov. 4, 2024, 2:30 a.m. UTC
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(+)
  

Patch

diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c
index c372fd928c..325a9d1eaf 100644
--- a/drivers/net/ngbe/ngbe_ethdev.c
+++ b/drivers/net/ngbe/ngbe_ethdev.c
@@ -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);