DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: Ferruh Yigit <ferruh.yigit@xilinx.com>,
	Xiaoyun Li <xiaoyun.li@intel.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH 3/3] app/testpmd: compact RSS flow type output in port info
Date: Tue, 31 May 2022 19:35:18 +0300	[thread overview]
Message-ID: <1fc4d0b9-a948-03a2-8a0b-b5250d8cf700@oktetlabs.ru> (raw)
In-Reply-To: <20220525173736.3394787-3-ferruh.yigit@xilinx.com>

On 5/25/22 20:37, Ferruh Yigit wrote:
> In port info command output, 'show port info all', supported RSS flow
> types printed one type per line, and although this information is not
> most important part of the command it takes big part of the command
> output.
> 
> Compacting the supported RSS flow type output by printing 6 (hardcoded
> value) items per line, instead of one per line. Output becomes as
> following:
> 
>   Supported RSS offload flow types:
>     ipv4  ipv4-frag  ipv4-tcp  ipv4-udp  ipv4-sctp  ipv4-other
>     ipv6  ipv6-frag  ipv6-tcp  ipv6-udp  ipv6-sctp  ipv6-other
>     l2-payload  ipv6-ex  ipv6-tcp-ex  ipv6-udp-ex  port  vxlan
>     geneve  nvgre  mpls
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
> ---
>   app/test-pmd/config.c | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 47de5b6d9458..5496ccd7f8ad 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -805,6 +805,7 @@ port_infos_display(portid_t port_id)
>   	else {
>   		uint64_t rss_types = dev_info.flow_type_rss_offloads;
>   		uint16_t i;
> +		uint16_t len = 0;
>   
>   		printf("Supported RSS offload flow types:\n");
>   		for (i = 0; rss_types != 0; i++) {
> @@ -813,12 +814,21 @@ port_infos_display(portid_t port_id)
>   				const char *p = rsstype_to_str(rss_type);
>   
>   				if (p)
> -					printf("  %s\n", p);
> +					printf("  %s", p);
>   				else
> -					printf("  user defined 0x%"PRIx64"\n", rss_type);
> +					printf("  user defined 0x%"PRIx64, rss_type);
> +
> +				len++;
> +				/* wrap on every 6 items */
> +				if (len == 6) {

Variable name 'len' is misleading here since the first idea is
like length, not a number of items.

Also 6 sounds to be to much in the worst case scenario with 6
user defined types. Each uses at least 18 chars. So, 18 * 6 = 108.
May be printing algorithm should be a bit more sophisticated and
really track line length.

> +					printf("\n");
> +					len = 0;
> +				}
>   			}
>   			rss_types >>= 1;
>   		}
> +		if (len)
> +			printf("\n");
>   	}
>   
>   	printf("Minimum size of RX buffer: %u\n", dev_info.min_rx_bufsize);


  reply	other threads:[~2022-05-31 16:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 17:37 [PATCH 1/3] app/testpmd: fix displaying RSS info Ferruh Yigit
2022-05-25 17:37 ` [PATCH 2/3] app/testpmd: remove duplicated flow type to string table Ferruh Yigit
2022-05-25 17:37 ` [PATCH 3/3] app/testpmd: compact RSS flow type output in port info Ferruh Yigit
2022-05-31 16:35   ` Andrew Rybchenko [this message]
2022-06-01  7:08     ` lihuisong (C)
2022-05-26  3:52 ` [PATCH 1/3] app/testpmd: fix displaying RSS info lihuisong (C)
2022-05-26  8:56   ` Ferruh Yigit
2022-05-27  2:48     ` lihuisong (C)
2022-05-27  2:30 ` lihuisong (C)
2022-05-30 10:43   ` Ferruh Yigit
2022-05-30 12:32     ` lihuisong (C)
2022-05-30 13:02       ` Ferruh Yigit
2022-05-31  2:07         ` lihuisong (C)
2022-05-31 16:35           ` Andrew Rybchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1fc4d0b9-a948-03a2-8a0b-b5250d8cf700@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=thomas@monjalon.net \
    --cc=xiaoyun.li@intel.com \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).