Fetch the repository succeeded.
This action will force synchronization from src-openEuler/dpdk, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。