From: Shiyang He <shiyangx.he@intel.com>
To: dev@dpdk.org
Cc: yidingx.zhou@intel.com, Shiyang He <shiyangx.he@intel.com>,
stable@dpdk.org, Jingjing Wu <jingjing.wu@intel.com>,
Beilei Xing <beilei.xing@intel.com>, Ting Xu <ting.xu@intel.com>
Subject: [PATCH] net/iavf: fix large vf queues cannot re-use.
Date: Mon, 8 May 2023 16:58:23 +0000 [thread overview]
Message-ID: <20230508165824.2086818-1-shiyangx.he@intel.com> (raw)
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
next reply other threads:[~2023-05-08 9:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 16:58 Shiyang He [this message]
2023-05-15 2:25 ` Zhang, Qi Z
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=20230508165824.2086818-1-shiyangx.he@intel.com \
--to=shiyangx.he@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=stable@dpdk.org \
--cc=ting.xu@intel.com \
--cc=yidingx.zhou@intel.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).