casaroli opened a new pull request, #4143: URL: https://github.com/apache/nuttx-apps/pull/4143
## Summary With `CONFIG_TESTING_NET_TCP=y` and `CONFIG_NET_SOLINGER=n`, `cmocka_net_tcp` does not build with `-Werror`: `tcp/test_tcp_backlog.c:234: error: 'tcp_backlog_port' defined but not used`. Only the cases under `CONFIG_NET_SOLINGER` call `tcp_backlog_port()` (from #4106) and `tcp_close_lo()` (from #4086). The first commit puts each helper under the same condition as the cases that use it. `test_tcp_close_timewait` (from #4086) fails with the default buffer sizes: `216 != 512` at `test_tcp_close.c:665`. The case sends 16 KiB with blocking `send()` before the server reads. Since apache/nuttx#22089, a connection queues by default only 1/8 of the IOBs above the throttle in its write buffers and in its read-ahead. With 96 IOBs of 196 bytes that is 2156 + 2156 = 4312 bytes, so `send()` blocks until `SO_SNDTIMEO` and returns 216. The second commit fills the window of the server and the write queue of the client with `tcp_close_fill()`, as `test_tcp_close_shutdown_queued` does. The case then works for every buffer size. ## Impact Test only (`testing/nettest/tcp`). No change to the cases that run, except the data size of `test_tcp_close_timewait`. ## Testing Built in the NuttX CI image (`ghcr.io/apache/nuttx/apache-nuttx-ci-linux`, `-Wno-cpp -Werror`), nuttx master d729a200002 with `CONFIG_TESTING_NET_TCP=y` and the TCP options it needs: - `qemu-armv8a:knsh` (kernel, make + export/import), `NET_SOLINGER=n` and `=y`: OK. apps master with `NET_SOLINGER=n`: `'tcp_backlog_port' defined but not used`. - `qemu-armv8a:nsh` (flat), `NET_SOLINGER=n`: OK. - `qemu-intel64:knsh_romfs` (kernel, CMake, gcc 12.3), `NET_SOLINGER=n` and `=y`: OK. - `rv-virt:citest` as it is: OK. `cmocka_net_tcp` with 96 IOBs of 196 bytes and `CONFIG_NET_PREALLOC_DEVIF_CALLBACKS=64`: - `qemu-armv8a:knsh`, QEMU TCG: `NET_SOLINGER=n` 29/29, `=y` 36/36 pass. apps master (`=y`): `test_tcp_close_timewait` fails with `216 != 512`, 35/36. - `qemu-intel64:knsh_romfs`, QEMU KVM: `test_tcp_close_timewait` passes with this change and fails on apps master. `test_tcp_reset_send` fails on x86_64 before and after this change (no SIGPIPE in the handler, `test_tcp_reset.c:520`). With the default of 16 devif callbacks, `shutdown()`, `send()` and `poll()` in later cases fail with `EBUSY` (`POLLERR` from `poll()`) before and after this change: the callbacks are all in use. These cases pass with 64 callbacks. -- 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]
