diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 5e5b932bbd4..c51d9cbd14f 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -4600,7 +4600,7 @@
CONFIG_IOB_NBUFFERS
CONFIG_NET_TCP_WRITE_BUFFERS
nor CONFIG_NET_TCP_READAHEAD
), 24 if only write buffering is enabled, and 36 if both read-ahead and write buffering are enabled.
+ The default value is setup for network support. The default is 8 buffers if neither TCP/UDP or write buffering is enabled (neither CONFIG_NET_TCP_WRITE_BUFFERS
nor CONFIG_NET_TCP
), 24 if only TCP/UDP is enabled, and 36 if both TCP/UDP and write buffering are enabled.
CONFIG_IOB_BUFSIZE
CONFIG_NET_TCP_READAHEAD
&& !CONFIG_NET_UDP_READAHEAD
or eight if either is enabled.
+ The default value is zero if nether TCP nor UDP is enabled (i.e., neither CONFIG_NET_TCP
&& !CONFIG_NET_UDP
or eight if either is enabled.
CONFIG_IOB_THROTTLE
CONFIG_NET
Defined for general network supportCONFIG_NET_TCP
Defined for TCP/IP supportCONFIG_NET_TCP_READAHEAD
Define to enable read-ahead bufferingCONFIG_NET_NTCP_READAHEAD_BUFFERS
Defined to be greater than zero
In order to for select to work with incoming connections, you must also select:
diff --git a/boards/arm/kinetis/freedom-k64f/README.txt b/boards/arm/kinetis/freedom-k64f/README.txt
index 49b208191a8..5ef51abe08d 100644
--- a/boards/arm/kinetis/freedom-k64f/README.txt
+++ b/boards/arm/kinetis/freedom-k64f/README.txt
@@ -200,11 +200,9 @@ Networking Support
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
CONFIG_NET_ARP_SEND=y : Send ARP request before sending data
CONFIG_NET_TCP=y : Enable TCP/IP networking
- CONFIG_NET_TCP_READAHEAD=y : Support TCP read-ahead
CONFIG_NET_TCP_WRITE_BUFFERS=y : Support TCP write-buffering
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
CONFIG_NET_MAX_LISTENPORTS=20 :
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=536 Read-ahead buffer size
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Needed for DNS name resolution
CONFIG_NET_ICMP=y : Enable ICMP networking
diff --git a/boards/arm/kinetis/freedom-k66f/README.txt b/boards/arm/kinetis/freedom-k66f/README.txt
index 7c5cc5bb753..1d2db56f785 100644
--- a/boards/arm/kinetis/freedom-k66f/README.txt
+++ b/boards/arm/kinetis/freedom-k66f/README.txt
@@ -203,11 +203,9 @@ Networking Support
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
CONFIG_NET_ARP_SEND=y : Send ARP request before sending data
CONFIG_NET_TCP=y : Enable TCP/IP networking
- CONFIG_NET_TCP_READAHEAD=y : Support TCP read-ahead
CONFIG_NET_TCP_WRITE_BUFFERS=y : Support TCP write-buffering
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
CONFIG_NET_MAX_LISTENPORTS=20 :
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=536 Read-ahead buffer size
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Needed for DNS name resolution
CONFIG_NET_ICMP=y : Enable ICMP networking
diff --git a/boards/arm/kinetis/twr-k64f120m/README.txt b/boards/arm/kinetis/twr-k64f120m/README.txt
index 5898395e116..a0221b9ec1b 100644
--- a/boards/arm/kinetis/twr-k64f120m/README.txt
+++ b/boards/arm/kinetis/twr-k64f120m/README.txt
@@ -178,11 +178,9 @@ Networking Support
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
CONFIG_NET_ARP_SEND=y : Send ARP request before sending data
CONFIG_NET_TCP=y : Enable TCP/IP networking
- CONFIG_NET_TCP_READAHEAD=y : Support TCP read-ahead
CONFIG_NET_TCP_WRITE_BUFFERS=y : Support TCP write-buffering
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
CONFIG_NET_MAX_LISTENPORTS=20 :
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=536 Read-ahead buffer size
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Needed for DNS name resolution
CONFIG_NET_ICMP=y : Enable ICMP networking
diff --git a/boards/arm/sam34/sam4e-ek/README.txt b/boards/arm/sam34/sam4e-ek/README.txt
index c78b42fef23..404237b0a07 100644
--- a/boards/arm/sam34/sam4e-ek/README.txt
+++ b/boards/arm/sam34/sam4e-ek/README.txt
@@ -226,7 +226,6 @@ Networking Support
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
CONFIG_NET_TCP=y : Enable TCP/IP networking
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=536 Read-ahead buffer size
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Needed for DNS name resolution
CONFIG_NET_ICMP=y : Enable ICMP networking
diff --git a/boards/arm/sama5/sama5d3-xplained/README.txt b/boards/arm/sama5/sama5d3-xplained/README.txt
index 1273b4aec84..a2611b202a7 100644
--- a/boards/arm/sama5/sama5d3-xplained/README.txt
+++ b/boards/arm/sama5/sama5d3-xplained/README.txt
@@ -843,7 +843,6 @@ Networking
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
CONFIG_NET_TCP=y : Enable TCP/IP networking
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=562 : Read-ahead buffer size
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_ICMP=y : Enable ICMP networking
CONFIG_NET_ICMP_SOCKET=y : Needed for NSH ping command
diff --git a/boards/arm/sama5/sama5d3-xplained/configs/bridge/defconfig b/boards/arm/sama5/sama5d3-xplained/configs/bridge/defconfig
index f0116cd3b78..f0dfc939fab 100644
--- a/boards/arm/sama5/sama5d3-xplained/configs/bridge/defconfig
+++ b/boards/arm/sama5/sama5d3-xplained/configs/bridge/defconfig
@@ -5,7 +5,6 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
-# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_SAMA5_ISRAM_HEAP is not set
# CONFIG_SAMA5_UART0 is not set
CONFIG_ARCH="arm"
diff --git a/boards/arm/sama5/sama5d3x-ek/README.txt b/boards/arm/sama5/sama5d3x-ek/README.txt
index 4ebddbebfde..b67e2fa1890 100644
--- a/boards/arm/sama5/sama5d3x-ek/README.txt
+++ b/boards/arm/sama5/sama5d3x-ek/README.txt
@@ -983,7 +983,6 @@ Networking
CONFIG_NET_ETH_PKTSIZE=562 : Maximum packet size 1518 is more standard
CONFIG_NET_TCP=y : Enable TCP/IP networking
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=562 : Read-ahead buffer size
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_ICMP=y : Enable ICMP networking
CONFIG_NET_ICMP_SOCKET=y : Needed for NSH ping command
diff --git a/boards/arm/sama5/sama5d4-ek/README.txt b/boards/arm/sama5/sama5d4-ek/README.txt
index 2ac52073af0..00569981cea 100644
--- a/boards/arm/sama5/sama5d4-ek/README.txt
+++ b/boards/arm/sama5/sama5d4-ek/README.txt
@@ -1344,7 +1344,6 @@ Networking
CONFIG_NET_ARP_IPIN=y : IP address harvesting (optional)
CONFIG_NET_TCP=y : Enable TCP/IP networking
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
- CONFIG_NET_TCP_READAHEAD=y : Enable TCP read-ahead buffering
CONFIG_NET_TCP_WRITE_BUFFERS=y : Enable TCP write buffering
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Support UDP broadcast packets
diff --git a/boards/arm/sama5/sama5d4-ek/configs/bridge/defconfig b/boards/arm/sama5/sama5d4-ek/configs/bridge/defconfig
index c31d0c713e4..0fddd31111a 100644
--- a/boards/arm/sama5/sama5d4-ek/configs/bridge/defconfig
+++ b/boards/arm/sama5/sama5d4-ek/configs/bridge/defconfig
@@ -5,7 +5,6 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
-# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_SAMA5_ISRAM_HEAP is not set
# CONFIG_SAMA5_UART0 is not set
CONFIG_ARCH="arm"
diff --git a/boards/arm/samv7/same70-xplained/README.txt b/boards/arm/samv7/same70-xplained/README.txt
index 2a952b4b43f..55302915564 100644
--- a/boards/arm/samv7/same70-xplained/README.txt
+++ b/boards/arm/samv7/same70-xplained/README.txt
@@ -395,7 +395,6 @@ Selecting the GMAC peripheral
CONFIG_NET_ARP_SEND=y : Use ARP to get peer address before sending
CONFIG_NET_TCP=y : Enable TCP/IP networking
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
- CONFIG_NET_TCP_READAHEAD=y : Enable TCP read-ahead buffering
CONFIG_NET_TCP_WRITE_BUFFERS=y : Enable TCP write buffering
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Support UDP broadcast packets
diff --git a/boards/arm/samv7/samv71-xult/README.txt b/boards/arm/samv7/samv71-xult/README.txt
index 68125b60bcf..8b09a6df06c 100644
--- a/boards/arm/samv7/samv71-xult/README.txt
+++ b/boards/arm/samv7/samv71-xult/README.txt
@@ -711,7 +711,6 @@ Selecting the GMAC peripheral
CONFIG_NET_ARP_SEND=y : Use ARP to get peer address before sending
CONFIG_NET_TCP=y : Enable TCP/IP networking
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
- CONFIG_NET_TCP_READAHEAD=y : Enable TCP read-ahead buffering
CONFIG_NET_TCP_WRITE_BUFFERS=y : Enable TCP write buffering
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Support UDP broadcast packets
diff --git a/boards/arm/stm32/cloudctrl/configs/nsh/defconfig b/boards/arm/stm32/cloudctrl/configs/nsh/defconfig
index 822fbdced8d..48fabb27541 100644
--- a/boards/arm/stm32/cloudctrl/configs/nsh/defconfig
+++ b/boards/arm/stm32/cloudctrl/configs/nsh/defconfig
@@ -5,7 +5,6 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
-# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_PS is not set
# CONFIG_SPI_CALLBACK is not set
diff --git a/boards/arm/stm32/olimex-stm32-p207/configs/nsh/defconfig b/boards/arm/stm32/olimex-stm32-p207/configs/nsh/defconfig
index 52c54cc3b63..0199fe6c45e 100644
--- a/boards/arm/stm32/olimex-stm32-p207/configs/nsh/defconfig
+++ b/boards/arm/stm32/olimex-stm32-p207/configs/nsh/defconfig
@@ -5,7 +5,6 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
-# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ADC=y
diff --git a/boards/arm/stm32/viewtool-stm32f107/README.txt b/boards/arm/stm32/viewtool-stm32f107/README.txt
index 2f38ea7e353..e1f5bdaec63 100644
--- a/boards/arm/stm32/viewtool-stm32f107/README.txt
+++ b/boards/arm/stm32/viewtool-stm32f107/README.txt
@@ -374,8 +374,6 @@ ViewTool DP83848 Ethernet Module
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_ETH_PKTSIZE=650 : Maximum packet size
- CONFIG_NET_TCP_READAHEAD=y : Enable read-ahead buffering
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=650
CONFIG_NET_TCP=y : TCP support
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
diff --git a/boards/arm/tiva/dk-tm4c129x/README.txt b/boards/arm/tiva/dk-tm4c129x/README.txt
index f1784565026..a167b414f3c 100644
--- a/boards/arm/tiva/dk-tm4c129x/README.txt
+++ b/boards/arm/tiva/dk-tm4c129x/README.txt
@@ -232,11 +232,9 @@ Networking Support
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting
CONFIG_NET_ARP_SEND=y : Send ARP request before sending data
CONFIG_NET_TCP=y : Enable TCP/IP networking
- CONFIG_NET_TCP_READAHEAD=y : Support TCP read-ahead
CONFIG_NET_TCP_WRITE_BUFFERS=y : Support TCP write-buffering
CONFIG_NET_TCPBACKLOG=y : Support TCP/IP backlog
CONFIG_NET_MAX_LISTENPORTS=20 :
- CONFIG_NET_TCP_READAHEAD_BUFSIZE=536 Read-ahead buffer size
CONFIG_NET_UDP=y : Enable UDP networking
CONFIG_NET_BROADCAST=y : Needed for DNS name resolution
CONFIG_NET_ICMP=y : Enable ICMP networking
diff --git a/boards/arm/tiva/dk-tm4c129x/configs/ipv6/defconfig b/boards/arm/tiva/dk-tm4c129x/configs/ipv6/defconfig
index 1a2c6d087c3..50e031e7e4b 100644
--- a/boards/arm/tiva/dk-tm4c129x/configs/ipv6/defconfig
+++ b/boards/arm/tiva/dk-tm4c129x/configs/ipv6/defconfig
@@ -7,7 +7,6 @@
#
# CONFIG_ARCH_FPU is not set
# CONFIG_NET_IPv4 is not set
-# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
diff --git a/boards/arm/tiva/lm3s6432-s2e/configs/nsh/defconfig b/boards/arm/tiva/lm3s6432-s2e/configs/nsh/defconfig
index e1d18e276b2..f7fd6e4a18e 100644
--- a/boards/arm/tiva/lm3s6432-s2e/configs/nsh/defconfig
+++ b/boards/arm/tiva/lm3s6432-s2e/configs/nsh/defconfig
@@ -5,7 +5,6 @@
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
# modifications.
#
-# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_NSH_DISABLE_IFCONFIG is not set
# CONFIG_NSH_DISABLE_PS is not set
CONFIG_ARCH="arm"
diff --git a/fs/procfs/fs_procfsiobinfo.c b/fs/procfs/fs_procfsiobinfo.c
index 1ddfb8e66d9..44e7486a080 100644
--- a/fs/procfs/fs_procfsiobinfo.c
+++ b/fs/procfs/fs_procfsiobinfo.c
@@ -136,13 +136,13 @@ static FAR const char *g_iob_user_names[] =
#ifdef CONFIG_NET_BLUETOOTH
"bluetooth_sock",
#endif
-#ifdef CONFIG_NET_UDP_READAHEAD
+#if defined(CONFIG_NET_UDP) && !defined(NET_UDP_NO_STACK)
"udp_readahead",
#endif
#ifdef CONFIG_NET_UDP_WRITE_BUFFERS
"udp_writebuffer",
#endif
-#ifdef CONFIG_NET_TCP_READAHEAD
+#if defined(CONFIG_NET_TCP) && !defined(NET_TCP_NO_STACK)
"tcp_readahead",
#endif
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
diff --git a/graphics/vnc/server/Kconfig b/graphics/vnc/server/Kconfig
index cf7fca29b32..c0158a36238 100644
--- a/graphics/vnc/server/Kconfig
+++ b/graphics/vnc/server/Kconfig
@@ -7,7 +7,6 @@ menuconfig VNCSERVER
bool "VNC server"
default n
depends on NET_TCP && !NX_LCDDRIVER
- select NET_TCP_READAHEAD
select NX_UPDATE
---help---
Enable support for a VNC Remote Frame Buffer (RFB) server.
diff --git a/graphics/vnc/server/vnc_server.h b/graphics/vnc/server/vnc_server.h
index 04f41c28e88..6bfc686d691 100644
--- a/graphics/vnc/server/vnc_server.h
+++ b/graphics/vnc/server/vnc_server.h
@@ -60,10 +60,6 @@
/* Configuration */
-#ifndef CONFIG_NET_TCP_READAHEAD
-# error CONFIG_NET_TCP_READAHEAD must be set to use VNC
-#endif
-
#ifndef CONFIG_NX_UPDATE
# error CONFIG_NX_UPDATE must be set to use VNC
#endif
diff --git a/include/nuttx/mm/iob.h b/include/nuttx/mm/iob.h
index ab2ee37a668..43cceea918d 100644
--- a/include/nuttx/mm/iob.h
+++ b/include/nuttx/mm/iob.h
@@ -187,13 +187,13 @@ enum iob_user_e
#ifdef CONFIG_NET_BLUETOOTH
IOBUSER_NET_SOCK_BLUETOOTH,
#endif
-#ifdef CONFIG_NET_UDP_READAHEAD
+#if defined(CONFIG_NET_UDP) && !defined(NET_UDP_NO_STACK)
IOBUSER_NET_UDP_READAHEAD,
#endif
#ifdef CONFIG_NET_UDP_WRITE_BUFFERS
IOBUSER_NET_UDP_WRITEBUFFER,
#endif
-#ifdef CONFIG_NET_TCP_READAHEAD
+#if defined(CONFIG_NET_TCP) && !defined(NET_TCP_NO_STACK)
IOBUSER_NET_TCP_READAHEAD,
#endif
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
diff --git a/include/nuttx/net/netconfig.h b/include/nuttx/net/netconfig.h
index 69c713cba9b..780290f8a95 100644
--- a/include/nuttx/net/netconfig.h
+++ b/include/nuttx/net/netconfig.h
@@ -587,20 +587,6 @@
# endif
#endif
-/* General configuration options */
-
-/* Delay after receive to catch a following packet. No delay should be
- * required if TCP/IP read-ahead buffering is enabled.
- */
-
-#ifndef CONFIG_NET_TCP_RECVDELAY
-# ifdef CONFIG_NET_TCP_READAHEAD
-# define CONFIG_NET_TCP_RECVDELAY 0
-# else
-# define CONFIG_NET_TCP_RECVDELAY 5
-# endif
-#endif
-
/****************************************************************************
* Public Type Definitions
****************************************************************************/
diff --git a/mm/iob/Kconfig b/mm/iob/Kconfig
index b7f72cd4410..95a43767c5b 100644
--- a/mm/iob/Kconfig
+++ b/mm/iob/Kconfig
@@ -16,8 +16,8 @@ if MM_IOB
config IOB_NBUFFERS
int "Number of pre-allocated I/O buffers"
- default 24 if (NET_WRITE_BUFFERS && !NET_READAHEAD) || (!NET_WRITE_BUFFERS && NET_READAHEAD)
- default 36 if NET_WRITE_BUFFERS && NET_READAHEAD
+ default 36 if NET_WRITE_BUFFERS
+ default 24 if !NET_WRITE_BUFFERS && NET_READAHEAD
default 8 if !NET_WRITE_BUFFERS && !NET_READAHEAD
---help---
Each packet is represented by a series of small I/O buffers in a
@@ -34,8 +34,8 @@ config IOB_BUFSIZE
config IOB_NCHAINS
int "Number of pre-allocated I/O buffer chain heads"
- default 0 if !NET_READAHEAD && !NET_UDP_READAHEAD
- default IOB_NBUFFERS if NET_READAHEAD || NET_UDP_READAHEAD
+ default 0 if !NET_READAHEAD
+ default IOB_NBUFFERS if NET_READAHEAD
---help---
These tiny nodes are used as "containers" to support queueing of
I/O buffer chains. This will limit the number of I/O transactions
diff --git a/net/Kconfig b/net/Kconfig
index d10088697f9..4c8d0dcec6d 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -14,10 +14,12 @@ config ARCH_HAVE_PHY
config NET_WRITE_BUFFERS
bool
default n
+ select MM_IOB
config NET_READAHEAD
bool
default n
+ select MM_IOB
config NET_MCASTGROUP
bool
diff --git a/net/inet/inet_recvfrom.c b/net/inet/inet_recvfrom.c
index e4edc5cd0d1..458fab24b2c 100644
--- a/net/inet/inet_recvfrom.c
+++ b/net/inet/inet_recvfrom.c
@@ -223,7 +223,6 @@ static inline void inet_tcp_newdata(FAR struct net_driver_s *dev,
if (recvlen < dev->d_len)
{
-#ifdef CONFIG_NET_TCP_READAHEAD
FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)pstate->ir_sock->s_conn;
FAR uint8_t *buffer = (FAR uint8_t *)dev->d_appdata + recvlen;
uint16_t buflen = dev->d_len - recvlen;
@@ -251,9 +250,6 @@ static inline void inet_tcp_newdata(FAR struct net_driver_s *dev,
{
nerr("ERROR: packet data not saved (%d bytes)\n", buflen - nsaved);
}
-#endif
-#else
- nerr("ERROR: packet data lost (%d bytes)\n", dev->d_len - recvlen);
#endif
}
@@ -312,7 +308,7 @@ static inline void inet_udp_newdata(FAR struct net_driver_s *dev,
*
****************************************************************************/
-#if defined(NET_TCP_HAVE_STACK) && defined(CONFIG_NET_TCP_READAHEAD)
+#ifdef NET_TCP_HAVE_STACK
static inline void inet_tcp_readahead(struct inet_recvfrom_s *pstate)
{
FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)pstate->ir_sock->s_conn;
@@ -373,9 +369,9 @@ static inline void inet_tcp_readahead(struct inet_recvfrom_s *pstate)
}
}
}
-#endif /* NET_TCP_HAVE_STACK && CONFIG_NET_TCP_READAHEAD */
+#endif /* NET_TCP_HAVE_STACK */
-#if defined(NET_UDP_HAVE_STACK) && defined(CONFIG_NET_UDP_READAHEAD)
+#ifdef NET_UDP_HAVE_STACK
static inline void inet_udp_readahead(struct inet_recvfrom_s *pstate)
{
@@ -501,26 +497,6 @@ static int inet_recvfrom_timeout(struct inet_recvfrom_s *pstate)
timeo = psock->s_rcvtimeo;
}
- /* Use a fixed, configurable delay under the following circumstances:
- *
- * 1) This delay function has been enabled with CONFIG_NET_TCP_RECVDELAY > 0
- * 2) Some data has already been received from the socket. Since this can
- * only be true for a TCP/IP socket, this logic applies only to TCP/IP
- * sockets. And either
- * 3) There is no configured receive timeout, or
- * 4) The configured receive timeout is greater than than the delay
- */
-
-#if CONFIG_NET_TCP_RECVDELAY > 0
- if ((timeo == 0 || timeo > CONFIG_NET_TCP_RECVDELAY) &&
- pstate->ir_recvlen > 0)
- {
- /* Use the configured timeout */
-
- timeo = CONFIG_NET_TCP_RECVDELAY;
- }
-#endif
-
/* Is there an effective timeout? */
if (timeo)
@@ -675,28 +651,14 @@ static uint16_t inet_tcp_eventhandler(FAR struct net_driver_s *dev,
flags = (flags & ~TCP_NEWDATA) | TCP_SNDACK;
- /* Check for transfer complete. We will consider the transfer
- * complete in own of two different ways, depending on the setting
- * of CONFIG_NET_TCP_RECVDELAY.
- *
- * 1) If CONFIG_NET_TCP_RECVDELAY == 0 then we will consider the
- * TCP/IP transfer complete as soon as any data has been received.
- * This is safe because if any additional data is received, it
- * will be retained in the TCP/IP read-ahead buffer until the
- * next receive is performed.
- * 2) CONFIG_NET_TCP_RECVDELAY > 0 may be set to wait a little
- * bit to determine if more data will be received. You might
- * do this if read-ahead buffering is disabled and we want to
- * minimize the loss of back-to-back packets. In this case,
- * the transfer is complete when either a) the entire user buffer
- * is full or 2) when the receive timeout occurs (below).
+ /* Check for transfer complete. We will consider the
+ * TCP/IP transfer complete as soon as any data has been received.
+ * This is safe because if any additional data is received, it
+ * will be retained in the TCP/IP read-ahead buffer until the
+ * next receive is performed.
*/
-#if CONFIG_NET_TCP_RECVDELAY > 0
- if (pstate->ir_buflen == 0)
-#else
if (pstate->ir_recvlen > 0)
-#endif
{
ninfo("TCP resume\n");
@@ -765,23 +727,7 @@ static uint16_t inet_tcp_eventhandler(FAR struct net_driver_s *dev,
}
else
{
- /* If no data has been received, then return ENOTCONN.
- * Otherwise, let this return success. The failure will
- * be reported the next time that recv[from]() is called.
- */
-
-#if CONFIG_NET_TCP_RECVDELAY > 0
- if (pstate->ir_recvlen > 0)
- {
- pstate->ir_result = 0;
- }
- else
- {
- pstate->ir_result = -ENOTCONN;
- }
-#else
pstate->ir_result = -ENOTCONN;
-#endif
}
/* Wake up the waiting thread */
@@ -806,19 +752,9 @@ static uint16_t inet_tcp_eventhandler(FAR struct net_driver_s *dev,
pstate->ir_cb->priv = NULL;
pstate->ir_cb->event = NULL;
- /* Report an error only if no data has been received. (If
- * CONFIG_NET_TCP_RECVDELAY then ir_recvlen should always be
- * less than or equal to zero).
- */
-
-#if CONFIG_NET_TCP_RECVDELAY > 0
- if (pstate->ir_recvlen <= 0)
-#endif
- {
- /* Report the timeout error */
+ /* Report the timeout error */
- pstate->ir_result = -EAGAIN;
- }
+ pstate->ir_result = -EAGAIN;
/* Wake up the waiting thread, returning either the error -EAGAIN
* that signals the timeout event or the data received up to
@@ -1207,7 +1143,6 @@ static ssize_t inet_udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
net_lock();
inet_recvfrom_initialize(psock, buf, len, from, fromlen, &state);
-#ifdef CONFIG_NET_UDP_READAHEAD
/* Copy the read-ahead data from the packet */
inet_udp_readahead(&state);
@@ -1220,15 +1155,6 @@ static ssize_t inet_udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
ret = state.ir_recvlen;
-#else
- /* Otherwise, the default return value of zero is used (only for the case
- * where len == state.ir_buflen is zero).
- */
-
- ret = 0;
-#endif
-
-#ifdef CONFIG_NET_UDP_READAHEAD
/* Handle non-blocking UDP sockets */
if (_SS_ISNONBLOCK(psock->s_flags))
@@ -1253,7 +1179,6 @@ static ssize_t inet_udp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
*/
else if (state.ir_recvlen <= 0)
-#endif
{
/* Get the device that will handle the packet transfers. This may be
* NULL if the UDP socket is bound to INADDR_ANY. In that case, no
@@ -1336,7 +1261,6 @@ static ssize_t inet_tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
* socket has been disconnected.
*/
-#ifdef CONFIG_NET_TCP_READAHEAD
inet_tcp_readahead(&state);
/* The default return value is the number of bytes that we just copied
@@ -1347,14 +1271,6 @@ static ssize_t inet_tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
ret = state.ir_recvlen;
-#else
- /* Otherwise, the default return value of zero is used (only for the case
- * where len == state.ir_buflen is zero).
- */
-
- ret = 0;
-#endif
-
/* Verify that the SOCK_STREAM has been and still is connected */
if (!_SS_ISCONNECTED(psock->s_flags))
@@ -1370,11 +1286,7 @@ static ssize_t inet_tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
* end-of-file indication.
*/
-#ifdef CONFIG_NET_TCP_READAHEAD
if (ret <= 0 && !_SS_ISCLOSED(psock->s_flags))
-#else
- if (!_SS_ISCLOSED(psock->s_flags))
-#endif
{
/* Nothing was previously received from the readahead buffers.
* The SOCK_STREAM must be (re-)connected in order to receive any
@@ -1391,9 +1303,7 @@ static ssize_t inet_tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
* if no data was obtained from the read-ahead buffers.
*/
- else
-#ifdef CONFIG_NET_TCP_READAHEAD
- if (_SS_ISNONBLOCK(psock->s_flags))
+ else if (_SS_ISNONBLOCK(psock->s_flags))
{
/* Return the number of bytes read from the read-ahead buffer if
* something was received (already in 'ret'); EAGAIN if not.
@@ -1413,27 +1323,19 @@ static ssize_t inet_tcp_recvfrom(FAR struct socket *psock, FAR void *buf, size_t
*/
else
-#endif
/* We get here when we we decide that we need to setup the wait for incoming
* TCP/IP data. Just a few more conditions to check:
*
* 1) Make sure thet there is buffer space to receive additional data
- * (state.ir_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. And
- * 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).
+ * (state.ir_buflen > 0). This could be zero, for example, we filled
+ * the user buffer with data from the read-ahead buffers. And
+ * 2) 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 && defined(CONFIG_NET_TCP_READAHEAD)
if (state.ir_recvlen == 0 && state.ir_buflen > 0)
-#else
- if (state.ir_buflen > 0)
-#endif
{
FAR struct tcp_conn_s *conn = (FAR struct tcp_conn_s *)psock->s_conn;
diff --git a/net/inet/inet_sockif.c b/net/inet/inet_sockif.c
index 2f03075672d..ff856eea54d 100644
--- a/net/inet/inet_sockif.c
+++ b/net/inet/inet_sockif.c
@@ -287,28 +287,12 @@ static sockcaps_t inet_sockcaps(FAR struct socket *psock)
{
#ifdef NET_TCP_HAVE_STACK
case SOCK_STREAM:
- /* REVISIT: Non-blocking recv() depends on CONFIG_NET_TCP_READAHEAD,
- * but non-blocking send() depends on CONFIG_NET_TCP_WRITE_BUFFERS.
- */
-
-#ifdef CONFIG_NET_TCP_READAHEAD
return SOCKCAP_NONBLOCKING;
-#else
- return 0;
-#endif
#endif
#ifdef NET_UDP_HAVE_STACK
case SOCK_DGRAM:
- /* REVISIT: Non-blocking recvfrom() depends on CONFIG_NET_UDP_READAHEAD,
- * but non-blocking sendto() depends on CONFIG_NET_UDP_WRITE_BUFFERS.
- */
-
-#ifdef CONFIG_NET_UDP_READAHEAD
return SOCKCAP_NONBLOCKING;
-#else
- return 0;
-#endif
#endif
default:
diff --git a/net/tcp/Kconfig b/net/tcp/Kconfig
index 9319c62bc96..325f7b79446 100644
--- a/net/tcp/Kconfig
+++ b/net/tcp/Kconfig
@@ -8,6 +8,7 @@ menu "TCP/IP Networking"
config NET_TCP
bool "TCP/IP Networking"
default n
+ select NET_READAHEAD if !NET_TCP_NO_STACK
---help---
Enable or disable TCP networking support.
@@ -90,30 +91,10 @@ config NET_TCP_NOTIFIER
purpose notifier, but was developed specifically to support poll()
logic where the poll must wait for these events.
-config NET_TCP_READAHEAD
- bool "Enable TCP/IP read-ahead buffering"
- default y
- select NET_READAHEAD
- select MM_IOB
- ---help---
- Read-ahead buffers allows buffering of TCP/IP packets when there is no
- receive in place to catch the TCP packet. In that case, the packet
- will be retained in the NuttX read-ahead buffers.
-
- You might want to disable TCP/IP read-ahead buffering on a highly
- memory constrained system that does not have any TCP/IP packet rate
- issues. But, if disabled, there will probably be more packet
- retransmissions or even packet loss.
-
- Make sure that you check the setting in the I/O Buffering menu.
- These settings are critical to the reasonable operation of read-
- ahead buffering.
-
config NET_TCP_WRITE_BUFFERS
bool "Enable TCP/IP write buffering"
default n
select NET_WRITE_BUFFERS
- select MM_IOB
---help---
Write buffers allows buffering of ongoing TCP/IP packets, providing
for higher performance, streamed output.
@@ -157,20 +138,6 @@ config NET_TCP_WRBUFFER_DUMP
endif # NET_TCP_WRITE_BUFFERS
-config NET_TCP_RECVDELAY
- int "TCP Rx delay"
- default 0
- ---help---
- If NET_TCP_READAHEAD_BUFFERS is undefined, then there will be no buffering
- of TCP/IP packets: Any TCP/IP packet received will be ACKed, but its contents
- will be dropped in the bit-bucket.
-
- One low-performance option is delay for a short period of time after a
- TCP/IP packet is received to see if another comes right behind it. Then
- the packet data from both can be combined. This option only makes since
- if performance is not an issue and you need to handle short bursts of
- small, back-to-back packets. The delay is in units of deciseconds.
-
config NET_TCPBACKLOG
bool "TCP/IP backlog support"
default n
diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h
index 5430bc4730b..5253018974e 100644
--- a/net/tcp/tcp.h
+++ b/net/tcp/tcp.h
@@ -208,7 +208,6 @@ struct tcp_conn_s
FAR struct net_driver_s *dev;
-#ifdef CONFIG_NET_TCP_READAHEAD
/* Read-ahead buffering.
*
* readahead - A singly linked list of type struct iob_qentry_s
@@ -216,7 +215,6 @@ struct tcp_conn_s
*/
struct iob_queue_s readahead; /* Read-ahead buffering */
-#endif
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
/* Write buffering
@@ -1109,10 +1107,8 @@ uint16_t tcp_callback(FAR struct net_driver_s *dev,
*
****************************************************************************/
-#ifdef CONFIG_NET_TCP_READAHEAD
uint16_t tcp_datahandler(FAR struct tcp_conn_s *conn, FAR uint8_t *buffer,
uint16_t nbytes);
-#endif
/****************************************************************************
* Name: tcp_backlogcreate
@@ -1708,7 +1704,7 @@ int tcp_notifier_teardown(int key);
*
****************************************************************************/
-#if defined(CONFIG_NET_TCP_READAHEAD) && defined(CONFIG_NET_TCP_NOTIFIER)
+#ifdef CONFIG_NET_TCP_NOTIFIER
void tcp_readahead_signal(FAR struct tcp_conn_s *conn);
#endif
diff --git a/net/tcp/tcp_callback.c b/net/tcp/tcp_callback.c
index 73f49f1d3e1..ba2d4d7cb4d 100644
--- a/net/tcp/tcp_callback.c
+++ b/net/tcp/tcp_callback.c
@@ -89,22 +89,18 @@ tcp_data_event(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn,
if (dev->d_len > 0)
{
-#ifdef CONFIG_NET_TCP_READAHEAD
uint8_t *buffer = dev->d_appdata;
int buflen = dev->d_len;
uint16_t recvlen;
-#endif
ninfo("No listener on connection\n");
-#ifdef CONFIG_NET_TCP_READAHEAD
/* Save as the packet data as in the read-ahead buffer. NOTE that
* partial packets will not be buffered.
*/
recvlen = tcp_datahandler(conn, buffer, buflen);
if (recvlen < buflen)
-#endif
{
/* There is no handler to receive new data and there are no free
* read-ahead buffers to retain the data -- drop the packet.
@@ -241,7 +237,6 @@ uint16_t tcp_callback(FAR struct net_driver_s *dev,
*
****************************************************************************/
-#ifdef CONFIG_NET_TCP_READAHEAD
uint16_t tcp_datahandler(FAR struct tcp_conn_s *conn, FAR uint8_t *buffer,
uint16_t buflen)
{
@@ -298,6 +293,5 @@ uint16_t tcp_datahandler(FAR struct tcp_conn_s *conn, FAR uint8_t *buffer,
ninfo("Buffered %d bytes\n", buflen);
return buflen;
}
-#endif /* CONFIG_NET_TCP_READAHEAD */
#endif /* NET_TCP_HAVE_STACK */
diff --git a/net/tcp/tcp_conn.c b/net/tcp/tcp_conn.c
index 1f3465c62b7..180094e51c3 100644
--- a/net/tcp/tcp_conn.c
+++ b/net/tcp/tcp_conn.c
@@ -775,11 +775,9 @@ void tcp_free(FAR struct tcp_conn_s *conn)
dq_rem(&conn->node, &g_active_tcp_connections);
}
-#ifdef CONFIG_NET_TCP_READAHEAD
/* Release any read-ahead buffers attached to the connection */
iob_free_queue(&conn->readahead, IOBUSER_NET_TCP_READAHEAD);
-#endif
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
/* Release any write buffers attached to the connection */
@@ -1020,11 +1018,9 @@ FAR struct tcp_conn_s *tcp_alloc_accept(FAR struct net_driver_s *dev,
memcpy(conn->rcvseq, tcp->seqno, 4);
-#ifdef CONFIG_NET_TCP_READAHEAD
/* Initialize the list of TCP read-ahead buffers */
IOB_QINIT(&conn->readahead);
-#endif
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
/* Initialize the write buffer lists */
@@ -1257,11 +1253,9 @@ int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr)
conn->sndseq_max = 0;
#endif
-#ifdef CONFIG_NET_TCP_READAHEAD
/* Initialize the list of TCP read-ahead buffers */
IOB_QINIT(&conn->readahead);
-#endif
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
/* Initialize the TCP write buffer lists */
diff --git a/net/tcp/tcp_netpoll.c b/net/tcp/tcp_netpoll.c
index e883c97ab4b..dca5ca38cbe 100644
--- a/net/tcp/tcp_netpoll.c
+++ b/net/tcp/tcp_netpoll.c
@@ -302,15 +302,9 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
fds->priv = (FAR void *)info;
-#ifdef CONFIG_NET_TCP_READAHEAD
/* Check for read data or backlogged connection availability now */
if (!IOB_QEMPTY(&conn->readahead) || tcp_backlogavailable(conn))
-#else
- /* Check for backlogged connection now */
-
- if (tcp_backlogavailable(conn))
-#endif
{
/* Normal data may be read without blocking. */
diff --git a/net/tcp/tcp_notifier.c b/net/tcp/tcp_notifier.c
index 23673cfef53..acd6404854c 100644
--- a/net/tcp/tcp_notifier.c
+++ b/net/tcp/tcp_notifier.c
@@ -85,7 +85,6 @@ int tcp_readahead_notifier_setup(worker_t worker,
FAR struct tcp_conn_s *conn,
FAR void *arg)
{
-#ifdef CONFIG_NET_TCP_READAHEAD
struct work_notifier_s info;
DEBUGASSERT(worker != NULL);
@@ -108,9 +107,6 @@ int tcp_readahead_notifier_setup(worker_t worker,
info.worker = worker;
return work_notifier_setup(&info);
-#else
- return 0;
-#endif
}
/****************************************************************************
@@ -269,14 +265,12 @@ int tcp_notifier_teardown(int key)
*
****************************************************************************/
-#ifdef CONFIG_NET_TCP_READAHEAD
void tcp_readahead_signal(FAR struct tcp_conn_s *conn)
{
/* This is just a simple wrapper around work_notifier_signal(). */
return work_notifier_signal(WORK_TCP_READAHEAD, conn);
}
-#endif
/****************************************************************************
* Name: tcp_writebuffer_signal
diff --git a/net/tcp/tcp_recvwindow.c b/net/tcp/tcp_recvwindow.c
index 694b965682b..c6b2dea4e21 100644
--- a/net/tcp/tcp_recvwindow.c
+++ b/net/tcp/tcp_recvwindow.c
@@ -75,10 +75,8 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev)
uint16_t iplen;
uint16_t mss;
uint16_t recvwndo;
-#ifdef CONFIG_NET_TCP_READAHEAD
- int niob_avail;
- int nqentry_avail;
-#endif
+ int niob_avail;
+ int nqentry_avail;
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
@@ -106,7 +104,6 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev)
mss = dev->d_pktsize - (NET_LL_HDRLEN(dev) + iplen + TCP_HDRLEN);
-#ifdef CONFIG_NET_TCP_READAHEAD
/* Update the TCP received window based on read-ahead I/O buffer
* and IOB chain availability. At least one queue entry is required.
* If one queue entry is available, then the amount of read-ahead
@@ -168,7 +165,6 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev)
recvwndo = (uint16_t)rwnd;
}
else /* nqentry_avail == 0 || niob_avail == 0 */
-#endif
{
/* No IOB chains or noIOBs are available. The only buffering
* available is within the packet buffer itself. We can buffer no
diff --git a/net/udp/Kconfig b/net/udp/Kconfig
index 095d86af754..24e05366b59 100644
--- a/net/udp/Kconfig
+++ b/net/udp/Kconfig
@@ -8,6 +8,7 @@ menu "UDP Networking"
config NET_UDP
bool "UDP Networking"
default n
+ select NET_READAHEAD if !NET_UDP_NO_STACK
depends on NET
---help---
Enable or disable UDP networking support.
@@ -59,17 +60,10 @@ config NET_UDP_NPOLLWAITERS
int "Number of UDP poll waiters"
default 1
-config NET_UDP_READAHEAD
- bool "Enable UDP/IP read-ahead buffering"
- default y
- select NET_READAHEAD
- select MM_IOB
-
config NET_UDP_WRITE_BUFFERS
bool "Enable UDP/IP write buffering"
default n
select NET_WRITE_BUFFERS
- select MM_IOB
---help---
Write buffers allows buffering of ongoing UDP/IP packets, providing
for higher performance, streamed output.
diff --git a/net/udp/udp.h b/net/udp/udp.h
index d63b1f75358..c2aa4ded3da 100644
--- a/net/udp/udp.h
+++ b/net/udp/udp.h
@@ -48,10 +48,7 @@
#include