qcacmn: Microsecond time stamping for hw tx latency stats
Use microsecond timestamping for the tx descriptors for capturing the latencies more accurately. It will help to determine the appropriate bucket. Change-Id: I216e083a7c89b01b6f2f384c1c0a85ca323d3a3e CRs-Fixed: 3165153
这个提交包含在:
@@ -3858,7 +3858,7 @@ static void dp_tx_compute_tid_delay(struct cdp_delay_tid_stats *stats,
|
||||
|
||||
current_timestamp = qdf_ktime_to_ms(qdf_ktime_real_get());
|
||||
timestamp_ingress = qdf_nbuf_get_timestamp(tx_desc->nbuf);
|
||||
timestamp_hw_enqueue = tx_desc->timestamp;
|
||||
timestamp_hw_enqueue = qdf_ktime_to_ms(tx_desc->timestamp);
|
||||
sw_enqueue_delay = (uint32_t)(timestamp_hw_enqueue - timestamp_ingress);
|
||||
fwhw_transmit_delay = (uint32_t)(current_timestamp -
|
||||
timestamp_hw_enqueue);
|
||||
@@ -3917,24 +3917,37 @@ static inline void dp_tx_update_peer_delay_stats(struct dp_txrx_peer *txrx_peer,
|
||||
#endif
|
||||
|
||||
#ifdef HW_TX_DELAY_STATS_ENABLE
|
||||
/**
|
||||
* dp_update_tx_delay_stats() - update the delay stats
|
||||
* @vdev: vdev handle
|
||||
* @delay: delay in ms or us based on the flag delay_in_us
|
||||
* @tid: tid value
|
||||
* @mode: type of tx delay mode
|
||||
* @ring id: ring number
|
||||
* @delay_in_us: flag to indicate whether the delay is in ms or us
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static inline
|
||||
void dp_update_tx_delay_stats(struct dp_vdev *vdev, uint32_t delay, uint8_t tid,
|
||||
uint8_t mode, uint8_t ring_id)
|
||||
uint8_t mode, uint8_t ring_id, bool delay_in_us)
|
||||
{
|
||||
struct cdp_tid_tx_stats *tstats =
|
||||
&vdev->stats.tid_tx_stats[ring_id][tid];
|
||||
|
||||
dp_update_delay_stats(tstats, NULL, delay, tid, mode, ring_id);
|
||||
dp_update_delay_stats(tstats, NULL, delay, tid, mode, ring_id,
|
||||
delay_in_us);
|
||||
}
|
||||
#else
|
||||
static inline
|
||||
void dp_update_tx_delay_stats(struct dp_vdev *vdev, uint32_t delay, uint8_t tid,
|
||||
uint8_t mode, uint8_t ring_id)
|
||||
uint8_t mode, uint8_t ring_id, bool delay_in_us)
|
||||
{
|
||||
struct cdp_tid_tx_stats *tstats =
|
||||
&vdev->pdev->stats.tid_stats.tid_tx_stats[ring_id][tid];
|
||||
|
||||
dp_update_delay_stats(tstats, NULL, delay, tid, mode, ring_id);
|
||||
dp_update_delay_stats(tstats, NULL, delay, tid, mode, ring_id,
|
||||
delay_in_us);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3953,28 +3966,41 @@ void dp_tx_compute_delay(struct dp_vdev *vdev, struct dp_tx_desc_s *tx_desc,
|
||||
{
|
||||
int64_t current_timestamp, timestamp_ingress, timestamp_hw_enqueue;
|
||||
uint32_t sw_enqueue_delay, fwhw_transmit_delay, interframe_delay;
|
||||
uint32_t fwhw_transmit_delay_us;
|
||||
|
||||
if (qdf_likely(!vdev->pdev->delay_stats_flag) &&
|
||||
qdf_likely(!dp_is_vdev_tx_delay_stats_enabled(vdev)))
|
||||
return;
|
||||
|
||||
if (dp_is_vdev_tx_delay_stats_enabled(vdev)) {
|
||||
fwhw_transmit_delay_us =
|
||||
qdf_ktime_to_us(qdf_ktime_real_get()) -
|
||||
qdf_ktime_to_us(tx_desc->timestamp);
|
||||
|
||||
/*
|
||||
* Delay between packet enqueued to HW and Tx completion in us
|
||||
*/
|
||||
dp_update_tx_delay_stats(vdev, fwhw_transmit_delay_us, tid,
|
||||
CDP_DELAY_STATS_FW_HW_TRANSMIT,
|
||||
ring_id, true);
|
||||
/*
|
||||
* For MCL, only enqueue to completion delay is required
|
||||
* so return if the vdev flag is enabled.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
current_timestamp = qdf_ktime_to_ms(qdf_ktime_real_get());
|
||||
timestamp_hw_enqueue = tx_desc->timestamp;
|
||||
timestamp_hw_enqueue = qdf_ktime_to_ms(tx_desc->timestamp);
|
||||
fwhw_transmit_delay = (uint32_t)(current_timestamp -
|
||||
timestamp_hw_enqueue);
|
||||
|
||||
/*
|
||||
* Delay between packet enqueued to HW and Tx completion
|
||||
* Delay between packet enqueued to HW and Tx completion in ms
|
||||
*/
|
||||
dp_update_tx_delay_stats(vdev, fwhw_transmit_delay, tid,
|
||||
CDP_DELAY_STATS_FW_HW_TRANSMIT, ring_id);
|
||||
|
||||
/*
|
||||
* For MCL, only enqueue to completion delay is required
|
||||
* so return if the vdev flag is enabled.
|
||||
*/
|
||||
if (dp_is_vdev_tx_delay_stats_enabled(vdev))
|
||||
return;
|
||||
CDP_DELAY_STATS_FW_HW_TRANSMIT, ring_id,
|
||||
false);
|
||||
|
||||
timestamp_ingress = qdf_nbuf_get_timestamp(tx_desc->nbuf);
|
||||
sw_enqueue_delay = (uint32_t)(timestamp_hw_enqueue - timestamp_ingress);
|
||||
@@ -3985,7 +4011,8 @@ void dp_tx_compute_delay(struct dp_vdev *vdev, struct dp_tx_desc_s *tx_desc,
|
||||
* Delay in software enqueue
|
||||
*/
|
||||
dp_update_tx_delay_stats(vdev, sw_enqueue_delay, tid,
|
||||
CDP_DELAY_STATS_SW_ENQ, ring_id);
|
||||
CDP_DELAY_STATS_SW_ENQ, ring_id,
|
||||
false);
|
||||
|
||||
/*
|
||||
* Update interframe delay stats calculated at hardstart receive point.
|
||||
@@ -3995,7 +4022,8 @@ void dp_tx_compute_delay(struct dp_vdev *vdev, struct dp_tx_desc_s *tx_desc,
|
||||
* of !vdev->prev_tx_enq_tstamp.
|
||||
*/
|
||||
dp_update_tx_delay_stats(vdev, interframe_delay, tid,
|
||||
CDP_DELAY_STATS_TX_INTERFRAME, ring_id);
|
||||
CDP_DELAY_STATS_TX_INTERFRAME, ring_id,
|
||||
false);
|
||||
vdev->prev_tx_enq_tstamp = timestamp_ingress;
|
||||
}
|
||||
|
||||
@@ -4413,7 +4441,7 @@ dp_tx_comp_process_desc(struct dp_soc *soc,
|
||||
*/
|
||||
if (qdf_unlikely(!!desc->pdev->latency_capture_enable)) {
|
||||
time_latency = (qdf_ktime_to_ms(qdf_ktime_real_get()) -
|
||||
desc->timestamp);
|
||||
qdf_ktime_to_ms(desc->timestamp));
|
||||
}
|
||||
|
||||
dp_send_completion_to_pkt_capture(soc, desc, ts);
|
||||
@@ -4422,7 +4450,7 @@ dp_tx_comp_process_desc(struct dp_soc *soc,
|
||||
qdf_trace_dp_packet(desc->nbuf, QDF_TX,
|
||||
desc->msdu_ext_desc ?
|
||||
desc->msdu_ext_desc->tso_desc : NULL,
|
||||
desc->timestamp);
|
||||
qdf_ktime_to_ms(desc->timestamp));
|
||||
|
||||
if (!(desc->msdu_ext_desc)) {
|
||||
dp_tx_enh_unmap(soc, desc);
|
||||
@@ -4758,7 +4786,7 @@ void dp_tx_comp_process_tx_status(struct dp_soc *soc,
|
||||
#ifdef QCA_SUPPORT_RDK_STATS
|
||||
if (soc->peerstats_enabled)
|
||||
dp_tx_sojourn_stats_process(vdev->pdev, txrx_peer, ts->tid,
|
||||
tx_desc->timestamp,
|
||||
qdf_ktime_to_ms(tx_desc->timestamp),
|
||||
ts->ppdu_id);
|
||||
#endif
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户