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 1F131A034F; Wed, 13 May 2020 13:47:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 209511D544; Wed, 13 May 2020 13:47:29 +0200 (CEST) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) by dpdk.org (Postfix) with ESMTP id 0D29D1D532 for ; Wed, 13 May 2020 13:47:28 +0200 (CEST) Received: by mail-il1-f193.google.com with SMTP id w6so15634486ilg.1 for ; Wed, 13 May 2020 04:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nrfG5PTKx9sQW2F4ZktZInDnrxxTwiBg5ERJqw45Bm4=; b=c7UTGrYUd+J9TP1r2DrRKv6ziNSHbD71tv35mVSFtGVQqeaUTAGVA+JvQKr4N7xGyA l/KSEjqMXIClrVnRVR6yy4ZhsGp6Cq6KIteeaXEdkvpAOdTP56+S57OHSEZ0bukhLHmA mv4E5oTPy/WlTDArjjnw8NzTqlXE1tmt3rxABVXBOeF1iAoElK24VlAdanPZsudAol+P 2KEkcN/XGj7tQzfqw0TU6WjnElBXI/IdzWjmJ8JEQTeTF/0enQgk2O9cyALNL+co5oyx LiKc52PA7cA02iuWvZCJTXyTk6AymQiS5JYbzROI7QA01U9iY7Z8rprc82qTbW3fviQH ABVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nrfG5PTKx9sQW2F4ZktZInDnrxxTwiBg5ERJqw45Bm4=; b=ZBEsG/HLp2JWZ/P3lcSgFxhf2Sz5MYtxlH+GT53oHgSoTNhdl3UUW2bPBrxFj+2HeQ x6FBX/Yuw5gMTGBeocYgXJ5dt5vjn1uCQra3tCI5oUFqDZhb3f11/J/ZbJq/UoaLXZiL K2SQcpcuohuZv8qe8K514q6IF+5HlbAjhNwo+wup0uOS70uv1ttLuPCWoMr2bKWSxMQ1 D0X6+rF0Eby1u56HUJJvWQ41DGS54pwzvKfAiINoibHR/8Kw2jquzLFgpS0GbpVkeznO mesuRtanNWj4JRTwQoyfGrLdC4cBYJd9IossaMQ+6zinYAl4ns0ZiRk0OHYkTsCypy7e Gdtw== X-Gm-Message-State: AGi0PubV6iIKmCea85tRnL1WtuYvfmjvUxcsrH6oh89E2bdrCcBgEcRA rcMMAlmuC4Z0HilFtG/Ypfk4BJPoyv9rGrBq3xk= X-Google-Smtp-Source: APiQypJ7nFpuuk2wIZxDB215KPVU0iiTBwa5+urpRisZk7jim4EgJ90iSWWibVUZ02F2lXKthV+VW/zyMIwLJHlLAGk= X-Received: by 2002:a05:6e02:689:: with SMTP id o9mr12196201ils.294.1589370447136; Wed, 13 May 2020 04:47:27 -0700 (PDT) MIME-Version: 1.0 References: <20200513113822.8681-1-hemant.agrawal@nxp.com> In-Reply-To: <20200513113822.8681-1-hemant.agrawal@nxp.com> From: Jerin Jacob Date: Wed, 13 May 2020 17:17:11 +0530 Message-ID: To: Hemant Agrawal Cc: dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 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" On Wed, May 13, 2020 at 5:10 PM Hemant Agrawal wrote: > > This patch adds support for free funnction. > > Signed-off-by: Hemant Agrawal > --- > lib/librte_bitratestats/rte_bitrate.c | 8 ++++++++ > lib/librte_bitratestats/rte_bitrate.h | 9 +++++++++ > lib/librte_bitratestats/rte_bitratestats_version.map | 6 ++++++ > 3 files changed, 23 insertions(+) > > diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c > index d18152365..1d4715d6c 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 ef10f22ff..b2d532b95 100644 > --- a/lib/librte_bitratestats/rte_bitrate.h > +++ b/lib/librte_bitratestats/rte_bitrate.h > @@ -27,6 +27,15 @@ 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_create() s/rte_stats_create()/rte_stats_bitrate_create() > + */ > +__rte_experimental > +int rte_stats_bitrate_free(struct rte_stats_bitrates *bitrate_data); > > /** > * Register bitrate statistics with the metric library. > diff --git a/lib/librte_bitratestats/rte_bitratestats_version.map b/lib/librte_bitratestats/rte_bitratestats_version.map > index 88fc2912d..85522a05d 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 >