add huge snd_buf
(cherry picked from commit 5f2a5765308b5681282f06bbc085e9f307cf792a)
This commit is contained in:
parent
7556bafb0d
commit
7c0d41c71e
86
0040-add-huge-snd_buf.patch
Normal file
86
0040-add-huge-snd_buf.patch
Normal file
@ -0,0 +1,86 @@
|
||||
diff -Nur lwip-2.1.3-org/src/core/init.c lwip-2.1.3/src/core/init.c
|
||||
--- lwip-2.1.3-org/src/core/init.c 2022-12-06 14:40:45.280000000 +0000
|
||||
+++ lwip-2.1.3/src/core/init.c 2022-12-06 14:41:01.452000000 +0000
|
||||
@@ -306,7 +306,7 @@
|
||||
#if TCP_SNDLOWAT >= TCP_SND_BUF
|
||||
#error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must be less than TCP_SND_BUF. If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
|
||||
#endif
|
||||
-#if TCP_SNDLOWAT >= (0xFFFF - (4 * TCP_MSS))
|
||||
+#if TCP_SNDLOWAT >= (0xFFFFFFFF - (4 * TCP_MSS))
|
||||
#error "lwip_sanity_check: WARNING: TCP_SNDLOWAT must at least be 4*MSS below u16_t overflow!"
|
||||
#endif
|
||||
#if TCP_SNDQUEUELOWAT >= TCP_SND_QUEUELEN
|
||||
diff -Nur lwip-2.1.3-org/src/core/pbuf.c lwip-2.1.3/src/core/pbuf.c
|
||||
--- lwip-2.1.3-org/src/core/pbuf.c 2022-12-06 14:40:45.280000000 +0000
|
||||
+++ lwip-2.1.3/src/core/pbuf.c 2022-12-06 14:46:04.860000000 +0000
|
||||
@@ -869,13 +869,13 @@
|
||||
/* proceed to last pbuf of chain */
|
||||
for (p = h; p->next != NULL; p = p->next) {
|
||||
/* add total length of second chain to all totals of first chain */
|
||||
- p->tot_len = (u16_t)(p->tot_len + t->tot_len);
|
||||
+ p->tot_len = p->tot_len + t->tot_len;
|
||||
}
|
||||
/* { p is last pbuf of first h chain, p->next == NULL } */
|
||||
LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
|
||||
LWIP_ASSERT("p->next == NULL", p->next == NULL);
|
||||
/* add total length of second chain to last pbuf total of first chain */
|
||||
- p->tot_len = (u16_t)(p->tot_len + t->tot_len);
|
||||
+ p->tot_len = p->tot_len + t->tot_len;
|
||||
/* chain last pbuf of head (p) with first of tail (t) */
|
||||
p->next = t;
|
||||
/* p->next now references t, but the caller will drop its reference to t,
|
||||
@@ -1181,7 +1181,7 @@
|
||||
if (r != NULL) {
|
||||
/* Update the tot_len field in the first part */
|
||||
for (i = p; i != NULL; i = i->next) {
|
||||
- i->tot_len = (u16_t)(i->tot_len - r->tot_len);
|
||||
+ i->tot_len = tot_len_front;
|
||||
LWIP_ASSERT("tot_len/len mismatch in last pbuf",
|
||||
(i->next != NULL) || (i->tot_len == i->len));
|
||||
}
|
||||
@@ -1192,6 +1192,9 @@
|
||||
/* tot_len field in rest does not need modifications */
|
||||
/* reference counters do not need modifications */
|
||||
*rest = r;
|
||||
+ r->tot_len = r->len;
|
||||
+ }else{
|
||||
+ p->tot_len = tot_len_front;
|
||||
}
|
||||
}
|
||||
}
|
||||
diff -Nur lwip-2.1.3-org/src/include/lwip/opt.h lwip-2.1.3/src/include/lwip/opt.h
|
||||
--- lwip-2.1.3-org/src/include/lwip/opt.h 2022-12-06 14:40:45.292000000 +0000
|
||||
+++ lwip-2.1.3/src/include/lwip/opt.h 2022-12-06 14:41:01.456000000 +0000
|
||||
@@ -1482,7 +1482,7 @@
|
||||
* send window while having a small receive window only.
|
||||
*/
|
||||
#if !defined LWIP_WND_SCALE || defined __DOXYGEN__
|
||||
-#define LWIP_WND_SCALE 0
|
||||
+#define LWIP_WND_SCALE 1
|
||||
#define TCP_RCV_SCALE 0
|
||||
#endif
|
||||
|
||||
diff -Nur lwip-2.1.3-org/src/include/lwip/pbuf.h lwip-2.1.3/src/include/lwip/pbuf.h
|
||||
--- lwip-2.1.3-org/src/include/lwip/pbuf.h 2022-12-06 14:40:45.284000000 +0000
|
||||
+++ lwip-2.1.3/src/include/lwip/pbuf.h 2022-12-06 14:46:36.720000000 +0000
|
||||
@@ -197,7 +197,7 @@
|
||||
* For non-queue packet chains this is the invariant:
|
||||
* p->tot_len == p->len + (p->next? p->next->tot_len: 0)
|
||||
*/
|
||||
- u16_t tot_len;
|
||||
+ u32_t tot_len;
|
||||
|
||||
/** length of this buffer */
|
||||
u16_t len;
|
||||
diff -Nur lwip-2.1.3-org/src/include/lwipopts.h lwip-2.1.3/src/include/lwipopts.h
|
||||
--- lwip-2.1.3-org/src/include/lwipopts.h 2022-12-06 14:40:45.292000000 +0000
|
||||
+++ lwip-2.1.3/src/include/lwipopts.h 2022-12-06 14:41:01.456000000 +0000
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
#define TCP_WND (40 * TCP_MSS)
|
||||
|
||||
-#define TCP_SND_BUF (40 * TCP_MSS)
|
||||
+#define TCP_SND_BUF (2500 * TCP_MSS)
|
||||
|
||||
#define TCP_SND_QUEUELEN (8191)
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
Summary: lwip is a small independent implementation of the TCP/IP protocol suite
|
||||
Name: lwip
|
||||
Version: 2.1.3
|
||||
Release: 28
|
||||
Release: 29
|
||||
License: BSD
|
||||
URL: http://savannah.nongnu.org/projects/lwip/
|
||||
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
|
||||
@ -51,6 +51,7 @@ Patch9035: 0036-add-fs-secure-compilation-option.patch
|
||||
Patch9036: 0037-enable-ARP-QUEUE-to-avoid-sync-packet-dropped.patch
|
||||
Patch9037: 0038-add-tso.patch
|
||||
Patch9038: 0039-optimize-app-thread-write-buff-block.patch
|
||||
Patch9039: 0040-add-huge-snd_buf.patch
|
||||
|
||||
BuildRequires: gcc-c++ dos2unix dpdk-devel
|
||||
|
||||
@ -106,6 +107,7 @@ find %{_builddir}/%{name}-%{version} -type f -exec dos2unix -q {} \;
|
||||
%patch9036 -p1
|
||||
%patch9037 -p1
|
||||
%patch9038 -p1
|
||||
%patch9039 -p1
|
||||
|
||||
%build
|
||||
cd %{_builddir}/%{name}-%{version}/src
|
||||
@ -121,6 +123,9 @@ cd %{_builddir}/%{name}-%{version}/src
|
||||
%{_libdir}/liblwip.a
|
||||
|
||||
%changelog
|
||||
* Tue Dec 6 2022 zhujunhao<zhujunhao11@huawei.com> - 2.1.3-29
|
||||
- add huge snd_buf
|
||||
|
||||
* Sat Dec 3 2022 wuchangsheng<wuchangsheng2@huawei.com> - 2.1.3-28
|
||||
- add tso define
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user