dpdk/0019-reinit-support-return-ok.patch

40 lines
1.2 KiB
Diff
Raw Normal View History

2023-11-03 09:16:16 +08:00
From d6d940b4a57cefdfa8efe751480cd4e7a1c10613 Mon Sep 17 00:00:00 2001
2022-10-06 17:13:02 +08:00
From: wuchangsheng <wuchangsheng2@huawei.com>
2023-11-03 09:16:16 +08:00
Date: Thu, 6 Oct 2022 17:09:03 +0800
2022-10-06 17:13:02 +08:00
Subject: [PATCH] reinit support return ok
---
2023-11-03 09:16:16 +08:00
lib/librte_eal/linux/eal/eal.c | 8 ++++++++
2022-10-06 17:13:02 +08:00
1 file changed, 8 insertions(+)
2023-11-03 09:16:16 +08:00
diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c
index 92f1b56..7673b18 100644
--- a/lib/librte_eal/linux/eal/eal.c
+++ b/lib/librte_eal/linux/eal/eal.c
@@ -1081,6 +1081,7 @@ rte_eal_init(int argc, char **argv)
2022-10-06 17:13:02 +08:00
int i, fctret, ret;
pthread_t thread_id;
2023-11-03 09:16:16 +08:00
static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
+ static uint32_t reinit_ok = 0;
2022-10-06 17:13:02 +08:00
const char *p;
static char logid[PATH_MAX];
2023-11-03 09:16:16 +08:00
char cpuset[RTE_CPU_AFFINITY_STR_LEN];
@@ -1094,7 +1095,14 @@ rte_eal_init(int argc, char **argv)
2022-10-06 17:13:02 +08:00
return -1;
}
2023-11-03 09:16:16 +08:00
+ if (argc > 1 && !strncmp(argv[1], "reinit-ok", strlen("reinit-ok"))) {
+ reinit_ok = 1;
+ }
2022-10-06 17:13:02 +08:00
+
2023-11-03 09:16:16 +08:00
if (!rte_atomic32_test_and_set(&run_once)) {
+ if (reinit_ok) {
+ return 0;
+ }
2022-10-06 17:13:02 +08:00
rte_eal_init_alert("already called initialization.");
rte_errno = EALREADY;
return -1;
--
2.27.0