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 003F645C2A; Mon, 4 Nov 2024 03:08:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E0D440DDA; Mon, 4 Nov 2024 03:07:20 +0100 (CET) Received: from smtpbg150.qq.com (smtpbg150.qq.com [18.132.163.193]) by mails.dpdk.org (Postfix) with ESMTP id 8C02440B9F; Mon, 4 Nov 2024 03:07:15 +0100 (CET) X-QQ-mid: bizesmtp91t1730686031tzpn4jsm X-QQ-Originating-IP: FmRB2qhZcyqnGfKNcNJZhRsMGdrerNm50ui8F0fLbqE= Received: from wxdbg.localdomain.com ( [60.186.23.108]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 04 Nov 2024 10:07:11 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4281527610238001315 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v3 10/13] net/ngbe: fix driver load bit to inform firmware Date: Mon, 4 Nov 2024 10:30:04 +0800 Message-Id: <20241104023007.782475-11-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: MQeLyr+N5AxPYh7JEPjI60To/pqDlDv6QS1HC+X6oRcKSlR9zB6rDv2x l4bxBEYZmT/bNFhsoEUtGoMHAstqw7AY/c5dNVcyknz4gaofhH1mP4Qky+V4t/3s91tCBIh CTIqyUKAZJM/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discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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 353d17acc8..238533f2b8 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