From 6e25c408bd9e94ff5c2f4a0f946619de20fc9928 Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Thu, 11 Nov 2021 16:18:33 +0800 Subject: [PATCH 1/5] qcacmn: Fix TSO nbuf unmap missing issue if tx hw enqueue failed, tx descriptor is released first, nbuf pointer in it is reset to NULL, then descriptor unmap will fail, nbuf is left unmapped in wlan CB, in worst case, wlan CB DMA address space is used out, new dma map will fail, assert will happen. Change-Id: I97b4ab304d884cafcf0303529ed93682690dce12 CRs-Fixed: 3073466 --- dp/wifi3.0/dp_tx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 1848fa50f48d..9438be28a218 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -2548,7 +2548,6 @@ qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf, tid_tx_stats[tx_q->ring_id][msdu_info->tid]; tid_stats->swdrop_cnt[TX_HW_ENQUEUE]++; - dp_tx_desc_release(tx_desc, tx_q->desc_pool_id); if (msdu_info->frm_type == dp_tx_frm_me) { hw_enq_fail++; if (hw_enq_fail == msdu_info->num_seg) { @@ -2574,6 +2573,7 @@ qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf, msdu_info->u.sg_info .curr_seg->next; i++; + dp_tx_desc_release(tx_desc, tx_q->desc_pool_id); continue; } @@ -2590,9 +2590,11 @@ qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf, */ dp_tx_comp_free_buf(soc, tx_desc); i++; + dp_tx_desc_release(tx_desc, tx_q->desc_pool_id); continue; } + dp_tx_desc_release(tx_desc, tx_q->desc_pool_id); goto done; } From dbdce3e282e6e187b302ebef4acf53c798d6fc7f Mon Sep 17 00:00:00 2001 From: Amit Mehta Date: Wed, 10 Nov 2021 18:12:48 +0530 Subject: [PATCH 2/5] qcacmn: Extend tid_lock in rx defrag store fragment path Currently, we are Flushing fragments for peer as part of rx defrag clean up. There is the possibility that frag flush is called while we are accessing frags in rx defrag store fragment path in parallel. Which will cause access after the free issue. Extending lock in rx defrag store fragment path to avoid any parallel flush while accessing the frags. Change-Id: I1e897b195f61d80ea6738e9a93f7bcaaa04adc97 CRs-Fixed: 3065414 --- dp/wifi3.0/dp_rx_defrag.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dp/wifi3.0/dp_rx_defrag.c b/dp/wifi3.0/dp_rx_defrag.c index eb8fd5a2c3df..1e4ea8ce674e 100644 --- a/dp/wifi3.0/dp_rx_defrag.c +++ b/dp/wifi3.0/dp_rx_defrag.c @@ -1760,9 +1760,6 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, goto discard_frag; } - pdev = peer->vdev->pdev; - rx_tid = &peer->rx_tid[tid]; - mpdu_sequence_control_valid = hal_rx_get_mpdu_sequence_control_valid(soc->hal_soc, rx_desc->rx_buf_start); @@ -1797,10 +1794,15 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, */ fragno = dp_rx_frag_get_mpdu_frag_number(rx_desc->rx_buf_start); + pdev = peer->vdev->pdev; + rx_tid = &peer->rx_tid[tid]; + + qdf_spin_lock_bh(&rx_tid->tid_lock); rx_reorder_array_elem = peer->rx_tid[tid].array; if (!rx_reorder_array_elem) { dp_err_rl("Rcvd Fragmented pkt before tid setup for peer %pK", peer); + qdf_spin_unlock_bh(&rx_tid->tid_lock); goto discard_frag; } @@ -1818,6 +1820,7 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, "Rcvd unfragmented pkt on REO Err srng, dropping"); + qdf_spin_unlock_bh(&rx_tid->tid_lock); qdf_assert(0); goto discard_frag; } @@ -1845,6 +1848,13 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, rx_tid->curr_seq_num = rxseq; } } else { + /* Check if we are processing first fragment if it is + * not first fragment discard fragment. + */ + if (fragno) { + qdf_spin_unlock_bh(&rx_tid->tid_lock); + goto discard_frag; + } dp_debug("cur rxseq %d\n", rxseq); /* Start of a new sequence */ dp_rx_defrag_cleanup(peer, tid); @@ -1856,11 +1866,9 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, * If the earlier sequence was dropped, this will be the fresh start. * Else, continue with next fragment in a given sequence */ - qdf_spin_lock_bh(&rx_tid->tid_lock); status = dp_rx_defrag_fraglist_insert(peer, tid, &rx_reorder_array_elem->head, &rx_reorder_array_elem->tail, frag, &all_frag_present); - qdf_spin_unlock_bh(&rx_tid->tid_lock); /* * Currently, we can have only 6 MSDUs per-MPDU, if the current @@ -1878,6 +1886,7 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, if (status != QDF_STATUS_SUCCESS) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, "%s: Unable to store ring desc !", __func__); + qdf_spin_unlock_bh(&rx_tid->tid_lock); goto discard_frag; } } else { @@ -1906,6 +1915,7 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, dp_rx_defrag_waitlist_add(peer, tid); dp_peer_unref_delete(peer, DP_MOD_ID_RX_ERR); + qdf_spin_unlock_bh(&rx_tid->tid_lock); return QDF_STATUS_SUCCESS; } @@ -1914,7 +1924,6 @@ dp_rx_defrag_store_fragment(struct dp_soc *soc, "All fragments received for sequence: %d", rxseq); /* Process the fragments */ - qdf_spin_lock_bh(&rx_tid->tid_lock); status = dp_rx_defrag(peer, tid, rx_reorder_array_elem->head, rx_reorder_array_elem->tail); if (QDF_IS_STATUS_ERROR(status)) { From 3eb1560d2d292b5f22c2e7fb06149e3bdc80b722 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Thu, 11 Nov 2021 04:32:14 -0800 Subject: [PATCH 3/5] qcacmn: Disable intra-bss forwarding for NDI interface Disable intra-bss forwarding for NDI interface. Change-Id: I0f3276547795defbd6c0f1f387b5e0018ef11048 CRs-Fixed: 3073451 --- dp/wifi3.0/dp_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index b9f1537f81dc..6067336cb479 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -5787,7 +5787,8 @@ static QDF_STATUS dp_vdev_attach_wifi3(struct cdp_soc_t *cdp_soc, dp_vdev_pdev_list_add(soc, pdev, vdev); pdev->vdev_count++; - if (wlan_op_mode_sta != vdev->opmode) + if (wlan_op_mode_sta != vdev->opmode && + wlan_op_mode_ndi != vdev->opmode) vdev->ap_bridge_enabled = true; else vdev->ap_bridge_enabled = false; From b2aa7520e0a3fa04979b4fa531595bea9eba3c06 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 14 Sep 2021 09:49:43 +0530 Subject: [PATCH 4/5] qcacmn: Add debug log in case BSS is filtered out due to freq list Add debug log in case BSS freq is not matching the freq list provided in scan filter. Change-Id: I00da614f4a5b4fdf58122cf2750afe5c03114536 CRs-Fixed: 3035787 --- umac/scan/core/src/wlan_scan_filter.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/umac/scan/core/src/wlan_scan_filter.c b/umac/scan/core/src/wlan_scan_filter.c index 8adbceb4b632..73836d7bade6 100644 --- a/umac/scan/core/src/wlan_scan_filter.c +++ b/umac/scan/core/src/wlan_scan_filter.c @@ -716,8 +716,18 @@ bool scm_filter_match(struct wlan_objmgr_psoc *psoc, } } - if (!match && filter->num_of_channels) + if (!match && filter->num_of_channels) { + /* + * Do not print if bssid/ssid is not present in filter to avoid + * excessive prints (e.g RRM case where only freq list is + * provided to get AP's in specific frequencies) + */ + if (filter->num_of_bssid || filter->num_of_ssid) + scm_debug(QDF_MAC_ADDR_FMT" : Ignore as AP's freq %d is not in freq list", + QDF_MAC_ADDR_REF(db_entry->bssid.bytes), + db_entry->channel.chan_freq); return false; + } if (filter->rrm_measurement_filter) return true; From c8e095d93152d6d3e9ab9b35c51888df2ec258ad Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Wed, 17 Nov 2021 20:17:39 +0800 Subject: [PATCH 5/5] qcacmn: classify qmi/wmi for WMI_REQUEST_STATS_CMDID Classify qmi/wmi by request type, only TYPE_STATION_STATS is designed to be sent by qmi so far. other type will continue go with wmi. Change-Id: Ibaee99c0a9d59b0db634e84f3c0b6e40b65a185d CRs-Fixed: 3077792 --- wmi/inc/wmi_unified_api.h | 5 ++++- wmi/inc/wmi_unified_param.h | 2 ++ wmi/src/wmi_unified_cp_stats_tlv.c | 10 +++++++--- wmi/src/wmi_unified_tlv.c | 11 ++++++++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index cfc2e5ec3ba3..44794703f23b 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 @@ -366,6 +367,7 @@ static inline int wmi_process_qmi_fw_event(void *wmi_cb_ctx, void *buf, int len) * @buf: wmi command buffer * @buflen: wmi command buffer length * @cmd_id: WMI cmd id + * @is_qmi_send_support:send by qmi is supported * * Note, it is NOT safe to access buf after calling this function! * @@ -373,7 +375,8 @@ static inline int wmi_process_qmi_fw_event(void *wmi_cb_ctx, void *buf, int len) */ QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle, wmi_buf_t buf, uint32_t buflen, - uint32_t cmd_id); + uint32_t cmd_id, + bool is_qmi_send_support); /** * wmi_unified_register_event() - WMI event handler diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 0e224b67b650..b97c2455e142 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -813,12 +813,14 @@ typedef struct { * @vdev_id: vdev id * @pdev_id: pdev_id * @wmi_host_inst_rssi_args: Instantaneous rssi stats args + * @is_qmi_send_support: support to send by qmi or not */ struct stats_request_params { uint32_t stats_id; uint8_t vdev_id; uint8_t pdev_id; wmi_host_inst_rssi_args rssi_args; + bool is_qmi_send_support; }; /** diff --git a/wmi/src/wmi_unified_cp_stats_tlv.c b/wmi/src/wmi_unified_cp_stats_tlv.c index 9987a2f3f43e..4a0edf20e7da 100644 --- a/wmi/src/wmi_unified_cp_stats_tlv.c +++ b/wmi/src/wmi_unified_cp_stats_tlv.c @@ -392,6 +392,7 @@ send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, wmi_request_stats_cmd_fixed_param *cmd; wmi_buf_t buf; uint16_t len = sizeof(wmi_request_stats_cmd_fixed_param); + bool is_qmi_send_support; buf = wmi_buf_alloc(wmi_handle, len); if (!buf) @@ -407,15 +408,18 @@ send_stats_request_cmd_tlv(wmi_unified_t wmi_handle, cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target( wmi_handle, param->pdev_id); + is_qmi_send_support = param->is_qmi_send_support; WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr); - wmi_debug("STATS REQ STATS_ID:%d VDEV_ID:%d PDEV_ID:%d-->", - cmd->stats_id, cmd->vdev_id, cmd->pdev_id); + wmi_debug("STATS REQ STATS_ID:%d VDEV_ID:%d PDEV_ID:%d, is_qmi_send_support %d", + cmd->stats_id, cmd->vdev_id, cmd->pdev_id, + is_qmi_send_support); wmi_mtrace(WMI_REQUEST_STATS_CMDID, cmd->vdev_id, 0); ret = wmi_unified_cmd_send_pm_chk(wmi_handle, buf, len, - WMI_REQUEST_STATS_CMDID); + WMI_REQUEST_STATS_CMDID, + is_qmi_send_support); if (ret) { wmi_err("Failed to send stats request to fw =%d", ret); diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index b004aaef6df6..1b95fa9770e9 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -718,8 +718,12 @@ qdf_export_symbol(wmi_mtrace); QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle, wmi_buf_t buf, - uint32_t buflen, uint32_t cmd_id) + uint32_t buflen, uint32_t cmd_id, + bool is_qmi_send_support) { + if (!is_qmi_send_support) + goto send_over_wmi; + if (!wmi_is_qmi_stats_enabled(wmi_handle)) goto send_over_wmi; @@ -5292,7 +5296,7 @@ static QDF_STATUS send_process_ll_stats_get_cmd_tlv(wmi_unified_t wmi_handle, wmi_mtrace(WMI_REQUEST_LINK_STATS_CMDID, cmd->vdev_id, 0); ret = wmi_unified_cmd_send_pm_chk(wmi_handle, buf, len, - WMI_REQUEST_LINK_STATS_CMDID); + WMI_REQUEST_LINK_STATS_CMDID, true); if (ret) { wmi_buf_free(buf); return QDF_STATUS_E_FAILURE; @@ -5375,7 +5379,8 @@ static QDF_STATUS send_unified_ll_stats_get_sta_cmd_tlv( } else { ret = wmi_unified_cmd_send_pm_chk( wmi_handle, buf, len, - WMI_REQUEST_UNIFIED_LL_GET_STA_CMDID); + WMI_REQUEST_UNIFIED_LL_GET_STA_CMDID, + true); } if (QDF_IS_STATUS_ERROR(ret)) {