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 92FB245BE5; Mon, 28 Oct 2024 03:08:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 827D240649; Mon, 28 Oct 2024 03:08:42 +0100 (CET) Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) by mails.dpdk.org (Postfix) with ESMTP id E0C61402A3; Mon, 28 Oct 2024 03:08:38 +0100 (CET) X-QQ-mid: bizesmtpsz8t1730081314tc3no6h X-QQ-Originating-IP: SqSl7TrWlUR7qaAd/MJDVWy6qqB484m2jc5MN8Oxlng= Received: from wxdbg.localdomain.com ( [36.24.66.21]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 28 Oct 2024 10:08:33 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 15610977390140531478 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v2 04/13] net/txgbe: fix driver load bit to inform firmware Date: Mon, 28 Oct 2024 10:31:38 +0800 Message-Id: <20241028023147.60157-5-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: NhvpCzAv3WKAt/M36PCC7xiP65Dj8Z3F7swSwqQ53ugqWHELakVgTi2W VSgSNhH2Tt9jC2KnP8rG1FyfDrjmj+NxmMPgnmZ6T19CoytuNI3IY5d+9kRNP7d7+vntjO+ Nqw+ZWo21iihkxFIj1BXc5In8RAmbkN0jYdTDYBzTQZZSCKNDfx1pwDYDcRh+kLmMgSDaLc Ur+SIlF6y/9KKG35owXGFXt0bmUOul+DD4DWN+jWC1+He/McJmvV0kFvL5FBOOoKPVDLAB4 Bi1wwxXAAWBiYeUPzsjXIr9wHH7Qkz1NyqzTApt9ZZo2M+XRlBd3ywtWSdI1j5PJ1j2v2T4 0Y3QIZZpndhftAm7U2Ukb0R4aleXXD6693Jt1iWPoCy2fhdUkhHk/IKUCVQHs/Fl0GJBqqd CkF7gCFvxyLTZXAby85w/NsESDwHHFI/enoqV/qP4gPlZpzYufWjRY+stz1O9S+kb9Pb4kj i2c+jf5uOaXswC2CLOV3mS2i1lfsFeflnc6JEKU1MvR10nRJu9T4BCNOdWlz20b3CW+J39X SS4ikcR2HFmxaDq8ket3GZpkJdmw10f0muvPNgOvx0EjRrN2VN+Wlw34bgLB3LW4j4Vu/ap mSRecAv5B6I/ve/m1TAFQFZuXdfDzqT3h8OrElx5ZMnlNfryXzlBsvlC41TTeSsUWEKTYg6 uqOlxIhEaef4lOn7mWWomLInR8jXASrjhJc1pWIyTmnkOsvjTJkOhF8D/4WUeaiNxp8DKXM lE4F6jBE1E9xyIgUlmHEElZuYFQlQpaZzJa7tT7LXbrsX1yIjFPCwf2CGqa3B6bg2dp7Au1 B9MUhKXNmM3SR+/I2d6Lj0AVisxV/bO3xvUA8KeewTF6vTLiPudgU7J5vi+7V/yOMSrRicg FMngYnqMkO0PCgIoixqTFAHUW8wBO9aar1NakVDzg7yxwAYMfxrHCywP5xC0suA3gfj2A4C 094kcBCIkeW1yVm8VeQbyKFD9JdVQz3CZPM/KIDpk1lt5W3DMX1MlZnN6 X-QQ-XMRINFO: M/715EihBoGSf6IYSX1iLFg= 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 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: b1f596677d8e ("net/txgbe: support device start") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 2834468764..4aa3bfd0bc 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -331,6 +331,8 @@ txgbe_pf_reset_hw(struct txgbe_hw *hw) status = hw->mac.reset_hw(hw); ctrl_ext = rd32(hw, TXGBE_PORTCTL); + /* let hardware know driver is loaded */ + ctrl_ext |= TXGBE_PORTCTL_DRVLOAD; /* Set PF Reset Done bit so PF/VF Mail Ops can work */ ctrl_ext |= TXGBE_PORTCTL_RSTDONE; wr32(hw, TXGBE_PORTCTL, ctrl_ext); @@ -2061,6 +2063,9 @@ txgbe_dev_close(struct rte_eth_dev *dev) ret = txgbe_dev_stop(dev); + /* Let firmware take over control of hardware */ + wr32m(hw, TXGBE_PORTCTL, TXGBE_PORTCTL_DRVLOAD, 0); + txgbe_dev_free_queues(dev); txgbe_set_pcie_master(hw, false); -- 2.27.0