1 Star 0 Fork 76

吴昌盛/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0010-dpdk-fix-coredump-when-primary-process-attach-without-shared-file.patch 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
吴昌盛 提交于 2021-12-25 17:37 . add gazelle support
From 097d8acb68c7d7dbfd7800c7f69eaf171ce9da4b Mon Sep 17 00:00:00 2001
From: Changsheng Wu <wuchangsheng2@huawei.com>
Date: Sat, 18 Dec 2021 16:49:16 +0800
Subject: [PATCH] 0009
---
lib/eal/linux/eal.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index f269e67fae..2555043155 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -524,22 +524,29 @@ rte_config_init(void)
return 0;
}
-static void
+static int
rte_sec_config_init(const int sec_idx)
{
int mem_cfg_fd = -1;
int mmap_flags = PROT_READ | PROT_WRITE;
+ int ret = -1;
struct rte_config *rte_cfg = rte_eal_sec_get_configuration(sec_idx);
struct internal_config *internal_conf = rte_eal_sec_get_internal_config(sec_idx);
rte_cfg->process_type = internal_conf->process_type;
- __rte_eal_config_attach(mmap_flags, &mem_cfg_fd,
+ ret = __rte_eal_config_attach(mmap_flags, &mem_cfg_fd,
rte_eal_sec_get_runtime_dir(sec_idx),
internal_conf, rte_cfg);
+ if (ret < 0) {
+ RTE_LOG(ERR, EAL, "Cannot attach shared memory\n");
+ return -1;
+ }
+
close(mem_cfg_fd);
+ return 0;
}
static int
@@ -1561,7 +1568,11 @@ rte_eal_sec_attach(int argc, char **argv)
return -1;
}
- rte_sec_config_init(sec_idx);
+ ret = rte_sec_config_init(sec_idx);
+ if (ret < 0) {
+ RTE_LOG(ERR, EAL, "Cannot init sec config\n");
+ return -1;
+ }
ret = rte_eal_sec_memory_init(sec_idx);
if (ret < 0) {
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu-changsheng/dpdk.git
git@gitee.com:wu-changsheng/dpdk.git
wu-changsheng
dpdk
dpdk
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385