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 46A16A00E6 for ; Fri, 17 May 2019 10:59:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C68622BBD; Fri, 17 May 2019 10:59:43 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id CDA642BA5 for ; Fri, 17 May 2019 10:59:41 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2D8A724866; Fri, 17 May 2019 04:59:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 17 May 2019 04:59:41 -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=ryUfj97vZak7ttuMP1orFjsxFnytdwl6BuUX71IgAG4=; b=Dz3Xvwk3XIjZ MDIN7m7xIvZV33THKz/kJdoHwo+Nf9rhGMMkoy3TT3NZBEekx0++E6Eis+ntfNP6 lfjxCl6IR19wCTvuIX32RfBq2s/9uGLsfXkmi8irTCpePfWyK45ZYNsNGKFK1SFj WLBY5z9AsnTqLyeaSkyQZVx30dgKew0= 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=ryUfj97vZak7ttuMP1orFjsxFnytdwl6BuUX71IgA G4=; b=32/0jePoyGlNB/W7ZPiZ6oReTKqcSU7EY2NGrrmhDXsdRVB8MNI6XfCoG WwOKABICZS42aflnwlaTZk3Q4kWm0BD0BnH0ujf2UVd+q4t2dvACA+8Sd2Nw9J+s vRZpse0Fjhcdxfpf3P4Zs/QUMr4ToV/7sEp0fvGbPZjsSGKTJ326mK0tr2R55+qe P7OuYBdAhB6XqUs1WOY8VI2wk4saXt5Eepcdqb0E/4fKReF0dj0Gb/RE2riYHNtq kh79a/pWYS3QCT6tAgsMtGC+OiR3nPuZZ/8G4sKSi5PE81/VRabQIhA9XpCJcpM+ LgnrpQVl2k/v4IvmVZCuzOo5c9HKQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtvddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf hppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhh ohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt 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 098BB8005B; Fri, 17 May 2019 04:59:39 -0400 (EDT) From: Thomas Monjalon To: Nithin Dabilpuram Cc: dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Date: Fri, 17 May 2019 10:59:38 +0200 Message-ID: <3849744.ELThORf4eq@xps> In-Reply-To: <20190517085547.GA26094@gmail.com> References: <20190513112112.7069-1-ndabilpuram@marvell.com> <1750613.yctpDDeXOX@xps> <20190517085547.GA26094@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] app/testpmd: change port detach interface 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" 17/05/2019 10:55, Nithin Dabilpuram: > On Wed, May 15, 2019 at 09:27:22AM +0200, Thomas Monjalon wrote: > > 15/05/2019 08:52, Nithin Dabilpuram: > > > Hi Thomas, > > > On Tue, May 14, 2019 at 05:39:30PM +0200, Thomas Monjalon wrote: > > > > Hi, > > > > > > > > 13/05/2019 13:21, Nithin Dabilpuram: > > > > > With the latest published interface of > > > > > rte_eal_hotplug_[add,remove](), and rte_eth_dev_close(), > > > > > rte_eth_dev_close() would cleanup all the data structures of > > > > > port's eth dev leaving the device common resource intact > > > > > if RTE_ETH_DEV_CLOSE_REMOVE is set in dev flags. > > > > > So "port detach" (~hotplug remove) should be able to work, > > > > > with device identifier like "port attach" as eth_dev could have > > > > > been closed already and rte_eth_devices[port_id] reused. > > > > > > > > "port attach" uses devargs as identifier because there > > > > is no port id before creating it. But "detach port" uses > > > > logically the port id to close. > > > > > > But if "port close" was already called on that port, > > > eth_dev->state would be set as RTE_ETH_DEV_UNUSED and > > > that port id could be reused. > > > So after "port close" if we call "port detach", isn't it > > > incorrect to use the same port id ? > > > > Yes it is incorrect to close a port which is already closed :) > > > > > > > This change alters "port detach" cmdline interface to > > > > > work with device identifier like "port attach". > > > > > > > > The word "port" means an ethdev port, so it should be > > > > referenced with a port id. > > > > If you want to close an EAL rte_device, then you should > > > > rename the command. > > > > But testpmd purpose should be to work with ethdev ports only. > > > > > > Renaming the command to "detach " ? > > > > Yes something like that. > > But why do you want to manage rte_device in testpmd? > > Being able to close ports in not enough? > > Please describe a scenario. > > > > We just want to support testing hotplug detach along with > hotplug attach from testpmd. Currently there is no way to detach > if we close the port first. OK > Another reason is that in our new PMD, for detaching one specific port, > we need more than one try as the PMD might return -EAGAIN. > So with the current "port detach" implementation, after closing the port, > if PMD returns -EAGAIN for rte_dev_remove() call, there is no way to > try it again. This is a bug. Should we catch -EAGAIN somewhere?