1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0175-app-testpmd-unify-RSS-types-display.patch 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
From 6515c3f93ea7b5f5ef79f32ca7360b9edfc5e2ab Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 21 Oct 2022 15:36:51 +0800
Subject: [PATCH 175/189] app/testpmd: unify RSS types display
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 <lihuisong@huawei.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
---
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 b08face76d..7b725fc7a1 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1554,6 +1554,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)
{
@@ -1596,13 +1613,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 *
@@ -3054,13 +3065,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;
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助