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 D8C2A45BAC; Wed, 23 Oct 2024 08:29:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBB9B410D4; Wed, 23 Oct 2024 08:28:43 +0200 (CEST) Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by mails.dpdk.org (Postfix) with ESMTP id 57C0040E2C; Wed, 23 Oct 2024 08:28:31 +0200 (CEST) X-QQ-mid: bizesmtpsz8t1729664908tyxlgph X-QQ-Originating-IP: OU42lSHJJz2hVkt3c3kKFeB+uEFmDnJNFWWHbR2sLmU= Received: from wxdbg.localdomain.com ( [125.122.84.15]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Oct 2024 14:28:27 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 10229214710977705103 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 10/13] net/ngbe: fix driver load bit to inform firmware Date: Wed, 23 Oct 2024 14:48:33 +0800 Message-Id: <20241023064836.2017879-11-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: NrxvMG+AXCyERbn9vmR4pzf73BfHVJ0yscKPaPVml64wYxeKM6MwBPTj raksWnOY1SgSVPX6gmNPae9y8nyjR31qQqbPaw4RooRy2jQ1BAsKdKwPBWMO99OSyVyMpcl acrIqAzvL5bddqqUUrLQ5xwmLxpd3+a9qldosWnQP06vcmP+zys3fMl2FDIPY3/z5nNLRdz 4soCLHUf8W4ouiKuPtN97zf3YOg16Msz2Lv7V6gFmYHxcFmdd0CR5aDE3E6L3+1M4XuT64Z yC16eFTqYY2Z5QIeazL1lgPgkbPuYcuDHNIq8EopFaptEoMcttPJhL+Znd+Wg3GIZymcan0 BSWAPQkqZBcHFFGZau33IeST5FR5zuu1WboeNBLGnFkDpxEYhXdie0T68ShsXIRargmZ9mO h5KvNUTDaDyqXgtUysjyC8jGs0KROw/PprFYz3ypS0rxwOKdLqKg/lYKudXEHn7ZMqfUP5d aLK8JBNSwVU2L1i1NncGD8jRxIr3Q/x1Kz2mF7iiQkbviJMrxQdwjYUbeGWMwIR2QU7s3Vw 5ue27x5CS8nPyOCnQTJjT1tsb6dIPNkw+k7svT8qjmCgBFW5pxsozGu8YxdPmuOxhtpQcj3 t5Rcj31J2v0PNWSQcTjwToJaC0opXIi22ZpQcLCp47qu24YzxmJHe8rsGkKSwZJrs2NbNDw LP9eODwUkZUVqzJEsuJsz3Tj4uO8/4wI++jFuVSm/jNnrwntniHa921oYwVnLuPt8Bd7Cxu wWOn2EB0MSPSszkVwo/GlcPOWH4hmyuAVNwY3f7jjNtO8I3ZbWV9iXcC1xDYL+joHjtOBGb V2iI/zwzen5uLjiPoNze2fmaOml78Kc4yMfypMsnlR3V+NmrCEj25k3E1H8x7PiqHykGoLY Nq2A1dng6fe49kZwrwyNNZMKXjoKmpGBElAkj+CrgFqngEXTJBJ6S3LS6eaAYw8ysTgwrzS eJTL5kmGAw97ushfehS2DmPxqXI9D3kwY1h/roWQd4c6ECaaUZplKg57KFHsro5TDHebFQy j466ZcouN2MD12PNQG X-QQ-XMRINFO: Mp0Kj//9VHAxr69bL5MkOOs= 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: 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