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 836D445D0D; Fri, 15 Nov 2024 09:10:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59302402B5; Fri, 15 Nov 2024 09:10:54 +0100 (CET) Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by mails.dpdk.org (Postfix) with ESMTP id 65A8B40278 for ; Fri, 15 Nov 2024 09:10:51 +0100 (CET) X-QQ-mid: bizesmtp85t1731658249te6fpa7a X-QQ-Originating-IP: /0OgQFqqkoZEv0E2b058p8R8l4JBbYl+SusIPTpOAQY= Received: from wxdbg.localdomain.com ( [115.206.160.29]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 15 Nov 2024 16:10:41 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5545175353688274416 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Subject: [PATCH] net/txgbe: fix a mass of interrupts Date: Fri, 15 Nov 2024 16:33:36 +0800 Message-Id: <20241115083336.1195101-1-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz8a-1 X-QQ-XMAILINFO: McfvTdNTSvcBcITR/eaqZEZKAuiKFQgAkOoQDpWhDLQnDTvFFn6sayzB ItF4tfibjbPtYUSvtVqvW88TW2FMZdnS7PmANwwAzUlPfzLoOYtCvmSN3eTVqG6LG/Lm1T4 wiJXlWMqSW7AY8JupdFpLU+Ab+Ujk1M+VKRzf9s7/LIOXQBuW3vhGF//G1sghgLfFwgEqGo GosfjFBsIZkZlClgkm8OQXmZkDe6fRaSCxqysT7D9C8Lmwh7fnL5pbQExPt2CymO0OO1pCw ku/oOyVYrEGhKHFy1/5qFiYKy68fSvkQPff+//jhLiVpeVGPfBcw/0sDePCwyYQiM44bbwC RIgIA3qWaG9R6zUENitvtjAl488ujP44mGmukUF208xXApkoU8vYFHlO2/FdDJzzM9oXjvK tXENogwjRpexQBBznM3kCM35YAnahs8PF13TdAR+q6aUNr0rpZc/ST/tKCUC6EDS/a2ohey vsOC1taeZG2x/2nP9u3TtfkQTXYjTsJ+7hCaRTaN7l8PC7VDqL++OCIt6qaGcvS3F0GyGwa rHSRiCfvzYAp7Ly0xwi8+6i9R0v7PXE4M88HhDsnqXzdkd3LDe057NDPfQd3PSWWxXa0ghT 0PinDyHx8na+VmFy038QLbF67k5DZ8Pj8gUgtu2rOquS/lWZ3A14mNb0gZXo27ra11xBP4W IvHuGUik9OWoHCjeaXyZXaOVcmB4ns9E6tzNuegAfwse+/FNlRA/eBXqxEtBmvRpBQmpTFn +tNc6RpS3RclLl/R1ZyPrU5PO7iTLMPgMV3ulrXFWObFGpvexQ7N5uqmEm8UwiJjyKO04DI IBd+aCMos3l4/XzHzloAhuY+Hb0e862Hmka627S3lSdWNPJsjO8sCImFyp6U6ogJP73FmUP qmAI+Ymo9Ozrz05HLtZVKWD2Fp74oewRALlpM2qqMDKY12lDXdHpom83VXRBCrigdp4NYlJ 4UbVaVnJ9+v44o2kb3lo6nTNkfyZtiEDRgwGOij7zTYI2V70UxLswjCd7roicGNgoIP9WAQ 9mpUex8Q== X-QQ-XMRINFO: OWPUhxQsoeAVDbp3OJHYyFg= X-QQ-RECHKSPAM: 0 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 Since firmware version 0x20010, GPIO interrupt enable is set to 0xd by default, which means enable bit 0 'tx_fault'. And GPIO interrupt polarity is set to 0xd by default too, which means these interrupts are rising-edge sensitive. So when unplug the SFP module, GPIO line 0 'tx_fault' is 0 -> 1 triggers the interrupt. However, the interrupt is not cleared. And GPIO interrupt mask is enabled and disabled to trigger the MISC interrupt repeatedly. Since this 'tx_fault' interrupt does not make much sense, simply clear it to fix the issue. Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index a956216abb..ea9faba2c0 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -1555,6 +1555,9 @@ static void txgbe_reinit_gpio_intr(struct txgbe_hw *hw) wr32(hw, TXGBE_GPIOINTMASK, 0xFF); reg = rd32(hw, TXGBE_GPIORAWINTSTAT); + if (reg & TXGBE_GPIOBIT_0) + wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_0); + if (reg & TXGBE_GPIOBIT_2) wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_2); @@ -2796,6 +2799,8 @@ txgbe_dev_sfp_event(struct rte_eth_dev *dev) wr32(hw, TXGBE_GPIOINTMASK, 0xFF); reg = rd32(hw, TXGBE_GPIORAWINTSTAT); + if (reg & TXGBE_GPIOBIT_0) + wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_0); if (reg & TXGBE_GPIOBIT_2) { wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_2); rte_eal_alarm_set(1000 * 100, txgbe_dev_detect_sfp, dev); -- 2.27.0