diff --git a/0185-fix-fin-pack-free-coredump.patch b/0185-fix-fin-pack-free-coredump.patch new file mode 100644 index 0000000..22aa7d1 --- /dev/null +++ b/0185-fix-fin-pack-free-coredump.patch @@ -0,0 +1,25 @@ +From 8bcbc7ef61b9193da5d3deb519211a2406564298 Mon Sep 17 00:00:00 2001 +From: compile_success <980965867@qq.com> +Date: Fri, 7 Jun 2024 01:51:34 +0000 +Subject: [PATCH] fix fin pack free coredump + +--- + src/lstack/core/lstack_lwip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c +index 667ffd7..628319c 100644 +--- a/src/lstack/core/lstack_lwip.c ++++ b/src/lstack/core/lstack_lwip.c +@@ -88,7 +88,7 @@ static void reset_sock_data(struct lwip_sock *sock) + sock->remain_len = 0; + sock->already_bind_numa = 0; + +- if (sock->recv_lastdata) { ++ if (sock->recv_lastdata && sock->recv_lastdata != (void *)&fin_packet) { + pbuf_free(sock->recv_lastdata); + } + sock->recv_lastdata = NULL; +-- +2.33.0 + diff --git a/0186-fix-MySQL-shutdown-cmd.patch b/0186-fix-MySQL-shutdown-cmd.patch new file mode 100644 index 0000000..fa2d7ee --- /dev/null +++ b/0186-fix-MySQL-shutdown-cmd.patch @@ -0,0 +1,95 @@ +From 1431fd828005acb2aa7df1844cdec62e21f50769 Mon Sep 17 00:00:00 2001 +From: yangchen +Date: Wed, 5 Jun 2024 12:56:52 +0800 +Subject: [PATCH] fix MySQL shutdown cmd + +--- + src/lstack/api/lstack_epoll.c | 14 ++++++-------- + src/lstack/include/posix/lstack_epoll.h | 4 ++-- + 2 files changed, 8 insertions(+), 10 deletions(-) + +diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c +index c8a2e43..1d6ae52 100644 +--- a/src/lstack/api/lstack_epoll.c ++++ b/src/lstack/api/lstack_epoll.c +@@ -144,7 +144,7 @@ void wakeup_stack_epoll(struct protocol_stack *stack) + if (__atomic_load_n(&wakeup->in_wait, __ATOMIC_ACQUIRE)) { + __atomic_store_n(&wakeup->in_wait, false, __ATOMIC_RELEASE); + rte_mb(); +- pthread_mutex_unlock(&wakeup->wait); ++ sem_post(&wakeup->wait); + stack->stats.wakeup_events++; + } + +@@ -258,12 +258,11 @@ int32_t lstack_do_epoll_create(int32_t fd) + init_list_node_null(&wakeup->wakeup_list[i]); + } + +- if (pthread_mutex_init(&wakeup->wait, NULL) != 0) { ++ if (sem_init(&wakeup->wait, 0, 0) != 0) { + posix_api->close_fn(fd); + free(wakeup); + GAZELLE_RETURN(EINVAL); + } +- pthread_mutex_trylock(&wakeup->wait); + __atomic_store_n(&wakeup->in_wait, false, __ATOMIC_RELEASE); + + struct protocol_stack_group *stack_group = get_protocol_stack_group(); +@@ -337,7 +336,7 @@ int32_t lstack_epoll_close(int32_t fd) + list_del_node_null(&wakeup->poll_list); + pthread_spin_unlock(&stack_group->poll_list_lock); + +- pthread_mutex_destroy(&wakeup->wait); ++ sem_destroy(&wakeup->wait); + + free(wakeup); + sock->wakeup = NULL; +@@ -609,9 +608,9 @@ int32_t lstack_block_wait(struct wakeup_poll *wakeup, int32_t timeout) + if (timeout > 0) { + struct timespec timespec; + ms_to_timespec(×pec, timeout); +- ret = pthread_mutex_timedlock(&wakeup->wait, ×pec); ++ ret = sem_timedwait(&wakeup->wait, ×pec); + } else { +- ret = pthread_mutex_lock(&wakeup->wait); ++ ret = sem_wait(&wakeup->wait); + } + + if (__atomic_load_n(&wakeup->in_wait, __ATOMIC_ACQUIRE)) { +@@ -714,10 +713,9 @@ int32_t lstack_rtw_epoll_wait(int32_t epfd, struct epoll_event* events, int32_t + + static int32_t init_poll_wakeup_data(struct wakeup_poll *wakeup) + { +- if (pthread_mutex_init(&wakeup->wait, NULL) != 0) { ++ if (sem_init(&wakeup->wait, 0, 0) != 0) { + GAZELLE_RETURN(EINVAL); + } +- pthread_mutex_trylock(&wakeup->wait); + __atomic_store_n(&wakeup->in_wait, false, __ATOMIC_RELEASE); + + for (uint32_t i = 0; i < PROTOCOL_STACK_MAX; i++) { +diff --git a/src/lstack/include/posix/lstack_epoll.h b/src/lstack/include/posix/lstack_epoll.h +index 59b5ef7..a7164f4 100644 +--- a/src/lstack/include/posix/lstack_epoll.h ++++ b/src/lstack/include/posix/lstack_epoll.h +@@ -37,7 +37,7 @@ struct protocol_stack; + struct wakeup_poll { + /* stack thread read frequently */ + enum wakeup_type type; +- pthread_mutex_t wait __rte_cache_aligned; ++ sem_t wait; + bool in_wait; + struct list_node wakeup_list[PROTOCOL_STACK_MAX]; + bool have_kernel_event; +@@ -87,7 +87,7 @@ static inline void lstack_block_wakeup(struct wakeup_poll *wakeup) + if (wakeup && __atomic_load_n(&wakeup->in_wait, __ATOMIC_ACQUIRE)) { + __atomic_store_n(&wakeup->in_wait, false, __ATOMIC_RELEASE); + rte_mb(); +- pthread_mutex_unlock(&wakeup->wait); ++ sem_post(&wakeup->wait); + } + } + +-- +2.33.0 + diff --git a/0187-cfg-remove-map-perfect-flag-in-lstack.conf.patch b/0187-cfg-remove-map-perfect-flag-in-lstack.conf.patch new file mode 100644 index 0000000..40d63be --- /dev/null +++ b/0187-cfg-remove-map-perfect-flag-in-lstack.conf.patch @@ -0,0 +1,31 @@ +From 9cd0a7ebb73b882ef3ac968795fb22ca78fb33cc Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Wed, 29 May 2024 16:20:59 +0800 +Subject: [PATCH] cfg: remove map-perfect flag in lstack.conf + +This parameter is used in ltran mode. +By defualt, ltran mode is not used, so remove it. +--- + src/lstack/lstack.conf | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/lstack/lstack.conf b/src/lstack/lstack.conf +index 07a6092..0b7dbc9 100644 +--- a/src/lstack/lstack.conf ++++ b/src/lstack/lstack.conf +@@ -8,10 +8,11 @@ + # PURPOSE. + # See the Mulan PSL v2 for more details. + +-dpdk_args=["--socket-mem", "2048,0,0,0", "--huge-dir", "/mnt/hugepages-lstack", "--proc-type", "primary", "--legacy-mem", "--map-perfect"] ++dpdk_args=["--socket-mem", "2048,0,0,0", "--huge-dir", "/mnt/hugepages-lstack", "--proc-type", "primary", "--legacy-mem"] + + stack_thread_mode="run-to-wakeup" + ++#ltran mode need add "--map-perfect" in dpdk_args + use_ltran=0 + kni_switch=0 + +-- +2.33.0 + diff --git a/gazelle.spec b/gazelle.spec index ae80c96..c1684d7 100644 --- a/gazelle.spec +++ b/gazelle.spec @@ -2,7 +2,7 @@ Name: gazelle Version: 1.0.2 -Release: 40 +Release: 41 Summary: gazelle is a high performance user-mode stack License: MulanPSL-2.0 URL: https://gitee.com/openeuler/gazelle @@ -201,6 +201,9 @@ Patch9181: 0181-memary-error-fix-some-memary-error.patch Patch9182: 0182-bond-remove-bond-initialization-code-in-dpdk_ethdev_.patch Patch9183: 0183-make-rpc_msg_max-recv_ring_size-configurable.patch Patch9184: 0184-EPOLL-fix-coredump-while-event-count-exceed-maxevent.patch +Patch9185: 0185-fix-fin-pack-free-coredump.patch +Patch9186: 0186-fix-MySQL-shutdown-cmd.patch +Patch9187: 0187-cfg-remove-map-perfect-flag-in-lstack.conf.patch %description %{name} is a high performance user-mode stack. @@ -241,6 +244,11 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b %config(noreplace) %{conf_path}/ltran.conf %changelog +* Fri Jun 14 2024 yinbin6 - 1.0.2-41 +- cfg: remove map-perfect flag in lstack.conf +- fix MySQL shutdown cmd +- fix fin pack free coredump + * Fri June 7 2024 yinbin6 - 1.0.2-40 - make rpc_msg_max recv_ring_size configurable - EPOLL: fix coredump while eventcount exceed maxevent