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 25A55A0545; Wed, 29 Jun 2022 10:35:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19F2942B76; Wed, 29 Jun 2022 10:35:30 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 7CED342905 for ; Wed, 29 Jun 2022 10:35:26 +0200 (CEST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LXvqS40PdzhYwH; Wed, 29 Jun 2022 16:33:08 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 29 Jun 2022 16:35:18 +0800 Received: from localhost.localdomain (10.28.79.22) 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, 29 Jun 2022 16:35:18 +0800 From: Huisong Li To: , , , CC: , , , , Subject: [PATCH V6 1/8] app/testpmd: fix supported RSS offload display Date: Wed, 29 Jun 2022 16:34:44 +0800 Message-ID: <20220629083451.21954-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220629083451.21954-1-lihuisong@huawei.com> References: <20220429102445.23711-1-lihuisong@huawei.com> <20220629083451.21954-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) 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 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. 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..a1183ad18e 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); + if ((rss_offload_types & rss_offload) != 0) { + const char *p = rsstypes_to_str(rss_offload); + if (p) + printf(" %s\n", p); + else + printf(" user defined %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.22.0