From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2F0142A98 for ; Mon, 8 May 2023 11:27:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9B9D42BDA; Mon, 8 May 2023 11:27:51 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 8BE7640685; Mon, 8 May 2023 11:27:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683538069; x=1715074069; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=kY/nQSj2qLhxru8tIzNmw1oG7L37BeHwCnrkWupjsr4=; b=dbOI2RBb7Q/8/LjWTvFPBfRQLWuZ7v5TTcr0F1KVKfw0M7U447AK1og6 9D1jV7xSlVcyxlRG30xYvlMtmEFDVzEt4ty4Ah8UXh04ZFu7wRjoaIqFs 4JXGhs6QkQ7BKCR2PILeQiOqJWVYyZQZdp0Xht5k4mVvLYjBWE7GQrdWB USTocWQpq1suhzw5b3UvUdSd/OnUKyLWSBd1XRa46fbz2WPYR/NCTrHlu 58zFcLUnLAjS+8Ymonc15NJAQtpuaRrYKRlNFd0srx4KAQ/+d4ZHqa0fG k3KJ0lwkZVjn8lS/xM7byaijVe4XPPUK3LmNjT54Fu10IseeIYThFTRlZ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="415159375" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="415159375" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 02:27:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="810191840" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="810191840" Received: from unknown (HELO root..) ([10.239.252.115]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 02:27:45 -0700 From: Shiyang He To: dev@dpdk.org Cc: yidingx.zhou@intel.com, Shiyang He , stable@dpdk.org, Jingjing Wu , Beilei Xing , Ting Xu Subject: [PATCH] net/iavf: fix large vf queues cannot re-use. Date: Mon, 8 May 2023 16:58:23 +0000 Message-Id: <20230508165824.2086818-1-shiyangx.he@intel.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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