aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-09-17 17:06:34 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-09-17 17:06:34 -0700
commitb46a939e45d6f7968a4684fc4e587f1b9cd73904 (patch)
tree28997029337091a747efc5355eec9488b6f5431b
parent1fca84a753c24831d3b16ce09525b194406c2d35 (diff)
downloadlwip-b46a939e45d6f7968a4684fc4e587f1b9cd73904.tar.gz
lwip-b46a939e45d6f7968a4684fc4e587f1b9cd73904.tar.xz
lwip-b46a939e45d6f7968a4684fc4e587f1b9cd73904.zip
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@zytor.com>
-rw-r--r--core/fs/pxe/isr.c8
-rw-r--r--core/lwip/src/include/lwipopts.h10
2 files changed, 12 insertions, 6 deletions
diff --git a/core/fs/pxe/isr.c b/core/fs/pxe/isr.c
index 7f1d2ea9..7c43b37e 100644
--- a/core/fs/pxe/isr.c
+++ b/core/fs/pxe/isr.c
@@ -91,7 +91,13 @@ 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 2b036ccd..d2debb22 100644
--- a/core/lwip/src/include/lwipopts.h
+++ b/core/lwip/src/include/lwipopts.h
@@ -13,12 +13,12 @@
#endif
#define MEM_USE_POOLS_TRY_BIGGER_POOL 1
-#define TCPIP_MBOX_SIZE 64
+#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 16
+#define DEFAULT_TCP_RECVMBOX_SIZE 128
#define DEFAULT_ACCEPTMBOX_SIZE 4
#define LWIP_SOCKET 0
@@ -35,7 +35,7 @@
#define MEMP_NUM_TCPIP_MSG_INPKT 64
#define PBUF_POOL_SIZE 256
#define ARP_TABLE_SIZE 16
-#define IP_REASS_MAX_PBUFS 32
+#define IP_REASS_MAX_PBUFS 64
#define IP_REASS_MAXAGE 10
#define LWIP_NETIF_API 1
@@ -43,8 +43,8 @@
#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
#define ETHARP_TRUST_IP_MAC 0