From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B4E8A0C4D; Wed, 13 Oct 2021 04:45:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1EF641166; Wed, 13 Oct 2021 04:45:41 +0200 (CEST) Received: from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128]) by mails.dpdk.org (Postfix) with ESMTP id 8308C41150 for ; Wed, 13 Oct 2021 04:45:38 +0200 (CEST) X-QQ-mid: bizesmtp45t1634093127t0lr0gcz Received: from jiawenwu.trustnetic.com (unknown [183.129.236.74]) by esmtp6.qq.com (ESMTP) with id ; Wed, 13 Oct 2021 10:45:27 +0800 (CST) X-QQ-SSF: 01400000000000E0H000B00A0000000 X-QQ-FEAT: b174WCRqV1gKeBEJHA5+Qk18d8K5WSwUqvHZJolsoIpST74FibzA40arLzFkj qKeHJhyUcJThX49C83rA1/fZfx6LfJpYJdb7gFNXyJOxVWM2iu7duhFnxPlJDGVqBJjNqUZ VQM5OipT4YZxf+0hchv+X3RlbIjJpKun57lmoWn6b+/+zpjO98t8koVK7e5VpNssPTKwTuH ccBWpyIsRzK2J4phleiGGi3Xi7OEpBKyQY8U+c4CZfacAGzEhn/b0SMwd5735smLMCnOqzP DGuCLl1tX16CZyzRdotl1abrjoZnZ1RcYL3JFDmFCRBYfuzrnZoV11bfy8tkxswiz2jpeiv 34cEE/4TeshOvZhhUq6xbRgn1ouxw== X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Date: Wed, 13 Oct 2021 10:45:19 +0800 Message-Id: <20211013024521.20520-2-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20211013024521.20520-1-jiawenwu@trustnetic.com> References: <20211013024521.20520-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign7 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH 1/3] net/txgbe: fix to get interrupt status X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/txgbe/base/txgbe_regs.h | 1 + drivers/net/txgbe/txgbe_ethdev.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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); } -- 2.21.0.windows.1