From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) by dpdk.org (Postfix) with ESMTP id 0B0EAC682 for ; Thu, 25 Jun 2015 16:41:24 +0200 (CEST) Received: by igcsj18 with SMTP id sj18so10057240igc.1 for ; Thu, 25 Jun 2015 07:41:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=PeQGmwTMOy+nWqR8B0/NFyd2FP+SJB9cJF6yLADaDKo=; b=iZNefzhTNH7Sw0BUIipRgY2MKUZwtvDmItZF0o+dahHQlSTIAqa4qMPzWeMOBn0uPB jBI0TUl/xPP4feyJh8SvUkLQokrckvAEc1n0V4EsumCjkG0hcGPfFIrJH94RjRfHdXpA b51iTXZxlmWGz6y0q4V5uhDLAE3FBRTDug5Dvwz1TE6gab/jarB23tN3O9gFYxAxuBn4 bHsa7HvikLBzLIsZuzqu9zqHxZcsuvEtZ9em7fTz6dn3wxLqM0+HnLIM1VtGzzWwmmgC d3zyfu5qxm9PApnoPgmt0R5Xqm9k96MPD5emijuHYWKpSpf3xA1WYiWFzjkGejmh7/xk RJAw== X-Gm-Message-State: ALoCoQn16BMiN28jid04tPBVdaa/EyaA0IdJVDxY8VmTL79nsq1KeeXXDm/OZYc7ltp7V73/EnYo X-Received: by 10.107.10.193 with SMTP id 62mr7479733iok.89.1435243283551; Thu, 25 Jun 2015 07:41:23 -0700 (PDT) Received: from uryu.home.lan ([144.160.5.83]) by mx.google.com with ESMTPSA id j20sm3434954igt.16.2015.06.25.07.41.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 07:41:23 -0700 (PDT) Date: Thu, 25 Jun 2015 10:41:21 -0400 From: Stephen Hemminger To: Bernard Iremonger Message-ID: <20150625104121.3d71c96e@uryu.home.lan> In-Reply-To: <1435242628-8619-1-git-send-email-bernard.iremonger@intel.com> References: <1435242628-8619-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] 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: Thu, 25 Jun 2015 14:41:24 -0000 On Thu, 25 Jun 2015 15:30:28 +0100 Bernard Iremonger wrote: > Signed-off-by: Bernard Iremonger > --- > lib/librte_ether/rte_ethdev.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index e13fde5..2404556 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -369,8 +369,14 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev) > /* free ether device */ > rte_eth_dev_release_port(eth_dev); > > - if (rte_eal_process_type() == RTE_PROC_PRIMARY) > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { > + rte_free(eth_dev->data->rx_queues); > + rte_free(eth_dev->data->tx_queues); > rte_free(eth_dev->data->dev_private); > + rte_free(eth_dev->data->mac_addrs); > + rte_free(eth_dev->data->hash_mac_addrs); > + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); Glad to see this problem addressed. I would prefer that the component that created the object be responsible for doing its own cleanup.