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 447ECA057B; Tue, 28 Jun 2022 15:18:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F8D942B6C; Tue, 28 Jun 2022 15:18:13 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2083.outbound.protection.outlook.com [40.107.212.83]) by mails.dpdk.org (Postfix) with ESMTP id D223C42B6C for ; Tue, 28 Jun 2022 15:18:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QXNO3/l8iy5q07yHs5RgJ2JQDr1cCEn1u6xVegNHPlDJ0wWHQrY9PaweXSlnfqOjybznn6rK1zicaFvvbfPIXSRssq/8qzFZgZQ90VV7ppOV4APGle40tCnZfkbq3zjeaHnPhAzXIY7y+4vTrn65MKbwOne54Y1HK2wknvGlep/NEDfU6EP30abthHgz9qleN2Qm5IysajiDsAL1FRKMLOMulbLaTQS3/RQy4qqNxbFvi9lG4mE3MxlD6ZoNlhKzViwLkQysm9BCOVyOx6pLtj5N9CrVaOmkp9MpVA3FSg2JkIeZ585ebGlwd10pb+aGCokkcoCmqlTa4ThRnCrcoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sTzVPygL/6bLa7nsxejgE4zbKi4EuAxZJ4pImdTvruI=; b=WJOH1/nvK6A/ODMFtOq8PIu3Auy34ETLtyV3LTcR+DIY3ExaZpkKoRZRXKV9Uri+UR4EZrn+AKa8uvZnlq1DwNHfEsQhudI7YsRAbGo0S+kRKpxX6qtuYOuA9oGDsquF61n5cynnqARVyZ5dB35K6j0AeY+ijzYodEKvtKkqsi+kubr9+jxz7neWMb7GK6Y4xGT8MnRiByBbnb6loOampR5Du1XJAiQOYAmUhbZrBuROR3UPEIjtaPSxtkfh2ae8w2RunkgjC8S5Tq7mIjecZQjA4ciGewpf82wLdP8FjL1RWS+mNonFQVWNG02VWdNPadIRYef1JQvE+7vK9TWuqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=huawei.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sTzVPygL/6bLa7nsxejgE4zbKi4EuAxZJ4pImdTvruI=; b=Jd2m/duHs5oTdxvYIN2+omW/cDkSiPgY0Tv3Qxgq3kpCs/Rgd7SoLe0yEI32UV3ubJlLBFfMSZftWK36xjt5pWf4iGch3OMGqIWFic2O3BsKaZz6ls0B7gPTs+BsB7cPesycNR0UPzQBp9631ZP/4P58K5DIv/zpDbgWNCtcLZg= Received: from DM6PR03CA0092.namprd03.prod.outlook.com (2603:10b6:5:333::25) by SN6PR02MB4046.namprd02.prod.outlook.com (2603:10b6:805:30::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17; Tue, 28 Jun 2022 13:18:09 +0000 Received: from DM3NAM02FT058.eop-nam02.prod.protection.outlook.com (2603:10b6:5:333:cafe::9) by DM6PR03CA0092.outlook.office365.com (2603:10b6:5:333::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.16 via Frontend Transport; Tue, 28 Jun 2022 13:18:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch02.xlnx.xilinx.com; pr=C Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by DM3NAM02FT058.mail.protection.outlook.com (10.13.5.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5373.15 via Frontend Transport; Tue, 28 Jun 2022 13:18:09 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 28 Jun 2022 14:18:07 +0100 Received: from smtp.xilinx.com (172.21.105.198) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 28 Jun 2022 14:18:07 +0100 Envelope-to: lihuisong@huawei.com, aman.deep.singh@intel.com, yuying.zhang@intel.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, thomas@monjalon.net, huangdaode@huawei.com, liudongdong3@huawei.com Received: from [10.71.119.54] (port=57605) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1o6B6V-00064f-RH; Tue, 28 Jun 2022 14:18:07 +0100 Message-ID: <974053d6-2102-a9a5-72d3-5bd7ac97f784@xilinx.com> Date: Tue, 28 Jun 2022 14:18:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH V5 5/7] app/testpmd: compact RSS types output in some commands Content-Language: en-US To: "lihuisong (C)" , , , CC: , , , References: <20220429102445.23711-1-lihuisong@huawei.com> <20220624072401.21839-1-lihuisong@huawei.com> <20220624072401.21839-6-lihuisong@huawei.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49700c1f-c080-4aab-962a-08da5908a533 X-MS-TrafficTypeDiagnostic: SN6PR02MB4046:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mZl49wSQkPRjwSmgoJXsoaVZyooXDacxfZ8GGor+R59MBWymWNWY6z1L6oLB80pKufD7YdPz5XVJf/4gkHNcNYiIaw7XnAkj8C/W4dszJWHWN3ZP4GK/dS3vFqDp9joh/+Y06RL92VnV8+MnGjjADgfLo6DE77OYgZvRQwTtFlApopKHoFFgk2HWbJAQYn9RVJyB7OxDkn7SAtfN0i/otJHhwi/p+wa+110jgVduQLm3LI5uJVW/bXkpRhjvPFtD1UNA1DA9afzR/n9TQ72Qj0FV6/WV/VNWW5Y+4B/fHYih3/johtyej2R9Y39wJIBQxdAdAc0lh7/L5g3UCHhUWe70oWTEOUJETrrm4c0x7b9PR32Y9uyZP9k/sGX9/kT2Y2D9pK52EzM1r0Xh33TgALr9XwfVyFe/+WFB6Vr8Rym1r4YIAUyWA9bDu8p7lRbnbhZvOgQxcPGOh4ByHlGgroYLHwhWCW8n9nGW2wtxU6APULikIFrghDXnmLD4IW3lVWguukAvxXv1fGMTT7h7Fy1qGiolWtiHwZrvzk8jI8xURTvw7uMEMr6zzqu8eOpFud5VQ5HtZ1Kqt54alGlns9r+Xw78wL1m/snQokBeqnl/MJ0e2WCn2yKEermUJW3AwVEghmoRGmJv6DJtXBuhZuDe/sQevVeyx4Dei6zHj4NslGuqj1X8hf52QYHnPiz17PnDOveZasd0I5DWeYOWPVqh/4iEvByFdM375yCgbo8xRQfRNHcDKJqBcNraE7q2tReoKXwWizLyI4UsgoAcyumeDm7wR6/qsv08C5yrS4LzlYNUcBhjx9S9CDoyDE2N4x18jwZTmjN1cH1/8YhV6h97l9lHWekiqWpyvL6YelQ= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(376002)(39860400002)(396003)(136003)(346002)(36840700001)(40470700004)(46966006)(83380400001)(186003)(31686004)(36756003)(8676002)(478600001)(7636003)(316002)(2906002)(2616005)(8936002)(54906003)(110136005)(31696002)(36860700001)(40480700001)(44832011)(356005)(82740400003)(82310400005)(26005)(9786002)(70586007)(70206006)(53546011)(336012)(426003)(4326008)(40460700003)(47076005)(41300700001)(5660300002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2022 13:18:09.0391 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49700c1f-c080-4aab-962a-08da5908a533 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT058.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4046 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 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 >>> >>> 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 >>> Signed-off-by: Huisong Li >>> --- >>>   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.