Message ID | 20200711082846.10238-1-hemant.agrawal@nxp.com |
---|---|
State | New |
Headers | show |
Series | [v3,1/2] bitratestats: add support for free | expand |
11/07/2020 10:28, Hemant Agrawal: > This patch adds support for free funnction. > > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Squashed patches 1 & 2 and applied, thanks
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; +};
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(-) -- 2.17.1