From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=3KiS5E3+DTYshtFCPpXdoLcI5Rg/GfvFv7x6IZCeSSU=; b=Hh3IJTj+ZjYiwUItAM75F3fwGCDMnEPwgWSOalgCXdUAeTw/UW9jqf9YCnB41f27Sy B08z2idAYrxUbtRtQ/jrgik/N5BpjOKD4OVOonyttjFMqIE1EzJE33xpKZcFe210cRiu IW4LAMPm32k7kyLXY9c091qxmPpS1+SihJQkztpmbqHsw6mgyEDLL/y2nnVuwLxPjTws l5ri1ZqfmFQiFj8TsVV6QTKlvGC6drssqJ0Et4xxmdlxpXEOaxnSzuskcT10D4Bh+E8u YGkOX346ZE4JgsJynU3wW++GnMXhJDWjfEGs/3GzWTWQgRtXhdSlMBXxo73ObhFjgYrL tZvQ== X-Gm-Message-State: ALoCoQmR1diFE1WDX4drDVbiOypDnqMKcivzdcmUoabMB96IzDdrvrDEa96dmgtAvfxYPiwztrd/ X-Received: by 10.194.174.194 with SMTP id bu2mr32211367wjc.76.1437141431073; Fri, 17 Jul 2015 06:57:11 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.151.210]) by smtp.gmail.com with ESMTPSA id j7sm18509477wjz.11.2015.07.17.06.57.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2015 06:57:09 -0700 (PDT) From: Thomas Monjalon To: Bernard Iremonger Date: Fri, 17 Jul 2015 15:55:58 +0200 Message-ID: <1679514.Xh2dpDAxNQ@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1436792645-26831-2-git-send-email-bernard.iremonger@intel.com> References: <1436792645-26831-2-git-send-email-bernard.iremonger@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3 1/2] 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, 17 Jul 2015 13:57:11 -0000 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