qcacmn: Fix rx_mpdu_received and error stats reporting to CNE

Current rx_mpdu_received and rx_mpdu_error stats reporting is incorrect.
rx_mpdu_received would be rx_mpdu_delivered + rx_mpdu_errors.
Also get combined rxdma_errors(rx_mpdu_errors) handled across host and FW.

Change-Id: Icbfeaffd7cd27d7f894df2d39add9cc7b47714be
CRs-Fixed: 3333010
This commit is contained in:
Prakash Manjunathappa
2023-01-11 13:49:41 -08:00
committed by Madan Koyyalamudi
parent 06e90b5374
commit 3167a36a06
3 changed files with 19 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -2934,6 +2934,7 @@ struct cdp_pdev_stats {
uint32_t ip_csum_err;
uint32_t tcp_udp_csum_err;
uint32_t rxdma_error;
uint32_t fw_reported_rxdma_error;
uint32_t reo_error;
} err;

View File

@@ -14849,14 +14849,18 @@ dp_txrx_ext_stats_request(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
req->tx_msdu_enqueue = pdev->stats.tx_i.processed.num;
req->tx_msdu_overflow = tcl_ring_full;
req->rx_mpdu_received = soc->ext_stats.rx_mpdu_received;
/* Error rate at LMAC */
req->rx_mpdu_received = soc->ext_stats.rx_mpdu_received +
pdev->stats.err.fw_reported_rxdma_error;
/* only count error source from RXDMA */
req->rx_mpdu_error = pdev->stats.err.fw_reported_rxdma_error;
/* Error rate at above the MAC */
req->rx_mpdu_delivered = soc->ext_stats.rx_mpdu_received;
req->rx_mpdu_missed = pdev->stats.err.reo_error;
/* only count error source from RXDMA */
req->rx_mpdu_error = pdev->stats.err.rxdma_error;
dp_info("ext stats: tx_msdu_enq = %u, tx_msdu_overflow = %u, "
"tx_mpdu_recieve = %u, rx_mpdu_delivered = %u, "
"rx_mpdu_receive = %u, rx_mpdu_delivered = %u, "
"rx_mpdu_missed = %u, rx_mpdu_error = %u",
req->tx_msdu_enqueue,
req->tx_msdu_overflow,
@@ -14959,6 +14963,7 @@ dp_request_rx_hw_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id)
last_rx_mpdu_received = soc->ext_stats.rx_mpdu_received;
last_rx_mpdu_missed = soc->ext_stats.rx_mpdu_missed;
soc->ext_stats.rx_mpdu_received = 0;
soc->ext_stats.rx_mpdu_missed = 0;
dp_debug("HW stats query start");
rx_stats_sent_cnt =

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -4299,7 +4299,8 @@ static void dp_print_rx_pdev_fw_mpdu_drop_tlv_v(uint32_t *tag_buf)
* tag_buf - Buffer
* Return - NULL
*/
static void dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv(uint32_t *tag_buf)
static uint64_t
dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv(uint32_t *tag_buf)
{
htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v *dp_stats_buf =
(htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v *)tag_buf;
@@ -4308,6 +4309,7 @@ static void dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv(uint32_t *tag_buf)
uint16_t index = 0;
char rxdma_err_cnt[DP_MAX_STRING_LEN];
uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
uint64_t total_rxdma_err_cnt = 0;
tag_len = qdf_min(tag_len, (uint32_t)HTT_RX_RXDMA_MAX_ERR_CODE);
@@ -4318,9 +4320,12 @@ static void dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv(uint32_t *tag_buf)
DP_MAX_STRING_LEN - index,
" %u:%u,", i,
dp_stats_buf->rxdma_err[i]);
total_rxdma_err_cnt += dp_stats_buf->rxdma_err[i];
}
DP_PRINT_STATS("rxdma_err = %s\n", rxdma_err_cnt);
return total_rxdma_err_cnt;
}
/*
@@ -4716,6 +4721,7 @@ void dp_htt_stats_print_tag(struct dp_pdev *pdev,
break;
case HTT_STATS_RX_REFILL_RXDMA_ERR_TAG:
pdev->stats.err.fw_reported_rxdma_error =
dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv(tag_buf);
break;