From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D654C04AA7 for ; Wed, 15 May 2019 06:52:20 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 0D56F2084F for ; Wed, 15 May 2019 06:52:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XS0BXgMF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D56F2084F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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=us-ascii 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" 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. > >