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 A6CEEA0465 for ; Wed, 29 May 2019 10:16:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1F07AA49; Wed, 29 May 2019 10:16:28 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 9084D4CA6 for ; Wed, 29 May 2019 10:16:26 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id d126so1137749pfd.2 for ; Wed, 29 May 2019 01:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+vDiwbZONERUpokNAGexNqwoIEv/hMONh8ce+7cem58=; b=liLHaL/DNtYSbJVOR6YVZ7GoaSJbyolu6D+3ailunsSekillU4kUm4rqU31O4YeDCK 5xFxZi+y0ITqpOIOE6JpkB4uZIDFG++LkC2lSSwkqNTvbi/g5g8YGv2tTJZwwdjD3LE1 iORkQ3PYLnnhS12bJ29Zq/1nH7ggngo9HIhET6Kql74rFna9+3h5BwQ2P32GdWREvAW1 b2y6hBjEkyul4SeQGBB4SGuyFYEBY+sIifGIwjC/dBGHee5KK3+4kcT/BqMB0Gjm/ZKa 3q+XYMVT7qgng7oMo8rDPseQct3nYTnTR7Xhi+xoGd/bFX4By/g6K2PhAyY8U3D2h8hA QxIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+vDiwbZONERUpokNAGexNqwoIEv/hMONh8ce+7cem58=; b=du8lj7QZLJX99P7Mk+hdGtsqTxhsIfHchcyhE37YRtT42L5uHWEZLhjr9LJF31nxXj G6VPNoc9uOXrMFzDlhB1XHqwuEBWt+p4HKaRBjM15S1Y/LP7z2nSLW1+jsgK7RUbpEE0 hU+Q4ARqAjlnjme+0Tt9BPW2YFN+2b9ugvmK7gWJuGKPsCyAAbRswmv6D5XpzS/UOmhr PtCCbkN9sUhPmPS3i9mMnH/Zbx9z/jBBK7evzf2e1v8xlLlwDh3f+62yHDm5wVjywmOx iD/92ofY45i7izJFtv2VF9z3ws4FEAmrhWUWhoG/oeIYi/rx5QSRftfRtfPYA1wywAM/ o1qA== X-Gm-Message-State: APjAAAU1WlVbCXT4+3lGAFeEyfD4te2PKAPlqysqDm75tyRYGkvPuxWK +Sq6bQMKw96fHDrQN0peM7M= X-Google-Smtp-Source: APXvYqxNMayn2kiWAjPgfIzkXo2jrZyxJemgzqSvHuQciRmf65pXHTbbCbRLL0F7ijmUWBG7Gc3YpQ== X-Received: by 2002:a65:6559:: with SMTP id a25mr36086536pgw.33.1559117785818; Wed, 29 May 2019 01:16:25 -0700 (PDT) Received: from gmail.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id m72sm15045922pjb.7.2019.05.29.01.16.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 01:16:24 -0700 (PDT) Date: Wed, 29 May 2019 13:46:20 +0530 From: Nithin Dabilpuram To: Thomas Monjalon Cc: dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , ndabilpuram@marvell.com, jerinj@marvell.com Message-ID: <20190529081620.GA5044@gmail.com> References: <20190513112112.7069-1-ndabilpuram@marvell.com> <1750613.yctpDDeXOX@xps> <20190517085547.GA26094@gmail.com> <3849744.ELThORf4eq@xps> <20190520125053.GA1399@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190520125053.GA1399@gmail.com> User-Agent: Mutt/1.10.0 (2018-05-17) 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" Hi Thomas, On Mon, May 20, 2019 at 06:20:53PM +0530, Nithin Dabilpuram wrote: > On Fri, May 17, 2019 at 10:59:38AM +0200, Thomas Monjalon wrote: > > 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 > So can I send next revision with command renamed to "detach " ? Any info on this ? I can even add it as another cmd without disturbing existing command if needed. > > > > > 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? > > It is already caught in local_dev_remove() and > rte_dev_remove() fails. Only problem as I said below is > in testpmd if first call to detach_port_device() i.e handler of "port detach", > rte_dev_remove() returns -EAGAIN and PMD cleaned up the resources partially like eth_dev > resources, the second time call cannot work port_id will not be valid anymore. > > > > >