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 9BDCE45BE5; Mon, 28 Oct 2024 03:09:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 722CB4068A; Mon, 28 Oct 2024 03:09:06 +0100 (CET) Received: from bg1.exmail.qq.com (bg1.exmail.qq.com [114.132.58.223]) by mails.dpdk.org (Postfix) with ESMTP id D6EFB4060A; Mon, 28 Oct 2024 03:08:59 +0100 (CET) X-QQ-mid: bizesmtpsz8t1730081333td7aqzq X-QQ-Originating-IP: 6MF+kqNwGQ5az8aykQ2PAvcOspCZYZCV4+xd+I0uXYo= Received: from wxdbg.localdomain.com ( [36.24.66.21]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 28 Oct 2024 10:08:52 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11705363039825570677 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v2 11/13] net/ngbe: reconfigure more MAC Rx registers Date: Mon, 28 Oct 2024 10:31:45 +0800 Message-Id: <20241028023147.60157-12-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241028023147.60157-1-jiawenwu@trustnetic.com> References: <20241023064836.2017879-1-jiawenwu@trustnetic.com> <20241028023147.60157-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: NRYSeI3Ux+UPdgiQ2LbZhbXGiFF/C00hjWBEnLug/WoLUAAXhXl46+Bv vD9kOeLF2ahwYVfqooYbXJps5o9JLzguVbh1P+m2iIjOPhfTKU2a+laQve7XRrmV51fW4KF x4YUtB6aDVmxfiuEBF+lJt0QuBu+wXcqCPaoRNJ7IQAmZOU/tEP/Ho7o3rqT8kUtvsGqBAi 9wjqt5b5psYzBlcEdd2EX/t5nKmoN+CYG1s3Qu43pOzW9fLxia210yLU1McrOGeB1oLPmbl VvwstqWMtHZvi1hGCquYj2EFxGw08iEcYHdiNWRjhdZ6vS6kjNHCtS/6uqn2rtQFugcCl/a OdJmqaIpYPpqW2O3/u/JxOyLAtiX2i4q1q1fmUQrreJeT4gV3va2EQd/2pfEsSlWcVWGHQ5 wxCaQkmykAUXZmmadSWGxL6aSLQvrb2xj/pSaUnfN6IUVkMvpzCj3VinqrkAZDpnz+CUmmm 2spVy79/5xA1ehEp+DYuPqQT5iQufMVWGtdXEVWki6Vy9KsqMi1F2WPgDFYecBUKE6cl8KU URysGnoCE26n60z+iLKwPEmD8gV4v4fQIRX5dUbZF5lIbnIdwLaumQYWXnm0m0Zmv8zf7Lj 50hooVsveaWcgL3bW3oWPDGc0Ao1jwC1fQ9nqeGPZVjBRRNI7ZeMWxECnFK0Oru43ikBZR3 pA824K/x3TuY/VFFgALfj6fth9wSFlNq7Awy9QdixQjMGbt5Jeiz0BDCcUwwTRb7+/qubFY 3ft9PNKLdLPo27lQEGaNERHHDEWVz62SS/UxobbwTWb4ruWJQxgAbiywxNcOMzpVYtTRVy+ Rxo8Rob7jKHNwDKdaAW2IipqKrT53kiU0nCH1toxnf2knPUfG5pJX+VIrycG7TJeU/tsdkY X3/IEkC0lKxniF3yHYDUvmjStC/PaUGt9SyKzgyVdkug5/Ka6F3X+g1kKyT9ieol8ihyzK9 ce+0K7ikdVlDJFa0TMihifH8MRKQZgjJTBY7UadCK/cHWJURM/Sr/Zf0k X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= 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