1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0015-fix-internal-cfg-and-fbarray-attach-mememory-leak.patch 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
吴昌盛 提交于 2021-12-25 17:37 . add gazelle support
From 847cbe34e8e45a0c0613cf5cd96f06ee31ada0f9 Mon Sep 17 00:00:00 2001
From: Changsheng Wu <wuchangsheng2@huawei.com>
Date: Sat, 18 Dec 2021 17:02:16 +0800
Subject: [PATCH] 0014
---
lib/eal/common/eal_common_fbarray.c | 13 ++++++++-----
lib/eal/linux/eal.c | 1 +
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index fa726cd2f5..b809d3c669 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -911,17 +911,20 @@ __rte_fbarray_attach(struct rte_fbarray *arr, const char *runtime_dir,
fd = -1;
}
- /* store our new memory area */
- ma->addr = data;
- ma->fd = fd; /* keep fd until detach/destroy */
- ma->len = mmap_len;
-
if (!internal_conf->pri_and_sec) {
+ /* store our new memory area */
+ ma->addr = data;
+ ma->fd = fd; /* keep fd until detach/destroy */
+ ma->len = mmap_len;
+
TAILQ_INSERT_TAIL(&mem_area_tailq, ma, next);
/* we're done */
rte_spinlock_unlock(&mem_area_lock);
+ } else {
+ /* pri_and_sec don't use mem_area_tailq */
+ free(ma);
}
return 0;
fail:
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index f70c4d55fa..2dee945be4 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -564,6 +564,7 @@ eal_sec_config_cleanup(const int sec_idx)
}
memset(lc_rte_cfg, 0, sizeof(*lc_rte_cfg));
+ eal_cleanup_config(lc_internal_cfg);
memset(lc_internal_cfg, 0, sizeof(*lc_internal_cfg));
memset(lc_runtime_dir, 0, PATH_MAX);
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助