代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lwip 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From d9e656c6ca48367fdc174b00c64d6f3fb0584a38 Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Mon, 5 Feb 2024 15:09:14 +0800
Subject: [PATCH] add huge snd_buf
---
src/core/init.c | 2 +-
src/core/pbuf.c | 9 ++++++---
src/include/lwip/opt.h | 2 +-
src/include/lwip/pbuf.h | 2 +-
src/include/lwipopts.h | 2 +-
5 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/core/init.c b/src/core/init.c
index 5b60ed8..6841857 100644
--- a/src/core/init.c
+++ b/src/core/init.c
@@ -312,7 +312,7 @@ PACK_STRUCT_END
#if TCP_MSS >= ((16 * 1024) - 1)
#error "lwip_sanity_check: WARNING: TCP_MSS must be <= 16382 to prevent u16_t underflow in TCP_SNDLOWAT calculation!"
#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 --git a/src/core/pbuf.c b/src/core/pbuf.c
index 69a52b6..bea0e81 100644
--- a/src/core/pbuf.c
+++ b/src/core/pbuf.c
@@ -871,13 +871,13 @@ pbuf_cat(struct pbuf *h, struct pbuf *t)
/* 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,
@@ -1178,7 +1178,7 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
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));
}
@@ -1189,6 +1189,9 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
/* 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 --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h
index b738460..570d2de 100644
--- a/src/include/lwip/opt.h
+++ b/src/include/lwip/opt.h
@@ -1533,7 +1533,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 --git a/src/include/lwip/pbuf.h b/src/include/lwip/pbuf.h
index b362007..60d8d1a 100644
--- a/src/include/lwip/pbuf.h
+++ b/src/include/lwip/pbuf.h
@@ -197,7 +197,7 @@ struct pbuf {
* 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 --git a/src/include/lwipopts.h b/src/include/lwipopts.h
index 7c819d0..d7b9635 100644
--- a/src/include/lwipopts.h
+++ b/src/include/lwipopts.h
@@ -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)
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。