From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 8EE3A5F18 for ; Mon, 19 Mar 2018 12:33:49 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id d10so18239676wrf.3 for ; Mon, 19 Mar 2018 04:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=oxUK3TbtLlxzznRC0yrQBBCXCux1LkkS25bMnRh6HSw=; b=RndUaU5GxyyQjTHJLkWlo03d73spP7pYrSMKN3CAVxCz3AgkRzOAflmb+oaQafArlD xaldVxAtfUZOCXH1SrcrFyEu/fixY8kPi/+YvZtxVxRPe6Sa7iwe9DBJyOFEiJoUnOoM YJcrfSaGU9AiJLqqMPeUAagXwR8dajLS5ufN6ghJ1c+WG0xz3P7fEj7dk4iye2MlXp+L ZC/02L77NxeXQkMOVzTYWKHQyI6/SiXhcdYQ7rSB8fvXg/9MJkB1sNXWDY9uojjpG8k7 2ftcA53xatxRqaeygSeuxPvwyxTSefDTfRkwydI4/zPyeU/U9xTcTsCQa8ncb5Y/Y4hW piVw== 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:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=oxUK3TbtLlxzznRC0yrQBBCXCux1LkkS25bMnRh6HSw=; b=XYB9jdpWYN8ISAvhrKOLyFEmCIpaTGilchYOEpRpXIUAx+TiQBzy4oiiBxPwqoCCKi WiAgV1VhQO8mU3p7flUGEhC25AeLgcWFclh9Iwq+VqEclr8rciUkitNZ5Q/RXoEOERiw w8JzsBJm+O1LpFgB3GlTh+Gzgdj2GHe0Mw5N1uOal4GfWTJEDGS/srJRACsmmyi887m5 orHvTl0CrtlgJdim0KUK4zG2pEoo0xd5b0iKKdt1ddNGnaOYhAxsgqPf6qZTEdaJyiSP Yk3lU8Z/K/+fmb/BWC2e9jqxo/d92fRWR2ndccp9ko8ZHQTFyY+iz4V2Apda3txZxDKh eIzQ== X-Gm-Message-State: AElRT7H3IAdDYPKSn11dkzv+76HEsY/6QiKpufmMSxKAKIIufBLX1vAp /hu9DpqHPdNO6B4zhE6dfmgLdThR X-Google-Smtp-Source: AG47ELuv4jJPoivUzz1LNrhB66FiMRTlFPuHl2LhUJGr91xEA9N2tiVucUKcmJ/Lagc9gnQ7bOTZYg== X-Received: by 10.223.197.1 with SMTP id q1mr8654960wrf.268.1521459228558; Mon, 19 Mar 2018 04:33:48 -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 y145sm130200wmd.43.2018.03.19.04.33.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 04:33:47 -0700 (PDT) Date: Mon, 19 Mar 2018 12:33:33 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: dev@dpdk.org Message-ID: <20180319113333.d7a3fob56pay6is7@bidouze.vm.6wind.com> References: <5dc4c501bf56cfc5645acdd2e195afff2139daec.1521124599.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5dc4c501bf56cfc5645acdd2e195afff2139daec.1521124599.git.gaetan.rivet@6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v1 18/18] 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: Mon, 19 Mar 2018 11:33:49 -0000 On Thu, Mar 15, 2018 at 06:49:48PM +0100, Gaetan Rivet wrote: > 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,class=eth,name=net_ring0 Silly mistake, it should read instead: show device bus=pci show device bus=vdev show device bus=vdev/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 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 52 insertions(+) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 40b31ad7e..8ac5fb3ca 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -6701,6 +6701,57 @@ 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; > @@ -16038,6 +16089,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, > -- > 2.11.0 > -- Gaëtan Rivet 6WIND