net/iavf: fix large vf queues cannot re-use.
PATCH 1/1 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) .
--- drivers/net/iavf/iavf_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/iavf/iavf_ethdev.c +12 -0
@@ -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 */
Signature · 1 line
2.37.2
Quoted 16 lines
-----Original Message-----
From: Shiyang He <[email protected]>
Sent: Tuesday, May 9, 2023 12:58 AM
To: [email protected]
Cc: Zhou, YidingX <[email protected]>; He, ShiyangX <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Xu, Ting <[email protected]>
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.
Quoted 8 lines
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 morequeues")
Cc: [email protected]Signed-off-by Shiyang He <[email protected]>
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.
Applied to dpdk-next-net-intel.
Thanks
Qi