[v3,1/2] bitratestats: add support for free
diff mbox series

Message ID 20200711082846.10238-1-hemant.agrawal@nxp.com
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • [v3,1/2] bitratestats: add support for free
Related show

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/Performance-Testing fail build patch failure
ci/checkpatch success coding style OK

Commit Message

Hemant Agrawal July 11, 2020, 8:28 a.m. UTC
This patch adds support for free funnction.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_bitratestats/rte_bitrate.c                |  6 ++++++
 lib/librte_bitratestats/rte_bitrate.h                | 10 +++++++++-
 lib/librte_bitratestats/rte_bitratestats_version.map |  6 ++++++
 3 files changed, 21 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c
index d18152365e..8fd9f47288 100644
--- a/lib/librte_bitratestats/rte_bitrate.c
+++ b/lib/librte_bitratestats/rte_bitrate.c
@@ -35,6 +35,12 @@  rte_stats_bitrate_create(void)
 		RTE_CACHE_LINE_SIZE);
 }
 
+void
+rte_stats_bitrate_free(struct rte_stats_bitrates *bitrate_data)
+{
+	rte_free(bitrate_data);
+}
+
 int
 rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data)
 {
diff --git a/lib/librte_bitratestats/rte_bitrate.h b/lib/librte_bitratestats/rte_bitrate.h
index ef10f22ff3..4865929e8f 100644
--- a/lib/librte_bitratestats/rte_bitrate.h
+++ b/lib/librte_bitratestats/rte_bitrate.h
@@ -27,12 +27,20 @@  struct rte_stats_bitrates;
  */
 struct rte_stats_bitrates *rte_stats_bitrate_create(void);
 
+/**
+ * Free bitrate statistics structure
+ *
+ * @param bitrate_data
+ *   Pointer allocated by rte_stats_bitrate_create()
+ */
+__rte_experimental
+void rte_stats_bitrate_free(struct rte_stats_bitrates *bitrate_data);
 
 /**
  * Register bitrate statistics with the metric library.
  *
  * @param bitrate_data
- *   Pointer allocated by rte_stats_create()
+ *   Pointer allocated by rte_stats_bitrate_create()
  *
  * @return
  *   Zero on success
diff --git a/lib/librte_bitratestats/rte_bitratestats_version.map b/lib/librte_bitratestats/rte_bitratestats_version.map
index 88fc2912db..85522a05d5 100644
--- a/lib/librte_bitratestats/rte_bitratestats_version.map
+++ b/lib/librte_bitratestats/rte_bitratestats_version.map
@@ -7,3 +7,9 @@  DPDK_20.0 {
 
 	local: *;
 };
+
+EXPERIMENTAL {
+	global:
+
+	rte_stats_bitrate_free;
+};