Commit Graph

13 Commits

Author SHA1 Message Date
Alin Jerpelea 37d5c1b0d9 net: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-20 00:38:18 -08:00
chao.an 234d3df19f net/tcp: correct the available iobs count if throttle is enabled
The number of available iobs is already sub in iob_navail(true) on line 114

net/tcp/tcp_recvwindow.c:
...
 73 uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev)
...
114   niob_avail    = iob_navail(true);

Change-Id: I230927904d8db08ed8d95d7fa18c5c5fce08aa5e
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 23:24:44 -06:00
chao.an 4305718691 net/tcp: fix nxstyle warnings
Change-Id: Id885fefc80caa12806c73778e632c8b0c5888be0
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 00:03:47 -06:00
chao.an bf21056001 net/tcp: fallback to unthrottle pool to avoid deadlock
Add a fallback mechanism to ensure that there are still available
iobs for an free connection, Guarantees all connections will have
a minimum threshold iob to keep the connection not be hanged.

Change-Id: I59bed98d135ccd1f16264b9ccacdd1b0d91261de
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 00:03:47 -06:00
Xiang Xiao 346336bb9e Make the read ahead buffer unselectable
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>
2020-01-11 08:24:49 -06:00
Gregory Nutt dec7ecbd56 net/tcp/tcp_recvwindow.c: In order to receive data we must not only have IOBs available, but we must also have at least one IOB chain qentry available. Otherwise, we will advertise that we an buffer a lot of data when, in fact, we cannot. This is an expermental fix to a performance problem noted by Masayuki Ishikawa. 2018-09-22 09:33:29 -06:00
Gregory Nutt b3f0aab00a Squashed commit of the following:
sched/wqueue/kwork_notifier.c:  Redesign some data structures.  struct works_s must appear at the beginning of the notifier entry structure.  That is because it contains the work queue indices.  This solves a harfault issue.

    net/tcp/tcp_netpoll.c:  tcp_iob_work() needs to free the allocated argument when it is finished.

    net/tcp/tcp_send_buffered.c:  Extend psock_tcp_cansend() so that it also requires that at least on IOB is also avaialble.

    mm/iob:  iob_navail() was returning the number of free IOB chain queue entries, not the number of free IOBs.  Completely misnamed.

    net/tcp/tcp_netpoll.c:  Add logic to receive notifications when IOBs are freed (Needs CONFIG_NET_TCP_WRITE_BUFFERS and CONFIG_IOB_NOTIFIER).  At present, does nothing because the logic in in psock_tcp_cansend() does not check for the availability of IOBs.  That will change.
2018-09-12 08:57:06 -06:00
Gregory Nutt 76eec53e4f mm/iob: iob_navail() was returning the number of free IOB chain queue entries, not the number of free IOBs. Completely misnamed. 2018-09-12 06:40:18 -06:00
Gregory Nutt 5764d5a529 net/tcp: Back out part of commit d944388888. I see a few places that say that the maximum receive window size is 32,767 (INT16_MAX), but most say that it is 65,535 (UINT16_MAX). 2018-07-05 17:41:01 -06:00
Gregory Nutt d944388888 configs/viewtool-stm32f107: Add a TCP performance test using apps/examples/tcpblaster. 2018-07-05 16:08:03 -06:00
Gregory Nutt 22cd0d47fa This commit attempts remove some long standard confusion in naming and some actual problems that result from the naming confusion. The basic problem is the standard MTU does not include the size of the Ethernet header. For clarity, I changed the naming of most things called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE.
This makes the user interface a little hostile.  People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header).  A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length.  Instead, we define the packet buffer size then derive the MTU.

The MTU is not common currency in networking.  On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP).  Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes.  So we should be all good and without the recurring 14 byte error in MTU's and MSS's.

Squashed commit of the following:

    Trivial update to fix some spacing issues.
    net/: Rename several macros containing _MTU to _PKTSIZE.
    net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE.  This is not the MTU which does not include the size of the link layer header.  This is the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename the file d_mtu in the network driver structure to d_pktsize.  That value saved there is not the MTU.  The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header.  The MTU does not include the link layer header.
2018-07-04 14:10:40 -06:00
Gregory Nutt e59b26370d 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.
2018-07-01 07:59:33 -06:00
Gregory Nutt b32d8b1714 net/tcp and sixlowpan: Separate the the TCP receive window calculations to a separate header file. It must also be used by the special 6LoWPAN TCP logic. 2018-06-30 20:50:07 -06:00