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 326CDA046B for ; Tue, 25 Jun 2019 06:24:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A26FE1BC01; Tue, 25 Jun 2019 06:24:20 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id C69D01BBFD for ; Tue, 25 Jun 2019 06:24:18 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id k13so2082201pgq.9 for ; Mon, 24 Jun 2019 21:24:18 -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=lOHH6zl2D4NH1Hw7wsDa+cBF0zIAgy6AesjlZPkbLMM=; b=Bb6D2y1oM47qpQqIsAWqtzIYiJks9SEHJYqhamHln2Pq4tIHGOO/C4rsJhAukgO8ni tudK/mVpv1796q4RaAJuONa6062ik9ctoWBAAtqP4GWnoQpoN2JW8v0ErC19/rhUwjD9 gxKY3PbQpGUbalVnirExyLPWyP6Cze/WA1MmaQQvt2FYGDHc3cH812REEhYJy1pwOvea sIpETGRrxVFRmjD/XAA9f0jAtR6Sq4Xxv6cyH+0jN+cIXxfzSTgdufmeUGBxOnDu07Fn jbJTM4FPqjPbMcKWkqMfpz+tSTWnBdeEs0SSMkj6JJQfUw+7ACY2brPE2Q8D6KXXtIM4 s+Pw== 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=lOHH6zl2D4NH1Hw7wsDa+cBF0zIAgy6AesjlZPkbLMM=; b=j7bmH3uPJfbM1VkeeYRMOSLn9ZgAl9fzIDix1nq1udq1zNfz4njUmBpqwrWurSTBg3 qoFKSQSxezzPuwDf7uAIKy7EqmMlgVC60fk5yEJqZDSyo2G1MVD30FZKaeRuaAz1xgt7 X8vnzUO7QqJ6JWCo4RR3dXwz9oAnqa965FNSN+oiW/3UOlmwHeM1jmL860jWrQcn3bW3 Lc6tCGj9Zi6hADic7OV2KzT1jeXA42/TWZezWfVNse1TaQqlHwa9b+4Q/ww2PR7ZHkK7 ERKeDnG7JelKjeD48Ki43DJMrt7oft/1PF5XAE2obX1qL77m9gcOXwO3H8j5+XvhigBh Lx4Q== X-Gm-Message-State: APjAAAUbWf3019F1lfMXA8WLEFSsSCWjsDGS/L6EivBSv5vzZHnV5Ntv LhyO+VHhDXZRs6WbSBYkyjg= X-Google-Smtp-Source: APXvYqx8rleDEJItBC4zMICQOWCgk3E2zqRJb84YvoHcyZLtksvBPxoA3scyi0/afzq/kiZlEnoEuQ== X-Received: by 2002:a17:90a:fa07:: with SMTP id cm7mr28333660pjb.138.1561436657842; Mon, 24 Jun 2019 21:24:17 -0700 (PDT) Received: from gmail.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id x128sm21507081pfd.17.2019.06.24.21.24.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 21:24:17 -0700 (PDT) Date: Tue, 25 Jun 2019 09:54:12 +0530 From: Nithin Dabilpuram To: Thomas Monjalon Cc: dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , jerinj@marvell.com Message-ID: <20190625042412.GA9172@gmail.com> References: <20190513112112.7069-1-ndabilpuram@marvell.com> <1750613.yctpDDeXOX@xps> <20190517085547.GA26094@gmail.com> <3849744.ELThORf4eq@xps> <20190520125053.GA1399@gmail.com> <20190529081620.GA5044@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190529081620.GA5044@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, A reminder about this patch. On Wed, May 29, 2019 at 01:46:20PM +0530, Nithin Dabilpuram wrote: > 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. > > > > > > > >