reduce pbuf poll size

(cherry picked from commit 31d2ac9cf3e6e42de830d4276cab3c64deee0851)
This commit is contained in:
yinbin6 2024-06-15 20:36:59 +08:00 committed by openeuler-sync-bot
parent d51b323592
commit b827de2e31
2 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,44 @@
From 98e846b1bc4f4c304bd08dbce0d92467f01a4196 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
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

View File

@ -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,7 +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
#Requires:
@ -177,6 +177,9 @@ cd %{_builddir}/%{name}-%{version}/src
%{_libdir}/liblwip.a
%changelog
* Sat Jun 15 2024 yinbin <yinbin8@huawei.com> - 2.2.0-30
- reduce pbuf pool size
* Fri May 24 2024 zhengjiebing <zhengjiebing@cmss.chinamobile.com> - 2.2.0-29
- fix vlan filter bug