DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Long Wu <long.wu@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH] net/nfp: reserve BAR for expansion ROM
Date: Tue,  3 Sep 2024 10:34:21 +0800	[thread overview]
Message-ID: <20240903023421.2637453-1-chaoyong.he@corigine.com> (raw)

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(+)

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;
 }
 
-- 
2.39.1


                 reply	other threads:[~2024-09-03  2:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240903023421.2637453-1-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).