From 0d69530ee2bc14cdec202b62bae996b66e71b98a Mon Sep 17 00:00:00 2001 From: Nandha Kishore Easwaran Date: Wed, 12 Feb 2020 17:49:51 +0530 Subject: [PATCH] qcacmn: Interrupt changes in MSI path 1) Modified MSI interrupt mask for QCN9000 so that rx and tx interrupts can be decoupled. 2) Removed lmac interrupts from polling mode and switched them to msi interrupts. Added MSI masks for lmac rings. 3) Enable monitor mode LWM interrupt. This was already enabled in integrated ahb interrupts but missing in msi. Replenish buffers in RXDMA refill ring based on low threshold interrupts in addition to regular Rx processing. Also made interrupt batch counter threshold as 8 for monitor status ring since ppdu end interrupts are not available in PCI chipset and require srng msi interrupts to reap monitor status ring Change-Id: I5c84b14d6b0a9c26fb3f0d67c349e79751a60861 --- dp/wifi3.0/dp_main.c | 21 +++++++++++++++++---- wlan_cfg/wlan_cfg.c | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 0563cea7d7..3b1e99c725 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1075,8 +1075,7 @@ static int dp_srng_calculate_msi_group(struct dp_soc *soc, break; case RXDMA_MONITOR_BUF: - /* TODO: support low_thresh interrupt */ - return -QDF_STATUS_E_NOENT; + grp_mask = &soc->wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[0]; break; case TCL_DATA: @@ -1333,6 +1332,15 @@ dp_srng_configure_interrupt_thresholds(struct dp_soc *soc, ring_params->flags |= HAL_SRNG_LOW_THRES_INTR_ENABLE; ring_params->intr_batch_cntr_thres_entries = 0; } + + /* In case of PCI chipsets, we dont have PPDU end interrupts, + * so MONITOR STATUS ring is reaped by receiving MSI from srng. + * Keep batch threshold as 8 so that interrupt is received for + * every 4 packets in MONITOR_STATUS ring + */ + if ((ring_type == RXDMA_MONITOR_STATUS) && + (soc->intr_mode == DP_INTR_MSI)) + ring_params->intr_batch_cntr_thres_entries = 4; } #endif @@ -2038,6 +2046,10 @@ static void dp_soc_interrupt_map_calculate_msi(struct dp_soc *soc, soc->wlan_cfg_ctx, intr_ctx_num); int rxdma2host_ring_mask = wlan_cfg_get_rxdma2host_ring_mask( soc->wlan_cfg_ctx, intr_ctx_num); + int host2rxdma_ring_mask = wlan_cfg_get_host2rxdma_ring_mask( + soc->wlan_cfg_ctx, intr_ctx_num); + int host2rxdma_mon_ring_mask = wlan_cfg_get_host2rxdma_mon_ring_mask( + soc->wlan_cfg_ctx, intr_ctx_num); unsigned int vector = (intr_ctx_num % msi_vector_count) + msi_vector_start; @@ -2046,7 +2058,8 @@ static void dp_soc_interrupt_map_calculate_msi(struct dp_soc *soc, soc->intr_mode = DP_INTR_MSI; if (tx_mask | rx_mask | rx_mon_mask | rx_err_ring_mask | - rx_wbm_rel_ring_mask | reo_status_ring_mask | rxdma2host_ring_mask) + rx_wbm_rel_ring_mask | reo_status_ring_mask | rxdma2host_ring_mask | + host2rxdma_ring_mask | host2rxdma_mon_ring_mask) irq_id_map[num_irq++] = pld_get_msi_irq(soc->osdev->dev, vector); @@ -11307,7 +11320,7 @@ void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle, soc->hw_nac_monitor_support = 1; soc->per_tid_basize_max_tid = 8; soc->num_hw_dscp_tid_map = HAL_MAX_HW_DSCP_TID_V2_MAPS; - soc->lmac_polled_mode = 1; + soc->lmac_polled_mode = 0; soc->wbm_release_desc_rx_sg_support = 1; if (cfg_get(soc->ctrl_psoc, CFG_DP_FULL_MON_MODE)) soc->full_mon_mode = true; diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 5fd19bdc0e..d86b26b193 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -166,43 +166,79 @@ static const int tx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { WLAN_CFG_TX_RING_MASK_3}; static const int rx_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, + 0, WLAN_CFG_RX_RING_MASK_0, WLAN_CFG_RX_RING_MASK_1, WLAN_CFG_RX_RING_MASK_2, WLAN_CFG_RX_RING_MASK_3}; static const int rx_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { - 0, 0, 0}; + 0, + 0, + 0, + WLAN_CFG_RX_MON_RING_MASK_0, + WLAN_CFG_RX_MON_RING_MASK_1, + WLAN_CFG_RX_MON_RING_MASK_2}; static const int host2rxdma_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { - 0, 0, 0, 0}; + 0, + 0, + 0, + WLAN_CFG_HOST2RXDMA_RING_MASK_0, + WLAN_CFG_HOST2RXDMA_RING_MASK_1, + WLAN_CFG_HOST2RXDMA_RING_MASK_2, + WLAN_CFG_HOST2RXDMA_RING_MASK_3}; static const int rxdma2host_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { - 0, 0, 0, 0}; + 0, + 0, + 0, + WLAN_CFG_RXDMA2HOST_RING_MASK_0, + WLAN_CFG_RXDMA2HOST_RING_MASK_1, + WLAN_CFG_RXDMA2HOST_RING_MASK_2, + WLAN_CFG_RXDMA2HOST_RING_MASK_3}; static const int host2rxdma_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2}; static const int rxdma2host_mon_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2}; static const int rx_err_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, WLAN_CFG_RX_ERR_RING_MASK_0, WLAN_CFG_RX_ERR_RING_MASK_1, WLAN_CFG_RX_ERR_RING_MASK_2, WLAN_CFG_RX_ERR_RING_MASK_3}; static const int rx_wbm_rel_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, WLAN_CFG_RX_WBM_REL_RING_MASK_0, WLAN_CFG_RX_WBM_REL_RING_MASK_1, WLAN_CFG_RX_WBM_REL_RING_MASK_2, WLAN_CFG_RX_WBM_REL_RING_MASK_3}; static const int reo_status_ring_mask_msi[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, WLAN_CFG_REO_STATUS_RING_MASK_0, WLAN_CFG_REO_STATUS_RING_MASK_1, WLAN_CFG_REO_STATUS_RING_MASK_2,