From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: Re: [PATCH v3 2/4] ethdev: free all common data when releasing port Date: Wed, 17 Oct 2018 10:13:53 +0300 Message-ID: <7fcb80d5-7abd-3034-f271-bb87fea72de4@solarflare.com> References: <20180907233929.21950-1-thomas@monjalon.net> <20181017015450.15783-1-thomas@monjalon.net> <20181017015450.15783-3-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: Thomas Monjalon , Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 79A155F29 for ; Wed, 17 Oct 2018 09:14:39 +0200 (CEST) In-Reply-To: <20181017015450.15783-3-thomas@monjalon.net> Content-Language: en-GB List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/17/18 4:54 AM, Thomas Monjalon wrote: > This is a clean-up of common ethdev data freeing. > All data freeing are moved to rte_eth_dev_release_port() > and done only in case of primary process. > > It is probably fixing some memory leaks for PMDs which were > not freeing all data. > > Signed-off-by: Thomas Monjalon [...] > diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h > index ca31b5777..a1398a80c 100644 > --- a/lib/librte_ethdev/rte_ethdev_driver.h > +++ b/lib/librte_ethdev/rte_ethdev_driver.h > @@ -58,7 +58,16 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name); > > /** > * @internal > - * Release the specified ethdev port. > + * Notify RTE_ETH_EVENT_DESTROY and release the specified ethdev port. > + * > + * The following data fields will be freed: > + * - rx_queues > + * - tx_queues I think rx_queues and tx_queues from should not be mentioned here. They are managed by ethdev and there is no options here. > + * - mac_addrs > + * - hash_mac_addrs > + * - dev_private > + * If one of these fields should not be freed, > + * it must be reset to NULL by the caller. I'm afraid nobody will find it here. Let's add @see rte_eth_dev_release_port() to these members description in rte_ethdev_core.h struct rte_eth_dev_data. Also I think "by the caller" is misleading here. Let's highlight that it is PMD responsibility, i.e. "by the PMD" may be with "typically in dev_close method implementation". Andrew.