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 A647F4C9F for ; Wed, 12 Sep 2018 16:57:29 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3DA3D215C6; Wed, 12 Sep 2018 10:57:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 12 Sep 2018 10:57:29 -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=gYoi7/N4Mew16ebpH2LWgklBJS Yoc3HMc0AA4fI8U2o=; b=kgOMR+MBp0W5wSdg/xpbnabLntPhHnqp+aRSxQZias BcA2hD2oBNjqSSjJK/CQmWlj77+AwQalk0Hc4NwSvjaZwgxwx27arI3QzJ+wCEYX dPJXw53ELAbVLEeAMnPqDr4fqGzAoK0VnHGAyI3fGtWWhqxJJ5uByIQkbac9aOqG 8= 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=gYoi7/ N4Mew16ebpH2LWgklBJSYoc3HMc0AA4fI8U2o=; b=nentGSCytaZlSIKHQsNMWF JmAjpVjJKw7cjGIcYiqymU1QbYCcMosY/YGigF6RA4BGtsCN3eAgXpd2JXl7jH4l tMCGAOj0u5I7rBrcQFmGBqIdcxMRR3Bhb2Mlhv0DLMxupxhjqdIgNOtZbBHdHLMv s51DyzYFIxHDRu3yqUnqp7s/W4xhX50cPzLHKUp293M6q2j+7hsGdsvmJ4qpn7Bw ixC4kRiFgRVO2x+6L3IubuESwHKNi7LlaLNCMXueegYjqCD3vEoL8HaoBHiPXHSl DScxIROkm6sRcimUZ/voBl84DVGX3QVlKQCxbDet7R49J7vik2+rB7c95DW05NIg == 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 EF168E44DC; Wed, 12 Sep 2018 10:57:27 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko Cc: ferruh.yigit@intel.com, dev@dpdk.org Date: Wed, 12 Sep 2018 16:57:35 +0200 Message-ID: <3176257.grtejztXq6@xps> In-Reply-To: <402147ea-d88a-27a0-25a9-905c79fb5b89@solarflare.com> References: <20180907233929.21950-1-thomas@monjalon.net> <2007089.03mgKk1tIn@xps> <402147ea-d88a-27a0-25a9-905c79fb5b89@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: Wed, 12 Sep 2018 14:57:30 -0000 10/09/2018 10:54, Andrew Rybchenko: > On 09/10/2018 11:42 AM, Thomas Monjalon wrote: > > 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 > > Yes, I'm sorry I used bad terminology. > We have probe/remove pair for both PCI and vdev drivers and I mean > that remove is a better candidate to be kept (as a pair for probe which > allocates all resources). OK, yes probe/remove is the pair at EAL level. But if we want to request removal at ethdev level, rte_eth_dev_close is the function. Note that there is no function to request creation of an ethdev port. Adding a new port is done only by the PMD during probing (rte_bus level).