From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 2/4] ethdev: free all common data when releasing port Date: Wed, 17 Oct 2018 10:22:34 +0200 Message-ID: <17711677.o5lTiYJ96P@xps> References: <20180907233929.21950-1-thomas@monjalon.net> <20181017015450.15783-3-thomas@monjalon.net> <7fcb80d5-7abd-3034-f271-bb87fea72de4@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: ferruh.yigit@intel.com, dev@dpdk.org, ophirmu@mellanox.com To: Andrew Rybchenko Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id CC9C07D34 for ; Wed, 17 Oct 2018 10:22:32 +0200 (CEST) In-Reply-To: <7fcb80d5-7abd-3034-f271-bb87fea72de4@solarflare.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 17/10/2018 09:13, Andrew Rybchenko: > 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". OK, thanks for the feedback.