patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/3] net/nfp: fix potential problem on certain version BSP
       [not found] <20240903055239.2642656-1-chaoyong.he@corigine.com>
@ 2024-09-03  5:52 ` Chaoyong He
  0 siblings, 0 replies; only message in thread
From: Chaoyong He @ 2024-09-03  5:52 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He, peng.zhang, stable, Long Wu

If BSP not support a command and the driver send it to BSP, some
unhappy thing will happen and the logic will go wrong.
Fix it by make sure the BSP does support the command before driver
send it to BSP.

Fixes: b301fd736003 ("net/nfp: add force reload firmware option")
Cc: peng.zhang@corigine.com
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index a09bbe52ca..db12914afe 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -1407,7 +1407,7 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp,
 	int ret;
 	bool fw_changed = true;
 
-	if (nfp_nsp_fw_loaded(nsp) && !force_reload_fw) {
+	if (nfp_nsp_has_fw_loaded(nsp) && nfp_nsp_fw_loaded(nsp) && !force_reload_fw) {
 		ret = nfp_fw_check_change(cpp, fw_name, &fw_changed);
 		if (ret != 0)
 			return ret;
@@ -1448,7 +1448,7 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp,
 		goto keepalive_uninit;
 	}
 
-	if (nfp_nsp_fw_loaded(nsp) && !reload_fw) {
+	if (nfp_nsp_has_fw_loaded(nsp) && nfp_nsp_fw_loaded(nsp) && !reload_fw) {
 		err = nfp_fw_check_change(cpp, fw_name, &fw_changed);
 		if (err != 0)
 			goto keepalive_stop;
-- 
2.39.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-09-03  5:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240903055239.2642656-1-chaoyong.he@corigine.com>
2024-09-03  5:52 ` [PATCH 1/3] net/nfp: fix potential problem on certain version BSP Chaoyong He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).