From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id CD8FC1C0B; Wed, 23 May 2018 13:58:36 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4DFCB20C3C; Wed, 23 May 2018 07:58:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 23 May 2018 07:58:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=3f/Hr0CAN2K1NJZn0j0lHklS2j pbzyJFZALTExKeGWU=; b=aR0r4P3ZytqYamE5q46tUuCYf1Pm18/REsJnbAeBzt ky5VYxc96Q+D77MHCreXM7tCJy4DAX09beqUcwgx8+sliLjkfGQBTKMmvrUwzHA0 qzNNpWywx6WteNGOcFmYGQt1OLawPnvjNzyzNfImalSaOXlFYG/vnV993akIPjeA A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=3f/Hr0 CAN2K1NJZn0j0lHklS2jpbzyJFZALTExKeGWU=; b=Sn4s8ftfYTYxqs4Vpr0md0 dwHaglJNHhUQgFN3LrK3RmZrbSoITwbgtjJchKjlsSDwzVuy02zgkyGw1Q8DovsO 0rAyek9rwYNAOLfgEpJv3pG0voBcZrcU+JLFt2OhQnAsM7yinr3alVW+sQJ9G4Xb oyOk9K56e6pQW0FPXlxhZuKyJy4CcOT3weaLPlcst05E/pwIRJ0rrdbEo/QiR/u2 NiPYlnVGQ+Bqr2PGAN7ku8TJcVp13UcLAEMHALPRqNCPY8LTo/s7Bf39IxULc+sk 6hNzmSNhymla9IkR1WlV+zzyzFauf/HWN4MokcLipR6KFM1PQ8a6SE+fmV+IXPlQ == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id DF8D0E498E; Wed, 23 May 2018 07:58:34 -0400 (EDT) From: Thomas Monjalon To: "Yang, Zhiyong" Cc: "Yigit, Ferruh" , "dev@dpdk.org" , Matan Azrad , "Iremonger, Bernard" , "Yao, Lei A" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "stable@dpdk.org" , "Van Haaren, Harry" Date: Wed, 23 May 2018 13:58:33 +0200 Message-ID: <7958875.5NsG26LkGv@xps> In-Reply-To: References: <20180518095937.28710-1-zhiyong.yang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] app/testpmd: fix pmd_test_exit function for vdevs X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 11:58:37 -0000 23/05/2018 13:37, Yang, Zhiyong: > From: Yang, Zhiyong > > > > Hi Thomas, > > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > 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 virtio-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 > > > > 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. > > > > > > >> 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? Yes, we need to call the remove() functions of all drivers from rte_eal_cleanup(). > > > > 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 > > > > > > > > > > rte_eal_cleanup() is a proper API, which is needed to clean up resources. > > > > Thanks > > Zhiyong