13 Star 5 Fork 32

src-openEuler/gazelle

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0232-fix-issue-create-virtio_user-based-on-bond4-main-net.patch 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
From 81b3494fbb9a6b346560220bf4b4dc10ae8f9881 Mon Sep 17 00:00:00 2001
From: hkk <hankangkang5@huawei.com>
Date: Wed, 24 Jul 2024 15:30:48 +0800
Subject: [PATCH] fix issue: create virtio_user based on bond4 main network
card
---
src/lstack/core/lstack_dpdk.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
index e17242c..50fbdf6 100644
--- a/src/lstack/core/lstack_dpdk.c
+++ b/src/lstack/core/lstack_dpdk.c
@@ -798,6 +798,7 @@ int32_t init_dpdk_ethdev(void)
LSTACK_LOG(ERR, LSTACK, "bond device create failed, ret=%d\n", ret);
return -1;
}
+ port_id = rte_eth_bond_primary_get(get_protocol_stack_group()->port_id);
} else {
port_id = ethdev_port_id(cfg->mac_addr);
if (port_id < 0) {
@@ -818,8 +819,14 @@ int32_t init_dpdk_ethdev(void)
}
}
#endif
- if (get_global_cfg_params()->flow_bifurcation && virtio_port_create(port_id) != 0) {
- return -1;
+ if (cfg->flow_bifurcation) {
+ if (cfg->kni_switch) {
+ LSTACK_LOG(ERR, LSTACK, "flow_bifurcation and kni_switch cannot both be enabled, please check them\n");
+ return -1;
+ }
+ if (virtio_port_create(port_id) != 0) {
+ return -1;
+ }
}
return 0;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/gazelle.git
git@gitee.com:src-openeuler/gazelle.git
src-openeuler
gazelle
gazelle
master

搜索帮助