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 20C4EA00E6 for ; Wed, 15 May 2019 08:52:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE5762BBD; Wed, 15 May 2019 08:52:18 +0200 (CEST) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by dpdk.org (Postfix) with ESMTP id 8D7181D7 for ; Wed, 15 May 2019 08:52:16 +0200 (CEST) Received: by mail-pg1-f171.google.com with SMTP id h17so873839pgv.0 for ; Tue, 14 May 2019 23:52:16 -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=Enud+pN9Qv9bloi28vyQwuJW2RfjfOwRfNSG/4nqtWo=; b=XS0BXgMFuuix5vaQHDhupNOWG+HEijWijKZoNtdPrRF1QXUbFbd7EuU5n/kIqq2FQ9 tpl9HgPzBfVlc3gdAgf1SoybXJXec1hN80gl8HCNihYck6A3Tp/Ukpd1yQ8Y8vn6xyIW sE9ib8yf67r7Wf9dbXe+98UK1FkL1AJ522r7arNfCremDAceOIzppvBgQwXTS4p6lhSq VFlTDIEbvlucn7lZcgfCFI6mi7rc8HM/ceszeEcfpFdm3trAKBPglQVQ/RK9nEdbhTYB RAT5lDrLh2EJkBiZ9UcddkF3824Ki7My9zqoUZMemzqmzUDER99Ld8kkmlEXtNhfAFLK CStw== 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=Enud+pN9Qv9bloi28vyQwuJW2RfjfOwRfNSG/4nqtWo=; b=Ou3xQK3NPgu/9EYbEFMlofB/XXDfSaCa/dLmI6Nqz5XEK5NWcy+8g1AMxC6iP9wkvw tGZyPTqDM1FlUBuRAOa/dTh62x1MVanAjZWEnNaJRYhErjDOenlix8ZYbaSdZNeO5tvk 0w0rXq0znvCozQMZDTXhnwPcS3CFtKl8E7f1RmfhJI7AJui/u/TGF6jzzVAX/+HQlDxb SPJ07v2u1e5Cx/GnmkoELqcbdsbcz/OEiEaSU1kckew7pF9jNeco11LYWT4+RKrk2Ymf 8nznNWELLY/Wqhokquafaju/4vFe/UfPOiRHqiHrPx2CAyuBurhnuQakx1ci+hQ4Nsr8 ajQg== X-Gm-Message-State: APjAAAXksNxqnqOogWro500o9MQTDr/p9rWWY95tLEhAwcWw7ixDrI81 D9vifbtkXxC31mPrMeK89CA= X-Google-Smtp-Source: APXvYqwrvTiLcPId99MmaPE5RSvyI5ry7w/mi4DJR6FdqF39XqRjGyVmJIxHZjqm17MFQwVeUWLk6w== X-Received: by 2002:a63:5720:: with SMTP id l32mr43775276pgb.438.1557903135145; Tue, 14 May 2019 23:52:15 -0700 (PDT) Received: from gmail.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id 132sm1506116pga.79.2019.05.14.23.52.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 23:52:13 -0700 (PDT) Date: Wed, 15 May 2019 12:22:09 +0530 From: Nithin Dabilpuram To: Thomas Monjalon Cc: dev@dpdk.org, Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , ndabilpuram@marvell.com Message-ID: <20190515065209.GA25995@gmail.com> References: <20190513112112.7069-1-ndabilpuram@marvell.com> <1973719.Au6Grg4Sd1@xps> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <1973719.Au6Grg4Sd1@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" Message-ID: <20190515065209.kRkIM0p-bKs1jW2tMAHEshx5SeO65Nck6zdC_QS8tOo@z> 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 ? > > > 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 " ? > > PS: Please remind that a device can have multiple ports. > >