From e59b26370da966f92c1dea2e02c669bc32572794 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 1 Jul 2018 07:59:33 -0600 Subject: [PATCH] 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. --- configs/bambino-200e/netnsh/defconfig | 1 - configs/dk-tm4c129x/README.txt | 1 - configs/dk-tm4c129x/ipv6/defconfig | 1 - configs/freedom-k64f/README.txt | 1 - configs/freedom-k66f/README.txt | 1 - configs/lc823450-xgevk/bt/defconfig | 3 - configs/lc823450-xgevk/rndis/defconfig | 2 - configs/lm3s6965-ek/tcpecho/defconfig | 1 - configs/misoc/hello/defconfig | 1 - configs/moxa/nsh/defconfig | 1 - configs/olimex-lpc1766stk/ftpc/defconfig | 1 - configs/olimex-stm32-p107/nsh/defconfig | 1 - configs/sam4e-ek/README.txt | 1 - configs/sama5d3-xplained/README.txt | 1 - configs/sama5d3x-ek/README.txt | 1 - configs/sama5d4-ek/README.txt | 1 - configs/sama5d4-ek/ipv6/defconfig | 1 - configs/sama5d4-ek/nsh/defconfig | 1 - configs/sama5d4-ek/nxwm/defconfig | 1 - configs/same70-xplained/README.txt | 1 - .../mrf24j40-starhub/defconfig | 1 - configs/samv71-xult/README.txt | 1 - .../samv71-xult/mrf24j40-starhub/defconfig | 1 - configs/shenzhou/thttpd/defconfig | 1 - configs/sim/pktradio/defconfig | 1 - configs/sim/sixlowpan/defconfig | 1 - configs/stm3240g-eval/discover/defconfig | 1 - configs/stm32f4discovery/ipv6/defconfig | 1 - configs/tm4c1294-launchpad/ipv6/defconfig | 1 - configs/twr-k64f120m/README.txt | 1 - configs/viewtool-stm32f107/README.txt | 1 - configs/viewtool-stm32f107/netnsh/defconfig | 1 - include/nuttx/net/netconfig.h | 36 --------- include/nuttx/net/netdev.h | 4 - net/Kconfig | 36 --------- net/netdev/netdev_register.c | 26 +------ net/sixlowpan/Kconfig | 10 --- net/sixlowpan/sixlowpan_tcpsend.c | 6 +- net/tcp/Kconfig | 12 --- net/tcp/Make.defs | 5 +- net/tcp/tcp.h | 12 +-- net/tcp/tcp_recvwindow.c | 73 +++++++++++++------ net/tcp/tcp_send.c | 6 +- 43 files changed, 64 insertions(+), 197 deletions(-) diff --git a/configs/bambino-200e/netnsh/defconfig b/configs/bambino-200e/netnsh/defconfig index 09c7ed325a..9dfc80b2ff 100644 --- a/configs/bambino-200e/netnsh/defconfig +++ b/configs/bambino-200e/netnsh/defconfig @@ -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 diff --git a/configs/dk-tm4c129x/README.txt b/configs/dk-tm4c129x/README.txt index 0efdca5dfb..be5befc6aa 100644 --- a/configs/dk-tm4c129x/README.txt +++ b/configs/dk-tm4c129x/README.txt @@ -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 diff --git a/configs/dk-tm4c129x/ipv6/defconfig b/configs/dk-tm4c129x/ipv6/defconfig index ead5064e19..68df6f36c3 100644 --- a/configs/dk-tm4c129x/ipv6/defconfig +++ b/configs/dk-tm4c129x/ipv6/defconfig @@ -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 diff --git a/configs/freedom-k64f/README.txt b/configs/freedom-k64f/README.txt index c706e95499..72fdbc9326 100644 --- a/configs/freedom-k64f/README.txt +++ b/configs/freedom-k64f/README.txt @@ -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 diff --git a/configs/freedom-k66f/README.txt b/configs/freedom-k66f/README.txt index 50ff26bd4a..b8b71e72c1 100644 --- a/configs/freedom-k66f/README.txt +++ b/configs/freedom-k66f/README.txt @@ -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 diff --git a/configs/lc823450-xgevk/bt/defconfig b/configs/lc823450-xgevk/bt/defconfig index c985f9292a..500e4317d5 100644 --- a/configs/lc823450-xgevk/bt/defconfig +++ b/configs/lc823450-xgevk/bt/defconfig @@ -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 diff --git a/configs/lc823450-xgevk/rndis/defconfig b/configs/lc823450-xgevk/rndis/defconfig index 8319197bcf..9ccd05a2fd 100644 --- a/configs/lc823450-xgevk/rndis/defconfig +++ b/configs/lc823450-xgevk/rndis/defconfig @@ -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 diff --git a/configs/lm3s6965-ek/tcpecho/defconfig b/configs/lm3s6965-ek/tcpecho/defconfig index f7c59d120c..54bf4f17eb 100644 --- a/configs/lm3s6965-ek/tcpecho/defconfig +++ b/configs/lm3s6965-ek/tcpecho/defconfig @@ -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 diff --git a/configs/misoc/hello/defconfig b/configs/misoc/hello/defconfig index 5607edbdf8..4bcde5e370 100644 --- a/configs/misoc/hello/defconfig +++ b/configs/misoc/hello/defconfig @@ -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 diff --git a/configs/moxa/nsh/defconfig b/configs/moxa/nsh/defconfig index 6f94c78203..731c98226e 100644 --- a/configs/moxa/nsh/defconfig +++ b/configs/moxa/nsh/defconfig @@ -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 diff --git a/configs/olimex-lpc1766stk/ftpc/defconfig b/configs/olimex-lpc1766stk/ftpc/defconfig index 474921ead9..f58051f8fa 100644 --- a/configs/olimex-lpc1766stk/ftpc/defconfig +++ b/configs/olimex-lpc1766stk/ftpc/defconfig @@ -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 diff --git a/configs/olimex-stm32-p107/nsh/defconfig b/configs/olimex-stm32-p107/nsh/defconfig index 8f3bbf0715..3bf8c1233f 100644 --- a/configs/olimex-stm32-p107/nsh/defconfig +++ b/configs/olimex-stm32-p107/nsh/defconfig @@ -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 diff --git a/configs/sam4e-ek/README.txt b/configs/sam4e-ek/README.txt index 9ec33a15ab..ad56da2e93 100644 --- a/configs/sam4e-ek/README.txt +++ b/configs/sam4e-ek/README.txt @@ -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 diff --git a/configs/sama5d3-xplained/README.txt b/configs/sama5d3-xplained/README.txt index 603f590368..8cdfb2c06b 100644 --- a/configs/sama5d3-xplained/README.txt +++ b/configs/sama5d3-xplained/README.txt @@ -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 diff --git a/configs/sama5d3x-ek/README.txt b/configs/sama5d3x-ek/README.txt index 3c0062a0d3..85aa1e5b16 100644 --- a/configs/sama5d3x-ek/README.txt +++ b/configs/sama5d3x-ek/README.txt @@ -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 diff --git a/configs/sama5d4-ek/README.txt b/configs/sama5d4-ek/README.txt index 62ecb80518..2df2b53e36 100644 --- a/configs/sama5d4-ek/README.txt +++ b/configs/sama5d4-ek/README.txt @@ -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 diff --git a/configs/sama5d4-ek/ipv6/defconfig b/configs/sama5d4-ek/ipv6/defconfig index 86844bdda0..d481e228fd 100644 --- a/configs/sama5d4-ek/ipv6/defconfig +++ b/configs/sama5d4-ek/ipv6/defconfig @@ -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 diff --git a/configs/sama5d4-ek/nsh/defconfig b/configs/sama5d4-ek/nsh/defconfig index 2ca2d53e14..3dd25013f6 100644 --- a/configs/sama5d4-ek/nsh/defconfig +++ b/configs/sama5d4-ek/nsh/defconfig @@ -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 diff --git a/configs/sama5d4-ek/nxwm/defconfig b/configs/sama5d4-ek/nxwm/defconfig index c669a50f4a..2bf2487270 100644 --- a/configs/sama5d4-ek/nxwm/defconfig +++ b/configs/sama5d4-ek/nxwm/defconfig @@ -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 diff --git a/configs/same70-xplained/README.txt b/configs/same70-xplained/README.txt index b9ad71b801..bdce1432cc 100644 --- a/configs/same70-xplained/README.txt +++ b/configs/same70-xplained/README.txt @@ -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 diff --git a/configs/same70-xplained/mrf24j40-starhub/defconfig b/configs/same70-xplained/mrf24j40-starhub/defconfig index 6de99c7e43..a4b6c46bc9 100644 --- a/configs/same70-xplained/mrf24j40-starhub/defconfig +++ b/configs/same70-xplained/mrf24j40-starhub/defconfig @@ -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 diff --git a/configs/samv71-xult/README.txt b/configs/samv71-xult/README.txt index 62730da982..b3425f01eb 100644 --- a/configs/samv71-xult/README.txt +++ b/configs/samv71-xult/README.txt @@ -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 diff --git a/configs/samv71-xult/mrf24j40-starhub/defconfig b/configs/samv71-xult/mrf24j40-starhub/defconfig index 049029fd30..7db0f101a1 100644 --- a/configs/samv71-xult/mrf24j40-starhub/defconfig +++ b/configs/samv71-xult/mrf24j40-starhub/defconfig @@ -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 diff --git a/configs/shenzhou/thttpd/defconfig b/configs/shenzhou/thttpd/defconfig index 2d0454d67d..ad7db17c04 100644 --- a/configs/shenzhou/thttpd/defconfig +++ b/configs/shenzhou/thttpd/defconfig @@ -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 diff --git a/configs/sim/pktradio/defconfig b/configs/sim/pktradio/defconfig index 720129348c..ff62fb1d51 100644 --- a/configs/sim/pktradio/defconfig +++ b/configs/sim/pktradio/defconfig @@ -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 diff --git a/configs/sim/sixlowpan/defconfig b/configs/sim/sixlowpan/defconfig index 0128eabcf2..98093bb8b3 100644 --- a/configs/sim/sixlowpan/defconfig +++ b/configs/sim/sixlowpan/defconfig @@ -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 diff --git a/configs/stm3240g-eval/discover/defconfig b/configs/stm3240g-eval/discover/defconfig index 773b32a086..696f7ac211 100644 --- a/configs/stm3240g-eval/discover/defconfig +++ b/configs/stm3240g-eval/discover/defconfig @@ -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 diff --git a/configs/stm32f4discovery/ipv6/defconfig b/configs/stm32f4discovery/ipv6/defconfig index fcdc3842b5..3fa942a62e 100644 --- a/configs/stm32f4discovery/ipv6/defconfig +++ b/configs/stm32f4discovery/ipv6/defconfig @@ -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 diff --git a/configs/tm4c1294-launchpad/ipv6/defconfig b/configs/tm4c1294-launchpad/ipv6/defconfig index 528571292f..89ce8785d2 100644 --- a/configs/tm4c1294-launchpad/ipv6/defconfig +++ b/configs/tm4c1294-launchpad/ipv6/defconfig @@ -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 diff --git a/configs/twr-k64f120m/README.txt b/configs/twr-k64f120m/README.txt index 4a379a7dae..7b2a05efc6 100644 --- a/configs/twr-k64f120m/README.txt +++ b/configs/twr-k64f120m/README.txt @@ -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 diff --git a/configs/viewtool-stm32f107/README.txt b/configs/viewtool-stm32f107/README.txt index 12c3d6b816..911246cdf6 100644 --- a/configs/viewtool-stm32f107/README.txt +++ b/configs/viewtool-stm32f107/README.txt @@ -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 diff --git a/configs/viewtool-stm32f107/netnsh/defconfig b/configs/viewtool-stm32f107/netnsh/defconfig index 2752311c24..b5a1ef39d2 100644 --- a/configs/viewtool-stm32f107/netnsh/defconfig +++ b/configs/viewtool-stm32f107/netnsh/defconfig @@ -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 diff --git a/include/nuttx/net/netconfig.h b/include/nuttx/net/netconfig.h index 491b920c0e..60886346ff 100644 --- a/include/nuttx/net/netconfig.h +++ b/include/nuttx/net/netconfig.h @@ -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 diff --git a/include/nuttx/net/netdev.h b/include/nuttx/net/netdev.h index e8655ce2b3..105bcaffb3 100644 --- a/include/nuttx/net/netdev.h +++ b/include/nuttx/net/netdev.h @@ -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) diff --git a/net/Kconfig b/net/Kconfig index aec1a6d3d7..97593db6df 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -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 diff --git a/net/netdev/netdev_register.c b/net/netdev/netdev_register.c index 408491413f..9d293905f2 100644 --- a/net/netdev/netdev_register.c +++ b/net/netdev/netdev_register.c @@ -39,7 +39,6 @@ ****************************************************************************/ #include -#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 #include #include @@ -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 diff --git a/net/sixlowpan/Kconfig b/net/sixlowpan/Kconfig index c1889188a8..4fc0bdb9e6 100644 --- a/net/sixlowpan/Kconfig +++ b/net/sixlowpan/Kconfig @@ -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 diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c index 240bf87224..2f449395db 100644 --- a/net/sixlowpan/sixlowpan_tcpsend.c +++ b/net/sixlowpan/sixlowpan_tcpsend.c @@ -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. */ diff --git a/net/tcp/Kconfig b/net/tcp/Kconfig index c11192e81f..f291991343 100644 --- a/net/tcp/Kconfig +++ b/net/tcp/Kconfig @@ -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 diff --git a/net/tcp/Make.defs b/net/tcp/Make.defs index 69a7b6adef..48e8ab29e9 100644 --- a/net/tcp/Make.defs +++ b/net/tcp/Make.defs @@ -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 diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h index df38dddc92..0643e8ac41 100644 --- a/net/tcp/tcp.h +++ b/net/tcp/tcp.h @@ -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 diff --git a/net/tcp/tcp_recvwindow.c b/net/tcp/tcp_recvwindow.c index fe9ee66f46..108165822f 100644 --- a/net/tcp/tcp_recvwindow.c +++ b/net/tcp/tcp_recvwindow.c @@ -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; +} diff --git a/net/tcp/tcp_send.c b/net/tcp/tcp_send.c index 229eaeabed..3a74dbbed2 100644 --- a/net/tcp/tcp_send.c +++ b/net/tcp/tcp_send.c @@ -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 */