net/nfp: fix skip reload firmware issue

Message ID 20240308105004.2146837-1-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/nfp: fix skip reload firmware issue |

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/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance fail Performance Testing issues
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Chaoyong He March 8, 2024, 10:50 a.m. UTC
  From: Peng Zhang <peng.zhang@corigine.com>

When the beat value of all ports are 0, which represent all
ports are unused. But the current port starts beat before
the check process, so it needs to sleep 1 second waiting
the beat value change and to ignore the current port.

Fixes: 8b9a83ea2af2 ("net/nfp: enlarge range of skipping loading firmware")
Cc: stable@dpdk.org

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

Comments

Ferruh Yigit March 11, 2024, 6:17 p.m. UTC | #1
On 3/8/2024 10:50 AM, Chaoyong He wrote:
> From: Peng Zhang <peng.zhang@corigine.com>
> 
> When the beat value of all ports are 0, which represent all
> ports are unused. But the current port starts beat before
> the check process, so it needs to sleep 1 second waiting
> the beat value change and to ignore the current port.
> 
> Fixes: 8b9a83ea2af2 ("net/nfp: enlarge range of skipping loading firmware")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 1e713ee111..31c54a595c 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -1193,7 +1193,13 @@  nfp_fw_skip_load(const struct nfp_dev_info *dev_info,
 	uint32_t offset[dev_info->pf_num_per_unit];
 	uint8_t abnormal = dev_info->pf_num_per_unit;
 
+	sleep(1);
 	for (port_num = 0; port_num < dev_info->pf_num_per_unit; port_num++) {
+		if (port_num == multi_pf->function_id) {
+			abnormal--;
+			continue;
+		}
+
 		offset[port_num] = NFP_BEAT_OFFSET(port_num);
 		beat[port_num] = nn_readq(multi_pf->beat_addr + offset[port_num]);
 		if (beat[port_num] == 0)