qcacmn: Add support for fragmented history recording

Currently the history recording for any debug purpose
is done using a contiguous memory chunk. For certain
history like tx_hw_ring, tx desc or tx completion desc
history, the amount of contiguous memory required is
very huge (order 7 or 8 allocation), which have a
higher probability of failing.

In order to mitigate the above scenario, introduce the
support for recording debug history into fragmented
chunks of memory, thereby reducing the requirement of
contiguous memory.

Change-Id: Iac4fb38b6d4b095766520899853e68b4c2b83afc
CRs-Fixed: 3282269
此提交包含在:
Rakesh Pillai
2022-09-01 10:44:05 -07:00
提交者 Madan Koyyalamudi
父節點 04dd6c626a
當前提交 d706698dd1
共有 5 個檔案被更改,包括 183 行新增46 行删除

查看文件

@@ -5374,17 +5374,18 @@ static void dp_free_ipa_rx_alt_refill_buf_ring(struct dp_soc *soc,
*/
static void dp_soc_tx_hw_desc_history_attach(struct dp_soc *soc)
{
soc->tx_hw_desc_history = dp_context_alloc_mem(
soc, DP_TX_HW_DESC_HIST_TYPE,
sizeof(*soc->tx_hw_desc_history));
if (soc->tx_hw_desc_history)
soc->tx_hw_desc_history->index = 0;
dp_soc_frag_history_attach(soc, &soc->tx_hw_desc_history,
DP_TX_HW_DESC_HIST_MAX_SLOTS,
DP_TX_HW_DESC_HIST_PER_SLOT_MAX,
sizeof(struct dp_tx_hw_desc_evt),
true, DP_TX_HW_DESC_HIST_TYPE);
}
static void dp_soc_tx_hw_desc_history_detach(struct dp_soc *soc)
{
dp_context_free_mem(soc, DP_TX_HW_DESC_HIST_TYPE,
soc->tx_hw_desc_history);
dp_soc_frag_history_detach(soc, &soc->tx_hw_desc_history,
DP_TX_HW_DESC_HIST_MAX_SLOTS,
true, DP_TX_HW_DESC_HIST_TYPE);
}
#else /* DP_TX_HW_DESC_HISTORY */
@@ -5561,20 +5562,16 @@ static void dp_soc_mon_status_ring_history_detach(struct dp_soc *soc)
*/
static void dp_soc_tx_history_attach(struct dp_soc *soc)
{
uint32_t tx_tcl_hist_size;
uint32_t tx_comp_hist_size;
tx_tcl_hist_size = sizeof(*soc->tx_tcl_history);
soc->tx_tcl_history = dp_context_alloc_mem(soc, DP_TX_TCL_HIST_TYPE,
tx_tcl_hist_size);
if (soc->tx_tcl_history)
qdf_atomic_init(&soc->tx_tcl_history->index);
tx_comp_hist_size = sizeof(*soc->tx_comp_history);
soc->tx_comp_history = dp_context_alloc_mem(soc, DP_TX_COMP_HIST_TYPE,
tx_comp_hist_size);
if (soc->tx_comp_history)
qdf_atomic_init(&soc->tx_comp_history->index);
dp_soc_frag_history_attach(soc, &soc->tx_tcl_history,
DP_TX_TCL_HIST_MAX_SLOTS,
DP_TX_TCL_HIST_PER_SLOT_MAX,
sizeof(struct dp_tx_desc_event),
true, DP_TX_TCL_HIST_TYPE);
dp_soc_frag_history_attach(soc, &soc->tx_comp_history,
DP_TX_COMP_HIST_MAX_SLOTS,
DP_TX_COMP_HIST_PER_SLOT_MAX,
sizeof(struct dp_tx_desc_event),
true, DP_TX_COMP_HIST_TYPE);
}
/**
@@ -5588,8 +5585,12 @@ static void dp_soc_tx_history_attach(struct dp_soc *soc)
*/
static void dp_soc_tx_history_detach(struct dp_soc *soc)
{
dp_context_free_mem(soc, DP_TX_TCL_HIST_TYPE, soc->tx_tcl_history);
dp_context_free_mem(soc, DP_TX_COMP_HIST_TYPE, soc->tx_comp_history);
dp_soc_frag_history_detach(soc, &soc->tx_tcl_history,
DP_TX_TCL_HIST_MAX_SLOTS,
true, DP_TX_TCL_HIST_TYPE);
dp_soc_frag_history_detach(soc, &soc->tx_comp_history,
DP_TX_COMP_HIST_MAX_SLOTS,
true, DP_TX_COMP_HIST_TYPE);
}
#else