diff --git a/0137-reduce-pbuf-pool-size.patch b/0137-reduce-pbuf-pool-size.patch new file mode 100644 index 0000000000000000000000000000000000000000..0ff2f9da0d2483d4a5b655714c7e0c2340d7f28b --- /dev/null +++ b/0137-reduce-pbuf-pool-size.patch @@ -0,0 +1,44 @@ +From 98e846b1bc4f4c304bd08dbce0d92467f01a4196 Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Thu, 13 Jun 2024 08:57:50 +0800 +Subject: [PATCH] reduce pbuf pool size + +--- + src/core/init.c | 4 ++++ + src/include/lwipopts.h | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/core/init.c b/src/core/init.c +index c0aaf45..821c6c7 100644 +--- a/src/core/init.c ++++ b/src/core/init.c +@@ -321,9 +321,13 @@ PACK_STRUCT_END + #if !MEMP_MEM_MALLOC && PBUF_POOL_SIZE && (PBUF_POOL_BUFSIZE <= (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)) + #error "lwip_sanity_check: WARNING: PBUF_POOL_BUFSIZE does not provide enough space for protocol headers. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." + #endif ++ ++#if !GAZELLE_ENABLE + #if !MEMP_MEM_MALLOC && PBUF_POOL_SIZE && (TCP_WND > (PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN)))) + #error "lwip_sanity_check: WARNING: TCP_WND is larger than space provided by PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - protocol headers). If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." + #endif ++#endif ++ + #if TCP_WND < TCP_MSS + #error "lwip_sanity_check: WARNING: TCP_WND is smaller than MSS. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error." + #endif +diff --git a/src/include/lwipopts.h b/src/include/lwipopts.h +index 4655388..cb3154a 100644 +--- a/src/include/lwipopts.h ++++ b/src/include/lwipopts.h +@@ -134,7 +134,7 @@ + + #define MEMP_NUM_SYS_MBOX (GAZELLE_MAX_CLIENTS + GAZELLE_RESERVED_CLIENTS) + +-#define PBUF_POOL_SIZE (GAZELLE_MAX_CLIENTS * 2) ++#define PBUF_POOL_SIZE (1024) + + /* we use PBUF_POOL instead of PBUF_RAM in tcp_write, so reduce PBUF_RAM size, + * and do NOT let PBUF_POOL_BUFSIZE less then TCP_MSS +-- +2.33.0 + diff --git a/lwip.spec b/lwip.spec index 20b6d2a7c2e41f5b1d6301f38da300d9fa128304..46a5628773dc99800d7490dc3a4327bab425743b 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.2.0 -Release: 29 +Release: 30 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -148,6 +148,7 @@ Patch9132: 0133-allow-membership-to-register-multiple-times.patch Patch9133: 0134-mod-checksum-of-ip_hdr-and-udp_hdr.patch Patch9134: 0135-change-STAT_COUNTER-from-u16-to-u64.patch Patch9135: 0136-fix-vlan-filter-bug.patch +Patch9136: 0137-reduce-pbuf-pool-size.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -177,6 +178,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Fri Jun 14 2024 jiangheng - 2.2.0-30 +- reduce pbuf pool size + * Fri May 24 2024 zhengjiebing - 2.2.0-29 - fix vlan filter bug