qcacmn: Add history to track the entries in rx rings

The rx rings are relatively of smaller size. Any
duplicate entry sent by hardware cannot be back-tracked
by just looking at the ring contents alone.

Hence add a history to track the entries for the
REO2SW, REO exception and SW2REO ring.

Change-Id: I9b0b311950d60a9421378ce0fcc0535be450f713
CRs-Fixed: 2739181
此提交包含在:
Rakesh Pillai
2020-07-23 10:34:03 +05:30
提交者 snandini
父節點 bc798a3c5c
當前提交 9beeaa95a7
共有 6 個檔案被更改,包括 262 行新增1 行删除

查看文件

@@ -1948,6 +1948,49 @@ bool dp_rx_is_raw_frame_dropped(qdf_nbuf_t nbuf)
}
#endif
#ifdef WLAN_FEATURE_DP_RX_RING_HISTORY
/**
* dp_rx_ring_record_entry() - Record an entry into the rx ring history.
* @soc: Datapath soc structure
* @ring_num: REO ring number
* @ring_desc: REO ring descriptor
*
* Returns: None
*/
static inline void
dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num,
hal_ring_desc_t ring_desc)
{
struct dp_buf_info_record *record;
uint8_t rbm;
struct hal_buf_info hbi;
uint32_t idx;
if (qdf_unlikely(!&soc->rx_ring_history[ring_num]))
return;
hal_rx_reo_buf_paddr_get(ring_desc, &hbi);
rbm = hal_rx_ret_buf_manager_get(ring_desc);
idx = dp_history_get_next_index(&soc->rx_ring_history[ring_num]->index,
DP_RX_HIST_MAX);
/* No NULL check needed for record since its an array */
record = &soc->rx_ring_history[ring_num]->entry[idx];
record->timestamp = qdf_get_log_timestamp();
record->hbi.paddr = hbi.paddr;
record->hbi.sw_cookie = hbi.sw_cookie;
record->hbi.rbm = rbm;
}
#else
static inline void
dp_rx_ring_record_entry(struct dp_soc *soc, uint8_t ring_num,
hal_ring_desc_t ring_desc)
{
}
#endif
/**
* dp_rx_process() - Brain of the Rx processing functionality
* Called from the bottom half (tasklet/NET_RX_SOFTIRQ)
@@ -2071,6 +2114,7 @@ more_data:
qdf_assert(0);
}
dp_rx_ring_record_entry(soc, reo_ring_num, ring_desc);
rx_buf_cookie = HAL_RX_REO_BUF_COOKIE_GET(ring_desc);
status = dp_rx_cookie_check_and_invalidate(ring_desc);
if (qdf_unlikely(QDF_IS_STATUS_ERROR(status))) {