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 5/9] net/nfp: revise the number of PF representor port
Date: Mon, 21 Oct 2024 14:32:57 +0800 [thread overview]
Message-ID: <20241021063301.4146214-6-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20241021063301.4146214-1-chaoyong.he@corigine.com>
From: Peng Zhang <peng.zhang@corigine.com>
When using the multiple PF firmware, there is no need to
create the PF representor port anymore.
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/flower/nfp_flower_representor.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index d49f02fc75..f769123174 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -1009,6 +1009,7 @@ nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower,
struct nfp_net_hw_priv *hw_priv)
{
int ret;
+ uint8_t num_pf_reprs;
struct nfp_pf_dev *pf_dev;
struct rte_pci_device *pci_dev;
struct rte_eth_devargs eth_da = {
@@ -1037,8 +1038,13 @@ nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower,
return 0;
}
- /* There always exist phy repr */
- if (eth_da.nb_representor_ports < pf_dev->total_phyports + 1) {
+ /* Calculate the number of pf repr */
+ if (pf_dev->multi_pf.enabled)
+ num_pf_reprs = 0;
+ else
+ num_pf_reprs = 1;
+
+ if (eth_da.nb_representor_ports < pf_dev->total_phyports + num_pf_reprs) {
PMD_INIT_LOG(ERR, "Should also create repr port for phy port and PF vNIC.");
return -ERANGE;
}
@@ -1052,7 +1058,7 @@ nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower,
/* Fill in flower app with repr counts */
app_fw_flower->num_phyport_reprs = pf_dev->total_phyports;
app_fw_flower->num_vf_reprs = eth_da.nb_representor_ports -
- pf_dev->total_phyports - 1;
+ pf_dev->total_phyports - num_pf_reprs;
if (pf_dev->max_vfs != 0 && pf_dev->sriov_vf < app_fw_flower->num_vf_reprs) {
PMD_INIT_LOG(ERR, "The VF repr nums %d is bigger than VF nums %d.",
app_fw_flower->num_vf_reprs, pf_dev->sriov_vf);
--
2.39.1
next prev parent reply other threads:[~2024-10-21 6:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-21 6:32 [PATCH 0/9] support multiple PF flower firmware Chaoyong He
2024-10-21 6:32 ` [PATCH 1/9] net/nfp: extract the function to allocate the PHY Chaoyong He
2024-10-21 6:32 ` [PATCH 2/9] net/nfp: extract the function to initialize the PF Chaoyong He
2024-10-21 6:32 ` [PATCH 3/9] net/nfp: extract the function to allocate PF Chaoyong He
2024-10-21 6:32 ` [PATCH 4/9] net/nfp: extract the function to allocate the VF Chaoyong He
2024-10-21 6:32 ` Chaoyong He [this message]
2024-10-21 6:32 ` [PATCH 6/9] net/nfp: initialize the representor port of the multiple PF Chaoyong He
2024-10-21 6:32 ` [PATCH 7/9] net/nfp: ignore useless message for " Chaoyong He
2024-10-21 6:33 ` [PATCH 8/9] net/nfp: add the new operations " Chaoyong He
2024-10-21 6:33 ` [PATCH 9/9] net/nfp: update the Tx and Rx function " Chaoyong He
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=20241021063301.4146214-6-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).