qcacmn: Replenish last entry in monitor status ring

In current monitor status ring implementation,
on pdev_attach, (srng->num_entires – 1) entries
(to keep one entry slot between hp and tp)
are replenished and last entry is not replenished to HW.

With qcn9000 monitor mode HW enhancements, status and destination ring
can be made lock-stepped.
for qcn9000 lock step is achieved by making monitor status ring
follow the monitor destination reap for a PPDU

However in existing flow during attach monitor status replenish logic
do not fill last entry but is filled up during first subsequent reap.
for first ppdu, i.e. after reaping destination ring,
when status ring is reaped, as first entry (hp = srng->num_entires – 1)
in status ring is NULL, so lock-stepping is not achieved.

To address this issue for qcn9000 as well as HK:
	a. Replenish last entry in monitor status ring during attach
	b. Modify src srng peek API to peek it from hp+1 entry
	c. Introduce new HAL API get cur desc and move next

CRs-Fixed: 2626049
Change-Id: I7da6cd6006243cbca2151da22a31a6f5ed0015f3
This commit is contained in:
Amir Patel
2020-02-21 16:38:10 +05:30
committed by nshrivas
parent 7a60a81d3a
commit 31bfe1fb2c
2 changed files with 41 additions and 8 deletions

View File

@@ -1643,7 +1643,7 @@ dp_rx_mon_status_srng_process(struct dp_soc *soc, uint32_t mac_id,
* BUFFER_ADDR_INFO STRUCT
*/
while (qdf_likely((rxdma_mon_status_ring_entry =
hal_srng_src_peek(hal_soc, mon_status_srng))
hal_srng_src_peek_n_get_next(hal_soc, mon_status_srng))
&& quota--)) {
uint32_t rx_buf_cookie;
qdf_nbuf_t status_nbuf;
@@ -1921,7 +1921,7 @@ QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc,
num_req_buffers = num_entries_avail;
}
while (count < num_req_buffers) {
while (count <= num_req_buffers) {
rx_netbuf = dp_rx_nbuf_prepare(dp_soc, dp_pdev);
/*
@@ -1940,8 +1940,9 @@ QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc,
paddr = qdf_nbuf_get_frag_paddr(rx_netbuf, 0);
next = (*desc_list)->next;
rxdma_ring_entry = hal_srng_src_get_next(dp_soc->hal_soc,
rxdma_srng);
rxdma_ring_entry = hal_srng_src_get_cur_hp_n_move_next(
dp_soc->hal_soc,
rxdma_srng);
if (qdf_unlikely(!rxdma_ring_entry)) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,