!220 lwip add need_tso_send

From: @kircher 
Reviewed-by: @jiangheng12 
Signed-off-by: @jiangheng12
This commit is contained in:
openeuler-ci-bot 2023-02-21 07:22:36 +00:00 committed by Gitee
commit d1ddfbd2b1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 83 additions and 2 deletions

View File

@ -0,0 +1,76 @@
From 590873482f9b6a5e2635a95720acb37b5f516ab0 Mon Sep 17 00:00:00 2001
From: kircher <majun65@huawei.com>
Date: Tue, 21 Feb 2023 15:05:41 +0800
Subject: [PATCH] lwip add need_tso_send
---
src/api/api_msg.c | 1 +
src/core/tcp_out.c | 5 ++++-
src/include/lwip/tcp.h | 2 ++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/api/api_msg.c b/src/api/api_msg.c
index 1fedaad..3a4a473 100644
--- a/src/api/api_msg.c
+++ b/src/api/api_msg.c
@@ -1744,6 +1744,7 @@ lwip_netconn_do_writemore(struct netconn *conn WRITE_DELAYED_PARAM)
write_more = 0;
err = tcp_write(conn->pcb.tcp, conn->current_msg->msg.w.vector->ptr, len, apiflags);
conn->current_msg->msg.w.len = len;
+ conn->pcb.tcp->need_tso_send = 1;
#else
err = tcp_write(conn->pcb.tcp, dataptr, len, apiflags);
#endif
diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
index c538f2a..bf23381 100644
--- a/src/core/tcp_out.c
+++ b/src/core/tcp_out.c
@@ -1473,7 +1473,7 @@ tcp_output(struct tcp_pcb *pcb)
u32_t send_len = 0;
#if USE_LIBOS
- if (get_eth_params_tx_ol() & DEV_TX_OFFLOAD_TCP_TSO) {
+ if ((get_eth_params_tx_ol() & DEV_TX_OFFLOAD_TCP_TSO) && pcb->need_tso_send) {
while(seg && send_len < 0xffff) {
/**
* 1) walk unsent queue, find all seg witch wait to send. chain buf in these segs.
@@ -1529,6 +1529,7 @@ tcp_output(struct tcp_pcb *pcb)
if (err != ERR_OK) {
if (pcb->unsent == NULL)
pcb->last_unsent = NULL;
+ pcb->need_tso_send = 0;
return err;
}
pcb->unsent = seg->next;
@@ -1552,6 +1553,7 @@ tcp_output(struct tcp_pcb *pcb)
pbuf_remove_header(new_seg.p, new_seg.p->tot_len - new_seg.len - TCPH_HDRLEN_BYTES(new_seg.tcphdr));
new_seg.p->tot_len = new_seg.p->len;
}
+ pcb->need_tso_send = 0;
} else
#endif
{
@@ -1647,6 +1649,7 @@ tcp_output(struct tcp_pcb *pcb)
#endif /* TCP_OVERSIZE */
output_done:
+ pcb->need_tso_send = 0;
if (pcb->unsent == NULL)
pcb->last_unsent = NULL;
tcp_clear_flags(pcb, TF_NAGLEMEMERR);
diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h
index 0b65b01..2fc683d 100644
--- a/src/include/lwip/tcp.h
+++ b/src/include/lwip/tcp.h
@@ -409,6 +409,8 @@ struct tcp_pcb {
u8_t snd_scale;
u8_t rcv_scale;
#endif
+
+ u8_t need_tso_send;
};
#if TCP_PCB_HASH
--
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.1.3
Release: 41
Release: 42
License: BSD
URL: http://savannah.nongnu.org/projects/lwip/
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
@ -62,6 +62,7 @@ Patch9046: 0047-reduce-struct-pbuf-size.patch
Patch9047: 0048-listen-pcb-also-use-pcb_if.patch
Patch9048: 0049-expand-recv-mbox-size.patch
Patch9049: 0050-lwip-reuse-ip-port.patch
Patch9050: 0051-lwip-add-need_tso_send.patch
BuildRequires: gcc-c++ dos2unix dpdk-devel
@ -127,7 +128,8 @@ find %{_builddir}/%{name}-%{version} -type f -exec dos2unix -q {} \;
%patch9046 -p1
%patch9047 -p1
%patch9048 -p1
#%patch9049 -p1
%patch9049 -p1
%patch9050 -p1
%build
cd %{_builddir}/%{name}-%{version}/src
@ -143,6 +145,9 @@ cd %{_builddir}/%{name}-%{version}/src
%{_libdir}/liblwip.a
%changelog
* Tue Feb 21 2023 majun<majun65@huawei.com> - 2.1.3-42
- add lwip need_tso_send
* Tue Feb 14 2023 majun<majun65@huawei.com> - 2.1.3-41
- add lwip reuse ip port