wifi: ath12k: avoid redundant code in DP Rx error process
authorKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Wed, 11 Dec 2024 15:34:32 +0000 (17:34 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 16 Dec 2024 20:46:58 +0000 (12:46 -0800)
Currently, in DP rx error processing, the MAC id is fetched redundantly from
the same descriptor for each MSDU. To avoid this redundancy, move the fetch
handling before the iteration.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241211153432.775335-9-kvalo@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_rx.c

index f8e79eff20894cfa81be5a1e23db7b51238608bb..536a90ff9796fde040c731765b4f7243d4126c2b 100644 (file)
@@ -3517,6 +3517,13 @@ int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
                                    ret);
                        continue;
                }
+
+               mac_id = le32_get_bits(reo_desc->info0,
+                                      HAL_REO_DEST_RING_INFO0_SRC_LINK_ID);
+
+               pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id);
+               ar = ab->pdevs[pdev_id].ar;
+
                link_desc_va = link_desc_banks[desc_bank].vaddr +
                               (paddr - link_desc_banks[desc_bank].paddr);
                ath12k_hal_rx_msdu_link_info_get(link_desc_va, &num_msdus, msdu_cookies,
@@ -3545,12 +3552,6 @@ int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
                }
 
                for (i = 0; i < num_msdus; i++) {
-                       mac_id = le32_get_bits(reo_desc->info0,
-                                              HAL_REO_DEST_RING_INFO0_SRC_LINK_ID);
-
-                       pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id);
-                       ar = ab->pdevs[pdev_id].ar;
-
                        if (!ath12k_dp_process_rx_err_buf(ar, reo_desc,
                                                          &rx_desc_used_list,
                                                          drop,