]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath12k: Refactor the format of peer rate table information
authorBalamurugan Mahalingam <quic_bmahalin@quicinc.com>
Thu, 6 Feb 2025 01:38:53 +0000 (07:08 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 11 Feb 2025 15:27:09 +0000 (07:27 -0800)
Currently, peer rate table information involves complex computation for
the rate index to update the rate table. To simplify this process, avoid
the rate index calculation by defining the rate table with bandwidth, GI,
NSS, MCS. Therefore, update the rate information based on the bandwidth,
GI, NSS and MCS information from the TLV data of monitor status Rx path.

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: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Link: https://patch.msgid.link/20250206013854.174765-9-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/dp_mon.c

index ef6ef6ad914df99aef7ac04c9a9323a5112a5abd..bc5b1b3a056c540c1645f75a66c77412c59a7fc3 100644 (file)
@@ -53,8 +53,6 @@
 
 #define ATH12K_INVALID_HW_MAC_ID       0xFF
 #define ATH12K_CONNECTION_LOSS_HZ      (3 * HZ)
-#define        ATH12K_RX_RATE_TABLE_NUM        320
-#define        ATH12K_RX_RATE_TABLE_11AX_NUM   576
 
 #define ATH12K_MON_TIMER_INTERVAL  10
 #define ATH12K_RESET_TIMEOUT_HZ                        (20 * HZ)
@@ -364,8 +362,6 @@ struct ath12k_vif_iter {
 #define HAL_RX_MAX_MCS_BE      15
 #define HAL_RX_MAX_NSS         8
 #define HAL_RX_MAX_NUM_LEGACY_RATES 12
-#define ATH12K_RX_RATE_TABLE_11AX_NUM  576
-#define ATH12K_RX_RATE_TABLE_NUM 320
 
 struct ath12k_rx_peer_rate_stats {
        u64 ht_mcs_count[HAL_RX_MAX_MCS_HT + 1];
@@ -376,7 +372,7 @@ struct ath12k_rx_peer_rate_stats {
        u64 bw_count[HAL_RX_BW_MAX];
        u64 gi_count[HAL_RX_GI_MAX];
        u64 legacy_count[HAL_RX_MAX_NUM_LEGACY_RATES];
-       u64 rx_rate[ATH12K_RX_RATE_TABLE_11AX_NUM];
+       u64 rx_rate[HAL_RX_BW_MAX][HAL_RX_GI_MAX][HAL_RX_MAX_NSS][HAL_RX_MAX_MCS_HT + 1];
 };
 
 struct ath12k_rx_peer_stats {
index 514bbd63db1c2eef68116e6218d59f62352fe304..d22800e894850d8a98045d0ed661f83d5a73fbad 100644 (file)
@@ -2915,34 +2915,31 @@ ath12k_dp_mon_rx_update_peer_rate_table_stats(struct ath12k_rx_peer_stats *rx_st
                                              struct hal_rx_user_status *user_stats,
                                              u32 num_msdu)
 {
-       u32 rate_idx = 0;
+       struct ath12k_rx_peer_rate_stats *stats;
        u32 mcs_idx = (user_stats) ? user_stats->mcs : ppdu_info->mcs;
        u32 nss_idx = (user_stats) ? user_stats->nss - 1 : ppdu_info->nss - 1;
        u32 bw_idx = ppdu_info->bw;
        u32 gi_idx = ppdu_info->gi;
+       u32 len;
 
-       if ((mcs_idx > HAL_RX_MAX_MCS_HE) || (nss_idx >= HAL_RX_MAX_NSS) ||
-           (bw_idx >= HAL_RX_BW_MAX) || (gi_idx >= HAL_RX_GI_MAX)) {
+       if (mcs_idx > HAL_RX_MAX_MCS_HT || nss_idx >= HAL_RX_MAX_NSS ||
+           bw_idx >= HAL_RX_BW_MAX || gi_idx >= HAL_RX_GI_MAX) {
                return;
        }
 
-       if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11N ||
-           ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AC) {
-               rate_idx = mcs_idx * 8 + 8 * 10 * nss_idx;
-               rate_idx += bw_idx * 2 + gi_idx;
-       } else if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AX) {
+       if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AX ||
+           ppdu_info->preamble_type == HAL_RX_PREAMBLE_11BE)
                gi_idx = ath12k_he_gi_to_nl80211_he_gi(ppdu_info->gi);
-               rate_idx = mcs_idx * 12 + 12 * 12 * nss_idx;
-               rate_idx += bw_idx * 3 + gi_idx;
-       } else {
-               return;
-       }
 
-       rx_stats->pkt_stats.rx_rate[rate_idx] += num_msdu;
+       rx_stats->pkt_stats.rx_rate[bw_idx][gi_idx][nss_idx][mcs_idx] += num_msdu;
+       stats = &rx_stats->byte_stats;
+
        if (user_stats)
-               rx_stats->byte_stats.rx_rate[rate_idx] += user_stats->mpdu_ok_byte_count;
+               len = user_stats->mpdu_ok_byte_count;
        else
-               rx_stats->byte_stats.rx_rate[rate_idx] += ppdu_info->mpdu_len;
+               len = ppdu_info->mpdu_len;
+
+       stats->rx_rate[bw_idx][gi_idx][nss_idx][mcs_idx] += len;
 }
 
 static void ath12k_dp_mon_rx_update_peer_su_stats(struct ath12k *ar,