diff --git a/dp/inc/cdp_txrx_misc.h b/dp/inc/cdp_txrx_misc.h index e51f775a55..a7bdc38f61 100644 --- a/dp/inc/cdp_txrx_misc.h +++ b/dp/inc/cdp_txrx_misc.h @@ -1045,4 +1045,31 @@ cdp_get_bus_lvl_high(ol_txrx_soc_handle soc) return true; } #endif + +#ifdef DP_TX_PACKET_INSPECT_FOR_ILP +/** + * cdp_evaluate_update_tx_ilp_cfg() - Evaluate and update DP TX + * ILP configuration + * @soc: DP SOC handle + * @num_msdu_idx_map: Number of HTT msdu index to qtype map in array + * @msdu_idx_map_arr: Pointer to HTT msdu index to qtype map array + * + * Return: Final updated TX ILP enable result, true - enabled, false - not + */ +static inline bool +cdp_evaluate_update_tx_ilp_cfg(ol_txrx_soc_handle soc, + uint8_t num_msdu_idx_map, + uint8_t *msdu_idx_map_arr) +{ + if (!soc || !soc->ops || !soc->ops->misc_ops || + !soc->ops->misc_ops->evaluate_update_tx_ilp_cfg) { + dp_cdp_debug("Invalid Instance:"); + return false; + } + + return soc->ops->misc_ops->evaluate_update_tx_ilp_cfg( + soc, num_msdu_idx_map, + msdu_idx_map_arr); +} +#endif /* DP_TX_PACKET_INSPECT_FOR_ILP */ #endif /* _CDP_TXRX_MISC_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 6b886c8a17..d8df88d3ca 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -1717,6 +1717,7 @@ void (*peer_send_wds_disconnect)(struct cdp_ctrl_objmgr_psoc *psoc, * @set_bus_vote_lvl_high: The bus lvl is set to high or low based on tput * @get_bus_vote_lvl_high: Get bus lvl to determine whether or not get * rx rate stats + * @evaluate_update_tx_ilp_cfg: Evaluate and update DP TX ILP configuration * * Function pointers for miscellaneous soc/pdev/vdev related operations. */ @@ -1819,6 +1820,11 @@ struct cdp_misc_ops { void (*set_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl, bool high); bool (*get_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl); #endif +#ifdef DP_TX_PACKET_INSPECT_FOR_ILP + bool (*evaluate_update_tx_ilp_cfg)(struct cdp_soc_t *soc_hdl, + uint8_t num_msdu_idx_map, + uint8_t *msdu_idx_map_arr); +#endif }; /** diff --git a/dp/wifi3.0/be/dp_be_tx.c b/dp/wifi3.0/be/dp_be_tx.c index 42f0710358..cd19941415 100644 --- a/dp/wifi3.0/be/dp_be_tx.c +++ b/dp/wifi3.0/be/dp_be_tx.c @@ -506,7 +506,7 @@ void dp_tx_set_particular_tx_queue(struct dp_soc *soc, uint32_t *hal_tx_desc, qdf_nbuf_t nbuf) { - if (!soc->wlan_cfg_ctx->tx_pkt_inspect_for_ilp) + if (!soc->tx_ilp_enable) return; if (qdf_unlikely(QDF_NBUF_CB_GET_PACKET_TYPE(nbuf) == diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index f1a48acc54..ee54c19bb0 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -10101,6 +10101,62 @@ void dp_set_tx_pause(struct cdp_soc_t *soc_hdl, bool flag) soc->is_tx_pause = flag; } +#ifdef DP_TX_PACKET_INSPECT_FOR_ILP +/** + * dp_evaluate_update_tx_ilp_config() - Evaluate and update DP TX + * ILP configuration + * @soc_hdl: CDP SOC handle + * @num_msdu_idx_map: Number of HTT msdu index to qtype map in array + * @msdu_idx_map_arr: Pointer to HTT msdu index to qtype map array + * + * This function will check: (a) TX ILP INI configuration, + * (b) index 3 value in array same as HTT_MSDU_QTYPE_LATENCY_TOLERANT, + * only if both (a) and (b) condition is met, then TX ILP feature is + * considered to be enabled. + * + * Return: Final updated TX ILP enable result in dp_soc, + * true is enabled, false is not + */ +static +bool dp_evaluate_update_tx_ilp_config(struct cdp_soc_t *soc_hdl, + uint8_t num_msdu_idx_map, + uint8_t *msdu_idx_map_arr) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + bool enable_tx_ilp = false; + + /** + * Check INI configuration firstly, if it's disabled, + * then keep feature disabled. + */ + if (!wlan_cfg_get_tx_ilp_inspect_config(soc->wlan_cfg_ctx)) { + dp_info("TX ILP INI is disabled already"); + goto update_tx_ilp; + } + + /* Check if the msdu index to qtype map table is valid */ + if (num_msdu_idx_map != HTT_MSDUQ_MAX_INDEX || !msdu_idx_map_arr) { + dp_info("Invalid msdu_idx qtype map num: 0x%x, arr_addr %pK", + num_msdu_idx_map, msdu_idx_map_arr); + goto update_tx_ilp; + } + + dp_info("msdu_idx_map_arr idx 0x%x value 0x%x", + HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, + msdu_idx_map_arr[HTT_MSDUQ_INDEX_CUSTOM_PRIO_1]); + + if (HTT_MSDU_QTYPE_LATENCY_TOLERANT == + msdu_idx_map_arr[HTT_MSDUQ_INDEX_CUSTOM_PRIO_1]) + enable_tx_ilp = true; + +update_tx_ilp: + soc->tx_ilp_enable = enable_tx_ilp; + dp_info("configure tx ilp enable %d", soc->tx_ilp_enable); + + return soc->tx_ilp_enable; +} +#endif + static struct cdp_cmn_ops dp_ops_cmn = { .txrx_soc_attach_target = dp_soc_attach_target_wifi3, .txrx_vdev_attach = dp_vdev_attach_wifi3, @@ -10914,6 +10970,9 @@ static struct cdp_misc_ops dp_ops_misc = { .set_bus_vote_lvl_high = dp_set_bus_vote_lvl_high, .get_bus_vote_lvl_high = dp_get_bus_vote_lvl_high, #endif +#ifdef DP_TX_PACKET_INSPECT_FOR_ILP + .evaluate_update_tx_ilp_cfg = dp_evaluate_update_tx_ilp_config, +#endif }; #endif @@ -11225,6 +11284,19 @@ dp_get_link_desc_id_start(uint16_t arch_id) } } +#ifdef DP_TX_PACKET_INSPECT_FOR_ILP +static inline +void dp_soc_init_tx_ilp(struct dp_soc *soc) +{ + soc->tx_ilp_enable = false; +} +#else +static inline +void dp_soc_init_tx_ilp(struct dp_soc *soc) +{ +} +#endif + /** * dp_soc_attach() - Attach txrx SOC * @ctrl_psoc: Opaque SOC handle from control plane @@ -11275,6 +11347,7 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, soc->ctrl_psoc = ctrl_psoc; soc->osdev = qdf_osdev; soc->num_hw_dscp_tid_map = HAL_MAX_HW_DSCP_TID_MAPS; + dp_soc_init_tx_ilp(soc); hal_rx_get_tlv_size(soc->hal_soc, &soc->rx_pkt_tlv_size, &soc->rx_mon_pkt_tlv_size); soc->idle_link_bm_id = hal_get_idle_link_bm_id(soc->hal_soc, diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index ac637ce2ad..9ebc04eb93 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -3071,6 +3071,10 @@ struct dp_soc { #endif /* Reo queue ref table items */ struct reo_queue_ref_table reo_qref; +#ifdef DP_TX_PACKET_INSPECT_FOR_ILP + /* Flag to show if TX ILP is enabled */ + bool tx_ilp_enable; +#endif }; #ifdef IPA_OFFLOAD diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index b3fa0a1fff..63d6499485 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -2448,6 +2448,20 @@ wlan_cfg_get_tx_capt_max_mem(struct wlan_cfg_dp_soc_ctxt *cfg) } #endif /* WLAN_TX_PKT_CAPTURE_ENH */ +#ifdef DP_TX_PACKET_INSPECT_FOR_ILP +/** + * wlan_cfg_get_tx_ilp_inspect_config() - Get TX ILP configuration + * @cfg: Configuration Handle + * + * Return: TX ILP enable or not + */ +static inline bool +wlan_cfg_get_tx_ilp_inspect_config(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->tx_pkt_inspect_for_ilp; +} +#endif + /** * wlan_cfg_get_napi_scale_factor() - Get napi scale factor * @cfg: soc configuration context