summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-06 15:06:08 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-06 15:06:08 +0000
commitb47a9d79bb418b3009489b28ebfa0d3d579ceb0a (patch)
tree8d3abea4c75673c0780e3b1c8d8d5a623b75f3a5
parenta5955f1c84d42d78af27a298f3cdb54e9cd9bff0 (diff)
downloadpx4-nuttx-b47a9d79bb418b3009489b28ebfa0d3d579ceb0a.tar.gz
px4-nuttx-b47a9d79bb418b3009489b28ebfa0d3d579ceb0a.tar.bz2
px4-nuttx-b47a9d79bb418b3009489b28ebfa0d3d579ceb0a.zip
Fix minimum MTU... must be at lest 576
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3674 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/TODO15
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_emacram.h2
-rw-r--r--nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c3
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/ftpc/defconfig4
-rw-r--r--nuttx/include/net/uip/uip-arch.h2
-rw-r--r--nuttx/include/net/uip/uipopt.h12
6 files changed, 31 insertions, 7 deletions
diff --git a/nuttx/TODO b/nuttx/TODO
index 475263727..7345d5b60 100644
--- a/nuttx/TODO
+++ b/nuttx/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/nuttx/arch/arm/src/lpc17xx/lpc17_emacram.h b/nuttx/arch/arm/src/lpc17xx/lpc17_emacram.h
index 98eaa91b9..3561b72ba 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_emacram.h
+++ b/nuttx/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/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
index 3efa3df03..de015bcb9 100644
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c
+++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig b/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
index 2ba0a0277..5d01d7e86 100755
--- a/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
+++ b/nuttx/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/nuttx/include/net/uip/uip-arch.h b/nuttx/include/net/uip/uip-arch.h
index 2cbe7239c..3cb2904ea 100644
--- a/nuttx/include/net/uip/uip-arch.h
+++ b/nuttx/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/nuttx/include/net/uip/uipopt.h b/nuttx/include/net/uip/uipopt.h
index f6aff58bd..a0ba62ee1 100644
--- a/nuttx/include/net/uip/uipopt.h
+++ b/nuttx/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)