From: Ferruh Yigit <ferruh.yigit@xilinx.com>
To: "lihuisong (C)" <lihuisong@huawei.com>,
<aman.deep.singh@intel.com>, <yuying.zhang@intel.com>,
<andrew.rybchenko@oktetlabs.ru>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>, <huangdaode@huawei.com>,
<liudongdong3@huawei.com>
Subject: Re: [PATCH V5 5/7] app/testpmd: compact RSS types output in some commands
Date: Tue, 28 Jun 2022 14:18:07 +0100 [thread overview]
Message-ID: <974053d6-2102-a9a5-72d3-5bd7ac97f784@xilinx.com> (raw)
In-Reply-To: <c23933bd-1bd7-76fa-2c3e-21e3eaebdefc@huawei.com>
On 6/25/2022 3:13 AM, lihuisong (C) wrote:
>
> 在 2022/6/24 22:04, Ferruh Yigit 写道:
>> On 6/24/2022 8:23 AM, Huisong Li wrote:
>>> CAUTION: This message has originated from an External Source. Please
>>> use proper judgment and caution when opening attachments, clicking
>>> links, or responding to this email.
>>>
>>>
>>> From: Ferruh Yigit <ferruh.yigit@xilinx.com>
>>>
>>> In port info command output, 'show port info all', supported RSS offload
>>> 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.
>>>
>>> In port RSS hash and flow RSS command output, 'show port 0 rss-hash',
>>> and 'flow query 0 0 rss', all enabled RSS types are printed on one line.
>>> If there are many types, the print will be very long.
>>>
>>> Compacting these RSS offloads and types output by fixing the length
>>> of the
>>> character string printed on each line, instead of one per line or one
>>> line.
>>> Output becomes as following:
>>>
>>> Supported RSS offload flow types:
>>> ipv4-frag ipv4-tcp ipv4-udp ipv4-sctp ipv4-other
>>> ipv6-frag ipv6-tcp ipv6-udp ipv6-sctp ipv6-other
>>> l4-dst-only l4-src-only l3-dst-only l3-src-only
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>>> ---
>>> app/test-pmd/config.c | 68 +++++++++++++++++++++++++++++++-----------
>>> app/test-pmd/testpmd.h | 2 ++
>>> 2 files changed, 52 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>>> index a0a5f12c71..b3cb68003c 100644
>>> --- a/app/test-pmd/config.c
>>> +++ b/app/test-pmd/config.c
>>> @@ -699,6 +699,38 @@ rsstypes_to_str(uint64_t rss_type)
>>> return NULL;
>>> }
>>>
>>> +static void
>>> +rss_offload_types_display(uint64_t offload_types, uint16_t
>>> char_num_per_line)
>>> +{
>>> + uint16_t unknown_offload_str_len;
>>> + uint16_t total_len = 0;
>>> + uint16_t str_len = 0;
>>> + uint64_t rss_offload;
>>> + uint16_t i;
>>> +
>>> + for (i = 0; i < sizeof(offload_types) * CHAR_BIT; i++) {
>>> + rss_offload = RTE_BIT64(i);
>>> + if ((offload_types & rss_offload) != 0) {
>>> + const char *p = rsstypes_to_str(rss_offload);
>>> +
>>> + unknown_offload_str_len =
>>> + strlen("unknown_offload(BIT())") + (i
>>> / 10 + 1);
>>> + str_len = p ? strlen(p) :
>>> unknown_offload_str_len;
>>> + str_len += 2; /* add two spaces */
>>> + if (total_len + str_len >= char_num_per_line) {
>>> + total_len = 0;
>>> + printf("\n");
>>> + }
>>> +
>>> + if (p)
>>> + printf(" %s", p);
>>> + else
>>> + printf(" unknown_offload(BIT(%u))", i);
>>> + total_len += str_len;
>>> + }
>>> + }
>>> +}
>>> +
>>> void
>>> port_infos_display(portid_t port_id)
>>> {
>>> @@ -803,21 +835,10 @@ port_infos_display(portid_t port_id)
>>> if (!dev_info.flow_type_rss_offloads)
>>> printf("No RSS offload flow type is supported.\n");
>>> else {
>>> - uint64_t rss_offload_types =
>>> dev_info.flow_type_rss_offloads;
>>> - uint16_t i;
>>> -
>>> printf("Supported RSS offload flow types:\n");
>>> - for (i = 0; i < sizeof(rss_offload_types) * CHAR_BIT;
>>> i++) {
>>> - uint64_t rss_offload = RTE_BIT64(i);
>>> - if ((rss_offload_types & rss_offload) != 0) {
>>> - const char *p =
>>> rsstypes_to_str(rss_offload);
>>> - if (p)
>>> - printf(" %s\n", p);
>>> - else
>>> - printf("
>>> unknown_offload(BIT(%u))\n",
>>> - i);
>>> - }
>>> - }
>>> + rss_offload_types_display(dev_info.flow_type_rss_offloads,
>>> + TESTPMD_RSS_TYPES_CHAR_NUM_PER_LINE);
>>> + printf("\n");
>>
>> Why 'rss_types_display()' is not reused, but new function
>> 'rss_offload_types_display()' created?
> As mentioned in the 1/7 patch reply, there are different purposes.
OK. Lets continue as it is.
next prev parent reply other threads:[~2022-06-28 13:18 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 10:24 [PATCH V2 0/2] fix RSS types display Huisong Li
2022-04-29 10:24 ` [PATCH V2 1/2] app/testpmd: fix supported RSS offload display Huisong Li
2022-04-29 10:24 ` [PATCH V2 2/2] app/testpmd: unify RSS types display Huisong Li
2022-06-07 8:32 ` [PATCH V3 app/testpmd 0/4] fix RSS types and flow type Huisong Li
2022-06-07 8:32 ` [PATCH V3 app/testpmd 1/4] app/testpmd: fix supported RSS offload display Huisong Li
2022-06-07 15:45 ` Ferruh Yigit
2022-06-09 3:25 ` lihuisong (C)
2022-06-17 1:38 ` lihuisong (C)
2022-06-20 12:35 ` Ferruh Yigit
2022-06-21 2:17 ` lihuisong (C)
2022-06-07 8:32 ` [PATCH V3 app/testpmd 2/4] app/testpmd: unify RSS types display and obtaination Huisong Li
2022-06-07 15:46 ` Ferruh Yigit
2022-06-09 3:25 ` lihuisong (C)
2022-06-07 8:32 ` [PATCH V3 app/testpmd 3/4] app/testpmd: compact RSS types output in some commands Huisong Li
2022-06-07 15:46 ` Ferruh Yigit
2022-06-09 3:41 ` lihuisong (C)
2022-06-20 12:37 ` Ferruh Yigit
2022-06-07 8:32 ` [PATCH V3 app/testpmd 4/4] app/testpmd: remove duplicated flow type to string table Huisong Li
2022-06-07 15:47 ` Ferruh Yigit
2022-06-09 3:26 ` lihuisong (C)
2022-06-20 12:38 ` Ferruh Yigit
2022-06-21 2:18 ` lihuisong (C)
2022-06-21 7:51 ` Ferruh Yigit
2022-06-21 12:21 ` lihuisong (C)
2022-06-24 4:12 ` [PATCH V4 0/7] app/testpmd: fix RSS and flow type Huisong Li
2022-06-24 4:12 ` [PATCH V4 1/7] app/testpmd: fix supported RSS offload display Huisong Li
2022-06-24 4:12 ` [PATCH V4 2/7] app/testpmd: unify the name of L2 payload offload Huisong Li
2022-06-24 4:12 ` [PATCH V4 3/7] app/testpmd: refactor config all RSS command Huisong Li
2022-06-24 4:12 ` [PATCH V4 4/7] app/testpmd: unify RSS types display Huisong Li
2022-06-24 4:12 ` [PATCH V4 5/7] app/testpmd: compact RSS types output in some commands Huisong Li
2022-06-24 4:12 ` [PATCH V4 6/7] app/testpmd: reorder elements in RSS type table array Huisong Li
2022-06-24 4:12 ` [PATCH V4 7/7] app/testpmd: remove duplicated flow type to string table Huisong Li
2022-06-24 7:23 ` [PATCH V5 0/7] app/testpmd: fix RSS and flow type Huisong Li
2022-06-24 7:23 ` [PATCH V5 1/7] app/testpmd: fix supported RSS offload display Huisong Li
2022-06-24 13:01 ` Ferruh Yigit
2022-06-25 2:12 ` lihuisong (C)
2022-06-28 13:18 ` Ferruh Yigit
2022-06-24 7:23 ` [PATCH V5 2/7] app/testpmd: unify the name of L2 payload offload Huisong Li
2022-06-24 13:53 ` Ferruh Yigit
2022-06-25 2:12 ` lihuisong (C)
2022-06-28 13:17 ` Ferruh Yigit
2022-06-29 1:47 ` lihuisong (C)
2022-06-24 7:23 ` [PATCH V5 3/7] app/testpmd: refactor config all RSS command Huisong Li
2022-06-24 13:55 ` Ferruh Yigit
2022-06-25 2:13 ` lihuisong (C)
2022-06-24 7:23 ` [PATCH V5 4/7] app/testpmd: unify RSS types display Huisong Li
2022-06-24 7:23 ` [PATCH V5 5/7] app/testpmd: compact RSS types output in some commands Huisong Li
2022-06-24 14:04 ` Ferruh Yigit
2022-06-25 2:13 ` lihuisong (C)
2022-06-28 13:18 ` Ferruh Yigit [this message]
2022-06-24 7:24 ` [PATCH V5 6/7] app/testpmd: reorder elements in RSS type table array Huisong Li
2022-06-24 14:00 ` Ferruh Yigit
2022-06-25 2:14 ` lihuisong (C)
2022-06-24 7:24 ` [PATCH V5 7/7] app/testpmd: remove duplicated flow type to string table Huisong Li
2022-06-24 8:55 ` [PATCH V5 0/7] app/testpmd: fix RSS and flow type lihuisong (C)
2022-06-24 8:59 ` David Marchand
2022-06-24 9:54 ` lihuisong (C)
2022-06-24 10:44 ` Ferruh Yigit
2022-06-25 1:09 ` lihuisong (C)
2022-06-28 13:18 ` Ferruh Yigit
2022-06-29 8:34 ` [PATCH V6 0/8] " Huisong Li
2022-06-29 8:34 ` [PATCH V6 1/8] app/testpmd: fix supported RSS offload display Huisong Li
2022-06-29 8:34 ` [PATCH V6 2/8] app/testpmd: unify the name of L2 payload offload Huisong Li
2022-06-29 8:34 ` [PATCH V6 3/8] doc: testpmd rename RSS type ether to L2 payload Huisong Li
2022-06-29 8:34 ` [PATCH V6 4/8] app/testpmd: refactor config all RSS command Huisong Li
2022-06-29 8:34 ` [PATCH V6 5/8] app/testpmd: unify RSS types display Huisong Li
2022-06-29 8:34 ` [PATCH V6 6/8] app/testpmd: compact RSS types output in some commands Huisong Li
2022-06-29 8:34 ` [PATCH V6 7/8] app/testpmd: reorder elements in RSS type table array Huisong Li
2022-06-29 8:34 ` [PATCH V6 8/8] app/testpmd: remove duplicated flow type to string table Huisong Li
2022-06-29 9:59 ` [PATCH V6 0/8] app/testpmd: fix RSS and flow type lihuisong (C)
2022-06-29 14:13 ` Ferruh Yigit
2022-06-29 20:05 ` Ferruh Yigit
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=974053d6-2102-a9a5-72d3-5bd7ac97f784@xilinx.com \
--to=ferruh.yigit@xilinx.com \
--cc=aman.deep.singh@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=huangdaode@huawei.com \
--cc=lihuisong@huawei.com \
--cc=liudongdong3@huawei.com \
--cc=thomas@monjalon.net \
--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).