[2/2] net/nfp: support new firmware name scheme

Message ID 20240528012933.2345436-3-chaoyong.he@corigine.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series support new firmware name scheme |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Chaoyong He May 28, 2024, 1:29 a.m. UTC
  Now all application firmware is indifferent of port speed, so do not
bother to compose the firmware name with media info. This will reduce
a number of symlinks for firmware files.

The logic of firmware name with media info still kept for compatibility.

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 | 7 +++++++
 1 file changed, 7 insertions(+)
  

Patch

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 771137db92..74d4a726df 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -1130,6 +1130,13 @@  nfp_fw_get_name(struct rte_pci_device *dev,
 		}
 	}
 
+	/* And then try the model name */
+	snprintf(card_desc, sizeof(card_desc), "%s.nffw", nfp_fw_model);
+	snprintf(fw_name, fw_size, "%s/%s", DEFAULT_FW_PATH, card_desc);
+	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
+	if (access(fw_name, F_OK) == 0)
+		return 0;
+
 	/* Finally try the card type and media */
 	snprintf(card_desc, sizeof(card_desc), "nic_%s_%dx%d.nffw",
 			nfp_fw_model, nfp_eth_table->count,