1195972f6Sopenharmony_ciFrom afd0d39d31196a74d6808120d1ca5664825d477c Mon Sep 17 00:00:00 2001
2195972f6Sopenharmony_ciFrom: wuchangsheng <wuchangsheng2@huawei.com>
3195972f6Sopenharmony_ciDate: Mon, 6 Sep 2021 22:52:41 +0800
4195972f6Sopenharmony_ciSubject: [PATCH] aaa
5195972f6Sopenharmony_ci
6195972f6Sopenharmony_ci---
7195972f6Sopenharmony_ci src/api/sockets.c       | 17 -----------------
8195972f6Sopenharmony_ci src/include/eventpoll.h |  1 -
9195972f6Sopenharmony_ci src/include/lwipopts.h  | 17 -----------------
10195972f6Sopenharmony_ci src/include/lwipsock.h  |  5 -----
11195972f6Sopenharmony_ci 4 files changed, 40 deletions(-)
12195972f6Sopenharmony_ci
13195972f6Sopenharmony_cidiff --git a/src/api/sockets.c b/src/api/sockets.c
14195972f6Sopenharmony_ciindex ac4cccb..8719568 100644
15195972f6Sopenharmony_ci--- a/src/api/sockets.c
16195972f6Sopenharmony_ci+++ b/src/api/sockets.c
17195972f6Sopenharmony_ci@@ -755,10 +755,6 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
18195972f6Sopenharmony_ci   sock = posix_api->get_socket(s);
19195972f6Sopenharmony_ci   /*AF_UNIX case*/
20195972f6Sopenharmony_ci   if (!sock) {
21195972f6Sopenharmony_ci-    if (rearm_accept_fd(s) < 0) {
22195972f6Sopenharmony_ci-      LWIP_DEBUGF(SOCKETS_DEBUG,
23195972f6Sopenharmony_ci-          ("failed to rearm accept fd=%d errno=%d\n", s, errno));
24195972f6Sopenharmony_ci-    }
25195972f6Sopenharmony_ci     return posix_api->accept_fn(s, addr, addrlen);
26195972f6Sopenharmony_ci   }
27195972f6Sopenharmony_ci   
28195972f6Sopenharmony_ci@@ -769,11 +765,6 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
29195972f6Sopenharmony_ci     return -1;
30195972f6Sopenharmony_ci   }
31195972f6Sopenharmony_ci   
32195972f6Sopenharmony_ci-  if (rearm_accept_fd(s) < 0) {
33195972f6Sopenharmony_ci-    LWIP_DEBUGF(SOCKETS_DEBUG,
34195972f6Sopenharmony_ci-        ("failed to rearm accept fd=%d errno=%d\n", s, errno));
35195972f6Sopenharmony_ci-  }
36195972f6Sopenharmony_ci-  
37195972f6Sopenharmony_ci   /* raise accept syscall in palce */
38195972f6Sopenharmony_ci   newsock = posix_api->accept_fn(s, addr, addrlen);
39195972f6Sopenharmony_ci   if (newsock >= 0) {
40195972f6Sopenharmony_ci@@ -977,8 +968,6 @@ lwip_close(int s)
41195972f6Sopenharmony_ci   ret = posix_api->close_fn(s);
42195972f6Sopenharmony_ci   if ((ret < 0) && (errno == EINTR))
43195972f6Sopenharmony_ci     ret = posix_api->close_fn(s);
44195972f6Sopenharmony_ci-  if (posix_api->is_chld == 0)
45195972f6Sopenharmony_ci-    clean_host_fd(s);
46195972f6Sopenharmony_ci 
47195972f6Sopenharmony_ci   sock = posix_api->get_socket(s);
48195972f6Sopenharmony_ci   /*AF_UNIX case*/
49195972f6Sopenharmony_ci@@ -1481,9 +1470,6 @@ static inline enum KERNEL_LWIP_PATH select_path(int s)
50195972f6Sopenharmony_ci   sock = posix_api->get_socket(s);
51195972f6Sopenharmony_ci   /*AF_UNIX case*/
52195972f6Sopenharmony_ci   if (!sock) {
53195972f6Sopenharmony_ci-    if (rearm_host_fd(s) < 0) {
54195972f6Sopenharmony_ci-      LWIP_DEBUGF(SOCKETS_DEBUG, ("failed to rearm fd=%d errno=%d\n", s, errno));
55195972f6Sopenharmony_ci-    }
56195972f6Sopenharmony_ci     return PATH_KERNEL;
57195972f6Sopenharmony_ci   }
58195972f6Sopenharmony_ci 
59195972f6Sopenharmony_ci@@ -1494,9 +1480,6 @@ static inline enum KERNEL_LWIP_PATH select_path(int s)
60195972f6Sopenharmony_ci 
61195972f6Sopenharmony_ci   /*for AF_INET, we can try erther linux or lwip*/
62195972f6Sopenharmony_ci   if (CONN_TYPE_IS_HOST(sock->conn)) {
63195972f6Sopenharmony_ci-    if (rearm_host_fd(s) < 0) {
64195972f6Sopenharmony_ci-      LWIP_DEBUGF(SOCKETS_DEBUG, ("failed to rearm read fd=%d errno=%d\n", s, errno));
65195972f6Sopenharmony_ci-    }
66195972f6Sopenharmony_ci     return PATH_KERNEL;
67195972f6Sopenharmony_ci   }
68195972f6Sopenharmony_ci 
69195972f6Sopenharmony_cidiff --git a/src/include/eventpoll.h b/src/include/eventpoll.h
70195972f6Sopenharmony_ciindex 01f8d64..f525bc2 100644
71195972f6Sopenharmony_ci--- a/src/include/eventpoll.h
72195972f6Sopenharmony_ci+++ b/src/include/eventpoll.h
73195972f6Sopenharmony_ci@@ -57,7 +57,6 @@ struct event_array {
74195972f6Sopenharmony_ci 
75195972f6Sopenharmony_ci struct libos_epoll {
76195972f6Sopenharmony_ci     struct event_queue *libos_queue;
77195972f6Sopenharmony_ci-    struct event_array *host_queue;
78195972f6Sopenharmony_ci     int num_hostfds;
79195972f6Sopenharmony_ci     int hints;
80195972f6Sopenharmony_ci     int fd;  /* self fd */
81195972f6Sopenharmony_cidiff --git a/src/include/lwipopts.h b/src/include/lwipopts.h
82195972f6Sopenharmony_ciindex 8893a5f..e0364a2 100644
83195972f6Sopenharmony_ci--- a/src/include/lwipopts.h
84195972f6Sopenharmony_ci+++ b/src/include/lwipopts.h
85195972f6Sopenharmony_ci@@ -177,23 +177,6 @@
86195972f6Sopenharmony_ci 
87195972f6Sopenharmony_ci #define ARP_TABLE_SIZE 512
88195972f6Sopenharmony_ci 
89195972f6Sopenharmony_ci-/*
90195972f6Sopenharmony_ci-   ---------------------------------------
91195972f6Sopenharmony_ci-   ------- Syscall thread options --------
92195972f6Sopenharmony_ci-   ---------------------------------------
93195972f6Sopenharmony_ci-*/
94195972f6Sopenharmony_ci-#define USE_SYSCALL_THREAD 1
95195972f6Sopenharmony_ci-
96195972f6Sopenharmony_ci-#define MAX_BLOCKING_ACCEPT_FD (100)
97195972f6Sopenharmony_ci-
98195972f6Sopenharmony_ci-#define MAX_BLOCKING_CONNECT_FD (100)
99195972f6Sopenharmony_ci-
100195972f6Sopenharmony_ci-#define MAX_BLOCKING_EPOLL_FD (100)
101195972f6Sopenharmony_ci-
102195972f6Sopenharmony_ci-#define MAX_SYSCALL_EVENTS (MAX_BLOCKING_ACCEPT_FD + MAX_BLOCKING_CONNECT_FD + MAX_BLOCKING_EPOLL_FD)
103195972f6Sopenharmony_ci-
104195972f6Sopenharmony_ci-#define MAX_HOST_FD (MAX_CLIENTS + RESERVED_CLIENTS)
105195972f6Sopenharmony_ci-
106195972f6Sopenharmony_ci #if USE_LIBOS
107195972f6Sopenharmony_ci #define PER_THREAD __thread
108195972f6Sopenharmony_ci #else
109195972f6Sopenharmony_cidiff --git a/src/include/lwipsock.h b/src/include/lwipsock.h
110195972f6Sopenharmony_ciindex dbc67b9..e9ffbb1 100644
111195972f6Sopenharmony_ci--- a/src/include/lwipsock.h
112195972f6Sopenharmony_ci+++ b/src/include/lwipsock.h
113195972f6Sopenharmony_ci@@ -146,10 +146,5 @@ void lwip_sock_init(void);
114195972f6Sopenharmony_ci void lwip_exit(void);
115195972f6Sopenharmony_ci 
116195972f6Sopenharmony_ci extern int is_host_ipv4(uint32_t ipv4);
117195972f6Sopenharmony_ci-extern int rearm_host_fd(int fd);
118195972f6Sopenharmony_ci-extern int rearm_accept_fd(int fd);
119195972f6Sopenharmony_ci-extern void unarm_host_fd(int fd);
120195972f6Sopenharmony_ci-extern void clean_host_fd(int fd);
121195972f6Sopenharmony_ci-extern int arm_host_fd(struct libos_epoll *ep, int op, int fd, struct epoll_event *event);
122195972f6Sopenharmony_ci 
123195972f6Sopenharmony_ci #endif /* __LWIPSOCK_H__ */
124195972f6Sopenharmony_ci-- 
125195972f6Sopenharmony_ci2.23.0
126195972f6Sopenharmony_ci
127