From 399202e307d0a062a58447db9c216f9051716ed7 Mon Sep 17 00:00:00 2001 From: kircher Date: Fri, 16 Dec 2022 17:19:38 +0800 Subject: [PATCH] sync move select_thread_path after posix_api_init (cherry picked from commit 4a34a374cf09b03d2f0ab5ff5c70818165e38f66) --- ...ect_thread_path-after-posix_api_init.patch | 43 +++++++++++++++++++ gazelle.spec | 6 ++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0157-move-select_thread_path-after-posix_api_init.patch diff --git a/0157-move-select_thread_path-after-posix_api_init.patch b/0157-move-select_thread_path-after-posix_api_init.patch new file mode 100644 index 0000000..d7ea8df --- /dev/null +++ b/0157-move-select_thread_path-after-posix_api_init.patch @@ -0,0 +1,43 @@ +From bd238ab678150c216d672409a5ddb4b7dd778fec Mon Sep 17 00:00:00 2001 +From: kircher +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 + diff --git a/gazelle.spec b/gazelle.spec index d09a3e2..e8335c5 100644 --- a/gazelle.spec +++ b/gazelle.spec @@ -2,7 +2,7 @@ Name: gazelle Version: 1.0.1 -Release: 32 +Release: 33 Summary: gazelle is a high performance user-mode stack License: MulanPSL-2.0 URL: https://gitee.com/openeuler/gazelle @@ -171,6 +171,7 @@ Patch9153: 0153-rxtx-mbuf-pool-size-config-by-conf.patch Patch9154: 0154-fix-kernel-event-thread-bind-numa-failed.patch Patch9155: 0155-stack-thread-parms-config-by-conf.patch Patch9156: 0156-ltran-rxtx-mbuf-pool-size-config-by-conf.patch +Patch9157: 0157-move-select_thread_path-after-posix_api_init.patch %description %{name} is a high performance user-mode stack. @@ -211,6 +212,9 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b %config(noreplace) %{conf_path}/ltran.conf %changelog +* Fri Dec 16 2022 kircher - 1.0.1-33 +- move select_thread_path after posix_api_init + * Thu Dec 15 2022 jiangheng - 1.0.1-32 - ltran rxtx mbuf pool size config by conf