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 B6135A0528; Sat, 11 Jul 2020 10:33:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1441D1D6EC; Sat, 11 Jul 2020 10:33:07 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id AA9BA1D626 for ; Sat, 11 Jul 2020 10:33:05 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 83875200464; Sat, 11 Jul 2020 10:33:05 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3A30520044D; Sat, 11 Jul 2020 10:33:04 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 1DF0040287; Sat, 11 Jul 2020 16:33:02 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: Hemant Agrawal Date: Sat, 11 Jul 2020 13:58:45 +0530 Message-Id: <20200711082846.10238-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514093001.12007-1-hemant.agrawal@nxp.com> References: <20200514093001.12007-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 1/2] bitratestats: add support for free 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" This patch adds support for free funnction. Signed-off-by: Hemant Agrawal --- 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(-) 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; +}; -- 2.17.1