1 Star 0 Fork 32

hantwofish/gazelle_1

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0191-virtio-flow_bifurcation-switch.patch 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
From 259092f39041968a07b395c43ed9cd26250215d9 Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
Date: Tue, 18 Jun 2024 11:29:58 +0800
Subject: [PATCH] [virtio]: flow_bifurcation switch
---
src/lstack/core/lstack_cfg.c | 12 ++++++++++++
src/lstack/include/lstack_cfg.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index 56f290e..f0c5f4f 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -86,6 +86,7 @@ static int32_t parse_nic_vlan_mode(void);
static int32_t parse_defaule_nonblock_mode(void);
static int32_t parse_rpc_msg_max(void);
static int32_t parse_send_cache_mode(void);
+static int32_t parse_flow_bifurcation(void);
#define PARSE_ARG(_arg, _arg_string, _default_val, _min_val, _max_val, _ret) \
do { \
@@ -152,6 +153,7 @@ static struct config_vector_t g_config_tbl[] = {
{ "nonblock_mode", parse_defaule_nonblock_mode },
{ "rpc_msg_max", parse_rpc_msg_max },
{ "send_cache_mode", parse_send_cache_mode },
+ { "flow_bifurcation", parse_flow_bifurcation},
{ NULL, NULL }
};
@@ -1393,3 +1395,13 @@ static int32_t parse_send_cache_mode(void)
return ret;
}
+static int32_t parse_flow_bifurcation(void)
+{
+ int32_t ret;
+ PARSE_ARG(g_config_params.flow_bifurcation, "flow_bifurcation", 0, 0, 1, ret);
+ if (ret != 0) {
+ LSTACK_PRE_LOG(LSTACK_ERR, "cfg: invalid flow_bifurcation value %d. only support 0 or 1\n",
+ g_config_params.flow_bifurcation);
+ }
+ return ret;
+}
diff --git a/src/lstack/include/lstack_cfg.h b/src/lstack/include/lstack_cfg.h
index b9721ff..9649d73 100644
--- a/src/lstack/include/lstack_cfg.h
+++ b/src/lstack/include/lstack_cfg.h
@@ -122,6 +122,7 @@ struct cfg_params {
bool nonblock_mode;
uint32_t rpc_msg_max;
bool send_cache_mode;
+ bool flow_bifurcation;
};
struct cfg_params *get_global_cfg_params(void);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hantwofish/gazelle_1.git
git@gitee.com:hantwofish/gazelle_1.git
hantwofish
gazelle_1
gazelle_1
master

搜索帮助