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 A02B6A0555; Thu, 26 May 2022 10:56:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40FE140E64; Thu, 26 May 2022 10:56:20 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2068.outbound.protection.outlook.com [40.107.220.68]) by mails.dpdk.org (Postfix) with ESMTP id EE13E40DF7; Thu, 26 May 2022 10:56:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lUd0aIboss8R49JSpEUWKXEft1xyKuQKwi0BgwFG+UI7UVwzA4TYvFWzqaEBlsEY0JyUdpR9wfvjJ+prNl9drWrU6NQ173RRSbyiG/ndk8Dwu7f4EbzrnLMmC+YF1U9ISeuOY2k5KhwcoQ93bs26kgQn5xD+SaBy3Di2Pwt0KRGiit0sS3HkOuA1WQc0C/DSMmbuen+cn2Ibmi1rJdpnN32Ba7CRvEuRIhEXenTI76a/RnIdG/i9Mg1nbRSxkxWyM7Tp8y2xnJR9hPsRghbUm0qCOt6z0TH/5ZHLYLuxT08W6c922GQm21bPTUI13lZrHnyv3H3h7CkUC9FeODFDzw== 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=hQVlu9O3vMcAzj0StC1N1WlhcnJZVCy+HRUuuxTkITU=; b=B7KQWg1PiSNMM2QaLNhnb45Ho5JUmgh6L+XNSvKKijFXHyN9bnudfpbmJHJs3rxTV7xkCI0YB7oSlHJ/Irqn7sHVmGubqsIMg38PksA76Nz9icNqtSSSAroHTCyqlKbeGAToSIY/XuSplR3pOgYw4GXAXR5brD9pqK4Q5GDfEgLOqfmSmgL3EScw411VqHvTSM73zoORsot++h9JsZkZJ4SmT9ZNh5cVs/jrXeOS4l4xe5yxXjVY4xByWIVJ804tS7DBmC8sMqR9ZyVQOcbTNbYYGXyfdQij1ZDly6BK+baicMH030KnbGADT1JMMxSAKSMzzCJqPpLyIH9f/a+Wrw== 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=hQVlu9O3vMcAzj0StC1N1WlhcnJZVCy+HRUuuxTkITU=; b=TPToIz31yk1M0ilb5u1V3snbjbgbYwOTj8BqL4WdIU5ByvpgsPmueAuLhwkl4jFf4L8YvAdAWU51OW2u7CGgfoRPVnjIopye1b6FmpgmKqcYL13D3mYGQji1/Sq8A8t/LFAOnNM8TNq+yOelvhXcn7Uv3ukCV3isnZrsfXoYUGs= Received: from SA9PR13CA0083.namprd13.prod.outlook.com (2603:10b6:806:23::28) by SN6PR02MB4064.namprd02.prod.outlook.com (2603:10b6:805:2e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 08:56:16 +0000 Received: from SN1NAM02FT0019.eop-nam02.prod.protection.outlook.com (2603:10b6:806:23:cafe::1d) by SA9PR13CA0083.outlook.office365.com (2603:10b6:806:23::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.5 via Frontend Transport; Thu, 26 May 2022 08:56:15 +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 SN1NAM02FT0019.mail.protection.outlook.com (10.97.4.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5293.13 via Frontend Transport; Thu, 26 May 2022 08:56:14 +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; Thu, 26 May 2022 09:56:13 +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; Thu, 26 May 2022 09:56:13 +0100 Envelope-to: lihuisong@huawei.com, xiaoyun.li@intel.com, aman.deep.singh@intel.com, yuying.zhang@intel.com, helin.zhang@intel.com, jingjing.wu@intel.com, dev@dpdk.org, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, stable@dpdk.org Received: from [172.21.34.28] (port=60287) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nu9Hw-0001Fk-S1; Thu, 26 May 2022 09:56:13 +0100 Message-ID: Date: Thu, 26 May 2022 09:56:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 1/3] app/testpmd: fix displaying RSS info Content-Language: en-US To: "lihuisong (C)" , Xiaoyun Li , Aman Singh , Yuying Zhang , Helin Zhang , Jingjing Wu CC: , Thomas Monjalon , Andrew Rybchenko , References: <20220525173736.3394787-1-ferruh.yigit@xilinx.com> <9a0b27e3-510d-6948-cf3e-a213c7929c85@huawei.com> From: Ferruh Yigit In-Reply-To: <9a0b27e3-510d-6948-cf3e-a213c7929c85@huawei.com> 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: 8fd617ef-c2ab-4a14-9057-08da3ef5970d X-MS-TrafficTypeDiagnostic: SN6PR02MB4064:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PBCGMljXeU+dsu+SXsk3qBKYeJCmwxRg0lNpaAGdfL/mz7fZzkjmExAAE34Mss+qfRungeAfFa4z2O/KdukXHm2T5jUh59zz5chLe+984LdEFiaHrJmCnFSeNq92SnQr9C2xely+gyHukcgpteduI7PYmkkfQrxoLCyAY+4EhXGB41H2rbGKRW113Bp9qt2YYPCCrF+JpN+jN404lK3SRxCJg5NE5VUCqAn0l/VQpeNJ5oUXSayAbtnXhee8GoSShZ0+PC0tYhL2A1IXUO4Db5yu3Lh+SKCTVDg+djNGj971QUPK8jAe2J9SDRJPCQk7xgvNiBrYQsn4mJOgZtIZ53vjM4LSowrJ/LFP7JoEleteSoLqbtSHk5ZUQmTFmWT2MvUUOXhQpvC9NWKNdNrsaXai2jiT+/bHWrAjmJp6f0VdL4c4u09A11yfY9hE2yCLgGIFBcj+bSNRheuyeyWmW/cEgtdnJ4fd00fnh1ZxAKzRUJKOcD2V+Z7uPvqhzpmLQXVWXxyNc2q6Ax5lDd2bONel6lxRc3gCxuTFG6wkSPcT/m7tygyry3tpYiMLIJqsE2yQXFv74fdJpTck0aEY48DdrX+EfK1vy5zxGs0Ap1BN9Bj8yj97H6ay4HzPIgoD44WhrnNgqCxz1nSMIRZgg0oyjjbrvawaLZdIAU7uv2BVc5/dl/qWXVw9rHLE8272tDgnRHzNt3PWqIQZ2MlYq5EsM2ZOjZRcM/4E/VFD/g9qm+BbumZk7SHypGSE5HT287hEut29lJHzKgDoaqc2WVgbzpbHdyJcSJAAW6cwEpT532PlD63uPE1LZk5UCEf3 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:(13230001)(4636009)(46966006)(40470700004)(36840700001)(7636003)(44832011)(54906003)(70206006)(47076005)(8676002)(336012)(70586007)(426003)(186003)(4326008)(31696002)(83380400001)(2616005)(316002)(31686004)(9786002)(966005)(508600001)(36860700001)(8936002)(356005)(2906002)(110136005)(82310400005)(45080400002)(7416002)(40460700003)(36756003)(26005)(53546011)(5660300002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2022 08:56:14.5848 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fd617ef-c2ab-4a14-9057-08da3ef5970d 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: SN1NAM02FT0019.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4064 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 5/26/2022 4:52 AM, lihuisong (C) 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. > > > Hi, Ferruh > > This patch is the same as the following patch: > > https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpatches.dpdk.org%2Fproject%2Fdpdk%2Fpatch%2F20220429102445.23711-2-lihuisong%40huawei.com%2F&data=05%7C01%7CFerruh.Yigit%40amd.com%7Cda898bd1b39b438ce3e308da3ecb3123%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637891340148254654%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=kixRff%2BQavl0SYS7woT5YYJELrrocoSoV4sE7TUK9Is%3D&reserved=0 > > > It was delegated to you.😂 > Yes indeed, I missed it. They are fixing same issue. But there is slight difference in the implementation, can you please review the set? We can share the sign off for final set. > > 在 2022/5/26 1:37, Ferruh Yigit 写道: >> When supported RSS offload flow types are printed via 'show port info #' >> command, flow names are get from flow type array which is wrong and >> causing some RSS flow types not being displayed. >> >> Instead RSS flow type array should be used. Also helper functions added >> and existing code updated to use helpers. >> >> Fixes: b12964f621dc ("ethdev: unification of RSS offload types") >> Cc: stable@dpdk.org >> >> Signed-off-by: Ferruh Yigit >> --- >> Cc: helin.zhang@intel.com >> >> Note: >> In ethdev, flow type macros 'RTE_ETH_FLOW_*' and RSS type macros >> 'RTE_ETH_RSS_*' are related, buy they seems diverged a little, may need >> to check that too. >> --- >>   app/test-pmd/config.c | 92 ++++++++++++++++++++++++++++++------------- >>   1 file changed, 64 insertions(+), 28 deletions(-) >> >> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c >> index 72d2606d19d5..c353d224ef06 100644 >> --- a/app/test-pmd/config.c >> +++ b/app/test-pmd/config.c >> @@ -147,6 +147,32 @@ const struct rss_type_info rss_type_table[] = { >>       { NULL, 0 }, >>   }; >> >> +static const char * >> +rsstype_to_str(uint64_t rss_type) >> +{ >> +     int i; >> + >> +     for (i = 0; rss_type_table[i].str != NULL; i++) { >> +             if (rss_type_table[i].rss_type == rss_type) >> +                     return rss_type_table[i].str; >> +     } >> + >> +     return NULL; >> +} >> + >> +static uint64_t >> +str_to_rsstype(const char *str) >> +{ >> +     int i; >> + >> +     for (i = 0; rss_type_table[i].str != NULL; i++) { >> +             if (!strcmp(rss_type_table[i].str, str)) >> +                     return rss_type_table[i].rss_type; >> +     } >> + >> +     return 0; >> +} >> + >>   static const struct { >>       enum rte_eth_fec_mode mode; >>       const char *name; >> @@ -779,19 +805,21 @@ 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_types = dev_info.flow_type_rss_offloads; >>               uint16_t i; >> -             char *p; >> >>               printf("Supported RSS offload flow types:\n"); >> -             for (i = RTE_ETH_FLOW_UNKNOWN + 1; >> -                  i < sizeof(dev_info.flow_type_rss_offloads) * >> CHAR_BIT; i++) { >> -                     if (!(dev_info.flow_type_rss_offloads & (1ULL << >> i))) >> -                             continue; >> -                     p = flowtype_to_str(i); >> -                     if (p) >> -                             printf("  %s\n", p); >> -                     else >> -                             printf("  user defined %d\n", i); >> +             for (i = 0; rss_types != 0; i++) { >> +                     if (rss_types & 1) { >> +                             uint64_t rss_type = 1ULL << i; >> +                             const char *p = rsstype_to_str(rss_type); >> + >> +                             if (p) >> +                                     printf("  %s\n", p); >> +                             else >> +                                     printf("  user defined >> 0x%"PRIx64"\n", rss_type); >> +                     } >> +                     rss_types >>= 1; >>               } >>       } >> >> @@ -1547,6 +1575,7 @@ port_flow_complain(struct rte_flow_error *error) >>   static void >>   rss_config_display(struct rte_flow_action_rss *rss_conf) >>   { >> +     uint64_t rss_types; >>       uint8_t i; >> >>       if (rss_conf == NULL) { >> @@ -1582,16 +1611,23 @@ rss_config_display(struct rte_flow_action_rss >> *rss_conf) >>       } >> >>       printf(" types:\n"); >> -     if (rss_conf->types == 0) { >> +     rss_types = rss_conf->types; >> +     if (rss_types == 0) { >>               printf("  none\n"); >>               return; >>       } >> -     for (i = 0; rss_type_table[i].str; i++) { >> -             if ((rss_conf->types & >> -                 rss_type_table[i].rss_type) == >> -                 rss_type_table[i].rss_type && >> -                 rss_type_table[i].rss_type != 0) >> -                     printf("  %s\n", rss_type_table[i].str); >> + >> +     for (i = 0; rss_types != 0; i++) { >> +             if (rss_types & 1) { >> +                     uint64_t rss_type = 1ULL << i; >> +                     const char *p = rsstype_to_str(rss_type); >> + >> +                     if (p) >> +                             printf("  %s\n", p); >> +                     else >> +                             printf("  user defined 0x%"PRIx64"\n", >> rss_type); >> +             } >> +             rss_types >>= 1; >>       } >>   } >> >> @@ -3823,11 +3859,16 @@ port_rss_hash_conf_show(portid_t port_id, int >> show_rss_key) >>               return; >>       } >>       printf("RSS functions:\n "); >> -     for (i = 0; rss_type_table[i].str; i++) { >> -             if (rss_type_table[i].rss_type == 0) >> -                     continue; >> -             if ((rss_hf & rss_type_table[i].rss_type) == >> rss_type_table[i].rss_type) >> -                     printf("%s ", rss_type_table[i].str); >> +     for (i = 0; rss_hf != 0; i++) { >> +             if (rss_hf & 1) { >> +                     uint64_t rss_type = 1ULL << i; >> +                     const char *p = rsstype_to_str(rss_type); >> +                     if (p) >> +                             printf("%s ", p); >> +                     else >> +                             printf("0x%"PRIx64" ", rss_type); >> +             } >> +             rss_hf >>= 1; >>       } >>       printf("\n"); >>       if (!show_rss_key) >> @@ -3844,15 +3885,10 @@ port_rss_hash_key_update(portid_t port_id, >> char rss_type[], uint8_t *hash_key, >>   { >>       struct rte_eth_rss_conf rss_conf; >>       int diag; >> -     unsigned int i; >> >>       rss_conf.rss_key = NULL; >>       rss_conf.rss_key_len = 0; >> -     rss_conf.rss_hf = 0; >> -     for (i = 0; rss_type_table[i].str; i++) { >> -             if (!strcmp(rss_type_table[i].str, rss_type)) >> -                     rss_conf.rss_hf = rss_type_table[i].rss_type; >> -     } >> +     rss_conf.rss_hf = str_to_rsstype(rss_type); >>       diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf); >>       if (diag == 0) { >>               rss_conf.rss_key = hash_key;