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
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -212,5 +213,6 @@ void dp_hist_init(struct cdp_hist_stats *hist_stats,
|
|||||||
enum cdp_hist_types hist_type)
|
enum cdp_hist_types hist_type)
|
||||||
{
|
{
|
||||||
qdf_mem_zero(hist_stats, sizeof(*hist_stats));
|
qdf_mem_zero(hist_stats, sizeof(*hist_stats));
|
||||||
|
hist_stats->min = INT_MAX;
|
||||||
hist_stats->hist.hist_type = hist_type;
|
hist_stats->hist.hist_type = hist_type;
|
||||||
}
|
}
|
||||||
|
@@ -5841,11 +5841,13 @@ static void dp_print_hist_stats(struct cdp_hist_stats *hstats,
|
|||||||
{
|
{
|
||||||
uint8_t index = 0;
|
uint8_t index = 0;
|
||||||
uint64_t count = 0;
|
uint64_t count = 0;
|
||||||
|
bool hist_delay_data = false;
|
||||||
|
|
||||||
for (index = 0; index < CDP_HIST_BUCKET_MAX; index++) {
|
for (index = 0; index < CDP_HIST_BUCKET_MAX; index++) {
|
||||||
count = hstats->hist.freq[index];
|
count = hstats->hist.freq[index];
|
||||||
if (!count)
|
if (!count)
|
||||||
continue;
|
continue;
|
||||||
|
hist_delay_data = true;
|
||||||
if (hist_type == CDP_HIST_TYPE_SW_ENQEUE_DELAY)
|
if (hist_type == CDP_HIST_TYPE_SW_ENQEUE_DELAY)
|
||||||
DP_PRINT_STATS("%s: Packets = %llu",
|
DP_PRINT_STATS("%s: Packets = %llu",
|
||||||
dp_vow_str_sw_enq_delay(index),
|
dp_vow_str_sw_enq_delay(index),
|
||||||
@@ -5860,9 +5862,15 @@ static void dp_print_hist_stats(struct cdp_hist_stats *hstats,
|
|||||||
count);
|
count);
|
||||||
}
|
}
|
||||||
|
|
||||||
DP_PRINT_STATS("Min = %u", hstats->min);
|
/*
|
||||||
DP_PRINT_STATS("Max = %u", hstats->max);
|
* If none of the buckets have any packets,
|
||||||
DP_PRINT_STATS("Avg = %u\n", hstats->avg);
|
* 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++) {
|
for (tid = 0; tid < CDP_MAX_DATA_TIDS; tid++) {
|
||||||
DP_PRINT_STATS("----TID: %d----", tid);
|
DP_PRINT_STATS("----TID: %d----", tid);
|
||||||
DP_PRINT_STATS("Software Enqueue Delay:");
|
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,
|
dp_accumulate_delay_tid_stats(soc, delay_stats->delay_tid_stats,
|
||||||
&hist_stats, tid,
|
&hist_stats, tid,
|
||||||
CDP_HIST_TYPE_SW_ENQEUE_DELAY);
|
CDP_HIST_TYPE_SW_ENQEUE_DELAY);
|
||||||
dp_print_hist_stats(&hist_stats, 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_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,
|
dp_accumulate_delay_tid_stats(soc, delay_stats->delay_tid_stats,
|
||||||
&hist_stats, tid,
|
&hist_stats, tid,
|
||||||
CDP_HIST_TYPE_HW_COMP_DELAY);
|
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++) {
|
for (tid = 0; tid < CDP_MAX_DATA_TIDS; tid++) {
|
||||||
DP_PRINT_STATS("----TID: %d----", tid);
|
DP_PRINT_STATS("----TID: %d----", tid);
|
||||||
DP_PRINT_STATS("Rx Reap2stack Deliver Delay:");
|
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,
|
dp_accumulate_delay_tid_stats(soc, delay_stats->delay_tid_stats,
|
||||||
&hist_stats, tid,
|
&hist_stats, tid,
|
||||||
CDP_HIST_TYPE_REAP_STACK);
|
CDP_HIST_TYPE_REAP_STACK);
|
||||||
|
Reference in New Issue
Block a user