Squashed commit of the following:

Fix a few typo/compilation problems.
    net/:  Remove all CONFIG_NET_xxx_TCP_RECVWNDO configuration variables.  They were used only to initialize the d_recwndo of the network device structure which no longer exists.
    net/:  Remove the device TCP receive window field (d_recvwndo) from the device structure.  That value is no longer retained, but is calculated dynamically.
    Remove some dangling references to CONFIG_NET_TCP_RWND_CONTROL.
    net/tcp:  Take read-ahead throttling into account when calculating the TCP receive window size.
    net/tcp: tcp_get_recvwindow() now returns the receive window size directly (vs. indirectly via the device structure).
    net/tcp:  Remove CONFIG_NET_TCP_RWND_CONTROL.  TCP window algorithm is now trigged only by CONFIG_NET_TCP_READAHEAD.
This commit is contained in:
Gregory Nutt 2018-07-01 07:59:33 -06:00
parent 6ec8f9ce83
commit e59b26370d
43 changed files with 64 additions and 197 deletions

View File

@ -41,7 +41,6 @@ CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_ARP_IPIN=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=650
CONFIG_NET_ETH_TCP_RECVWNDO=624
CONFIG_NET_HOSTNAME="Bambino-200E"
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y

View File

@ -227,7 +227,6 @@ Networking Support
CONFIG_NET_ETHERNET=y : Support Ethernet data link
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=536 : Should be the same as CONFIG_NET_ETH_MTU
CONFIG_NET_ARP=y : Enable ARP
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting

View File

@ -27,7 +27,6 @@ CONFIG_MAX_WDOGPARMS=2
CONFIG_NET=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=590
CONFIG_NET_ETH_TCP_RECVWNDO=536
CONFIG_NET_ICMPv6=y
CONFIG_NET_ICMPv6_NEIGHBOR=y
CONFIG_NET_ICMPv6_SOCKET=y

View File

@ -195,7 +195,6 @@ Networking Support
CONFIG_NET_ETHERNET=y : Support Ethernet data link
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=536 : Should be the same as CONFIG_NET_ETH_MTU
CONFIG_NET_ARP=y : Enable ARP
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting

View File

@ -198,7 +198,6 @@ Networking Support
CONFIG_NET_ETHERNET=y : Support Ethernet data link
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=536 : Should be the same as CONFIG_NET_ETH_MTU
CONFIG_NET_ARP=y : Enable ARP
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting

View File

@ -81,7 +81,6 @@ CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=1500
CONFIG_NET_ETH_TCP_RECVWNDO=8400
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_LOOPBACK=y
@ -91,10 +90,8 @@ CONFIG_NET_SOCKOPTS=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCP_KEEPALIVE=y
CONFIG_NET_TCP_RWND_CONTROL=y
CONFIG_NET_TUN=y
CONFIG_NET_TUN_MTU=1500
CONFIG_NET_TUN_TCP_RECVWNDO=8400
CONFIG_NET_UDP=y
CONFIG_NFILE_DESCRIPTORS=45
CONFIG_NFILE_STREAMS=8

View File

@ -79,7 +79,6 @@ CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=1500
CONFIG_NET_ETH_TCP_RECVWNDO=2800
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_LOOPBACK=y
@ -88,7 +87,6 @@ CONFIG_NET_ROUTE=y
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCP_RWND_CONTROL=y
CONFIG_NET_UDP=y
CONFIG_NFILE_DESCRIPTORS=45
CONFIG_NFILE_STREAMS=8

View File

@ -26,7 +26,6 @@ CONFIG_NETUTILS_TFTPC=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=650
CONFIG_NET_ETH_TCP_RECVWNDO=624
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_MAX_LISTENPORTS=8

View File

@ -44,7 +44,6 @@ CONFIG_NET_ARP_IPIN=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=1400
CONFIG_NET_ETH_TCP_RECVWNDO=742
CONFIG_NET_GUARDSIZE=648
CONFIG_NET_HOSTNAME="nuttx"
CONFIG_NET_ICMP=y

View File

@ -63,7 +63,6 @@ CONFIG_NETUTILS_TELNETD=y
CONFIG_NET_ARP_IPIN=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_ETH_MTU=1500
CONFIG_NET_ETH_TCP_RECVWNDO=1536
CONFIG_NET_FTMAC100=y
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y

View File

@ -34,7 +34,6 @@ CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDB_DNSCLIENT_ENTRIES=4
CONFIG_NETUTILS_FTPC=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_TCP_RECVWNDO=550
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_MAX_LISTENPORTS=8

View File

@ -26,7 +26,6 @@ CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETUTILS_TFTPC=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_ETH_MTU=650
CONFIG_NET_ETH_TCP_RECVWNDO=624
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_MAX_LISTENPORTS=40

View File

@ -224,7 +224,6 @@ Networking Support
CONFIG_NET=y : Enable Neworking
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=536 : Should be the same as CONFIG_NET_ETH_MTU
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

View File

@ -812,7 +812,6 @@ Networking
CONFIG_NET=y : Enable Neworking
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU
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

View File

@ -977,7 +977,6 @@ Networking
CONFIG_NET=y : Enable Networking
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU
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

View File

@ -1340,7 +1340,6 @@ Networking
CONFIG_NET=y : Enable Neworking
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU
CONFIG_NET_ARP=y : ARP support should be enabled
CONFIG_NET_ARP_IPIN=y : IP address harvesting (optional)
CONFIG_NET_TCP=y : Enable TCP/IP networking

View File

@ -56,7 +56,6 @@ CONFIG_MMCSD=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=590
CONFIG_NET_ETH_TCP_RECVWNDO=562
CONFIG_NET_ICMPv6_NEIGHBOR=y
CONFIG_NET_ICMPv6_SOCKET=y
CONFIG_NET_ICMPv6=y

View File

@ -55,7 +55,6 @@ CONFIG_MMCSD=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_TCP_RECVWNDO=562
CONFIG_NET_HOSTNAME="SAMA5D4-EK"
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_ICMP=y

View File

@ -57,7 +57,6 @@ CONFIG_MMCSD=y
CONFIG_MQ_MAXMSGSIZE=64
CONFIG_NET_ARP_IPIN=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_TCP_RECVWNDO=562
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_ICMP=y
CONFIG_NET_SOCKOPTS=y

View File

@ -391,7 +391,6 @@ Selecting the GMAC peripheral
CONFIG_NET=y : Enable Neworking
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU
CONFIG_NET_ARP=y : ARP support should be enabled
CONFIG_NET_ARP_SEND=y : Use ARP to get peer address before sending
CONFIG_NET_TCP=y : Enable TCP/IP networking

View File

@ -55,7 +55,6 @@ CONFIG_MTD=y
CONFIG_NET_6LOWPAN=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=590
CONFIG_NET_ETH_TCP_RECVWNDO=536
CONFIG_NET_HOSTNAME="MRF24J40-Hub"
CONFIG_NET_ICMPv6_NEIGHBOR=y
CONFIG_NET_ICMPv6_SOCKET=y

View File

@ -707,7 +707,6 @@ Selecting the GMAC peripheral
CONFIG_NET=y : Enable Neworking
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU
CONFIG_NET_ARP=y : ARP support should be enabled
CONFIG_NET_ARP_SEND=y : Use ARP to get peer address before sending
CONFIG_NET_TCP=y : Enable TCP/IP networking

View File

@ -56,7 +56,6 @@ CONFIG_MTD=y
CONFIG_NET_6LOWPAN=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=590
CONFIG_NET_ETH_TCP_RECVWNDO=536
CONFIG_NET_HOSTNAME="MRF24J40-Hub"
CONFIG_NET_ICMPv6_NEIGHBOR=y
CONFIG_NET_ICMPv6_SOCKET=y

View File

@ -31,7 +31,6 @@ CONFIG_NETUTILS_THTTPD=y
CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=768
CONFIG_NET_ETH_TCP_RECVWNDO=742
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_MAX_LISTENPORTS=40

View File

@ -63,7 +63,6 @@ CONFIG_NETDEV_PHY_IOCTL=y
CONFIG_NETDEV_STATISTICS=y
CONFIG_NETDEV_TELNET=y
CONFIG_NET_6LOWPAN=y
CONFIG_NET_6LOWPAN_TCP_RECVWNDO=102
CONFIG_NET_BROADCAST=y
CONFIG_NET_HOSTNAME="SAMV71-XULT"
CONFIG_NET_IPv6=y

View File

@ -65,7 +65,6 @@ CONFIG_NETDEV_PHY_IOCTL=y
CONFIG_NETDEV_STATISTICS=y
CONFIG_NETDEV_TELNET=y
CONFIG_NET_6LOWPAN=y
CONFIG_NET_6LOWPAN_TCP_RECVWNDO=102
CONFIG_NET_BROADCAST=y
CONFIG_NET_HOSTNAME="SAMV71-XULT"
CONFIG_NET_IPv6=y

View File

@ -28,7 +28,6 @@ CONFIG_NETDB_DNSCLIENT_ENTRIES=4
CONFIG_NET_ARP_IPIN=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=650
CONFIG_NET_ETH_TCP_RECVWNDO=624
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_MAX_LISTENPORTS=40

View File

@ -34,7 +34,6 @@ CONFIG_MMCSD_SDIO=y
CONFIG_NET=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=590
CONFIG_NET_ETH_TCP_RECVWNDO=536
CONFIG_NET_HOSTNAME="STM32F4-Discovery"
CONFIG_NET_ICMPv6=y
CONFIG_NET_ICMPv6_NEIGHBOR=y

View File

@ -24,7 +24,6 @@ CONFIG_MAX_WDOGPARMS=2
CONFIG_NET=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=590
CONFIG_NET_ETH_TCP_RECVWNDO=536
CONFIG_NET_ICMPv6=y
CONFIG_NET_ICMPv6_SOCKET=y
CONFIG_NET_IPv6=y

View File

@ -173,7 +173,6 @@ Networking Support
CONFIG_NET_ETHERNET=y : Support Ethernet data link
CONFIG_NET_SOCKOPTS=y : Enable socket operations
CONFIG_NET_ETH_MTU=590 : Maximum packet size (MTU) 1518 is more standard
CONFIG_NET_ETH_TCP_RECVWNDO=536 : Should be the same as CONFIG_NET_ETH_MTU
CONFIG_NET_ARP=y : Enable ARP
CONFIG_NET_ARPTAB_SIZE=16 : ARP table size
CONFIG_NET_ARP_IPIN=y : Enable ARP address harvesting

View File

@ -373,7 +373,6 @@ ViewTool DP83848 Ethernet Module
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_ETH_MTU=650 : Maximum packet size
CONFIG_NET_ETH_TCP_RECVWNDO=650
CONFIG_NET_TCP_READAHEAD=y : Enable read-ahead buffering
CONFIG_NET_TCP_READAHEAD_BUFSIZE=650

View File

@ -28,7 +28,6 @@ CONFIG_NETUTILS_WEBCLIENT=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_MTU=650
CONFIG_NET_ETH_TCP_RECVWNDO=624
CONFIG_NET_HOSTNAME="Viewtool-STM32F107"
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y

View File

@ -130,8 +130,6 @@
#ifndef CONFIG_NET_6LOWPAN_MTU
# define CONFIG_NET_6LOWPAN_MTU 1294
# undef CONFIG_NET_6LOWPAN_TCP_RECVWNDO
# define CONFIG_NET_6LOWPAN_TCP_RECVWNDO 1220
#endif
/* We are supporting multiple network devices using different link layer
@ -527,40 +525,6 @@
# define MIN_TCP_MSS __MIN_TCP_MSS(__IPv6_HDRLEN)
#endif
/* The size of the advertised receiver's window.
*
* Should be set low (i.e., to the size of the d_buf buffer) is the
* application is slow to process incoming data, or high (32768 bytes)
* if the application processes data quickly.
*/
#define NET_LO_TCP_RECVWNDO LO_TCP_MSS(0)
#ifdef CONFIG_NET_SLIP
# ifndef CONFIG_NET_SLIP_TCP_RECVWNDO
# define CONFIG_NET_SLIP_TCP_RECVWNDO SLIP_TCP_MSS(0)
# endif
#endif
#ifdef CONFIG_NET_TUN
# ifndef CONFIG_NET_TUN_TCP_RECVWNDO
# define CONFIG_NET_TUN_TCP_RECVWNDO TUN_TCP_MSS(0)
# endif
#endif
#ifdef CONFIG_NET_ETHERNET
# ifndef CONFIG_NET_ETH_TCP_RECVWNDO
# define CONFIG_NET_ETH_TCP_RECVWNDO ETH_TCP_MSS(0)
# endif
#endif
/* We are supporting multiple network devices using different link layer
* protocols. Get the size of the receive window from the device
* structure.
*/
#define NET_DEV_RCVWNDO(d) ((d)->d_recvwndo)
/* How long a connection should stay in the TIME_WAIT state.
*
* This configuration option has no real implication, and it should be

View File

@ -241,15 +241,11 @@ struct net_driver_s
uint8_t d_lltype; /* See enum net_lltype_e */
uint8_t d_llhdrlen; /* Link layer header size */
#ifdef CONFIG_NETDEV_IFINDEX
uint8_t d_ifindex; /* Device index */
#endif
uint16_t d_mtu; /* Maximum packet size */
#ifdef CONFIG_NET_TCP
uint16_t d_recvwndo; /* TCP receive window size */
#endif
#if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_NET_6LOWPAN) || \
defined(CONFIG_NET_BLUETOOTH) || defined(CONFIG_NET_IEEE802154)

View File

@ -56,27 +56,6 @@ config NET_ETH_MTU
IPv6 hosts are required to be able to handle an MSS of 1220 octets,
resulting in a minimum buffer size of of 1220+20+40+14 = 1294
config NET_ETH_TCP_RECVWNDO
int "Ethernet TCP receive window size"
default 1220 if NET_IPv6
default 536 if !NET_IPv6
depends on NET_ETHERNET && NET_TCP
range 536 65535
---help---
The size of the advertised receiver's window. Should be set low
(i.e., to the size of the MSS) if the application is slow to process
incoming data, or high (65,535 bytes) if the application processes
data quickly.
This value does not account for buffering provided for read-ahead
buffering via IOBs. To include IOB aware windowing logic also
enable CONFIG_NET_TCP_RWND_CONTROL.
The default values correspond to the MSS associated with the
minimum MSS: IPv4 hosts are required to be able to handle an MSS
of at least 536 octets; IPv6 hosts are required to be able to handle
an MSS of 1220 octets.
config NET_SLIP_MTU
int # "SLIP packet buffer size (MTU)"
default 296
@ -103,16 +82,6 @@ config NET_SLIP_MTU
the MSS value in the TCP connection structure).
config NET_SLIP_TCP_RECVWNDO
int "SLIP TCP receive window size"
default 256
depends on NET_SLIP && NET_TCP
---help---
The size of the advertised receiver's window. Should be set low
(i.e., to the size of the MSS) if the application is slow to process
incoming data, or high (32768 bytes) if the application processes
data quickly.
config NET_GUARDSIZE
int "Driver I/O guard size"
default 2
@ -215,11 +184,6 @@ config NET_TUN_MTU
default 296
range 296 1518
config NET_TUN_TCP_RECVWNDO
int "TUN TCP receive window size"
default 256
depends on NET_TCP
choice
prompt "Work queue"
default LOOPBACK_LPWORK if SCHED_LPWORK

View File

@ -39,7 +39,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <sys/socket.h>
#include <stdio.h>
@ -60,6 +59,8 @@
#include "igmp/igmp.h"
#include "netdev/netdev.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -268,9 +269,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
case NET_LL_LOOPBACK: /* Local loopback */
dev->d_llhdrlen = 0;
dev->d_mtu = NET_LO_MTU;
#ifdef CONFIG_NET_TCP
dev->d_recvwndo = NET_LO_TCP_RECVWNDO;
#endif
devfmt = NETDEV_LO_FORMAT;
break;
#endif
@ -279,9 +277,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
case NET_LL_ETHERNET: /* Ethernet */
dev->d_llhdrlen = ETH_HDRLEN;
dev->d_mtu = CONFIG_NET_ETH_MTU;
#ifdef CONFIG_NET_TCP
dev->d_recvwndo = CONFIG_NET_ETH_TCP_RECVWNDO;
#endif
devfmt = NETDEV_ETH_FORMAT;
break;
#endif
@ -290,9 +285,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
case NET_LL_IEEE80211: /* IEEE 802.11 */
dev->d_llhdrlen = ETH_HDRLEN;
dev->d_mtu = CONFIG_NET_ETH_MTU;
#ifdef CONFIG_NET_TCP
dev->d_recvwndo = CONFIG_NET_ETH_TCP_RECVWNDO;
#endif
devfmt = NETDEV_WLAN_FORMAT;
break;
#endif
@ -301,12 +293,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
case NET_LL_BLUETOOTH: /* Bluetooth */
dev->d_llhdrlen = BLUETOOTH_MAX_HDRLEN; /* Determined at runtime */
#ifdef CONFIG_NET_6LOWPAN
# warning Missing logic
dev->d_mtu = CONFIG_NET_6LOWPAN_MTU;
#ifdef CONFIG_NET_TCP
# warning Missing logic
dev->d_recvwndo = CONFIG_NET_6LOWPAN_TCP_RECVWNDO;
#endif
#endif
devfmt = NETDEV_BNEP_FORMAT;
break;
@ -318,9 +305,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
dev->d_llhdrlen = 0; /* Determined at runtime */
#ifdef CONFIG_NET_6LOWPAN
dev->d_mtu = CONFIG_NET_6LOWPAN_MTU;
#ifdef CONFIG_NET_TCP
dev->d_recvwndo = CONFIG_NET_6LOWPAN_TCP_RECVWNDO;
#endif
#endif
devfmt = NETDEV_WPAN_FORMAT;
break;
@ -330,9 +314,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
case NET_LL_SLIP: /* Serial Line Internet Protocol (SLIP) */
dev->d_llhdrlen = 0;
dev->d_mtu = CONFIG_NET_SLIP_MTU;
#ifdef CONFIG_NET_TCP
dev->d_recvwndo = CONFIG_NET_SLIP_TCP_RECVWNDO;
#endif
devfmt = NETDEV_SLIP_FORMAT;
break;
#endif
@ -342,9 +323,6 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
dev->d_llhdrlen = 0; /* This will be overwritten by tun_ioctl
* if used as a TAP (layer 2) device */
dev->d_mtu = CONFIG_NET_TUN_MTU;
#ifdef CONFIG_NET_TCP
dev->d_recvwndo = CONFIG_NET_TUN_TCP_RECVWNDO;
#endif
devfmt = NETDEV_TUN_FORMAT;
break;
#endif

View File

@ -302,16 +302,6 @@ config NET_6LOWPAN_MTU
sizes. Without fragmentation support, the MTU is equal to the frame
size and that has already been selected.
config NET_6LOWPAN_TCP_RECVWNDO
int "6LoWPAN TCP receive window size"
default 1220
depends on NET_TCP
---help---
The size of the advertised receiver's window. Should be set low
(i.e., to the size of the IEEE802.15.4 MTU or frame payload) if
the application is slow to process incoming data, or high (32768
bytes) if the application processes data quickly.
config NET_6LOWPAN_DUMPBUFFER
bool "Enable dumping of buffer data"
default n

View File

@ -269,12 +269,12 @@ static int sixlowpan_tcp_header(FAR struct tcp_conn_s *conn,
{
/* Update the TCP received window based on I/O buffer availability */
tcp_update_recvwindws(dev);
uint16 recvwndo = tcp_get_recvwindow(dev);
/* Set the TCP Window */
ipv6tcp->tcp.wnd[0] = ((NET_DEV_RCVWNDO(dev)) >> 8);
ipv6tcp->tcp.wnd[1] = ((NET_DEV_RCVWNDO(dev)) & 0xff);
ipv6tcp->tcp.wnd[0] = recvwndo >> 8;
ipv6tcp->tcp.wnd[1] = recvwndo & 0xff;
}
/* Calculate TCP checksum. */

View File

@ -174,16 +174,4 @@ config NET_SENDFILE
files out a TCP connection.
endif # NET_TCP && !NET_TCP_NO_STACK
config NET_TCP_RWND_CONTROL
bool "Receive window control based on IOBuffer"
default n
depends on NET_READAHEAD
---help---
Support receive window control based on I/O buffer. This feature
is still experimental.
This feature, if enabled, will assume that the every IOB is
available for read-ahead storage of TCP packets.
endmenu # TCP/IP Networking

View File

@ -62,15 +62,12 @@ ifeq ($(CONFIG_NET_TCPPROTO_OPTIONS),y)
SOCK_CSRCS += tcp_setsockopt.c tcp_getsockopt.c
endif
ifeq ($(CONFIG_NET_TCP_RWND_CONTROL),y)
SOCK_CSRCS += tcp_recvwindow.c
endif
# Transport layer
NET_CSRCS += tcp_conn.c tcp_seqno.c tcp_devpoll.c tcp_finddev.c tcp_timer.c
NET_CSRCS += tcp_send.c tcp_input.c tcp_appsend.c tcp_listen.c
NET_CSRCS += tcp_monitor.c tcp_callback.c tcp_backlog.c tcp_ipselect.c
NET_CSRCS += tcp_recvwindow.c
# TCP write buffering

View File

@ -1356,24 +1356,20 @@ int tcp_getsockopt(FAR struct socket *psock, int option,
#endif
/****************************************************************************
* Name: tcp_update_recvwindws
* Name: tcp_get_recvwindow
*
* Description:
* Update the TCP receive window for the specified device.
* Calculate the TCP receive window for the specified device.
*
* Input Parameters:
* dev - The device whose TCP receive window will be updated.
*
* Returned Value:
* None.
* The value of the TCP receive window to use.
*
****************************************************************************/
#ifdef CONFIG_NET_TCP_RWND_CONTROL
void tcp_update_recvwindws(FAR struct net_driver_s *dev);
#else
# define tcp_update_recvwindws(dev)
#endif
uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev);
/****************************************************************************
* Name: psock_tcp_cansend

View File

@ -51,31 +51,32 @@
#include "tcp/tcp.h"
#ifdef CONFIG_NET_TCP_RWND_CONTROL
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: tcp_update_recvwindws
* Name: tcp_get_recvwindow
*
* Description:
* Update the TCP receive window for the specified device.
* Calculate the TCP receive window for the specified device.
*
* Input Parameters:
* dev - The device whose TCP receive window will be updated.
*
* Returned Value:
* None.
* The value of the TCP receive window to use.
*
****************************************************************************/
void tcp_update_recvwindws(FAR struct net_driver_s *dev)
uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev)
{
uint16_t iplen;
uint16_t overhead;
uint16_t mss;
uint16_t recvwndo;
#ifdef CONFIG_NET_TCP_READAHEAD
int navail;
#endif
#ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_IPv4
@ -95,22 +96,49 @@ void tcp_update_recvwindws(FAR struct net_driver_s *dev)
}
#endif /* CONFIG_NET_IPv4 */
/* Update the TCP received window based on I/O buffer availability
/* Calculate the packet MSS.
*
* REVISIT: The actual TCP header length is varialble. TCP_HDRLEN
* REVISIT: The actual TCP header length is variable. TCP_HDRLEN
* is the minimum size.
*/
overhead = NET_LL_HDRLEN(dev) + iplen + TCP_HDRLEN;
navail = iob_navail();
mss = dev->d_mtu - (NET_LL_HDRLEN(dev) + iplen + TCP_HDRLEN);
#ifdef CONFIG_NET_TCP_READAHEAD
/* Update the TCP received window based on read-ahead I/O buffer
* availability.
*/
navail = iob_navail();
/* Are the read-ahead allocations throttled? If so, then not all of these
* IOBs are available for read-ahead buffering.
*
* REVISIT: Should also check that there is at least one available IOB
* chain.
*/
#if CONFIG_IOB_THROTTLE > 0
if (navail > CONFIG_IOB_THROTTLE)
{
navail -= CONFIG_IOB_THROTTLE;
}
else
{
navail = 0;
}
#endif
/* Are there any IOBs available for read-ahead buffering? */
if (navail > 0)
{
uint32_t rwnd;
/* The optimal TCP window size is the amount of TCP data that we can
* currently buffer via TCP read-ahead buffering minus overhead for the
* link-layer, IP, and TCP headers. This logic here assumes that
* all IOBs are available for TCP buffering.
* currently buffer via TCP read-ahead buffering plus MSS for the
* device packet buffer. This logic here assumes that all IOBs are
* available for TCP buffering.
*
* Assume that all of the available IOBs are can be used for buffering
* on this connection. Also assume that at least one chain is available
@ -123,7 +151,7 @@ void tcp_update_recvwindws(FAR struct net_driver_s *dev)
* buffering for this connection.
*/
rwnd = (navail * CONFIG_IOB_BUFSIZE) - overhead;
rwnd = (navail * CONFIG_IOB_BUFSIZE) + mss;
if (rwnd > UINT16_MAX)
{
rwnd = UINT16_MAX;
@ -131,20 +159,21 @@ void tcp_update_recvwindws(FAR struct net_driver_s *dev)
/* Save the new receive window size */
NET_DEV_RCVWNDO(dev) = (uint16_t)rwnd;
recvwndo = (uint16_t)rwnd;
}
else /* if (navail == 0) */
#endif
{
/* No IOBs are available... fall back to the configured default
* which assumes no write buffering. The only buffering available
* is within the packet buffer itself.
/* No IOBs are available. The only buffering available is within the
* packet buffer itself. We can buffer no more than the MSS (unless
* we are very fast).
*
* NOTE: If no IOBs are available, then the next packet will be
* lost if there is no listener on the connection.
*/
NET_DEV_RCVWNDO(dev) = dev->d_mtu - overhead;
recvwndo = mss;
}
}
#endif /* CONFIG_NET_TCP_RWND_CONTROL */
return recvwndo;
}

View File

@ -359,12 +359,12 @@ static void tcp_sendcommon(FAR struct net_driver_s *dev,
{
/* Update the TCP received window based on I/O buffer availability */
tcp_update_recvwindws(dev);
uint16_t recvwndo = tcp_get_recvwindow(dev);
/* Set the TCP Window */
tcp->wnd[0] = ((NET_DEV_RCVWNDO(dev)) >> 8);
tcp->wnd[1] = ((NET_DEV_RCVWNDO(dev)) & 0xff);
tcp->wnd[0] = recvwndo >> 8;
tcp->wnd[1] = recvwndo & 0xff;
}
/* Finish the IP portion of the message and calculate checksums */