qcacmn: Add DP API to evaluate if TX ILP needs to be enabled

Add DP API to evaluate if TX ILP needs to be enabled,
it is only enabled if following two conditions are met,
(1) INI for TX ILP is enabled
(2) htt msdu index to qtype mapping table index 3 value is
HTT_MSDU_QTYPE_LATENCY_TOLERANT

Change-Id: I4d0c1103941b8b12b8441762dc6b45d28ee1df21
CRs-Fixed: 3447096
This commit is contained in:
Jinwei Chen
2023-03-27 05:39:24 -07:00
committed by Madan Koyyalamudi
parent 72beba762d
commit 401521fc7c
6 changed files with 125 additions and 1 deletions

View File

@@ -1045,4 +1045,31 @@ cdp_get_bus_lvl_high(ol_txrx_soc_handle soc)
return true; return true;
} }
#endif #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_ */ #endif /* _CDP_TXRX_MISC_H_ */

View File

@@ -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 * @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 * @get_bus_vote_lvl_high: Get bus lvl to determine whether or not get
* rx rate stats * rx rate stats
* @evaluate_update_tx_ilp_cfg: Evaluate and update DP TX ILP configuration
* *
* Function pointers for miscellaneous soc/pdev/vdev related operations. * 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); 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); bool (*get_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl);
#endif #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
}; };
/** /**

View File

@@ -506,7 +506,7 @@ void dp_tx_set_particular_tx_queue(struct dp_soc *soc,
uint32_t *hal_tx_desc, uint32_t *hal_tx_desc,
qdf_nbuf_t nbuf) qdf_nbuf_t nbuf)
{ {
if (!soc->wlan_cfg_ctx->tx_pkt_inspect_for_ilp) if (!soc->tx_ilp_enable)
return; return;
if (qdf_unlikely(QDF_NBUF_CB_GET_PACKET_TYPE(nbuf) == if (qdf_unlikely(QDF_NBUF_CB_GET_PACKET_TYPE(nbuf) ==

View File

@@ -10101,6 +10101,62 @@ void dp_set_tx_pause(struct cdp_soc_t *soc_hdl, bool flag)
soc->is_tx_pause = 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 = { static struct cdp_cmn_ops dp_ops_cmn = {
.txrx_soc_attach_target = dp_soc_attach_target_wifi3, .txrx_soc_attach_target = dp_soc_attach_target_wifi3,
.txrx_vdev_attach = dp_vdev_attach_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, .set_bus_vote_lvl_high = dp_set_bus_vote_lvl_high,
.get_bus_vote_lvl_high = dp_get_bus_vote_lvl_high, .get_bus_vote_lvl_high = dp_get_bus_vote_lvl_high,
#endif #endif
#ifdef DP_TX_PACKET_INSPECT_FOR_ILP
.evaluate_update_tx_ilp_cfg = dp_evaluate_update_tx_ilp_config,
#endif
}; };
#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 * dp_soc_attach() - Attach txrx SOC
* @ctrl_psoc: Opaque SOC handle from control plane * @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->ctrl_psoc = ctrl_psoc;
soc->osdev = qdf_osdev; soc->osdev = qdf_osdev;
soc->num_hw_dscp_tid_map = HAL_MAX_HW_DSCP_TID_MAPS; 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, hal_rx_get_tlv_size(soc->hal_soc, &soc->rx_pkt_tlv_size,
&soc->rx_mon_pkt_tlv_size); &soc->rx_mon_pkt_tlv_size);
soc->idle_link_bm_id = hal_get_idle_link_bm_id(soc->hal_soc, soc->idle_link_bm_id = hal_get_idle_link_bm_id(soc->hal_soc,

View File

@@ -3071,6 +3071,10 @@ struct dp_soc {
#endif #endif
/* Reo queue ref table items */ /* Reo queue ref table items */
struct reo_queue_ref_table reo_qref; 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 #ifdef IPA_OFFLOAD

View File

@@ -2448,6 +2448,20 @@ wlan_cfg_get_tx_capt_max_mem(struct wlan_cfg_dp_soc_ctxt *cfg)
} }
#endif /* WLAN_TX_PKT_CAPTURE_ENH */ #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 * wlan_cfg_get_napi_scale_factor() - Get napi scale factor
* @cfg: soc configuration context * @cfg: soc configuration context