From 125174cdd17df597ffd06b80bbd0f91d81be7101 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Sun, 12 Dec 2021 09:43:20 -0800 Subject: [PATCH] qcacmn: Initialize only one RXDMA Monitor Status ring For WCN7850, the first mac (i.e.. MAC0) is capable of 2G/5G and 6G data transfer. Hence initialize and use only on RXDMA monitor status ring. Change-Id: Idb6e23a887a9ed32a52dd54765e5ed3c6a12df06 CRs-Fixed: 3094138 --- dp/wifi3.0/dp_htt.c | 4 +++- dp/wifi3.0/dp_main.c | 2 ++ dp/wifi3.0/dp_stats.c | 4 +++- dp/wifi3.0/monitor/1.0/dp_mon_1.0.c | 19 +++++++++++++++---- dp/wifi3.0/monitor/dp_mon.c | 4 +++- dp/wifi3.0/monitor/dp_mon_filter.c | 3 +++ wlan_cfg/wlan_cfg.c | 10 ++++++++-- wlan_cfg/wlan_cfg.h | 2 ++ 8 files changed, 39 insertions(+), 9 deletions(-) diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 606b31c100..c60a4dd0a3 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -2600,7 +2600,9 @@ static void dp_queue_ring_stats(struct dp_pdev *pdev) qdf_assert_always(++j < DP_MAX_SRNGS); } - for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { lmac_id = dp_get_lmac_id_for_pdev_id(pdev->soc, mac_id, pdev->pdev_id); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 035687db99..a57dd3dde2 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -14261,6 +14261,8 @@ static void dp_soc_cfg_init(struct dp_soc *soc) soc->wlan_cfg_ctx->rxdma1_enable = 0; soc->wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev = 1; + /* use only MAC0 status ring */ + soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev = 1; break; case TARGET_TYPE_QCA8074: wlan_cfg_set_raw_mode_war(soc->wlan_cfg_ctx, true); diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index 133e9025b4..4c43fda1ed 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -5366,7 +5366,9 @@ dp_print_ring_stats(struct dp_pdev *pdev) &pdev->rx_mac_buf_ring[i], RXDMA_BUF); - for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { lmac_id = dp_get_lmac_id_for_pdev_id(pdev->soc, mac_id, pdev->pdev_id); 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 c3a8c3caca..2040764098 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 @@ -161,7 +161,9 @@ void dp_mon_rings_deinit_1_0(struct dp_pdev *pdev) pdev_cfg_ctx = pdev->wlan_cfg_ctx; - for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev->pdev_id); @@ -181,7 +183,9 @@ void dp_mon_rings_free_1_0(struct dp_pdev *pdev) pdev_cfg_ctx = pdev->wlan_cfg_ctx; - for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev->pdev_id); @@ -200,7 +204,9 @@ QDF_STATUS dp_mon_rings_init_1_0(struct dp_pdev *pdev) pdev_cfg_ctx = pdev->wlan_cfg_ctx; - for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev->pdev_id); @@ -231,7 +237,9 @@ QDF_STATUS dp_mon_rings_alloc_1_0(struct dp_pdev *pdev) pdev_cfg_ctx = pdev->wlan_cfg_ctx; - for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++) { + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { int lmac_id = dp_get_lmac_id_for_pdev_id(soc, mac_id, pdev->pdev_id); entries = wlan_cfg_get_dma_mon_stat_ring_size(pdev_cfg_ctx); @@ -636,6 +644,9 @@ QDF_STATUS dp_mon_htt_srng_setup_1_0(struct dp_soc *soc, if (status != QDF_STATUS_SUCCESS) return status; + if (!soc->rxdma_mon_status_ring[mac_id].hal_srng) + return QDF_STATUS_SUCCESS; + status = htt_srng_setup(soc->htt_handle, mac_for_pdev, soc->rxdma_mon_status_ring[mac_id] .hal_srng, diff --git a/dp/wifi3.0/monitor/dp_mon.c b/dp/wifi3.0/monitor/dp_mon.c index 28242bae45..30490ae281 100644 --- a/dp/wifi3.0/monitor/dp_mon.c +++ b/dp/wifi3.0/monitor/dp_mon.c @@ -1403,7 +1403,9 @@ static void dp_cfr_filter(struct cdp_soc_t *soc_hdl, htt_tlv_filter.mo_data_filter = filter_val->mo_data; } - for (mac_id = 0; mac_id < max_mac_rings; mac_id++) { + for (mac_id = 0; + mac_id < soc->wlan_cfg_ctx->num_rxdma_status_rings_per_pdev; + mac_id++) { int mac_for_pdev = dp_get_mac_id_for_pdev(mac_id, pdev->pdev_id); diff --git a/dp/wifi3.0/monitor/dp_mon_filter.c b/dp/wifi3.0/monitor/dp_mon_filter.c index 54f8b55b4b..3689a79ba3 100644 --- a/dp/wifi3.0/monitor/dp_mon_filter.c +++ b/dp/wifi3.0/monitor/dp_mon_filter.c @@ -92,6 +92,9 @@ dp_mon_ht2_rx_ring_cfg(struct dp_soc *soc, return QDF_STATUS_E_FAILURE; } + if (!hal_ring_hdl) + continue; + status = htt_h2t_rx_ring_cfg(soc->htt_handle, mac_for_pdev, hal_ring_hdl, hal_ring_type, ring_buf_size, diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index cbc9f3de4b..d0a110c33d 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -201,16 +201,20 @@ static const uint8_t rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { #ifdef CONFIG_BERYLLIUM static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { - [13] = WLAN_CFG_RXDMA2HOST_RING_MASK_0 | - WLAN_CFG_RXDMA2HOST_RING_MASK_1}; + [13] = WLAN_CFG_RXDMA2HOST_RING_MASK_0}; #else static const uint8_t rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { [5] = WLAN_CFG_RXDMA2HOST_RING_MASK_0, [6] = WLAN_CFG_RXDMA2HOST_RING_MASK_1}; #endif /* CONFIG_BERYLLIUM */ +#ifdef CONFIG_BERYLLIUM +static const uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { + [5] = WLAN_CFG_RX_MON_RING_MASK_0}; +#else static const uint8_t rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { [1] = WLAN_CFG_RX_MON_RING_MASK_0, [2] = WLAN_CFG_RX_MON_RING_MASK_1}; +#endif static const uint8_t host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = {0}; @@ -2141,6 +2145,8 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) PKT_CAPTURE_MODE_DATA_ONLY; #endif wlan_cfg_ctx->num_rxdma_dst_rings_per_pdev = NUM_RXDMA_RINGS_PER_PDEV; + wlan_cfg_ctx->num_rxdma_status_rings_per_pdev = + NUM_RXDMA_RINGS_PER_PDEV; return wlan_cfg_ctx; } diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 1ff07a709a..e4d5b11a7c 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -250,6 +250,7 @@ struct wlan_srng_cfg { * @vdev_stats_hw_offload_config: HW vdev stats config * @vdev_stats_hw_offload_timer: HW vdev stats timer duration * @txmon_hw_support: TxMON HW support + * @num_rxdma_status_rings_per_pdev: Num RXDMA status rings */ struct wlan_cfg_dp_soc_ctxt { int num_int_ctxts; @@ -410,6 +411,7 @@ struct wlan_cfg_dp_soc_ctxt { #endif uint8_t num_rxdma_dst_rings_per_pdev; bool txmon_hw_support; + uint8_t num_rxdma_status_rings_per_pdev; }; /**