From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id EF1EC7EC7 for ; Thu, 28 Jun 2018 12:10:07 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id b8-v6so4894575wro.6 for ; Thu, 28 Jun 2018 03:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=rMf6TLHSs5AR3RwPiGSgXUNFaRrD9RInRtc337Wjkbc=; b=LnFhfxchv9W6ewWp9XkPTI+Q3DDmS5XGsQZn6X5hJCMWKGo3TQ2WN05aqqyUrQRPiS IFwIABPoYVvqCWaaTK2jHZeOJYkyOTZ4JNfmWNPwhU68JB/kTkhxlOQVZy6Q6QXba3Ih 3ebkAiHfFV/ZKTi2/f5Q9uZMBwJbIag91p27OXZdurBwOjskFZ9hQJeoTLsbuYyK2ICC 1Nl1xs0sc12CdDdRSXbyqecl92vcSWiQvjLqHC6JCaVlzkpy8VvMbABg2Vo2a7nm5Fdy /72gSf8JkMQ+Dl+aLPXIxMGh5salM0kuYFJ+hoklwmFDEFKYUeodGdvG9GIYuA0LCxu1 PFyA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=rMf6TLHSs5AR3RwPiGSgXUNFaRrD9RInRtc337Wjkbc=; b=np6+bVfPRkKgPbi84SRWUIx/MbHLwuQwleyC4+sf0k+O6OsrL4C/dIlHGQtTyYKq0b yntBpiZwU3iRQEg9QqsCIakdYVMSDRDBfiZEBatfgITXpgdV6JIn9D9oWIb1LpvuosfE 1pV62QE9loa79CPAPYUTVc1MMH1oTFwZYiuD6WxTEQPmSYvksFaqHLB+8x59gwo/GpLe GItPajhfxUdblVXmc8bl8TFcndqCxe4e0GOE1zJbGk+BRklmjN/qZ12rLvs0NLQjvCNn VJX2wQ+Uthgz+MXUdi/QbqNTbuxT3ZK/+sOGH0cksus0a9nXjGPpUcOhMNwUu9GatrJW D/DA== X-Gm-Message-State: APt69E0MiG9UQd1/mzA/8CKArJlqNI7fwhVgofiMh2EHuJdsqG/57pr+ h41VEHoQ+REQ0Pjko1pVAi+E8w== X-Google-Smtp-Source: AAOMgpfhLErg6fhyU+lCJmXIIKcoyFNaxMwevSjL1Gj4E9/dOK26DbDbSHKUE/NJi49v32bTWtO7yA== X-Received: by 2002:adf:8acd:: with SMTP id z13-v6mr8023973wrz.22.1530180606642; Thu, 28 Jun 2018 03:10:06 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id o1-v6sm7342787wrm.41.2018.06.28.03.10.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Jun 2018 03:10:05 -0700 (PDT) Date: Thu, 28 Jun 2018 12:09:48 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: "Iremonger, Bernard" Cc: "dev@dpdk.org" Message-ID: <20180628100948.uolikqtvzo3wxjka@bidouze.vm.6wind.com> References: <8CEF83825BEC744B83065625E567D7C260CBA14A@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8CEF83825BEC744B83065625E567D7C260CBA14A@IRSMSX108.ger.corp.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v8 21/21] app/testpmd: add show device command 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: , X-List-Received-Date: Thu, 28 Jun 2018 10:10:08 -0000 Hi Bernard, On Thu, Jun 28, 2018 at 10:03:30AM +0000, Iremonger, Bernard wrote: > Hi Gaetan, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet > > Sent: Tuesday, June 26, 2018 5:56 PM > > To: dev@dpdk.org > > Cc: Gaetan Rivet > > Subject: [dpdk-dev] [PATCH v8 21/21] app/testpmd: add show device > > command > > > > A new interactive command is offered: > > > > show device > > > > This commands lists all rte_device element matching the device description. > > e.g.: > > > > show device bus=pci > > show device bus=vdev > > show device bus=vdev/class=eth > > show device bus=vdev,driver=net_ring/class=eth > > show device bus=vdev/class=eth,name=net_ring0 > > > > These devices may not be otherwise useful, some buses will spawn devices > > to keep track of their assets without having a driver to use them. > > > > Signed-off-by: Gaetan Rivet > > --- > > app/test-pmd/cmdline.c | 51 > > +++++++++++++++++++++++++++++ > > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 24 ++++++++++++++ > > 2 files changed, 75 insertions(+) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > 27e2aa8c8..872492b88 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -7083,6 +7083,56 @@ cmdline_parse_inst_t cmd_showportall = { > > }, > > }; > > > > +/* *** SHOW DEVICE INFO *** */ > > +struct cmd_showdevice_result { > > + cmdline_fixed_string_t show; > > + cmdline_fixed_string_t device; > > + cmdline_fixed_string_t filter; > > +}; > > + > > +static void > > +cmd_showdevice_dump_device(const struct rte_device *dev) { > > + const struct rte_driver *drv = dev->driver; > > + > > + printf("0x%p: %s:%s\n", (const void *)dev, dev->name, > > + drv ? drv->name : ""); > > +} > > + > > +static void cmd_showdevice_parsed(void *parsed_result, > > + __attribute__((unused)) struct cmdline *cl, > > + __attribute__((unused)) void *data) { > > + struct cmd_showdevice_result *res = parsed_result; > > + struct rte_dev_iterator it; > > + const struct rte_device *dev; > > + > > + RTE_DEV_FOREACH(dev, res->filter, &it) > > + cmd_showdevice_dump_device(dev); > > +} > > + > > +cmdline_parse_token_string_t cmd_showdevice_show = > > + TOKEN_STRING_INITIALIZER(struct cmd_showdevice_result, > > + show, "show"); > > +cmdline_parse_token_string_t cmd_showdevice_device = > > + TOKEN_STRING_INITIALIZER(struct cmd_showdevice_result, > > + device, "device"); > > +cmdline_parse_token_string_t cmd_showdevice_filter = > > + TOKEN_STRING_INITIALIZER(struct cmd_showdevice_result, > > + filter, NULL); > > + > > +cmdline_parse_inst_t cmd_showdevice = { > > + .f = cmd_showdevice_parsed, > > + .data = NULL, > > + .help_str = "show device ", > > + .tokens = { > > + (void *)&cmd_showdevice_show, > > + (void *)&cmd_showdevice_device, > > + (void *)&cmd_showdevice_filter, > > + NULL, > > + }, > > +}; > > + > > /* *** SHOW PORT INFO *** */ > > struct cmd_showport_result { > > cmdline_fixed_string_t show; > > @@ -17262,6 +17312,7 @@ cmdline_parse_ctx_t main_ctx[] = { > > (cmdline_parse_inst_t *)&cmd_help_long, > > (cmdline_parse_inst_t *)&cmd_quit, > > (cmdline_parse_inst_t *)&cmd_load_from_file, > > + (cmdline_parse_inst_t *)&cmd_showdevice, > > (cmdline_parse_inst_t *)&cmd_showport, > > (cmdline_parse_inst_t *)&cmd_showqueue, > > (cmdline_parse_inst_t *)&cmd_showportall, diff --git > > a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > index 0d6fd50ca..4f1009a3a 100644 > > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > > @@ -2628,6 +2628,30 @@ set the traffic management default hierarchy on > > the port:: > > > > testpmd> set port tm hierarchy default (port_id) > > > > +Device functions > > +---------------- > > + > > +Show devices > > +~~~~~~~~~~~~ > > + > > +Display any registered devices:: > > + > > + testpmd> show device > > + > > +where: > > + > > +* ``device_string``: Device description string, of the format > > + > > + layer[/layer[/layer]] > > + > > + where one layer is in the form > > + > > + layer_key=layer_name[,key1=value1[,...]] > > + > > + Valid layer keys are ``bus`` and ``class``. > > + Their respective values is defined by registered ``bus`` and > > + ``class`` drivers. > > + > > Filter Functions > > ---------------- > > > > -- > > 2.11.0 > > This patch fails to compile on the latest 18_08 master branch. > I had it rebased a few days ago, it was fine. It seems there has been some movement lately, will rebase again. > There is no update to the internal testpmd documentation about this new command. > There is some documentation added to doc/guides/testpmd_app_ug/testpmd_funcs.rst Are you referring to some other kind of documentation? -- Gaëtan Rivet 6WIND