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 A442945C2A; Mon, 4 Nov 2024 03:08:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B58B440DD1; Mon, 4 Nov 2024 03:07:18 +0100 (CET) Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by mails.dpdk.org (Postfix) with ESMTP id 6392F40B9C; Mon, 4 Nov 2024 03:07:15 +0100 (CET) X-QQ-mid: bizesmtp91t1730686033tqud107y X-QQ-Originating-IP: g/+NaELzUCpW4ZO1XagA8y/OqOgzEmb4+1wr/9Uh3Mc= Received: from wxdbg.localdomain.com ( [60.186.23.108]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 04 Nov 2024 10:07:12 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 8001140337641018006 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v3 11/13] net/ngbe: reconfigure more MAC Rx registers Date: Mon, 4 Nov 2024 10:30:05 +0800 Message-Id: <20241104023007.782475-12-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241104023007.782475-1-jiawenwu@trustnetic.com> References: <20241028023147.60157-1-jiawenwu@trustnetic.com> <20241104023007.782475-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz8a-1 X-QQ-XMAILINFO: NojR6Ao/DkEDck1FqqOMSUTFNy73tzlDV/AmhUcJMtP4AC7G3gnFXUFh Y2fxfmYxuuAlGIV/3hRZt0fsorhNiXwmUnmBsbRqaqD3E28i0PCAc02nRit+qcZ4jPDIW31 Wsq70pemm9DGy+jTFBh+HdiyWCwjk90Yxp8bi/BMR9eYMtIRoESVQ36xbJ6A66xQ1v2frdt BwCKbE40B5OIxXw6ns2xDSiRuVRYoLHohCfvx6hKtg5cdkV8QffRs3labycQuH7KoB+9Uw3 GNVz5353P5iXsq4rHGnsUQ3M2PMu5B6ZpS5JUwa04ZTSSOVgRSiVIdpgb+IWStDSvzIVle8 NSBuYcV7rRForHA/oz5XkzMNSoGyvrkTXBCUxP1bjIFJ/V6HR/HQ0XtSsHmZ84daWiEJVfQ UtPllzQFrCpcxK8TIwPLKndkdqpxymF2MBfM8t6VN75XuCmS1vHjUtuE1uobVQLRNScsFAd tJ6GtNNlPqlpJSKgb4MMIMAo/aA/sOF9yxb/0vJUvyq/rFEf/R25G8t4IBNikABMUUQvOPw Ih0uyCyj3UormCoGYz7qkKckZ+mbeFt9ua4b+N1krLW5TanMUFnjrBrADJ3tUfbsa5ghPGZ bw2AXBaQj08s1P3d+lCmqrbTU+zt9hflFkddJ4FLaiEIoGeRc8TX6N6ODSNRN3VWE18jSVD jdf4WQlZ6WaICJAVSt/qb8A8li8I9Vrouufmly9ATihdor7G7qvk9mtQyvsJs/M8O5mi+Mw YZtsWofzpP/0ujWIp241b0kaYfe2Fs3/008KODjtQARBTzOrmJjCWN6+CPkJqsgA1NPLP5Y qKwGgoeqjkb45yrOrxw7VeUZpw1A5neac7WcOR1wnvrhtSQ+ptzo34Lf1NPAFHb9x7Eyh2m MuZGk5tJEO/0Sr816Dfnaepny4kxP9fO8wafPzHIQZsb5XySB6LkKm2GCNtp5HuPCYiYsC/ Ec9eFpWHsBwQ0S9XBuuiR6QsxTB31v0o43XcM0EFt65DpdpAgtI1hDt1T X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= 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 238533f2b8..c372fd928c 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -1941,6 +1941,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; @@ -1998,8 +1999,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