sync set sock when select path is PATH_UNKNOW
(cherry picked from commit bbd206dcc76d124c74413ee46934c302c42aa1a9)
This commit is contained in:
parent
ac7bab6d9b
commit
c73b45e14d
60
0247-set-sock-when-select-path-is-PATH_UNKNOW.patch
Normal file
60
0247-set-sock-when-select-path-is-PATH_UNKNOW.patch
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
From 046d0963dc5d00430897ee2ffdb27dcae6b4693c Mon Sep 17 00:00:00 2001
|
||||||
|
From: jiangheng <jiangheng14@huawei.com>
|
||||||
|
Date: Mon, 5 Sep 2022 12:20:17 +0800
|
||||||
|
Subject: [PATCH] set sock when select path is PATH_UNKNOW
|
||||||
|
|
||||||
|
---
|
||||||
|
src/lstack/api/lstack_wrap.c | 19 +++++++------------
|
||||||
|
1 file changed, 7 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
|
||||||
|
index 1f33e13..096fcf7 100644
|
||||||
|
--- a/src/lstack/api/lstack_wrap.c
|
||||||
|
+++ b/src/lstack/api/lstack_wrap.c
|
||||||
|
@@ -54,9 +54,9 @@ static inline enum KERNEL_LWIP_PATH select_path(int fd, struct lwip_sock **socke
|
||||||
|
{
|
||||||
|
if (unlikely(posix_api == NULL)) {
|
||||||
|
/*
|
||||||
|
- * posix api maybe call before gazelle init
|
||||||
|
- * So, we must call posix_api_init at the head of select_path
|
||||||
|
- */
|
||||||
|
+ * 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");
|
||||||
|
}
|
||||||
|
@@ -74,26 +74,21 @@ static inline enum KERNEL_LWIP_PATH select_path(int fd, struct lwip_sock **socke
|
||||||
|
return PATH_KERNEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (socket) {
|
||||||
|
+ *socket = sock;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (likely(CONN_TYPE_IS_LIBOS(sock->conn))) {
|
||||||
|
- if (socket) {
|
||||||
|
- *socket = sock;
|
||||||
|
- }
|
||||||
|
return PATH_LWIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NETCONN_IS_UDP(sock)) {
|
||||||
|
- if (socket) {
|
||||||
|
- *socket = sock;
|
||||||
|
- }
|
||||||
|
return PATH_LWIP;
|
||||||
|
} else {
|
||||||
|
struct tcp_pcb *pcb = sock->conn->pcb.tcp;
|
||||||
|
/* after lwip connect, call send immediately, pcb->state is SYN_SENT, need return PATH_LWIP */
|
||||||
|
/* pcb->state default value is CLOSED when call socket, need return PATH_UNKNOW */
|
||||||
|
if (pcb != NULL && pcb->state <= ESTABLISHED && pcb->state >= LISTEN) {
|
||||||
|
- if (socket) {
|
||||||
|
- *socket = sock;
|
||||||
|
- }
|
||||||
|
return PATH_LWIP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: gazelle
|
Name: gazelle
|
||||||
Version: 1.0.1
|
Version: 1.0.1
|
||||||
Release: 62
|
Release: 63
|
||||||
Summary: gazelle is a high performance user-mode stack
|
Summary: gazelle is a high performance user-mode stack
|
||||||
License: MulanPSL-2.0
|
License: MulanPSL-2.0
|
||||||
URL: https://gitee.com/openeuler/gazelle
|
URL: https://gitee.com/openeuler/gazelle
|
||||||
@ -261,6 +261,7 @@ Patch9243: 0243-fix-change-low-power-mod-invalid.patch
|
|||||||
Patch9244: 0244-add-exception-handling-for-is_dst_ip_localhost.patch
|
Patch9244: 0244-add-exception-handling-for-is_dst_ip_localhost.patch
|
||||||
Patch9245: 0245-fix-gazellectl-block-before-lstack-registration-is-c.patch
|
Patch9245: 0245-fix-gazellectl-block-before-lstack-registration-is-c.patch
|
||||||
Patch9246: 0246-fix-udp-send-recv-in-muliple-queue.patch
|
Patch9246: 0246-fix-udp-send-recv-in-muliple-queue.patch
|
||||||
|
Patch9247: 0247-set-sock-when-select-path-is-PATH_UNKNOW.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%{name} is a high performance user-mode stack.
|
%{name} is a high performance user-mode stack.
|
||||||
@ -301,6 +302,9 @@ install -Dpm 0640 %{_builddir}/%{name}-%{version}/src/ltran/ltran.conf %{b
|
|||||||
%config(noreplace) %{conf_path}/ltran.conf
|
%config(noreplace) %{conf_path}/ltran.conf
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jun 14 2023 jiangheng12 <jiangheng14@huawei.com> - 1.0.1-63
|
||||||
|
- set sock when select path is PATH_UNKNOW
|
||||||
|
|
||||||
* Wed Jun 14 2023 jiangheng12 <jiangheng14@huawei.com> - 1.0.1-62
|
* Wed Jun 14 2023 jiangheng12 <jiangheng14@huawei.com> - 1.0.1-62
|
||||||
- fix udp send/recv in muliple queue
|
- fix udp send/recv in muliple queue
|
||||||
- fix gazellectl block before lstack registration is complete
|
- fix gazellectl block before lstack registration is complete
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user