From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 4529B1B014 for ; Mon, 8 Jan 2018 13:07:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 04:07:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,330,1511856000"; d="scan'208";a="193236199" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga006.fm.intel.com with ESMTP; 08 Jan 2018 04:07:57 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0319.002; Mon, 8 Jan 2018 12:07:56 +0000 From: "Van Haaren, Harry" To: "Varghese, Vipin" , "dev@dpdk.org" CC: "Hunt, David" , "Jain, Deepak K" , "Varghese, Vipin" Thread-Topic: [dpdk-dev] [PATCH v1] [app/procinfo] fix memory leak - PCAP & service Thread-Index: AQHTgh/9idNqT00ij0SbSk1ijg0Z2qNp7a1g Date: Mon, 8 Jan 2018 12:07:56 +0000 Message-ID: References: <1514735641-8738-1-git-send-email-vipin.varghese@intel.com> In-Reply-To: <1514735641-8738-1-git-send-email-vipin.varghese@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODNkYjI4MmYtOTY4Ni00NzNlLWE5ZjMtOTBkMmZhYTJiYmIzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjZmYXQxN3I0Nnp1WG91akpOZENRMVVFdkgxajhtaWowM0doOHM4aTZGQkU9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] [app/procinfo] fix memory leak - PCAP & service 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: , X-List-Received-Date: Mon, 08 Jan 2018 12:07:59 -0000 > 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 ; Jain, Deepak K > ; Varghese, Vipin > Subject: [dpdk-dev] [PATCH v1] [app/procinfo] fix memory leak - PCAP & > service >=20 > 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 lea= ds > to memory leak, on multiple runs. >=20 > The patch add check for libpcap PMD check and detaches the same. The patc= h > also frees the service library memory too. >=20 > Signed-off-by: Vipin Varghese 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 For Ack of PCAP part, please CC PCAP maintainer. Regards, -Harry > --- > app/proc_info/main.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) >=20 > 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 > #include > #include > +#include >=20 > /* 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); >=20 > + for (i =3D 0; i < nb_ports; i++) { > + struct rte_eth_dev_info dev_info =3D {0}; > + char name[RTE_DEV_NAME_MAX_LEN] =3D {0}; > + > + rte_eth_dev_info_get(i, &dev_info); > + if (strncmp(dev_info.driver_name, "net_pcap", 8) =3D=3D 0) { > + printf("port: %d driver_name: %s\n", > + i, dev_info.driver_name); > + rte_eth_dev_stop(i); > + rte_eth_dev_close(i); > + > + ret =3D rte_eth_dev_detach(i, name); > + if (ret) > + rte_panic("Failed to detach %s\n", name); > + } > + } > + > + rte_service_deinit(); > + > return 0; > } > -- > 1.9.1