summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDebashis Dutt <ddutt@qca.qualcomm.com>2014-12-05 20:09:17 -0800
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-01-07 14:20:13 +0530
commita41edf0bc89f16e070f45658650bee7b41cab3db (patch)
treec96ee6e240a76a401039ae3d884559c46e842ff9
parentbb2d5efeddcc9745d77e92abfdbf457c690ef053 (diff)
qcacld-wlan: Enhance txrx_fw_stats
1) Enhance iwpriv wlan0 txrx_fw_stats 2 -- Add more fields struct rx_reorder_stats{} 2) Add iwpriv wlan0 txrx_fw_stats 12 -- Statistics with respect to f/w view of remote ring. Change-Id: I491624b273cc2b38d94e37d55abd8f18ba1f1b33 CRs-Fixed: 767452
-rw-r--r--CORE/CLD_TXRX/HTT/htt_fw_stats.c78
-rw-r--r--CORE/CLD_TXRX/TXRX/ol_txrx.c16
-rw-r--r--CORE/SERVICES/WMA/wma.c29
-rw-r--r--CORE/SERVICES/WMA/wma.h1
4 files changed, 121 insertions, 3 deletions
diff --git a/CORE/CLD_TXRX/HTT/htt_fw_stats.c b/CORE/CLD_TXRX/HTT/htt_fw_stats.c
index dfca31bc599a..d7c13727db23 100644
--- a/CORE/CLD_TXRX/HTT/htt_fw_stats.c
+++ b/CORE/CLD_TXRX/HTT/htt_fw_stats.c
@@ -353,10 +353,75 @@ htt_t2h_stats_rx_reorder_stats_print(
stats_ptr->dup_past);
adf_os_print(" %u times reorder timeout happened\n",
stats_ptr->reorder_timeout);
- adf_os_print(" %u times bar ssn reset happened\n",
- stats_ptr->ssn_reset);
adf_os_print(" %u times incorrect bar received\n",
stats_ptr->invalid_bar_ssn);
+ adf_os_print(" %u times bar ssn reset happened\n",
+ stats_ptr->ssn_reset);
+ adf_os_print(" %u times flushed due to peer delete\n",
+ stats_ptr->deliver_flush_delpeer);
+ adf_os_print(" %u times flushed due to offload\n",
+ stats_ptr->deliver_flush_offload);
+ adf_os_print(" %u times flushed due to ouf of buffer\n",
+ stats_ptr->deliver_flush_oob);
+ adf_os_print(" %u MPDU's dropped due to PN check fail\n",
+ stats_ptr->pn_fail);
+ adf_os_print(" %u MPDU's dropped due to lack of memory\n",
+ stats_ptr->store_fail);
+ adf_os_print(" %u times tid pool alloc succeeded\n",
+ stats_ptr->tid_pool_alloc_succ);
+ adf_os_print(" %u times MPDU pool alloc succeeded\n",
+ stats_ptr->mpdu_pool_alloc_succ);
+ adf_os_print(" %u times MSDU pool alloc succeeded\n",
+ stats_ptr->msdu_pool_alloc_succ);
+ adf_os_print(" %u times tid pool alloc failed\n",
+ stats_ptr->tid_pool_alloc_fail);
+ adf_os_print(" %u times MPDU pool alloc failed\n",
+ stats_ptr->mpdu_pool_alloc_fail);
+ adf_os_print(" %u times MSDU pool alloc failed\n",
+ stats_ptr->msdu_pool_alloc_fail);
+ adf_os_print(" %u times tid pool freed\n",
+ stats_ptr->tid_pool_free);
+ adf_os_print(" %u times MPDU pool freed\n",
+ stats_ptr->mpdu_pool_free);
+ adf_os_print(" %u times MSDU pool freed\n",
+ stats_ptr->msdu_pool_free);
+ adf_os_print(" %u MSDUs undelivered to HTT, queued to Rx MSDU free list\n",
+ stats_ptr->msdu_queued);
+ adf_os_print(" %u MSDUs released from Rx MSDU list to MAC ring\n",
+ stats_ptr->msdu_recycled);
+}
+
+static void
+htt_t2h_stats_rx_rem_buf_stats_print(
+ struct rx_remote_buffer_mgmt_stats *stats_ptr, int concise)
+{
+ adf_os_print("Rx Remote Buffer Statistics:\n");
+ adf_os_print(" %u MSDU's reaped for Rx processing\n",
+ stats_ptr->remote_reaped);
+ adf_os_print(" %u MSDU's recycled within firmware\n",
+ stats_ptr->remote_recycled);
+ adf_os_print(" %u MSDU's stored by Data Rx\n",
+ stats_ptr->data_rx_msdus_stored);
+ adf_os_print(" %u HTT indications from WAL Rx MSDU\n",
+ stats_ptr->wal_rx_ind);
+ adf_os_print(" %u HTT indications unconsumed from WAL Rx MSDU\n",
+ stats_ptr->wal_rx_ind_unconsumed);
+ adf_os_print(" %u HTT indications from Data Rx MSDU\n",
+ stats_ptr->data_rx_ind);
+ adf_os_print(" %u HTT indications unconsumed from Data Rx MSDU\n",
+ stats_ptr->data_rx_ind_unconsumed);
+ adf_os_print(" %u HTT indications from ATHBUF\n",
+ stats_ptr->athbuf_rx_ind);
+ adf_os_print(" %u Remote buffers requested for refill\n",
+ stats_ptr->refill_buf_req);
+ adf_os_print(" %u Remote buffers filled by host\n",
+ stats_ptr->refill_buf_rsp);
+ adf_os_print(" %u times MAC has no buffers\n",
+ stats_ptr->mac_no_bufs);
+ adf_os_print(" %u times f/w write & read indices on MAC ring are equal\n",
+ stats_ptr->fw_indices_equal);
+ adf_os_print(" %u times f/w has no remote buffers to post to MAC\n",
+ stats_ptr->host_no_bufs);
}
#define HTT_T2H_STATS_TX_PPDU_TIME_TO_MICROSEC(ticks, microsec_per_tick) \
@@ -719,6 +784,15 @@ htt_t2h_stats_print(u_int8_t *stats_data, int concise)
htt_t2h_stats_tx_rate_stats_print(tx_rate_info, concise);
break;
}
+ case HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO:
+ {
+
+ struct rx_remote_buffer_mgmt_stats *rx_rem_buf;
+
+ rx_rem_buf = (struct rx_remote_buffer_mgmt_stats *)(msg_word + 1);
+ htt_t2h_stats_rx_rem_buf_stats_print(rx_rem_buf, concise);
+ break;
+ }
default:
break;
}
diff --git a/CORE/CLD_TXRX/TXRX/ol_txrx.c b/CORE/CLD_TXRX/TXRX/ol_txrx.c
index 53c816e60c79..3635fd612c9d 100644
--- a/CORE/CLD_TXRX/TXRX/ol_txrx.c
+++ b/CORE/CLD_TXRX/TXRX/ol_txrx.c
@@ -1914,6 +1914,22 @@ ol_txrx_fw_stats_handler(
case HTT_DBG_STATS_TX_PPDU_LOG:
bytes = 0; /* TO DO: specify how many bytes are present */
/* TO DO: add copying to the requestor's buffer */
+ break;
+
+ case HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO:
+
+ bytes = sizeof(struct rx_remote_buffer_mgmt_stats);
+ if (req->base.copy.buf) {
+ int limit;
+
+ limit = sizeof(struct rx_remote_buffer_mgmt_stats);
+ if (req->base.copy.byte_limit < limit) {
+ limit = req->base.copy.byte_limit;
+ }
+ buf = req->base.copy.buf + req->offset;
+ adf_os_mem_copy(buf, stats_data, limit);
+ }
+ break;
default:
break;
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index 1751cb7aecd6..2f5a2aa2b1dc 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -10911,8 +10911,35 @@ static int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
*/
req.print.concise = 1;
req.stats_type_upload_mask = 1 << (WMA_FW_TX_PPDU_STATS - 1);
- } else if (value == WMA_FW_TX_RC_STATS)
+ } else if (value == WMA_FW_TX_RC_STATS) {
req.stats_type_upload_mask = 1 << (WMA_FW_TX_CONCISE_STATS - 1);
+ /*
+ * This part of the code is a bit confusing.
+ * For the statistics command iwpriv wlan0 txrx_fw_stats <n>,
+ * for all n <= 4, there is 1:1 mapping of WMA defined value (n)
+ * with f/w required stats_type_upload_mask.
+ * For n <= 4, stats_type_upload_mask = 1 << (n - 1)
+ * With the introduction of WMA_FW_TX_CONCISE_STATS, this changed
+ * & the code has a special case handling, where for n = 5,
+ * stats_type_upload_mask = 1 << (n - 2).
+ * However per current code, there is no way to set the value of
+ * stats_type_upload_mask for n > 5.
+ * In the mean-time for dumping Remote Ring Buffer information,
+ * f/w expects stats_type_upload_mask = 1 << 12.
+ * However going by CLI command arguments, n should be 7.
+ * There seems to be no apparent correlation between 7 & 12.
+ * To fix this properly, one needs to fix the WMA defines appropriately
+ * and always let n have a 1:1 correspondence with the bitmask expected by f/w.
+ * Do not want to disturb the existing code now, but extending this code,
+ * so that CLI argument "n" has 1:1 correpondence with f/w bitmask.
+ * With this approach, for remote ring information, the statistics
+ * command should be:
+ * iwpriv wlan0 txrx_fw_stats 12
+ */
+ /* FIXME : Fix all the values in the appropriate way. */
+ } else if (value == WMA_FW_RX_REM_RING_BUF) {
+ req.stats_type_upload_mask = 1 << WMA_FW_RX_REM_RING_BUF;
+ }
ol_txrx_fw_stats_get(vdev, &req);
diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h
index 5bccc7930b97..3b601c1f34d3 100644
--- a/CORE/SERVICES/WMA/wma.h
+++ b/CORE/SERVICES/WMA/wma.h
@@ -1132,6 +1132,7 @@ u_int16_t get_regdmn_5g(u_int32_t reg_dmn);
#define WMA_FW_TX_PPDU_STATS 0x4
#define WMA_FW_TX_CONCISE_STATS 0x5
#define WMA_FW_TX_RC_STATS 0x6
+#define WMA_FW_RX_REM_RING_BUF 0xc
/*
* Setting the Tx Comp Timeout to 1 secs.