Commit 5344fc76 authored by Dinesh Karthikeyan's avatar Dinesh Karthikeyan Committed by Kalle Valo

wifi: ath12k: Support TQM stats

Add support to request pdev TQM stats from firmware through HTT stats
type 6. This stat type gives information such as TQM error, MPDU
related information and TQM pdev stats.

Sample output:
-------------
echo 6 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type
cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats

HTT_TX_TQM_ERROR_STATS_TLV:
q_empty_failure = 0
q_not_empty_failure = 0
add_msdu_failure = 0

TQM_ERROR_RESET_STATS:
tqm_cache_ctl_err = 0
tqm_soft_reset = 0
tqm_reset_total_num_in_use_link_descs = 0
.....

HTT_TX_TQM_GEN_MPDU_STATS_TLV:
gen_mpdu_end_reason =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0,
10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0

HTT_TX_TQM_LIST_MPDU_STATS_TLV:
list_mpdu_end_reason =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0,
10:0, 11:0, 12:0

HTT_TX_TQM_LIST_MPDU_CNT_TLV_V:
list_mpdu_cnt_hist =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0

HTT_TX_TQM_PDEV_STATS_TLV_V:
msdu_count = 0
mpdu_count = 0
remove_msdu = 0

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
Signed-off-by: default avatarDinesh Karthikeyan <quic_dinek@quicinc.com>
Signed-off-by: default avatarRoopni Devanathan <quic_rdevanat@quicinc.com>
Acked-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20240625042217.1303332-4-quic_rdevanat@quicinc.com
parent cf1187b3
......@@ -127,6 +127,7 @@ enum ath12k_dbg_htt_ext_stats_type {
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX = 1,
ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_SCHED = 4,
ATH12K_DBG_HTT_EXT_STATS_PDEV_ERROR = 5,
ATH12K_DBG_HTT_EXT_STATS_PDEV_TQM = 6,
/* keep this last */
ATH12K_DBG_HTT_NUM_EXT_STATS,
......@@ -137,9 +138,15 @@ enum ath12k_dbg_htt_tlv_tag {
HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1,
HTT_STATS_TX_PDEV_SIFS_TAG = 2,
HTT_STATS_TX_PDEV_FLUSH_TAG = 3,
HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11,
HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12,
HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13,
HTT_STATS_TX_TQM_CMN_TAG = 14,
HTT_STATS_TX_TQM_PDEV_TAG = 15,
HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36,
HTT_STATS_TX_SCHED_CMN_TAG = 37,
HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39,
HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43,
HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44,
HTT_STATS_HW_INTR_MISC_TAG = 54,
HTT_STATS_HW_PDEV_ERRS_TAG = 56,
......@@ -462,4 +469,99 @@ struct ath12k_htt_hw_war_stats_tlv {
DECLARE_FLEX_ARRAY(__le32, hw_wars);
} __packed;
struct ath12k_htt_tx_tqm_cmn_stats_tlv {
__le32 mac_id__word;
__le32 max_cmdq_id;
__le32 list_mpdu_cnt_hist_intvl;
__le32 add_msdu;
__le32 q_empty;
__le32 q_not_empty;
__le32 drop_notification;
__le32 desc_threshold;
__le32 hwsch_tqm_invalid_status;
__le32 missed_tqm_gen_mpdus;
__le32 tqm_active_tids;
__le32 tqm_inactive_tids;
__le32 tqm_active_msduq_flows;
__le32 msduq_timestamp_updates;
__le32 msduq_updates_mpdu_head_info_cmd;
__le32 msduq_updates_emp_to_nonemp_status;
__le32 get_mpdu_head_info_cmds_by_query;
__le32 get_mpdu_head_info_cmds_by_tac;
__le32 gen_mpdu_cmds_by_query;
__le32 high_prio_q_not_empty;
} __packed;
struct ath12k_htt_tx_tqm_error_stats_tlv {
__le32 q_empty_failure;
__le32 q_not_empty_failure;
__le32 add_msdu_failure;
__le32 tqm_cache_ctl_err;
__le32 tqm_soft_reset;
__le32 tqm_reset_num_in_use_link_descs;
__le32 tqm_reset_num_lost_link_descs;
__le32 tqm_reset_num_lost_host_tx_buf_cnt;
__le32 tqm_reset_num_in_use_internal_tqm;
__le32 tqm_reset_num_in_use_idle_link_rng;
__le32 tqm_reset_time_to_tqm_hang_delta_ms;
__le32 tqm_reset_recovery_time_ms;
__le32 tqm_reset_num_peers_hdl;
__le32 tqm_reset_cumm_dirty_hw_mpduq_cnt;
__le32 tqm_reset_cumm_dirty_hw_msduq_proc;
__le32 tqm_reset_flush_cache_cmd_su_cnt;
__le32 tqm_reset_flush_cache_cmd_other_cnt;
__le32 tqm_reset_flush_cache_cmd_trig_type;
__le32 tqm_reset_flush_cache_cmd_trig_cfg;
__le32 tqm_reset_flush_cmd_skp_status_null;
} __packed;
struct ath12k_htt_tx_tqm_gen_mpdu_stats_tlv {
DECLARE_FLEX_ARRAY(__le32, gen_mpdu_end_reason);
} __packed;
#define ATH12K_HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
#define ATH12K_HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
struct ath12k_htt_tx_tqm_list_mpdu_stats_tlv {
DECLARE_FLEX_ARRAY(__le32, list_mpdu_end_reason);
} __packed;
struct ath12k_htt_tx_tqm_list_mpdu_cnt_tlv {
DECLARE_FLEX_ARRAY(__le32, list_mpdu_cnt_hist);
} __packed;
struct ath12k_htt_tx_tqm_pdev_stats_tlv {
__le32 msdu_count;
__le32 mpdu_count;
__le32 remove_msdu;
__le32 remove_mpdu;
__le32 remove_msdu_ttl;
__le32 send_bar;
__le32 bar_sync;
__le32 notify_mpdu;
__le32 sync_cmd;
__le32 write_cmd;
__le32 hwsch_trigger;
__le32 ack_tlv_proc;
__le32 gen_mpdu_cmd;
__le32 gen_list_cmd;
__le32 remove_mpdu_cmd;
__le32 remove_mpdu_tried_cmd;
__le32 mpdu_queue_stats_cmd;
__le32 mpdu_head_info_cmd;
__le32 msdu_flow_stats_cmd;
__le32 remove_msdu_cmd;
__le32 remove_msdu_ttl_cmd;
__le32 flush_cache_cmd;
__le32 update_mpduq_cmd;
__le32 enqueue;
__le32 enqueue_notify;
__le32 notify_mpdu_at_head;
__le32 notify_mpdu_state_valid;
__le32 sched_udp_notify1;
__le32 sched_udp_notify2;
__le32 sched_nonudp_notify1;
__le32 sched_nonudp_notify2;
} __packed;
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment