!734 delete redundant logs in lwip

From: @hantwofish 
Reviewed-by: @LemmyHuang 
Signed-off-by: @LemmyHuang
This commit is contained in:
openeuler-ci-bot 2024-01-17 02:01:00 +00:00 committed by Gitee
commit 0015ea0b7c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 96 additions and 1 deletions

View File

@ -0,0 +1,91 @@
From ed49e784233ec0a83eb4f4e37fe9cd112bfed555 Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
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

View File

@ -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 <hankangkang5@huawei.com> - 2.1.3-110
- delete redundant logs in lwip
* Tue Jan 16 2024 zhengjiebing <zhengjiebing@cmss.chinamobile.com> - 2.1.3-109
- optimize enqueue way for unacked and unsent queue