From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D0026A0352; Tue, 5 Nov 2019 09:42:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4131634F0; Tue, 5 Nov 2019 09:42:24 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 1E4E1343C; Tue, 5 Nov 2019 09:42:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2019 00:42:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,270,1569308400"; d="scan'208";a="212495648" Received: from intel.sh.intel.com ([10.239.255.146]) by fmsmga001.fm.intel.com with ESMTP; 05 Nov 2019 00:42:18 -0800 From: Wang ShougangX To: dev@dpdk.org Cc: qiming.yang@intel.com, yahui.cao@intel.com, Wang ShougangX , stable@dpdk.org Date: Tue, 5 Nov 2019 02:09:15 +0000 Message-Id: <20191105020915.25548-1-shougangx.wang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/ice: fix FDIR counter resource release 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" 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 --- 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