net/nfp: using the correct PCI name to look for the firmware

Message ID 20221128023705.32671-1-chaoyong.he@corigine.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/nfp: using the correct PCI name to look for the firmware |

Checks

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

Commit Message

Chaoyong He Nov. 28, 2022, 2:37 a.m. UTC
  From: Peng Zhang <peng.zhang@corigine.com>

In the description of nfp document, DPDK PMD supports that the PF
looks for a firmware file by the PCI name.

After this commit, it will looks for the PCI name format such as
pci-0000:04:00.0.nffw rather than pci-04:00.0.nffw, which will
keep consistent with what is written in the nfp.rst.

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Dec. 7, 2022, 2:45 p.m. UTC | #1
On 11/28/2022 2:37 AM, Chaoyong He wrote:
> From: Peng Zhang <peng.zhang@corigine.com>
> 
> In the description of nfp document, DPDK PMD supports that the PF
> looks for a firmware file by the PCI name.
> 
> After this commit, it will looks for the PCI name format such as
> pci-0000:04:00.0.nffw rather than pci-04:00.0.nffw, which will
> keep consistent with what is written in the nfp.rst.
> 

Hi Chaoyong,

The commit log mentions change is to be consistent with document, but I
assume code is wrong, oterwise it would be easier to update the document.
So, can you please update commit log as a fix to [1]?


[1]
896c265ef954 ("net/nfp: use new CPP interface")

> Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
> ---
>  drivers/net/nfp/nfp_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
> index 0956ea81df..f22ae24b53 100644
> --- a/drivers/net/nfp/nfp_ethdev.c
> +++ b/drivers/net/nfp/nfp_ethdev.c
> @@ -724,7 +724,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
>  		goto load_fw;
>  	/* Then try the PCI name */
>  	snprintf(fw_name, sizeof(fw_name), "%s/pci-%s.nffw", DEFAULT_FW_PATH,
> -			dev->device.name);
> +			dev->name);
>  
>  	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
>  	if (rte_firmware_read(fw_name, &fw_buf, &fsize) == 0)
  

Patch

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 0956ea81df..f22ae24b53 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -724,7 +724,7 @@  nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 		goto load_fw;
 	/* Then try the PCI name */
 	snprintf(fw_name, sizeof(fw_name), "%s/pci-%s.nffw", DEFAULT_FW_PATH,
-			dev->device.name);
+			dev->name);
 
 	PMD_DRV_LOG(DEBUG, "Trying with fw file: %s", fw_name);
 	if (rte_firmware_read(fw_name, &fw_buf, &fsize) == 0)