From: Wang ShougangX <shougangx.wang@intel.com>
To: dev@dpdk.org
Cc: qiming.yang@intel.com, yahui.cao@intel.com,
Wang ShougangX <shougangx.wang@intel.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ice: fix FDIR counter resource release
Date: Tue, 5 Nov 2019 02:09:15 +0000 [thread overview]
Message-ID: <20191105020915.25548-1-shougangx.wang@intel.com> (raw)
To avoid memory leak, all the counter resources should be
released when teardown.
Fixes: 0f880c3df192 ("net/ice: add flow director counter resource init/release")
Cc: stable@dpdk.org
Signed-off-by: Wang ShougangX <shougangx.wang@intel.com>
---
drivers/net/ice/ice_fdir_filter.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 736ccd54e..4a4349824 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -256,8 +256,13 @@ ice_fdir_counter_release(struct ice_pf *pf)
&fdir_info->counter;
uint8_t i;
- for (i = 0; i < container->index_free; i++)
+ for (i = 0; i < container->index_free; i++) {
rte_free(container->pools[i]);
+ container->pools[i] = NULL;
+ }
+
+ TAILQ_INIT(&container->pool_list);
+ container->index_free = 0;
return 0;
}
--
2.17.1
reply other threads:[~2019-11-05 8:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20191105020915.25548-1-shougangx.wang@intel.com \
--to=shougangx.wang@intel.com \
--cc=dev@dpdk.org \
--cc=qiming.yang@intel.com \
--cc=stable@dpdk.org \
--cc=yahui.cao@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).