[syslinux:lwip] core: lwip: tune parameters for performance

syslinux-bot for H. Peter Anvin hpa at zytor.com
Fri Apr 22 20:05:45 PDT 2011


Commit-ID:  7bffc3a00ee5b491ec27242bdbe3afba1c532eee
Gitweb:     http://syslinux.zytor.com/commit/7bffc3a00ee5b491ec27242bdbe3afba1c532eee
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Thu, 17 Sep 2009 17:06:34 -0700
Committer:  Eric W. Biederman <ebiederm at xmission.com>
CommitDate: Tue, 12 Apr 2011 14:40:53 -0700

core: lwip: tune parameters for performance

With these tweaks, we are up from 6 Mbps to over 200 Mbps on a
back-to-back gigabit TCP connection.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 core/fs/pxe/isr.c                |    8 ++++++-
 core/lwip/src/include/lwipopts.h |   42 ++++++++++++++++++++++++++++++++++++-
 2 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/core/fs/pxe/isr.c b/core/fs/pxe/isr.c
index 0799061..a59b91a 100644
--- a/core/fs/pxe/isr.c
+++ b/core/fs/pxe/isr.c
@@ -91,6 +91,12 @@ static void pxe_receive_thread(void *dummy)
 void pxe_init_isr(void)
 {
     start_idle_thread();
-    start_thread("pxe receive", 16384, 0, pxe_receive_thread, NULL);
+    /*
+     * Run the pxe receive thread at elevated priority, since the UNDI
+     * stack is likely to have very limited memory available; therefore to
+     * avoid packet loss we need to move it into memory that we ourselves
+     * manage, as soon as possible.
+     */
+    start_thread("pxe receive", 16384, -20, pxe_receive_thread, NULL);
     core_pm_hook = pm_return;
 }
diff --git a/core/lwip/src/include/lwipopts.h b/core/lwip/src/include/lwipopts.h
index 915d232..c10a277 100644
--- a/core/lwip/src/include/lwipopts.h
+++ b/core/lwip/src/include/lwipopts.h
@@ -5,10 +5,48 @@
 #define LWIP_NETIF_API		1
 #define LWIP_DNS		1
 
+#define MEM_SIZE		(1 << 18)
+#if 0
+#define MEMP_OVERFLOW_CHECK	2 /* XXX: for debugging */
+#define MEMP_SANITY_CHECK	1 /* XXX: for debugging */
+#else
+#define MEMP_OVERFLOW_CHECK	0 /* XXX: for debugging */
+#define MEMP_SANITY_CHECK	0 /* XXX: for debugging */
+#endif
+#define MEM_USE_POOLS_TRY_BIGGER_POOL	1
+
+#define TCPIP_MBOX_SIZE         	512
+#define TCPIP_THREAD_PRIO		0
+#define TCPIP_THREAD_STACKSIZE		32768
+
+#define DEFAULT_UDP_RECVMBOX_SIZE	16
+#define DEFAULT_TCP_RECVMBOX_SIZE	128
+#define DEFAULT_ACCEPTMBOX_SIZE		4
+
+#define LWIP_SOCKET			0
+
+#define MEM_LIBC_MALLOC			0
+#define MEMP_MEM_MALLOC			0
+
+#define MEMP_NUM_TCP_PCB		64
+#define MEMP_NUM_TCP_SEG		256
+#define MEMP_NUM_REASSDATA		32
+#define MEMP_NUM_SYS_TIMEOUT		8
+#define MEMP_NUM_NETCONN		64
+#define MEMP_NUM_TCPIP_MSG_API		64
+#define MEMP_NUM_TCPIP_MSG_INPKT	64
+#define PBUF_POOL_SIZE			256
+#define ARP_TABLE_SIZE			16
+#define IP_REASS_MAX_PBUFS		64
+#define IP_REASS_MAXAGE			10
+
+#define LWIP_NETIF_API		1
+
+#define LWIP_DNS		1
 #define DNS_TABLE_SIZE		16
 #define DNS_MAX_SERVERS		4
-#define TCP_WND			32768
-#define TCP_MSS			4096
+#define TCP_WND			0xff00
+#define TCP_MSS			1460
 #define TCP_SND_BUF		4096
 
 #endif /* __LWIPOPTS_H__ */



More information about the Syslinux-commits mailing list