Ver código fonte

qcacld-3.0: debug info for full reorder offload

qcacld-2.0 to qcacld-3.0 propagation

Log last 1K physical addresses and corresponding virtual addresses of the
Rx buffers.

Change-Id: I2bb4502fdd92b362199b579ec3cceaa691d4691f
CRs-Fixed: 864569
Govind Singh 9 anos atrás
pai
commit
d79e134de3

+ 7 - 0
core/cdf/src/i_cdf_nbuf.h

@@ -102,6 +102,9 @@ struct cvg_nbuf_cb {
 	 * provided by the OS.
 	 */
 	uint32_t mapped_paddr_lo[CVG_NBUF_MAX_OS_FRAGS];
+#ifdef DEBUG_RX_RING_BUFFER
+	uint32_t map_index;
+#endif
 
 	/* store extra tx fragments provided by the driver */
 	struct {
@@ -137,6 +140,10 @@ wordstream_flags:CVG_NBUF_MAX_EXTRA_FRAGS + 1;
 	unsigned char tx_htt2_reserved:7;
 #endif /* QCA_TX_HTT2_SUPPORT */
 };
+#ifdef DEBUG_RX_RING_BUFFER
+#define NBUF_MAP_ID(skb) \
+	(((struct cvg_nbuf_cb *)((skb)->cb))->map_index)
+#endif
 #define NBUF_OWNER_ID(skb) \
 	(((struct cvg_nbuf_cb *)((skb)->cb))->owner_id)
 #define NBUF_OWNER_PRIV_DATA(skb) \

+ 94 - 0
core/dp/htt/htt_internal.h

@@ -125,6 +125,14 @@ struct htt_host_rx_desc_base {
 	(HTT_RX_STD_DESC_RESERVATION >> 2)
 
 #define HTT_RX_DESC_ALIGN_MASK 7        /* 8-byte alignment */
+#ifdef DEBUG_RX_RING_BUFFER
+#define HTT_RX_RING_BUFF_DBG_LIST          1024
+struct rx_buf_debug {
+	uint32_t paddr;
+	void     *vaddr;
+	bool     in_use;
+};
+#endif
 static inline struct htt_host_rx_desc_base *htt_rx_desc(cdf_nbuf_t msdu)
 {
 	return (struct htt_host_rx_desc_base *)
@@ -497,4 +505,90 @@ static inline int htt_rx_ipa_uc_detach(struct htt_pdev_t *pdev)
 	return 0;
 }
 #endif /* IPA_OFFLOAD */
+#ifdef DEBUG_RX_RING_BUFFER
+/**
+ * htt_rx_dbg_rxbuf_init() - init debug rx buff list
+ * @pdev: pdev handle
+ *
+ * Return: none
+ */
+static inline
+void htt_rx_dbg_rxbuf_init(struct htt_pdev_t *pdev)
+{
+	pdev->rx_buff_list = cdf_mem_malloc(
+				 HTT_RX_RING_BUFF_DBG_LIST *
+				 sizeof(struct rx_buf_debug));
+	if (!pdev->rx_buff_list) {
+		cdf_print("HTT: debug RX buffer allocation failed\n");
+		CDF_ASSERT(0);
+	}
+}
+/**
+ * htt_rx_dbg_rxbuf_set() - set element of rx buff list
+ * @pdev: pdev handle
+ * @paddr: physical address of netbuf
+ * @rx_netbuf: received netbuf
+ *
+ * Return: none
+ */
+static inline
+void htt_rx_dbg_rxbuf_set(struct htt_pdev_t *pdev,
+				uint32_t paddr,
+				cdf_nbuf_t rx_netbuf)
+{
+	if (pdev->rx_buff_list) {
+		pdev->rx_buff_list[pdev->rx_buff_index].paddr =
+					paddr;
+		pdev->rx_buff_list[pdev->rx_buff_index].in_use =
+					true;
+		pdev->rx_buff_list[pdev->rx_buff_index].vaddr =
+					rx_netbuf;
+		NBUF_MAP_ID(rx_netbuf) = pdev->rx_buff_index;
+		if (++pdev->rx_buff_index ==
+				HTT_RX_RING_BUFF_DBG_LIST)
+			pdev->rx_buff_index = 0;
+	}
+}
+/**
+ * htt_rx_dbg_rxbuf_set() - reset element of rx buff list
+ * @pdev: pdev handle
+ * @netbuf: rx sk_buff
+ * Return: none
+ */
+static inline
+void htt_rx_dbg_rxbuf_reset(struct htt_pdev_t *pdev,
+				cdf_nbuf_t netbuf)
+{
+	uint32_t index;
+
+	if (pdev->rx_buff_list) {
+		index = NBUF_MAP_ID(netbuf);
+		if (index < HTT_RX_RING_BUFF_DBG_LIST) {
+			pdev->rx_buff_list[index].in_use =
+						false;
+			pdev->rx_buff_list[index].paddr = 0;
+			pdev->rx_buff_list[index].vaddr = NULL;
+		}
+	}
+}
+#else
+static inline
+void htt_rx_dbg_rxbuf_init(struct htt_pdev_t *pdev)
+{
+	return;
+}
+static inline
+void htt_rx_dbg_rxbuf_set(struct htt_pdev_t *pdev,
+				uint32_t paddr,
+				cdf_nbuf_t rx_netbuf)
+{
+	return;
+}
+static inline
+void htt_rx_dbg_rxbuf_reset(struct htt_pdev_t *pdev,
+				cdf_nbuf_t netbuf)
+{
+	return;
+}
+#endif
 #endif /* _HTT_INTERNAL__H_ */

+ 3 - 0
core/dp/htt/htt_rx.c

@@ -311,6 +311,7 @@ void htt_rx_ring_fill_n(struct htt_pdev_t *pdev, int num)
 				cdf_nbuf_free(rx_netbuf);
 				goto fail;
 			}
+			htt_rx_dbg_rxbuf_set(pdev, paddr, rx_netbuf);
 		} else {
 			pdev->rx_ring.buf.netbufs_ring[idx] = rx_netbuf;
 		}
@@ -2031,6 +2032,7 @@ cdf_nbuf_t htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, uint32_t paddr)
 			else
 				cdf_mem_free(hash_entry);
 
+			htt_rx_dbg_rxbuf_reset(pdev, netbuf);
 			break;
 		}
 	}
@@ -2232,6 +2234,7 @@ int htt_rx_attach(struct htt_pdev_t *pdev)
 	pdev->rx_ring.rx_reset = 0;
 	pdev->rx_ring.htt_rx_restore = 0;
 #endif
+	htt_rx_dbg_rxbuf_init(pdev);
 	htt_rx_ring_fill_n(pdev, pdev->rx_ring.fill_level);
 
 	if (pdev->cfg.is_full_reorder_offload) {

+ 4 - 0
core/dp/htt/htt_types.h

@@ -357,6 +357,10 @@ struct htt_pdev_t {
 
 	struct htt_ipa_uc_tx_resource_t ipa_uc_tx_rsc;
 	struct htt_ipa_uc_rx_resource_t ipa_uc_rx_rsc;
+#ifdef DEBUG_RX_RING_BUFFER
+	struct rx_buf_debug *rx_buff_list;
+	int rx_buff_index;
+#endif
 };
 
 #define HTT_EPID_GET(_htt_pdev_hdl)  \