diff --git a/0029-fix-EISCONN-err-and-remove-same-customized-modificat.patch b/0029-fix-EISCONN-err-and-remove-same-customized-modificat.patch new file mode 100644 index 0000000000000000000000000000000000000000..91ac15ef74201b88990a33a2691d65b553343836 --- /dev/null +++ b/0029-fix-EISCONN-err-and-remove-same-customized-modificat.patch @@ -0,0 +1,114 @@ +From ec2f5414c6c98b63376e4bce9534abc5c01ce13c Mon Sep 17 00:00:00 2001 +From: wuchangsheng +Date: Thu, 6 Oct 2022 18:47:06 +0800 +Subject: [PATCH] fix EISCONN err and remove same customized modification + +--- + src/api/api_msg.c | 22 ++-------------------- + src/include/lwipsock.h | 33 ++++----------------------------- + 2 files changed, 6 insertions(+), 49 deletions(-) + +diff --git a/src/api/api_msg.c b/src/api/api_msg.c +index 2dded75..1fedaad 100644 +--- a/src/api/api_msg.c ++++ b/src/api/api_msg.c +@@ -1334,25 +1334,7 @@ lwip_netconn_do_connected(void *arg, struct tcp_pcb *pcb, err_t err) + } + + #if USE_LIBOS +- if (CONN_TYPE_IS_HOST(conn)) { +- LWIP_DEBUGF(API_MSG_DEBUG, +- ("libos outgoing connection abort fd=%d\n", conn->socket)); +- return ERR_ABRT; +- } +- +- LWIP_DEBUGF(API_MSG_DEBUG, ("libos outgoing connection established\n")); +- if (CONN_TYPE_HAS_INPRG(conn) && CONN_TYPE_HAS_HOST(conn)) { +- int s = conn->socket; +- struct lwip_sock *sock = get_socket_without_errno(s); +- +- if (!!sock) { +- posix_api->shutdown_fn(s, SHUT_RDWR); +- LWIP_DEBUGF(API_MSG_DEBUG, +- ("linux outgoing connection abort fd=%d\n", s)); +- } +- } +- SET_CONN_TYPE_LIBOS(conn); +- add_epoll_event(conn, EPOLLOUT); ++ gazelle_connected_callback(conn); + #endif + + LWIP_ASSERT("conn->state == NETCONN_CONNECT", conn->state == NETCONN_CONNECT); +@@ -1417,7 +1399,7 @@ lwip_netconn_do_connect(void *m) + /* Prevent connect while doing any other action. */ + if (msg->conn->state == NETCONN_CONNECT) { + err = ERR_ALREADY; +- } else if (msg->conn->pcb.tcp->state != ESTABLISHED) { ++ } else if (msg->conn->pcb.tcp->state == ESTABLISHED) { + err = ERR_ISCONN; + } else { + setup_tcp(msg->conn); +diff --git a/src/include/lwipsock.h b/src/include/lwipsock.h +index 3c5c44b..912d471 100644 +--- a/src/include/lwipsock.h ++++ b/src/include/lwipsock.h +@@ -93,13 +93,14 @@ struct lwip_sock { + #endif + + #if USE_LIBOS ++ struct pbuf *send_lastdata; ++ uint16_t send_datalen; + volatile uint32_t events __rte_cache_aligned; /* available events */ + struct pbuf *recv_lastdata __rte_cache_aligned; /* unread data in one pbuf */ + struct list_node recv_list __rte_cache_aligned; + struct list_node event_list __rte_cache_aligned; + struct list_node send_list __rte_cache_aligned; + uint32_t in_send __rte_cache_aligned; /* avoid sock too much send rpc msg*/ +- uint32_t send_flag __rte_cache_aligned; /* avoid sock too much send rpc msg*/ + uint32_t epoll_events; /* registered events, EPOLLONESHOT write frequently */ + char pad __rte_cache_aligned; + +@@ -124,38 +125,12 @@ struct lwip_sock { + #if USE_LIBOS + extern uint32_t sockets_num; + extern struct lwip_sock *sockets; +-/** +- * Map a externally used socket index to the internal socket representation. +- * +- * @param s externally used socket index +- * @return struct lwip_sock for the socket or NULL if not found +- */ +-static inline struct lwip_sock * +-get_socket_without_errno(int s) +-{ +- struct lwip_sock *sock = NULL; +- +- s -= LWIP_SOCKET_OFFSET; +- +- if ((s < 0) || (s >= sockets_num)) { +- LWIP_DEBUGF(SOCKETS_DEBUG, ("get_socket(%d): invalid\n", s + LWIP_SOCKET_OFFSET)); +- return NULL; +- } +- +- sock = &sockets[s]; +- +- if (!sock->conn) { +- LWIP_DEBUGF(SOCKETS_DEBUG, ("get_socket(%d): not active\n", s + LWIP_SOCKET_OFFSET)); +- return NULL; +- } +- +- return sock; +-} +- ++extern void gazelle_connected_callback(struct netconn *conn); + extern void add_recv_list(int32_t fd); + extern ssize_t read_lwip_data(struct lwip_sock *sock, int32_t flags, u8_t apiflags); + extern struct pbuf *write_lwip_data(struct lwip_sock *sock, uint16_t remain_size, uint8_t *apiflags); + extern void gazelle_init_sock(int32_t fd); ++extern void write_lwip_over(struct lwip_sock *sock, uint32_t n); + #endif /* USE_LIBOS */ + + struct lwip_sock *get_socket(int s); +-- +2.27.0 + diff --git a/lwip.spec b/lwip.spec index dd72c372aaaba1a761879f843831138893537b91..5cddeb89261588deb9726aa459c8c22155044ec6 100644 --- a/lwip.spec +++ b/lwip.spec @@ -4,7 +4,7 @@ Summary: lwip is a small independent implementation of the TCP/IP protocol suite Name: lwip Version: 2.1.3 -Release: 16 +Release: 17 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.tar.gz @@ -40,6 +40,7 @@ Patch9024: 0025-Replace-gettid-with-syscall-SYS_gettid.patch Patch9025: 0026-del-redundant-wait_close-and-move-epoll_events-pos.patch Patch9026: 0027-modify-EISCONN-condition.patch Patch9027: 0028-per-thread-reassdata-variables.patch +Patch9028: 0029-fix-EISCONN-err-and-remove-same-customized-modificat.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -68,6 +69,10 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Thu Oct 6 2022 wuchangsheng - 2.1.3-17 +- fix EISCONN conditon err + remove same customized modification + * Thu Oct 6 2022 wuchangsheng - 2.1.3-16 - per thread reassdata variables