qcacmn: Add support for extended statistics with DS

Add support to handle the extended Tx completion
statistics during direct switch mode.

Change-Id: If1b6906d5d2b3156ead8ef039524f47e763cb543
CRs-Fixed: 3431840
This commit is contained in:
syed touqeer pasha
2023-02-13 13:55:43 +05:30
committed by Madan Koyyalamudi
parent 68a9eec276
commit c928ef0e59
2 changed files with 99 additions and 5 deletions

View File

@@ -1021,6 +1021,11 @@ int dp_ppeds_tx_comp_handler(struct dp_soc_be *be_soc, uint32_t quota)
hal_soc_handle_t hal_soc = soc->hal_soc;
hal_ring_handle_t hal_ring_hdl =
be_soc->ppeds_wbm_release_ring.hal_srng;
struct dp_txrx_peer *txrx_peer = NULL;
uint16_t peer_id = CDP_INVALID_PEER;
dp_txrx_ref_handle txrx_ref_handle = NULL;
struct dp_vdev *vdev = NULL;
struct dp_pdev *pdev = NULL;
if (qdf_unlikely(dp_srng_access_start(NULL, soc, hal_ring_hdl))) {
dp_err("HAL RING Access Failed -- %pK", hal_ring_hdl);
@@ -1081,6 +1086,50 @@ int dp_ppeds_tx_comp_handler(struct dp_soc_be *be_soc, uint32_t quota)
tx_desc->tx_status =
hal_tx_comp_get_tx_status(tx_comp_hal_desc);
/*
* Add desc sync to account for extended statistics
* during Tx completion.
*/
if (peer_id != tx_desc->peer_id) {
if (txrx_peer) {
dp_txrx_peer_unref_delete(txrx_ref_handle,
DP_MOD_ID_TX_COMP);
txrx_peer = NULL;
vdev = NULL;
pdev = NULL;
}
peer_id = tx_desc->peer_id;
txrx_peer =
dp_txrx_peer_get_ref_by_id(soc, peer_id,
&txrx_ref_handle,
DP_MOD_ID_TX_COMP);
if (txrx_peer) {
vdev = txrx_peer->vdev;
if (!vdev)
goto next_desc;
pdev = vdev->pdev;
if (!pdev)
goto next_desc;
dp_tx_desc_update_fast_comp_flag(soc,
tx_desc,
!pdev->enhanced_stats_en);
if (pdev->enhanced_stats_en) {
hal_tx_comp_desc_sync(tx_comp_hal_desc,
&tx_desc->comp, 1);
}
}
} else if (txrx_peer && vdev && pdev) {
dp_tx_desc_update_fast_comp_flag(soc,
tx_desc,
!pdev->enhanced_stats_en);
if (pdev->enhanced_stats_en) {
hal_tx_comp_desc_sync(tx_comp_hal_desc,
&tx_desc->comp, 1);
}
}
next_desc:
if (!head_desc) {
head_desc = tx_desc;
tail_desc = tx_desc;
@@ -1102,6 +1151,9 @@ int dp_ppeds_tx_comp_handler(struct dp_soc_be *be_soc, uint32_t quota)
dp_srng_access_end(NULL, soc, hal_ring_hdl);
if (txrx_peer)
dp_txrx_peer_unref_delete(txrx_ref_handle,
DP_MOD_ID_TX_COMP);
if (head_desc)
dp_tx_comp_process_desc_list(soc, head_desc,
CDP_MAX_TX_COMP_PPE_RING);

View File

@@ -5562,6 +5562,51 @@ dp_tx_nbuf_dev_kfree_list(qdf_nbuf_queue_head_t *nbuf_queue_head)
}
#endif
#ifdef WLAN_SUPPORT_PPEDS
static inline void
dp_tx_update_ppeds_tx_comp_stats(struct dp_soc *soc,
struct dp_txrx_peer *txrx_peer,
struct hal_tx_completion_status *ts,
struct dp_tx_desc_s *desc,
uint8_t ring_id)
{
uint8_t link_id = 0;
struct dp_vdev *vdev = NULL;
if (qdf_likely(txrx_peer)) {
dp_tx_update_peer_basic_stats(txrx_peer,
desc->length,
desc->tx_status,
false);
if (!(desc->flags & DP_TX_DESC_FLAG_SIMPLE)) {
hal_tx_comp_get_status(&desc->comp,
ts,
soc->hal_soc);
vdev = txrx_peer->vdev;
link_id = dp_tx_get_link_id_from_ppdu_id(soc,
ts,
txrx_peer,
vdev);
if (link_id < 1 || link_id > DP_MAX_MLO_LINKS)
link_id = 0;
dp_tx_update_peer_stats(desc, ts,
txrx_peer,
ring_id,
link_id);
}
}
}
#else
static inline void
dp_tx_update_ppeds_tx_comp_stats(struct dp_soc *soc,
struct dp_txrx_peer *txrx_peer,
struct hal_tx_completion_status *ts,
struct dp_tx_desc_s *desc,
uint8_t ring_id)
{
}
#endif
void
dp_tx_comp_process_desc_list(struct dp_soc *soc,
struct dp_tx_desc_s *comp_head, uint8_t ring_id)
@@ -5600,12 +5645,9 @@ dp_tx_comp_process_desc_list(struct dp_soc *soc,
if (desc->flags & DP_TX_DESC_FLAG_PPEDS) {
qdf_nbuf_t nbuf;
dp_tx_update_ppeds_tx_comp_stats(soc, txrx_peer, &ts,
desc, ring_id);
if (qdf_likely(txrx_peer))
dp_tx_update_peer_basic_stats(txrx_peer,
desc->length,
desc->tx_status,
false);
nbuf = dp_ppeds_tx_desc_free(soc, desc);
dp_tx_nbuf_dev_queue_free_no_flag(&h, nbuf);
desc = next;