lib/latencystats: free up the memzone

Message ID 1532623808-18558-1-git-send-email-reshma.pattan@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series lib/latencystats: free up the memzone |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Pattan, Reshma July 26, 2018, 4:50 p.m. UTC
  Free up the memzone allocated during the
rte_latencystats_init().

Fixes: 5cd3cac9ed ("latency: added new library for latency stats")
CC: stable@dpdk.org
CC: remy.horton@intel.com

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
 lib/librte_latencystats/rte_latencystats.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
  

Comments

Remy Horton Aug. 1, 2018, 10:36 a.m. UTC | #1
On 26/07/2018 17:50, Reshma Pattan wrote:
> Free up the memzone allocated during the
> rte_latencystats_init().
>
> Fixes: 5cd3cac9ed ("latency: added new library for latency stats")
> CC: stable@dpdk.org
> CC: remy.horton@intel.com
>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>

Acked-by: Remy Horton <remy.horton@intel.com>
  
Thomas Monjalon Aug. 1, 2018, 4:04 p.m. UTC | #2
01/08/2018 12:36, Remy Horton:
> 
> On 26/07/2018 17:50, Reshma Pattan wrote:
> > Free up the memzone allocated during the
> > rte_latencystats_init().
> >
> > Fixes: 5cd3cac9ed ("latency: added new library for latency stats")
> > CC: stable@dpdk.org
> > CC: remy.horton@intel.com
> >
> > Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> 
> Acked-by: Remy Horton <remy.horton@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c
index 46c69bf05..1fdec68e3 100644
--- a/lib/librte_latencystats/rte_latencystats.c
+++ b/lib/librte_latencystats/rte_latencystats.c
@@ -1,5 +1,5 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2017 Intel Corporation
+ * Copyright(c) 2018 Intel Corporation
  */
 
 #include <unistd.h>
@@ -265,6 +265,7 @@  rte_latencystats_uninit(void)
 	uint16_t qid;
 	int ret = 0;
 	struct rxtx_cbs *cbs = NULL;
+	const struct rte_memzone *mz = NULL;
 
 	/** De register Rx/Tx callbacks */
 	RTE_ETH_FOREACH_DEV(pid) {
@@ -288,6 +289,11 @@  rte_latencystats_uninit(void)
 		}
 	}
 
+	/* free up the memzone */
+	mz = rte_memzone_lookup(MZ_RTE_LATENCY_STATS);
+	if (mz)
+		rte_memzone_free(mz);
+
 	return 0;
 }