From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "Varghese, Vipin" <vipin.varghese@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "Hunt, David" <david.hunt@intel.com>,
"Jain, Deepak K" <deepak.k.jain@intel.com>,
"Varghese, Vipin" <vipin.varghese@intel.com>
Subject: Re: [dpdk-dev] [PATCH v1] [app/procinfo] fix memory leak - PCAP & service
Date: Mon, 8 Jan 2018 12:07:56 +0000 [thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA650FEAE09@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <1514735641-8738-1-git-send-email-vipin.varghese@intel.com>
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Vipin Varghese
> Sent: Sunday, December 31, 2017 3:54 PM
> To: dev@dpdk.org
> Cc: Hunt, David <david.hunt@intel.com>; Jain, Deepak K
> <deepak.k.jain@intel.com>; Varghese, Vipin <vipin.varghese@intel.com>
> Subject: [dpdk-dev] [PATCH v1] [app/procinfo] fix memory leak - PCAP &
> service
>
> When procinfo uses the PCAP PMD it is not detached. The library service
> also makes of memory but never releases at exit of application. These leads
> to memory leak, on multiple runs.
>
> The patch add check for libpcap PMD check and detaches the same. The patch
> also frees the service library memory too.
>
> Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Hi,
There are two fixes in this patch, please split into two patches:
1) PCAP PMD detach
2) service library deinit()
For service library half of patch only, you can add:
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
For Ack of PCAP part, please CC PCAP maintainer.
Regards, -Harry
> ---
> app/proc_info/main.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/app/proc_info/main.c b/app/proc_info/main.c
> index 64fbbd0..44d9af9 100644
> --- a/app/proc_info/main.c
> +++ b/app/proc_info/main.c
> @@ -58,6 +58,7 @@
> #include <rte_branch_prediction.h>
> #include <rte_string_fns.h>
> #include <rte_metrics.h>
> +#include <rte_service.h>
>
> /* Maximum long option length for option parsing. */
> #define MAX_LONG_OPT_SZ 64
> @@ -689,5 +690,24 @@ static void collectd_resolve_cnt_type(char *cnt_type,
> size_t cnt_type_len,
> if (enable_metrics)
> metrics_display(RTE_METRICS_GLOBAL);
>
> + for (i = 0; i < nb_ports; i++) {
> + struct rte_eth_dev_info dev_info = {0};
> + char name[RTE_DEV_NAME_MAX_LEN] = {0};
> +
> + rte_eth_dev_info_get(i, &dev_info);
> + if (strncmp(dev_info.driver_name, "net_pcap", 8) == 0) {
> + printf("port: %d driver_name: %s\n",
> + i, dev_info.driver_name);
> + rte_eth_dev_stop(i);
> + rte_eth_dev_close(i);
> +
> + ret = rte_eth_dev_detach(i, name);
> + if (ret)
> + rte_panic("Failed to detach %s\n", name);
> + }
> + }
> +
> + rte_service_deinit();
> +
> return 0;
> }
> --
> 1.9.1
next prev parent reply other threads:[~2018-01-08 12:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-31 15:54 Vipin Varghese
2018-01-08 12:07 ` Van Haaren, Harry [this message]
2018-01-11 19:47 ` [dpdk-dev] [PATCH v2] app/procinfo: Fix memory leak by rte_service_init Vipin Varghese
2018-01-26 15:44 ` Van Haaren, Harry
2018-01-26 16:59 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-01-26 17:15 ` Van Haaren, Harry
2018-01-26 17:26 ` 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=E923DB57A917B54B9182A2E928D00FA650FEAE09@IRSMSX102.ger.corp.intel.com \
--to=harry.van.haaren@intel.com \
--cc=david.hunt@intel.com \
--cc=deepak.k.jain@intel.com \
--cc=dev@dpdk.org \
--cc=vipin.varghese@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).