1 Star 0 Fork 32

misaka00251/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0098-support-dpdk-dynamic-memory.patch 2.14 KB
一键复制 编辑 原始数据 按行查看 历史
吴昌盛 提交于 2022-10-08 22:27 . adapt ceph client
From cc9db5e298dab1c1bac927464538ba51da07d9c6 Mon Sep 17 00:00:00 2001
From: wu-changsheng <wuchangsheng2@huawei.com>
Date: Sat, 8 Oct 2022 10:55:05 +0800
Subject: [PATCH 14/21] support dpdk dynamic memory
---
src/lstack/core/lstack_cfg.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index b6a517b..19a5b30 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -192,7 +192,6 @@ static int32_t parse_devices(void)
static int32_t get_param_idx(int32_t argc, char **argv, const char *param)
{
- int32_t ret;
int32_t idx;
if ((argc <= 0) || (argv == NULL) || (param == NULL)) {
@@ -200,8 +199,7 @@ static int32_t get_param_idx(int32_t argc, char **argv, const char *param)
}
for (idx = 0; idx < argc; ++idx) {
- ret = strncmp(argv[idx], param, strlen(param));
- if (ret == 0) {
+ if (strncmp(argv[idx], param, strlen(param)) == 0) {
return idx;
}
}
@@ -249,6 +247,7 @@ static int32_t parse_stack_cpu_number(void)
if (args == NULL) {
return -EINVAL;
}
+
if (!have_corelist_arg(g_config_params.dpdk_argc, g_config_params.dpdk_argv)) {
int32_t idx = get_param_idx(g_config_params.dpdk_argc, g_config_params.dpdk_argv, OPT_BIND_CORELIST);
if (idx < 0) {
@@ -465,12 +464,15 @@ static int32_t turn_args_to_config(int32_t argc, char **argv)
// OPT_SOCKET_MEM
idx = get_param_idx(argc, argv, OPT_SOCKET_MEM);
if ((idx < 0) || (idx + 1 >= argc)) {
- LSTACK_LOG(ERR, LSTACK, "Cannot find param %s\n", OPT_SOCKET_MEM);
- return idx;
- }
- ret = gazelle_parse_socket_mem(argv[idx + 1], &g_config_params.sec_attach_arg);
- if (ret < 0) {
- return ret;
+ if (use_ltran()) {
+ LSTACK_LOG(ERR, LSTACK, "Cannot find param %s\n", OPT_SOCKET_MEM);
+ return idx;
+ }
+ } else {
+ ret = gazelle_parse_socket_mem(argv[idx + 1], &g_config_params.sec_attach_arg);
+ if (ret < 0) {
+ return ret;
+ }
}
// OPT_BASE_VIRTADDR
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/misaka00251/gazelle.git
git@gitee.com:misaka00251/gazelle.git
misaka00251
gazelle
gazelle
master

搜索帮助