From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Peng Zhang <peng.zhang@corigine.com>,
Chaoyong He <chaoyong.he@corigine.com>,
Long Wu <long.wu@corigine.com>
Subject: [PATCH 06/11] net/nfp: adjust physical port check for multiple PFs
Date: Thu, 2 Nov 2023 10:23:16 +0800 [thread overview]
Message-ID: <20231102022321.2254224-7-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231102022321.2254224-1-chaoyong.he@corigine.com>
From: Peng Zhang <peng.zhang@corigine.com>
If the firmware supports multiple PFs each PF is represented by a single
physical port. While if the firmware only supports a single PF there
might be one or more physical ports represented by a single PF.
Adjust the check to handle both single and multiple PFs firmware.
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
---
drivers/net/nfp/nfp_ethdev.c | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 7022ef435f..3ebfd444b3 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -712,6 +712,15 @@ nfp_fw_setup(struct rte_pci_device *dev,
return err;
}
+static inline bool
+nfp_check_multi_pf_from_fw(uint32_t total_vnics)
+{
+ if (total_vnics == 1)
+ return true;
+
+ return false;
+}
+
static inline bool
nfp_check_multi_pf_from_nsp(struct rte_pci_device *pci_dev,
struct nfp_cpp *cpp)
@@ -765,14 +774,22 @@ nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev,
goto app_cleanup;
}
- /*
- * For coreNIC the number of vNICs exposed should be the same as the
- * number of physical ports.
- */
- if (total_vnics != nfp_eth_table->count) {
- PMD_INIT_LOG(ERR, "Total physical ports do not match number of vNICs");
- ret = -ENODEV;
- goto app_cleanup;
+ if (pf_dev->multi_pf.enabled) {
+ if (!nfp_check_multi_pf_from_fw(total_vnics)) {
+ PMD_INIT_LOG(ERR, "NSP report multipf, but FW report not multipf");
+ ret = -ENODEV;
+ goto app_cleanup;
+ }
+ } else {
+ /*
+ * For coreNIC the number of vNICs exposed should be the same as the
+ * number of physical ports.
+ */
+ if (total_vnics != nfp_eth_table->count) {
+ PMD_INIT_LOG(ERR, "Total physical ports do not match number of vNICs");
+ ret = -ENODEV;
+ goto app_cleanup;
+ }
}
/* Populate coreNIC app properties */
--
2.39.1
next prev parent reply other threads:[~2023-11-02 2:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 2:23 [PATCH 00/11] Add the support of multiple PF Chaoyong He
2023-11-02 2:23 ` [PATCH 01/11] net/nfp: refactor the probe logic of the secondary process Chaoyong He
2023-11-02 2:23 ` [PATCH 02/11] net/nfp: fix the failure to initialize the LSC mask Chaoyong He
2023-11-02 2:23 ` [PATCH 03/11] net/nfp: fix the DMA error caused by app exit abnormally Chaoyong He
2023-11-02 2:23 ` [PATCH 04/11] net/nfp: add flag to indicate multiple PFs support Chaoyong He
2023-11-02 2:23 ` [PATCH 05/11] net/nfp: add major version to nsp commands Chaoyong He
2023-11-02 2:23 ` Chaoyong He [this message]
2023-11-02 2:23 ` [PATCH 07/11] net/nfp: add the check about the firmware load Chaoyong He
2023-11-02 2:23 ` [PATCH 08/11] net/nfp: add PF ID used to format symbols Chaoyong He
2023-11-02 2:23 ` [PATCH 09/11] net/nfp: add nsp command to check if firmware is loaded Chaoyong He
2023-11-02 2:23 ` [PATCH 10/11] net/nfp: introduce keepalive mechanism for multiple PF Chaoyong He
2023-11-02 2:23 ` [PATCH 11/11] drivers: enable multiple PF in application firmware Chaoyong He
2023-11-02 14:52 ` [PATCH 00/11] Add the support of multiple PF Ferruh Yigit
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=20231102022321.2254224-7-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).