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 A23E4A00E6 for ; Fri, 17 May 2019 10:55:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DA4E9568A; Fri, 17 May 2019 10:55:54 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 425812BCE for ; Fri, 17 May 2019 10:55:53 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id z3so2993099pgp.8 for ; Fri, 17 May 2019 01:55:53 -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=tbWeqE44P22JN2IrTD10Zjg9VKMDJ4vVB3FGlVsJmDI=; b=liNZQRSbkwkSDKo3rnTkbnUyyTSr1PuolSaZE4rY1Uuyzwy1m4lyPY8zFk7+qNnJfN 0x2Xj5B5m3xBlMc+7XhBGEPRCGbN+vPkaCbRpMz/Ab0rZFQmoQYjI5mupIT1jIXPpl7S BTa6ahHy7tm0ODjPi7rppCgDJEVtrIUZHy6fGQ4Z2mTW0ddzBHdcK2wwDMop+WR2vFHY 3mowg5OPh8BZ8ZjV3E44YhKzkI/jsb4dFPh/cRgYI6x+8ycFZHS+nf2+0CA2af0YMb29 X60mA3VgsHELjuqlC/lFZDqFD4luRWaITe7BdKDQG1H0YG0q81Z2hCeWewTeMWti1pbq LuYA== 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=tbWeqE44P22JN2IrTD10Zjg9VKMDJ4vVB3FGlVsJmDI=; b=F+LZldL98JLi/1VIZlMoZPPFedxQFCzZPAJF+1YBbKw0XHm2xtnIg1YMdnBC+2gKqJ 32e7tY8C5xSuV+9dtt2I3ySwAqxFMSt0x3zEvZpP5OSS9Pb6o50NYvGWVRr6g4Fo8Jun m+BN403wQ+eHxk8CK2MXpih7rkIOCCv2YpZmIKBrWVI8mJ/fmz5wUrJD5IcoD0ZAsKxs jLRq1xPeIi1I5iKfSMgw/yoUIybOmr4YaycUBh0zbvyt6d382pjCKBy5Abkc5jvCTelm Ea1my1+FBh2k0MSzdiUvI/kzmTmnEa6Y8SZ2k25XM/YM0v9soEhqLU8nnFQ+teBJzvk2 U9bw== X-Gm-Message-State: APjAAAVNTV4xWMvpw9VoSWPHJ/DMNUh0DkXs5zaHQ3UYVEjsFCto/OxA akx0oDcG0IEFSNbfgkeRsa8= X-Google-Smtp-Source: APXvYqziKOvJjbH3XfgOX9lRK1kXdMrtkOTF0DCYDj5nxhJDfqqPlXLrJ32Cd5RifKfolgmzXiRyfA== X-Received: by 2002:a62:7995:: with SMTP id u143mr59292196pfc.61.1558083352440; Fri, 17 May 2019 01:55:52 -0700 (PDT) Received: from gmail.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id o20sm9781512pgj.70.2019.05.17.01.55.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 01:55:51 -0700 (PDT) Date: Fri, 17 May 2019 14:25:47 +0530 From: Nithin Dabilpuram To: Thomas Monjalon Cc: dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Message-ID: <20190517085547.GA26094@gmail.com> References: <20190513112112.7069-1-ndabilpuram@marvell.com> <1973719.Au6Grg4Sd1@xps> <20190515065209.GA25995@gmail.com> <1750613.yctpDDeXOX@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1750613.yctpDDeXOX@xps> 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" 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. 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. >