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 D2B5745BAC; Wed, 23 Oct 2024 08:28:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A65E240E4C; Wed, 23 Oct 2024 08:28:22 +0200 (CEST) Received: from smtpbguseast3.qq.com (smtpbguseast3.qq.com [54.243.244.52]) by mails.dpdk.org (Postfix) with ESMTP id ABDB740E44; Wed, 23 Oct 2024 08:28:18 +0200 (CEST) X-QQ-mid: bizesmtpsz8t1729664896t590y2x X-QQ-Originating-IP: Yx56wH5wBlJTOXAyW1BKuKi4pv1VTJP6AMYKEkFFaLI= Received: from wxdbg.localdomain.com ( [125.122.84.15]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Oct 2024 14:28:14 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14928773688920118237 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 04/13] net/txgbe: fix driver load bit to inform firmware Date: Wed, 23 Oct 2024 14:48:27 +0800 Message-Id: <20241023064836.2017879-5-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241023064836.2017879-1-jiawenwu@trustnetic.com> References: <20241023064836.2017879-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: MBREESna/OUiXkaDSI6/oSAztDnjeCBFANc7jsxyLxuPczST2eaHv+Wb tneuNgqx04u/eL0vlO8BtjZmKsvdPPW3v487gAGHOXomxMy2ksiP6ObKBD5/B4AJTJB4jTV 0Zqlt3pOdkop+c4uOkKp4cRVpQi/PDtpLDgZhZwSZOG1oy8l8kZYSQ0CZ86tpQNiHBRH++4 BHlKn3WRHzI1lk61RdRfLstcgHRnZ31cbo6Q3dUaWW25SVv4sLb//haocssWiPrA/giV31p NptsedenyWvV3mkApy1qylSIOxaAtSwmDs31j0ZRy0rTGdnJhfc5iY0zpBO82rTBDPn/SrI iVPjiOV3s4KP62URS8R9l4DthhdGtAtE62qtONlTwyaXOrtI0gQfVVMa7maj3JDEH2csutE Zarj2L40IOm8EP8L/2HEHtbPNUqclhIrVk9r790/d8BQdRTxOlkdaOfPk0+RTalYtNTZwED CSKt3X6maYJNX/LeU02txkCu3dj17mOT6TgYgSG2FqhqjQLhLZbV8C6lE6UrsOrONtmJflQ O1hYoGT/V+QonV3w9W0jrQLEy8xax2KnvboDHQDVTr0caYhIXjv4+BsxufGjUmLC427CQbQ BGaaJOMExHCZEGdBeRorCfdJ3wA6D7/oNYiuKJ04GSBSrybXA9MZLdEb4P69Ab3w0n1lPtd tyvgxaMWL0kxqe7nMK1LUvFOWb3pn7IMZp/Dfd4XijKcdVU1lcKjPtv3nSDkUBqUMLxupuy e19MxKkTKXC1qBospBLCEc2bLQAU2oZEcWdvfVik+mkOE1cjq4VyC/PAlW4kB/PJo4YuqkH WCoMiD9jUHe1PsXL+qOnvMxezDN04V3rURior4x+sbZ3uQYJIIDiU/fQCclW1ipYEE0yGQM uuf6ZJRUbwxVmzf+fD/8Bz1o5ZyY/seV7E7kPnuIk7ZjiiNBFhF1meAVJei5q4ITPBpoXqy 8dk9lPUOr0mw0D9mj8NpKgVQ0CzqfbdYHandE/zjeTFEE0/wMzZ60Or6+ 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 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