From 01d9bd573ee26a3bc26209b4376b192c99371d9c Mon Sep 17 00:00:00 2001 From: kieranm Date: Wed, 28 Mar 2007 12:27:38 +0000 Subject: [PATCH] 2007-03-28 Kieran Mansley * opt.h Change default PBUF_POOL_BUFSIZE (again) to accomodate default MSS + IP and TCP headers *and* physical link headers --- CHANGELOG | 5 +++++ src/include/lwip/opt.h | 43 ++++++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8129fd6a..520d4eaa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -95,8 +95,13 @@ HISTORY 2007-02-26 Jonathan Larmour (based on patch from Simon Goldschmidt) * api_lib.c: Use memcpy in netbuf_copy_partial. + ++ Bug fixes: + 2007-03-28 Kieran Mansley + * opt.h Change default PBUF_POOL_BUFSIZE (again) to accomodate default MSS + + IP and TCP headers *and* physical link headers + 2007-03-26 Frédéric Bernon (based on patch from Dmitry Potapov) * api_lib.c: patch for netconn_write(), fixes a possible race condition which cause to send some garbage. It is not a definitive solution, but the patch does solve diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index 804a9027..86997e7c 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -143,26 +143,6 @@ a lot of data that needs to be copied, this should be set high. */ #define MEMP_NUM_TCPIP_MSG 8 #endif -/* ---------- Pbuf options ---------- */ -/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ - -#ifndef PBUF_POOL_SIZE -#define PBUF_POOL_SIZE 16 -#endif - -/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ - -#ifndef PBUF_POOL_BUFSIZE -/* TCP_MSS + 40 for IP and TCP headers */ -#define PBUF_POOL_BUFSIZE (128+40) -#endif - -/* PBUF_LINK_HLEN: the number of bytes that should be allocated for a - link level header. Defaults to 14 for Ethernet. */ - -#ifndef PBUF_LINK_HLEN -#define PBUF_LINK_HLEN 14 -#endif /* ---------- ARP options ---------- */ #ifndef LWIP_ARP @@ -384,6 +364,29 @@ a lot of data that needs to be copied, this should be set high. */ #endif +/* ---------- Pbuf options ---------- */ +/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ + +#ifndef PBUF_POOL_SIZE +#define PBUF_POOL_SIZE 16 +#endif + +/* PBUF_LINK_HLEN: the number of bytes that should be allocated for a + link level header. Defaults to 14 for Ethernet. */ + +#ifndef PBUF_LINK_HLEN +#define PBUF_LINK_HLEN 14 +#endif + +/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ + +#ifndef PBUF_POOL_BUFSIZE +/* Default designed to accomodate single full size TCP frame in one PBUF */ +/* TCP_MSS + 40 for IP and TCP headers + physical layer headers */ +#define PBUF_POOL_BUFSIZE (TCP_MSS+40+PBUF_LINK_HLEN) +#endif + + /* ---- Network Interfaces options ---- */ /* 1 if you want to use DHCP_OPTION_HOSTNAME with netif's hostname field */ #ifndef LWIP_NETIF_HOSTNAME