diff --git a/TODO b/TODO index 475263727769be706229868655e1b0f876552c8e..7345d5b60839c38176c4d2018cdbaf6a0b936885 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ -NuttX TODO List (Last updated May 31, 2011) +NuttX TODO List (Last updated June 6, 2011) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nuttx/ @@ -10,7 +10,7 @@ nuttx/ (1) pthreads (sched/) (1) C++ Support (5) Binary loaders (binfmt/) - (15) Network (net/, drivers/net) + (16) Network (net/, drivers/net) (2) USB (drivers/usbdev, drivers/usbhost) (6) Libraries (lib/) (13) File system/Generic drivers (fs/, drivers/) @@ -333,6 +333,17 @@ o Network (net/, drivers/net) the mechanism for leaving and joining groups is hidden behind a wrapper function so that little of this incompatibilities need be exposed. + Description: Many configurations have the MTU (CONFIG_NET_BUFSIZE) set to very small + numbers, less then the minimum MTU size that must be supported -- 576. + This can cause problems in some networks: CONFIG_NET_BUFSIZE should + be set to at least 576 in all defconfig files. + + The symptoms of using very small MTU sizes can be very strange. With + Ubuntu 9.x and vsFtpd was that the total packet size did *not match* the + packet size in the IP header. This then caused a TCP checksum failure + and the packet was rejected. + Status: Open + Priority: Low... fix defconfig files as necessary. o USB (drivers/usbdev, drivers/usbhost) ^^^^^^^^^^^^^^^^^^^^ diff --git a/arch/arm/src/lpc17xx/lpc17_emacram.h b/arch/arm/src/lpc17xx/lpc17_emacram.h index 98eaa91b97487793c4c25c512fdf35f10e6dba68..3561b72ba8a35af15e13f2de0239c9720c09889d 100755 --- a/arch/arm/src/lpc17xx/lpc17_emacram.h +++ b/arch/arm/src/lpc17xx/lpc17_emacram.h @@ -209,7 +209,7 @@ #define LPC17_PKTMEM_SIZE (LPC17_EMACRAM_SIZE-LPC17_DESCTAB_SIZE) #define LPC17_PKTMEM_END (LPC17_EMACRAM_BASE+LPC17_PKTMEM_SIZE) -#define LPC17_MAXPACKET_SIZE ((CONFIG_NET_BUFSIZE + 3 + 2) & ~3) +#define LPC17_MAXPACKET_SIZE ((CONFIG_NET_BUFSIZE + CONFIG_NET_GUARDSIZE + 3) & ~3) #define LPC17_NTXPKTS CONFIG_NET_NTXDESC #define LPC17_NRXPKTS CONFIG_NET_NRXDESC diff --git a/arch/arm/src/lpc17xx/lpc17_ethernet.c b/arch/arm/src/lpc17xx/lpc17_ethernet.c index 3efa3df03b8476eae45795ccf55f8737cdb89b6a..de015bcb94f0b1c9f9e9876ec21cea22a0cf7d1d 100644 --- a/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -53,6 +53,7 @@ #include <nuttx/mii.h> #include <net/uip/uip.h> +#include <net/uip/uipopt.h> #include <net/uip/uip-arp.h> #include <net/uip/uip-arch.h> @@ -809,7 +810,7 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv) * imply that the packet is too big. */ - /* else */ if (pktlen > CONFIG_NET_BUFSIZE+2) + /* else */ if (pktlen > CONFIG_NET_BUFSIZE + CONFIG_NET_GUARDSIZE) { nlldbg("Too big. considx: %08x prodidx: %08x pktlen: %d rxstat: %08x\n", considx, prodidx, pktlen, *rxstat); diff --git a/configs/olimex-lpc1766stk/ftpc/defconfig b/configs/olimex-lpc1766stk/ftpc/defconfig index 2ba0a0277ef2863d9f2bbb58e457aa2d9d6c374b..5d01d7e86d6c718b69d81550949c2993f1386c2f 100755 --- a/configs/olimex-lpc1766stk/ftpc/defconfig +++ b/configs/olimex-lpc1766stk/ftpc/defconfig @@ -207,7 +207,7 @@ CONFIG_PHY_KS8721=y CONFIG_PHY_AUTONEG=y CONFIG_PHY_SPEED100=n CONFIG_PHY_FDUPLEX=y -CONFIG_NET_EMACRAM_SIZE=8192 +CONFIG_NET_EMACRAM_SIZE=8448 CONFIG_NET_NTXDESC=7 CONFIG_NET_NRXDESC=7 CONFIG_NET_REGDEBUG=n @@ -551,7 +551,7 @@ CONFIG_NET=y CONFIG_NET_IPv6=n CONFIG_NSOCKET_DESCRIPTORS=16 CONFIG_NET_SOCKOPTS=y -CONFIG_NET_BUFSIZE=562 +CONFIG_NET_BUFSIZE=576 CONFIG_NET_TCP=y CONFIG_NET_TCP_CONNS=16 CONFIG_NET_NTCP_READAHEAD_BUFFERS=16 diff --git a/include/net/uip/uip-arch.h b/include/net/uip/uip-arch.h index 2cbe7239c6837e2343511f85791fd205f2c02cf6..3cb2904ea3bf1dacc9e6360f4ec627d10d78decc 100644 --- a/include/net/uip/uip-arch.h +++ b/include/net/uip/uip-arch.h @@ -117,7 +117,7 @@ struct uip_driver_s #ifdef CONFIG_NET_MULTIBUFFER uint8_t *d_buf; #else - uint8_t d_buf[CONFIG_NET_BUFSIZE + 2]; + uint8_t d_buf[CONFIG_NET_BUFSIZE + CONFIG_NET_GUARDSIZE]; #endif /* d_appdata points to the location where application data can be read from diff --git a/include/net/uip/uipopt.h b/include/net/uip/uipopt.h index f6aff58bd35d124ec071f55a87a706aef63da589..a0ba62ee1000534f96aff0438574e8188dc63c03 100644 --- a/include/net/uip/uipopt.h +++ b/include/net/uip/uipopt.h @@ -134,6 +134,18 @@ #define UIP_REASS_MAXAGE (20*10) /* 20 seconds */ +/* Network drivers often receive packets with garbage at the end + * and are longer than the size of packet in the TCP header. The + * following "fudge" factor increases the size of the I/O buffering + * by a small amount to allocate slightly oversize packets. After + * receipt, the packet size will be chopped down to the size indicated + * in the TCP header. + */ + +#ifndef CONFIG_NET_GUARDSIZE +# define CONFIG_NET_GUARDSIZE 2 +#endif + /* ICMP configuration options */ #if !defined(CONFIG_NET_ICMP) || defined(CONFIG_DISABLE_CLOCK)