!591 [sync] PR-550: log: add errevent log and tcp exception statistics
From: @openeuler-sync-bot Reviewed-by: @jiangheng12 Signed-off-by: @jiangheng12
This commit is contained in:
commit
baffc303a4
77
0086-log-add-errevent-log-and-tcp-exception-statistics.patch
Normal file
77
0086-log-add-errevent-log-and-tcp-exception-statistics.patch
Normal file
@ -0,0 +1,77 @@
|
||||
From d7b0ffc7604075639f3eedbfe63fc0f12b87d23f Mon Sep 17 00:00:00 2001
|
||||
From: jiangheng <jiangheng14@huawei.com>
|
||||
Date: Tue, 28 Nov 2023 16:34:16 +0800
|
||||
Subject: [PATCH] log: add errevent log and tcp exception statistics
|
||||
|
||||
---
|
||||
src/api/api_msg.c | 1 +
|
||||
src/api/sockets.c | 3 ++-
|
||||
src/core/tcp_in.c | 2 ++
|
||||
src/include/lwip/stats.h | 3 +++
|
||||
4 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/api/api_msg.c b/src/api/api_msg.c
|
||||
index 8d98be6..531da40 100644
|
||||
--- a/src/api/api_msg.c
|
||||
+++ b/src/api/api_msg.c
|
||||
@@ -613,6 +613,7 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
|
||||
sys_mbox_free(&newconn->recvmbox);
|
||||
sys_mbox_set_invalid(&newconn->recvmbox);
|
||||
netconn_free(newconn);
|
||||
+ MIB2_STATS_INC(mib2.tcpacceptmboxfull);
|
||||
return ERR_MEM;
|
||||
} else {
|
||||
/* Register event with callback */
|
||||
diff --git a/src/api/sockets.c b/src/api/sockets.c
|
||||
index 62052f2..65c69d4 100644
|
||||
--- a/src/api/sockets.c
|
||||
+++ b/src/api/sockets.c
|
||||
@@ -2797,9 +2797,10 @@ event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len)
|
||||
#endif
|
||||
break;
|
||||
case NETCONN_EVT_ERROR:
|
||||
+ LWIP_DEBUGF(GAZELLE_DEBUG_SERIOUS, ("event_callback: have errevent, err=%d\n", conn->pending_err));
|
||||
sock->errevent = 1;
|
||||
#if GAZELLE_ENABLE
|
||||
- if (netif_is_rtc_mode(netif_default)) {
|
||||
+ if (netif_is_rtc_mode(netif_default)) {
|
||||
add_sock_event_nolock(sock, EPOLLERR);
|
||||
} else {
|
||||
add_sock_event(sock, EPOLLERR);
|
||||
diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c
|
||||
index 1076f20..03b9942 100644
|
||||
--- a/src/core/tcp_in.c
|
||||
+++ b/src/core/tcp_in.c
|
||||
@@ -770,6 +770,7 @@ tcp_listen_input(struct tcp_pcb_listen *pcb)
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
if (pcb->accepts_pending >= pcb->backlog) {
|
||||
LWIP_DEBUGF(TCP_DEBUG, ("tcp_listen_input: listen backlog exceeded for port %"U16_F"\n", tcphdr->dest));
|
||||
+ MIB2_STATS_INC(mib2.tcplistendrops);
|
||||
return;
|
||||
}
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
@@ -1845,6 +1846,7 @@ tcp_receive(struct tcp_pcb *pcb)
|
||||
|
||||
} else {
|
||||
/* We get here if the incoming segment is out-of-sequence. */
|
||||
+ MIB2_STATS_INC(mib2.tcpoutofseq);
|
||||
|
||||
#if TCP_QUEUE_OOSEQ
|
||||
/* We queue the segment on the ->ooseq queue. */
|
||||
diff --git a/src/include/lwip/stats.h b/src/include/lwip/stats.h
|
||||
index 5953a74..805836c 100644
|
||||
--- a/src/include/lwip/stats.h
|
||||
+++ b/src/include/lwip/stats.h
|
||||
@@ -153,6 +153,9 @@ struct stats_mib2 {
|
||||
u32_t tcpfinackcnt;
|
||||
u32_t tcpdelayackcnt;
|
||||
u32_t tcpredusedcnt;
|
||||
+ u32_t tcpoutofseq;
|
||||
+ u32_t tcpacceptmboxfull;
|
||||
+ u32_t tcplistendrops;
|
||||
|
||||
/* UDP */
|
||||
u32_t udpindatagrams;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
Summary: lwip is a small independent implementation of the TCP/IP protocol suite
|
||||
Name: lwip
|
||||
Version: 2.1.3
|
||||
Release: 88
|
||||
Release: 89
|
||||
License: BSD
|
||||
URL: http://savannah.nongnu.org/projects/lwip/
|
||||
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
|
||||
@ -99,6 +99,7 @@ Patch9081: 0082-add-vlanid-in-netif.patch
|
||||
Patch9082: 0083-lwipopts-add-lwip-debug-log-macro.patch
|
||||
Patch9083: 0084-add-tcpslowtmr-log-and-tcpfasttmr-cnt.patch
|
||||
Patch9084: 0085-add-lwip-log-tcp_rst-tcp_abandon-tcp_abort.patch
|
||||
Patch9085: 0086-log-add-errevent-log-and-tcp-exception-statistics.patch
|
||||
|
||||
BuildRequires: gcc-c++ dos2unix dpdk-devel
|
||||
|
||||
@ -129,6 +130,9 @@ cd %{_builddir}/%{name}-%{version}/src
|
||||
%{_libdir}/liblwip.a
|
||||
|
||||
%changelog
|
||||
* Tue Nov 28 2023 jiangheng <jiangheng14@huawei.com> - 2.1.3-89
|
||||
- log: add errevent log and tcp exception statistics
|
||||
|
||||
* Tue Nov 28 2023 yangchen <yangchen145@huawei.com> - 2.1.3-88
|
||||
- add lwip log: tcp_rst & tcp_abandon & tcp_abort
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user