From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 550DBA0548; Fri, 27 Aug 2021 11:20:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BEF1406B4; Fri, 27 Aug 2021 11:20:58 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 6DCD64067C for ; Fri, 27 Aug 2021 11:20:57 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 104787F6D0; Fri, 27 Aug 2021 12:20:57 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from oktetlabs.ru (calendar.oktetlabs.ru [192.168.34.50]) by shelob.oktetlabs.ru (Postfix) with ESMTP id D06667F523; Fri, 27 Aug 2021 12:20:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru D06667F523 Authentication-Results: shelob.oktetlabs.ru/D06667F523; dkim=none; dkim-atps=neutral MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 27 Aug 2021 12:20:50 +0300 From: Viacheslav Galaktionov To: "Xueming(Steven) Li" Cc: Andrew Rybchenko , Xiaoyun Li , dev@dpdk.org, Andy Moreton In-Reply-To: References: <20210827063935.1834143-1-andrew.rybchenko@oktetlabs.ru> Message-ID: X-Sender: viacheslav.galaktionov@oktetlabs.ru User-Agent: Roundcube Webmail/1.3.16 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add command to print representor info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 2021-08-27 11:20, Xueming(Steven) Li wrote: > Thanks for getting this feature more complete! > >> -----Original Message----- >> From: Andrew Rybchenko >> Sent: Friday, August 27, 2021 2:40 PM >> To: Xiaoyun Li >> Cc: dev@dpdk.org; Xueming(Steven) Li ; Viacheslav >> Galaktionov ; Andy >> Moreton >> Subject: [PATCH] app/testpmd: add command to print representor info >> >> From: Viacheslav Galaktionov >> >> Make it simpler to debug configurations and code related to the >> representor info API. >> >> Signed-off-by: Viacheslav Galaktionov >> >> Signed-off-by: Andrew Rybchenko >> Reviewed-by: Andy Moreton >> --- >> app/test-pmd/cmdline.c | 117 >> +++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 117 insertions(+) >> >> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index >> 82253bc751..49e6e63471 100644 >> --- a/app/test-pmd/cmdline.c >> +++ b/app/test-pmd/cmdline.c >> @@ -236,6 +236,10 @@ static void cmd_help_long_parsed(void >> *parsed_result, >> " Show port supported ptypes" >> " for a specific port\n\n" >> >> + "show port (port_id) representors\n" >> + " Show supported representors" >> + " for a specific port\n\n" > > Confusing name, code below shows representor info, not probed > representor devices. > How about "show port (port_id) representor info"? That's a good point, thank you! [snip] >> +static void >> +cmd_representor_info_parsed(void *parsed_result, >> + __rte_unused struct cmdline *cl, >> + __rte_unused void *data) >> +{ >> + struct cmd_representor_info_result *res = parsed_result; >> + struct rte_eth_representor_info *info; >> + uint32_t i; >> + int ret; >> + int num; >> + >> + if (!rte_eth_dev_is_valid_port(res->cmd_pid)) { > > Seems port "all" not supported, is there a check? What kind of check do you mean? I suppose support for "all" can be added. In such a case, testpmd can go over all available ports that aren't representors and print their representor info. Does this sound good to you? [snip] >> + printf("Port controller: %hu\n", info->controller); >> + printf("Port PF: %hu\n", info->pf); >> + printf("Ranges: %u\n", info->nb_ranges); >> + for (i = 0; i < info->nb_ranges; i++) { >> + printf("%u:\n", i); > > Normally there will be certain amount of ranges here, how about output > as a table? I'm not sure what the layout of this table should be, could you provide an example? [snip]