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 D95DF45BAC; Wed, 23 Oct 2024 08:29:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24F7D40E96; Wed, 23 Oct 2024 08:28:53 +0200 (CEST) Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by mails.dpdk.org (Postfix) with ESMTP id 5244740E2C; Wed, 23 Oct 2024 08:28:33 +0200 (CEST) X-QQ-mid: bizesmtpsz8t1729664911t0f1z27 X-QQ-Originating-IP: dM3SmmuEKJ45d421//YL1zXsl+FqVeAojQlyrGpVA7g= Received: from wxdbg.localdomain.com ( [125.122.84.15]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Oct 2024 14:28:30 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5996620260891551480 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 11/13] net/ngbe: reconfigure more MAC Rx registers Date: Wed, 23 Oct 2024 14:48:34 +0800 Message-Id: <20241023064836.2017879-12-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: MR/iVh5QLeieXNwzqTzvogcKeyvoPyXRXHw/5S/AwLrxBc1kW162Wp+g p1qKS8xqO4R4obESrlXqW7xd7S+YYCc1qOA4w61F8lnmr3qdR9YqDRaJ7sWD8CKUytN6Wnf JmOEixEnPuKQ+1aBBt4PtD/aRNMmZxpe8ZKOmrQZnOD9DUCQj15gQeEyBvfhRVNTh42Uy87 0mY7NPYuPk3JmPgCInsslzJ0oj6sZwYfbkcBMYLFzuQuSiujnk8DAE6VKVzDenbFu0ks+u3 s+IYiQWejydEBLbnNkXR6xyCk1v8pv7/v+j6gknSWNUIHIH+7np/wFEEFtuEW1O7Xrc5Ez0 g9LQThRmRfAKlQVXW00wdvVVwb8aDCor4mpZ2AtqUYZ64fmePh6g9YIHDKRtZzWVHqWMvK6 h1DrfCozwvQp3JAv3t+u/THekly3HIl34geTSmXjl6fovam07eomVSj16t+LTLIH041Ij80 2qCqWe7zUg/vd2sq0T5Xeoeylo258vw3XMx2547d9NEPPB5l8mz/9+wY5tZ9Z3kGNViwGGD BSFocXwZnKXP5wW4ENfCJg9LNsyoaFDdItGY67sSSo7szCxzMqbJU4ixRBo1ZtkN20XZp+q ZdEAsJkgHioTERoi7TuDiheHkGEKGXhWX1aNzxcHrGcdqoN/vLmBr3awCZlHDaMgugwPhjm 01w9kz2kNFrJtQNgvyiZ3yhs//Wl2WXrPXxJsuQa20yFIs381IHl8y40SjhHLw32PtPbhFx elf7M6Isden8Xu1eX6Uz+cnRKozphlGtUi714J/xfqtUoDroirggVUHg5Kp3S2cNzQ3nfsG KjWITySZWDiygtaofQRPAzO3e1OjPivRxJ+nijiAJEojRt9MLPRrwx08lK5J33RC/frnm29 x1AvM7Xj+6Q/yZm41wKDQx3SoVtidr6ljaRt/tTi1mLTZam7gxwjo/nmeW7LVIBY9URWGcZ SYihyYmHPN93YUYEDrFLIlgAmKy3m/8oFWEU7lywCh/iDVu7ElM32SNpi X-QQ-XMRINFO: Mp0Kj//9VHAxr69bL5MkOOs= 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 link status changes, there is a probability that no more packets can be received on the port, due to hardware defects. These MAC Rx registers should be reconfigured to fix this problem. Fixes: b9246b8fa280 ("net/ngbe: support link update") Fixes: a7c5f95ed9c2 ("net/ngbe: reconfigure MAC Rx when link update") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/ngbe/base/ngbe_regs.h | 2 ++ drivers/net/ngbe/ngbe_ethdev.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/ngbe/base/ngbe_regs.h b/drivers/net/ngbe/base/ngbe_regs.h index 8a6776b0e6..b1295280a7 100644 --- a/drivers/net/ngbe/base/ngbe_regs.h +++ b/drivers/net/ngbe/base/ngbe_regs.h @@ -712,6 +712,8 @@ enum ngbe_5tuple_protocol { #define NGBE_MACRXFLT_CTL_PASS LS(3, 6, 0x3) #define NGBE_MACRXFLT_RXALL MS(31, 0x1) +#define NGBE_MAC_WDG_TIMEOUT 0x01100C + /****************************************************************************** * Statistic Registers ******************************************************************************/ diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c index ba46dcf2a5..3ea7ed43ff 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -1934,6 +1934,7 @@ ngbe_dev_link_update_share(struct rte_eth_dev *dev, bool link_up; int err; int wait = 1; + u32 reg; memset(&link, 0, sizeof(link)); link.link_status = RTE_ETH_LINK_DOWN; @@ -1991,8 +1992,13 @@ ngbe_dev_link_update_share(struct rte_eth_dev *dev, wr32m(hw, NGBE_MACTXCFG, NGBE_MACTXCFG_SPEED_MASK, NGBE_MACTXCFG_SPEED_1G | NGBE_MACTXCFG_TE); } + /* Re configure MAC RX */ + reg = rd32(hw, NGBE_MACRXCFG); + wr32(hw, NGBE_MACRXCFG, reg); wr32m(hw, NGBE_MACRXFLT, NGBE_MACRXFLT_PROMISC, NGBE_MACRXFLT_PROMISC); + reg = rd32(hw, NGBE_MAC_WDG_TIMEOUT); + wr32(hw, NGBE_MAC_WDG_TIMEOUT, reg); } return rte_eth_linkstatus_set(dev, &link); -- 2.27.0