瀏覽代碼

qcacmn: Record few more ce desc event during post_recv_buffers

CE events are not recorded during nbuf allocation and
nbuf map done in hif_post_recv_buffers_for_pipe.

Add few more events to be recorded to know the exact
time when nbuf allocation and map is done with respect
to rx_desc_completion and rx_post_desc events.

Change-Id: Ia2a3ea61dc99dd21d06b442ef00cd25550f4cb5a
CRs-Fixed: 2541986
Yeshwanth Sriram Guntuka 5 年之前
父節點
當前提交
2a7ed0abd3
共有 2 個文件被更改,包括 18 次插入1 次删除
  1. 7 0
      hif/src/ce/ce_internal.h
  2. 11 1
      hif/src/ce/ce_main.c

+ 7 - 0
hif/src/ce/ce_internal.h

@@ -427,6 +427,9 @@ union ce_srng_desc {
  * @HIF_CE_DEST_RING_BUFFER_POST: record the packet when buffer is posted to ce dst ring
  * @HIF_CE_DEST_RING_BUFFER_REAP: record the packet when buffer is reaped from ce dst ring
  * @HIF_CE_DEST_STATUS_RING_REAP: record the packet when status ring is reaped
+ * @HIF_RX_DESC_PRE_NBUF_ALLOC: record the packet before nbuf allocation
+ * @HIF_RX_DESC_PRE_NBUF_MAP: record the packet before nbuf map
+ * @HIF_RX_DESC_POST_NBUF_MAP: record the packet after nbuf map
  */
 enum hif_ce_event_type {
 	HIF_RX_DESC_POST,
@@ -461,6 +464,10 @@ enum hif_ce_event_type {
 	HIF_CE_DEST_RING_BUFFER_POST,
 	HIF_CE_DEST_RING_BUFFER_REAP,
 	HIF_CE_DEST_STATUS_RING_REAP,
+
+	HIF_RX_DESC_PRE_NBUF_ALLOC,
+	HIF_RX_DESC_PRE_NBUF_MAP,
+	HIF_RX_DESC_POST_NBUF_MAP,
 };
 
 void ce_init_ce_desc_event_log(struct hif_softc *scn, int ce_id, int size);

+ 11 - 1
hif/src/ce/ce_main.c

@@ -2410,6 +2410,7 @@ QDF_STATUS hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
 	struct hif_softc *scn = HIF_GET_SOFTC(pipe_info->HIF_CE_state);
 	QDF_STATUS status;
 	uint32_t bufs_posted = 0;
+	unsigned int ce_id;
 
 	buf_sz = pipe_info->buf_sz;
 	if (buf_sz == 0) {
@@ -2418,6 +2419,7 @@ QDF_STATUS hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
 	}
 
 	ce_hdl = pipe_info->ce_hdl;
+	ce_id = ((struct CE_state *)ce_hdl)->id;
 
 	qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock);
 	while (atomic_read(&pipe_info->recv_bufs_needed) > 0) {
@@ -2427,6 +2429,9 @@ QDF_STATUS hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
 		atomic_dec(&pipe_info->recv_bufs_needed);
 		qdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock);
 
+		hif_record_ce_desc_event(scn, ce_id,
+					 HIF_RX_DESC_PRE_NBUF_ALLOC, NULL, NULL,
+					 0, 0);
 		nbuf = qdf_nbuf_alloc(scn->qdf_dev, buf_sz, 0, 4, false);
 		if (!nbuf) {
 			hif_post_recv_buffers_failure(pipe_info, nbuf,
@@ -2436,6 +2441,9 @@ QDF_STATUS hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
 			return QDF_STATUS_E_NOMEM;
 		}
 
+		hif_record_ce_desc_event(scn, ce_id,
+					 HIF_RX_DESC_PRE_NBUF_MAP, NULL, nbuf,
+					 0, 0);
 		/*
 		 * qdf_nbuf_peek_header(nbuf, &data, &unused);
 		 * CE_data = dma_map_single(dev, data, buf_sz, );
@@ -2454,7 +2462,9 @@ QDF_STATUS hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
 		}
 
 		CE_data = qdf_nbuf_get_frag_paddr(nbuf, 0);
-
+		hif_record_ce_desc_event(scn, ce_id,
+					 HIF_RX_DESC_POST_NBUF_MAP, NULL, nbuf,
+					 0, 0);
 		qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data,
 					       buf_sz, DMA_FROM_DEVICE);
 		status = ce_recv_buf_enqueue(ce_hdl, (void *)nbuf, CE_data);