From: Qi Zhang <qi.z.zhang@intel.com>
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 <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH v2 7/7] net/ice/base: free flow profile entries
Date: Wed, 16 Jan 2019 22:13:38 +0800 [thread overview]
Message-ID: <20190116141338.12310-8-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20190116141338.12310-1-qi.z.zhang@intel.com>
Free flow profile entries when free hw tables.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
---
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
next prev parent reply other threads:[~2019-01-16 14:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 12:56 [dpdk-dev] [PATCH 0/7] net/ice: update share code Qi Zhang
2019-01-15 12:56 ` [dpdk-dev] [PATCH 1/7] net/ice/base: code clean Qi Zhang
2019-01-15 12:56 ` [dpdk-dev] [PATCH 2/7] net/ice/base: add API to support resource allocate Qi Zhang
2019-01-15 12:56 ` [dpdk-dev] [PATCH 3/7] net/ice/base: add package download related data structure Qi Zhang
2019-01-15 12:56 ` [dpdk-dev] [PATCH 4/7] net/ice/base: add some help macros Qi Zhang
2019-01-15 12:56 ` [dpdk-dev] [PATCH 5/7] net/ice/base: add flexible pipeline module Qi Zhang
2019-01-15 12:56 ` [dpdk-dev] [PATCH 6/7] net/ice/base: add flow module Qi Zhang
2019-01-16 12:14 ` Ferruh Yigit
2019-01-15 12:56 ` [dpdk-dev] [PATCH 7/7] net/ice/base: free flow profile entries Qi Zhang
2019-01-16 12:15 ` Ferruh Yigit
2019-01-16 5:05 ` [dpdk-dev] [PATCH 0/7] net/ice: update share code Lu, Wenzhuo
2019-01-16 12:16 ` Ferruh Yigit
2019-01-16 14:13 ` [dpdk-dev] [PATCH v2 " Qi Zhang
2019-01-16 14:13 ` [dpdk-dev] [PATCH v2 1/7] net/ice/base: code clean Qi Zhang
2019-01-16 14:13 ` [dpdk-dev] [PATCH v2 2/7] net/ice/base: add API to support resource allocate Qi Zhang
2019-01-16 14:13 ` [dpdk-dev] [PATCH v2 3/7] net/ice/base: add package download related data structure Qi Zhang
2019-01-16 14:13 ` [dpdk-dev] [PATCH v2 4/7] net/ice/base: add some help macros Qi Zhang
2019-01-16 14:13 ` [dpdk-dev] [PATCH v2 5/7] net/ice/base: add flexible pipeline module Qi Zhang
2019-01-16 14:13 ` [dpdk-dev] [PATCH v2 6/7] net/ice/base: add flow module Qi Zhang
2019-01-16 14:13 ` Qi Zhang [this message]
2019-01-17 13:31 ` [dpdk-dev] [PATCH v2 0/7] net/ice: update share code Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190116141338.12310-8-qi.z.zhang@intel.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=paul.m.stillwell.jr@intel.com \
--cc=qiming.yang@intel.com \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).