From 81db06479ed52b6a5a49f2123b1c5f4bd6c6f5fa Mon Sep 17 00:00:00 2001 From: spuligil Date: Thu, 25 Apr 2019 00:01:01 -0700 Subject: [PATCH] fw-api: CL 7004110 - update fw common interface files HTT backpressure messages Change-Id: I26a4f708f3028294fcf58a0583a12afe2e5eb3ee CRs-Fixed: 2262693 --- fw/htt.h | 182 ++++++++++++++++++++++++++++++++++++++++++++++++- fw/htt_stats.h | 53 ++++++++++++++ 2 files changed, 234 insertions(+), 1 deletion(-) diff --git a/fw/htt.h b/fw/htt.h index 295776d15a..7a091598ae 100644 --- a/fw/htt.h +++ b/fw/htt.h @@ -177,9 +177,10 @@ * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t + * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def */ #define HTT_CURRENT_VERSION_MAJOR 3 -#define HTT_CURRENT_VERSION_MINOR 62 +#define HTT_CURRENT_VERSION_MINOR 63 #define HTT_NUM_TX_FRAG_DESC 1024 @@ -5755,6 +5756,7 @@ enum htt_t2h_msg_type { HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21, HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22, HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23, + HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24, HTT_T2H_MSG_TYPE_TEST, /* keep this last */ @@ -11432,4 +11434,182 @@ PREPACK struct htt_cfr_dump_compl_ind { * @tx_duration : Tx duration for the PPDU (microsecond units) */ + +/** + * @brief HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID Message + * + * @details + * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when + * continuous backpressure is seen in the LMAC/ UMAC rings software rings. + * This message will only be sent if the backpressure condition has existed + * continuously for an initial period (100 ms). + * Repeat messages with updated information will be sent after each + * subsequent period (100 ms) as long as the backpressure remains unabated. + * This message indicates the ring id along with current head and tail index + * locations (i.e. write and read indices). + * The backpressure time indicates the time in ms for which continous + * backpressure has been observed in the ring. + * + * The message format is as follows: + * + * |31 24|23 16|15 8|7 0| + * |----------------+----------------+----------------+----------------| + * | ring_id | ring_type | pdev_id | msg_type | + * |-------------------------------------------------------------------| + * | tail_idx | head_idx | + * |-------------------------------------------------------------------| + * | backpressure_time_ms | + * |-------------------------------------------------------------------| + * + * The message is interpreted as follows: + * dword0 - b'0:7 - msg_type: This will be set to + * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND + * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring. + * 1, 2, 3 indicates pdev_id 0,1,2 and + the msg is for LMAC ring. + * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type. + * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/ + * htt_backpressure_lmac_ring_id. This represents + * the ring id for which continous backpressure is seen + * + * dword1 - b'0:15 - head_idx: This indicates the current head index of + * the ring indicated by the ring_id + * + * dword1 - b'16:31 - tail_idx: This indicates the current tail index of + * the ring indicated by the ring id + * + * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous + * backpressure has been seen in the ring + * indicated by the ring_id. + * Units = milliseconds + */ +#define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00 +#define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8 +#define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000 +#define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16 +#define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000 +#define HTT_T2H_RX_BKPRESSURE_RINGID_S 24 +#define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff +#define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0 +#define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000 +#define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16 +#define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff +#define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0 + +#define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \ + do { \ + HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \ + (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \ + } while (0) +#define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \ + (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \ + HTT_T2H_RX_BKPRESSURE_PDEV_ID_S) + +#define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \ + do { \ + HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \ + (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \ + } while (0) +#define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \ + (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \ + HTT_T2H_RX_BKPRESSURE_RING_TYPE_S) + +#define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \ + do { \ + HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \ + (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \ + } while (0) +#define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \ + (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \ + HTT_T2H_RX_BKPRESSURE_RINGID_S) + +#define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \ + do { \ + HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \ + (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \ + } while (0) +#define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \ + (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \ + HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S) + +#define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \ + do { \ + HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \ + (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \ + } while (0) +#define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \ + (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \ + HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S) + +#define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \ + do { \ + HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \ + (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \ + } while (0) +#define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \ + (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \ + HTT_T2H_RX_BKPRESSURE_TIME_MS_S) + +enum htt_backpressure_ring_type { + HTT_SW_RING_TYPE_UMAC, + HTT_SW_RING_TYPE_LMAC, + HTT_SW_RING_TYPE_MAX, +}; + +/* Ring id for which the message is sent to host */ +enum htt_backpressure_umac_ringid { + HTT_SW_RING_IDX_REO_REO2SW1_RING, + HTT_SW_RING_IDX_REO_REO2SW2_RING, + HTT_SW_RING_IDX_REO_REO2SW3_RING, + HTT_SW_RING_IDX_REO_REO2SW4_RING, + HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING, + HTT_SW_RING_IDX_REO_REO2TCL_RING, + HTT_SW_RING_IDX_REO_REO2FW_RING, + HTT_SW_RING_IDX_REO_REO_RELEASE_RING, + HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING, + HTT_SW_RING_IDX_TCL_TCL2TQM_RING, + HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING, + HTT_SW_RING_IDX_WBM_REO_RELEASE_RING, + HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING, + HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING, + HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING, + HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING, + HTT_SW_RING_IDX_REO_REO_CMD_RING, + HTT_SW_RING_IDX_REO_REO_STATUS_RING, + HTT_SW_UMAC_RING_IDX_MAX, +}; + +enum htt_backpressure_lmac_ringid { + HTT_SW_RING_IDX_FW2RXDMA_BUF_RING, + HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING, + HTT_SW_RING_IDX_FW2RXDMA_LINK_RING, + HTT_SW_RING_IDX_SW2RXDMA_BUF_RING, + HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING, + HTT_SW_RING_IDX_RXDMA2FW_RING, + HTT_SW_RING_IDX_RXDMA2SW_RING, + HTT_SW_RING_IDX_RXDMA2RELEASE_RING, + HTT_SW_RING_IDX_RXDMA2REO_RING, + HTT_SW_RING_IDX_MONITOR_STATUS_RING, + HTT_SW_RING_IDX_MONITOR_BUF_RING, + HTT_SW_RING_IDX_MONITOR_DESC_RING, + HTT_SW_RING_IDX_MONITOR_DEST_RING, + HTT_SW_LMAC_RING_IDX_MAX, +}; + +PREPACK struct htt_t2h_msg_bkpressure_event_ind_t { + A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */ + pdev_id: 8, + ring_type: 8, /* htt_backpressure_ring_type */ + /* + * ring_id holds an enum value from either + * htt_backpressure_umac_ringid or + * htt_backpressure_lmac_ringid, based on + * the ring_type setting. + */ + ring_id: 8; + A_UINT16 head_idx; + A_UINT16 tail_idx; + A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */ +} POSTPACK; + #endif diff --git a/fw/htt_stats.h b/fw/htt_stats.h index 1de7ec053c..924434b403 100644 --- a/fw/htt_stats.h +++ b/fw/htt_stats.h @@ -267,6 +267,15 @@ enum htt_dbg_ext_stats_type { */ HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS = 23, + /* HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS + * PARAMS: + * - config_param0: + * No params + * RESP MSG: + * - htt_stats_ring_backpressure_stats_t + */ + HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS = 24, + /* keep this last */ HTT_DBG_NUM_EXT_STATS = 256, }; @@ -362,6 +371,7 @@ typedef enum { HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */ HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */ HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */ + HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */ HTT_STATS_MAX_TAG, } htt_tlv_tag_t; @@ -3782,4 +3792,47 @@ typedef struct { htt_pdev_obss_pd_stats_tlv obss_pd_stat; } htt_pdev_obss_pd_stats_t; +typedef struct { + htt_tlv_hdr_t tlv_hdr; + A_UINT32 pdev_id; + A_UINT32 current_head_idx; + A_UINT32 current_tail_idx; + A_UINT32 num_htt_msgs_sent; + /* + * Time in milliseconds for which the ring has been in + * its current backpressure condition + */ + A_UINT32 backpressure_time_ms; + /* backpressure_hist - histogram showing how many times different degrees + * of backpressure duration occurred: + * Index 0 indicates the number of times ring was + * continously in backpressure state for 100 - 200ms. + * Index 1 indicates the number of times ring was + * continously in backpressure state for 200 - 300ms. + * Index 2 indicates the number of times ring was + * continously in backpressure state for 300 - 400ms. + * Index 3 indicates the number of times ring was + * continously in backpressure state for 400 - 500ms. + * Index 4 indicates the number of times ring was + * continously in backpressure state beyond 500ms. + */ + A_UINT32 backpressure_hist[5]; +} htt_ring_backpressure_stats_tlv; + +/* STATS_TYPE : HTT_STATS_RING_BACKPRESSURE_STATS_INFO + * TLV_TAGS: + * - HTT_STATS_RING_BACKPRESSURE_STATS_TAG + */ +/* NOTE: + * This structure is for documentation, and cannot be safely used directly. + * Instead, use the constituent TLV structures to fill/parse. + */ +typedef struct { + htt_sring_cmn_tlv cmn_tlv; + struct { + htt_stats_string_tlv sring_str_tlv; + htt_ring_backpressure_stats_tlv backpressure_stats_tlv; + } r[1]; /* variable-length array */ +} htt_ring_backpressure_stats_t; + #endif /* __HTT_STATS_H__ */