diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index 8c15b75527..3135247a41 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -74,6 +74,19 @@ #define RU_242 9 #define RU_484 18 #define RU_996 37 +#ifdef WLAN_FEATURE_11BE +#define RU_2X996 74 +#define RU_3X996 111 +#define RU_4X996 148 +#define RU_52_26 RU_52 + RU_26 +#define RU_106_26 RU_106 + RU_26 +#define RU_484_242 RU_484 + RU_242 +#define RU_996_484 RU_996 + RU_484 +#define RU_996_484_242 RU_996 + RU_484_242 +#define RU_2X996_484 RU_2X996 + RU_484 +#define RU_3X996_484 RU_3X996 + RU_484 +#endif + /* WME stream classes */ #define WME_AC_BE 0 /* best effort */ @@ -516,15 +529,15 @@ static const struct cdp_rate_debug cdp_rate_string[DOT11_MAX][MAX_MCS] = { #endif /* - * cdp_mu_packet_type: MU Rx type index - * RX_TYPE_MU_MIMO: MU MIMO Rx type index - * RX_TYPE_MU_OFDMA: MU OFDMA Rx type index - * MU_MIMO_OFDMA: MU Rx MAX type index + * cdp_mu_packet_type: MU type index + * TXRX_TYPE_MU_MIMO: MU MIMO type index + * TXRX_TYPE_MU_OFDMA: MU OFDMA type index + * TXRX_TYPE_MU_MAX: MU MAX type index */ enum cdp_mu_packet_type { - RX_TYPE_MU_MIMO = 0, - RX_TYPE_MU_OFDMA = 1, - RX_TYPE_MU_MAX = 2, + TXRX_TYPE_MU_MIMO = 0, + TXRX_TYPE_MU_OFDMA = 1, + TXRX_TYPE_MU_MAX = 2, }; enum WDI_EVENT { @@ -1220,6 +1233,8 @@ struct protocol_trace_count { * HE * @preamble_info: preamble * @last_tx_ts: last timestamp in jiffies when tx comp occurred + * @su_be_ppdu_cnt: SU Tx packet count + * @mu_be_ppdu_cnt: MU Tx packet count */ struct cdp_tx_stats { struct cdp_pkt_info comp_pkt; @@ -1321,6 +1336,10 @@ struct cdp_tx_stats { /* mpdu retry count in case of successful transmission */ uint32_t mpdu_success_with_retries; unsigned long last_tx_ts; +#ifdef WLAN_FEATURE_11BE + struct cdp_pkt_type su_be_ppdu_cnt; + struct cdp_pkt_type mu_be_ppdu_cnt[TXRX_TYPE_MU_MAX]; +#endif }; /* struct cdp_rx_stats - rx Level Stats @@ -1354,7 +1373,7 @@ struct cdp_tx_stats { * @mpdu_cnt_fcs_err: SU Rx fail mpdu count * @su_ax_ppdu_cnt: SU Rx packet count * @ppdu_cnt[MAX_RECEPTION_TYPES]: PPDU packet count in reception type - * @rx_mu[RX_TYPE_MU_MAX]: Rx MU stats + * @rx_mu[TXRX_TYPE_MU_MAX]: Rx MU stats * @bw[MAX_BW]: Packet Count in different bandwidths * @non_ampdu_cnt: Number of MSDUs with no MPDU level aggregation * @ampdu_cnt: Number of MSDUs part of AMSPU @@ -1445,7 +1464,7 @@ struct cdp_rx_stats { uint32_t mpdu_cnt_fcs_err; struct cdp_pkt_type su_ax_ppdu_cnt; uint32_t ppdu_cnt[MAX_RECEPTION_TYPES]; - struct cdp_rx_mu rx_mu[RX_TYPE_MU_MAX]; + struct cdp_rx_mu rx_mu[TXRX_TYPE_MU_MAX]; uint32_t bw[MAX_BW]; uint32_t non_ampdu_cnt; uint32_t ampdu_cnt; diff --git a/dp/wifi3.0/dp_stats.c b/dp/wifi3.0/dp_stats.c index f4866144d0..136552ffb1 100644 --- a/dp/wifi3.0/dp_stats.c +++ b/dp/wifi3.0/dp_stats.c @@ -101,7 +101,7 @@ static const struct cdp_rate_debug dp_ppdu_rate_string[DOT11_MAX][MAX_MCS] = { }; static const struct cdp_rate_debug -dp_mu_rate_string[RX_TYPE_MU_MAX][MAX_MCS] = { +dp_mu_rate_string[TXRX_TYPE_MU_MAX][MAX_MCS] = { { {"HE MU-MIMO MCS 0 (BPSK 1/2) ", MCS_VALID}, {"HE MU-MIMO MCS 1 (QPSK 1/2) ", MCS_VALID}, @@ -138,7 +138,7 @@ dp_mu_rate_string[RX_TYPE_MU_MAX][MAX_MCS] = { }, }; -const char *mu_reception_mode[RX_TYPE_MU_MAX] = { +const char *mu_reception_mode[TXRX_TYPE_MU_MAX] = { "MU MIMO", "MU OFDMA" }; @@ -5318,7 +5318,7 @@ dp_print_mu_ppdu_rates_info(struct cdp_rx_mu *rx_mu) uint8_t mcs, pkt_type; DP_PRINT_STATS("PPDU Count"); - for (pkt_type = 0; pkt_type < RX_TYPE_MU_MAX; pkt_type++) { + for (pkt_type = 0; pkt_type < TXRX_TYPE_MU_MAX; pkt_type++) { for (mcs = 0; mcs < MAX_MCS; mcs++) { if (!dp_mu_rate_string[pkt_type][mcs].valid) continue; @@ -5891,7 +5891,7 @@ void dp_print_peer_stats(struct dp_peer *peer) peer->stats.rx.mpdu_cnt_fcs_ok, peer->stats.rx.mpdu_cnt_fcs_err); - for (rx_mu_type = 0; rx_mu_type < RX_TYPE_MU_MAX; rx_mu_type++) { + for (rx_mu_type = 0; rx_mu_type < TXRX_TYPE_MU_MAX; rx_mu_type++) { DP_PRINT_STATS("reception mode %s", mu_reception_mode[rx_mu_type]); rx_mu = &peer->stats.rx.rx_mu[rx_mu_type]; 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 ecf4201093..78d6ce7b97 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 @@ -901,6 +901,9 @@ dp_mon_register_feature_ops_1_0(struct dp_soc *soc) dp_mon_filter_setup_enhanced_stats_1_0; mon_ops->mon_filter_reset_enhanced_stats = dp_mon_filter_reset_enhanced_stats_1_0; +#ifdef WLAN_FEATURE_11BE + mon_ops->mon_tx_stats_update = NULL; +#endif #endif #if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC) mon_ops->mon_filter_setup_smart_monitor = diff --git a/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c b/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c index 25d5eed2da..ef6adb8e2e 100644 --- a/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c +++ b/dp/wifi3.0/monitor/2.0/dp_mon_2.0.c @@ -332,6 +332,62 @@ QDF_STATUS dp_vdev_set_monitor_mode_rings_2_0(struct dp_pdev *pdev, } #endif +#if defined(QCA_ENHANCED_STATS_SUPPORT) && defined(WLAN_FEATURE_11BE) +void +dp_mon_tx_stats_update_2_0(struct dp_peer *peer, + struct cdp_tx_completion_ppdu_user *ppdu) +{ + uint8_t preamble; + uint8_t mcs; + + preamble = ppdu->preamble; + mcs = ppdu->mcs; + + DP_STATS_INCC(peer, + tx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu, + ((mcs >= (MAX_MCS - 1)) && (preamble == DOT11_BE))); + DP_STATS_INCC(peer, + tx.pkt_type[preamble].mcs_count[mcs], num_msdu, + ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_BE))); + DP_STATS_INCC(peer, + tx.su_be_ppdu_cnt.mcs_count[MAX_MCS - 1], 1, + ((mcs >= (MAX_MCS - 1)) && (preamble == DOT11_BE) && + (ppdu->ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_SU))); + DP_STATS_INCC(peer, + tx.su_be_ppdu_cnt.mcs_count[mcs], 1, + ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_BE) && + (ppdu->ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_SU))); + DP_STATS_INCC(peer, + tx.mu_be_ppdu_cnt[TXRX_TYPE_MU_OFDMA].ppdu.mcs_count[MAX_MCS - 1], + 1, ((mcs >= (MAX_MCS - 1)) && + (preamble == DOT11_BE) && + (ppdu->ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA))); + DP_STATS_INCC(peer, + tx.mu_be_ppdu_cnt[TXRX_TYPE_MU_OFDMA].ppdu.mcs_count[mcs], + 1, ((mcs < (MAX_MCS - 1)) && + (preamble == DOT11_BE) && + (ppdu->ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA))); + DP_STATS_INCC(peer, + tx.mu_be_ppdu_cnt[TXRX_TYPE_MU_MIMO].ppdu.mcs_count[MAX_MCS - 1], + 1, ((mcs >= (MAX_MCS - 1)) && + (preamble == DOT11_BE) && + (ppdu->ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO))); + DP_STATS_INCC(peer, + tx.mu_be_ppdu_cnt[TXRX_TYPE_MU_MIMO].ppdu.mcs_count[mcs], + 1, ((mcs < (MAX_MCS - 1)) && + (preamble == DOT11_BE) && + (ppdu->ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO))); +} +#endif + +#if defined(QCA_ENHANCED_STATS_SUPPORT) && !defined(WLAN_FEATURE_11BE) +void +dp_mon_tx_stats_update_2_0(struct dp_peer *peer, + struct cdp_tx_completion_ppdu_user *ppdu) +{ +} +#endif + #ifdef QCA_SUPPORT_BPR static QDF_STATUS dp_set_bpr_enable_2_0(struct dp_pdev *pdev, int val) @@ -830,6 +886,7 @@ dp_mon_register_feature_ops_2_0(struct dp_soc *soc) dp_mon_filter_setup_enhanced_stats_2_0; mon_ops->mon_filter_reset_enhanced_stats = dp_mon_filter_reset_enhanced_stats_2_0; + mon_ops->mon_tx_stats_update = dp_mon_tx_stats_update_2_0; #endif #if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC) mon_ops->mon_filter_setup_smart_monitor = diff --git a/dp/wifi3.0/monitor/dp_mon.c b/dp/wifi3.0/monitor/dp_mon.c index 45cea33acb..537d1f24e6 100644 --- a/dp/wifi3.0/monitor/dp_mon.c +++ b/dp/wifi3.0/monitor/dp_mon.c @@ -2274,6 +2274,106 @@ static inline void dp_send_stats_event(struct dp_pdev *pdev, } #endif +/* + * dp_get_ru_index_frm_ru_tones() - get ru index + * @ru_tones: ru tones + * + * Return: ru index + */ +#ifdef WLAN_FEATURE_11BE +static inline enum cdp_ru_index dp_get_ru_index_frm_ru_tones(uint16_t ru_tones) +{ + enum cdp_ru_index ru_index; + + switch (ru_tones) { + case RU_26: + ru_index = RU_26_INDEX; + break; + case RU_52: + ru_index = RU_52_INDEX; + break; + case RU_52_26: + ru_index = RU_52_26_INDEX; + break; + case RU_106: + ru_index = RU_106_INDEX; + break; + case RU_106_26: + ru_index = RU_106_26_INDEX; + break; + case RU_242: + ru_index = RU_242_INDEX; + break; + case RU_484: + ru_index = RU_484_INDEX; + break; + case RU_484_242: + ru_index = RU_484_242_INDEX; + break; + case RU_996: + ru_index = RU_996_INDEX; + break; + case RU_996_484: + ru_index = RU_996_484_INDEX; + break; + case RU_996_484_242: + ru_index = RU_996_484_242_INDEX; + break; + case RU_2X996: + ru_index = RU_2X996_INDEX; + break; + case RU_2X996_484: + ru_index = RU_2X996_484_INDEX; + break; + case RU_3X996: + ru_index = RU_3X996_INDEX; + break; + case RU_3X996_484: + ru_index = RU_2X996_484_INDEX; + break; + case RU_4X996: + ru_index = RU_4X996_INDEX; + break; + default: + ru_index = RU_INDEX_MAX; + break; + } + + return ru_index; +} +#else +static inline enum cdp_ru_index dp_get_ru_index_frm_ru_tones(uint16_t ru_tones) +{ + enum cdp_ru_index ru_index; + + switch (ru_tones) { + case RU_26: + ru_index = RU_26_INDEX; + break; + case RU_52: + ru_index = RU_52_INDEX; + break; + case RU_106: + ru_index = RU_106_INDEX; + break; + case RU_242: + ru_index = RU_242_INDEX; + break; + case RU_484: + ru_index = RU_484_INDEX; + break; + case RU_996: + ru_index = RU_996_INDEX; + break; + default: + ru_index = RU_INDEX_MAX; + break; + } + + return ru_index; +} +#endif + /* * dp_tx_stats_update() - Update per-peer statistics * @pdev: Datapath pdev handle @@ -2293,6 +2393,8 @@ dp_tx_stats_update(struct dp_pdev *pdev, struct dp_peer *peer, uint16_t num_mpdu; uint16_t mpdu_tried; uint16_t mpdu_failed; + struct dp_mon_ops *mon_ops; + enum cdp_ru_index ru_index; preamble = ppdu->preamble; mcs = ppdu->mcs; @@ -2337,55 +2439,14 @@ dp_tx_stats_update(struct dp_pdev *pdev, struct dp_peer *peer, ppdu->ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA) { DP_STATS_UPD(peer, tx.ru_tones, ppdu->ru_tones); DP_STATS_UPD(peer, tx.ru_start, ppdu->ru_start); - switch (ppdu->ru_tones) { - case RU_26: - DP_STATS_INC(peer, tx.ru_loc[RU_26_INDEX].num_msdu, + ru_index = dp_get_ru_index_frm_ru_tones(ppdu->ru_tones); + if (ru_index != RU_INDEX_MAX) { + DP_STATS_INC(peer, tx.ru_loc[ru_index].num_msdu, num_msdu); - DP_STATS_INC(peer, tx.ru_loc[RU_26_INDEX].num_mpdu, + DP_STATS_INC(peer, tx.ru_loc[ru_index].num_mpdu, num_mpdu); - DP_STATS_INC(peer, tx.ru_loc[RU_26_INDEX].mpdu_tried, + DP_STATS_INC(peer, tx.ru_loc[ru_index].mpdu_tried, mpdu_tried); - break; - case RU_52: - DP_STATS_INC(peer, tx.ru_loc[RU_52_INDEX].num_msdu, - num_msdu); - DP_STATS_INC(peer, tx.ru_loc[RU_52_INDEX].num_mpdu, - num_mpdu); - DP_STATS_INC(peer, tx.ru_loc[RU_52_INDEX].mpdu_tried, - mpdu_tried); - break; - case RU_106: - DP_STATS_INC(peer, tx.ru_loc[RU_106_INDEX].num_msdu, - num_msdu); - DP_STATS_INC(peer, tx.ru_loc[RU_106_INDEX].num_mpdu, - num_mpdu); - DP_STATS_INC(peer, tx.ru_loc[RU_106_INDEX].mpdu_tried, - mpdu_tried); - break; - case RU_242: - DP_STATS_INC(peer, tx.ru_loc[RU_242_INDEX].num_msdu, - num_msdu); - DP_STATS_INC(peer, tx.ru_loc[RU_242_INDEX].num_mpdu, - num_mpdu); - DP_STATS_INC(peer, tx.ru_loc[RU_242_INDEX].mpdu_tried, - mpdu_tried); - break; - case RU_484: - DP_STATS_INC(peer, tx.ru_loc[RU_484_INDEX].num_msdu, - num_msdu); - DP_STATS_INC(peer, tx.ru_loc[RU_484_INDEX].num_mpdu, - num_mpdu); - DP_STATS_INC(peer, tx.ru_loc[RU_484_INDEX].mpdu_tried, - mpdu_tried); - break; - case RU_996: - DP_STATS_INC(peer, tx.ru_loc[RU_996_INDEX].num_msdu, - num_msdu); - DP_STATS_INC(peer, tx.ru_loc[RU_996_INDEX].num_mpdu, - num_mpdu); - DP_STATS_INC(peer, tx.ru_loc[RU_996_INDEX].mpdu_tried, - mpdu_tried); - break; } } @@ -2451,6 +2512,10 @@ dp_tx_stats_update(struct dp_pdev *pdev, struct dp_peer *peer, DP_STATS_INCC(peer, tx.non_ampdu_cnt, num_mpdu, !(ppdu->is_ampdu)); DP_STATS_INCC(peer, tx.pream_punct_cnt, 1, ppdu->pream_punct); + mon_ops = dp_mon_ops_get(pdev->soc); + if (mon_ops && mon_ops->mon_tx_stats_update) + mon_ops->mon_tx_stats_update(peer, ppdu); + dp_peer_stats_notify(pdev, peer); dp_send_stats_event(pdev, peer, ppdu->peer_id); diff --git a/dp/wifi3.0/monitor/dp_mon.h b/dp/wifi3.0/monitor/dp_mon.h index f42b6f6e3b..8213c32bea 100644 --- a/dp/wifi3.0/monitor/dp_mon.h +++ b/dp/wifi3.0/monitor/dp_mon.h @@ -512,6 +512,8 @@ struct dp_mon_ops { #ifdef QCA_ENHANCED_STATS_SUPPORT void (*mon_filter_setup_enhanced_stats)(struct dp_pdev *pdev); void (*mon_filter_reset_enhanced_stats)(struct dp_pdev *pdev); + void (*mon_tx_stats_update)(struct dp_peer *peer, + struct cdp_tx_completion_ppdu_user *ppdu); #endif #ifdef QCA_MCOPY_SUPPORT void (*mon_filter_setup_mcopy_mode)(struct dp_pdev *pdev); diff --git a/dp/wifi3.0/monitor/dp_rx_mon.c b/dp/wifi3.0/monitor/dp_rx_mon.c index c6ba0d5ee7..d4352b7ddc 100644 --- a/dp/wifi3.0/monitor/dp_rx_mon.c +++ b/dp/wifi3.0/monitor/dp_rx_mon.c @@ -1,5 +1,6 @@ /* * Copyright (c) 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 @@ -810,9 +811,9 @@ static void dp_rx_stats_update(struct dp_pdev *pdev, if (ppdu_type >= HAL_RX_TYPE_MU_MIMO && ppdu_type <= HAL_RX_TYPE_MU_OFDMA) { if (ppdu_type == HAL_RX_TYPE_MU_MIMO) - mu_pkt_type = RX_TYPE_MU_MIMO; + mu_pkt_type = TXRX_TYPE_MU_MIMO; else - mu_pkt_type = RX_TYPE_MU_OFDMA; + mu_pkt_type = TXRX_TYPE_MU_OFDMA; if (nss) { DP_STATS_INC(peer, rx.nss[nss - 1], num_msdu); @@ -878,22 +879,22 @@ static void dp_rx_stats_update(struct dp_pdev *pdev, ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_AX) && (ppdu_type == HAL_RX_TYPE_SU))); DP_STATS_INCC(peer, - rx.rx_mu[RX_TYPE_MU_OFDMA].ppdu.mcs_count[MAX_MCS - 1], + rx.rx_mu[TXRX_TYPE_MU_OFDMA].ppdu.mcs_count[MAX_MCS - 1], 1, ((mcs >= (MAX_MCS - 1)) && (preamble == DOT11_AX) && (ppdu_type == HAL_RX_TYPE_MU_OFDMA))); DP_STATS_INCC(peer, - rx.rx_mu[RX_TYPE_MU_OFDMA].ppdu.mcs_count[mcs], + rx.rx_mu[TXRX_TYPE_MU_OFDMA].ppdu.mcs_count[mcs], 1, ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_AX) && (ppdu_type == HAL_RX_TYPE_MU_OFDMA))); DP_STATS_INCC(peer, - rx.rx_mu[RX_TYPE_MU_MIMO].ppdu.mcs_count[MAX_MCS - 1], + rx.rx_mu[TXRX_TYPE_MU_MIMO].ppdu.mcs_count[MAX_MCS - 1], 1, ((mcs >= (MAX_MCS - 1)) && (preamble == DOT11_AX) && (ppdu_type == HAL_RX_TYPE_MU_MIMO))); DP_STATS_INCC(peer, - rx.rx_mu[RX_TYPE_MU_MIMO].ppdu.mcs_count[mcs], + rx.rx_mu[TXRX_TYPE_MU_MIMO].ppdu.mcs_count[mcs], 1, ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_AX) && (ppdu_type == HAL_RX_TYPE_MU_MIMO)));