Commit ac83b603 authored by Venkateswara Naralasetty's avatar Venkateswara Naralasetty Committed by Kalle Valo

ath11k: add HTT stats support for new stats

Add HTT stats support for,

29-ATH11K_DBG_HTT_EXT_STATS_PEER_CTRL_PATH_TXRX_STATS:
Used to dump the control path txrx stats for each connected peer.
Usage:
echo 29 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
cat /sys/kernel/debug/ieee80211/phyx/netdev\:wlan0/stations/
<sta mac>/htt_peer_stats.

31-ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_RATE_TXBF_STATS:
Used to dump the per pdev tx rate txbf stats.
Usage:
echo 31 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats

32-ATH11k_DBG_HTT_EXT_STATS_TXBF_OFDMA:
Used to dump the TXBF ofdma stats for all ofdma users.
Usage:
echo 32 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats

37-ATH11K_DBG_HTT_EXT_PHY_COUNTERS_AND_PHY_STATS:
Used to dump the mac and phy txrx counts and phy stats like per chain rssi
and ANI level.
Usage:
echo 37 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00486-QCAHKSWPL_SILICONZ-1
Signed-off-by: default avatarVenkateswara Naralasetty <vnaralas@codeaurora.org>
Signed-off-by: default avatarJouni Malinen <jouni@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210913223148.208026-6-jouni@codeaurora.org
parent 6ed73182
...@@ -38,6 +38,10 @@ enum ath11k_dbg_htt_ext_stats_type { ...@@ -38,6 +38,10 @@ enum ath11k_dbg_htt_ext_stats_type {
ATH11K_DBG_HTT_EXT_STATS_TX_SOUNDING_INFO = 22, ATH11K_DBG_HTT_EXT_STATS_TX_SOUNDING_INFO = 22,
ATH11K_DBG_HTT_EXT_STATS_PDEV_OBSS_PD_STATS = 23, ATH11K_DBG_HTT_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
ATH11K_DBG_HTT_EXT_STATS_RING_BACKPRESSURE_STATS = 24, ATH11K_DBG_HTT_EXT_STATS_RING_BACKPRESSURE_STATS = 24,
ATH11K_DBG_HTT_EXT_STATS_PEER_CTRL_PATH_TXRX_STATS = 29,
ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_RATE_TXBF_STATS = 31,
ATH11K_DBG_HTT_EXT_STATS_TXBF_OFDMA = 32,
ATH11K_DBG_HTT_EXT_PHY_COUNTERS_AND_PHY_STATS = 37,
/* keep this last */ /* keep this last */
ATH11K_DBG_HTT_NUM_EXT_STATS, ATH11K_DBG_HTT_NUM_EXT_STATS,
......
...@@ -102,6 +102,14 @@ enum htt_tlv_tag_t { ...@@ -102,6 +102,14 @@ enum htt_tlv_tag_t {
HTT_STATS_PDEV_OBSS_PD_TAG = 88, HTT_STATS_PDEV_OBSS_PD_TAG = 88,
HTT_STATS_HW_WAR_TAG = 89, HTT_STATS_HW_WAR_TAG = 89,
HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90,
HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101,
HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108,
HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113,
HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114,
HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115,
HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116,
HTT_STATS_PHY_COUNTERS_TAG = 121,
HTT_STATS_PHY_STATS_TAG = 122,
HTT_STATS_MAX_TAG, HTT_STATS_MAX_TAG,
}; };
...@@ -1750,6 +1758,170 @@ struct htt_ring_backpressure_stats_tlv { ...@@ -1750,6 +1758,170 @@ struct htt_ring_backpressure_stats_tlv {
u32 backpressure_hist[5]; u32 backpressure_hist[5];
}; };
#define HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS 14
#define HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS 5
#define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
struct htt_pdev_txrate_txbf_stats_tlv {
/* SU TxBF TX MCS stats */
u32 tx_su_txbf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
/* Implicit BF TX MCS stats */
u32 tx_su_ibf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
/* Open loop TX MCS stats */
u32 tx_su_ol_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
/* SU TxBF TX NSS stats */
u32 tx_su_txbf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
/* Implicit BF TX NSS stats */
u32 tx_su_ibf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
/* Open loop TX NSS stats */
u32 tx_su_ol_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
/* SU TxBF TX BW stats */
u32 tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
/* Implicit BF TX BW stats */
u32 tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
/* Open loop TX BW stats */
u32 tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
};
struct htt_txbf_ofdma_ndpa_stats_tlv {
/* 11AX HE OFDMA NDPA frame queued to the HW */
u32 ax_ofdma_ndpa_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA NDPA frame sent over the air */
u32 ax_ofdma_ndpa_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA NDPA frame flushed by HW */
u32 ax_ofdma_ndpa_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA NDPA frame completed with error(s) */
u32 ax_ofdma_ndpa_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
};
struct htt_txbf_ofdma_ndp_stats_tlv {
/* 11AX HE OFDMA NDP frame queued to the HW */
u32 ax_ofdma_ndp_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA NDPA frame sent over the air */
u32 ax_ofdma_ndp_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA NDPA frame flushed by HW */
u32 ax_ofdma_ndp_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA NDPA frame completed with error(s) */
u32 ax_ofdma_ndp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
};
struct htt_txbf_ofdma_brp_stats_tlv {
/* 11AX HE OFDMA MU BRPOLL frame queued to the HW */
u32 ax_ofdma_brpoll_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA MU BRPOLL frame sent over the air */
u32 ax_ofdma_brpoll_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA MU BRPOLL frame flushed by HW */
u32 ax_ofdma_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
u32 ax_ofdma_brp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* Number of CBF(s) received when 11AX HE OFDMA MU BRPOLL frame
* completed with error(s).
*/
u32 ax_ofdma_brp_err_num_cbf_rcvd[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS + 1];
};
struct htt_txbf_ofdma_steer_stats_tlv {
/* 11AX HE OFDMA PPDUs that were sent over the air with steering (TXBF + OFDMA) */
u32 ax_ofdma_num_ppdu_steer[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA PPDUs that were sent over the air in open loop */
u32 ax_ofdma_num_ppdu_ol[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA number of users for which CBF prefetch was
* initiated to PHY HW during TX.
*/
u32 ax_ofdma_num_usrs_prefetch[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA number of users for which sounding was initiated during TX */
u32 ax_ofdma_num_usrs_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
/* 11AX HE OFDMA number of users for which sounding was forced during TX */
u32 ax_ofdma_num_usrs_force_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
};
#define HTT_MAX_RX_PKT_CNT 8
#define HTT_MAX_RX_PKT_CRC_PASS_CNT 8
#define HTT_MAX_PER_BLK_ERR_CNT 20
#define HTT_MAX_RX_OTA_ERR_CNT 14
#define HTT_STATS_MAX_CHAINS 8
#define ATH11K_STATS_MGMT_FRM_TYPE_MAX 16
struct htt_phy_counters_tlv {
/* number of RXTD OFDMA OTA error counts except power surge and drop */
u32 rx_ofdma_timing_err_cnt;
/* rx_cck_fail_cnt:
* number of cck error counts due to rx reception failure because of
* timing error in cck
*/
u32 rx_cck_fail_cnt;
/* number of times tx abort initiated by mac */
u32 mactx_abort_cnt;
/* number of times rx abort initiated by mac */
u32 macrx_abort_cnt;
/* number of times tx abort initiated by phy */
u32 phytx_abort_cnt;
/* number of times rx abort initiated by phy */
u32 phyrx_abort_cnt;
/* number of rx defered count initiated by phy */
u32 phyrx_defer_abort_cnt;
/* number of sizing events generated at LSTF */
u32 rx_gain_adj_lstf_event_cnt;
/* number of sizing events generated at non-legacy LTF */
u32 rx_gain_adj_non_legacy_cnt;
/* rx_pkt_cnt -
* Received EOP (end-of-packet) count per packet type;
* [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
* [6-7]=RSVD
*/
u32 rx_pkt_cnt[HTT_MAX_RX_PKT_CNT];
/* rx_pkt_crc_pass_cnt -
* Received EOP (end-of-packet) count per packet type;
* [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
* [6-7]=RSVD
*/
u32 rx_pkt_crc_pass_cnt[HTT_MAX_RX_PKT_CRC_PASS_CNT];
/* per_blk_err_cnt -
* Error count per error source;
* [0] = unknown; [1] = LSIG; [2] = HTSIG; [3] = VHTSIG; [4] = HESIG;
* [5] = RXTD_OTA; [6] = RXTD_FATAL; [7] = DEMF; [8] = ROBE;
* [9] = PMI; [10] = TXFD; [11] = TXTD; [12] = PHYRF
* [13-19]=RSVD
*/
u32 per_blk_err_cnt[HTT_MAX_PER_BLK_ERR_CNT];
/* rx_ota_err_cnt -
* RXTD OTA (over-the-air) error count per error reason;
* [0] = voting fail; [1] = weak det fail; [2] = strong sig fail;
* [3] = cck fail; [4] = power surge; [5] = power drop;
* [6] = btcf timing timeout error; [7] = btcf packet detect error;
* [8] = coarse timing timeout error
* [9-13]=RSVD
*/
u32 rx_ota_err_cnt[HTT_MAX_RX_OTA_ERR_CNT];
};
struct htt_phy_stats_tlv {
/* per chain hw noise floor values in dBm */
s32 nf_chain[HTT_STATS_MAX_CHAINS];
/* number of false radars detected */
u32 false_radar_cnt;
/* number of channel switches happened due to radar detection */
u32 radar_cs_cnt;
/* ani_level -
* ANI level (noise interference) corresponds to the channel
* the desense levels range from -5 to 15 in dB units,
* higher values indicating more noise interference.
*/
s32 ani_level;
/* running time in minutes since FW boot */
u32 fw_run_time;
};
struct htt_peer_ctrl_path_txrx_stats_tlv {
/* peer mac address */
u8 peer_mac_addr[ETH_ALEN];
u8 rsvd[2];
/* Num of tx mgmt frames with subtype on peer level */
u32 peer_tx_mgmt_subtype[ATH11K_STATS_MGMT_FRM_TYPE_MAX];
/* Num of rx mgmt frames with subtype on peer level */
u32 peer_rx_mgmt_subtype[ATH11K_STATS_MGMT_FRM_TYPE_MAX];
};
#ifdef CONFIG_ATH11K_DEBUGFS #ifdef CONFIG_ATH11K_DEBUGFS
void ath11k_debugfs_htt_stats_init(struct ath11k *ar); void ath11k_debugfs_htt_stats_init(struct ath11k *ar);
......
...@@ -419,15 +419,21 @@ ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file) ...@@ -419,15 +419,21 @@ ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file)
struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv;
struct ath11k *ar = arsta->arvif->ar; struct ath11k *ar = arsta->arvif->ar;
struct debug_htt_stats_req *stats_req; struct debug_htt_stats_req *stats_req;
int type = ar->debug.htt_stats.type;
int ret; int ret;
if ((type != ATH11K_DBG_HTT_EXT_STATS_PEER_INFO &&
type != ATH11K_DBG_HTT_EXT_STATS_PEER_CTRL_PATH_TXRX_STATS) ||
type == ATH11K_DBG_HTT_EXT_STATS_RESET)
return -EPERM;
stats_req = vzalloc(sizeof(*stats_req) + ATH11K_HTT_STATS_BUF_SIZE); stats_req = vzalloc(sizeof(*stats_req) + ATH11K_HTT_STATS_BUF_SIZE);
if (!stats_req) if (!stats_req)
return -ENOMEM; return -ENOMEM;
mutex_lock(&ar->conf_mutex); mutex_lock(&ar->conf_mutex);
ar->debug.htt_stats.stats_req = stats_req; ar->debug.htt_stats.stats_req = stats_req;
stats_req->type = ATH11K_DBG_HTT_EXT_STATS_PEER_INFO; stats_req->type = type;
memcpy(stats_req->peer_addr, sta->addr, ETH_ALEN); memcpy(stats_req->peer_addr, sta->addr, ETH_ALEN);
ret = ath11k_debugfs_htt_stats_req(ar); ret = ath11k_debugfs_htt_stats_req(ar);
mutex_unlock(&ar->conf_mutex); mutex_unlock(&ar->conf_mutex);
......
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