* [PATCH] net/nfp: check whether the generated VF can be used
@ 2022-12-09 1:35 Chaoyong He
2023-01-19 9:09 ` Ferruh Yigit
0 siblings, 1 reply; 2+ messages in thread
From: Chaoyong He @ 2022-12-09 1:35 UTC (permalink / raw)
To: dev; +Cc: oss-drivers, niklas.soderlund, Peng Zhang, Chaoyong He
From: Peng Zhang <peng.zhang@corigine.com>
All the queue pairs are shared between VF and PF for NFP,
and there exist different assignment policy for different
firmware application.
The user can create VFs up to the max number of queue pairs,
which will cause the last few VFs has no queue pairs and
cannot be used, because PF must occupy some queue pairs by
default.
This commit add check to prevent this kind of VFs be used.
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/nfp_ethdev_vf.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index d1427b63bc..3aa0e46150 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -333,6 +333,13 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
hw->max_rx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_RXRINGS);
hw->max_tx_queues = nn_cfg_readl(hw, NFP_NET_CFG_MAX_TXRINGS);
+ if (hw->max_rx_queues == 0 || hw->max_tx_queues == 0) {
+ PMD_DRV_LOG(ERR,
+ "Device %s can not be used, there are no valid queue "
+ "pairs for use, please try to generate less VFs",
+ pci_dev->name);
+ return -ENODEV;
+ }
/* Work out where in the BAR the queues start. */
switch (pci_dev->id.device_id) {
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/nfp: check whether the generated VF can be used
2022-12-09 1:35 [PATCH] net/nfp: check whether the generated VF can be used Chaoyong He
@ 2023-01-19 9:09 ` Ferruh Yigit
0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-01-19 9:09 UTC (permalink / raw)
To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund, Peng Zhang
On 12/9/2022 1:35 AM, Chaoyong He wrote:
> From: Peng Zhang <peng.zhang@corigine.com>
>
> All the queue pairs are shared between VF and PF for NFP,
> and there exist different assignment policy for different
> firmware application.
>
> The user can create VFs up to the max number of queue pairs,
> which will cause the last few VFs has no queue pairs and
> cannot be used, because PF must occupy some queue pairs by
> default.
>
> This commit add check to prevent this kind of VFs be used.
>
> Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-19 9:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 1:35 [PATCH] net/nfp: check whether the generated VF can be used Chaoyong He
2023-01-19 9:09 ` Ferruh Yigit
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).