From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id BE9F92BE2 for ; Wed, 16 Jan 2019 15:12:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 06:12:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,486,1539673200"; d="scan'208";a="118951338" Received: from dpdk51.sh.intel.com ([10.67.110.190]) by orsmga003.jf.intel.com with ESMTP; 16 Jan 2019 06:12:22 -0800 From: Qi Zhang To: wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: paul.m.stillwell.jr@intel.com, dev@dpdk.org, ferruh.yigit@intel.com, Qi Zhang Date: Wed, 16 Jan 2019 22:13:38 +0800 Message-Id: <20190116141338.12310-8-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190116141338.12310-1-qi.z.zhang@intel.com> References: <20190115125658.15421-1-qi.z.zhang@intel.com> <20190116141338.12310-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 7/7] net/ice/base: free flow profile entries 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: , X-List-Received-Date: Wed, 16 Jan 2019 14:12:24 -0000 Free flow profile entries when free hw tables. Signed-off-by: Qi Zhang Signed-off-by: Paul M Stillwell Jr --- drivers/net/ice/base/ice_flex_pipe.c | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index 1887fc38c..493bc4e9b 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -3034,6 +3034,42 @@ static void ice_fill_blk_tbls(struct ice_hw *hw, enum ice_block block_id) } /** + * ice_free_flow_profs - free flow profile entries + * @hw: pointer to the hardware structure + */ +static void ice_free_flow_profs(struct ice_hw *hw) +{ + u8 i; + + for (i = 0; i < ICE_BLK_COUNT; i++) { + struct ice_flow_prof *p, *tmp; + + if (!&hw->fl_profs[i]) + continue; + + /* This call is being made as part of resource deallocation + * during unload. Lock acquire and release will not be + * necessary here. + */ + LIST_FOR_EACH_ENTRY_SAFE(p, tmp, &hw->fl_profs[i], + ice_flow_prof, l_entry) { + struct ice_flow_entry *e, *t; + + LIST_FOR_EACH_ENTRY_SAFE(e, t, &p->entries, + ice_flow_entry, l_entry) + ice_flow_rem_entry(hw, ICE_FLOW_ENTRY_HNDL(e)); + + LIST_DEL(&p->l_entry); + if (p->acts) + ice_free(hw, p->acts); + ice_free(hw, p); + } + + ice_destroy_lock(&hw->fl_profs_locks[i]); + } +} + +/** * ice_free_prof_map - frees the profile map * @hw: pointer to the hardware structure * @blk: the hw block which contains the profile map to be freed @@ -3096,6 +3132,8 @@ void ice_free_hw_tbls(struct ice_hw *hw) } ice_memset(hw->blk, 0, sizeof(hw->blk), ICE_NONDMA_MEM); + + ice_free_flow_profs(hw); } /** -- 2.13.6