From 2832476ca7649fc7ac033117edb8db07e358b0ba Mon Sep 17 00:00:00 2001 From: hantwofish Date: Wed, 10 Jan 2024 10:34:07 +0800 Subject: [PATCH] delete redundant logs in lwip (cherry picked from commit b862b30f51a7a401a09f6a2a842a69ac95348c89) --- 0105-delete-redundant-logs-in-lwip.patch | 91 ++++++++++++++++++++++++ lwip.spec | 6 +- 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 0105-delete-redundant-logs-in-lwip.patch diff --git a/0105-delete-redundant-logs-in-lwip.patch b/0105-delete-redundant-logs-in-lwip.patch new file mode 100644 index 0000000..39848c5 --- /dev/null +++ b/0105-delete-redundant-logs-in-lwip.patch @@ -0,0 +1,91 @@ +From ed49e784233ec0a83eb4f4e37fe9cd112bfed555 Mon Sep 17 00:00:00 2001 +From: hantwofish +Date: Wed, 10 Jan 2024 09:31:23 +0800 +Subject: [PATCH] delete redundant logs in lwip + +--- + src/api/sockets.c | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +diff --git a/src/api/sockets.c b/src/api/sockets.c +index 15053b3..ce79bb3 100644 +--- a/src/api/sockets.c ++++ b/src/api/sockets.c +@@ -447,7 +447,7 @@ tryget_socket_unconn_nouse(int fd) + if ((s < 0) || (s >= NUM_SOCKETS)) + #endif /* GAZELLE_ENABLE */ + { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("tryget_socket_unconn(%d): invalid\n", fd)); ++ LWIP_DEBUGF(SOCKETS_DEBUG , ("tryget_socket_unconn(%d): invalid\n", fd)); + return NULL; + } + return &sockets[s]; +@@ -521,7 +521,7 @@ get_socket(int fd) + struct lwip_sock *sock = tryget_socket(fd); + if (!sock) { + if ((fd < LWIP_SOCKET_OFFSET) || (fd >= (LWIP_SOCKET_OFFSET + NUM_SOCKETS))) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("get_socket(%d): invalid\n", fd)); ++ LWIP_DEBUGF(SOCKETS_DEBUG , ("get_socket(%d): invalid\n", fd)); + } + set_errno(EBADF); + return NULL; +@@ -588,7 +588,6 @@ alloc_socket(struct netconn *newconn, int accepted, int flags) + SYS_ARCH_PROTECT(lev); + i = posix_api->socket_fn(domain, type, protocol); + if (i == -1) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("posix_api->socket_fn fail socket is -1")); + goto err; + } + +@@ -597,7 +596,6 @@ alloc_socket(struct netconn *newconn, int accepted, int flags) + } + + if ((i < LWIP_SOCKET_OFFSET) || (i >= sockets_num + LWIP_SOCKET_OFFSET)) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("posix_api->socket_fn socket is %d, illegal\n", i)); + goto err; + } + +@@ -769,14 +767,13 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags) + + sock = get_socket(s); + if (!sock) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("get_socket sock is null\n")); + return -1; + } + + /* wait for a new connection */ + err = netconn_accept(sock->conn, &newconn); + if (err != ERR_OK) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("lwip_accept(%d): netconn_acept failed, err=%d\n", s, err)); ++ LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_acept failed, err=%d\n", s, err)); + if (NETCONNTYPE_GROUP(netconn_type(sock->conn)) != NETCONN_TCP) { + sock_set_errno(sock, EOPNOTSUPP); + } else if (err == ERR_CLSD) { +@@ -791,7 +788,6 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags) + + newsock = alloc_socket(newconn, 1, flags); + if (newsock == -1) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("alloc_socket fail newsock is -1\n")); + netconn_delete(newconn); + sock_set_errno(sock, ENFILE); + done_socket(sock); +@@ -811,7 +807,6 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags) + ret = find_same_node_memzone(pcb, nsock); + } + if (pcb == NULL || ret != 0) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("alloc_socket fail pcb null flag=%u, ret=%d \n", (pcb == NULL), ret)); + netconn_delete(newconn); + free_socket(nsock, 1); + sock_set_errno(sock, ENOTCONN); +@@ -847,7 +842,7 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags) + /* get the IP address and port of the remote host */ + err = netconn_peer(newconn, &naddr, &port); + if (err != ERR_OK) { +- LWIP_DEBUGF(SOCKETS_DEBUG | GAZELLE_DEBUG_SERIOUS, ("lwip_accept(%d): netconn_peer failed, err=%d\n", s, err)); ++ LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): netconn_peer failed, err=%d\n", s, err)); + free_socket(nsock, 1); + sock_set_errno(sock, err_to_errno(err)); + done_socket(sock); +-- +2.33.0 + diff --git a/lwip.spec b/lwip.spec index cc346da..8ee9ddb 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: 109 +Release: 110 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -121,6 +121,7 @@ Patch6005: backport-tcp_in-fix-ooseq-update-error.patch Patch9102: 0103-adapt-for-dpdk-23.11.patch Patch9103: 0104-optimize-enqueue-for-unacked-and-unsent-queue.patch +Patch9104: 0105-delete-redundant-logs-in-lwip.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -150,6 +151,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Wed Jan 10 2024 hankangkang - 2.1.3-110 +- delete redundant logs in lwip + * Tue Jan 16 2024 zhengjiebing - 2.1.3-109 - optimize enqueue way for unacked and unsent queue