diff --git a/Kbuild b/Kbuild index df5368b57d..a3060d27fd 100644 --- a/Kbuild +++ b/Kbuild @@ -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_DYNAMIC_RX_AGGREGATION) += -DWLAN_FEATURE_DYNAMIC_RX_AGGREGATION +cppflags-$(CONFIG_RX_HASH_DEBUG) += -DRX_HASH_DEBUG + ifeq ($(CONFIG_QCA6290_11AX), y) cppflags-y += -DQCA_WIFI_QCA6290_11AX -DQCA_WIFI_QCA6290_11AX_MU_UL endif diff --git a/configs/default_defconfig b/configs/default_defconfig index 972e3fde34..4d64a8146f 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -1058,7 +1058,6 @@ endif ifneq ($(TARGET_BUILD_VARIANT),user) CONFIG_DESC_DUP_DETECT_DEBUG := y -CONFIG_DEBUG_RX_RING_BUFFER := y endif ifeq (y,$(findstring y,$(CONFIG_CNSS) $(CONFIG_CNSS_MODULE))) @@ -1128,6 +1127,12 @@ ifeq ($(CONFIG_ARCH_SDM660), y) CONFIG_WLAN_FEATURE_PKT_CAPTURE := y endif +#Enable RX RING buffers debug +CONFIG_DEBUG_RX_RING_BUFFER := y + +#Enable Hash debug +CONFIG_RX_HASH_DEBUG := y + #Enable connection manager CONFIG_CM_ENABLE := n diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c index 14e0174e67..566f189b8e 100644 --- a/core/dp/htt/htt.c +++ b/core/dp/htt/htt.c @@ -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)); } diff --git a/core/dp/htt/htt_internal.h b/core/dp/htt/htt_internal.h index 6e05b2f2f3..f49dba0300 100644 --- a/core/dp/htt/htt_internal.h +++ b/core/dp/htt/htt_internal.h @@ -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); } diff --git a/core/dp/htt/htt_rx_ll.c b/core/dp/htt/htt_rx_ll.c index 7148c9afb4..66c2f783b8 100644 --- a/core/dp/htt/htt_rx_ll.c +++ b/core/dp/htt/htt_rx_ll.c @@ -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; diff --git a/core/dp/htt/htt_types.h b/core/dp/htt/htt_types.h index 0ad01dec88..386d8d968c 100644 --- a/core/dp/htt/htt_types.h +++ b/core/dp/htt/htt_types.h @@ -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 */ /*