net/nfp: reserve BAR for expansion ROM

Message ID 20240903023421.2637453-1-chaoyong.he@corigine.com (mailing list archive)
State Accepted
Delegated to: Ferruh Yigit
Headers
Series net/nfp: reserve BAR for expansion ROM |

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/intel-Functional success Functional PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Chaoyong He Sept. 3, 2024, 2:34 a.m. UTC
For some platform, the warm restart of host doesn't trigger
the reset of NIC, which causes the initialize process of NIC
not executed with the right expansion ROM mapping. Consequently,
the PXE boot won't work in this case.

Now reserve BAR 2.0 which used by expansion ROM so that the
mapping is fixed.

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/nfpcore/nfp6000_pcie.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Ferruh Yigit Oct. 4, 2024, 5:25 a.m. UTC | #1
On 9/3/2024 3:34 AM, Chaoyong He wrote:
> For some platform, the warm restart of host doesn't trigger
> the reset of NIC, which causes the initialize process of NIC
> not executed with the right expansion ROM mapping. Consequently,
> the PXE boot won't work in this case.
> 
> Now reserve BAR 2.0 which used by expansion ROM so that the
> mapping is fixed.
> 
> 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>
>

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

Patch

diff --git a/drivers/net/nfp/nfpcore/nfp6000_pcie.c b/drivers/net/nfp/nfpcore/nfp6000_pcie.c
index ef1ffd6d01..2c989ee70c 100644
--- a/drivers/net/nfp/nfpcore/nfp6000_pcie.c
+++ b/drivers/net/nfp/nfpcore/nfp6000_pcie.c
@@ -370,6 +370,16 @@  nfp_enable_bars(struct nfp_pcie_user *nfp)
 	if (nfp_bar_write(nfp, bar, barcfg_msix_general) < 0)
 		return -EIO;
 
+
+	/* Reserve BAR2.0 for expansion rom mapping */
+	if (type == RTE_PROC_PRIMARY) {
+		if (nfp->pci_dev->id.device_id == PCI_DEVICE_ID_NFP3800_PF_NIC) {
+			bar = &nfp->bar[16];
+			if (bar != NULL)
+				bar->lock = true;
+		}
+	}
+
 	return 0;
 }