RDKBWIFI-401: Add VAP traffic stats collection and fix AP metrics reporting#1030
RDKBWIFI-401: Add VAP traffic stats collection and fix AP metrics reporting#1030nefiguclu wants to merge 2 commits intordkcentral:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands EasyMesh AP metrics reporting by adding a per-VAP traffic stats collection pipeline, extending AP/BSS metrics payloads (ESP + multicast/broadcast counters), and fixing several AP metrics decode/translate issues so radio/BSS/STA metrics are propagated correctly into the EasyMesh data model.
Changes:
- Add a new
mon_stats_type_vap_statsmonitor stats type with awifi_stats_vap.ccollector and corresponding event plumbing. - Extend AP metrics encode/decode/translate to include radio metrics, per-AC ESP fields, and multicast/broadcast byte counters; improve VAP lookup by BSSID.
- Fix multiple AP metrics reporting bugs (e.g.,
radio_countdecode, retrans mapping, receive_other utilization, STA time delta calculation).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| source/webconfig/wifi_webconfig_em_ap_metrics_report.c | Sets decoded radio_count after subdoc processing. |
| source/webconfig/wifi_encoder.c | Encodes radio metrics and extends VAP/AP metrics payload (ESP flags/values + multicast/broadcast counters); skips non-AP VAPs. |
| source/webconfig/wifi_easymesh_translator.c | Propagates radio metrics into em_radio_info and maps per-VAP metrics into em_bss_info (BSSID-based lookup, ESP 24-bit unpack). |
| source/webconfig/wifi_decoder.c | Decodes radio metrics and new VAP/AP metrics fields; fixes unicast-bytes-received decode. |
| source/stats/wifi_stats.c | Registers the new mon_stats_type_vap_stats descriptor. |
| source/stats/wifi_stats_vap.c | Adds a new VAP traffic stats collector/cacher implementation. |
| source/stats/wifi_stats_radio_diagnostics.c | Removes stray whitespace. |
| source/stats/wifi_stats_radio_channel.c | Adds early path for WIFI_RADIO_SCAN_MODE_NONE to update channel stats cache. |
| source/stats/wifi_stats_assoc_client.c | Captures per-STA monotonic timestamp for later link-metrics delta computation. |
| source/stats/wifi_monitor.h | Introduces vap_traffic_stats_t, stores it in bssid_data_t, and declares VAP stats APIs. |
| source/stats/wifi_monitor.c | Removes stray whitespace. |
| source/core/wifi_events.c | Adds event allocation/copy support for mon_stats_type_vap_stats. |
| source/core/Makefile.am | Builds and links wifi_stats_vap.c. |
| source/apps/em/wifi_em.h | Adds em_app_event_type_vap_stats_periodic. |
| source/apps/em/wifi_em.c | Adds timestamp wrapper for per-STA measurements, computes time_delta, handles VAP stats responses, and fixes AP/radio metrics mappings. |
| include/wifi_base.h | Adds mon_stats_type_vap_stats, adds STA timestamp field, and updates STA metrics field types. |
Comments suppressed due to low confidence (1)
source/webconfig/wifi_encoder.c:3448
vap_arr_indexis initialized once before the VAP loop and is not reset for eachj. If a VAP’s BSSID doesn’t match anyvap_reports[k],vap_arr_indexcan retain the previous iteration’s value and cause the encoder to attach the wrong AP metrics to the current VAP. Resetvap_arr_index = -1at the start of eachjiteration (or immediately before thefor (k ...)search) and only use it when a match is found.
for (int k = 0; k < MAX_NUM_VAP_PER_RADIO; k++) {
ap_metrics = &radio_report->vap_reports[k];
if (strncmp(vap->u.bss_info.bssid, ap_metrics->vap_metrics.bssid,
sizeof(bssid_t)) == 0) {
vap_arr_index = k;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fa3e0cd to
cbc65db
Compare
cbc65db to
3b97852
Compare
708191d to
0f8c45e
Compare
|
Hello @amarnathhullur, the reason for the build error is that the unified-wifi-mesh changes were not included. Could you please start the build together with below PR? |
0f8c45e to
9fa45d5
Compare
Thanks Nefi, merged the Unified-wifi-mesh change and see that the automated build is working. This change will be further reviewed by OneWifi-maintainers team. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9fa45d5 to
a2c8d50
Compare
…orting New Features - Add mon_stats_type_vap_stats pipeline: vap_traffic_stats_t struct, wifi_stats_vap.c collector, per-VAP monitor task configuration - Add wifi_associated_dev3_timestamp_t wrapper to track per-STA measurement time; compute time_delta using CLOCK_MONOTONIC - Add em_app_event_type_vap_stats_periodic event type Radio & BSS Metrics - Fix receive_other to use ch_utilization_busy_ext instead of 0 - Change channel stats scan_mode ONCHAN→NONE; add early-return path - Add ESP AC BE/BK/VI/VO encoding/decoding and 24-bit unpack into em_bss_info byte arrays - Add multicast/broadcast byte counters to AP metrics encoder/decoder - Fix VAP lookup in translator to use BSSID matching; skip non-AP VAPs - Propagate radio metrics (noise/transmit/receive_self/receive_other) into em_radio_info via translator Bug Fixes - Fix unicast_bytes_rcvd overwritten with unicast_bytes_sent in decoder - Fix retrans_count mapped to rx_packtes_errs instead of retrans_cnt - Fix em_ap_metrics_report.radio_count not set after subdoc decode - Add missing return RETURN_OK in prepare_sta_traffic_stats_data() - Change assoc_sta_traffic_stats_t and assoc_sta_link_metrics_data_t fields from int to ULONG/unsigned int Known Limitations - VAP traffic stats return zero values; HAL API integration pending
a2c8d50 to
26fb4ed
Compare
|
Hi @amarnathhullur, is this PR still waiting for review? |
Hi @nefiguclu, PR is also under review by Narendra. |
|
Internal build success - https://gerrit.teamccp.com/#/c/953897/ |
New Features
Radio & BSS Metrics
Bug Fixes
Known Limitations