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 8F9D158CB for ; Wed, 17 Oct 2018 04:12:25 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A9BA821711; Tue, 16 Oct 2018 22:12:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 16 Oct 2018 22:12:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=y/Uaf38fAWf3ONJswpGF3xGXHVzqQfq14HEuPS5V4sY=; b=J+aWwJBhQWK7 ak3nseyMjGwCR6Kl73M2r+Xu/bIDfQBDC0XVgxSMiEBe/Lo1uUzuhmCTQ4u1uhzY MFbHAOl7h5fkcheyd68dT99tGZdiAnEt51oxL8clc2Q5D4sQRE+ovpNFD5LR5bKt 2zEH2RaFWLGtp3hVYhGzKe91iepuw1Y= 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=y/Uaf38fAWf3ONJswpGF3xGXHVzqQfq14HEuPS5V4 sY=; b=Endv921p7OH89kMu/lPYLKyatuSJ3IiaajOhKhxrJk7DwpnB9VrvARNtB Ye4v2erakppYdFbtwdznjMo8kn05L5EBUNRCbosOQ/KaQUQcgfUCFNzaEzjifckn QYTUYrdZss8uqrbbnHKp2kflca5oy0VnKZGtJkmF5SZLpwLkGXnS0891hYX/P4Ix rsqez/3OV7N/FR2VN+hLOSzUUi8sV13qbnYH64mklfyCjp3DnowueNR7+GY9aC6N JGoCgtcErp9Uomrn3/dWbaSrCILN13JsgPh7qRaEsx5RP4H9jbAtiw+uJfnc4QNY mm0xHUzPrBIyQdjqKuNkFKR2at1NA== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 74FB6102A0; Tue, 16 Oct 2018 22:12:23 -0400 (EDT) From: Thomas Monjalon To: ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org, ophirmu@mellanox.com Date: Wed, 17 Oct 2018 04:12:26 +0200 Message-ID: <9517816.1Q1vY9UbFX@xps> In-Reply-To: <20181017015450.15783-5-thomas@monjalon.net> References: <20180907233929.21950-1-thomas@monjalon.net> <20181017015450.15783-1-thomas@monjalon.net> <20181017015450.15783-5-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 4/4] ethdev: complete closing of port 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, 17 Oct 2018 02:12:26 -0000 17/10/2018 03:54, Thomas Monjalon: > 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 blindly removing the associated rte_device, the driver should > check if no more port (ethdev, cryptodev, etc) is open for the device. > > The last ethdev freeing which were done by rte_eth_dev_detach(), > are now done at the end of rte_eth_dev_close(). [...] > /** > * Close a stopped Ethernet device. The device cannot be restarted! > - * The function frees all resources except for needed by the > - * closed state. To free these resources, call rte_eth_dev_detach(). > + * The function frees all port resources. [...] > @@ -1384,12 +1386,7 @@ rte_eth_dev_close(uint16_t port_id) > + rte_eth_dev_release_port(dev); After more thoughts, I think I should add a release note to explain that a closed port has its data freed and its state to RTE_ETH_DEV_UNUSED.