Re: [dpdk-dev] [PATCH] app/testpmd: add command to print representor info
From: Xueming(Steven) Li <hidden>
Date: 2021-08-28 13:28:55
-----Original Message----- From: Viacheslav Galaktionov <redacted> Sent: Friday, August 27, 2021 5:21 PM To: Xueming(Steven) Li <redacted> Cc: Andrew Rybchenko <redacted>; Xiaoyun Li <redacted>; dev@dpdk.org; Andy Moreton [off-list ref] Subject: Re: [PATCH] app/testpmd: add command to print representor info On 2021-08-27 11:20, Xueming(Steven) Li wrote:quoted
Thanks for getting this feature more complete!quoted
-----Original Message----- From: Andrew Rybchenko <redacted> Sent: Friday, August 27, 2021 2:40 PM To: Xiaoyun Li <redacted> Cc: dev@dpdk.org; Xueming(Steven) Li <redacted>; Viacheslav Galaktionov [off-list ref]; Andy Moreton [off-list ref] Subject: [PATCH] app/testpmd: add command to print representor info From: Viacheslav Galaktionov <redacted> Make it simpler to debug configurations and code related to the representor info API. Signed-off-by: Viacheslav Galaktionov [off-list ref] Signed-off-by: Andrew Rybchenko <redacted> Reviewed-by: Andy Moreton <redacted> --- 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 index82253bc751..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]quoted
quoted
+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?
Sorry, "all" will not pass the check, please ignore my comment. Dump a single port is good enough.
[snip]quoted
quoted
+ 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?
Range entry fields is dump in vertical here, how about dump range entry as a row? No need to align columns.
[snip]