diff options
| author | Karthick S <skarthic@qti.qualcomm.com> | 2015-07-25 12:11:53 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-07-29 17:44:00 +0530 |
| commit | 1583d26abbbb72f73632d3690b8ec7e864cce11e (patch) | |
| tree | 29b34db685a488e758a4abf23d2d242c9cd66b67 | |
| parent | 7a56f0999a4829cb86a6ea55ec66ffef5add778e (diff) | |
qcacld-2.0: debug info for full reorder offload
Log last 1K physical addresses and corresponding virtual addresses of the
Rx buffers.
Change-Id: I2bb4502fdd92b362199b579ec3cceaa691d4691f
CRs-Fixed: 864569
| -rw-r--r-- | CORE/CLD_TXRX/HTT/htt_rx.c | 31 | ||||
| -rw-r--r-- | CORE/CLD_TXRX/HTT/htt_types.h | 18 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/adf/linux/adf_nbuf_pvt.h | 8 |
3 files changed, 57 insertions, 0 deletions
diff --git a/CORE/CLD_TXRX/HTT/htt_rx.c b/CORE/CLD_TXRX/HTT/htt_rx.c index 267f79370676..24e48b9abc77 100644 --- a/CORE/CLD_TXRX/HTT/htt_rx.c +++ b/CORE/CLD_TXRX/HTT/htt_rx.c @@ -296,6 +296,16 @@ htt_rx_ring_fill_n(struct htt_pdev_t *pdev, int num) adf_nbuf_free(rx_netbuf); goto fail; } +#ifdef DEBUG_RX_RING_BUFFER + 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; + } +#endif } else { pdev->rx_ring.buf.netbufs_ring[idx] = rx_netbuf; } @@ -2476,6 +2486,9 @@ htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, u_int32_t paddr) HTT_RX_HASH_COOKIE_CHECK(hash_entry); if (hash_entry->paddr == paddr) { +#ifdef DEBUG_RX_RING_BUFFER + uint32_t index; +#endif /* Found the entry corresponding to paddr */ netbuf = hash_entry->netbuf; htt_list_remove(&hash_entry->listnode); @@ -2488,6 +2501,16 @@ htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, u_int32_t paddr) else { adf_os_mem_free(hash_entry); } +#ifdef DEBUG_RX_RING_BUFFER + 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; + } + } +#endif break; } } @@ -2722,6 +2745,14 @@ htt_rx_attach(struct htt_pdev_t *pdev) pdev->rx_ring.rx_reset = 0; pdev->rx_ring.htt_rx_restore = 0; #endif +#ifdef DEBUG_RX_RING_BUFFER + pdev->rx_buff_list = adf_os_mem_alloc(pdev->osdev, + HTT_RX_RING_BUFF_DBG_LIST * + sizeof(struct rx_buf_debug)); + if (!pdev->rx_buff_list) { + adf_os_print("HTT: debug RX buffer allocation failed\n"); + } +#endif htt_rx_ring_fill_n(pdev, pdev->rx_ring.fill_level); if (pdev->cfg.is_full_reorder_offload) { diff --git a/CORE/CLD_TXRX/HTT/htt_types.h b/CORE/CLD_TXRX/HTT/htt_types.h index 59780705fb1c..f4c3f2916e04 100644 --- a/CORE/CLD_TXRX/HTT/htt_types.h +++ b/CORE/CLD_TXRX/HTT/htt_types.h @@ -61,6 +61,9 @@ #define HTT_TX_EXT_TID_INVALID 31 #define HTT_TX_EXT_TID_NONPAUSE 19 +#ifdef DEBUG_RX_RING_BUFFER +#define HTT_RX_RING_BUFF_DBG_LIST 1024 +#endif /** * @brief General specification of the tx frame contents * @@ -197,6 +200,15 @@ struct htt_tx_credit_t adf_os_atomic_t target_delta; }; +#ifdef DEBUG_RX_RING_BUFFER +struct rx_buf_debug { + uint32_t paddr; + void * vaddr; + bool in_use; +}; +#endif + + struct htt_pdev_t { ol_pdev_handle ctrl_pdev; ol_txrx_pdev_handle txrx_pdev; @@ -353,6 +365,12 @@ struct htt_pdev_t { #endif /* IPA_UC_OFFLOAD */ struct htt_tx_credit_t htt_tx_credit; + +#ifdef DEBUG_RX_RING_BUFFER + struct rx_buf_debug *rx_buff_list; + int rx_buff_index; +#endif + }; #endif /* _HTT_TYPES__H_ */ diff --git a/CORE/SERVICES/COMMON/adf/linux/adf_nbuf_pvt.h b/CORE/SERVICES/COMMON/adf/linux/adf_nbuf_pvt.h index 542540c7f5e1..d376f41ee903 100644 --- a/CORE/SERVICES/COMMON/adf/linux/adf_nbuf_pvt.h +++ b/CORE/SERVICES/COMMON/adf/linux/adf_nbuf_pvt.h @@ -78,6 +78,9 @@ struct cvg_nbuf_cb { union { struct sk_buff *parent; void *ptr; +#ifdef DEBUG_RX_RING_BUFFER + uint32_t map_index; +#endif } txrx_field; /* @@ -128,6 +131,11 @@ struct cvg_nbuf_cb { (((struct cvg_nbuf_cb *)((skb)->cb))->txrx_field.ptr) #endif +#ifdef DEBUG_RX_RING_BUFFER +#define NBUF_MAP_ID(skb) \ + (((struct cvg_nbuf_cb *)((skb)->cb))->txrx_field.map_index) +#endif + #ifdef QCA_MDM_DEVICE #define NBUF_OWNER_ID(skb) \ (((struct cvg_nbuf_cb *)((skb)->cb))->owner_id) |
