From: Jiawen Wu Date: Wed, 13 Oct 2021 02:45:19 +0000 (+0800) Subject: net/txgbe: fix to get interrupt status X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ef6427a3f2868af08dc888031dcdf4eb41451b24;p=dpdk.git net/txgbe: fix to get interrupt status It's necessary to set 1 on TXGBE_PX_INTA register to get interrupts normally, when legacy interrupt mode is used. Fixes: 2fc745e6b606 ("net/txgbe: add interrupt operation") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- diff --git a/drivers/net/txgbe/base/txgbe_regs.h b/drivers/net/txgbe/base/txgbe_regs.h index 990589b013..48d9300a2e 100644 --- a/drivers/net/txgbe/base/txgbe_regs.h +++ b/drivers/net/txgbe/base/txgbe_regs.h @@ -1219,6 +1219,7 @@ enum txgbe_5tuple_protocol { #define TXGBE_IVARMISC 0x0004FC #define TXGBE_IVARMISC_VEC(v) LS(v, 0, 0x7) #define TXGBE_IVARMISC_VLD MS(7, 0x1) +#define TXGBE_PX_INTA 0x000110 #define TXGBE_ICR(i) (0x000120 + (i) * 4) /* 0-1 */ #define TXGBE_ICR_MASK MS(0, 0xFFFFFFFF) #define TXGBE_ICS(i) (0x000130 + (i) * 4) /* 0-1 */ diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index b267da462b..ab972a3a35 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -109,7 +109,8 @@ static int txgbe_dev_lsc_interrupt_setup(struct rte_eth_dev *dev, uint8_t on); static int txgbe_dev_macsec_interrupt_setup(struct rte_eth_dev *dev); static int txgbe_dev_misc_interrupt_setup(struct rte_eth_dev *dev); static int txgbe_dev_rxq_interrupt_setup(struct rte_eth_dev *dev); -static int txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev); +static int txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev, + struct rte_intr_handle *handle); static int txgbe_dev_interrupt_action(struct rte_eth_dev *dev, struct rte_intr_handle *handle); static void txgbe_dev_interrupt_handler(void *param); @@ -2938,12 +2939,17 @@ txgbe_dev_macsec_interrupt_setup(struct rte_eth_dev *dev) * - On failure, a negative value. */ static int -txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev) +txgbe_dev_interrupt_get_status(struct rte_eth_dev *dev, + struct rte_intr_handle *intr_handle) { uint32_t eicr; struct txgbe_hw *hw = TXGBE_DEV_HW(dev); struct txgbe_interrupt *intr = TXGBE_DEV_INTR(dev); + if (intr_handle->type != RTE_INTR_HANDLE_UIO && + intr_handle->type != RTE_INTR_HANDLE_VFIO_MSIX) + wr32(hw, TXGBE_PX_INTA, 1); + /* clear all cause mask */ txgbe_disable_intr(hw); @@ -3165,7 +3171,7 @@ txgbe_dev_interrupt_handler(void *param) { struct rte_eth_dev *dev = (struct rte_eth_dev *)param; - txgbe_dev_interrupt_get_status(dev); + txgbe_dev_interrupt_get_status(dev, dev->intr_handle); txgbe_dev_interrupt_action(dev, dev->intr_handle); }