From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2] app/testpmd: fix pmd_test_exit function for vdevs Date: Mon, 21 May 2018 17:32:07 +0100 Message-ID: References: <20180518095937.28710-1-zhiyong.yang@intel.com> <2140651.lW3kzKMLfn@xps> <4367922.LPtKO2KjJs@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, Matan Azrad , "Iremonger, Bernard" , "Yao, Lei A" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "stable@dpdk.org" , Harry Van Haaren To: Thomas Monjalon , "Yang, Zhiyong" Return-path: In-Reply-To: <4367922.LPtKO2KjJs@xps> Content-Language: en-US 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 5/21/2018 11:54 AM, Thomas Monjalon wrote: > 19/05/2018 16:19, Thomas Monjalon: >> 18/05/2018 18:29, Ferruh Yigit: >>> On 5/18/2018 4:55 PM, Matan Azrad wrote: >>>> Hi all >>>> >>>> While this patch also applied I don't understand it. >>>> Is it mandatory for each PMD to free all its resources in dev_close()? >>>> Or it should be done by the rte_device remove function? >>>> >>>> If the resource cleanup should be done by the remove function I think it >>>> should be called for all the devices (pci, vdev, etc). >>>> >>>> Is there an exit function for EAL to clean rte_eal_init()? If no, looks like we need it... >>> >>> Hi Matan, >>> >>> I believe there is a gap in resource cleanup. >>> dev_close() it not for resource cleanup, it should be in PMD remove() functions, >>> and PMDs have it. The problem is remove path is not called in application exit. >>> >>> As far as I know there is no simple API to clean the resources, having it may >>> help application to do the cleanup. >>> >>> I have seen the rte_eal_cleanup() API by Harry, that can be extended to cover >>> PMD resource cleanup if there is enough motivation for it. >> >> Yes, EAL resources should be removed by the function rte_eal_cleanup(). >> And ethdev ports must be removed by rte_eth_dev_close(). > > This patch is relying on rte_eth_dev_detach() to remove the EAL device. > It should be done in rte_eal_cleanup(). > > I am concerned that this patch is workarounding a miss in rte_eal_cleanup, > and takes a different action only for vdev. It is a bad example. Indeed it does workaround, but it is needed to fix a defect in virtio-user. And currently rte_eal_cleanup() is not complete, it is not doing any device related cleanup. > > And the function rte_eth_dev_detach() is fundamentally wrong and should be deprecated: > http://dpdk.org/commit/b05b444d22 > http://dpdk.org/commit/b0fb266855 > http://dpdk.org/commit/df3e8ad73f > > One more concern: it seems this patch is breaking failsafe use case. > Note: bonding is managed as an exception in rte_eth_dev_detach(). > >