casaroli opened a new pull request, #4063: URL: https://github.com/apache/nuttx-apps/pull/4063
depends-on: apache/nuttx/pull/21906 ## Summary This PR adds `test_pkt_lo_close` to `cmocka_net_pkt` (testing/nettest/pkt). The test opens an `ETH_P_ALL` packet socket on `lo`, sends IPv4 packets to 127.0.0.1 and closes the socket, in 4 rounds. The free IOB count of `/proc/iobinfo` must be the same before and after. In the second set of rounds the test runs above the work queue that sends the packets. With `CONFIG_NET_PKT_WRITE_BUFFERS`, the packets then come back to the socket while `close()` waits for its write buffers to drain. This is the case that apache/nuttx#21906 fixes: before it, these frames stayed queued on the freed connection and their IOBs were lost. `send()` uses `MSG_DONTWAIT`, so lost IOB queue entries give a failed send and not a hang. The test skips when `/proc/iobinfo` is not there. ## Impact One new test case in `cmocka_net_pkt`. No new Kconfig option: `TESTING_NET_PKT` already builds the program. No change to the other cases. ## Testing | Configuration | nuttx master 10ef71be55c | with apache/nuttx#21906 (a9001d95393) | |---|---|---| | qemu-armv8a:nsh (flat, HVF), NET_PKT + write buffers + NET_LOOPBACK | `test_pkt_lo_close` FAILED: 16 IOBs lost | OK | | rv-virt:citest (flat rv32, TCG) with the defconfig of apache/nuttx#TBD | `test_pkt_lo_close` FAILED: 4 IOBs lost | OK | Both configurations: `test_pkt_lo_send` OK and `test_pkt_lo_frag` SKIPPED (no NET_IPFRAG), on master and with the fix. The NTFC form of the command, `cmocka -s cmocka_net_pkt -t test_pkt_lo_close`, gives the same results. ostest on qemu-armv8a:nsh with the fix: exit status 0. checkpatch: `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]
