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 D3352A00BE; Mon, 25 Apr 2022 11:26:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96C05427FD; Mon, 25 Apr 2022 11:26:19 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 592E941132 for ; Mon, 25 Apr 2022 11:26:16 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kn03k5XRLz1JBgj; Mon, 25 Apr 2022 17:25:22 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 25 Apr 2022 17:26:13 +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; Mon, 25 Apr 2022 17:26:13 +0800 From: Huisong Li To: CC: , , , , Subject: [PATCH V1 1/2] app/testpmd: fix supported RSS offload display Date: Mon, 25 Apr 2022 17:25:22 +0800 Message-ID: <20220425092523.52338-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220425092523.52338-1-lihuisong@huawei.com> References: <20220425092523.52338-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index cc8e7aa138..f58da01a3a 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -669,6 +669,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 +787,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); -- 2.33.0