From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DDAD8A0679 for ; Tue, 30 Apr 2019 16:12:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 856015B2C; Tue, 30 Apr 2019 16:12:57 +0200 (CEST) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by dpdk.org (Postfix) with ESMTP id D93A056A1 for ; Tue, 30 Apr 2019 16:12:55 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id C44D016273; Tue, 30 Apr 2019 10:12:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 30 Apr 2019 10:12:53 -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=EDJoNggMVwsTG5Mu+t58TeH01VtEKdGbbxEUwMUOYAg=; b=lGzrPGHvZUTf 4AT9Gf3IfB7wDgyzbpZhBj6AmGWrBM4oWlTEW4uJhXM7+SLtasXWm6JsGKxpFhmf 4+/V7fBaVJCtsJUoUTxTEQ01Q2CqK8K3dJAbdRD1RiFpinBE16vRujCxRpNY6Jrl 3FqQo6nV8TQKc0rNJVVJkOAJ40OmwlU= 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=fm2; bh=EDJoNggMVwsTG5Mu+t58TeH01VtEKdGbbxEUwMUOY Ag=; b=xAwJYXnw9BrARmTQDEzE3DASpZcKWp1fKQwO/U6OrfmOwSyylR7W6Y2xP qI+CkdD86OqeU9TbrxjE3YAae8iSvEAgGsNIm+w7FGWi3GhF9ZtYrz+CYD3H457u fwEG3YDMoIbtnqw8cpjY8fKijooyPmctMym5+b9C2Pd2+TxRfTg5pueV3SKASoOB 5PyyImK6S7/8oQCsO31Q7hhUZioWyDeRAshNpX7o6jNKGIskyXsHjq2x5qYAtfwm BJsColW3TtN9TCkPHqKOLMpcKz3E4OcmscyGHffJDrwNUtbNym3enVBTDwkpB9Zl 25j0f0X+KxnXDSUqUTKGylY5XyeNg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrieehgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd 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 66413103CB; Tue, 30 Apr 2019 10:12:44 -0400 (EDT) From: Thomas Monjalon To: Nithin Dabilpuram Cc: Ferruh Yigit , "John W. Linville" , Xiaolong Ye , Qi Zhang , Shepard Siegel , Ed Czeck , John Miller , Igor Russkikh , Pavel Belous , Allain Legacy , Matt Peters , Ravi Kumar , Rasesh Mody , Shahed Shaikh , Ajit Khaparde , Somnath Kotur , Chas Williams , Rahul Lakkireddy , Hemant Agrawal , Shreyansh Jain , Wenzhuo Lu , Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin , Gagandeep Singh , Pankaj Chauhan , John Daley , Hyong Youb Kim , Gaetan Rivet , Xiao Wang , Beilei Xing , Jingjing Wu , Qiming Yang , Konstantin Ananyev , Shijith Thotton , Srisivasubramanian Srinivasan , Matan Azrad , Shahaf Shuler , Yongseok Koh , Zyta Szpak , Liron Himi , Alan Winkowski , Tomasz Duszynski , Stephen Hemminger , "K. Y. Srinivasan" , Haiyang Zhang , Rastislav Cernay , Jan Remes , Alejandro Lucero , Tetsuya Mukawa , Jerin Jacob , Bruce Richardson , Andrew Rybchenko , Jasvinder Singh , Cristian Dumitrescu , Keith Wiles , Maciej Czekaj , Maxime Coquelin , Tiwei Bie , Zhihong Wang , Yong Wang , Anatoly Burakov , dev@dpdk.org Date: Tue, 30 Apr 2019 16:12:41 +0200 Message-ID: <1712690.NYlGCEZG53@xps> In-Reply-To: <20190430124542.GA16665@gmail.com> References: <30528485.5cHeq7CNxZ@xps> <1748144.UFpUr2FPnr@xps> <20190430124542.GA16665@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] CALL to eth PMD maintainers: 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190430141241.1DmNY7Ain4-rqM61JDh6mo9KoXIYqSOr5NiLp6Z45VA@z> 30/04/2019 14:45, Nithin Dabilpuram: > On Mon, Apr 29, 2019 at 10:30:00PM +0200, Thomas Monjalon wrote: > > 29/04/2019 18:51, Ferruh Yigit: > > > I would like to detail a little more what needs to be done, mainly for the sake > > > of the discussion, please comment if something missing/wrong. > > > > > > There are two exit paths for driver: > > > 1) Hotplug remove the device > > > rte_dev_remove() OR rte_eal_hotplug_remove() > > > > > > 2) Application exit: > > > rte_eth_dev_close() > > > > > > > > > (1) can be called without ethdev stop and close functions called, so the path > > > should cover those functions. > > > And in the PMD entry point in this path is .remove() function. In this .remove() > > > function PMD should: > > > - stop forwarding > > > - clean PMD private resources (dev_close() ? ) > > > > yes > > > > > - clean ethdev generic resources (rte_eth_dev_release_port() ? ) > > > > already done in dev_close thanks to RTE_ETH_DEV_CLOSE_REMOVE > > > > > - remove device resources, which already done by remove APIs > > > > There can be some specific PMD private resources, > > not cleaned when closing a port, to clean in "remove". > > > > > (2) ethdev won't be usable after "rte_eth_dev_close()" and it should clear PMD > > > private and ethdev generic resources. > > > With RTE_ETH_DEV_CLOSE_REMOVE flag 'rte_eth_dev_close()' will free generic > > > ethdev resources (rte_eth_dev_release_port()) so PMD specific '.dev_close()' should: > > > - stop forwarding > > > - clean PMD private resources > > > > yes, but only port-related resources, > > not those common with other ports or features of the device. > I have a related query. Even after rte_eth_dev_close(), we have to call > rte_eal_hotplug_remove() to free up common resource if any > and remove the device from application ? > And rte_eal_hotplug_remove() would still call drivers .remove function for this. Yes if you really want to free the whole device, you should call the .remove op from rte_eal_hotplug_remove() or rte_dev_remove().