From 6ea48347adeba04794697392c20439692e9d8dff Mon Sep 17 00:00:00 2001 From: Manikanta Pubbisetty Date: Wed, 6 Nov 2024 15:37:16 +0530 Subject: [PATCH] qcacmn: Avoid buffer allocation during monitor vdev bringup Ideally monitor buffers are allocated during driver init, but when DP resource manager is enabled, buffers are allocated on the go during monitor mode bringup resulting in the allocation of huge number of buffers in one shot. This will sometime hogs CPU for longer durations making CPUs unavailable for other high priority tasks resulting in asserts. Avoid allocations in one shot during monitor vdev bringup when DP resource manager is enabled to avoid this, required buffers will be allocated eventually from a different context. Change-Id: I5b827869dafdc04d2003e5327bd407dd4c8e4a8c CRs-Fixed: 3963082 --- dp/inc/cdp_txrx_cmn_struct.h | 3 +++ dp/wifi3.0/dp_main.c | 6 ++++++ dp/wifi3.0/dp_types.h | 2 ++ dp/wifi3.0/monitor/1.0/dp_mon_1.0.c | 9 +++++++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 3b943ffe8e..201a29e247 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -1691,6 +1691,7 @@ typedef union cdp_config_param_t { uint16_t peer_id; struct cdp_pkt_info pkts; } pkt_info; + bool cdp_dyn_resource_mgr_support; } cdp_config_param_type; /** @@ -1880,6 +1881,7 @@ enum cdp_vdev_param_type { * @CDP_SCAN_RADIO_SUPPORT: Scan Radio capability * @CDP_SAWF_MSDUQ_RECLAIM_SUPPORT: To initiate msduq reclaim related functions * @CDP_VDEV_TX_NSS_SUPPORT: FW Support vdev Tx NSS command + * @CDP_DYN_RESOURCE_MGR_SUPPORT: Dynamic RX buffer allocation support */ enum cdp_psoc_param_type { CDP_ENABLE_RATE_STATS, @@ -1918,6 +1920,7 @@ enum cdp_psoc_param_type { CDP_SAWF_MSDUQ_RECLAIM_SUPPORT, #endif CDP_VDEV_TX_NSS_SUPPORT, + CDP_DYN_RESOURCE_MGR_SUPPORT, }; #ifdef CONFIG_AP_PLATFORM diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index b45c9670ba..d28af5955b 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -9771,6 +9771,12 @@ dp_set_psoc_param(struct cdp_soc_t *cdp_soc, dp_info("FW supports Tx Vdev NSS report: %d", soc->features.vdev_tx_nss_support); break; + case CDP_DYN_RESOURCE_MGR_SUPPORT: + soc->features.dyn_resource_mgr_support = + val.cdp_dyn_resource_mgr_support; + dp_info("Dynamic resource manager support: %u", + soc->features.dyn_resource_mgr_support); + break; default: break; } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index bb73c12dca..3a6804abd5 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -2901,6 +2901,7 @@ struct dp_arch_ops { * @fw_support_ml_monitor: FW support ML monitor mode * @dp_ipa_opt_dp_ctrl_refill: opt_dp_ctrl refill support * @vdev_tx_nss_support: FW supports vdev Tx NSS report. + * @dyn_resource_mgr_support: Dynamic RX buffer allocation support */ struct dp_soc_features { uint8_t pn_in_reo_dest:1, @@ -2914,6 +2915,7 @@ struct dp_soc_features { bool dp_ipa_opt_dp_ctrl_refill; #endif bool vdev_tx_nss_support; + bool dyn_resource_mgr_support; }; enum sysfs_printing_mode { diff --git a/dp/wifi3.0/monitor/1.0/dp_mon_1.0.c b/dp/wifi3.0/monitor/1.0/dp_mon_1.0.c index 4d6a8a0fe5..6102351fdd 100644 --- a/dp/wifi3.0/monitor/1.0/dp_mon_1.0.c +++ b/dp/wifi3.0/monitor/1.0/dp_mon_1.0.c @@ -437,8 +437,13 @@ QDF_STATUS dp_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev) mac_id, pdev->pdev_id); - dp_rx_pdev_mon_buf_buffers_alloc(pdev, mac_for_pdev, - FALSE); + /* Skip buffer allocation if dynamic resource manager + * is enabled, these will be allocated from a different + * context. + */ + if (!soc->features.dyn_resource_mgr_support) + dp_rx_pdev_mon_buf_buffers_alloc( + pdev, mac_for_pdev, FALSE); mon_buf_ring = &pdev->soc->rxdma_mon_buf_ring[mac_for_pdev]; /*