From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 4BFFB5592 for ; Thu, 28 Jun 2018 13:28:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 04:28:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,283,1526367600"; d="scan'208";a="51192927" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga008.fm.intel.com with ESMTP; 28 Jun 2018 04:28:54 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by IRSMSX152.ger.corp.intel.com ([163.33.192.66]) with mapi id 14.03.0319.002; Thu, 28 Jun 2018 12:28:54 +0100 From: "Iremonger, Bernard" To: =?iso-8859-1?Q?Ga=EBtan_Rivet?= CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v8 21/21] app/testpmd: add show device command Thread-Index: AQHUDW9VsKboGTqfzE6E+9BB3JsyLKR1b8SQ///05ACAACVxsA== Date: Thu, 28 Jun 2018 11:28:53 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260CBA25D@IRSMSX108.ger.corp.intel.com> References: <8CEF83825BEC744B83065625E567D7C260CBA14A@IRSMSX108.ger.corp.intel.com> <20180628100948.uolikqtvzo3wxjka@bidouze.vm.6wind.com> In-Reply-To: <20180628100948.uolikqtvzo3wxjka@bidouze.vm.6wind.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzIyZjhhNDUtMDNjZi00NmMzLWI5MzctNjI2NzU0YWI3MGY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWkhwMTBUU3NkVXVOaGowcFYyRUlkRDJnbkluclhwUDNuU0N0eFNrS3pEU2dUaE5GV3g4R3VPNDFcLzk4elVCY3YifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 11:28:57 -0000 Hi Gaetan, > -----Original Message----- > From: Ga=EBtan Rivet [mailto:gaetan.rivet@6wind.com] > Sent: Thursday, June 28, 2018 11:10 AM > To: Iremonger, Bernard > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v8 21/21] app/testpmd: add show device > command >=20 > Hi Bernard, >=20 > 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=3Dpci > > > show device bus=3Dvdev > > > show device bus=3Dvdev/class=3Deth > > > show device bus=3Dvdev,driver=3Dnet_ring/class=3Deth > > > show device bus=3Dvdev/class=3Deth,name=3Dnet_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 =3D { > > > }, > > > }; > > > > > > +/* *** 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 =3D 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 =3D 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 =3D > > > + TOKEN_STRING_INITIALIZER(struct cmd_showdevice_result, > > > + show, "show"); > > > +cmdline_parse_token_string_t cmd_showdevice_device =3D > > > + TOKEN_STRING_INITIALIZER(struct cmd_showdevice_result, > > > + device, "device"); > > > +cmdline_parse_token_string_t cmd_showdevice_filter =3D > > > + TOKEN_STRING_INITIALIZER(struct cmd_showdevice_result, > > > + filter, NULL); > > > + > > > +cmdline_parse_inst_t cmd_showdevice =3D { > > > + .f =3D cmd_showdevice_parsed, > > > + .data =3D NULL, > > > + .help_str =3D "show device ", > > > + .tokens =3D { > > > + (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[] =3D { > > > (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=3Dlayer_name[,key1=3Dvalue1[,...]] > > > + > > > + 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. > > >=20 > I had it rebased a few days ago, it was fine. It seems there has been som= e > movement lately, will rebase again. >=20 > > There is no update to the internal testpmd documentation about this new > command. > > >=20 > There is some documentation added to > doc/guides/testpmd_app_ug/testpmd_funcs.rst >=20 > Are you referring to some other kind of documentation? >=20 > -- > Ga=EBtan Rivet > 6WIND There should be an update to the testpmd "help" command. See line 122 to 1133 in cmdline .c Regards, Bernard