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
This commit is contained in:
Karthik Kantamneni 2020-07-20 21:37:25 +05:30 committed by snandini
parent c51a0329a6
commit 4a7bc29161
6 changed files with 23 additions and 10 deletions

2
Kbuild
View File

@ -3152,6 +3152,8 @@ cppflags-$(CONFIG_RX_DESC_SANITY_WAR) += -DRX_DESC_SANITY_WAR
cppflags-$(CONFIG_WBM_IDLE_LSB_WR_CNF_WAR) += -DWBM_IDLE_LSB_WRITE_CONFIRM_WAR cppflags-$(CONFIG_WBM_IDLE_LSB_WR_CNF_WAR) += -DWBM_IDLE_LSB_WRITE_CONFIRM_WAR
cppflags-$(CONFIG_DYNAMIC_RX_AGGREGATION) += -DWLAN_FEATURE_DYNAMIC_RX_AGGREGATION cppflags-$(CONFIG_DYNAMIC_RX_AGGREGATION) += -DWLAN_FEATURE_DYNAMIC_RX_AGGREGATION
cppflags-$(CONFIG_RX_HASH_DEBUG) += -DRX_HASH_DEBUG
ifeq ($(CONFIG_QCA6290_11AX), y) ifeq ($(CONFIG_QCA6290_11AX), y)
cppflags-y += -DQCA_WIFI_QCA6290_11AX -DQCA_WIFI_QCA6290_11AX_MU_UL cppflags-y += -DQCA_WIFI_QCA6290_11AX -DQCA_WIFI_QCA6290_11AX_MU_UL
endif endif

View File

@ -1058,7 +1058,6 @@ endif
ifneq ($(TARGET_BUILD_VARIANT),user) ifneq ($(TARGET_BUILD_VARIANT),user)
CONFIG_DESC_DUP_DETECT_DEBUG := y CONFIG_DESC_DUP_DETECT_DEBUG := y
CONFIG_DEBUG_RX_RING_BUFFER := y
endif endif
ifeq (y,$(findstring y,$(CONFIG_CNSS) $(CONFIG_CNSS_MODULE))) ifeq (y,$(findstring y,$(CONFIG_CNSS) $(CONFIG_CNSS_MODULE)))
@ -1128,6 +1127,12 @@ ifeq ($(CONFIG_ARCH_SDM660), y)
CONFIG_WLAN_FEATURE_PKT_CAPTURE := y CONFIG_WLAN_FEATURE_PKT_CAPTURE := y
endif endif
#Enable RX RING buffers debug
CONFIG_DEBUG_RX_RING_BUFFER := y
#Enable Hash debug
CONFIG_RX_HASH_DEBUG := y
#Enable connection manager #Enable connection manager
CONFIG_CM_ENABLE := n CONFIG_CM_ENABLE := n

View File

@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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)." "%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", "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, __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)); qdf_atomic_read(&pdev->rx_ring.refill_debt));
} }

View File

@ -226,7 +226,11 @@ struct htt_host_rx_desc_base {
* @posted: time-stamp when HTT message is recived * @posted: time-stamp when HTT message is recived
* @recvd : 0x48545452584D5367 ('HTTRXMSG') * @recvd : 0x48545452584D5367 ('HTTRXMSG')
*/ */
#ifdef CONFIG_SLUB_DEBUG_ON
#define HTT_RX_RING_BUFF_DBG_LIST (8 * 1024) #define HTT_RX_RING_BUFF_DBG_LIST (8 * 1024)
#else
#define HTT_RX_RING_BUFF_DBG_LIST (4 * 1024)
#endif
struct rx_buf_debug { struct rx_buf_debug {
qdf_dma_addr_t paddr; qdf_dma_addr_t paddr;
qdf_nbuf_t nbuf; 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_rx_in_order_netbuf_pop(htt_pdev_handle pdev, qdf_dma_addr_t paddr)
{ {
HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0); 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); paddr = htt_paddr_trim_to_37(paddr);
return htt_rx_hash_list_lookup(pdev, paddr); return htt_rx_hash_list_lookup(pdev, paddr);
} }

View File

@ -124,7 +124,7 @@ static inline qdf_nbuf_t htt_rx_netbuf_pop(htt_pdev_handle pdev)
idx++; idx++;
idx &= pdev->rx_ring.size_mask; idx &= pdev->rx_ring.size_mask;
pdev->rx_ring.sw_rd_idx.msdu_payld = idx; pdev->rx_ring.sw_rd_idx.msdu_payld = idx;
pdev->rx_ring.fill_cnt--; qdf_atomic_dec(&pdev->rx_ring.fill_cnt);
return msdu; return msdu;
} }
@ -483,7 +483,7 @@ moretofill:
} }
pdev->rx_ring.buf.paddrs_ring[idx] = paddr_marked; pdev->rx_ring.buf.paddrs_ring[idx] = paddr_marked;
pdev->rx_ring.fill_cnt++; qdf_atomic_inc(&pdev->rx_ring.fill_cnt);
num--; num--;
idx++; idx++;
@ -2049,7 +2049,8 @@ void htt_rx_fill_ring_count(htt_pdev_handle pdev)
{ {
int num_to_fill; 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 */); 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, htt_rx_ring_refill_retry, (void *)pdev,
QDF_TIMER_TYPE_SW); 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; pdev->rx_ring.pop_fail_cnt = 0;
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
pdev->rx_ring.dbg_ring_idx = 0; pdev->rx_ring.dbg_ring_idx = 0;

View File

@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * 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 */ 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_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 */ int pop_fail_cnt; /* # of nebuf pop failures */
/* /*