1 Star 0 Fork 32

compile_success/gazelle_3

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0104-support-conf-control-app-bind-numa.patch 3.39 KB
一键复制 编辑 原始数据 按行查看 历史
吴昌盛 提交于 2022-10-08 22:27 . adapt ceph client
From 8a148ade17e4c73cd768ad81b30096139898bbe7 Mon Sep 17 00:00:00 2001
From: wu-changsheng <wuchangsheng2@huawei.com>
Date: Sat, 8 Oct 2022 21:03:58 +0800
Subject: [PATCH 20/21] support conf control app bind numa
---
src/lstack/api/lstack_epoll.c | 9 +++++++--
src/lstack/core/lstack_cfg.c | 20 +++++++++++++++++++-
src/lstack/include/lstack_cfg.h | 1 +
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c
index cc1cbf0..bd3396a 100644
--- a/src/lstack/api/lstack_epoll.c
+++ b/src/lstack/api/lstack_epoll.c
@@ -343,7 +343,9 @@ static void epoll_bind_statck(struct wakeup_poll *wakeup)
}
if (wakeup->bind_stack != wakeup->max_stack && wakeup->max_stack) {
- bind_to_stack_numa(wakeup->max_stack);
+ if (get_global_cfg_params()->app_bind_numa) {
+ bind_to_stack_numa(wakeup->max_stack);
+ }
if (wakeup->bind_stack) {
unregister_wakeup(wakeup->bind_stack, wakeup);
}
@@ -461,7 +463,10 @@ static void poll_bind_statck(struct wakeup_poll *wakeup, int32_t *stack_count)
if (wakeup->bind_stack) {
unregister_wakeup(wakeup->bind_stack, wakeup);
}
- bind_to_stack_numa(stack_group->stacks[bind_id]);
+
+ if (get_global_cfg_params()->app_bind_numa) {
+ bind_to_stack_numa(stack_group->stacks[bind_id]);
+ }
wakeup->bind_stack = stack_group->stacks[bind_id];
register_wakeup(wakeup->bind_stack, wakeup);
}
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index 19a5b30..2cd9989 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -55,6 +55,7 @@ static int32_t parse_dpdk_args(void);
static int32_t parse_gateway_addr(void);
static int32_t parse_kni_switch(void);
static int32_t parse_listen_shadow(void);
+static int32_t parse_app_bind_numa(void);
struct config_vector_t {
const char *name;
@@ -71,8 +72,9 @@ static struct config_vector_t g_config_tbl[] = {
{ "num_cpus", parse_stack_cpu_number },
{ "num_wakeup", parse_wakeup_cpu_number },
{ "low_power_mode", parse_low_power_mode },
- { "kni_switch", parse_kni_switch },
+ { "kni_switch", parse_kni_switch },
{ "listen_shadow", parse_listen_shadow },
+ { "app_bind_numa", parse_app_bind_numa },
{ NULL, NULL }
};
@@ -710,6 +712,22 @@ static int32_t parse_listen_shadow(void)
return 0;
}
+static int32_t parse_app_bind_numa(void)
+{
+ const config_setting_t *arg = NULL;
+
+ arg = config_lookup(&g_config, "app_bind_numa");
+ if (arg == NULL) {
+ g_config_params.app_bind_numa = true;
+ return 0;
+ }
+
+ int32_t val = config_setting_get_int(arg);
+ g_config_params.app_bind_numa = (val == 0) ? false : true;
+
+ return 0;
+}
+
static int32_t parse_kni_switch(void)
{
const config_setting_t *arg = NULL;
diff --git a/src/lstack/include/lstack_cfg.h b/src/lstack/include/lstack_cfg.h
index 1a6ef39..80dfd24 100644
--- a/src/lstack/include/lstack_cfg.h
+++ b/src/lstack/include/lstack_cfg.h
@@ -76,6 +76,7 @@ struct cfg_params {
bool use_ltran; // ture:lstack read from nic false:read form ltran
bool kni_switch;
bool listen_shadow; // true:listen in all stack thread. false:listen in one stack thread.
+ bool app_bind_numa;
int dpdk_argc;
char **dpdk_argv;
struct secondary_attach_arg sec_attach_arg;
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/compile_success/gazelle_3.git
git@gitee.com:compile_success/gazelle_3.git
compile_success
gazelle_3
gazelle_3
master

搜索帮助