Commit Graph

2066 Commits

Author SHA1 Message Date
chao.an 1cd39d813f net/dev: check the available address further
check the available address further to avoid obtain unusable device

Change-Id: Icdd91cf0c4cb158f00a49f74d054425c2aeacd14
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-20 16:33:43 +08:00
chao.an 043c92fedd net/tcp: only print the error when disable the TCP_NODELAY
Since we do not have the Nagle's algorithm,
the TCP_NODELAY socket option is enabled by default.

Change-Id: I0c8619bb06cf418f7eded5bd72ac512b349cacc5
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-18 18:21:55 +08:00
chao.an 4e77f7cf9f net/tcp: change the log level to warning if iob_tryalloc fail
Change-Id: I544d8132ba89eebd9f29e793307010a35d9c161e
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-18 18:18:10 +08:00
chao.an 1a0a0e84a0 net/ipv4: bypass the udp drop and filter the packet from udp stack
Change-Id: I00055a6e930e2a0d9b1a8bd8929c5eb4e045c0d1
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-18 18:15:32 +08:00
ligd 365df8d188 net/rpmsg/rpmsg_sockif.c: fix compile error in socketrpmsg
Change-Id: Ibbc62826317e204c49c744d1fb125da7b54eb7a3
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-01-07 14:17:03 +08:00
ligd 91de680de8 net/rpmsg/rpmsg_sockif.c: fix temporary sendsize is 0 bug
Change-Id: I4348fab159eda7e015340ea8067ff7866105bdd5
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-01-07 11:09:51 +08:00
chao.an b7100ed99a net/rpmsg: correct the lifecycle of sendlock
Change-Id: Ie23ee4c0052cf2fc66972ea9bc5f11c070fbcf8a
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-29 18:45:57 +08:00
chao.an be88bb00ca net/tcp/handshake: send the SYN immediately.
Change-Id: I761cff3b9950b75327fa03fb53b861ea088d8b35
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-15 21:41:29 +08:00
chao.an ede54cad35 net/tcp: send the ack on nonblock mode
Change-Id: Ib5b74a97393c3fed4cc00c3678d738c1cb27ce1a
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-15 21:41:10 +08:00
ligd 9ac98f21dc net/rpmsgsocket: fix connect timeout when remote not ready
force connect to block mode

Change-Id: I458f806411c93def0e64596f8e1c1680c485b298
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-12-11 15:01:59 +08:00
ligd 4c7124ae6c socket_rpmsg: correct return values when type is DGRAM
Change-Id: I299686769616894e919eaa7a5727494aed92a302
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-12-10 16:39:03 +08:00
chao.an ed99d43735 [Performance]net/tcp: send the ACK in time after obtain ahead buffer from iobs
Request the TCP ACK to estimate the receive window after handle
any data already buffered in a read-ahead buffer.

Change-Id: Id998a1125dd2991d73ba4bef081ddcb7adea4f0d
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-07 14:50:38 +08:00
chao.an 6a206d87a1 net/tcp: add a member to record the current receiving window
Change-Id: Ic4c46d643a905fdd3a828e563eab4814da70dbe5
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-07 14:44:55 +08:00
chao.an 11385f64d3 net/tcp: rename the winszie to snd_wnd to make the semantics more accurate
Change-Id: I8fdc7cf78a7f2cd53a30ef1de702b1a697c43238
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-07 14:20:34 +08:00
chao.an 46df08ba31 net/setsockopt/IP_MULTICAST_TTL: add handles of different prototypes
Reference here:
https://github.com/torvalds/linux/blob/b3298500b23f0b53a8d81e0d5ad98a29db71f4f0/net/ipv4/ip_sockglue.c#L923-L932

Change-Id: Iad67c756eb549d969bd7a8ffe965d9b1dcc56988
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-05 18:18:49 +08:00
chao.an 49f50e7169 net/igmp: fix nxstyle warning
Change-Id: I6bb84038e035b81ea66b128ebf109f4a392ee6ab
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-05 15:33:21 +08:00
ligd fe996fc69c socket_rpmsg: add socket rpmsg support
N/A

Change-Id: I1e18a0b3d643e5b74b86624ef245f19ef616bc61
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-12-04 20:36:24 +08:00
chao.an af1da5e047 net/igmp: add MULTICAST_TTL support
Change-Id: Ic8c9a4f4f9b1ebf9858fa5368c6c75e949de6800
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-02 16:40:24 +08:00
chao.an d45b4324ab net/sockopt: Try usrsock further if the protocol not available
fallback to usrsock if the features are not implemented locally

Change-Id: I46e2d6452d7edd3fa5b3d508945511cd48f22ebb
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-01 20:08:40 +08:00
chao.an 753ecb6ae1 net/sockopt: fix invalid option set
fix invalid option set if enable UDP without TCP

Change-Id: I732893501a9b28749706d6f860c77ae9e14b358c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-01 20:08:35 +08:00
chao.an 8ee9b0f6d5 net/procfs: handle opendir("/proc/net/") correctly
Change-Id: I092bade082ba673b30257add4f869ac5bfa55ca6
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-01 15:12:24 +08:00
chao.an 96df173097 net/igmp: add sanity check to handle allocate fail
Change-Id: Ia3128c9c2b219345fb6ac2789ece7760c6aee663
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-30 15:14:04 +08:00
chao.an 90dc86655c style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-30 11:20:05 +08:00
chao.an cb1ab6df02 net/inet: fix nxstyle warnings
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-27 11:57:14 +08:00
chao.an f4a530edd2 net/tcp: fix nxstyle warnings
Change-Id: Id885fefc80caa12806c73778e632c8b0c5888be0
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-27 11:07:28 +08:00
chao.an 3e21a06676 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-27 11:07:12 +08:00
chao.an c64ed0cc03 igmp: bypass MULTICAST_LOOP/TTL options
Signed-off-by: chao.an <anchao@xiaomi.com>
Change-Id: I4c8064283327b04ece2037419e2693e8ae3abaab
2020-11-27 10:46:26 +08:00
chao.an 19ba85c492 net/tcp: implement the fast retransmit
RFC2001: TCP Slow Start, Congestion Avoidance, Fast Retransmit,
         and Fast Recovery Algorithms

...

3.  Fast Retransmit
  Modifications to the congestion avoidance algorithm were proposed in
  1990 [3].  Before describing the change, realize that TCP may
  generate an immediate acknowledgment (a duplicate ACK) when an out-
  of-order segment is received (Section 4.2.2.21 of [1], with a note
  that one reason for doing so was for the experimental fast-
  retransmit algorithm).  This duplicate ACK should not be delayed.
  The purpose of this duplicate ACK is to let the other end know that a
  segment was received out of order, and to tell it what sequence
  number is expected.

  Since TCP does not know whether a duplicate ACK is caused by a lost
  segment or just a reordering of segments, it waits for a small number
  of duplicate ACKs to be received.  It is assumed that if there is
  just a reordering of the segments, there will be only one or two
  duplicate ACKs before the reordered segment is processed, which will
  then generate a new ACK.  If three or more duplicate ACKs are
  received in a row, it is a strong indication that a segment has been
  lost.  TCP then performs a retransmission of what appears to be the
  missing segment, without waiting for a retransmission timer to
  expire.

Change-Id: Ie2cbcecab507c3d831f74390a6a85e0c5c8e0652
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-26 20:49:38 +08:00
chao.an 07d5538ed5 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-26 20:04:01 +08:00
liuhaitao c24f178af7 Merge remote-tracking branch 'mirtos/master' into dev
Change-Id: I85394b24ce27d20ecbb130b85d844ab540507031
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-11-25 14:44:27 +08:00
chao.an c08ac2e35d net/icmp: add sanity check to avoid wild data length
MIRTOS-267

net device buffer overflow if the icmp packet is too large

Change-Id: If0e6c039b99e064a122672d64eb057347ae3c053
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-24 15:45:51 +08:00
YAMAMOTO Takashi ee1c914277 net/tcp/tcp_input.c: Fix syslog formats 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi bfff9e5691 net/igmp/igmp_poll.c: Fix syslog formats
The following nxstyle errors are known.
They are a part of the copyright notice.

net/igmp/igmp_poll.c:22:82: error: Long line found
net/igmp/igmp_poll.c:29:82: error: Long line found
2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi 79d2a4b82b net/igmp/igmp_mcastmac.c: Fix syslog formats
The following nxstyle errors are known.
They are a part of the copyright notice.

net/igmp/igmp_mcastmac.c:22:82: error: Long line found
net/igmp/igmp_mcastmac.c:29:82: error: Long line found
2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi a403e6eec2 net/igmp/igmp_join.c: Fix a syslog format 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi ffe29f9025 net/igmp/igmp_join.c: Appease nxstyle
The following nxstyle errors are intentionally left
because they are a part of the copyright notice.

net/igmp/igmp_join.c:22:82: error: Long line found
net/igmp/igmp_join.c:29:82: error: Long line found
2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi d6e87d7f40 net/igmp/igmp_input.c: Fix a syslog format 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi 70a964bdcb net/igmp/igmp_group.c: Fix syslog formats 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi b7be6047bb net/sixlowpan/sixlowpan_send.c: Fix a syslog format 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi dcfe08d227 net/sixlowpan/sixlowpan_tcpsend.c: Fix syslog formats 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi d4b5684eba net/sixlowpan/sixlowpan_framelist.c: Fix syslog formats 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi d5a5b6979d net/sixlowpan/sixlowpan_framelist.c: Appease nxstyle 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi 3ed096cc08 net/bluetooth/bluetooth_sendto.c: Fix a syslog format 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi d851cd9322 net/bluetooth/bluetooth_sockif.c: Fix syslog formats 2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi 28fda4e5bb net/tcp/tcp_send_unbuffered.c: Fix syslog formats 2020-11-23 05:00:10 -08:00
Matias N d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
YAMAMOTO Takashi 8cb6790cef net/tcp/tcp_send_unbuffered.c: Fix a syslog format 2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi 8a23f98233 net/tcp/tcp_wrbuffer_dump.c: Fix a syslog format 2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi bf9b36cf92 net/local/local_sockif.c: Fix a syslog format error 2020-11-20 22:22:53 -08:00
YAMAMOTO Takashi 49055bc638 net/local/local_sendpacket.c: Fix a syslog format error 2020-11-20 22:22:53 -08:00