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 F3373A0543; Wed, 1 Jun 2022 09:08:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D518740694; Wed, 1 Jun 2022 09:08:21 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 3EC7340689 for ; Wed, 1 Jun 2022 09:08:20 +0200 (CEST) Received: from kwepemi100023.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LCgFW5TdPzjXB5; Wed, 1 Jun 2022 15:07:27 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by kwepemi100023.china.huawei.com (7.221.188.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 1 Jun 2022 15:08:17 +0800 Received: from [10.67.103.231] (10.67.103.231) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 1 Jun 2022 15:08:17 +0800 Message-ID: <8842e395-349f-7984-37fe-956f28dced33@huawei.com> Date: Wed, 1 Jun 2022 15:08:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 3/3] app/testpmd: compact RSS flow type output in port info To: Andrew Rybchenko , Ferruh Yigit , Xiaoyun Li , Aman Singh , Yuying Zhang CC: , Thomas Monjalon References: <20220525173736.3394787-1-ferruh.yigit@xilinx.com> <20220525173736.3394787-3-ferruh.yigit@xilinx.com> <1fc4d0b9-a948-03a2-8a0b-b5250d8cf700@oktetlabs.ru> From: "lihuisong (C)" In-Reply-To: <1fc4d0b9-a948-03a2-8a0b-b5250d8cf700@oktetlabs.ru> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.231] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected 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 在 2022/6/1 0:35, Andrew Rybchenko 写道: > 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 >> --- >>   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. ok. I will fix it in my set. > >> +                    printf("\n"); >> +                    len = 0; >> +                } >>               } >>               rss_types >>= 1; >>           } >> +        if (len) >> +            printf("\n"); >>       } >>         printf("Minimum size of RX buffer: %u\n", >> dev_info.min_rx_bufsize); > > .