qcacmn: add rx nbuf ipa smmu map/unmap trace

Currently in_use and unmapped flag from rx_desc can not know is
the rx nbuf has done IPA smmu map/unmap accurately.
add rx nbuf IPA smmu map/unmap flag in qdf_nbuf_cb, and use
this flag to check if IPA smmu map/unmap need to be done or not.

Change-Id: I19bbc6cc69ba752ef7c58d41fbe26299ca96d29e
CRs-Fixed: 2731313
This commit is contained in:
Jinwei Chen
2020-07-20 23:10:57 +08:00
committed by snandini
parent fc461df2d5
commit d552bfa2cb
7 changed files with 115 additions and 3 deletions

View File

@@ -128,8 +128,29 @@ QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
!qdf_mem_smmu_s1_enabled(soc->osdev))
return QDF_STATUS_SUCCESS;
if (!qdf_atomic_read(&soc->ipa_pipes_enabled))
return QDF_STATUS_SUCCESS;
/**
* Even if ipa pipes is disabled, but if it's unmap
* operation and nbuf has done ipa smmu map before,
* do ipa smmu unmap as well.
*/
if (!qdf_atomic_read(&soc->ipa_pipes_enabled)) {
if (!create && qdf_nbuf_is_rx_ipa_smmu_map(nbuf)) {
DP_STATS_INC(soc, rx.err.ipa_unmap_no_pipe, 1);
} else {
return QDF_STATUS_SUCCESS;
}
}
if (qdf_unlikely(create == qdf_nbuf_is_rx_ipa_smmu_map(nbuf))) {
if (create) {
DP_STATS_INC(soc, rx.err.ipa_smmu_map_dup, 1);
} else {
DP_STATS_INC(soc, rx.err.ipa_smmu_unmap_dup, 1);
}
return QDF_STATUS_E_INVAL;
}
qdf_nbuf_set_rx_ipa_smmu_map(nbuf, create);
return __dp_ipa_handle_buf_smmu_mapping(soc, nbuf, size, create);
}
@@ -167,6 +188,19 @@ static QDF_STATUS dp_ipa_handle_rx_buf_pool_smmu_mapping(struct dp_soc *soc,
continue;
nbuf = rx_desc->nbuf;
if (qdf_unlikely(create ==
qdf_nbuf_is_rx_ipa_smmu_map(nbuf))) {
if (create) {
DP_STATS_INC(soc,
rx.err.ipa_smmu_map_dup, 1);
} else {
DP_STATS_INC(soc,
rx.err.ipa_smmu_unmap_dup, 1);
}
continue;
}
qdf_nbuf_set_rx_ipa_smmu_map(nbuf, create);
__dp_ipa_handle_buf_smmu_mapping(soc, nbuf,
rx_pool->buf_size, create);
}
@@ -198,6 +232,19 @@ static QDF_STATUS dp_ipa_handle_rx_buf_pool_smmu_mapping(struct dp_soc *soc,
nbuf = rx_pool->array[i].rx_desc.nbuf;
if (qdf_unlikely(create ==
qdf_nbuf_is_rx_ipa_smmu_map(nbuf))) {
if (create) {
DP_STATS_INC(soc,
rx.err.ipa_smmu_map_dup, 1);
} else {
DP_STATS_INC(soc,
rx.err.ipa_smmu_unmap_dup, 1);
}
continue;
}
qdf_nbuf_set_rx_ipa_smmu_map(nbuf, create);
__dp_ipa_handle_buf_smmu_mapping(soc, nbuf,
rx_pool->buf_size, create);
}