1 Star 0 Fork 48

zhengjiebing/lwip_222

forked from src-openEuler/lwip 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0104-optimize-enqueue-for-unacked-and-unsent-queue.patch 2.49 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2024-02-06 10:45 +08:00 . adapt lwip-2.2.0
From d491c37cce3796ddce32b30be7ad23d52937479e Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Mon, 5 Feb 2024 19:18:52 +0800
Subject: optimize enqueue for unacked and unsent queue
---
src/core/tcp_out.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
index 30cd215..1ab5cfb 100644
--- a/src/core/tcp_out.c
+++ b/src/core/tcp_out.c
@@ -1636,6 +1636,10 @@ tcp_output(struct tcp_pcb *pcb)
pbuf_remove_header(new_seg.p, new_seg.p->tot_len - new_seg.len - TCP_HLEN);
new_seg.p->tot_len = new_seg.p->len;
+ struct tcp_seg **cur_seg = NULL;
+ if (pcb->unacked != NULL) {
+ cur_seg = &(pcb->unacked);
+ }
for (int start = pbuf_chain_len; start > 0; start--) {
struct tcp_seg *tmp_seg = start_seg;
start_seg = start_seg->next;
@@ -1646,10 +1650,10 @@ tcp_output(struct tcp_pcb *pcb)
pcb->last_unacked = tmp_seg;
pcb->unacked = tmp_seg;
useg = tmp_seg;
+ cur_seg = &(pcb->unacked);
} else {
if (TCP_SEQ_LT(lwip_ntohl(tmp_seg->tcphdr->seqno), lwip_ntohl(useg->tcphdr->seqno))) {
/* add segment to before tail of unacked list, keeping the list sorted */
- struct tcp_seg **cur_seg = &(pcb->unacked);
while (*cur_seg &&
TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(tmp_seg->tcphdr->seqno))) {
cur_seg = &((*cur_seg)->next );
@@ -2160,7 +2164,10 @@ tcp_rexmit(struct tcp_pcb *pcb)
}
seg = pcb->unacked;
+#if GAZELLE_ENABLE
+ cur_seg = &(pcb->unsent);
while (seg) {
+#endif
/* Give up if the segment is still referenced by the netif driver
due to deferred transmission. */
if (tcp_output_segment_busy(seg)) {
@@ -2177,7 +2184,9 @@ tcp_rexmit(struct tcp_pcb *pcb)
pcb->last_unacked = pcb->unacked->next;
pcb->unacked = pcb->unacked->next;
+#if !GAZELLE_ENABLE
cur_seg = &(pcb->unsent);
+#endif
while (*cur_seg &&
TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) {
cur_seg = &((*cur_seg)->next);
@@ -2193,8 +2202,10 @@ tcp_rexmit(struct tcp_pcb *pcb)
}
#endif /* TCP_OVERSIZE */
+#if GAZELLE_ENABLE
seg = pcb->unacked;
}
+#endif
if (pcb->nrtx < 0xFF) {
++pcb->nrtx;
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/steganographer/lwip_222.git
git@gitee.com:steganographer/lwip_222.git
steganographer
lwip_222
lwip_222
master

搜索帮助

371d5123 14472233 46e8bd33 14472233