From patchwork Sat Jul 11 08:28:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 235286 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1151263ilg; Sat, 11 Jul 2020 01:33:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn3htXxH5UXLBbGaArYC87KbBPm1ggNGMkzASdvyIaPPGGYcO416PWmwdvz/9zMaJ7USHw X-Received: by 2002:a05:6402:b9b:: with SMTP id cf27mr80648478edb.84.1594456387955; Sat, 11 Jul 2020 01:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594456387; cv=none; d=google.com; s=arc-20160816; b=FesArzdnJjZ1I89117T0hPg76HH+nM20U/WKHYn8+MHplfa56lWxG0pT5Jd740aR8+ ks/hOq4Hen4ubMyJyZ87n+kh6L7oVOLST7i+H+yU4uWU8Yz+q0un862VsSk5BRNsfIPx uoMACL/lltNFRheeOSlYyhSQeTb1FvPZTjGsbjw1v65xRR4PbDIqlA/fxZJNF/VGEdTy sRu754Yn+ZZBj6/BCtxFswZcAJpjeOvIRyLk8E0Kx77cwduqlzEAO3btlgNTflGMqwB/ AOS2sEfs5DexDfm3VkhgVAd97QvJ5yxeSTkd39Q977t1+yicg7vwDni3LBRzFGDQzMhO 4Vew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=bvDvm2SfpaZ90+JEVKgJlEhuY3ozARdHgGzPQFmYCKE=; b=gF6QaWtv6DhOwcsTtLbd5erGxiyp62+hhN3QcGpoTpBQMP2hgwZNstlxC+Woi9KuZ3 8GI7t4tWh9ezIzjp3QzaXr8q64FYNQJTPLlWchS9RJsc+TvV8brtZjueHR5312VGQy12 tfMzkmoyq3QW7hdQfxHFgCq5BFpoU+H4uo2BodWe6UMLmi+HhOr2o1nhM8v2mpM1kcXy uccA6jcjwDmYPUS7VjMIZqeKITCwiyh83bg0vzTxgUzgNfzwx10P2cRWSKpu97RU2umj zcgHM6ki67oAdWeKphTk+Q49Ppu9CvZfiEJMdzn/KItCh5SeKUl/RwZBOaMBzq9vScEA VaZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id s23si4948093eji.327.2020.07.11.01.33.07; Sat, 11 Jul 2020 01:33:07 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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(-) -- 2.17.1 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; +}; From patchwork Sat Jul 11 08:28:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 235287 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1151308ilg; Sat, 11 Jul 2020 01:33:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZLwy7LapxI03eXnPs17viHCqiBKYZr6RDP+MX5FOlDNZzVvoh5lXEfFBaUySPJB4bpDZ0 X-Received: by 2002:a17:906:aac9:: with SMTP id kt9mr60318085ejb.488.1594456392963; Sat, 11 Jul 2020 01:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594456392; cv=none; d=google.com; s=arc-20160816; b=MUpSzNslwMytsbArUPDSSQZBjf7MmTPbw+hmiGDDMQMbIRtoA/4N8cTbxEi0QS4Sr0 fb8rJJ9IEt2w3xpcBoTWsRlVYPsGiBAdKyNb6qd7+/b28F3ycc9ladJS11MJtzmUk6En fTM/a4BPWQvW3Xk3fS5w5bP6ZV/fBJLEdYsFyLhEMRdVAzkYq5ERw2hSpcmGN6pEnIlz Cb8Qt9bO/HZPTi3oP83RO//VJwiZ0+8bXBSfykWX0bMXxRBWsQm4B9bt/wTKpmRVBVz0 xTTJMxUjBMxWN960PaDtJvJIu7gqyT68miWE1hIPUryBmqL435rD3ecwr/PorsK00DHt 8QUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=xQ8JwKlm4fJsnOf6WtT6PNg0N5+5TjBMfl03fbkgFh4=; b=aXezxUIXXPIC6f+MsKKirWUJbZoJEsaE+3wl7b3BUdPC9wD1K/ODYyIOk/Wwrfn7iz t/9Ph9xVbHjJ9nEKI1E7rRRifF26YsTK8ZABftWYPVL1+KNPv97i2dEXXmOgcLs0YyoV wl63V3Fo9eS7CYx0f21qi00DK/J5LoYUZ9SGNQYW8CNf04oY9R8JjNPyMnZnPsXd6Kz4 eG5Lz7HrWEe5hcVgvIDcTv+BVP0wq43cY7wtSEU698EpTAwNe/gUqaaIDR9jSFykk2wc lzBrTw6f3hhBfjSNdvww4IBXAj1APmU2WGgERpd5JVSj+ozLaOr/TDxVUY0Oy0kTHkJR Tp8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id lc2si5424311ejb.424.2020.07.11.01.33.12; Sat, 11 Jul 2020 01:33:12 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFFA81DA1C; Sat, 11 Jul 2020 10:33:08 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 449BA1D626 for ; Sat, 11 Jul 2020 10:33:06 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2CFA02004C6; Sat, 11 Jul 2020 10:33:06 +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 D7F95200854; 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 B1D26402AE; 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:46 +0530 Message-Id: <20200711082846.10238-2-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200711082846.10238-1-hemant.agrawal@nxp.com> References: <20200514093001.12007-1-hemant.agrawal@nxp.com> <20200711082846.10238-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 2/2] test: add support for testing bitrate stats 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 to test rte_stats_bitrate_free Signed-off-by: Hemant Agrawal --- app/test/test_bitratestats.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/app/test/test_bitratestats.c b/app/test/test_bitratestats.c index 39d7f734d4..fd4e949642 100644 --- a/app/test/test_bitratestats.c +++ b/app/test/test_bitratestats.c @@ -32,12 +32,14 @@ test_stats_bitrate_create(void) return TEST_SUCCESS; } -/* To test free the resources from bitrate_reg test */ +/* To test free the resources from bitrate_create test */ static int test_stats_bitrate_free(void) { int ret = 0; + rte_stats_bitrate_free(bitrate_data); + ret = rte_metrics_deinit(); TEST_ASSERT(ret >= 0, "Test Failed: rte_metrics_deinit failed");