[PATCH 23/23] net/nfp: add support of flower firmware with multiple PF
Chaoyong He
chaoyong.he at corigine.com
Wed Jun 19 11:58:30 CEST 2024
From: Peng Zhang <peng.zhang at corigine.com>
Adjust the logic to also support the flower firmware
with multiple PF.
Signed-off-by: Peng Zhang <peng.zhang at corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Long Wu <long.wu at corigine.com>
---
drivers/net/nfp/nfp_ethdev.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index d560bd695f..9867db9729 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -1504,6 +1504,9 @@ nfp_enable_multi_pf(struct nfp_pf_dev *pf_dev)
struct nfp_cpp_area *area;
char name[RTE_ETH_NAME_MAX_LEN];
+ if (!pf_dev->multi_pf.enabled)
+ return 0;
+
memset(&net_hw, 0, sizeof(struct nfp_net_hw));
/* Map the symbol table */
@@ -1872,12 +1875,6 @@ nfp_fw_app_primary_init(struct nfp_net_hw_priv *hw_priv)
switch (pf_dev->app_fw_id) {
case NFP_APP_FW_CORE_NIC:
- if (pf_dev->multi_pf.enabled) {
- ret = nfp_enable_multi_pf(pf_dev);
- if (ret != 0)
- return ret;
- }
-
PMD_INIT_LOG(INFO, "Initializing coreNIC");
ret = nfp_init_app_fw_nic(hw_priv);
if (ret != 0) {
@@ -2248,6 +2245,10 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
goto mac_stats_cleanup;
}
+ ret = nfp_enable_multi_pf(pf_dev);
+ if (ret != 0)
+ goto vf_cfg_tbl_cleanup;
+
hw_priv->pf_dev = pf_dev;
hw_priv->dev_info = dev_info;
--
2.39.1
More information about the dev
mailing list