From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Zhiyong" Subject: Re: [PATCH v2] app/testpmd: fix pmd_test_exit function for vdevs Date: Wed, 23 May 2018 11:37:10 +0000 Message-ID: References: <20180518095937.28710-1-zhiyong.yang@intel.com> <9489790.cv73CZovxU@xps> <45bf17fa-fb43-7917-8cf6-63864f9d2c4c@intel.com> <3059388.qb94XYSleL@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , Matan Azrad , "Iremonger, Bernard" , "Yao, Lei A" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "stable@dpdk.org" , "Van Haaren, Harry" To: "Yang, Zhiyong" , Thomas Monjalon , "Yigit, Ferruh" Return-path: In-Reply-To: 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" > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yang, Zhiyong > Sent: Wednesday, May 23, 2018 9:52 AM > To: Thomas Monjalon ; Yigit, Ferruh > > Cc: dev@dpdk.org; Matan Azrad ; Iremonger, Bernard > ; Yao, Lei A ; > maxime.coquelin@redhat.com; Bie, Tiwei ; > stable@dpdk.org; Van Haaren, Harry > Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix pmd_test_exit functio= n for > vdevs >=20 > Hi Thomas, >=20 > > -----Original Message----- > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Wednesday, May 23, 2018 3:49 AM > > To: Yigit, Ferruh > > Cc: Yang, Zhiyong ; dev@dpdk.org; Matan Azrad > > ; Iremonger, Bernard > > ; Yao, Lei A ; > > maxime.coquelin@redhat.com; Bie, Tiwei ; > > stable@dpdk.org; Van Haaren, Harry > > Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix pmd_test_exit > > function for vdevs > > > > 22/05/2018 20:38, Ferruh Yigit: > > > On 5/22/2018 2:12 PM, Thomas Monjalon wrote: > > > > Any update to improve this workaround? > > > > > > > > 21/05/2018 18:38, Thomas Monjalon: > > > >> 21/05/2018 18:32, Ferruh Yigit: > > > >>> 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 vi= rtio-user. > > > >> > > > >> The defect is still in virtio-user after this patch. > > > >> To make this workaround acceptable, you need: > > > >> 1/ add the virtio-user known issue in release notes >=20 > I don't think it is a bug for virtio-user. Just no proper implemented API= can free > the virtio-user resources allocated by probe method. > Socket file is just one example, other resources are freed in the remove > method. Testpmd was always missing the functionality. >=20 > > > >> 2/ add a FIXME comment in testpmd code explaining the workaround > > > >> 3/ commit to work on rte_eal_cleanup() in 18.08 Do you mean to work on rte_eal_cleanup() for all drivers or for virtio user= only? > > > > > > I have submitted following patch [1], can it cover 2/ for the v18.05-= rc5? > > > > > > [1] > > > https://dpdk.org/dev/patchwork/patch/40350/ > > > > Yes, it covers item 2/. Thanks > > > > >=20 > rte_eal_cleanup() is a proper API, which is needed to clean up resources= . >=20 > Thanks > Zhiyong