Historically, the loopback driver used the largest packet size of all enabled link layer protocols. This permitted packets to be forward via the loopbak device with no major loss of performance. However, in experimenting with configurations where no other link layer protocols were enabled, this means the loopback packet size was set to the smallest possible size, to the SLIP minimum of 296 bytes. This resulted in terrible loopback performance.
This commit adds an option to increase the loopback packet size with the option CONFIG_NET_LOOPBACK_PACKETSIZE.
The loopback driver packet buffer should be quite large. The larger the loopback packet buffer, the better will be TCP performance of the loopback transfers. The Linux loopback device historically used packet buffers of size 16Kb, but that was increased in recent Linux versions to 64Kb. Those sizes may be excessive for resource constrained MCUs, however.
The network still enforces the lower limit that is the maximum packet size of all enabled link layer protocols. But this new option permits the loopback packet size to be increased from that.
* net/Kconfig: Adds CONFIG_NET_LOOPBACK_PKTSIZE option
* include/nuttx/net/netconfig.h: Assures that the packet size that is used is at least as large as the largest packet size of other link layer protocols.
* drivers/net/loopback.c: Use that larger packet size.
* boards/sim/sim/sim/configs/tcploop/defconfig: Set the loopback packet size to 1500
Build nucleo-144/f767-netnsh fail with below error:
In file included from igmp/igmp_initialize.c:54:
./igmp/igmp.h:130:3: error: unknown type name 'sem_t'
130 | sem_t sem; /* Used to wait for message transmission */
| ^~~~~
make[1]: *** [igmp_initialize.o] Error 1
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
1. Remove the unused and unimplemented ipv6_chksum declaration
2. Update NET_ARCH_CHKSUM description to align with the implementation
3. Declare all checksum function prototype regardless CONFIG_NET_ARCH_CHKSUM
4. Remove the CONFIG_NET_ARCH_CHKSUM guard for tcp_ipv[4|6]_chksum
Author: Gregory Nutt <gnutt@nuttx.org>
net/tcp: Fix errors found in build testing.
Recent re-organization moved some functions from net/inet to net/tcp and net/udp. This include references to nxsem_wait(), SEM_PRIO_NONE, and other internal NuttX semaphore functions. These all failed to compile because nuttx/semaphore.h was not included in any of the files.
Author: Alan Carvalho de Assis <acassis@gmail.com>
Run nxstyle against .c and .h files and fix it
Author: Juha Niskanen <juha.niskanen@haltian.com>
Fix typos and some incorrect comments
NuttX follows OpenGroup.org: https://pubs.opengroup.org/onlinepubs/009695399/functions/recv.html :
[EAGAIN] or [EWOULDBLOCK]
The socket's file descriptor is marked O_NONBLOCK and no data is waiting to be received; or MSG_OOB is set and no out-of-band data is available and either the socket's file descriptor is marked O_NONBLOCK or the socket does not support blocking to await out-of-band data.
ETIMEDOUT is not a valid error to be returned from recv() or recvfrom().
Author: chao.an <anchao@xiaomi.com>
net/udp: break the network lock to avoid deadlock
network deadlock when udp sendto() storm is coming
net/close: force wait tx drain to complete
atomic send() and close() will causes data to be discarded directly
Signed-off-by: chao.an <anchao@xiaomi.com>
* fix warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int'
* fix warning: implicit declaration of function 'up_init_exidx'
* tools/nxstyle: Added logic to parse section headers (like Included files, Pre-processor Definitions, etc.) and to assure that the section headers are correct for the file type. Also (1) verify that #include appears only in the 'Included Files' section and that (2) #define only occurs in the Pre-processor definition section.
Right now, there are several places where that rule is not followed. I think most of these are acceptable so these failures only generate warnings, not errors. The warning means that we need to go look at the offending #define or #include and decide if it is a acceptable usage or not.
1.Consolidate absolute to relative timeout conversion into one place(_net_timedwait)
2.Drive the wait timeout logic by net_timedwait instead of devif_timer
This patch help us remove devif_timer(period tick) to save the power in the future.
Change-Id: I534748a5d767ca6da8a7843c3c2f993ed9ea77d4
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
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>
Description:
Fix two warnings found in build testing: (1) Need to include nuttx/semaphore.h
from prototype of nxsem_post() and (2) need to initialize return value of function.
Uninittialized garbage was being returned on success.Fix two warnings found in
build testing: (1) Need to include nuttx/semaphore.h from prototype of
nxsem_post() and (2) need to initialize return value of function.
Uninittialized garbage was being returned on success.
* Simplify EINTR/ECANCEL error handling
1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx
* Unify the void cast usage
1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro