From 4e5a5f03497e563025543d89859a5825b732c8ce Mon Sep 17 00:00:00 2001 From: jiangheng12 Date: Fri, 10 Mar 2023 19:40:18 +0800 Subject: [PATCH] reduce cpu usage when send --- 0054-reduce-cpu-usage-when-send.patch | 32 +++++++++++++++++++++++++++ lwip.spec | 7 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0054-reduce-cpu-usage-when-send.patch diff --git a/0054-reduce-cpu-usage-when-send.patch b/0054-reduce-cpu-usage-when-send.patch new file mode 100644 index 0000000..94f394f --- /dev/null +++ b/0054-reduce-cpu-usage-when-send.patch @@ -0,0 +1,32 @@ +From d3d6f7fa6e755992fd4b75b56681b5e14aa8ba14 Mon Sep 17 00:00:00 2001 +From: jiangheng12 +Date: Fri, 10 Mar 2023 19:32:48 +0800 +Subject: [PATCH] reduce cpu usage when send + +--- + src/include/lwipsock.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/include/lwipsock.h b/src/include/lwipsock.h +index f78c9cf..810e98f 100644 +--- a/src/include/lwipsock.h ++++ b/src/include/lwipsock.h +@@ -33,6 +33,7 @@ + #ifndef __LWIPSOCK_H__ + #define __LWIPSOCK_H__ + ++#include + #include "lwip/opt.h" + #include "lwip/api.h" + +@@ -110,6 +111,7 @@ struct lwip_sock { + struct list_node send_list; + struct pbuf *send_lastdata; + struct pbuf *send_pre_del; ++ sem_t snd_ring_sem; + + char pad3 __rte_cache_aligned; + /* nerver change */ +-- +2.23.0 + diff --git a/lwip.spec b/lwip.spec index dd9deb1..622bfb6 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: 44 +Release: 45 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -65,6 +65,7 @@ Patch9049: 0050-lwip-reuse-ip-port.patch Patch9050: 0051-lwip-add-need_tso_send.patch Patch9051: 0052-lwip_fnctl-only-support-F_SETFL-F_GETFL.patch Patch9052: 0053-cleancode-improve-lwipopts.h-readability.patch +Patch9053: 0054-reduce-cpu-usage-when-send.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -134,6 +135,7 @@ find %{_builddir}/%{name}-%{version} -type f -exec dos2unix -q {} \; %patch9050 -p1 %patch9051 -p1 %patch9052 -p1 +%patch9053 -p1 %build cd %{_builddir}/%{name}-%{version}/src @@ -149,6 +151,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Fri Mar 10 2023 jiangheng - 2.1.3-45 +- reduce cpu usage when send + * Thu Mar 9 2023 Lemmy Huang - 2.1.3-44 - cleancode: improve lwipopts.h readability