qcacld-3.0: Enhance logging in RX path to check refill failures

Enable logging feature which helps to check rx ring refill failure.

Currently rx ring refill count is updated same time from multiple
places without protection, so use atomic variable for refill count.

CRS-Fixed: 2740225
Change-Id: Icd88d351cb15d0f18edf0b986e4de95dbe4e6989
这个提交包含在:
Karthik Kantamneni
2020-07-20 21:37:25 +05:30
提交者 snandini
父节点 c51a0329a6
当前提交 4a7bc29161
修改 6 个文件,包含 23 行新增10 行删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2011, 2014-2019-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -855,7 +855,7 @@ void htt_log_rx_ring_info(htt_pdev_handle pdev)
"%s: Data Stall Detected with reason 4 (=FW_RX_REFILL_FAILED)."
"src htt rx ring: space for %d elements, filled with %d buffers, buffers in the ring %d, refill debt %d",
__func__, pdev->rx_ring.size, pdev->rx_ring.fill_level,
pdev->rx_ring.fill_cnt,
qdf_atomic_read(&pdev->rx_ring.fill_cnt),
qdf_atomic_read(&pdev->rx_ring.refill_debt));
}

查看文件

@@ -226,7 +226,11 @@ struct htt_host_rx_desc_base {
* @posted: time-stamp when HTT message is recived
* @recvd : 0x48545452584D5367 ('HTTRXMSG')
*/
#ifdef CONFIG_SLUB_DEBUG_ON
#define HTT_RX_RING_BUFF_DBG_LIST (8 * 1024)
#else
#define HTT_RX_RING_BUFF_DBG_LIST (4 * 1024)
#endif
struct rx_buf_debug {
qdf_dma_addr_t paddr;
qdf_nbuf_t nbuf;
@@ -1094,7 +1098,7 @@ static inline qdf_nbuf_t
htt_rx_in_order_netbuf_pop(htt_pdev_handle pdev, qdf_dma_addr_t paddr)
{
HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0);
pdev->rx_ring.fill_cnt--;
qdf_atomic_dec(&pdev->rx_ring.fill_cnt);
paddr = htt_paddr_trim_to_37(paddr);
return htt_rx_hash_list_lookup(pdev, paddr);
}

查看文件

@@ -124,7 +124,7 @@ static inline qdf_nbuf_t htt_rx_netbuf_pop(htt_pdev_handle pdev)
idx++;
idx &= pdev->rx_ring.size_mask;
pdev->rx_ring.sw_rd_idx.msdu_payld = idx;
pdev->rx_ring.fill_cnt--;
qdf_atomic_dec(&pdev->rx_ring.fill_cnt);
return msdu;
}
@@ -483,7 +483,7 @@ moretofill:
}
pdev->rx_ring.buf.paddrs_ring[idx] = paddr_marked;
pdev->rx_ring.fill_cnt++;
qdf_atomic_inc(&pdev->rx_ring.fill_cnt);
num--;
idx++;
@@ -2049,7 +2049,8 @@ void htt_rx_fill_ring_count(htt_pdev_handle pdev)
{
int num_to_fill;
num_to_fill = pdev->rx_ring.fill_level - pdev->rx_ring.fill_cnt;
num_to_fill = pdev->rx_ring.fill_level -
qdf_atomic_read(&pdev->rx_ring.fill_cnt);
htt_rx_ring_fill_n(pdev, num_to_fill /* okay if <= 0 */);
}
@@ -2137,7 +2138,7 @@ int htt_rx_attach(struct htt_pdev_t *pdev)
htt_rx_ring_refill_retry, (void *)pdev,
QDF_TIMER_TYPE_SW);
pdev->rx_ring.fill_cnt = 0;
qdf_atomic_init(&pdev->rx_ring.fill_cnt);
pdev->rx_ring.pop_fail_cnt = 0;
#ifdef DEBUG_DMA_DONE
pdev->rx_ring.dbg_ring_idx = 0;

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2011, 2014-2018-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -297,7 +297,8 @@ struct htt_pdev_t {
uint32_t size_mask; /* size - 1, at least 16 bits long */
int fill_level; /* how many rx buffers to keep in the ring */
int fill_cnt; /* # of rx buffers (full+empty) in the ring */
/* # of rx buffers (full+empty) in the ring */
qdf_atomic_t fill_cnt;
int pop_fail_cnt; /* # of nebuf pop failures */
/*