1 Star 0 Fork 75

mengxuanzhang/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-dpdk-bugfix-the-deadlock-in-rte_eal_init.patch 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2024-01-12 02:37 . add self-developed patches
From cf3c7fd3f5898d515899841eadfe86a154c0268b Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Thu, 11 Jan 2024 16:14:16 +0800
Subject: [PATCH] dpdk-bugfix-the-deadlock-in-rte_eal_init
---
lib/eal/linux/eal.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 57da058..28226fc 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1126,7 +1126,7 @@ rte_eal_init(int argc, char **argv)
rte_eal_init_alert("Cannot get hugepage information.");
rte_errno = EACCES;
rte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed);
- return -1;
+ goto out;
}
}
@@ -1151,7 +1151,7 @@ rte_eal_init(int argc, char **argv)
rte_eal_init_alert("Cannot init logging.");
rte_errno = ENOMEM;
rte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed);
- return -1;
+ goto out;
}
#ifdef VFIO_PRESENT
@@ -1159,7 +1159,7 @@ rte_eal_init(int argc, char **argv)
rte_eal_init_alert("Cannot init VFIO");
rte_errno = EAGAIN;
rte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed);
- return -1;
+ goto out;
}
#endif
/* in secondary processes, memory init may allocate additional fbarrays
@@ -1169,7 +1169,7 @@ rte_eal_init(int argc, char **argv)
if (rte_eal_memzone_init() < 0) {
rte_eal_init_alert("Cannot init memzone");
rte_errno = ENODEV;
- return -1;
+ goto out;
}
rte_mcfg_mem_read_lock();
@@ -1178,7 +1178,7 @@ rte_eal_init(int argc, char **argv)
rte_mcfg_mem_read_unlock();
rte_eal_init_alert("Cannot init memory");
rte_errno = ENOMEM;
- return -1;
+ goto out;
}
/* the directories are locked during eal_hugepage_info_init */
@@ -1323,6 +1323,10 @@ rte_eal_init(int argc, char **argv)
eal_mcfg_complete();
return fctret;
+
+out:
+ eal_hugedirs_unlock();
+ return -1;
}
static int
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mengxuanzhang/dpdk.git
git@gitee.com:mengxuanzhang/dpdk.git
mengxuanzhang
dpdk
dpdk
master

搜索帮助