From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 4/4] ethdev: complete closing of port Date: Wed, 17 Oct 2018 04:12:26 +0200 Message-ID: <9517816.1Q1vY9UbFX@xps> References: <20180907233929.21950-1-thomas@monjalon.net> <20181017015450.15783-1-thomas@monjalon.net> <20181017015450.15783-5-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, ophirmu@mellanox.com To: ferruh.yigit@intel.com, arybchenko@solarflare.com 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) In-Reply-To: <20181017015450.15783-5-thomas@monjalon.net> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.