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 D7B9145BE5 for ; Mon, 28 Oct 2024 03:09:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A375740698; Mon, 28 Oct 2024 03:09:04 +0100 (CET) Received: from smtpbg154.qq.com (smtpbg154.qq.com [15.184.224.54]) by mails.dpdk.org (Postfix) with ESMTP id C6E4C40684; Mon, 28 Oct 2024 03:08:53 +0100 (CET) X-QQ-mid: bizesmtpsz8t1730081330tlyn2uq X-QQ-Originating-IP: LVV9hxeIov6OqWPOfYNIy47cQPPAIUeqly3fcgwPb8Q= Received: from wxdbg.localdomain.com ( [36.24.66.21]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 28 Oct 2024 10:08:49 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6194721514714591776 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v2 10/13] net/ngbe: fix driver load bit to inform firmware Date: Mon, 28 Oct 2024 10:31:44 +0800 Message-Id: <20241028023147.60157-11-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: MkhAA4qIuU0puR6EDKZ5L+ifs98d9NlZm/4AKf6wjGLGM//kyHWOLyLY zCzOxpy9GXXZZbR8Hzk7syxiVcG+CHccGy2B8+M7AeNAp6Eb1rppTYSfdyw7Nlom/udKbnz pHEO7qteSGEBvA120tN6iAlxvvT8kZF3enh4QgBT/BiKkXlMcw3Ja4o1CjA0WB8NCti3uod dIJ2OWbm+VLn1LziKkAOE0H4nfK9yxjhSSB8hiodUo+rmakRO59VTbSteikJuGxEJGppx/8 cH87JoZZOt2DBZclWzSiHlzUVs0hwiGx1SXhQdOwnr6L3e+gj89v6fMhdzIYUqUWiN3w7h/ gw/5XHWAEXjyiSDTthCXrN3KOxCO3cF2cQe9ApFskTf9DMCg/AhN8Xe0OJBOAfw7h67YeNz 8ghvW9LMpFXi0YQK4qIKEAKzM6UbMTX48bJmtuxJ1PUAHXH15AHFdFVOIIAnaUac2W7Ka7w NqgOZuoCnuJjnqbt8bnjrNx/E5mnr5zAFZmUq885yQuNU12iEuDpoOaheEFPjqMqfiZLjqY jfJn72YB6yeSRA/tNbcwQb7PLUIbmoCbBaExf/QlIEdcl/7BwIG0jbB33WuRcFbMv7CV0xx eHtm8wpOWilzgCjAXxw2rvOTukREjwUvgPB6238a6YGlC8JT20QYSbpWYBSFiG2t+D7GRLT M+/d2Wa0RGNxwDkdMVbxWLF2tY9NLdrk1gsepwKY61AO+dxTdbBfulTYnhbRA52otUYqWyw UMB2C9XEpe+JxTWR0HgFohAcDR6VxXwVtnxIErMbXetZJYEUV0n5dcxbQfqRFy6ixzbPOr4 Dwq94Z9rlR/O95+gGqUopFNChfz1e31wLUwkuv5XnzOwxl6YD3j0C9GysX/dC4NF4ESOVWQ entES2eM7BzNYI/jVG0MaCZHs2TiKJ5s4l+N8ssiMI3VPwjhcdFl6DMzVBgzO0WurGPVpHv Nxsz7zxkwYqNDodSd6ife/ri8OQFa4DabAXKm8gWDhybHs3U9fA78Hk9k2sb0Do8nLkoCIz /SQsoD/Rjd7x8EiNfw7VePOsY623xBzwejuQiRMg== X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= X-QQ-RECHKSPAM: 0 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Drv_load bit will be reset to default 0 after hardware LAN reset, reconfigure it to inform firmware that driver is loaded. And set it to 0 when device is closed. Fixes: 3518df5774c7 ("net/ngbe: support device start/stop") Fixes: cc63194e89cb ("net/ngbe: support close and reset device") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/ngbe/ngbe_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c index d9d2daf656..ba46dcf2a5 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -263,6 +263,8 @@ ngbe_pf_reset_hw(struct ngbe_hw *hw) status = hw->mac.reset_hw(hw); ctrl_ext = rd32(hw, NGBE_PORTCTL); + /* let hardware know driver is loaded */ + ctrl_ext |= NGBE_PORTCTL_DRVLOAD; /* Set PF Reset Done bit so PF/VF Mail Ops can work */ ctrl_ext |= NGBE_PORTCTL_RSTDONE; wr32(hw, NGBE_PORTCTL, ctrl_ext); @@ -1277,6 +1279,9 @@ ngbe_dev_close(struct rte_eth_dev *dev) ngbe_dev_stop(dev); + /* Let firmware take over control of hardware */ + wr32m(hw, NGBE_PORTCTL, NGBE_PORTCTL_DRVLOAD, 0); + ngbe_dev_free_queues(dev); ngbe_set_pcie_master(hw, false); -- 2.27.0