Skip to content

TCP low-watermark paths are not measured for coverage and inflate TCP_INFO receive counters #444

Description

@fdesbiens

Two gaps found while reviewing #435. Neither is introduced by that pull request.

Low-watermark code is outside the coverage measurement. No *_coverage profile in test/cmake/netxduo/CMakeLists.txt defines NX_ENABLE_LOW_WATERMARK. Every branch under that option, in _nx_tcp_socket_state_data_check(), _nx_tcp_socket_packet_process() and elsewhere, is therefore never measured. netx_low_watermark_test and netx_tcp_low_watermark_rx_window_test only run their N/A stub in default_build_coverage. #435 enables the option in v4_build and v4_full_build, so the tests now execute, but not in a profile that reports coverage. Adding NX_ENABLE_LOW_WATERMARK to a coverage profile, or adding a low-watermark coverage profile, would close this.

TCP_INFO counters count dropped data as received. In _nx_tcp_socket_state_data_check(), the in-order and empty-queue drop branches release the incoming packet and then fall through to the nx_ip_tcp_packets_received / nx_ip_tcp_bytes_received increments and their per-socket equivalents. When the out-of-order drop branch releases the queue tail, the counts that packet added when it arrived are not taken back. Under low-watermark pressure, nx_tcp_socket_info_get() and nx_tcp_info_get() therefore report more packets and bytes received than were kept. The superset path in the same function already decrements the counters when it releases a queued packet, so the drop paths can do the same.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions