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 3D2CA45BAC; Wed, 23 Oct 2024 08:29:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48E0C40E3B; Wed, 23 Oct 2024 08:29:00 +0200 (CEST) Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by mails.dpdk.org (Postfix) with ESMTP id 5736740EDB; Wed, 23 Oct 2024 08:28:36 +0200 (CEST) X-QQ-mid: bizesmtpsz8t1729664913t0kgzyq X-QQ-Originating-IP: qNu6UhmryBp8FDpYGmogZ9q3SyxuZcTiPMmxspitQ4g= Received: from wxdbg.localdomain.com ( [125.122.84.15]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Oct 2024 14:28:32 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14817680273175321099 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 12/13] net/ngbe: fix interrupt lost in legacy or MSI mode Date: Wed, 23 Oct 2024 14:48:35 +0800 Message-Id: <20241023064836.2017879-13-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241023064836.2017879-1-jiawenwu@trustnetic.com> References: <20241023064836.2017879-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpsz:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz8a-1 X-QQ-XMAILINFO: NQR8mRxMnur9GPkA9zCMu1emP7jsaCZ6eTPvTRHWyXylqbofHVuts7ih u+8Eu0SXTKXK2SjUG4cYBQcfQMN1pZv8z0Np57F03mtudtNYG0LsMPwjDKF0mhimaAqrniQ IGpIEf0AFo7JjjINeral2utZ0XlotQJDMeSr4k3+htgexf5Cpqx/2dCECMMcprP8fYwzj3p AmvuUJDk3VUbE1lnD9t7fOZ1GuvoiYMKSqE0dh/BPakaaS5DREXAxarhE4QgoiQ4ZyoiddE g/RiDTqwX9RA7bwqpWsArP+erQG8UkoCmRciuSl/DNhOoFKYiFp6D7WQtKoTCjYqS3zBMVc 57UZzq/9+6uOdnHfTV0s6kLTtb1MKNuf0+pan0glCcgIte/sdBKnfK+rK0bjFPKWF0zlghU hhG2p16dzapJEhuEjlDuz2MvS1q7BsfPQIvQyjs0OJ0zOJbcjui7zAF7xydqRFyBhRrHOFE ENSutnYx65kmEGNHhB1BCkJaa6dtoUYdZN0fRvdLp0OLtSMayoPLUArhNC2HmRhsMK71NI0 w6H17QmIfImeXI8O+B8EoFlO2Lgir4tDdwHFz9SFX2wcxvCr/iOZo+HN5jevBNBgnOXqe4p Kv3HmKN/6j6OGG66bfUwot3jQiPtC7HMrtU4/XRNBaeDTnyTR9ZXU6D1O0IJPMGvoR8fOHd mqyai62Ey3XOIM9A6zBPTBbNjFCTKSjjZ11CjbWVDY2lgrrJnCFw18DkxAwOQGsxEitO8us 7f08Hq4Ip0pSl3fcZUFg/gBGa5WcBLRt4mRxAEid1W3IDKxLriVfZBUMbzHWgvPOhXz5tsv lGPrEh4wJOHuB6/oBBXomGnKuOuZYJsyXQgGX+SboG7FQRFFdyevPu7pmYklzJ6k3CkAXBN ITRERJyDHMPN/TZigtUENTN1yAFPMyqyiSWGsFTB0eEmlAFz3z4NgkDXmAOq+Tldc5GS8yN OUw3QQljoeTnQyMsqpT977L4shadtc1y7jOZOy4lbCYy/j1GJx2B9kOEhWKq4LFzrTVU= X-QQ-XMRINFO: NI4Ajvh11aEj8Xl/2s1/T8w= 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 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 --- drivers/net/ngbe/ngbe_ethdev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c index 3ea7ed43ff..e7dc1c0f94 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -2186,6 +2186,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); -- 2.27.0