From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 1/2] librte_ether: release memory in uninit function. Date: Fri, 17 Jul 2015 15:55:58 +0200 Message-ID: <1679514.Xh2dpDAxNQ@xps13> References: <1436792645-26831-2-git-send-email-bernard.iremonger@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Bernard Iremonger Return-path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id 3C762DE4 for ; Fri, 17 Jul 2015 15:57:11 +0200 (CEST) Received: by wgmn9 with SMTP id n9so83030841wgm.0 for ; Fri, 17 Jul 2015 06:57:11 -0700 (PDT) In-Reply-To: <1436792645-26831-2-git-send-email-bernard.iremonger@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2015-07-13 14:04, Bernard Iremonger: > @@ -387,8 +387,12 @@ 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); > + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); > + } What is the benefit of freeing queues in detach/uninit function? It is already freed in the close function of your other patch and calling close() is mandatory before calling detach(): http://dpdk.org/browse/dpdk/tree/doc/guides/prog_guide/port_hotplug_framework.rst#n63 http://dpdk.org/browse/dpdk/tree/lib/librte_ether/rte_ethdev.h#n1699