qcacmn: Update correct tx rate, rx rate and sojourn stats
Currently we are upadting sojourn stats for all tid. but rate stats maintains stats for only data tids 0-7. updating stats for tid value exceeding 7 is leading it to assert. Update correct tx rate, rx rate and sojourn stats. Change-Id: Ib2f5791aa7b8e85aac6283c46f58ce7e821a559b CRs-Fixed: 2428648 2429575 2429575
This commit is contained in:
@@ -114,10 +114,9 @@
|
|||||||
#define CDP_WDI_NUM_EVENTS 26
|
#define CDP_WDI_NUM_EVENTS 26
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CDP_FC_RETRY_OFFSET 0x4
|
#define CDP_FCTL_RETRY 0x0800
|
||||||
#define CDP_FC_RETRY_MASK (CDP_FC_RETRY_OFFSET << 1)
|
|
||||||
#define CDP_FC_IS_RETRY_SET(_fc) \
|
#define CDP_FC_IS_RETRY_SET(_fc) \
|
||||||
((_fc) && CDP_FC_RETRY_MASK)
|
((_fc) & qdf_cpu_to_le16(CDP_FCTL_RETRY))
|
||||||
|
|
||||||
/* Different Packet Types */
|
/* Different Packet Types */
|
||||||
enum cdp_packet_type {
|
enum cdp_packet_type {
|
||||||
|
@@ -149,6 +149,7 @@ dp_tx_rate_stats_update(struct dp_peer *peer,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ppdu->rix = rix;
|
ppdu->rix = rix;
|
||||||
|
ppdu->tx_ratekbps = ratekbps;
|
||||||
peer->stats.tx.avg_tx_rate =
|
peer->stats.tx.avg_tx_rate =
|
||||||
dp_ath_rate_lpf(peer->stats.tx.avg_tx_rate, ratekbps);
|
dp_ath_rate_lpf(peer->stats.tx.avg_tx_rate, ratekbps);
|
||||||
ppdu_tx_rate = dp_ath_rate_out(peer->stats.tx.avg_tx_rate);
|
ppdu_tx_rate = dp_ath_rate_out(peer->stats.tx.avg_tx_rate);
|
||||||
@@ -2601,6 +2602,7 @@ void dp_ppdu_desc_deliver(struct dp_pdev *pdev,
|
|||||||
if (!peer)
|
if (!peer)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
ppdu_desc->user[i].cookie = (void *)peer->wlanstats_ctx;
|
||||||
if (ppdu_desc->user[i].completion_status !=
|
if (ppdu_desc->user[i].completion_status !=
|
||||||
HTT_PPDU_STATS_USER_STATUS_OK)
|
HTT_PPDU_STATS_USER_STATUS_OK)
|
||||||
tlv_bitmap_expected = tlv_bitmap_expected & 0xFF;
|
tlv_bitmap_expected = tlv_bitmap_expected & 0xFF;
|
||||||
@@ -2616,7 +2618,6 @@ void dp_ppdu_desc_deliver(struct dp_pdev *pdev,
|
|||||||
ppdu_desc->ack_rssi);
|
ppdu_desc->ack_rssi);
|
||||||
}
|
}
|
||||||
|
|
||||||
ppdu_desc->user[i].cookie = (void *)peer->wlanstats_ctx;
|
|
||||||
dp_tx_rate_stats_update(peer, &ppdu_desc->user[i]);
|
dp_tx_rate_stats_update(peer, &ppdu_desc->user[i]);
|
||||||
dp_peer_unref_del_find_by_id(peer);
|
dp_peer_unref_del_find_by_id(peer);
|
||||||
tlv_bitmap_expected = tlv_bitmap_default;
|
tlv_bitmap_expected = tlv_bitmap_default;
|
||||||
|
@@ -3265,6 +3265,7 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
|||||||
int entries;
|
int entries;
|
||||||
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
|
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
|
||||||
int nss_cfg;
|
int nss_cfg;
|
||||||
|
void *sojourn_buf;
|
||||||
|
|
||||||
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
||||||
struct dp_pdev *pdev = NULL;
|
struct dp_pdev *pdev = NULL;
|
||||||
@@ -3472,6 +3473,10 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
|||||||
sizeof(struct cdp_tx_sojourn_stats), 0, 4,
|
sizeof(struct cdp_tx_sojourn_stats), 0, 4,
|
||||||
TRUE);
|
TRUE);
|
||||||
|
|
||||||
|
if (pdev->sojourn_buf) {
|
||||||
|
sojourn_buf = qdf_nbuf_data(pdev->sojourn_buf);
|
||||||
|
qdf_mem_zero(sojourn_buf, sizeof(struct cdp_tx_sojourn_stats));
|
||||||
|
}
|
||||||
/* initlialize cal client timer */
|
/* initlialize cal client timer */
|
||||||
dp_cal_client_attach(&pdev->cal_client_ctx, pdev, pdev->soc->osdev,
|
dp_cal_client_attach(&pdev->cal_client_ctx, pdev, pdev->soc->osdev,
|
||||||
&dp_iterate_update_peer_list);
|
&dp_iterate_update_peer_list);
|
||||||
|
@@ -106,8 +106,8 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
|
|||||||
cdp_rx_ppdu->udp_msdu_count +
|
cdp_rx_ppdu->udp_msdu_count +
|
||||||
cdp_rx_ppdu->other_msdu_count);
|
cdp_rx_ppdu->other_msdu_count);
|
||||||
cdp_rx_ppdu->num_bytes = ppdu_info->rx_status.ppdu_len;
|
cdp_rx_ppdu->num_bytes = ppdu_info->rx_status.ppdu_len;
|
||||||
if (CDP_FC_IS_RETRY_SET(cdp_rx_ppdu->frame_ctrl))
|
cdp_rx_ppdu->retries = CDP_FC_IS_RETRY_SET(cdp_rx_ppdu->frame_ctrl) ?
|
||||||
cdp_rx_ppdu->retries += ppdu_info->com_info.mpdu_cnt_fcs_ok;
|
ppdu_info->com_info.mpdu_cnt_fcs_ok : 0;
|
||||||
|
|
||||||
if (ppdu_info->com_info.mpdu_cnt_fcs_ok > 1)
|
if (ppdu_info->com_info.mpdu_cnt_fcs_ok > 1)
|
||||||
cdp_rx_ppdu->is_ampdu = 1;
|
cdp_rx_ppdu->is_ampdu = 1;
|
||||||
@@ -188,6 +188,7 @@ static inline void dp_rx_rate_stats_update(struct dp_peer *peer,
|
|||||||
dp_ath_rate_lpf(peer->stats.rx.avg_rx_rate, ratekbps);
|
dp_ath_rate_lpf(peer->stats.rx.avg_rx_rate, ratekbps);
|
||||||
ppdu_rx_rate = dp_ath_rate_out(peer->stats.rx.avg_rx_rate);
|
ppdu_rx_rate = dp_ath_rate_out(peer->stats.rx.avg_rx_rate);
|
||||||
DP_STATS_UPD(peer, rx.rnd_avg_rx_rate, ppdu_rx_rate);
|
DP_STATS_UPD(peer, rx.rnd_avg_rx_rate, ppdu_rx_rate);
|
||||||
|
ppdu->rx_ratekbps = ratekbps;
|
||||||
|
|
||||||
if (peer->vdev)
|
if (peer->vdev)
|
||||||
peer->vdev->stats.rx.last_rx_rate = ratekbps;
|
peer->vdev->stats.rx.last_rx_rate = ratekbps;
|
||||||
|
@@ -2978,47 +2978,36 @@ static inline void dp_tx_sojourn_stats_process(struct dp_pdev *pdev,
|
|||||||
{
|
{
|
||||||
uint64_t delta_ms;
|
uint64_t delta_ms;
|
||||||
struct cdp_tx_sojourn_stats *sojourn_stats;
|
struct cdp_tx_sojourn_stats *sojourn_stats;
|
||||||
uint8_t tidno;
|
|
||||||
|
|
||||||
if (pdev->enhanced_stats_en == 0)
|
if (qdf_unlikely(pdev->enhanced_stats_en == 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (pdev->sojourn_stats.ppdu_seq_id == 0)
|
if (qdf_unlikely(tid == HTT_INVALID_TID ||
|
||||||
pdev->sojourn_stats.ppdu_seq_id = ppdu_id;
|
tid >= CDP_DATA_TID_MAX))
|
||||||
|
return;
|
||||||
|
|
||||||
if (ppdu_id != pdev->sojourn_stats.ppdu_seq_id) {
|
if (qdf_unlikely(!pdev->sojourn_buf))
|
||||||
if (!pdev->sojourn_buf)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sojourn_stats = (struct cdp_tx_sojourn_stats *)
|
sojourn_stats = (struct cdp_tx_sojourn_stats *)
|
||||||
qdf_nbuf_data(pdev->sojourn_buf);
|
qdf_nbuf_data(pdev->sojourn_buf);
|
||||||
|
|
||||||
qdf_mem_copy(sojourn_stats, &pdev->sojourn_stats,
|
|
||||||
sizeof(struct cdp_tx_sojourn_stats));
|
|
||||||
|
|
||||||
sojourn_stats->cookie = (void *)peer->wlanstats_ctx;
|
sojourn_stats->cookie = (void *)peer->wlanstats_ctx;
|
||||||
|
|
||||||
for (tidno = 0; tidno < CDP_DATA_TID_MAX; tidno++) {
|
|
||||||
pdev->sojourn_stats.sum_sojourn_msdu[tidno] = 0;
|
|
||||||
pdev->sojourn_stats.num_msdus[tidno] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dp_wdi_event_handler(WDI_EVENT_TX_SOJOURN_STAT, pdev->soc,
|
|
||||||
pdev->sojourn_buf, HTT_INVALID_PEER,
|
|
||||||
WDI_NO_VAL, pdev->pdev_id);
|
|
||||||
|
|
||||||
pdev->sojourn_stats.ppdu_seq_id = ppdu_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tid == HTT_INVALID_TID)
|
|
||||||
return;
|
|
||||||
|
|
||||||
delta_ms = qdf_ktime_to_ms(qdf_ktime_get()) -
|
delta_ms = qdf_ktime_to_ms(qdf_ktime_get()) -
|
||||||
txdesc_ts;
|
txdesc_ts;
|
||||||
qdf_ewma_tx_lag_add(&pdev->sojourn_stats.avg_sojourn_msdu[tid],
|
qdf_ewma_tx_lag_add(&peer->avg_sojourn_msdu[tid],
|
||||||
delta_ms);
|
delta_ms);
|
||||||
pdev->sojourn_stats.sum_sojourn_msdu[tid] += delta_ms;
|
sojourn_stats->sum_sojourn_msdu[tid] = delta_ms;
|
||||||
pdev->sojourn_stats.num_msdus[tid]++;
|
sojourn_stats->num_msdus[tid] = 1;
|
||||||
|
sojourn_stats->avg_sojourn_msdu[tid].internal =
|
||||||
|
peer->avg_sojourn_msdu[tid].internal;
|
||||||
|
dp_wdi_event_handler(WDI_EVENT_TX_SOJOURN_STAT, pdev->soc,
|
||||||
|
pdev->sojourn_buf, HTT_INVALID_PEER,
|
||||||
|
WDI_NO_VAL, pdev->pdev_id);
|
||||||
|
sojourn_stats->sum_sojourn_msdu[tid] = 0;
|
||||||
|
sojourn_stats->num_msdus[tid] = 0;
|
||||||
|
sojourn_stats->avg_sojourn_msdu[tid].internal = 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline void dp_tx_sojourn_stats_process(struct dp_pdev *pdev,
|
static inline void dp_tx_sojourn_stats_process(struct dp_pdev *pdev,
|
||||||
|
@@ -1714,6 +1714,8 @@ struct dp_peer {
|
|||||||
|
|
||||||
/* rdk statistics context */
|
/* rdk statistics context */
|
||||||
struct cdp_peer_rate_stats_ctx *wlanstats_ctx;
|
struct cdp_peer_rate_stats_ctx *wlanstats_ctx;
|
||||||
|
/* average sojourn time */
|
||||||
|
qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_WIN
|
#ifdef CONFIG_WIN
|
||||||
|
Reference in New Issue
Block a user