patches for DPDK stable branches
 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

* RE: [PATCH] net/iavf: fix large vf queues cannot re-use.
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2023-05-15  2:25 UTC (permalink / raw)
  To: He, ShiyangX, dev
  Cc: Zhou, YidingX, He, ShiyangX, stable, Wu, Jingjing, Xing, Beilei,
	Xu, Ting



> -----Original Message-----
> From: Shiyang He <shiyangx.he@intel.com>
> Sent: Tuesday, May 9, 2023 12:58 AM
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; He, ShiyangX
> <shiyangx.he@intel.com>; stable@dpdk.org; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Xu, Ting
> <ting.xu@intel.com>
> Subject: [PATCH] net/iavf: fix large vf queues cannot re-use.
>
> 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>

I assume this is a workaround, as the queue resources may not be released if the PMD quits abnormally. A robust solution would rely on the kernel driver to reclaim the resources during a VF reset.
Nevertheless, this fix is not harmful and provides temporary relief for the issue until a proper solution can be implemented in the kernel driver.

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi



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