1 Star 0 Fork 32

fantaotao1/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0258-fix-core-dump-when-slave-mac-failed.patch 3.27 KB
一键复制 编辑 原始数据 按行查看 历史
From 8f81630296d5d305613a1a766a7a2fbc4690df79 Mon Sep 17 00:00:00 2001
From: compile_success <980965867@qq.com>
Date: Mon, 26 Jun 2023 08:45:51 +0000
Subject: [PATCH] fix core dump when slave mac failed
---
src/lstack/core/lstack_dpdk.c | 37 +++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/src/lstack/core/lstack_dpdk.c b/src/lstack/core/lstack_dpdk.c
index f865d55..f6cabf8 100644
--- a/src/lstack/core/lstack_dpdk.c
+++ b/src/lstack/core/lstack_dpdk.c
@@ -495,13 +495,32 @@ int32_t dpdk_ethdev_init(int port_id, bool bond_port)
for (int i = 0; i < slave_num; i++) {
ret = dpdk_ethdev_init(slave_port_id[i], 0);
if (ret != 0) {
- LSTACK_LOG(ERR, LSTACK, "dpdk_ethdev_init failed\n");
+ LSTACK_LOG(ERR, LSTACK, "dpdk_ethdev_init failed ret = %d\n", ret);
return -1;
}
ret = rte_eth_promiscuous_enable(slave_port_id[i]);
- rte_eth_allmulticast_enable(slave_port_id[i]);
+ if (ret != 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk slave enable promiscuous failed ret = %d\n", ret);
+ return -1;
+ }
+
+ ret = rte_eth_allmulticast_enable(slave_port_id[i]);
+ if (ret != 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk slave enable allmulticast failed ret = %d\n", ret);
+ return -1;
+ }
+
ret = rte_eth_bond_slave_add(port_id, slave_port_id[i]);
+ if (ret != 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk add slave port failed ret = %d\n", ret);
+ return -1;
+ }
+
ret = rte_eth_dev_start(slave_port_id[i]);
+ if (ret != 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk start slave port failed ret = %d\n", ret);
+ return -1;
+ }
}
}
@@ -670,27 +689,41 @@ int32_t init_dpdk_ethdev(void)
}
ret = dpdk_ethdev_init(bond_port_id, 1);
+ if (ret != 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk_ethdev_init failed ret = %d\n", ret);
+ return -1;
+ }
+
ret = rte_eth_bond_xmit_policy_set(bond_port_id, BALANCE_XMIT_POLICY_LAYER34);
if (ret < 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk set bond xmit policy failed ret = %d\n", ret);
return -1;
}
ret = rte_eth_bond_8023ad_dedicated_queues_enable(bond_port_id);
if (ret < 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk enable 8023 dedicated queues failed ret = %d\n", ret);
return -1;
}
ret = rte_eth_promiscuous_enable(bond_port_id);
if (ret < 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk enable promiscuous failed ret = %d\n", ret);
return -1;
}
ret = rte_eth_allmulticast_enable(bond_port_id);
if (ret < 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk enable allmulticast failed ret = %d\n", ret);
return -1;
}
ret = rte_eth_dev_start(bond_port_id);
+ if (ret < 0) {
+ LSTACK_LOG(ERR, LSTACK, "dpdk start bond port failed ret = %d\n", ret);
+ return -1;
+ }
+
/* 20: sleep for lacp ,this is a temp plan, it will be changed in future */
int wait_lacp = 20;
sleep(wait_lacp);
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fantaotao1/gazelle.git
git@gitee.com:fantaotao1/gazelle.git
fantaotao1
gazelle
gazelle
master

搜索帮助