From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id C46A82C17 for ; Wed, 15 May 2019 09:27:27 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 29F27260B8; Wed, 15 May 2019 03:27:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 15 May 2019 03:27:26 -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=7t+uBdYbcH4Yvl6mo6R7kQ9TV8RkUHCWZZOnmcVqUO8=; b=WQOG3dT41XfU jjvdVIaZ6Afs4EMc1p5DmPwPIj7B44sR/Mgny8yi+p4H0m50KtXDCuDOQ3KIoDls IVFyam6HSIjFQ+7uq2TMom4GMYKbDp7F0hOaWZDzKRapcNQzksqdooo9qqT93YTZ wHam0dgRv7YACdqvWsG33buVPKyJG0M= 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=7t+uBdYbcH4Yvl6mo6R7kQ9TV8RkUHCWZZOnmcVqU O8=; b=kQUAagDxU9axM5tifAUU/1hKQiNEDrCa6dHuESCsrQGaqlA/w/rqm9fjb 7I/jUf7CDe78j7WZJ2sTxA/mpsvJtpARmoVM7qA7PPIT1Ay8bv4mOGpFPPCmkptV sZg7a7l0ctgE+hZ1bl97/HiNcrQXcxcCqZ3kliuoGbawyoiHvRDRgA60a7dnhjXR ireif7WkovjUIUqtCkXQGgNcL5cQHJwiCXsCo3iJEuQuCl8cgIVmk0D3HEM/rQVS NDL41EV07gdqTdZDFPfvLFpHcFkzN2IzgViaU2QLoclx51UTZQ7DAdoEFWGdngbR Y/0dDvYdIVbnfPj98EjD+X67Q8orw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrleejgdduvddtucetufdoteggodetrfdotf 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 B082E80062; Wed, 15 May 2019 03:27:24 -0400 (EDT) From: Thomas Monjalon To: Nithin Dabilpuram Cc: dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , ndabilpuram@marvell.com Date: Wed, 15 May 2019 09:27:22 +0200 Message-ID: <1750613.yctpDDeXOX@xps> In-Reply-To: <20190515065209.GA25995@gmail.com> References: <20190513112112.7069-1-ndabilpuram@marvell.com> <1973719.Au6Grg4Sd1@xps> <20190515065209.GA25995@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: , X-List-Received-Date: Wed, 15 May 2019 07:27:28 -0000 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. 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 5A16EA00E6 for ; Wed, 15 May 2019 09:27:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 373BB34F0; Wed, 15 May 2019 09:27:29 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id C46A82C17 for ; Wed, 15 May 2019 09:27:27 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 29F27260B8; Wed, 15 May 2019 03:27:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 15 May 2019 03:27:26 -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=7t+uBdYbcH4Yvl6mo6R7kQ9TV8RkUHCWZZOnmcVqUO8=; b=WQOG3dT41XfU jjvdVIaZ6Afs4EMc1p5DmPwPIj7B44sR/Mgny8yi+p4H0m50KtXDCuDOQ3KIoDls IVFyam6HSIjFQ+7uq2TMom4GMYKbDp7F0hOaWZDzKRapcNQzksqdooo9qqT93YTZ wHam0dgRv7YACdqvWsG33buVPKyJG0M= 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=7t+uBdYbcH4Yvl6mo6R7kQ9TV8RkUHCWZZOnmcVqU O8=; b=kQUAagDxU9axM5tifAUU/1hKQiNEDrCa6dHuESCsrQGaqlA/w/rqm9fjb 7I/jUf7CDe78j7WZJ2sTxA/mpsvJtpARmoVM7qA7PPIT1Ay8bv4mOGpFPPCmkptV sZg7a7l0ctgE+hZ1bl97/HiNcrQXcxcCqZ3kliuoGbawyoiHvRDRgA60a7dnhjXR ireif7WkovjUIUqtCkXQGgNcL5cQHJwiCXsCo3iJEuQuCl8cgIVmk0D3HEM/rQVS NDL41EV07gdqTdZDFPfvLFpHcFkzN2IzgViaU2QLoclx51UTZQ7DAdoEFWGdngbR Y/0dDvYdIVbnfPj98EjD+X67Q8orw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrleejgdduvddtucetufdoteggodetrfdotf 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 B082E80062; Wed, 15 May 2019 03:27:24 -0400 (EDT) From: Thomas Monjalon To: Nithin Dabilpuram Cc: dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , ndabilpuram@marvell.com Date: Wed, 15 May 2019 09:27:22 +0200 Message-ID: <1750613.yctpDDeXOX@xps> In-Reply-To: <20190515065209.GA25995@gmail.com> References: <20190513112112.7069-1-ndabilpuram@marvell.com> <1973719.Au6Grg4Sd1@xps> <20190515065209.GA25995@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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" Message-ID: <20190515072722.GossJ24JXtZrz8DRr2BJGGaqTVeLiEq3kFGYl9C65XI@z> 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.