gazelle/0181-move-control_client_thread-creation-after-control_in.patch
kircher 06c078f260 sync add ret check in pthread_create and fix example bug
(cherry picked from commit f1a55c8332318e5f22d38ed2141642e7c701fbd9)
2023-01-16 17:17:51 +08:00

34 lines
1.1 KiB
Diff

From 400c9f494c2217cba4ca48af83c53f36663dc066 Mon Sep 17 00:00:00 2001
From: kircher <majun65@huawei.com>
Date: Tue, 10 Jan 2023 20:11:05 +0800
Subject: [PATCH] move control_client_thread creation after control_in and
dpdk_skip_nic_init
---
src/lstack/core/lstack_init.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/lstack/core/lstack_init.c b/src/lstack/core/lstack_init.c
index 6347ab1..477c5e2 100644
--- a/src/lstack/core/lstack_init.c
+++ b/src/lstack/core/lstack_init.c
@@ -223,11 +223,14 @@ static void create_control_thread(void)
pthread_t tid;
if (use_ltran()) {
- ret = pthread_create(&tid, NULL, (void *(*)(void *))control_client_thread, NULL);
+ /*
+ * The function call here should be in strict order.
+ */
dpdk_skip_nic_init();
if (control_init_client(false) != 0) {
LSTACK_EXIT(1, "control_init_client failed\n");
}
+ ret = pthread_create(&tid, NULL, (void *(*)(void *))control_client_thread, NULL);
} else {
ret = pthread_create(&tid, NULL, (void *(*)(void *))control_server_thread, NULL);
ret = dpdk_eal_init();
--
2.33.0