From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 241BA11A4 for ; Mon, 10 Sep 2018 10:42:50 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id BAC023C5; Mon, 10 Sep 2018 04:42:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 10 Sep 2018 04:42:49 -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=9GbmZW9Cc1m2Dw7/PUJrzM6Qeh 720iKb5JUvVVz13Mg=; b=iz+l4bBuAfLfQb+lwr8jbA8PGE39Whpd+QAWv3p0OY wGZgtDHO7T9g8Cs+5EHG0QCbk1pdgkviP/u/RD+rU2ctjrD59lqRTbZkYraIMakD 8IzCRJqvoE1P2nwbC0bUaFryj8U0Ew1r2y1TakMPZVTjZ7ohuVVaSJQZjiqMZBM2 U= 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=fm3; bh=9GbmZW 9Cc1m2Dw7/PUJrzM6Qeh720iKb5JUvVVz13Mg=; b=fczboivHk7RzUtDBBF0ph9 LJZdlv+z+Ta3Zyl6mzi8H8Sgp7XMISh6kVHsA+CGiviHTKTiFJOrEIu5vWQwig7h Gno7Wzh2aMANxH30dHVB+1xKlvOduivLCkDUJMMPC6EnSkQ6NGhqqr7L+pXvY+Uy 17F88uUIcWbUvBCLOuMiooXmxUiLbqINefJNaoG8zO8xaGs2NP89IJfdRmq2puGY kXMVL0O+A2kfRnSTDbLtbZcNllxE4imtLcXvrfxB5jgDz+bAsqahZLV3ywAAS3Od jvjMWTV+CWP52EyGhdmox1m1iRR/cCVycqU+Ip+qdvHaf1jQWnZSbOKgnO6gkq6w == 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 64A3EE4621; Mon, 10 Sep 2018 04:42:47 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko Cc: ferruh.yigit@intel.com, dev@dpdk.org Date: Mon, 10 Sep 2018 10:42:43 +0200 Message-ID: <2007089.03mgKk1tIn@xps> In-Reply-To: <47678eef-0260-302a-b46b-2cdf861322a6@solarflare.com> References: <20180907233929.21950-1-thomas@monjalon.net> <47678eef-0260-302a-b46b-2cdf861322a6@solarflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [RFC] ethdev: complete closing to free all resources 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: Mon, 10 Sep 2018 08:42:50 -0000 10/09/2018 10:03, Andrew Rybchenko: > On 09/08/2018 02:39 AM, Thomas Monjalon wrote: > > After closing a port, it cannot be restarted. > > So there is no reason to not free all associated resources. > > > > The last step was done with rte_eth_dev_detach() which is deprecated. > > Instead of removing the associated rte_device, the driver should check > > if no more port (ethdev, cryptodev, etc) is still open for the device. > > Then the device resources can be freed by the driver inside the > > dev_close() driver callback operation. > > > > The last ethdev freeing (dev_private and final release), which were done > > by rte_eth_dev_detach(), are now done at the end of rte_eth_dev_close(). > > For me, it sounds more logical to kill dev_close and keep detach. > IMHO, dev_close is artificial and hardly useful. detach is a local pair > to attach. I don't get your point. In order to free a port, we need close + detach. We can keep only one. I choose close because: 1) attach/detach are deprecated 2) probe/close is a more obvious pair 3) we need the driver to free the lower level resources > Anyway it requires update of all drivers as I understand. Yes if we want to free all resources. But close operation in drivers can be completed in later steps.