All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: dev@dpdk.org
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [dpdk-dev] [PATCHv2 1/2] bitratestats: add support for free
Date: Thu, 14 May 2020 15:00:00 +0530	[thread overview]
Message-ID: <20200514093001.12007-1-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <20200513113822.8681-1-hemant.agrawal@nxp.com>

This patch adds support for free funnction.

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

diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c
index d18152365e..1d4715d6c0 100644
--- a/lib/librte_bitratestats/rte_bitrate.c
+++ b/lib/librte_bitratestats/rte_bitrate.c
@@ -35,6 +35,14 @@ rte_stats_bitrate_create(void)
 		RTE_CACHE_LINE_SIZE);
 }
 
+int
+rte_stats_bitrate_free(struct rte_stats_bitrates *bitrate_data)
+{
+	if (bitrate_data)
+		rte_free(bitrate_data);
+	return 0;
+}
+
 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..0e5b625b79 100644
--- a/lib/librte_bitratestats/rte_bitrate.h
+++ b/lib/librte_bitratestats/rte_bitrate.h
@@ -27,12 +27,21 @@ 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
+int 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;
+};
-- 
2.17.1


  parent reply	other threads:[~2020-05-14  9:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 11:38 [dpdk-dev] [PATCH 1/2] bitratestats: add support for free Hemant Agrawal
2020-05-13 11:38 ` [dpdk-dev] [PATCH 2/2] test: add support for testing bitrate stats free Hemant Agrawal
2020-05-13 11:47 ` [dpdk-dev] [PATCH 1/2] bitratestats: add support for free Jerin Jacob
2020-05-14  9:30 ` Hemant Agrawal [this message]
2020-05-14  9:30   ` [dpdk-dev] [PATCHv2 2/2] test: add support for testing bitrate stats free Hemant Agrawal
2020-05-19 15:19   ` [dpdk-dev] [PATCHv2 1/2] bitratestats: add support for free Stephen Hemminger
2020-07-10 22:30     ` Thomas Monjalon
2020-07-11  3:11       ` Hemant Agrawal
2020-07-11  8:28   ` [dpdk-dev] [PATCH v3 " Hemant Agrawal
2020-07-11  8:28     ` [dpdk-dev] [PATCH v3 2/2] test: add support for testing bitrate stats free Hemant Agrawal
2020-10-19 14:09     ` [dpdk-dev] [PATCH v3 1/2] bitratestats: add support for free Thomas Monjalon

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=20200514093001.12007-1-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.