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 2E7CE45C2A; Mon, 4 Nov 2024 03:07:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 728F340A89; Mon, 4 Nov 2024 03:07:11 +0100 (CET) Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by mails.dpdk.org (Postfix) with ESMTP id 6893F4068E; Mon, 4 Nov 2024 03:07:04 +0100 (CET) X-QQ-mid: bizesmtp91t1730686022t8d138sv X-QQ-Originating-IP: 0Iuf0vKWakKfNbf0XExkteR0R2IN19sem1eUn2R75c8= Received: from wxdbg.localdomain.com ( [60.186.23.108]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 04 Nov 2024 10:07:01 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 9012053615565657481 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH v3 04/13] net/txgbe: fix driver load bit to inform firmware Date: Mon, 4 Nov 2024 10:29:58 +0800 Message-Id: <20241104023007.782475-5-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: OUyKUPM3d6L7QNZhMKMpLz0ss7DIagmQEqPqUsPVHwqi5qgolud1ndIo lqpKwvpMNHspLfFhD37Pswa+QAKLaX8w4Dg1ga/HHHImyUtHf8GVH4MOywxdNVe6k3uE7ic mFKkrs+6ivinShc1jGXMG8iU4Fl3c+l9ebeDqwQFyrt/NV/fhqf4lXDshZDqK+qd6PmDpfY 2yDQfcRd4Lur4Ijplq9uuA0JO/B/CHcEhoq8jDKEKq+0Rzw1thVU9k/k7o29zdiJCAaWjMt HjXy7iaWF9/t90E/vQP1BZMvpr+0quB6wIs8qwhLnUteBArNUo6wdKAmcHpMwUNWWiFTpxq 2q6vM1Tk/bxf1ChuPcDExY0gJsqyTPKbM1AxRxsGH2FuHxGvMVPkjQaGBiK9nPqiUS8sqOs vRNyxdEIIIa62d99BlIWpYU0LgnZ8rQUQLJH2fiWRF+opMQnSBCHjvxbG21LuTPwGGn+ayZ FvqKub3EM0PzSK4+UQaliT7VqouP5HDGaRemlbASSA36dvMi03p+cHvc3fMg3+DGh3tH1IE pP3rtwbLTQ/MNtJhq2Ebb0s/QLn6APtFwqJ07luzPdeiDpbG97L773MjRB0YkR50fPKIDIz zJ2ZlY6Nx556Hdy5vlZGvPe7aGnoupddO9zy1AyEPx6qsr9lnASco5GOoIRLDHH8nRzspqk rxYw1qwlDmnPxn8jV+zLgw9g9FiUH7ctZMlW8lPih4RNOs8E41a+trr8ny5vYjjIMHyVMn5 7ryRcwnIBpKbeR0IQ/TuP2Yb2omByE1MkBZOdwojvgYFX9ITNCAzsBQnlzIQVEClpGECn70 VgbEeZhS+zUyd66OOxwJG80E2fRezgyuUZQwqXcPaht+HFWy51OHh8QEg2O764zSZxkv2rz 6rjbqG+1Gmj7XAanQCcgKjUyHOQffrxhjzQ4QD4FUi4bE/TMP90/n1RGgzpLb/bryT+tpjA F1PXDRF/qsLvvOMjKjjb5n6U6k2HhL4ERV6/fnUSLIJlwq0XXChBcePu7k94cqFnWD1fC2X VAiRhT3A== X-QQ-XMRINFO: MPJ6Tf5t3I/ycC2BItcBVIA= 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