From patchwork Mon Nov 9 06:51:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Yang X-Patchwork-Id: 83833 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2A157A0527; Mon, 9 Nov 2020 07:53:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D31625AA7; Mon, 9 Nov 2020 07:53:08 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C1C055953 for ; Mon, 9 Nov 2020 07:53:06 +0100 (CET) IronPort-SDR: aXrGQz4cMF8yDT7DKA+BU++bb02B8VwMTdvkmnEDWmNyiXJGCT9KOswgIaTUNYgl+sWk7Htuge 1dl5WH78CyjQ== X-IronPort-AV: E=McAfee;i="6000,8403,9799"; a="166247819" X-IronPort-AV: E=Sophos;i="5.77,462,1596524400"; d="scan'208";a="166247819" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2020 22:53:06 -0800 IronPort-SDR: gcOqkm5wJkIWCe6eSqxpXvveiNKz7EQnEmMiuyrFb8iLFh0lhGVfhNKh3YCfHhHALv59adgzwZ Q+30ZvhG4/Ew== X-IronPort-AV: E=Sophos;i="5.77,462,1596524400"; d="scan'208";a="540717619" Received: from intel-npg-odc-srv01.cd.intel.com ([10.240.178.136]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2020 22:53:03 -0800 From: Steve Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com, Steve Yang Date: Mon, 9 Nov 2020 06:51:36 +0000 Message-Id: <20201109065136.26807-3-stevex.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201109065136.26807-1-stevex.yang@intel.com> References: <20201105083216.38300-1-stevex.yang@intel.com> <20201109065136.26807-1-stevex.yang@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] net/iavf: fix the RSS error when VF port closed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Check the VF RSS offload flag and ignore relative operation when iavf hash uninit to avoid reset/close error. Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF") Signed-off-by: Steve Yang --- drivers/net/iavf/iavf_hash.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index 8a5a6bb5a4..d3e9218f75 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -1093,10 +1093,13 @@ iavf_hash_uninit(struct iavf_adapter *ad) if (vf->vf_reset) return; - if (iavf_hash_default_set(ad, false)) - PMD_DRV_LOG(ERR, "fail to delete default RSS"); + if (vf->vf_res && + vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF) { + if (iavf_hash_default_set(ad, false)) + PMD_DRV_LOG(ERR, "fail to delete default RSS"); - iavf_unregister_parser(&iavf_hash_parser, ad); + iavf_unregister_parser(&iavf_hash_parser, ad); + } } static void