casaroli opened a new pull request, #4096: URL: https://github.com/apache/nuttx-apps/pull/4096
## Summary depends-on: apache/nuttx/pull/22089 Add `test_tcp_loopback_bulk` to `cmocka_net_tcp`: a thread sends 4 MiB over 127.0.0.1 with blocking `send()` calls, and the test thread reads them. The sender fills its write buffers, so the received data must find IOBs while the write buffers hold most of the pool. All bytes must arrive in order within 30 s. Since apache/nuttx@ea5d2c9ae49 (apache/nuttx#22000), the receiver drops every segment in this case and the transfer stops (apache/nuttx#ISSUE). apache/nuttx#22089 fixes it; this case checks it. The case does not hang when the transfer stops: both sockets have 1 s send and receive time-outs, the case ends at the time limit or at the first error (on master: `ECONNRESET` after about 13 s), and the sender thread always stops before the case returns. The case runs first in `cmocka_net_tcp`. When it ran after the other cases, its first `recv()` failed with `EBUSY` (no free devif callback; `CONFIG_NET_PREALLOC_DEVIF_CALLBACKS` is 16 by default), also 130 s later. ## Impact Test only: one new file `testing/nettest/tcp/test_tcp_bulk.c`, built by Make and CMake with `CONFIG_NET_IPv4` as the other IPv4 cases; `test_tcp.c` lists the case with `CONFIG_NET_SOCKOPTS` (the time-outs). No CI configuration builds `cmocka_net_tcp` (`rv-virt:citest`, the only one with the network tests, has no TCP). ## Testing qemu-armv8a under HVF, `CONFIG_NET_TCP_WRITE_BUFFERS`, 96 IOBs of 196 bytes, `IOB_THROTTLE` 8, `cmocka_net_tcp` twice per boot (the second run 130 s after the first), NuttX master ed122374690: | NuttX | `test_tcp_loopback_bulk` | |---|---| | master, knsh 1 CPU | FAIL in 2 of 2 runs: `ECONNRESET` after 23330 bytes, 13 s | | master, knsh 4 CPUs | FAIL in 4 of 4 runs (2 boots): `ECONNRESET` after 70 KB to 2 MB, 12 to 13 s | | master, flat qemu-armv8a:nsh | FAIL: `ECONNRESET` after 23330 bytes | | with apache/nuttx#22089, knsh 1 and 4 CPUs, flat | PASS in every run | | master without TCP write buffers | PASS | | 9df78aa1e69 (before apache/nuttx#22000), 1 MiB version | PASS | | ea5d2c9ae49, 1 MiB version | FAIL at the 30 s limit: 63008 bytes received | The other cases of `cmocka_net_tcp` give the same results with and without this commit (`test_tcp_connect_ipv4` and the group teardown fail with `ECONNREFUSED` in this configuration on all versions). ostest: status 0. Builds in the NuttX CI image (`EXTRAFLAGS="-Wno-cpp -Werror"`), with apache/nuttx#22089: qemu-armv8a:netnsh with write buffers and the TCP nettest (Make and CMake) and sim:tcpblaster with the TCP nettest: OK, 0 warnings. In the kernel build the case is built with the applications of the knsh runs above. `tools/checkpatch.sh -c -u -m -g` passes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
