From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id CF7F7C88E for ; Fri, 26 Jun 2015 11:55:39 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 26 Jun 2015 02:55:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,683,1427785200"; d="scan'208";a="595177934" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga003.jf.intel.com with ESMTP; 26 Jun 2015 02:55:38 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.245]) by IRSMSX102.ger.corp.intel.com ([169.254.2.117]) with mapi id 14.03.0224.002; Fri, 26 Jun 2015 10:55:37 +0100 From: "Ananyev, Konstantin" To: "Iremonger, Bernard" , "dev@dpdk.org" Thread-Topic: [PATCH v2] librte_ether: release memory in uninit function. Thread-Index: AQHQr/MWZgUa4qAVvkqT3DLkDMoKFJ2+jGsA Date: Fri, 26 Jun 2015 09:55:36 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836A1E506@irsmsx105.ger.corp.intel.com> References: <1435311160-8679-1-git-send-email-bernard.iremonger@intel.com> In-Reply-To: <1435311160-8679-1-git-send-email-bernard.iremonger@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 v2] librte_ether: release memory in uninit function. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jun 2015 09:55:40 -0000 > -----Original Message----- > From: Iremonger, Bernard > Sent: Friday, June 26, 2015 10:33 AM > To: dev@dpdk.org > Cc: Zhang, Helin; Ananyev, Konstantin; Qiu, Michael; mukawa@igel.co.jp; I= remonger, Bernard > Subject: [PATCH v2] librte_ether: release memory in uninit function. >=20 > Changes in v2: > do not free mac_addrs and hash_mac_addrs here. >=20 > Signed-off-by: Bernard Iremonger > --- > lib/librte_ether/rte_ethdev.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) >=20 > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index e13fde5..7ae101a 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -369,8 +369,12 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev) > /* free ether device */ > rte_eth_dev_release_port(eth_dev); >=20 > - if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) > + if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) { > + rte_free(eth_dev->data->rx_queues); > + rte_free(eth_dev->data->tx_queues); > rte_free(eth_dev->data->dev_private); > + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); > + } >=20 > eth_dev->pci_dev =3D NULL; > eth_dev->driver =3D NULL; > -- Acked-by: Konstantin Ananyev > 1.7.4.1