From patchwork Fri Apr 29 10:24:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 110514 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06517A0093; Fri, 29 Apr 2022 12:25:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA5134282B; Fri, 29 Apr 2022 12:25:44 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id BA7974161A for ; Fri, 29 Apr 2022 12:25:40 +0200 (CEST) Received: from kwepemi100007.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KqT6805ZqzCsLX; Fri, 29 Apr 2022 18:21:03 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by kwepemi100007.china.huawei.com (7.221.188.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 29 Apr 2022 18:25:38 +0800 Received: from localhost.localdomain (10.69.192.56) 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; Fri, 29 Apr 2022 18:25:38 +0800 From: Huisong Li To: CC: , , , , , Subject: [PATCH V2 1/2] app/testpmd: fix supported RSS offload display Date: Fri, 29 Apr 2022 18:24:44 +0800 Message-ID: <20220429102445.23711-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220429102445.23711-1-lihuisong@huawei.com> References: <20220429102445.23711-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] 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 And 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. 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 --- app/test-pmd/config.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cc8e7aa138..cc47db3690 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; @@ -669,6 +667,20 @@ print_dev_capabilities(uint64_t capabilities) } } +static void +show_rss_types(uint64_t rss_hf) +{ + uint16_t i; + + 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); + } + printf("\n"); +} + void port_infos_display(portid_t port_id) { @@ -773,20 +785,8 @@ port_infos_display(portid_t port_id) if (!dev_info.flow_type_rss_offloads) printf("No RSS offload flow type is supported.\n"); else { - 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); - } + printf("Supported RSS offload:\n"); + show_rss_types(dev_info.flow_type_rss_offloads); } printf("Minimum size of RX buffer: %u\n", dev_info.min_rx_bufsize); @@ -5512,6 +5512,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) { @@ -5555,8 +5557,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) { From patchwork Fri Apr 29 10:24:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 110513 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CA46A0093; Fri, 29 Apr 2022 12:25:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AF774281C; Fri, 29 Apr 2022 12:25:44 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 9FE26415D7 for ; Fri, 29 Apr 2022 12:25:40 +0200 (CEST) Received: from kwepemi100006.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KqTBL51r3z1JBkC; Fri, 29 Apr 2022 18:24:42 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by kwepemi100006.china.huawei.com (7.221.188.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 29 Apr 2022 18:25:39 +0800 Received: from localhost.localdomain (10.69.192.56) 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; Fri, 29 Apr 2022 18:25:38 +0800 From: Huisong Li To: CC: , , , , , Subject: [PATCH V2 2/2] app/testpmd: unify RSS types display Date: Fri, 29 Apr 2022 18:24:45 +0800 Message-ID: <20220429102445.23711-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220429102445.23711-1-lihuisong@huawei.com> References: <20220429102445.23711-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] 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 Unify RSS types display. Signed-off-by: Huisong Li --- app/test-pmd/config.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cc47db3690..1d9ac4a038 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1525,13 +1525,7 @@ rss_config_display(struct rte_flow_action_rss *rss_conf) 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); - } + show_rss_types(rss_conf->types); } static struct port_indirect_action * @@ -3731,13 +3725,7 @@ 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); - } - printf("\n"); + show_rss_types(rss_hf); if (!show_rss_key) return; printf("RSS key:\n"); From patchwork Fri Jun 24 07:23:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lihuisong (C)" X-Patchwork-Id: 113405 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9CAE5A0032; Fri, 24 Jun 2022 09:25:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B1FF40A87; Fri, 24 Jun 2022 09:25:43 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 70B0040A82 for ; Fri, 24 Jun 2022 09:25:41 +0200 (CEST) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LTpTx3ND1zShFJ; Fri, 24 Jun 2022 15:22:13 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 24 Jun 2022 15:25:39 +0800 Received: from localhost.localdomain (10.69.192.56) 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; Fri, 24 Jun 2022 15:25:38 +0800 From: Huisong Li To: , , , CC: , , , , Subject: [PATCH V5 4/7] app/testpmd: unify RSS types display Date: Fri, 24 Jun 2022 15:23:58 +0800 Message-ID: <20220624072401.21839-5-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220624072401.21839-1-lihuisong@huawei.com> References: <20220429102445.23711-1-lihuisong@huawei.com> <20220624072401.21839-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) 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 'rss_type_table[]' maintains the name and value of RSS types. This patch unifies a common interface to display RSS types. Signed-off-by: Huisong Li Signed-off-by: Ferruh Yigit --- app/test-pmd/config.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3bf03c0969..a0a5f12c71 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1569,6 +1569,23 @@ port_flow_complain(struct rte_flow_error *error) return -err; } +static void +rss_types_display(uint64_t rss_types) +{ + uint16_t i; + + if (rss_types == 0) + return; + + for (i = 0; rss_type_table[i].str; i++) { + if (rss_type_table[i].rss_type == 0) + continue; + if ((rss_types & rss_type_table[i].rss_type) == + rss_type_table[i].rss_type) + printf(" %s", rss_type_table[i].str); + } +} + static void rss_config_display(struct rte_flow_action_rss *rss_conf) { @@ -1611,13 +1628,7 @@ rss_config_display(struct rte_flow_action_rss *rss_conf) 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); - } + rss_types_display(rss_conf->types); } static struct port_indirect_action * @@ -3847,13 +3858,8 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key) printf("RSS disabled\n"); 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); - } + printf("RSS functions:\n"); + rss_types_display(rss_hf); printf("\n"); if (!show_rss_key) return;