diff --git a/0018-gazelle-reduce-copy-in-send.patch b/0018-gazelle-reduce-copy-in-send.patch new file mode 100644 index 0000000000000000000000000000000000000000..fffa8b7f96d4a375390d3d19246af6e9e3222d1b --- /dev/null +++ b/0018-gazelle-reduce-copy-in-send.patch @@ -0,0 +1,50 @@ +From 05bfdb54fc744d835c8b3b50b54d220fe7e87277 Mon Sep 17 00:00:00 2001 +From: wuchangsheng +Date: Mon, 7 Mar 2022 21:10:06 +0800 +Subject: [PATCH] reduce copy in send + +--- + src/core/pbuf.c | 5 +++++ + src/include/lwip/pbuf.h | 3 +++ + 2 files changed, 8 insertions(+) + +diff --git a/src/core/pbuf.c b/src/core/pbuf.c +index 27afc28..cd6b558 100644 +--- a/src/core/pbuf.c ++++ b/src/core/pbuf.c +@@ -281,6 +281,10 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) + } + + /* If pbuf is to be allocated in RAM, allocate memory for it. */ ++#if USE_LIBOS ++ /* alloc mbuf to reduce copy in sending */ ++ p = lwip_alloc_pbuf(layer, length, type); ++#else + p = (struct pbuf *)mem_malloc(alloc_len); + if (p == NULL) { + return NULL; +@@ -289,6 +293,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type) + length, length, type, 0); + LWIP_ASSERT("pbuf_alloc: pbuf->payload properly aligned", + ((mem_ptr_t)p->payload % MEM_ALIGNMENT) == 0); ++#endif + break; + } + default: +diff --git a/src/include/lwip/pbuf.h b/src/include/lwip/pbuf.h +index e5daf96..3894574 100644 +--- a/src/include/lwip/pbuf.h ++++ b/src/include/lwip/pbuf.h +@@ -272,6 +272,9 @@ void pbuf_free_ooseq(void); + /* Initializes the pbuf module. This call is empty for now, but may not be in future. */ + #define pbuf_init() + ++#if USE_LIBOS ++struct pbuf *lwip_alloc_pbuf(pbuf_layer l, u16_t length, pbuf_type type); ++#endif + struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type); + struct pbuf *pbuf_alloc_reference(void *payload, u16_t length, pbuf_type type); + #if LWIP_SUPPORT_CUSTOM_PBUF +-- +2.30.0 + diff --git a/lwip.spec b/lwip.spec index 16722837cc6ae14c9ba2053a4ec5f54d4fa538b2..365f357b23df8947f9c9f9d9e7670a0a7227df55 100644 --- a/lwip.spec +++ b/lwip.spec @@ -4,7 +4,7 @@ Summary: lwip is a small independent implementation of the TCP/IP protocol suite Name: lwip Version: 2.1.3 -Release: 4 +Release: 5 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.tar.gz @@ -26,6 +26,7 @@ Patch9013: 0014-fix-some-compile-errors.patch Patch9014: 0015-fix-tcp-port-alloc-issue.patch Patch9015: 0016-lstack-support-mysql-mode.patch Patch9016: 0017-support-REUSEPOR-option.patch +Patch9017: 0018-gazelle-reduce-copy-in-send.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -37,27 +38,9 @@ ExclusiveArch: x86_64 aarch64 lwip is a small independent implementation of the TCP/IP protocol suite. %prep -%setup -n %{name}-%{version} -q +%autosetup -n %{name}-%{version} -p1 find %{_builddir}/%{name}-%{version} -type f -exec dos2unix -q {} \; -%patch9000 -p1 -%patch9001 -p1 -%patch9002 -p1 -%patch9003 -p1 -%patch9004 -p1 -%patch9005 -p1 -%patch9006 -p1 -%patch9007 -p1 -%patch9008 -p1 -%patch9009 -p1 -%patch9010 -p1 -%patch9011 -p1 -%patch9012 -p1 -%patch9013 -p1 -%patch9014 -p1 -%patch9015 -p1 -%patch9016 -p1 - %build cd %{_builddir}/%{name}-%{version}/src %make_build @@ -72,6 +55,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Mon Mar 07 2022 wu-changsheng - 2.1.3-5 +- gazelle reduce copy in send + * Thu Mar 03 2022 jiangheng - 2.1.3-4 - support REUSEPOR option - fix rpc msg too much