diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index f06b848c15..5895a265ed 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -29,6 +29,11 @@ #include "cdp_txrx_ops.h" #include "cdp_txrx_handle.h" #include "cdp_txrx_cmn_struct.h" + +#ifdef ENABLE_VERBOSE_DEBUG +extern bool is_dp_verbose_debug_enabled; +#endif + /****************************************************************************** * * Common Data Path Header File @@ -40,6 +45,30 @@ #define dp_info(params...) \ __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP, ## params) #define dp_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP, params) +#ifdef ENABLE_VERBOSE_DEBUG +/** + * @enum verbose_debug_module: + * if INI "enable_verbose_debug" has to set following bit positions to enable + * respective module's excessive logging, + * + * @hif_verbose_debug_mask: 1st bit [0th index] is for HIF module + * @hal_verbose_debug_mask: 2nd bit [1st index] is for HAL module + * @dp_verbose_debug_mask: 3rd bit [2nd index] is for DP module + */ +enum verbose_debug_module { + hif_vebose_debug_mask = 1 << 0, + hal_verbose_debug_mask = 1 << 1, + dp_verbose_debug_mask = 1 << 2, +}; + +#define dp_verbose_debug(params...) \ + if (unlikely(is_dp_verbose_debug_enabled)) \ + do {\ + QDF_TRACE_DEBUG(QDF_MODULE_ID_DP, params); \ + } while (0) +#else +#define dp_verbose_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP, params) +#endif #define dp_alert_rl(params...) QDF_TRACE_FATAL_RL(QDF_MODULE_ID_DP, params) #define dp_err_rl(params...) QDF_TRACE_ERROR_RL(QDF_MODULE_ID_DP, params) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index d6396780e7..4128796cfb 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -77,6 +77,9 @@ static void *dp_peer_create_wifi3(struct cdp_vdev *vdev_handle, static void dp_peer_delete_wifi3(void *peer_handle, uint32_t bitmap); static void dp_ppdu_ring_reset(struct dp_pdev *pdev); static void dp_ppdu_ring_cfg(struct dp_pdev *pdev); +#ifdef ENABLE_VERBOSE_DEBUG +bool is_dp_verbose_debug_enabled; +#endif #define DP_INTR_POLL_TIMER_MS 10 /* Generic AST entry aging timer value */ @@ -2601,6 +2604,22 @@ static void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring) } } +#ifdef ENABLE_VERBOSE_DEBUG +static void dp_enable_verbose_debug(struct dp_soc *soc) +{ + struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx; + + soc_cfg_ctx = soc->wlan_cfg_ctx; + + if (soc_cfg_ctx->per_pkt_trace & dp_verbose_debug_mask) + is_dp_verbose_debug_enabled = true; +} +#else +static void dp_enable_verbose_debug(struct dp_soc *soc) +{ +} +#endif + /* * dp_soc_cmn_setup() - Common SoC level initializion * @soc: Datapath SOC handle @@ -2625,6 +2644,9 @@ static int dp_soc_cmn_setup(struct dp_soc *soc) goto fail1; soc_cfg_ctx = soc->wlan_cfg_ctx; + + dp_enable_verbose_debug(soc); + /* Setup SRNG rings */ /* Common rings */ if (dp_srng_setup(soc, &soc->wbm_desc_rel_ring, SW2WBM_RELEASE, 0, 0, @@ -4211,6 +4233,7 @@ static int dp_soc_get_nss_cfg_wifi3(struct cdp_soc_t *cdp_soc) struct dp_soc *dsoc = (struct dp_soc *)cdp_soc; return wlan_cfg_get_dp_soc_nss_cfg(dsoc->wlan_cfg_ctx); } + /* * dp_soc_set_nss_cfg_wifi3() - SOC set nss config * @txrx_soc: Datapath SOC handle diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 00e1a31717..315b32a79a 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -596,6 +596,11 @@ WLAN_CFG_RXDMA_ERR_DST_RING_SIZE, \ CFG_VALUE_OR_DEFAULT, "RXDMA err destination ring") +#define CFG_DP_PER_PKT_LOGGING \ + CFG_INI_UINT("enable_verbose_debug", \ + 0, 0xffff, 0, \ + CFG_VALUE_OR_DEFAULT, "Enable excessive per packet logging") + #define CFG_DP_TX_FLOW_START_QUEUE_OFFSET \ CFG_INI_UINT("TxFlowStartQueueOffset", \ 0, 30, WLAN_CFG_TX_FLOW_START_QUEUE_OFFSET, \ @@ -685,6 +690,7 @@ CFG(CFG_DP_RXDMA_MONITOR_STATUS_RING) \ CFG(CFG_DP_RXDMA_MONITOR_DESC_RING) \ CFG(CFG_DP_RXDMA_ERR_DST_RING) \ + CFG(CFG_DP_PER_PKT_LOGGING) \ CFG(CFG_DP_TX_FLOW_START_QUEUE_OFFSET) \ CFG(CFG_DP_TX_FLOW_STOP_QUEUE_TH) \ CFG(CFG_DP_IPA_UC_TX_BUF_SIZE) \ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 6fac2191b3..201d08e1b6 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -333,7 +333,7 @@ struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *psoc) /*Enable checksum offload by default*/ wlan_cfg_ctx->tcp_udp_checksumoffload = cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD); - + wlan_cfg_ctx->per_pkt_trace = cfg_get(psoc, CFG_DP_PER_PKT_LOGGING); wlan_cfg_ctx->defrag_timeout_check = cfg_get(psoc, CFG_DP_DEFRAG_TIMEOUT_CHECK); wlan_cfg_ctx->rx_defrag_min_timeout = diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 19a245006c..2d3a4ca5ae 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -1,5 +1,5 @@ /* -* * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2019 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 @@ -203,6 +203,7 @@ struct wlan_cfg_dp_soc_ctxt { int reo_status_ring; int rxdma_refill_ring; int rxdma_err_dst_ring; + uint32_t per_pkt_trace; bool raw_mode_war; bool enable_data_stall_detection; bool disable_intra_bss_fwd; @@ -982,7 +983,6 @@ wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); bool wlan_cfg_get_dp_caps(struct wlan_cfg_dp_soc_ctxt *cfg, enum cdp_capabilities dp_caps); - #ifdef QCA_LL_TX_FLOW_CONTROL_V2 int wlan_cfg_get_tx_flow_stop_queue_th(struct wlan_cfg_dp_soc_ctxt *cfg);