qcacmn: Initialize min_delay of hist_stats to high value
As the value of min_delay is initialized to 0, during the updation of min_delay per-packet,the new value is compared with 0.This results in the value of min_delay always becoming 0.Fix this by initializing min_delay to very high value. Change-Id: I6dfdd88a44f68d21240c148bd5c591e04fdff92e CRs-Fixed: 3170996
This commit is contained in:

committed by
Madan Koyyalamudi

parent
67d1b9bf12
commit
4bdcc0d4c5
@@ -5841,11 +5841,13 @@ static void dp_print_hist_stats(struct cdp_hist_stats *hstats,
|
||||
{
|
||||
uint8_t index = 0;
|
||||
uint64_t count = 0;
|
||||
bool hist_delay_data = false;
|
||||
|
||||
for (index = 0; index < CDP_HIST_BUCKET_MAX; index++) {
|
||||
count = hstats->hist.freq[index];
|
||||
if (!count)
|
||||
continue;
|
||||
hist_delay_data = true;
|
||||
if (hist_type == CDP_HIST_TYPE_SW_ENQEUE_DELAY)
|
||||
DP_PRINT_STATS("%s: Packets = %llu",
|
||||
dp_vow_str_sw_enq_delay(index),
|
||||
@@ -5860,9 +5862,15 @@ static void dp_print_hist_stats(struct cdp_hist_stats *hstats,
|
||||
count);
|
||||
}
|
||||
|
||||
DP_PRINT_STATS("Min = %u", hstats->min);
|
||||
DP_PRINT_STATS("Max = %u", hstats->max);
|
||||
DP_PRINT_STATS("Avg = %u\n", hstats->avg);
|
||||
/*
|
||||
* If none of the buckets have any packets,
|
||||
* there is no need to display the stats.
|
||||
*/
|
||||
if (hist_delay_data) {
|
||||
DP_PRINT_STATS("Min = %u", hstats->min);
|
||||
DP_PRINT_STATS("Max = %u", hstats->max);
|
||||
DP_PRINT_STATS("Avg = %u\n", hstats->avg);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5964,14 +5972,14 @@ void dp_peer_print_tx_delay_stats(struct dp_pdev *pdev,
|
||||
for (tid = 0; tid < CDP_MAX_DATA_TIDS; tid++) {
|
||||
DP_PRINT_STATS("----TID: %d----", tid);
|
||||
DP_PRINT_STATS("Software Enqueue Delay:");
|
||||
qdf_mem_zero(&hist_stats, sizeof(*(&hist_stats)));
|
||||
dp_hist_init(&hist_stats, CDP_HIST_TYPE_SW_ENQEUE_DELAY);
|
||||
dp_accumulate_delay_tid_stats(soc, delay_stats->delay_tid_stats,
|
||||
&hist_stats, tid,
|
||||
CDP_HIST_TYPE_SW_ENQEUE_DELAY);
|
||||
dp_print_hist_stats(&hist_stats, CDP_HIST_TYPE_SW_ENQEUE_DELAY);
|
||||
qdf_mem_zero(&hist_stats, sizeof(*(&hist_stats)));
|
||||
|
||||
DP_PRINT_STATS("Hardware Transmission Delay:");
|
||||
dp_hist_init(&hist_stats, CDP_HIST_TYPE_HW_COMP_DELAY);
|
||||
dp_accumulate_delay_tid_stats(soc, delay_stats->delay_tid_stats,
|
||||
&hist_stats, tid,
|
||||
CDP_HIST_TYPE_HW_COMP_DELAY);
|
||||
@@ -6011,7 +6019,7 @@ void dp_peer_print_rx_delay_stats(struct dp_pdev *pdev,
|
||||
for (tid = 0; tid < CDP_MAX_DATA_TIDS; tid++) {
|
||||
DP_PRINT_STATS("----TID: %d----", tid);
|
||||
DP_PRINT_STATS("Rx Reap2stack Deliver Delay:");
|
||||
qdf_mem_zero(&hist_stats, sizeof(*(&hist_stats)));
|
||||
dp_hist_init(&hist_stats, CDP_HIST_TYPE_REAP_STACK);
|
||||
dp_accumulate_delay_tid_stats(soc, delay_stats->delay_tid_stats,
|
||||
&hist_stats, tid,
|
||||
CDP_HIST_TYPE_REAP_STACK);
|
||||
|
Reference in New Issue
Block a user