From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 42EAD8D3B; Sat, 19 May 2018 16:19:38 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 25C4822310; Sat, 19 May 2018 10:19:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 19 May 2018 10:19:37 -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=IZTgXQe/A7wQA3CDcwzLnypzxv HG7iUq/v/RGpjdgp8=; b=eG5RZ8FvKQn86/VHDMrW0U0pQqqomtkkkzFyqGPIzs IDF+T57yHngSczGui6Wpkdi24H20kwCrZv7bUIQ58Z50NQlfKocVKHlSvDKG3hpK WJquXJ8i53DRtmMPXjWaZ9q3Yu6b1D+VknwcZhLphnNa7dTsF16GXblwSNn7a05E o= 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=IZTgXQ e/A7wQA3CDcwzLnypzxvHG7iUq/v/RGpjdgp8=; b=bcY+VglR01/Hf7e5Unat78 NlZ9v4GyiEqLjo0L2DvIaZF8mYIgAqLgBMybqCKwIA18f1OJKYrgjFtt1Usbwr/M QosuVAfbIlF2pQBq+yH/mE1/kawamI2XMWEq6ru5+ibMOj4Ql8VKDxoJKsuuq+5x rHrZttgSRWUOwrU2sLIAbLWWNXU5pg1ONuq7dmmDsoTUoz5VCDD2SeBYicGbjmLC BE5E4d0x9OYvW3HvslO6Xnp9kGAMGJAo+TSG6lPZ/pMyewyMa1z6fOD+UvAkhdgx TF1jlW85mR3URG28twjl31JpcXHTrxpeGc5Vde1sdUjyZtET6nANBkrLm3mmQfoQ == 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 (114.149.6.93.rev.sfr.net [93.6.149.114]) by mail.messagingengine.com (Postfix) with ESMTPA id 93CE7E473B; Sat, 19 May 2018 10:19:35 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit , Matan Azrad Cc: "Iremonger, Bernard" , "Yao, Lei A" , "Yang, Zhiyong" , "dev@dpdk.org" , "maxime.coquelin@redhat.com" , "Bie, Tiwei" , "stable@dpdk.org" , Harry Van Haaren Date: Sat, 19 May 2018 16:19:33 +0200 Message-ID: <2140651.lW3kzKMLfn@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-dev] [PATCH v2] app/testpmd: fix pmd_test_exit function for vdevs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2018 14:19:38 -0000 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().