From ab5a5149ab95e4ce14245e3748460b1ea36e2b99 Mon Sep 17 00:00:00 2001 From: chengyechun Date: Sat, 1 Jul 2023 14:42:36 +0800 Subject: [PATCH] sync fix bond4 EPOLLOUT event error (cherry picked from commit 7ecd02724564fe72b2ad772c2faa63be949a3823) --- 0261-fix-bond4-EPOLLOUT-event-error.patch | 63 +++++++++++++++++++++++ gazelle.spec | 6 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0261-fix-bond4-EPOLLOUT-event-error.patch diff --git a/0261-fix-bond4-EPOLLOUT-event-error.patch b/0261-fix-bond4-EPOLLOUT-event-error.patch new file mode 100644 index 0000000..70970e8 --- /dev/null +++ b/0261-fix-bond4-EPOLLOUT-event-error.patch @@ -0,0 +1,63 @@ +From 0e6863306602e58e21932ed9b5fccf269e77e1da Mon Sep 17 00:00:00 2001 +From: compile_success <980965867@qq.com> +Date: Wed, 28 Jun 2023 11:40:36 +0000 +Subject: [PATCH] fix bond4 EPOLLOUT event error + +--- + src/lstack/api/lstack_epoll.c | 12 ++++++------ + src/lstack/core/lstack_lwip.c | 2 +- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/lstack/api/lstack_epoll.c b/src/lstack/api/lstack_epoll.c +index 06bd71b..55ca4fe 100644 +--- a/src/lstack/api/lstack_epoll.c ++++ b/src/lstack/api/lstack_epoll.c +@@ -140,6 +140,11 @@ static void raise_pending_events(struct wakeup_poll *wakeup, struct lwip_sock *s + event |= EPOLLIN; + } + ++ if (sock->errevent > 0) { ++ event |= EPOLLERR | EPOLLIN; ++ } ++ ++ pthread_spin_lock(&wakeup->event_list_lock); + if (NETCONN_IS_OUTIDLE(sock)) { + /* lwip_netconn_do_connected set LIBOS FLAGS when connected */ + if (sock->conn && CONN_TYPE_IS_LIBOS(sock->conn)) { +@@ -147,19 +152,14 @@ static void raise_pending_events(struct wakeup_poll *wakeup, struct lwip_sock *s + } + } + +- if (sock->errevent > 0) { +- event |= EPOLLERR | EPOLLIN; +- } +- + if (event) { +- pthread_spin_lock(&wakeup->event_list_lock); + sock->events = event; + if (wakeup->type == WAKEUP_EPOLL && (sock->events & sock->epoll_events) && + list_is_null(&sock->event_list)) { + list_add_node(&wakeup->event_list, &sock->event_list); + } +- pthread_spin_unlock(&wakeup->event_list_lock); + } ++ pthread_spin_unlock(&wakeup->event_list_lock); + } + + int32_t lstack_do_epoll_create(int32_t fd) +diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c +index d53591d..c1346f6 100644 +--- a/src/lstack/core/lstack_lwip.c ++++ b/src/lstack/core/lstack_lwip.c +@@ -645,7 +645,7 @@ static inline bool replenish_send_ring(struct protocol_stack *stack, struct lwip + + replenish_again = replenish_send_idlembuf(stack, sock); + +- if ((sock->epoll_events & EPOLLOUT) && NETCONN_IS_OUTIDLE(sock)) { ++ if (NETCONN_IS_OUTIDLE(sock)) { + add_sock_event(sock, EPOLLOUT); + } + +-- +2.23.0 + diff --git a/gazelle.spec b/gazelle.spec index 6976312..1b78b4a 100644 --- a/gazelle.spec +++ b/gazelle.spec @@ -2,7 +2,7 @@ Name: gazelle Version: 1.0.1 -Release: 70 +Release: 71 Summary: gazelle is a high performance user-mode stack License: MulanPSL-2.0 URL: https://gitee.com/openeuler/gazelle @@ -276,6 +276,7 @@ Patch9257: 0257-enable-UDP-CKSUM-in-gazelle.patch Patch9258: 0258-fix-core-dump-when-slave-mac-failed.patch Patch9259: 0259-check-return-value-of-hugepage_init-to-avoid-coredum.patch Patch9260: 0260-add-udp_enable-to-turn-off-udp-in-need.patch +Patch9261: 0261-fix-bond4-EPOLLOUT-event-error.patch %description %{name} is a high performance user-mode stack. @@ -317,6 +318,9 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b %config(noreplace) %{conf_path}/ltran.conf %changelog +* Sat Jul 1 2023 jiangheng12 - 1.0.1-71 +- fix bond4 EPOLLOUT event error + * Fri Jun 30 2023 jiangheng12 - 1.0.1-70 - add build requires constraints on lwip version