From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 5A16EA00E6
	for <public@inbox.dpdk.org>; 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 <dev@dpdk.org>; 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: <xms:Xb_bXE9h5_6Uydh60CROy00VOGuPVXa2CJECf87e0yILy6Z8DldaQw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrleejgdduvddtucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf
 hppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhh
 ohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:Xb_bXBT8QIPxpuLh8w12F9Gk-8Ounu8msBR54Ex8_N6aI4Nrdb4UAQ>
 <xmx:Xb_bXHLMdUBITnI28oapqTzmRY-iy7x9LWAXX3l8dC1YLeXxtWFd5g>
 <xmx:Xb_bXLQJqt_AlXoQfU0znbKqZJMEezrOrFV_Ciy0RVvYMsF5itjAsQ>
 <xmx:Xr_bXH50KazWD3s6AmJpZfxy_LfCNufjPxyGTQB_ocPWoX8ISnfJ_g>
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 <thomas@monjalon.net>
To: Nithin Dabilpuram <nithind1988@gmail.com>
Cc: dev@dpdk.org, Wenzhuo Lu <wenzhuo.lu@intel.com>,
 Jingjing Wu <jingjing.wu@intel.com>,
 Bernard Iremonger <bernard.iremonger@intel.com>, 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
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 <identifier>" ?

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.