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 0304142AF1; Thu, 18 May 2023 17:36:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C76E42DA4; Thu, 18 May 2023 17:34:45 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 10A0842D9B for ; Thu, 18 May 2023 17:34:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684424083; x=1715960083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qOrryRfocNYxpzvtwNi4mSEKYKrSIK1AOwHqzWP/Kok=; b=BoEwXhlFUWetonzSEMJZ5yupIv6XHcU1EOmzpeawuLFqwDNBirrsi5uc pb8NnqXrDnYMNVxkWkvAuU8tuLCkKsS3JyStSzdOrPXCSltCqj/E4tnv6 beq07e3pqPxGbUkmjuGJkjLpD5/kkc8Ced/88fPi4JETUi4OnFh+0sPiy rNgZnt8S8API7yR/EA4vLZ2JSVG/VvjjUv0p4WDohnp467uIfy7/jnmHp gf7qWu1fQLU7MZalbghZDSYhCJoXzB5OlHfQICiUrPmEfqDcl22JRWTSf EkUYKth0kTKj9bejiidpXCUR4af7LuzOIW5S2/OgegccvPBWsq3djni50 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="341527753" X-IronPort-AV: E=Sophos;i="5.99,285,1677571200"; d="scan'208";a="341527753" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2023 08:34:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10714"; a="705235206" X-IronPort-AV: E=Sophos;i="5.99,285,1677571200"; d="scan'208";a="705235206" Received: from dpdk-qiming3.sh.intel.com ([10.67.111.4]) by fmsmga007.fm.intel.com with ESMTP; 18 May 2023 08:34:41 -0700 From: Qiming Yang To: dev@dpdk.org Cc: qi.z.zhang@intel.com, Qiming Yang , Benjamin Mikailenko Subject: [PATCH v2 15/20] net/ice/base: check VSIG before disassociating VSI Date: Thu, 18 May 2023 15:16:33 +0000 Message-Id: <20230518151638.1207021-16-qiming.yang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230518151638.1207021-1-qiming.yang@intel.com> References: <20230427062001.478032-1-qiming.yang@intel.com> <20230518151638.1207021-1-qiming.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add checking if the VSIG group exists when iterating through all flow profiles and disassociating them from the VSI. Signed-off-by: Benjamin Mikailenko Signed-off-by: Qiming Yang --- drivers/net/ice/base/ice_flow.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 5254ee27ed..7f1490de50 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -3856,6 +3856,7 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) const enum ice_block blk = ICE_BLK_RSS; struct ice_flow_prof *p, *t; enum ice_status status = ICE_SUCCESS; + u16 vsig; if (!ice_is_vsi_valid(hw, vsi_handle)) return ICE_ERR_PARAM; @@ -3865,7 +3866,16 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) ice_acquire_lock(&hw->rss_locks); LIST_FOR_EACH_ENTRY_SAFE(p, t, &hw->fl_profs[blk], ice_flow_prof, - l_entry) + l_entry) { + int ret; + + /* check if vsig is already removed */ + ret = ice_vsig_find_vsi(hw, blk, + ice_get_hw_vsi_num(hw, vsi_handle), + &vsig); + if (!ret && !vsig) + break; + if (ice_is_bit_set(p->vsis, vsi_handle)) { status = ice_flow_disassoc_prof(hw, blk, p, vsi_handle); if (status) @@ -3877,6 +3887,7 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) break; } } + } ice_release_lock(&hw->rss_locks); return status; -- 2.25.1