From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas@monjalon.net>
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: <xmx:eDIAW2oNeFSAQ7Y7DXI-Ig3s315bUlXfZ7zUt6kWgvhXQQkck0GrOA>
X-ME-Proxy: <xmx:eDIAW-kSrwbgkhXDmy-DHLv9NlOtcAugqxSkbnQC1WJg4gEKMue7mQ>
X-ME-Proxy: <xmx:eDIAWxiNf36f_GioLT3lD5gyBzQ1Jm0MFy777qX0vQwpYzM8Da6u0w>
X-ME-Proxy: <xmx:eDIAW8Y5VRWeLLHfIxWj-SRQQNnqFEMsBlku63lnUcwqeXnBv2tCtg>
X-ME-Proxy: <xmx:eDIAW1x9X-amfXE7aBA5EbeCUF0Lh2CVhKSE1J-SjPN5u09WG9y6MQ>
X-ME-Proxy: <xmx:eTIAW4Nc_XbE5XfpFDAPJQT14zJOCH_ds5Jf0br0OJh8VU-QHfdBOA>
X-ME-Sender: <xms:eDIAW3lyNpDAhWXOZCjkI9F6rTPj-xpFu1VvzX_8ss7DTPWH29Zggw>
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 <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>, Matan Azrad <matan@mellanox.com>
Cc: "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Yao,
 Lei A" <lei.a.yao@intel.com>, "Yang, Zhiyong" <zhiyong.yang@intel.com>,
 "dev@dpdk.org" <dev@dpdk.org>,
 "maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>, "Bie,
 Tiwei" <tiwei.bie@intel.com>, "stable@dpdk.org" <stable@dpdk.org>,
 Harry Van Haaren <harry.van.haaren@intel.com>
Date: Sat, 19 May 2018 16:19:33 +0200
Message-ID: <2140651.lW3kzKMLfn@xps>
In-Reply-To: <f16bb33b-a3bc-c7ae-8b4b-ff2760e130fc@intel.com>
References: <20180518095937.28710-1-zhiyong.yang@intel.com>
 <VI1PR0501MB26080DBFA8CACD88E5A9F633D2900@VI1PR0501MB2608.eurprd05.prod.outlook.com>
 <f16bb33b-a3bc-c7ae-8b4b-ff2760e130fc@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 <stable.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=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().