sync move select_thread_path after posix_api_init

(cherry picked from commit 1a84e349a49e300499c8c7a4d5ae9a9eb7c5b265)
This commit is contained in:
kircher 2022-12-16 17:20:03 +08:00 committed by openeuler-sync-bot
parent 53b848aaaf
commit 6d4d8eb40c
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From bd238ab678150c216d672409a5ddb4b7dd778fec Mon Sep 17 00:00:00 2001
From: kircher <majun65@huawei.com>
Date: Fri, 16 Dec 2022 16:53:21 +0800
Subject: [PATCH] move select_thread_path after posix_api_init
---
src/lstack/api/lstack_wrap.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index 2eeda6b..d976f74 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -50,18 +50,21 @@ bool select_thread_path(void);
static enum KERNEL_LWIP_PATH select_path(int fd)
{
- if (!select_thread_path()) {
- return PATH_KERNEL;
- }
-
if (unlikely(posix_api == NULL)) {
- /* posix api maybe call before gazelle init */
+ /*
+ * posix api maybe call before gazelle init
+ * So, we must call posix_api_init at the head of select_path
+ */
if (posix_api_init() != 0) {
LSTACK_PRE_LOG(LSTACK_ERR, "posix_api_init failed\n");
}
return PATH_KERNEL;
}
+ if (!select_thread_path()) {
+ return PATH_KERNEL;
+ }
+
if (unlikely(posix_api->ues_posix)) {
return PATH_KERNEL;
}
--
2.33.0

View File

@ -2,7 +2,7 @@
Name: gazelle
Version: 1.0.1
Release: 35
Release: 36
Summary: gazelle is a high performance user-mode stack
License: MulanPSL-2.0
URL: https://gitee.com/openeuler/gazelle
@ -176,6 +176,7 @@ Patch9158: 0158-rxtx-mbuf-pool-size-config-by-conf.patch
Patch9159: 0159-fix-kernel-event-thread-bind-numa-failed.patch
Patch9160: 0160-stack-thread-parms-config-by-conf.patch
Patch9161: 0161-ltran-rxtx-mbuf-pool-size-config-by-conf.patch
Patch9162: 0162-move-select_thread_path-after-posix_api_init.patch
%description
%{name} is a high performance user-mode stack.
@ -216,6 +217,9 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
%config(noreplace) %{conf_path}/ltran.conf
%changelog
* Fri Dec 16 2022 kircher <majun65@huawei.com> - 1.0.1-36
- move select_thread_path after posix_api_init
* Thu Dec 15 2022 jiangheng <jiangheng14@huawei.com> - 1.0.1-35
- ltran rxtx mbuf pool config by conf