qcacmn: Defer IPA SMMU mapping to OPT_DP reserve
Currently, IPA SMMU map/unmap is called as part of init. This causes every nbuf to be mapped to IPA in the Rx path, causing throughputs to drop. This change resolves the problem by deferring the IPA SMMU map/unmap call to OPT_DP filter reserve/release, as nbuf needs to be mapped to IPA only in this scenario. Change-Id: If198a6c5f22af58fdaf9d9c020c74b1f76002e37 CRs-Fixed: 3496679
This commit is contained in:

committed by
Rahul Choudhary

parent
7830b92b9d
commit
b50ceeee79
@@ -378,6 +378,21 @@ static QDF_STATUS dp_ipa_handle_rx_buf_pool_smmu_mapping(
|
||||
}
|
||||
#endif /* RX_DESC_MULTI_PAGE_ALLOC */
|
||||
|
||||
QDF_STATUS dp_ipa_set_smmu_mapped(struct cdp_soc_t *soc_hdl, int val)
|
||||
{
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
|
||||
qdf_atomic_set(&soc->ipa_mapped, val);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
int dp_ipa_get_smmu_mapped(struct cdp_soc_t *soc_hdl)
|
||||
{
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
|
||||
return qdf_atomic_read(&soc->ipa_mapped);
|
||||
}
|
||||
|
||||
static QDF_STATUS dp_ipa_get_shared_mem_info(qdf_device_t osdev,
|
||||
qdf_shared_mem_t *shared_mem,
|
||||
void *cpu_addr,
|
||||
@@ -3448,8 +3463,12 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
||||
|
||||
qdf_atomic_set(&soc->ipa_pipes_enabled, 1);
|
||||
DP_IPA_EP_SET_TX_DB_PA(soc, ipa_res);
|
||||
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, true,
|
||||
__func__, __LINE__);
|
||||
|
||||
if (!ipa_config_is_opt_wifi_dp_enabled()) {
|
||||
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, true,
|
||||
__func__, __LINE__);
|
||||
qdf_atomic_set(&soc->ipa_mapped, 1);
|
||||
}
|
||||
|
||||
result = qdf_ipa_wdi_enable_pipes(hdl);
|
||||
if (result) {
|
||||
@@ -3458,8 +3477,9 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
||||
__func__, result);
|
||||
qdf_atomic_set(&soc->ipa_pipes_enabled, 0);
|
||||
DP_IPA_RESET_TX_DB_PA(soc, ipa_res);
|
||||
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, false,
|
||||
__func__, __LINE__);
|
||||
if (qdf_atomic_read(&soc->ipa_mapped))
|
||||
dp_ipa_handle_rx_buf_pool_smmu_mapping(
|
||||
soc, pdev, false, __func__, __LINE__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
@@ -3505,8 +3525,10 @@ QDF_STATUS dp_ipa_disable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
||||
}
|
||||
|
||||
qdf_atomic_set(&soc->ipa_pipes_enabled, 0);
|
||||
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, false,
|
||||
__func__, __LINE__);
|
||||
|
||||
if (qdf_atomic_read(&soc->ipa_mapped))
|
||||
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, false,
|
||||
__func__, __LINE__);
|
||||
|
||||
return result ? QDF_STATUS_E_FAILURE : QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3915,6 +3937,31 @@ QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||
|
||||
if (!qdf_mem_smmu_s1_enabled(soc->osdev)) {
|
||||
dp_debug("SMMU S1 disabled");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (!pdev) {
|
||||
dp_err("Invalid pdev instance pdev_id:%d", pdev_id);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (__dp_ipa_tx_buf_smmu_mapping(soc, pdev, false, func, line) ||
|
||||
dp_ipa_tx_alt_buf_smmu_mapping(soc, pdev, false, func, line))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS dp_ipa_rx_buf_pool_smmu_mapping(
|
||||
struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
|
||||
bool create, const char *func, uint32_t line)
|
||||
{
|
||||
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
|
||||
struct dp_pdev *pdev =
|
||||
dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
|
||||
|
||||
if (!pdev) {
|
||||
dp_err("Invalid instance");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
@@ -3925,13 +3972,9 @@ QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (__dp_ipa_tx_buf_smmu_mapping(soc, pdev, false, func, line) ||
|
||||
dp_ipa_tx_alt_buf_smmu_mapping(soc, pdev, false, func, line))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
dp_ipa_handle_rx_buf_pool_smmu_mapping(soc, pdev, create, func, line);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef IPA_WDS_EASYMESH_FEATURE
|
||||
QDF_STATUS dp_ipa_ast_create(struct cdp_soc_t *soc_hdl,
|
||||
qdf_ipa_ast_info_type_t *data)
|
||||
|
Reference in New Issue
Block a user