patch 'net/nfp: fix firmware load from flash' has been queued to stable release 24.11.2

Kevin Traynor ktraynor at redhat.com
Thu Feb 13 10:58:10 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/17/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/878de746e37734e368f4d250699e5af438d7b905

Thanks.

Kevin

---
>From 878de746e37734e368f4d250699e5af438d7b905 Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he at corigine.com>
Date: Wed, 22 Jan 2025 09:47:50 +0800
Subject: [PATCH] net/nfp: fix firmware load from flash

[ upstream commit d7c07c8e29bea66622183e4279d881c20fafe375 ]

The firmware load policy 'NFP_NSP_APP_FW_LOAD_FLASH' means first try to
load from file system, if failed then try to load from flash.

The original logic will cause load firmware fail if any mistake occurs
in the load from file system process.

Fix this by relocated the related logic.

Fixes: 08ea495d624b ("net/nfp: support loading firmware from flash")

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

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index dce03ed550..b3d7bc301b 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -1533,11 +1533,5 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp,
 	int ret;
 
-	if (policy == NFP_NSP_APP_FW_LOAD_FLASH && nfp_nsp_has_stored_fw_load(nsp)) {
-		ret = nfp_fw_reload_from_flash(nsp);
-		if (ret != 0) {
-			PMD_DRV_LOG(ERR, "Load single PF firmware from flash failed.");
-			return ret;
-		}
-	} else if (fw_name[0] != 0) {
+	if (fw_name[0] != 0 && policy != NFP_NSP_APP_FW_LOAD_FLASH) {
 		ret = nfp_fw_reload_for_single_pf_from_disk(nsp, fw_name, pf_dev, reset);
 		if (ret != 0) {
@@ -1545,4 +1539,10 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp,
 			return ret;
 		}
+	} else if (policy != NFP_NSP_APP_FW_LOAD_DISK && nfp_nsp_has_stored_fw_load(nsp)) {
+		ret = nfp_fw_reload_from_flash(nsp);
+		if (ret != 0) {
+			PMD_DRV_LOG(ERR, "Load single PF firmware from flash failed.");
+			return ret;
+		}
 	} else {
 		PMD_DRV_LOG(ERR, "Not load firmware, please update flash or recofigure card.");
@@ -1609,11 +1609,5 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp,
 	}
 
-	if (policy == NFP_NSP_APP_FW_LOAD_FLASH && nfp_nsp_has_stored_fw_load(nsp)) {
-		err = nfp_fw_reload_from_flash(nsp);
-		if (err != 0) {
-			PMD_DRV_LOG(ERR, "Load multi PF firmware from flash failed.");
-			goto keepalive_stop;
-		}
-	} else if (fw_name[0] != 0) {
+	if (fw_name[0] != 0 && policy != NFP_NSP_APP_FW_LOAD_FLASH) {
 		err = nfp_fw_reload_for_multi_pf_from_disk(nsp, fw_name, dev_info,
 				pf_dev, reset);
@@ -1622,4 +1616,10 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp,
 			goto keepalive_stop;
 		}
+	} else if (policy != NFP_NSP_APP_FW_LOAD_DISK && nfp_nsp_has_stored_fw_load(nsp)) {
+		err = nfp_fw_reload_from_flash(nsp);
+		if (err != 0) {
+			PMD_DRV_LOG(ERR, "Load multi PF firmware from flash failed.");
+			goto keepalive_stop;
+		}
 	} else {
 		PMD_DRV_LOG(ERR, "Not load firmware, please update flash or recofigure card.");
@@ -1727,6 +1727,6 @@ nfp_fw_setup(struct nfp_pf_dev *pf_dev,
 		err = nfp_fw_get_name(pf_dev, fw_name, sizeof(fw_name));
 		if (err != 0) {
-			PMD_DRV_LOG(ERR, "Can not find suitable firmware.");
-			goto close_nsp;
+			fw_name[0] = 0;
+			PMD_DRV_LOG(DEBUG, "Can not find suitable firmware.");
 		}
 	}
-- 
2.48.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-12 17:29:39.181234426 +0000
+++ 0043-net-nfp-fix-firmware-load-from-flash.patch	2025-02-12 17:29:34.325945781 +0000
@@ -1 +1 @@
-From d7c07c8e29bea66622183e4279d881c20fafe375 Mon Sep 17 00:00:00 2001
+From 878de746e37734e368f4d250699e5af438d7b905 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d7c07c8e29bea66622183e4279d881c20fafe375 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index ca808afdd9..b9cb9fc652 100644
+index dce03ed550..b3d7bc301b 100644
@@ -28 +29 @@
-@@ -1535,11 +1535,5 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp,
+@@ -1533,11 +1533,5 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp,
@@ -41 +42 @@
-@@ -1547,4 +1541,10 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp,
+@@ -1545,4 +1539,10 @@ nfp_fw_reload_for_single_pf(struct nfp_nsp *nsp,
@@ -52 +53 @@
-@@ -1611,11 +1611,5 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp,
+@@ -1609,11 +1609,5 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp,
@@ -65 +66 @@
-@@ -1624,4 +1618,10 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp,
+@@ -1622,4 +1616,10 @@ nfp_fw_reload_for_multi_pf(struct nfp_nsp *nsp,
@@ -76 +77 @@
-@@ -1729,6 +1729,6 @@ nfp_fw_setup(struct nfp_pf_dev *pf_dev,
+@@ -1727,6 +1727,6 @@ nfp_fw_setup(struct nfp_pf_dev *pf_dev,



More information about the stable mailing list