DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/iavf: fix large vf queues cannot re-use.
@ 2023-05-08 16:58 Shiyang He
  2023-05-15  2:25 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Shiyang He @ 2023-05-08 16:58 UTC (permalink / raw)
  To: dev; +Cc: yidingx.zhou, Shiyang He, stable, Jingjing Wu, Beilei Xing, Ting Xu

Multiple vfs created based on one PF. If one of the vf requests a large
number of queues, the queue resources are not released when exiting the
program, resulting in these queues cannot be available to other vfs.

This commit fixes the issue by resetting the number of queues to default
when closing the dev (refer to the kernel driver) .

Fixes: e436cd43835b ("net/iavf: negotiate large VF and request more queues")
Cc: stable@dpdk.org

Signed-off-by: Shiyang He <shiyangx.he@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index f6d68403ce..9c55eaa66e 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -2735,6 +2735,18 @@ iavf_dev_close(struct rte_eth_dev *dev)
 	if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
 		iavf_config_promisc(adapter, false, false);
 
+	/*
+	 * Release redundant queue resource when close the dev
+	 * so that other vfs can re-use the queues.
+	 */
+	if (vf->lv_enabled) {
+		ret = iavf_request_queues(dev, IAVF_MAX_NUM_QUEUES_DFLT);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Reset the num of queues failed");
+
+		vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
+	}
+
 	iavf_shutdown_adminq(hw);
 	if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
 		/* disable uio intr before callback unregister */
-- 
2.37.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-15  2:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08 16:58 [PATCH] net/iavf: fix large vf queues cannot re-use Shiyang He
2023-05-15  2:25 ` Zhang, Qi Z

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).