From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 31E8810BD for ; Mon, 10 Sep 2018 10:54:35 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 966BDB40057; Mon, 10 Sep 2018 08:54:33 +0000 (UTC) Received: from [192.168.38.17] (91.220.146.112) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Sep 2018 01:54:30 -0700 To: Thomas Monjalon CC: , References: <20180907233929.21950-1-thomas@monjalon.net> <47678eef-0260-302a-b46b-2cdf861322a6@solarflare.com> <2007089.03mgKk1tIn@xps> From: Andrew Rybchenko Message-ID: <402147ea-d88a-27a0-25a9-905c79fb5b89@solarflare.com> Date: Mon, 10 Sep 2018 11:54:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2007089.03mgKk1tIn@xps> Content-Language: en-US X-Originating-IP: [91.220.146.112] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ocex03.SolarFlarecom.com (10.20.40.36) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24084.005 X-TM-AS-Result: No-13.213600-4.000000-10 X-TMASE-MatchedRID: 6otD/cJAac0OwH4pD14DsPHkpkyUphL9wuIWIvQEbW6vPoND+wakFlPK Q4g0ENBTz0kHebusWqG/OcTZGXKzdinPugGsN3p5bc297PAGtWbhKQh1LCmGBk+nXRcya9Nvq4N L3KtjQybxF3lBuZS3jYGwaIKd6VKF9rhTO8T5ktELPVZHwod7gPiH64jt3FfETmPQ6wyP0TowV1 2/6ktut6IXHI3/puiC4YS6FyG8vyjyUQNiagGSs9sfxZpQv2qMm/y00tE9Sta/wz3p7pLVvSxZV 2XdhwOw7fNKgmEEsE1qlnm6jwp3D3ASplscW9qaBxsweNg3EaGFkCkkB0UMNpsoi2XrUn/JyeMt MD9QOgChMIDkR/KfwCIQ5mZ5SqHP51ZNIYRBNcyfvz5Xci2oCyzVGS6wFGfNYkj7XPc+JIgYEHK 0sZ9tzGSz/GPofIEjfProUh6rf/OtHmas/5jrt0+EWBo42gw+aAZk0sEcY14= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--13.213600-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24084.005 X-MDID: 1536569674-8x4wy49doijp Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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:54:35 -0000 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).