Skip to content

Commit

Permalink
Make the read ahead buffer unselectable
Browse files Browse the repository at this point in the history
Here is the email loop talk about why it is better to remove the option:
https://groups.google.com/forum/#!topic/nuttx/AaNkS7oU6R0

Change-Id: Ib66c037752149ad4b2787ef447f966c77aa12aad
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
  • Loading branch information
xiaoxiang781216 authored and patacongo committed Jan 11, 2020
1 parent b96d0bf commit 346336b
Show file tree
Hide file tree
Showing 41 changed files with 35 additions and 282 deletions.
4 changes: 2 additions & 2 deletions Documentation/NuttxPortingGuide.html
Original file line number Diff line number Diff line change
Expand Up @@ -4600,7 +4600,7 @@ <h3><a name="iobconfig">4.14.1 Configuration Options</a></h3>
<dt><code>CONFIG_IOB_NBUFFERS</code>
<dd>Number of pre-allocated I/O buffers. Each packet is represented by a series of small I/O buffers in a chain. This setting determines the number of preallocated I/O buffers available for packet data.

The default value is setup for network support. The default is 8 buffers if neither TCP read-ahead or TCP write buffering is enabled (neither <code>CONFIG_NET_TCP_WRITE_BUFFERS</code> nor <code>CONFIG_NET_TCP_READAHEAD</code>), 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 <code>CONFIG_NET_TCP_WRITE_BUFFERS</code> nor <code>CONFIG_NET_TCP</code>), 24 if only TCP/UDP is enabled, and 36 if both TCP/UDP and write buffering are enabled.

<dt><code>CONFIG_IOB_BUFSIZE</code>
<dd>Payload size of one I/O buffer. Each packet is represented by a series of small I/O buffers in a chain. This setting determines the data payload each preallocated I/O buffer. The default value is 196 bytes.
Expand All @@ -4610,7 +4610,7 @@ <h3><a name="iobconfig">4.14.1 Configuration Options</a></h3>

<dd>These generic I/O buffer chain containers are not currently used by any logic in NuttX. That is because their other other specialized I/O buffer chain containers that also carry a payload of usage specific information.

The default value is zero if nether TCP nor UDP read-ahead buffering is enabled (i.e., neither <code>CONFIG_NET_TCP_READAHEAD</code> && !<code>CONFIG_NET_UDP_READAHEAD</code> or eight if either is enabled.
The default value is zero if nether TCP nor UDP is enabled (i.e., neither <code>CONFIG_NET_TCP</code> && !<code>CONFIG_NET_UDP</code> or eight if either is enabled.

<dt><code>CONFIG_IOB_THROTTLE</code>
<dd>I/O buffer throttle value. TCP write buffering and read-ahead buffer use the same pool of free I/O buffers. In order to prevent uncontrolled incoming TCP packets from hogging all of the available, pre-allocated I/O buffers, a throttling value is required. This throttle value assures that I/O buffers will be denied to the read-ahead logic before TCP writes are halted.
Expand Down
2 changes: 0 additions & 2 deletions Documentation/NuttxUserGuide.html
Original file line number Diff line number Diff line change
Expand Up @@ -8639,8 +8639,6 @@ <h5><a name="poll">2.10.2.4.1 poll</a></H5>
<ul>
<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_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>
In order to for select to work with incoming connections, you must also select:
Expand Down
2 changes: 0 additions & 2 deletions boards/arm/kinetis/freedom-k64f/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions boards/arm/kinetis/freedom-k66f/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions boards/arm/kinetis/twr-k64f120m/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/sam34/sam4e-ek/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/sama5/sama5d3-xplained/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/sama5/sama5d3-xplained/configs/bridge/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion boards/arm/sama5/sama5d3x-ek/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/sama5/sama5d4-ek/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/sama5/sama5d4-ek/configs/bridge/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion boards/arm/samv7/same70-xplained/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/samv7/samv71-xult/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/stm32/cloudctrl/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/stm32/olimex-stm32-p207/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions boards/arm/stm32/viewtool-stm32f107/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions boards/arm/tiva/dk-tm4c129x/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion boards/arm/tiva/dk-tm4c129x/configs/ipv6/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion boards/arm/tiva/lm3s6432-s2e/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions fs/procfs/fs_procfsiobinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion graphics/vnc/server/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions graphics/vnc/server/vnc_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/nuttx/mm/iob.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions include/nuttx/net/netconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
****************************************************************************/
Expand Down
8 changes: 4 additions & 4 deletions mm/iob/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 346336b

Please sign in to comment.