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 4B774A0032; Fri, 24 Jun 2022 15:01:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D7D34069D; Fri, 24 Jun 2022 15:01:17 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2084.outbound.protection.outlook.com [40.107.92.84]) by mails.dpdk.org (Postfix) with ESMTP id A30CB400EF for ; Fri, 24 Jun 2022 15:01:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YVU/99f6Nv4ahe7e2jaqp1ByH3UUcKXTfqBQMU7eH72wYLDFqwkCkrl+1OxzSkmQGkt26l7TpdgEA8zOLxbeCv+bs8DqXzIBhCViuR7bVlZbmrWKD2lHgFJPAxVkkKq4Cbs8ZukIlU8hHMarGHydw6MvqlfrVXwclfDybsU2mmYOsFOysVoekPerlF07z6fPx8G+J8/F6tQKbXT8oJiVVzcRxNKz4T8HJXAP8jWM0agBv72uMv2AUFbnQ3tu41I7kgR1n+eO2maeXTiFaRdobE4bjBiXrzBoXA8Tvh+AHr3vqw16UCbpYx49wxZ2zM6IG24w9tsibAwPnYlmtaZYAw== 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=xOFAsFk9OLRF3C7mOZ5ulJcICgmekKs1hAjZc8JcjMs=; b=KjhzqBQNU2XEf1WtHMz95U4P7bgtsT3pTUmxgNzlby86mJnkH0JhePpRia/Wy8ZgWURkh0KtFGkChzX/nghScr+i2Wq3wHEI3hehbNUenlUKF/EJMDEUyhX+g2SomLLw2XqohI7qCUcVwdTHpG6jBOETSaR5GskHxdMJ4Tyrqi+QaE9uA0FJduMLdOox9a56cnU16+FLNq8nTMFo8Ado65vXDLaoLf+1avGHC89r/EP1qU3k4B+IDFG0bsLvGkBxzfx9HqASk5ah/cHrW4ViRw+1lOx3QwgOWyA1GFudTBnKzQbiG1nxVCD6ZBuKCT4MT57dvMnypauLKynTrFkaUQ== 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=xOFAsFk9OLRF3C7mOZ5ulJcICgmekKs1hAjZc8JcjMs=; b=XWmkjqWlMNSL959Hvrpt6UWGFX03rTCTTZqqyU/YIQJK+fFvjxqR4+QAYmCgJxgo7TWnWoH7bkDisgkGgwDD0yjPFvVcUGGj7lWegole48RaD6AbBZG3uoPAbpJP8ooJwrzOCc9gjsdBobNWaZ+FdzJ3ppp0+mp8qQotYQcuseA= Received: from DM6PR17CA0027.namprd17.prod.outlook.com (2603:10b6:5:1b3::40) by DM6PR02MB4315.namprd02.prod.outlook.com (2603:10b6:5:1e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.20; Fri, 24 Jun 2022 13:01:08 +0000 Received: from DM3NAM02FT058.eop-nam02.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::c9) by DM6PR17CA0027.outlook.office365.com (2603:10b6:5:1b3::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.16 via Frontend Transport; Fri, 24 Jun 2022 13:01:08 +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-pvapexch01.xlnx.xilinx.com; pr=C Received: from xir-pvapexch01.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; Fri, 24 Jun 2022 13:01:07 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 24 Jun 2022 14:01:06 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 24 Jun 2022 14:01:05 +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, kirill.rybalchenko@intel.com Received: from [10.71.119.54] (port=52070) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1o4ivo-0000aS-U7; Fri, 24 Jun 2022 14:01:05 +0100 Message-ID: Date: Fri, 24 Jun 2022 14:01:04 +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 1/7] app/testpmd: fix supported RSS offload display Content-Language: en-US To: Huisong Li , , , CC: , , , , References: <20220429102445.23711-1-lihuisong@huawei.com> <20220624072401.21839-1-lihuisong@huawei.com> <20220624072401.21839-2-lihuisong@huawei.com> From: Ferruh Yigit In-Reply-To: <20220624072401.21839-2-lihuisong@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ed0d743-0fb4-40dc-9862-08da55e19ad0 X-MS-TrafficTypeDiagnostic: DM6PR02MB4315:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aLLCHlIUQr/c5eZ+WeQbAA4DYHhH6pt36QldmbMhh+BfQiTWDLvJoDzjaXzcKOr4JaJEACOz0GHoXFn5ryH6KqO1ElDKgMMPOH8QHuM9S3rJX2LNvS6Ys5hd9fCZ/rRVpEFlyRCrOJFsiwEZWuDy9l1W71HgYNHw5bKwxHh+eErPwqGuWk6iP0V1UwTLhPv8MzXOGjCMlB15n8uCrTgR9MB0EVa9EDWYhRwH5/p2Kwy/VPkRihIeyQD9WQJpyIJFWmdnSjg8tYfwvDMt+eUtZ4Degu8tor24IGnfi1qQzkuj/Smr0iqaQ7i6rNRGbYHNlT85AoeF7oElRxzb6L5HXL8o2mM1JiRqdhjh6fhawyRV0zsxtrVNWdEWjUV7rp/0RO0mQu/jwV0CzdvSviQAwAqRHiffCnS3mlJoul1CRys8FCNWGSoiVyr93tc1eHfrKOXE2SjAOvn3sGSY8ESodvMi497cz38eebYhHDyk4nRAJV9Z6eO4oh0gvWGn+e1YWW+K//BSmL5NHAq2h5bBdAhncp20tkSSkNNLC7vaUB1g9Gz+fpTkYPDbIW6hrDHp2rCq6tnOr811j24FM58q36P7LiY37Zr6b5hxRlzSLp8yZTUjyrQbGEOFXsPYKdlHcdCqWHtyEZL5jGBPRN4KZyZcyJMD+DtjR6CpYak4pZE+C61gFRNRMTWCRGnsetYNX7xxWoaghBudQK+zEPQQrXGZDEESywX+bqBWdviHOanPfsc+NDyMcA3P/otgh+F3LKA6aTCD+QRbfUfsaYzsE1ISFh7eHinHdYWOzPHP8VSv4BohStgLfsLEgYM1XehfL3NFFB4ssGV2oSTs9eybVMb9svcK9Ce02mJ+b3qMW09OLjdlxKUIuUrcOAr1wKErCODdrfKikuMs7QCv++s9eT8Vy8GRBtGVaXUIxTZrdgY= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch01.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(376002)(346002)(136003)(46966006)(36840700001)(40470700004)(82740400003)(53546011)(8676002)(316002)(54906003)(31686004)(478600001)(2616005)(110136005)(70586007)(41300700001)(186003)(31696002)(36860700001)(36756003)(70206006)(82310400005)(47076005)(9786002)(336012)(7636003)(4326008)(426003)(356005)(5660300002)(44832011)(40480700001)(26005)(83380400001)(8936002)(40460700003)(966005)(2906002)(50156003)(21314003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2022 13:01:07.6898 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ed0d743-0fb4-40dc-9862-08da55e19ad0 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-pvapexch01.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: DM6PR02MB4315 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/24/2022 8:23 AM, Huisong Li wrote: > > The rte_eth_dev_info.flow_type_rss_offloads is populated in terms of > RTE_ETH_RSS_* bits. If PMD sets RTE_ETH_RSS_L3_SRC_ONLY to > dev_info->flow_type_rss_offloads. testpmd will display "user defined 63" > when run 'show port info 0'. Because testpmd use flowtype_to_str() > to display the supported RSS offload of PMD. In fact, the function is > used to display flow type in FDIR commands for i40e or ixgbe. This patch > uses the RTE_ETH_RSS_* bits to display supported RSS offload of PMD. > > In addition, offloads that are not in rss_type_table[] should be displayed > as "unknown offload xxx", instead of "user defined 63". So this patch fixes > it. > There is something as "user defined" RSS type, so please keep it as it is. For more details please check: Commit 8b94c81e3341 ("app/testpmd: port info prints dynamically mapped flow types") Commit 5a4806d304e0 ("app/testpmd: support updating pctype mapping") Simply this is to allow doing RSS on user defined protocols, supported by plugging like Intel DDP. > Fixes: b12964f621dc ("ethdev: unification of RSS offload types") > Cc: stable@dpdk.org > > Signed-off-by: Huisong Li > Signed-off-by: Ferruh Yigit > --- > app/test-pmd/config.c | 40 ++++++++++++++++++++++++++-------------- > app/test-pmd/testpmd.h | 2 ++ > 2 files changed, 28 insertions(+), 14 deletions(-) > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index 62833fe97c..36a828307c 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -66,8 +66,6 @@ > > #define NS_PER_SEC 1E9 > > -static char *flowtype_to_str(uint16_t flow_type); > - > static const struct { > enum tx_pkt_split split; > const char *name; > @@ -675,6 +673,19 @@ print_dev_capabilities(uint64_t capabilities) > } > } > > +const char * > +rsstypes_to_str(uint64_t rss_type) > +{ > + uint16_t 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; > +} > + > void > port_infos_display(portid_t port_id) > { > @@ -779,19 +790,20 @@ 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; > - 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; i < sizeof(rss_offload_types) * CHAR_BIT; i++) { > + uint64_t rss_offload = RTE_BIT64(i); This logic is wrong, as we talked before some RSS types can be multiple bit, with about logic you can't catch them. The logic in the V2 of this set [1] is correct, which walks through 'rss_type_table[]' array and check if any value in that array exists in 'flow_type_rss_offloads'. [1] https://patchwork.dpdk.org/project/dpdk/patch/20220425092523.52338-2-lihuisong@huawei.com/ > + 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); > + } > } > } > > @@ -5604,6 +5616,8 @@ set_record_burst_stats(uint8_t on_off) > record_burst_stats = on_off; > } > > +#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE) > + > static char* > flowtype_to_str(uint16_t flow_type) > { > @@ -5647,8 +5661,6 @@ flowtype_to_str(uint16_t flow_type) > return NULL; > } > > -#if defined(RTE_NET_I40E) || defined(RTE_NET_IXGBE) > - > static inline void > print_fdir_mask(struct rte_eth_fdir_masks *mask) > { > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index eeefb5e70f..195488b602 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -1199,6 +1199,8 @@ extern int flow_parse(const char *src, void *result, unsigned int size, > struct rte_flow_item **pattern, > struct rte_flow_action **actions); > > +const char *rsstypes_to_str(uint64_t rss_type); > + > /* For registering driver specific testpmd commands. */ > struct testpmd_driver_commands { > TAILQ_ENTRY(testpmd_driver_commands) next; > -- > 2.33.0 >