summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-01-13 13:55:51 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-01-13 13:55:51 -0600
commitd9bb5702d44cbee000a76151558fc51446fcf305 (patch)
tree6b991974a9f7a685db34b05b181fce30049789cd
parent2d9a9034c31134db3f689430b9c04f63cf1ce59b (diff)
downloadnuttx-d9bb5702d44cbee000a76151558fc51446fcf305.tar.gz
nuttx-d9bb5702d44cbee000a76151558fc51446fcf305.tar.bz2
nuttx-d9bb5702d44cbee000a76151558fc51446fcf305.zip
Change how TCP read-ahead is selected to better integrate with TCP write buffering
-rw-r--r--apps/examples/README.txt1
-rw-r--r--apps/examples/poll/poll_internal.h20
-rw-r--r--apps/netutils/thttpd/config.h2
-rw-r--r--nuttx/Documentation/NuttxUserGuide.html3
-rw-r--r--nuttx/configs/c5471evm/httpd/defconfig1
-rw-r--r--nuttx/configs/c5471evm/nettest/defconfig1
-rw-r--r--nuttx/configs/c5471evm/nsh/defconfig1
-rw-r--r--nuttx/configs/c5471evm/ostest/defconfig1
-rw-r--r--nuttx/configs/cloudctrl/nsh/defconfig1
-rw-r--r--nuttx/configs/compal_e88/nsh_highram/defconfig1
-rw-r--r--nuttx/configs/compal_e99/nsh_compalram/defconfig1
-rw-r--r--nuttx/configs/compal_e99/nsh_highram/defconfig1
-rw-r--r--nuttx/configs/eagle100/httpd/defconfig1
-rw-r--r--nuttx/configs/eagle100/nettest/defconfig1
-rw-r--r--nuttx/configs/eagle100/nsh/defconfig1
-rw-r--r--nuttx/configs/eagle100/thttpd/defconfig1
-rw-r--r--nuttx/configs/ekk-lm3s9b96/nsh/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/dhcpd/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/httpd/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/nettest/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/nsh/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/poll/defconfig1
-rw-r--r--nuttx/configs/fire-stm32v2/nsh/defconfig1
-rw-r--r--nuttx/configs/lm3s6432-s2e/nsh/defconfig1
-rw-r--r--nuttx/configs/lm3s6965-ek/discover/defconfig1
-rwxr-xr-xnuttx/configs/lm3s6965-ek/nsh/defconfig1
-rw-r--r--nuttx/configs/lm3s6965-ek/tcpecho/defconfig1
-rwxr-xr-xnuttx/configs/lm3s8962-ek/nsh/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/nsh/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig1
-rw-r--r--nuttx/configs/mbed/hidkbd/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/nettest/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/nsh/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/poll/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/thttpd/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/udp/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/uip/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/ftpc/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/nettest/defconfig1
-rw-r--r--nuttx/configs/olimex-lpc1766stk/nsh/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/thttpd/defconfig1
-rw-r--r--nuttx/configs/olimex-lpc1766stk/zmodem/defconfig1
-rw-r--r--nuttx/configs/olimex-stm32-p107/nsh/defconfig1
-rw-r--r--nuttx/configs/olimex-stm32-p207/nsh/defconfig1
-rwxr-xr-xnuttx/configs/olimex-strp711/nettest/defconfig1
-rw-r--r--nuttx/configs/pic32-starterkit/nsh/defconfig1
-rw-r--r--nuttx/configs/pic32-starterkit/nsh2/defconfig1
-rw-r--r--nuttx/configs/pic32-starterkit/ostest/defconfig1
-rw-r--r--nuttx/configs/pic32mx7mmb/nsh/defconfig1
-rw-r--r--nuttx/configs/pic32mx7mmb/ostest/defconfig1
-rw-r--r--nuttx/configs/shenzhou/nsh/defconfig1
-rw-r--r--nuttx/configs/shenzhou/nxwm/defconfig1
-rw-r--r--nuttx/configs/shenzhou/thttpd/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/dhcpd/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nettest/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nsh/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nsh2/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nxwm/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/telnetd/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/dhcpd/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/discover/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nettest/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nsh/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nsh2/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nxconsole/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nxwm/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/telnetd/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/webserver/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/xmlrpc/defconfig1
-rw-r--r--nuttx/configs/stm32f4discovery/pm/defconfig1
-rwxr-xr-xnuttx/configs/teensy/nsh/defconfig1
-rwxr-xr-xnuttx/configs/teensy/usbmsc/defconfig1
-rw-r--r--nuttx/configs/viewtool-stm32f107/README.txt1
-rw-r--r--nuttx/configs/viewtool-stm32f107/netnsh/defconfig1
-rw-r--r--nuttx/configs/zkit-arm-1769/hello/defconfig1
-rw-r--r--nuttx/configs/zkit-arm-1769/nsh/defconfig1
-rw-r--r--nuttx/configs/zkit-arm-1769/nxhello/defconfig1
-rw-r--r--nuttx/configs/zkit-arm-1769/thttpd/defconfig1
-rw-r--r--nuttx/include/nuttx/net/uip/uip-tcp.h10
-rw-r--r--nuttx/include/nuttx/net/uip/uipopt.h22
-rw-r--r--nuttx/net/Kconfig8
-rw-r--r--nuttx/net/net_poll.c4
-rw-r--r--nuttx/net/net_vfcntl.c6
-rw-r--r--nuttx/net/recvfrom.c16
-rw-r--r--nuttx/net/uip/uip_initialize.c4
-rw-r--r--nuttx/net/uip/uip_internal.h8
-rw-r--r--nuttx/net/uip/uip_tcpcallback.c10
-rw-r--r--nuttx/net/uip/uip_tcpconn.c11
-rw-r--r--nuttx/net/uip/uip_tcpreadahead.c6
91 files changed, 147 insertions, 60 deletions
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index b6547399c..78b6d1bbf 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -1183,6 +1183,7 @@ examples/poll
CONFIG_NET - Defined for general network support
CONFIG_NET_TCP - Defined for TCP/IP support
CONFIG_NSOCKET_DESCRIPTORS - Defined to be greater than 0
+ CONFIG_NET_TCP_READAHEAD - Defined
CONFIG_NET_NTCP_READAHEAD_BUFFERS - Defined to be greater than zero
CONFIG_EXAMPLES_POLL_NOMAC - (May be defined to use software assigned MAC)
diff --git a/apps/examples/poll/poll_internal.h b/apps/examples/poll/poll_internal.h
index 759d23f1c..b621531b3 100644
--- a/apps/examples/poll/poll_internal.h
+++ b/apps/examples/poll/poll_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/poll_internal.h
*
- * Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008, 2009, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __EXAMPLES_PIPE_PIPE_H
-#define __EXAMPLES_PIPE_PIPE_H
+#ifndef __EXAMPLES_POLL_POLL_INTERNAL_H
+#define __EXAMPLES_POLL_POLL_INTERNAL_H
/****************************************************************************
* Compilation Switches
@@ -57,15 +57,15 @@
/* Here are all of the configuration settings that must be met to have TCP/IP
* poll/select support. This kind of looks like overkill.
*
- * CONFIG_NET - Network support must be enabled
- * CONFIG_NSOCKET_DESCRIPTORS - Socket descriptors must be allocated
- * CONFIG_NET_TCP - Only support on TCP (because read-ahead
- * ibuffering s not yet support for UDP)
- * CONFIG_NET_NTCP_READAHEAD_BUFFERS - TCP/IP read-ahead buffering must be enabled
+ * CONFIG_NET - Network support must be enabled
+ * CONFIG_NSOCKET_DESCRIPTORS - Socket descriptors must be allocated
+ * CONFIG_NET_TCP - Only support on TCP (because read-ahead
+ * buffering s not yet support for UDP)
+ * CONFIG_NET_TCP_READAHEAD - TCP/IP read-ahead buffering must be enabled
*/
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 && \
- defined(CONFIG_NET_TCP) && CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+ defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCP_READAHEAD)
# define HAVE_NETPOLL 1
#else
# undef HAVE_NETPOLL
@@ -125,4 +125,4 @@ extern void *select_listener(pthread_addr_t pvarg);
extern void *net_listener(pthread_addr_t pvarg);
extern void *net_reader(pthread_addr_t pvarg);
#endif
-#endif /* __EXAMPLES_PIPE_PIPE_H */
+#endif /* __EXAMPLES_POLL_POLL_INTERNAL_H */
diff --git a/apps/netutils/thttpd/config.h b/apps/netutils/thttpd/config.h
index 32908cc16..e7bbb5ad9 100644
--- a/apps/netutils/thttpd/config.h
+++ b/apps/netutils/thttpd/config.h
@@ -53,7 +53,7 @@
#undef CONFIG_THTTPD
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && \
defined(CONFIG_NET_TCPBACKLOG) && !defined(CONFIG_DISABLE_ENVIRONMENT) && \
- !defined(CONFIG_SDCLONE_DISABLE) && CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+ !defined(CONFIG_SDCLONE_DISABLE) && defined(CONFIG_NET_TCP_READAHEAD)
# define CONFIG_THTTPD 1
diff --git a/nuttx/Documentation/NuttxUserGuide.html b/nuttx/Documentation/NuttxUserGuide.html
index 621c65c93..621c4c8c1 100644
--- a/nuttx/Documentation/NuttxUserGuide.html
+++ b/nuttx/Documentation/NuttxUserGuide.html
@@ -13,7 +13,7 @@
<h1><big><font color="#3c34ec"><i>NuttX Operating System<p>User's Manual</i></font></big></h1>
<p><small>by</small></p>
<p>Gregory Nutt<p>
- <p>Last Updated: September 28, 2013</p>
+ <p>Last Updated: January 13, 2014</p>
</td>
</tr>
</table>
@@ -7986,6 +7986,7 @@ interface of the same name.
<li><code>CONFIG_NET</code> Defined for general network support</li>
<li><code>CONFIG_NET_TCP</code> Defined for TCP/IP support</li>
<li><code>CONFIG_NSOCKET_DESCRIPTORS</code> Defined to be greater than 0</li>
+ <li><code>CONFIG_NET_TCP_READAHEAD</code> Define to enable read-ahead buffering</li>
<li><code>CONFIG_NET_NTCP_READAHEAD_BUFFERS</code> Defined to be greater than zero</li>
</ul>
<p>
diff --git a/nuttx/configs/c5471evm/httpd/defconfig b/nuttx/configs/c5471evm/httpd/defconfig
index 017671737..118a70098 100644
--- a/nuttx/configs/c5471evm/httpd/defconfig
+++ b/nuttx/configs/c5471evm/httpd/defconfig
@@ -187,6 +187,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=0
+CONFIG_NET_TCP_READAHEAD=n
CONFIG_NET_NTCP_READAHEAD_BUFFERS=0
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=0
diff --git a/nuttx/configs/c5471evm/nettest/defconfig b/nuttx/configs/c5471evm/nettest/defconfig
index 90f24143c..7eae0d32f 100644
--- a/nuttx/configs/c5471evm/nettest/defconfig
+++ b/nuttx/configs/c5471evm/nettest/defconfig
@@ -187,6 +187,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=32
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/c5471evm/nsh/defconfig b/nuttx/configs/c5471evm/nsh/defconfig
index d0fa02fdc..521b09123 100644
--- a/nuttx/configs/c5471evm/nsh/defconfig
+++ b/nuttx/configs/c5471evm/nsh/defconfig
@@ -187,6 +187,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=32
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/c5471evm/ostest/defconfig b/nuttx/configs/c5471evm/ostest/defconfig
index 17e6ba774..7fb94cc52 100644
--- a/nuttx/configs/c5471evm/ostest/defconfig
+++ b/nuttx/configs/c5471evm/ostest/defconfig
@@ -187,6 +187,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=40
diff --git a/nuttx/configs/cloudctrl/nsh/defconfig b/nuttx/configs/cloudctrl/nsh/defconfig
index 5fd1dc317..ee2d21ac0 100644
--- a/nuttx/configs/cloudctrl/nsh/defconfig
+++ b/nuttx/configs/cloudctrl/nsh/defconfig
@@ -405,6 +405,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/compal_e88/nsh_highram/defconfig b/nuttx/configs/compal_e88/nsh_highram/defconfig
index 1f15b3d8d..ad58f0db2 100644
--- a/nuttx/configs/compal_e88/nsh_highram/defconfig
+++ b/nuttx/configs/compal_e88/nsh_highram/defconfig
@@ -200,6 +200,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=32
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/compal_e99/nsh_compalram/defconfig b/nuttx/configs/compal_e99/nsh_compalram/defconfig
index 7057b92c1..7c76a1643 100644
--- a/nuttx/configs/compal_e99/nsh_compalram/defconfig
+++ b/nuttx/configs/compal_e99/nsh_compalram/defconfig
@@ -202,6 +202,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=32
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/compal_e99/nsh_highram/defconfig b/nuttx/configs/compal_e99/nsh_highram/defconfig
index d5264ef18..442ec6134 100644
--- a/nuttx/configs/compal_e99/nsh_highram/defconfig
+++ b/nuttx/configs/compal_e99/nsh_highram/defconfig
@@ -203,6 +203,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=32
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/eagle100/httpd/defconfig b/nuttx/configs/eagle100/httpd/defconfig
index 9003c9dab..c2790f3e5 100644
--- a/nuttx/configs/eagle100/httpd/defconfig
+++ b/nuttx/configs/eagle100/httpd/defconfig
@@ -240,6 +240,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/eagle100/nettest/defconfig b/nuttx/configs/eagle100/nettest/defconfig
index 37eeb25b5..e1e23e856 100644
--- a/nuttx/configs/eagle100/nettest/defconfig
+++ b/nuttx/configs/eagle100/nettest/defconfig
@@ -240,6 +240,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/eagle100/nsh/defconfig b/nuttx/configs/eagle100/nsh/defconfig
index 5e2e12c3e..e4f4f0dfa 100644
--- a/nuttx/configs/eagle100/nsh/defconfig
+++ b/nuttx/configs/eagle100/nsh/defconfig
@@ -242,6 +242,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/eagle100/thttpd/defconfig b/nuttx/configs/eagle100/thttpd/defconfig
index 5715c8019..e6b455e30 100644
--- a/nuttx/configs/eagle100/thttpd/defconfig
+++ b/nuttx/configs/eagle100/thttpd/defconfig
@@ -247,6 +247,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ekk-lm3s9b96/nsh/defconfig b/nuttx/configs/ekk-lm3s9b96/nsh/defconfig
index cec84480b..391c0f429 100644
--- a/nuttx/configs/ekk-lm3s9b96/nsh/defconfig
+++ b/nuttx/configs/ekk-lm3s9b96/nsh/defconfig
@@ -349,6 +349,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/ez80f910200zco/dhcpd/defconfig b/nuttx/configs/ez80f910200zco/dhcpd/defconfig
index 0c179058b..25a1e9a91 100644
--- a/nuttx/configs/ez80f910200zco/dhcpd/defconfig
+++ b/nuttx/configs/ez80f910200zco/dhcpd/defconfig
@@ -227,6 +227,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ez80f910200zco/httpd/defconfig b/nuttx/configs/ez80f910200zco/httpd/defconfig
index 00e4839ac..fb4f409c1 100644
--- a/nuttx/configs/ez80f910200zco/httpd/defconfig
+++ b/nuttx/configs/ez80f910200zco/httpd/defconfig
@@ -227,6 +227,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ez80f910200zco/nettest/defconfig b/nuttx/configs/ez80f910200zco/nettest/defconfig
index ba21db591..a9e969dc9 100644
--- a/nuttx/configs/ez80f910200zco/nettest/defconfig
+++ b/nuttx/configs/ez80f910200zco/nettest/defconfig
@@ -227,6 +227,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ez80f910200zco/nsh/defconfig b/nuttx/configs/ez80f910200zco/nsh/defconfig
index 627a95864..a01b92a58 100644
--- a/nuttx/configs/ez80f910200zco/nsh/defconfig
+++ b/nuttx/configs/ez80f910200zco/nsh/defconfig
@@ -227,6 +227,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ez80f910200zco/poll/defconfig b/nuttx/configs/ez80f910200zco/poll/defconfig
index 09ced0d5f..9f81cbdac 100644
--- a/nuttx/configs/ez80f910200zco/poll/defconfig
+++ b/nuttx/configs/ez80f910200zco/poll/defconfig
@@ -227,6 +227,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/fire-stm32v2/nsh/defconfig b/nuttx/configs/fire-stm32v2/nsh/defconfig
index 09d558024..e7fd821f8 100644
--- a/nuttx/configs/fire-stm32v2/nsh/defconfig
+++ b/nuttx/configs/fire-stm32v2/nsh/defconfig
@@ -450,6 +450,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
CONFIG_NET_MAX_LISTENPORTS=16
+CONFIG_NET_TCP_READAHEAD=y
# CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/lm3s6432-s2e/nsh/defconfig b/nuttx/configs/lm3s6432-s2e/nsh/defconfig
index d2ba2451b..4ec9f104e 100644
--- a/nuttx/configs/lm3s6432-s2e/nsh/defconfig
+++ b/nuttx/configs/lm3s6432-s2e/nsh/defconfig
@@ -257,6 +257,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/lm3s6965-ek/discover/defconfig b/nuttx/configs/lm3s6965-ek/discover/defconfig
index 6f761847c..ebfe60eb0 100644
--- a/nuttx/configs/lm3s6965-ek/discover/defconfig
+++ b/nuttx/configs/lm3s6965-ek/discover/defconfig
@@ -335,6 +335,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/lm3s6965-ek/nsh/defconfig b/nuttx/configs/lm3s6965-ek/nsh/defconfig
index 6f761847c..ebfe60eb0 100755
--- a/nuttx/configs/lm3s6965-ek/nsh/defconfig
+++ b/nuttx/configs/lm3s6965-ek/nsh/defconfig
@@ -335,6 +335,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/lm3s6965-ek/tcpecho/defconfig b/nuttx/configs/lm3s6965-ek/tcpecho/defconfig
index 97be63440..eaf39dc71 100644
--- a/nuttx/configs/lm3s6965-ek/tcpecho/defconfig
+++ b/nuttx/configs/lm3s6965-ek/tcpecho/defconfig
@@ -362,6 +362,7 @@ CONFIG_NET_BUFSIZE=650
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/lm3s8962-ek/nsh/defconfig b/nuttx/configs/lm3s8962-ek/nsh/defconfig
index 838572204..58fa0072b 100755
--- a/nuttx/configs/lm3s8962-ek/nsh/defconfig
+++ b/nuttx/configs/lm3s8962-ek/nsh/defconfig
@@ -256,6 +256,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig
index 400f5d0b9..409d24104 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig
@@ -303,6 +303,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig b/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig
index dcf7200c4..f3af6b382 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig
@@ -299,6 +299,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig b/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig
index 608421ca1..ac578378d 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig
@@ -303,6 +303,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/mbed/hidkbd/defconfig b/nuttx/configs/mbed/hidkbd/defconfig
index 33fbe6226..6cab95d60 100644
--- a/nuttx/configs/mbed/hidkbd/defconfig
+++ b/nuttx/configs/mbed/hidkbd/defconfig
@@ -296,6 +296,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ntosd-dm320/nettest/defconfig b/nuttx/configs/ntosd-dm320/nettest/defconfig
index cbb571ef0..75295a2bb 100644
--- a/nuttx/configs/ntosd-dm320/nettest/defconfig
+++ b/nuttx/configs/ntosd-dm320/nettest/defconfig
@@ -189,6 +189,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ntosd-dm320/nsh/defconfig b/nuttx/configs/ntosd-dm320/nsh/defconfig
index a80002288..26ba17e64 100644
--- a/nuttx/configs/ntosd-dm320/nsh/defconfig
+++ b/nuttx/configs/ntosd-dm320/nsh/defconfig
@@ -194,6 +194,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ntosd-dm320/poll/defconfig b/nuttx/configs/ntosd-dm320/poll/defconfig
index 12ca86f4d..2d4167844 100644
--- a/nuttx/configs/ntosd-dm320/poll/defconfig
+++ b/nuttx/configs/ntosd-dm320/poll/defconfig
@@ -189,6 +189,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ntosd-dm320/thttpd/defconfig b/nuttx/configs/ntosd-dm320/thttpd/defconfig
index 1dbf7a3be..97cb92bb3 100644
--- a/nuttx/configs/ntosd-dm320/thttpd/defconfig
+++ b/nuttx/configs/ntosd-dm320/thttpd/defconfig
@@ -212,6 +212,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/ntosd-dm320/udp/defconfig b/nuttx/configs/ntosd-dm320/udp/defconfig
index 977ddad1b..17037f085 100644
--- a/nuttx/configs/ntosd-dm320/udp/defconfig
+++ b/nuttx/configs/ntosd-dm320/udp/defconfig
@@ -189,6 +189,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=0
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=0
diff --git a/nuttx/configs/ntosd-dm320/uip/defconfig b/nuttx/configs/ntosd-dm320/uip/defconfig
index 8db4f5c0f..8a84de8c0 100644
--- a/nuttx/configs/ntosd-dm320/uip/defconfig
+++ b/nuttx/configs/ntosd-dm320/uip/defconfig
@@ -189,6 +189,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig b/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
index bc533526f..1f33ad888 100755
--- a/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
@@ -314,6 +314,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=576
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/olimex-lpc1766stk/nettest/defconfig b/nuttx/configs/olimex-lpc1766stk/nettest/defconfig
index eb1850ffe..afe7c72aa 100755
--- a/nuttx/configs/olimex-lpc1766stk/nettest/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/nettest/defconfig
@@ -392,6 +392,7 @@ CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/olimex-lpc1766stk/nsh/defconfig b/nuttx/configs/olimex-lpc1766stk/nsh/defconfig
index 2149fe451..5f0cc8287 100644
--- a/nuttx/configs/olimex-lpc1766stk/nsh/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/nsh/defconfig
@@ -402,6 +402,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig b/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig
index d407c3d23..9ed921db9 100755
--- a/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig
@@ -314,6 +314,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=296
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig b/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig
index 4c256a7ca..271092fe1 100755
--- a/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig
@@ -309,6 +309,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/olimex-lpc1766stk/zmodem/defconfig b/nuttx/configs/olimex-lpc1766stk/zmodem/defconfig
index 8cf9986ba..47aecb0ea 100644
--- a/nuttx/configs/olimex-lpc1766stk/zmodem/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/zmodem/defconfig
@@ -417,6 +417,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/olimex-stm32-p107/nsh/defconfig b/nuttx/configs/olimex-stm32-p107/nsh/defconfig
index 62b65b8c3..4fae497c4 100644
--- a/nuttx/configs/olimex-stm32-p107/nsh/defconfig
+++ b/nuttx/configs/olimex-stm32-p107/nsh/defconfig
@@ -513,6 +513,7 @@ CONFIG_NET_BUFSIZE=650
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/olimex-stm32-p207/nsh/defconfig b/nuttx/configs/olimex-stm32-p207/nsh/defconfig
index f3b420661..07b2b0f07 100644
--- a/nuttx/configs/olimex-stm32-p207/nsh/defconfig
+++ b/nuttx/configs/olimex-stm32-p207/nsh/defconfig
@@ -550,6 +550,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=20
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/olimex-strp711/nettest/defconfig b/nuttx/configs/olimex-strp711/nettest/defconfig
index ba4af1afa..b5332881e 100755
--- a/nuttx/configs/olimex-strp711/nettest/defconfig
+++ b/nuttx/configs/olimex-strp711/nettest/defconfig
@@ -267,6 +267,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/pic32-starterkit/nsh/defconfig b/nuttx/configs/pic32-starterkit/nsh/defconfig
index 277ba1b68..5f6ec9402 100644
--- a/nuttx/configs/pic32-starterkit/nsh/defconfig
+++ b/nuttx/configs/pic32-starterkit/nsh/defconfig
@@ -391,6 +391,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/pic32-starterkit/nsh2/defconfig b/nuttx/configs/pic32-starterkit/nsh2/defconfig
index 1045844a8..55076d366 100644
--- a/nuttx/configs/pic32-starterkit/nsh2/defconfig
+++ b/nuttx/configs/pic32-starterkit/nsh2/defconfig
@@ -390,6 +390,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/pic32-starterkit/ostest/defconfig b/nuttx/configs/pic32-starterkit/ostest/defconfig
index 6b0b6ba7e..10deaaa60 100644
--- a/nuttx/configs/pic32-starterkit/ostest/defconfig
+++ b/nuttx/configs/pic32-starterkit/ostest/defconfig
@@ -388,6 +388,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/pic32mx7mmb/nsh/defconfig b/nuttx/configs/pic32mx7mmb/nsh/defconfig
index 1689549a2..af9984326 100644
--- a/nuttx/configs/pic32mx7mmb/nsh/defconfig
+++ b/nuttx/configs/pic32mx7mmb/nsh/defconfig
@@ -406,6 +406,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/pic32mx7mmb/ostest/defconfig b/nuttx/configs/pic32mx7mmb/ostest/defconfig
index 22d26b106..595ba9bff 100644
--- a/nuttx/configs/pic32mx7mmb/ostest/defconfig
+++ b/nuttx/configs/pic32mx7mmb/ostest/defconfig
@@ -388,6 +388,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/shenzhou/nsh/defconfig b/nuttx/configs/shenzhou/nsh/defconfig
index 20e9a20d2..4b3875ad9 100644
--- a/nuttx/configs/shenzhou/nsh/defconfig
+++ b/nuttx/configs/shenzhou/nsh/defconfig
@@ -405,6 +405,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/shenzhou/nxwm/defconfig b/nuttx/configs/shenzhou/nxwm/defconfig
index ff9e0936f..989258945 100644
--- a/nuttx/configs/shenzhou/nxwm/defconfig
+++ b/nuttx/configs/shenzhou/nxwm/defconfig
@@ -623,6 +623,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
CONFIG_NET_MAX_LISTENPORTS=16
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=4
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/shenzhou/thttpd/defconfig b/nuttx/configs/shenzhou/thttpd/defconfig
index c3202c2c4..6bb52749f 100644
--- a/nuttx/configs/shenzhou/thttpd/defconfig
+++ b/nuttx/configs/shenzhou/thttpd/defconfig
@@ -392,6 +392,7 @@ CONFIG_NET_BUFSIZE=768
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/stm3220g-eval/dhcpd/defconfig b/nuttx/configs/stm3220g-eval/dhcpd/defconfig
index ab4aab41a..f83152ad6 100644
--- a/nuttx/configs/stm3220g-eval/dhcpd/defconfig
+++ b/nuttx/configs/stm3220g-eval/dhcpd/defconfig
@@ -401,6 +401,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
diff --git a/nuttx/configs/stm3220g-eval/nettest/defconfig b/nuttx/configs/stm3220g-eval/nettest/defconfig
index 4356cae6c..2c6084e0b 100644
--- a/nuttx/configs/stm3220g-eval/nettest/defconfig
+++ b/nuttx/configs/stm3220g-eval/nettest/defconfig
@@ -401,6 +401,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
diff --git a/nuttx/configs/stm3220g-eval/nsh/defconfig b/nuttx/configs/stm3220g-eval/nsh/defconfig
index 601cd45b2..2deb8c2f9 100644
--- a/nuttx/configs/stm3220g-eval/nsh/defconfig
+++ b/nuttx/configs/stm3220g-eval/nsh/defconfig
@@ -447,6 +447,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/stm3220g-eval/nsh2/defconfig b/nuttx/configs/stm3220g-eval/nsh2/defconfig
index 459f8c426..bc39cb097 100644
--- a/nuttx/configs/stm3220g-eval/nsh2/defconfig
+++ b/nuttx/configs/stm3220g-eval/nsh2/defconfig
@@ -447,6 +447,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/stm3220g-eval/nxwm/defconfig b/nuttx/configs/stm3220g-eval/nxwm/defconfig
index a999c3c31..a369d08b2 100644
--- a/nuttx/configs/stm3220g-eval/nxwm/defconfig
+++ b/nuttx/configs/stm3220g-eval/nxwm/defconfig
@@ -636,6 +636,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/stm3220g-eval/telnetd/defconfig b/nuttx/configs/stm3220g-eval/telnetd/defconfig
index a29c9698a..4c4642496 100644
--- a/nuttx/configs/stm3220g-eval/telnetd/defconfig
+++ b/nuttx/configs/stm3220g-eval/telnetd/defconfig
@@ -401,6 +401,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
diff --git a/nuttx/configs/stm3240g-eval/dhcpd/defconfig b/nuttx/configs/stm3240g-eval/dhcpd/defconfig
index 519582322..1b870ffc6 100644
--- a/nuttx/configs/stm3240g-eval/dhcpd/defconfig
+++ b/nuttx/configs/stm3240g-eval/dhcpd/defconfig
@@ -407,6 +407,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
diff --git a/nuttx/configs/stm3240g-eval/discover/defconfig b/nuttx/configs/stm3240g-eval/discover/defconfig
index 1bb2f87fa..1e50c47cb 100644
--- a/nuttx/configs/stm3240g-eval/discover/defconfig
+++ b/nuttx/configs/stm3240g-eval/discover/defconfig
@@ -412,6 +412,7 @@ CONFIG_NET_BUFSIZE=650
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
# CONFIG_NET_TCP_READAHEAD_BUFSIZE=650
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/stm3240g-eval/nettest/defconfig b/nuttx/configs/stm3240g-eval/nettest/defconfig
index 5b779f0d2..3a47abe19 100644
--- a/nuttx/configs/stm3240g-eval/nettest/defconfig
+++ b/nuttx/configs/stm3240g-eval/nettest/defconfig
@@ -407,6 +407,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
diff --git a/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig
index 297ef6e01..fb33ae347 100644
--- a/nuttx/configs/stm3240g-eval/nsh/defconfig
+++ b/nuttx/configs/stm3240g-eval/nsh/defconfig
@@ -452,6 +452,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/stm3240g-eval/nsh2/defconfig b/nuttx/configs/stm3240g-eval/nsh2/defconfig
index 11238d311..ef4c87248 100644
--- a/nuttx/configs/stm3240g-eval/nsh2/defconfig
+++ b/nuttx/configs/stm3240g-eval/nsh2/defconfig
@@ -453,6 +453,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/stm3240g-eval/nxconsole/defconfig b/nuttx/configs/stm3240g-eval/nxconsole/defconfig
index 2522d5e4a..3cef983c1 100644
--- a/nuttx/configs/stm3240g-eval/nxconsole/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxconsole/defconfig
@@ -451,6 +451,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/stm3240g-eval/nxwm/defconfig b/nuttx/configs/stm3240g-eval/nxwm/defconfig
index d903a5548..0954ef979 100644
--- a/nuttx/configs/stm3240g-eval/nxwm/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxwm/defconfig
@@ -631,6 +631,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/stm3240g-eval/telnetd/defconfig b/nuttx/configs/stm3240g-eval/telnetd/defconfig
index b34d3ea1c..951440e96 100644
--- a/nuttx/configs/stm3240g-eval/telnetd/defconfig
+++ b/nuttx/configs/stm3240g-eval/telnetd/defconfig
@@ -407,6 +407,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n
diff --git a/nuttx/configs/stm3240g-eval/webserver/defconfig b/nuttx/configs/stm3240g-eval/webserver/defconfig
index 56dedcb1d..5abfee748 100644
--- a/nuttx/configs/stm3240g-eval/webserver/defconfig
+++ b/nuttx/configs/stm3240g-eval/webserver/defconfig
@@ -452,6 +452,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig
index 8bcabe692..79fbec949 100644
--- a/nuttx/configs/stm3240g-eval/xmlrpc/defconfig
+++ b/nuttx/configs/stm3240g-eval/xmlrpc/defconfig
@@ -405,6 +405,7 @@ CONFIG_NET_BUFSIZE=650
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
# CONFIG_NET_TCP_READAHEAD_BUFSIZE=650
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/stm32f4discovery/pm/defconfig b/nuttx/configs/stm32f4discovery/pm/defconfig
index bcb20416c..9afcb86db 100644
--- a/nuttx/configs/stm32f4discovery/pm/defconfig
+++ b/nuttx/configs/stm32f4discovery/pm/defconfig
@@ -431,6 +431,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
+CONFIG_NET_TCP_READAHEAD=y
#CONFIG_NET_TCP_READAHEAD_BUFSIZE
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=y
diff --git a/nuttx/configs/teensy/nsh/defconfig b/nuttx/configs/teensy/nsh/defconfig
index 53f59c140..188223f2d 100755
--- a/nuttx/configs/teensy/nsh/defconfig
+++ b/nuttx/configs/teensy/nsh/defconfig
@@ -253,6 +253,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/teensy/usbmsc/defconfig b/nuttx/configs/teensy/usbmsc/defconfig
index b00d7448e..416316dd2 100755
--- a/nuttx/configs/teensy/usbmsc/defconfig
+++ b/nuttx/configs/teensy/usbmsc/defconfig
@@ -254,6 +254,7 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=n
CONFIG_NET_TCP_CONNS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8
diff --git a/nuttx/configs/viewtool-stm32f107/README.txt b/nuttx/configs/viewtool-stm32f107/README.txt
index 291c62778..b2b085cfe 100644
--- a/nuttx/configs/viewtool-stm32f107/README.txt
+++ b/nuttx/configs/viewtool-stm32f107/README.txt
@@ -373,6 +373,7 @@ ViewTool DP83848 Ethernet Module
CONFIG_NET_BUFSIZE=650 : Maximum packet size
CONFIG_NET_RECEIVE_WINDOW=650
+ CONFIG_NET_TCP_READAHEAD=y : Enable read-ahead buffering
CONFIG_NET_TCP_READAHEAD_BUFSIZE=650
CONFIG_NET_TCP=y : TCP support
diff --git a/nuttx/configs/viewtool-stm32f107/netnsh/defconfig b/nuttx/configs/viewtool-stm32f107/netnsh/defconfig
index d9b31ebf9..a6675ebb0 100644
--- a/nuttx/configs/viewtool-stm32f107/netnsh/defconfig
+++ b/nuttx/configs/viewtool-stm32f107/netnsh/defconfig
@@ -550,6 +550,7 @@ CONFIG_NET_BUFSIZE=650
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=40
CONFIG_NET_MAX_LISTENPORTS=40
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=650
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/zkit-arm-1769/hello/defconfig b/nuttx/configs/zkit-arm-1769/hello/defconfig
index 6d4cdf343..ef775d78d 100644
--- a/nuttx/configs/zkit-arm-1769/hello/defconfig
+++ b/nuttx/configs/zkit-arm-1769/hello/defconfig
@@ -395,6 +395,7 @@ CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/zkit-arm-1769/nsh/defconfig b/nuttx/configs/zkit-arm-1769/nsh/defconfig
index 63cd96321..687a39264 100644
--- a/nuttx/configs/zkit-arm-1769/nsh/defconfig
+++ b/nuttx/configs/zkit-arm-1769/nsh/defconfig
@@ -434,6 +434,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/zkit-arm-1769/nxhello/defconfig b/nuttx/configs/zkit-arm-1769/nxhello/defconfig
index 6eea9b76c..bd0a7e6d6 100644
--- a/nuttx/configs/zkit-arm-1769/nxhello/defconfig
+++ b/nuttx/configs/zkit-arm-1769/nxhello/defconfig
@@ -430,6 +430,7 @@ CONFIG_NET_BUFSIZE=562
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=16
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/configs/zkit-arm-1769/thttpd/defconfig b/nuttx/configs/zkit-arm-1769/thttpd/defconfig
index b079b6bc9..9c6ceb58b 100644
--- a/nuttx/configs/zkit-arm-1769/thttpd/defconfig
+++ b/nuttx/configs/zkit-arm-1769/thttpd/defconfig
@@ -395,6 +395,7 @@ CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=16
CONFIG_NET_MAX_LISTENPORTS=8
+CONFIG_NET_TCP_READAHEAD=y
CONFIG_NET_TCP_READAHEAD_BUFSIZE=562
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCP_RECVDELAY=0
diff --git a/nuttx/include/nuttx/net/uip/uip-tcp.h b/nuttx/include/nuttx/net/uip/uip-tcp.h
index f9e6b742f..a296ef3e1 100644
--- a/nuttx/include/nuttx/net/uip/uip-tcp.h
+++ b/nuttx/include/nuttx/net/uip/uip-tcp.h
@@ -6,7 +6,7 @@
* of C macros that are used by uIP programs as well as internal uIP
* structures, TCP/IP header structures and function declarations.
*
- * Copyright (C) 2007, 2009-2010, 2012-2013 Gregory Nutt. All rights
+ * Copyright (C) 2007, 2009-2010, 2012-2014 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
@@ -170,7 +170,7 @@ struct uip_conn
* where the TCP/IP read-ahead data is retained.
*/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
sq_queue_t readahead; /* Read-ahead buffering */
#endif
@@ -234,7 +234,7 @@ struct uip_conn
* buffers so that no data is lost.
*/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
struct uip_readahead_s
{
sq_entry_t rh_node; /* Supports a singly linked list */
@@ -401,10 +401,10 @@ extern int uip_unlisten(struct uip_conn *conn);
/* Access to TCP read-ahead buffers */
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
extern struct uip_readahead_s *uip_tcpreadaheadalloc(void);
extern void uip_tcpreadaheadrelease(struct uip_readahead_s *buf);
-#endif /* CONFIG_NET_NTCP_READAHEAD_BUFFERS */
+#endif /* CONFIG_NET_TCP_READAHEAD */
/* Backlog support */
diff --git a/nuttx/include/nuttx/net/uip/uipopt.h b/nuttx/include/nuttx/net/uip/uipopt.h
index 9797e0482..6234ed40c 100644
--- a/nuttx/include/nuttx/net/uip/uipopt.h
+++ b/nuttx/include/nuttx/net/uip/uipopt.h
@@ -287,20 +287,22 @@
# define CONFIG_NET_BUFSIZE 400
#endif
-/* Number of TCP read-ahead buffers (may be zero) */
+#ifdef CONFIG_NET_TCP_READAHEAD
+ /* Number of TCP read-ahead buffers */
-#ifndef CONFIG_NET_NTCP_READAHEAD_BUFFERS
-# define CONFIG_NET_NTCP_READAHEAD_BUFFERS 4
-#endif
+# ifndef CONFIG_NET_NTCP_READAHEAD_BUFFERS
+# define CONFIG_NET_NTCP_READAHEAD_BUFFERS 4
+# endif
-/* The size of the TCP read buffer size */
+ /* The size of the TCP read buffer size */
-#ifndef CONFIG_NET_TCP_READAHEAD_BUFSIZE
-# if CONFIG_NET_NTCP_READAHEAD_BUFFERS < 1
-# define CONFIG_NET_TCP_READAHEAD_BUFSIZE 0
-# else
+# ifndef CONFIG_NET_TCP_READAHEAD_BUFSIZE
# define CONFIG_NET_TCP_READAHEAD_BUFSIZE UIP_TCP_MSS
# endif
+
+#else
+# undef CONFIG_NET_TCP_READAHEAD_BUFSIZE
+# undef CONFIG_NET_NTCP_READAHEAD_BUFFERS
#endif
/* Delay after receive to catch a following packet. No delay should be
@@ -308,7 +310,7 @@
*/
#ifndef CONFIG_NET_TCP_RECVDELAY
-# if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+# ifdef CONFIG_NET_TCP_READAHEAD
# define CONFIG_NET_TCP_RECVDELAY 0
# else
# define CONFIG_NET_TCP_RECVDELAY 5
diff --git a/nuttx/net/Kconfig b/nuttx/net/Kconfig
index 6bd92b118..d57243b9d 100644
--- a/nuttx/net/Kconfig
+++ b/nuttx/net/Kconfig
@@ -115,6 +115,12 @@ config NET_MAX_LISTENPORTS
---help---
Maximum number of listening TCP/IP ports (all tasks). Default: 20
+config NET_TCP_READAHEAD
+ bool "Enabled TCP/IP read-ahead buffering"
+ default y
+
+if NET_TCP_READAHEAD
+
config NET_TCP_READAHEAD_BUFSIZE
int "TCP/IP read-ahead buffer size"
default 562
@@ -140,6 +146,8 @@ config NET_NTCP_READAHEAD_BUFFERS
memory constained system that does not have any TCP/IP packet rate
issues.
+endif # NET_TCP_READAHEAD
+
config NET_TCP_RECVDELAY
int "TCP Rx delay"
default 0
diff --git a/nuttx/net/net_poll.c b/nuttx/net/net_poll.c
index bd27b86d7..49c0a2b74 100644
--- a/nuttx/net/net_poll.c
+++ b/nuttx/net/net_poll.c
@@ -1,7 +1,7 @@
/****************************************************************************
* net/net_poll.c
*
- * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -68,7 +68,7 @@
*/
#if !defined(CONFIG_DISABLE_POLL) && CONFIG_NSOCKET_DESCRIPTORS > 0 && \
- defined(CONFIG_NET_TCP) && CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+ defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCP_READAHEAD)
# define HAVE_NETPOLL 1
#else
# undef HAVE_NETPOLL
diff --git a/nuttx/net/net_vfcntl.c b/nuttx/net/net_vfcntl.c
index a4c924225..5fa6177f1 100644
--- a/nuttx/net/net_vfcntl.c
+++ b/nuttx/net/net_vfcntl.c
@@ -1,7 +1,7 @@
/****************************************************************************
* net/net_vfcntl.c
*
- * Copyright (C) 2009, 2012-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2012-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -127,9 +127,9 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
ret = O_RDWR | O_SYNC | O_RSYNC;
+#ifdef CONFIG_NET_TCP_READAHEAD
/* TCP/IP sockets may also be non-blocking if read-ahead is enabled */
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
if (psock->s_type == SOCK_STREAM && _SS_ISNONBLOCK(psock->s_flags))
{
ret |= O_NONBLOCK;
@@ -148,11 +148,11 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
*/
{
+#ifdef CONFIG_NET_TCP_READAHEAD
/* Non-blocking is the only configurable option. And it applies only to
* read operations on TCP/IP sockets when read-ahead is enabled.
*/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
int mode = va_arg(ap, int);
if (psock->s_type == SOCK_STREAM)
{
diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c
index d274e9594..0ce705167 100644
--- a/nuttx/net/recvfrom.c
+++ b/nuttx/net/recvfrom.c
@@ -1,7 +1,7 @@
/****************************************************************************
* net/recvfrom.c
*
- * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -173,7 +173,7 @@ static inline void recvfrom_newtcpdata(FAR struct uip_driver_s *dev,
if (recvlen < dev->d_len)
{
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
FAR struct uip_conn *conn = (FAR struct uip_conn *)pstate->rf_sock->s_conn;
FAR uint8_t *buffer = (FAR uint8_t *)dev->d_appdata + recvlen;
uint16_t buflen = dev->d_len - recvlen;
@@ -263,7 +263,7 @@ static inline void recvfrom_newudpdata(FAR struct uip_driver_s *dev,
*
****************************************************************************/
-#if defined(CONFIG_NET_TCP) && CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#if defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCP_READAHEAD)
static inline void recvfrom_readahead(struct recvfrom_s *pstate)
{
FAR struct uip_conn *conn = (FAR struct uip_conn *)pstate->rf_sock->s_conn;
@@ -1028,7 +1028,7 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
* socket has been disconnected.
*/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
recvfrom_readahead(&state);
/* The default return value is the number of bytes that we just copied into
@@ -1062,7 +1062,7 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
* end-of-file indication.
*/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
if (ret <= 0 && !_SS_ISCLOSED(psock->s_flags))
#else
if (!_SS_ISCLOSED(psock->s_flags))
@@ -1084,7 +1084,7 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
*/
else
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
if (_SS_ISNONBLOCK(psock->s_flags))
{
/* Return the number of bytes read from the read-ahead buffer if
@@ -1114,14 +1114,14 @@ static ssize_t tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
* (state.rf_buflen > 0). This could be zero, for example, if read-ahead
* buffering was enabled and we filled the user buffer with data from
* the read-ahead buffers. Aand
- * 2) if read-ahead buffering is enabled (CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0)
+ * 2) if read-ahead buffering is enabled (CONFIG_NET_TCP_READAHEAD)
* and delay logic is disabled (CONFIG_NET_TCP_RECVDELAY == 0), then we
* not want to wait if we already obtained some data from the read-ahead
* buffer. In that case, return now with what we have (don't want for more
* because there may be no timeout).
*/
-#if CONFIG_NET_TCP_RECVDELAY == 0 && CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#if CONFIG_NET_TCP_RECVDELAY == 0 && defined(CONFIG_NET_TCP_READAHEAD)
if (state.rf_recvlen == 0 && state.rf_buflen > 0)
#else
if (state.rf_buflen > 0)
diff --git a/nuttx/net/uip/uip_initialize.c b/nuttx/net/uip/uip_initialize.c
index e737d646e..064f240d1 100644
--- a/nuttx/net/uip/uip_initialize.c
+++ b/nuttx/net/uip/uip_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* net/uip/uip_initialize.c
*
- * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Adapted for NuttX from logic in uIP which also has a BSD-like license:
@@ -134,7 +134,7 @@ void uip_initialize(void)
/* Initialize the TCP/IP read-ahead buffering */
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
uip_tcpreadaheadinit();
#endif
#endif /* CONFIG_NET_TCP */
diff --git a/nuttx/net/uip/uip_internal.h b/nuttx/net/uip/uip_internal.h
index 32a3c6f7f..8b4cc8801 100644
--- a/nuttx/net/uip/uip_internal.h
+++ b/nuttx/net/uip/uip_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* net/uip/uip_internal.h
*
- * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* This logic was leveraged from uIP which also has a BSD-style license:
@@ -156,18 +156,18 @@ void uip_tcpinput(struct uip_driver_s *dev);
uint16_t uip_tcpcallback(FAR struct uip_driver_s *dev,
FAR struct uip_conn *conn, uint16_t flags);
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
uint16_t uip_datahandler(FAR struct uip_conn *conn,
FAR uint8_t *buffer, uint16_t nbytes);
#endif
/* Defined in uip_tcpreadahead.c ********************************************/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
void uip_tcpreadaheadinit(void);
struct uip_readahead_s *uip_tcpreadaheadalloc(void);
void uip_tcpreadaheadrelease(struct uip_readahead_s *buf);
-#endif /* CONFIG_NET_NTCP_READAHEAD_BUFFERS */
+#endif /* CONFIG_NET_TCP_READAHEAD */
#endif /* CONFIG_NET_TCP */
diff --git a/nuttx/net/uip/uip_tcpcallback.c b/nuttx/net/uip/uip_tcpcallback.c
index d6615a300..be586cddd 100644
--- a/nuttx/net/uip/uip_tcpcallback.c
+++ b/nuttx/net/uip/uip_tcpcallback.c
@@ -70,7 +70,7 @@
*
****************************************************************************/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
static int uip_readahead(struct uip_readahead_s *readahead, uint8_t *buf,
int len)
{
@@ -131,7 +131,7 @@ uip_dataevent(FAR struct uip_driver_s *dev, FAR struct uip_conn *conn,
if (dev->d_len > 0)
{
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
uint8_t *buffer = dev->d_appdata;
int buflen = dev->d_len;
uint16_t recvlen;
@@ -139,7 +139,7 @@ uip_dataevent(FAR struct uip_driver_s *dev, FAR struct uip_conn *conn,
nllvdbg("No listener on connection\n");
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
/* Save as much data as possible in the read-ahead buffers */
recvlen = uip_datahandler(conn, buffer, buflen);
@@ -276,7 +276,7 @@ uint16_t uip_tcpcallback(struct uip_driver_s *dev, struct uip_conn *conn,
*
****************************************************************************/
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
uint16_t uip_datahandler(FAR struct uip_conn *conn, FAR uint8_t *buffer,
uint16_t buflen)
{
@@ -332,6 +332,6 @@ uint16_t uip_datahandler(FAR struct uip_conn *conn, FAR uint8_t *buffer,
nllvdbg("Buffered %d bytes (of %d)\n", recvlen, buflen);
return recvlen;
}
-#endif /* CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0 */
+#endif /* CONFIG_NET_TCP_READAHEAD */
#endif /* CONFIG_NET && CONFIG_NET_TCP */
diff --git a/nuttx/net/uip/uip_tcpconn.c b/nuttx/net/uip/uip_tcpconn.c
index 6e1eb6d9d..071936db1 100644
--- a/nuttx/net/uip/uip_tcpconn.c
+++ b/nuttx/net/uip/uip_tcpconn.c
@@ -1,7 +1,7 @@
/****************************************************************************
* net/uip/uip_tcpconn.c
*
- * Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2011, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Large parts of this file were leveraged from uIP logic:
@@ -305,8 +305,7 @@ void uip_tcpfree(struct uip_conn *conn)
{
FAR struct uip_callback_s *cb;
FAR struct uip_callback_s *next;
-
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
struct uip_readahead_s *readahead;
#endif
uip_lock_t flags;
@@ -342,7 +341,7 @@ void uip_tcpfree(struct uip_conn *conn)
/* Release any read-ahead buffers attached to the connection */
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
while ((readahead = (struct uip_readahead_s *)sq_remfirst(&conn->readahead)) != NULL)
{
uip_tcpreadaheadrelease(readahead);
@@ -511,7 +510,7 @@ struct uip_conn *uip_tcpaccept(struct uip_tcpip_hdr *buf)
/* Initialize the list of TCP read-ahead buffers */
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
sq_init(&conn->readahead);
#endif
@@ -654,7 +653,7 @@ int uip_tcpconnect(struct uip_conn *conn, const struct sockaddr_in *addr)
/* Initialize the list of TCP read-ahead buffers */
-#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
+#ifdef CONFIG_NET_TCP_READAHEAD
sq_init(&conn->readahead);
#endif
diff --git a/nuttx/net/uip/uip_tcpreadahead.c b/nuttx/net/uip/uip_tcpreadahead.c
index dadb809cc..1927af6ba 100644
--- a/nuttx/net/uip/uip_tcpreadahead.c
+++ b/nuttx/net/uip/uip_tcpreadahead.c
@@ -1,7 +1,7 @@
/****************************************************************************
* net/uip/uip_tcpreadahead.c
*
- * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/net/uip/uipopt.h>
-#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && (CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0)
+#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCP_READAHEAD)
#include <queue.h>
#include <debug.h>
@@ -127,4 +127,4 @@ void uip_tcpreadaheadrelease(struct uip_readahead_s *buf)
sq_addfirst(&buf->rh_node, &g_freebuffers);
}
-#endif /* CONFIG_NET && CONFIG_NET_TCP && CONFIG_NET_NTCP_READAHEAD_BUFFERS*/
+#endif /* CONFIG_NET && CONFIG_NET_TCP && CONFIG_NET_TCP_READAHEAD */