From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id A06C31E2F3 for ; Thu, 14 Jun 2018 13:35:58 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id z6-v6so2801936wma.0 for ; Thu, 14 Jun 2018 04:35:58 -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=XbQf3PNI/m8AR3E6XNMVW7odPy0d3izWMuWcgKQ37cY=; b=exqC+RC4x6Gvv0MRISFKqm7Kx6LKMolTlEC9+8MLotb7I+y6+OEoIlcwBepTjejoi2 iYQuaMjD4cUQ7nu3oFS85nP7AJcr8CY3KgfiVTWqcUq8dpMrQi+5wqkhCPA7MO3pCdPD ID8xQpIS6I7MDnZO0LobMmCgryp12WAuai+7BEm8vbBhLxVfHNh/K20jficQ7RCsaznX pelaz5lyPxVH88DQ4deSAXdz+p7WVpTBuZxS/rI4yoCpo2omGDQMRGkEQ7xiMIhug3GV lTjvwTQhozhpvcPWIiAVgEowBwnIcmE2IpN2LkV2v6qzIZdwJTGnCgoel0s5wu42W8iB uM5g== 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=XbQf3PNI/m8AR3E6XNMVW7odPy0d3izWMuWcgKQ37cY=; b=Hhvp+0itV+vQ7XldG1/qHDMXCmagZbjdAHZXuA3cAPa+5MNsz5p6cDeYqZCybK2Z6/ tX1F1icx2RxMCxgyyxbN3Bh8HlduK4aY1zZE/V6EN1sQiqssVVYb/xBGnylQE0V5nqA9 8YFiAWk2STDqDPHD6u/pBW7/A58nlf+1cfg9wXSuDtdACViOIjrkW9eh1Ko3CTQN0h4N uD8s/nv3Y51LGdn+g89oQjtTKF1oVNR9xR65tf9r0YRP6gRwQkmV4FdGgY9dRJ1xQ5Ws RCMazlAfwN7y/LtDyp6/dRUxG4bgT0Z0alG1tIamC6AhOoZ9WBMXwbG5r73fPqI/0lDh 28cQ== X-Gm-Message-State: APt69E3zXDYiUqzqBj7PjDBZW1Lglp6/dYRudejA62e7hK3XdBgAXZkx /qvOEH8rl6xwEn4W++ybqeMk2Q== X-Google-Smtp-Source: ADUXVKJrZ416c848JXpdhRWQvNIs98bjNTjF+bNHzhpsOquDFjkc1M4yf5DxDYh0ZQrjsjT/wVQ9bA== X-Received: by 2002:a1c:64c5:: with SMTP id y188-v6mr1537972wmb.45.1528976158164; Thu, 14 Jun 2018 04:35:58 -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 u11-v6sm5670440wrq.68.2018.06.14.04.35.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Jun 2018 04:35:57 -0700 (PDT) Date: Thu, 14 Jun 2018 13:35:41 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: "Iremonger, Bernard" Cc: "dev@dpdk.org" Message-ID: <20180614113541.rxu33jti7fs6xlet@bidouze.vm.6wind.com> References: <1d3660a04c3c1eb1157b78abc45d97d5cfed01fe.1523804657.git.gaetan.rivet@6wind.com> <8CEF83825BEC744B83065625E567D7C260CB3577@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: <8CEF83825BEC744B83065625E567D7C260CB3577@IRSMSX108.ger.corp.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v7 22/22] 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, 14 Jun 2018 11:35:58 -0000 Hi Bernard, On Thu, Jun 14, 2018 at 10:59:09AM +0000, Iremonger, Bernard wrote: > Hi Gaetan, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet > > Sent: Sunday, April 15, 2018 4:08 PM > > To: dev@dpdk.org > > Cc: Gaetan Rivet > > Subject: [dpdk-dev] [PATCH v7 22/22] 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 | 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 " > > + "", > > .help_str should be on one line to avoid checkpatch warning. > Thanks, will fix. > > + .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 > > This patch fails to compile on dpdk_18.08.rc0 > I have rebased the series in 18.08-rc0, I will send it as a v8. > There should probably be an update to the testpmd documentation also in doc/guides/testpmd_app_ug/*.rst I will look into it. Regards, -- Gaëtan Rivet 6WIND