From be766af0fbc223a0c575636e114c0bb9f1c8438c Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 3 Sep 2011 13:27:25 -0700 Subject: [PATCH] LwIP fine tuning --- lwip/src/include/arch/cc.h | 2 +- lwip/src/include/lwipopts.h | 44 +++++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/lwip/src/include/arch/cc.h b/lwip/src/include/arch/cc.h index 3474f573..392132bb 100644 --- a/lwip/src/include/arch/cc.h +++ b/lwip/src/include/arch/cc.h @@ -70,7 +70,7 @@ typedef size_t mem_ptr_t; #define MEM_ALIGNMENT 4 #define ETH_PAD_SIZE 2 -#define LWIP_CHKSUM_ALGORITHM 2 +#define LWIP_CHKSUM_ALGORITHM 3 /* prototypes for printf() and abort() */ #include diff --git a/lwip/src/include/lwipopts.h b/lwip/src/include/lwipopts.h index 68ae046b..34d12975 100644 --- a/lwip/src/include/lwipopts.h +++ b/lwip/src/include/lwipopts.h @@ -3,6 +3,8 @@ #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H_ +#include + /** * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain * critical regions during buffer allocation, deallocation and memory @@ -59,10 +61,19 @@ */ #define LWIP_TCP 1 +/** + * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, + * you might want to increase this.) + * For the receive side, this MSS is advertised to the remote side + * when opening a connection. For the transmit size, this MSS sets + * an upper limit on the MSS advertised by the remote host. + */ +#define TCP_MSS 1460 + /** * TCP_SND_BUF: TCP sender buffer space (bytes). */ -#define TCP_SND_BUF (16*1024) +#define TCP_SND_BUF (16*TCP_WND) /** * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) @@ -118,15 +129,6 @@ */ #define DEFAULT_THREAD_PRIO NORMAL_PRIO -/** - * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, - * you might want to increase this.) - * For the receive side, this MSS is advertised to the remote side - * when opening a connection. For the transmit size, this MSS sets - * an upper limit on the MSS advertised by the remote host. - */ -#define TCP_MSS 2048 - /** * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ @@ -175,7 +177,25 @@ * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. * (requires the LWIP_TCP option) */ -#define MEMP_NUM_TCP_SEG 32 +#define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN + +// On the SCC, we have not to check incoming messages +#ifdef CONFIG_ROCKCREEK +/** + * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. + */ +#define CHECKSUM_CHECK_IP 0 + +/** + * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. + */ +#define CHECKSUM_CHECK_UDP 0 + +/** + * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. + */ +#define CHECKSUM_CHECK_TCP 0 +#endif /* DEBUG options */ #define LWIP_DEBUG 1 @@ -187,7 +207,7 @@ #define MEM_DEBUG LWIP_DBG_OFF #define IP_DEBUG LWIP_DBG_OFF #define INET_DEBUG LWIP_DBG_OFF -#define NETIF_DEBUG LWIP_DBG_ON +#define NETIF_DEBUG LWIP_DBG_OFF #define TIMERS_DEBUG LWIP_DBG_OFF #define SOCKETS_DEBUG LWIP_DBG_OFF #define PBUF_DEBUG LWIP_DBG_OFF