Refactor: unify and fix session statistics counters#1510
Merged
Conversation
Collaborator
DawidWesierski4
left a comment
There was a problem hiding this comment.
Please make sure noctx integration tests are not affected as they will be run in nightly
also please include information about Reset not being thread safe
Collaborator
Author
All noctx tests passed, I made reset thread safe. |
1669b2b to
1d26bb5
Compare
- Fix int/uint32_t -> uint64_t for stat fields in st40_rx and st41_rx - Remove 9 wrong-domain RX fields from st41_tx_user_stats (never set) - Remove stale stat_last_time copy in TX fastmetadata stat dump - Remove redundant stat_pkts_out_of_order_per_port internal counter from all 4 RX session types (already tracked via port_user_stats) - Add per-port out-of-order breakdown for RX video sessions - Use snapshot-based deltas for per-port OOO logging in all sessions - Fix TX video stat_pkts_burst: print before reset (was silently zeroed) - Fix format specifiers in RX fastmetadata stat dump to match uint64_t
- Add stat_pkts_unrecovered to st_rx_user_stats: unified post-redundancy loss counter for all session types (video/audio/anc/fmd) - Audio/anc/fmd: count actual missing packets per RTP sequence gap instead of gap events - Video: feed estimated missing packets from corrupted frames into the unified counter - Remove stat_frames_pks_missed from st20_rx_user_stats (superseded by stat_pkts_unrecovered in common stats) - Populate err_packets for audio/anc/fmd RX (was always 0) - Add stat_pkts_out_of_order++ at per-port OOO sites for audio/anc/fmd to match video behavior (aggregate = sum of per-port counters) - Improve doxygen: pre/post-redundancy annotations on st_rx_port_stats and st_rx_user_stats, mark dead ST41 interlace fields
Pipeline diagram, OOO/loss counter interpretation with scenario table, cross-session differences, and troubleshooting reference. Field descriptions are kept in header file doxygen comments only.
RX: move stat_pkts_redundant to st_rx_user_stats (was duplicated in st30/st40/st41 as stat_pkts_redundant, and in st20 as stat_pkts_redundant_dropped with same semantics). TX: move stat_epoch_mismatch, stat_recoverable_error, and stat_unrecoverable_error to st_tx_user_stats (were duplicated across st20/st30/st40/st41 session-specific structs).
Wrap all 16 get/reset_session_stats implementations with the existing per-session mgr->mutex[idx] spinlock to prevent races with the data-path tasklet. Add @note Thread-safe to all 28 doxygen blocks across 7 headers. Change out_of_order_packets and stat_pkts_out_of_order from counting gap events (++) to counting actual missing packets (+= gap_size), consistent with stat_pkts_unrecovered. The invariant stat_pkts_unrecovered <= stat_pkts_out_of_order now holds. Update doxygen in st_api.h and stats_guide.md accordingly.
1d26bb5 to
820bed0
Compare
awilczyns
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unify RX/TX session statistics across all session types for consistency and thread safety.
Fields moved from session-specific structs to common are removed from st20/st30/st40/st41 API headers — see commit 6ef76f2 for the full list.