qcacmn: Clean up TxRx statistics
Cleanup the print format for rate stats.
Add missing elements in HAL tx completion structure.
Change-Id: I57aaac605fce5060f7943b9bbe95ef8e8c2d3b7b
diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h
index aba5465..069781e 100644
--- a/dp/inc/cdp_txrx_cmn_struct.h
+++ b/dp/inc/cdp_txrx_cmn_struct.h
@@ -44,13 +44,16 @@
#define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
#define CDP_INVALID_VDEV_ID 0xff
-#define MAX_MCS 12
+/* 1 additional MCS is for invalid values */
+#define MAX_MCS (12 + 1)
#define MAX_MCS_11A 8
#define MAX_MCS_11B 7
#define MAX_MCS_11AC 10
+/* 1 additional GI is for invalid values */
+#define MAX_GI (4 + 1)
#define SS_COUNT 8
-#define SUPPORTED_BW 4
-#define SUPPORTED_RECEPTION_TYPES 4
+#define MAX_BW 4
+#define MAX_RECEPTION_TYPES 4
/* Options for Dump Statistics */
#define CDP_HDD_STATS 0
@@ -106,28 +109,28 @@
* The bitmask contains 24 bits.
*/
enum htt_cmn_dbg_stats_type {
- HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
- HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
- HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
- HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
- HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
- HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
- HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
- HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
- HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
- HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
- HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
- HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
- HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
- HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
- HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
- HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
- HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
- HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
- /* bits 18-23 currently reserved */
+ HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
+ HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
+ HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
+ HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
+ HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
+ HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
+ HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
+ HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
+ HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
+ HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
+ HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
+ HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
+ HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
+ HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
+ HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
+ HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
+ HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
+ HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
+ /* bits 18-23 currently reserved */
- /* keep this last */
- HTT_DBG_CMN_NUM_STATS
+ /* keep this last */
+ HTT_DBG_CMN_NUM_STATS
};
/*
@@ -577,6 +580,7 @@
UPDATE_VDEV_STATS = 1,
UPDATE_PDEV_STATS = 2,
};
+
/* packet info */
struct cdp_pkt_info {
/*no of packets*/
@@ -597,6 +601,7 @@
struct cdp_pkt_info tx_success;
/* Total Tx failure */
uint32_t tx_failed;
+
/* Total Packets as ofdma*/
uint32_t ofdma;
/* Packets in STBC */
@@ -609,39 +614,38 @@
uint32_t non_amsdu_cnt;
/* Number of MSDUs part of AMSDU*/
uint32_t amsdu_cnt;
+
/* RSSI of last packet */
uint32_t last_ack_rssi;
/* Packet Type */
struct {
/* MCS Count */
- uint32_t mcs_count[MAX_MCS + 1];
+ uint32_t mcs_count[MAX_MCS];
} pkt_type[DOT11_MAX];
+
/* SGI count */
- uint32_t sgi_count[MAX_MCS + 1];
+ uint32_t sgi_count[MAX_GI];
+
/* Packet Count for different bandwidths */
- uint32_t bw[SUPPORTED_BW];
+ uint32_t bw[MAX_BW];
+
/* Wireless Multimedia type Count */
uint32_t wme_ac_type[WME_AC_MAX];
+
/* Wireless Multimedia type Count */
uint32_t excess_retries_ac[WME_AC_MAX];
/* Packets dropped on the Tx side */
struct {
/* Discarded by firmware */
- uint32_t fw_discard;
- /* fw_discard_retired */
- uint32_t fw_discard_retired;
+ uint32_t fw_rem;
/* firmware_discard_untransmitted */
- uint32_t fw_discard_untransmitted;
- /* ,pdu_age_out */
- uint32_t mpdu_age_out;
- /* firmware_discard_reason1 */
- uint32_t fw_discard_reason1;
- /* firmware_discard_reason2 */
- uint32_t fw_discard_reason2;
- /* firmware_discard_reason3 */
- uint32_t fw_discard_reason3;
+ uint32_t fw_rem_notx;
+ /* firmware_discard_transmitted */
+ uint32_t fw_rem_tx;
+ /* aged out in mpdu/msdu queues*/
+ uint32_t age_out;
} dropped;
};
@@ -677,18 +681,18 @@
/* Wireless Multimedia type Count */
uint32_t wme_ac_type[WME_AC_MAX];
/* Reception type os packets */
- uint32_t reception_type[SUPPORTED_RECEPTION_TYPES];
+ uint32_t reception_type[MAX_RECEPTION_TYPES];
/* Packet Type */
struct {
/* MCS Count */
- uint32_t mcs_count[MAX_MCS + 1];
+ uint32_t mcs_count[MAX_MCS];
} pkt_type[DOT11_MAX];
/* SGI count */
- uint32_t sgi_count[MAX_MCS + 1];
+ uint32_t sgi_count[MAX_GI];
/* Packet count in spatiel Streams */
uint32_t nss[SS_COUNT];
/* Packet Count in different bandwidths */
- uint32_t bw[SUPPORTED_BW];
+ uint32_t bw[MAX_BW];
/* Number of MSDUs with no MPDU level aggregation */
uint32_t non_ampdu_cnt;
/* Number of MSDUs part of AMSPU */
@@ -817,7 +821,6 @@
uint32_t pkts_201_plus;
};
-
struct cdp_pdev_stats {
/* packets dropped on rx */
struct {
@@ -852,6 +855,7 @@
/* desc alloc failed errors */
uint32_t desc_alloc_fail;
} err;
+
/* buffers added back in freelist */
uint32_t buf_freelist;
/* Tx Ingress stats */
diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h
index 773f327..a14c600 100644
--- a/dp/wifi3.0/dp_internal.h
+++ b/dp/wifi3.0/dp_internal.h
@@ -65,6 +65,10 @@
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL, \
fmt, ## args)
+#define DP_PRINT_STATS(fmt, args ...) \
+ QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, \
+ fmt, ## args)
+
#define DP_STATS_INIT(_handle) \
qdf_mem_set(&((_handle)->stats), sizeof((_handle)->stats), 0x0)
diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c
index e56e4af..6fc7e79 100644
--- a/dp/wifi3.0/dp_main.c
+++ b/dp/wifi3.0/dp_main.c
@@ -55,8 +55,9 @@
#define DP_WDS_AGING_TIMER_DEFAULT_MS 6000
#define DP_MCS_LENGTH (6*MAX_MCS)
#define DP_NSS_LENGTH (6*SS_COUNT)
-#define DP_RXDMA_ERR_LENGTH (6*MAX_RXDMA_ERRORS)
-#define DP_REO_ERR_LENGTH (6*REO_ERROR_TYPE_MAX)
+#define DP_RXDMA_ERR_LENGTH (6*HAL_RXDMA_ERR_MAX)
+#define DP_REO_ERR_LENGTH (6*HAL_REO_ERR_MAX)
+#define DP_MAX_MCS_STRING_LEN 30
#define DP_CURR_FW_STATS_AVAIL 19
#define DP_HTT_DBG_EXT_STATS_MAX 256
@@ -92,6 +93,98 @@
6, 6, 6, 6, 6, 6, 6, 6,
};
+/*
+ * struct dp_rate_debug
+ *
+ * @mcs_type: print string for a given mcs
+ * @valid: valid mcs rate?
+ */
+struct dp_rate_debug {
+ char mcs_type[DP_MAX_MCS_STRING_LEN];
+ uint8_t valid;
+};
+
+#define MCS_VALID 1
+#define MCS_INVALID 0
+
+static const struct dp_rate_debug dp_rate_string[DOT11_MAX][MAX_MCS] = {
+ {
+ {"CCK 11 Mbps Long ", MCS_VALID},
+ {"CCK 5.5 Mbps Long ", MCS_VALID},
+ {"CCK 2 Mbps Long ", MCS_VALID},
+ {"CCK 1 Mbps Long ", MCS_VALID},
+ {"CCK 11 Mbps Short ", MCS_VALID},
+ {"CCK 5.5 Mbps Short", MCS_VALID},
+ {"CCK 2 Mbps Short ", MCS_VALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_VALID},
+ },
+ {
+ {"OFDM 48 Mbps", MCS_VALID},
+ {"OFDM 24 Mbps", MCS_VALID},
+ {"OFDM 12 Mbps", MCS_VALID},
+ {"OFDM 6 Mbps ", MCS_VALID},
+ {"OFDM 54 Mbps", MCS_VALID},
+ {"OFDM 36 Mbps", MCS_VALID},
+ {"OFDM 18 Mbps", MCS_VALID},
+ {"OFDM 9 Mbps ", MCS_VALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_VALID},
+ },
+ {
+ {"HT MCS 0 (BPSK 1/2) ", MCS_VALID},
+ {"HT MCS 1 (QPSK 1/2) ", MCS_VALID},
+ {"HT MCS 2 (QPSK 3/4) ", MCS_VALID},
+ {"HT MCS 3 (16-QAM 1/2)", MCS_VALID},
+ {"HT MCS 4 (16-QAM 3/4)", MCS_VALID},
+ {"HT MCS 5 (64-QAM 2/3)", MCS_VALID},
+ {"HT MCS 6 (64-QAM 3/4)", MCS_VALID},
+ {"HT MCS 7 (64-QAM 5/6)", MCS_VALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_INVALID},
+ {"INVALID ", MCS_VALID},
+ },
+ {
+ {"VHT MCS 0 (BPSK 1/2) ", MCS_VALID},
+ {"VHT MCS 1 (QPSK 1/2) ", MCS_VALID},
+ {"VHT MCS 2 (QPSK 3/4) ", MCS_VALID},
+ {"VHT MCS 3 (16-QAM 1/2) ", MCS_VALID},
+ {"VHT MCS 4 (16-QAM 3/4) ", MCS_VALID},
+ {"VHT MCS 5 (64-QAM 2/3) ", MCS_VALID},
+ {"VHT MCS 6 (64-QAM 3/4) ", MCS_VALID},
+ {"VHT MCS 7 (64-QAM 5/6) ", MCS_VALID},
+ {"VHT MCS 8 (256-QAM 3/4) ", MCS_VALID},
+ {"VHT MCS 9 (256-QAM 5/6) ", MCS_VALID},
+ {"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
+ {"VHT MCS 10 (1024-QAM 5/6)", MCS_VALID},
+ {"INVALID ", MCS_VALID},
+ },
+ {
+ {"HE MCS 0 (BPSK 1/2) ", MCS_VALID},
+ {"HE MCS 1 (QPSK 1/2) ", MCS_VALID},
+ {"HE MCS 2 (QPSK 3/4) ", MCS_VALID},
+ {"HE MCS 3 (16-QAM 1/2) ", MCS_VALID},
+ {"HE MCS 4 (16-QAM 3/4) ", MCS_VALID},
+ {"HE MCS 5 (64-QAM 2/3) ", MCS_VALID},
+ {"HE MCS 6 (64-QAM 3/4) ", MCS_VALID},
+ {"HE MCS 7 (64-QAM 5/6) ", MCS_VALID},
+ {"HE MCS 8 (256-QAM 3/4) ", MCS_VALID},
+ {"HE MCS 9 (256-QAM 5/6) ", MCS_VALID},
+ {"HE MCS 10 (1024-QAM 3/4)", MCS_VALID},
+ {"HE MCS 10 (1024-QAM 5/6)", MCS_VALID},
+ {"INVALID ", MCS_VALID},
+ }
+};
+
/**
* @brief Cpu ring map types
*/
@@ -131,7 +224,7 @@
};
/**
- * @brief Firmware and Host statistics
+ * dp_stats_mapping_table - Firmware and Host statistics
* currently supported
*/
const int dp_stats_mapping_table[][STATS_TYPE_MAX] = {
@@ -3349,6 +3442,7 @@
void dp_aggregate_vdev_stats(struct dp_vdev *vdev)
{
struct dp_peer *peer = NULL;
+ struct dp_soc *soc = vdev->pdev->soc;
int i;
qdf_mem_set(&(vdev->stats.tx), sizeof(vdev->stats.tx), 0x0);
@@ -3358,7 +3452,7 @@
if (!peer)
return;
- for (i = 0; i <= MAX_MCS; i++) {
+ for (i = 0; i < MAX_MCS; i++) {
DP_STATS_AGGR(vdev, peer, tx.pkt_type[0].mcs_count[i]);
DP_STATS_AGGR(vdev, peer, tx.pkt_type[1].mcs_count[i]);
DP_STATS_AGGR(vdev, peer, tx.pkt_type[2].mcs_count[i]);
@@ -3371,7 +3465,7 @@
DP_STATS_AGGR(vdev, peer, rx.pkt_type[4].mcs_count[i]);
}
- for (i = 0; i < SUPPORTED_BW; i++) {
+ for (i = 0; i < MAX_BW; i++) {
DP_STATS_AGGR(vdev, peer, tx.bw[i]);
DP_STATS_AGGR(vdev, peer, rx.bw[i]);
}
@@ -3386,7 +3480,7 @@
}
- for (i = 0; i < MAX_MCS + 1; i++) {
+ for (i = 0; i < MAX_GI; i++) {
DP_STATS_AGGR(vdev, peer, tx.sgi_count[i]);
DP_STATS_AGGR(vdev, peer, rx.sgi_count[i]);
}
@@ -3402,12 +3496,10 @@
DP_STATS_AGGR(vdev, peer, tx.retries);
DP_STATS_AGGR(vdev, peer, tx.non_amsdu_cnt);
DP_STATS_AGGR(vdev, peer, tx.amsdu_cnt);
- DP_STATS_AGGR(vdev, peer, tx.dropped.fw_discard);
- DP_STATS_AGGR(vdev, peer, tx.dropped.fw_discard_retired);
- DP_STATS_AGGR(vdev, peer, tx.dropped.mpdu_age_out);
- DP_STATS_AGGR(vdev, peer, tx.dropped.fw_discard_reason1);
- DP_STATS_AGGR(vdev, peer, tx.dropped.fw_discard_reason2);
- DP_STATS_AGGR(vdev, peer, tx.dropped.fw_discard_reason3);
+ DP_STATS_AGGR(vdev, peer, tx.dropped.fw_rem);
+ DP_STATS_AGGR(vdev, peer, tx.dropped.fw_rem_tx);
+ DP_STATS_AGGR(vdev, peer, tx.dropped.fw_rem_notx);
+ DP_STATS_AGGR(vdev, peer, tx.dropped.age_out);
DP_STATS_AGGR(vdev, peer, rx.err.mic_err);
DP_STATS_AGGR(vdev, peer, rx.err.decrypt_err);
@@ -3434,6 +3526,9 @@
vdev->stats.tx.last_ack_rssi =
peer->stats.tx.last_ack_rssi;
}
+
+ soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev,
+ &vdev->stats, vdev->vdev_id, UPDATE_VDEV_STATS);
}
/**
@@ -3456,7 +3551,7 @@
return;
dp_aggregate_vdev_stats(vdev);
- for (i = 0; i <= MAX_MCS; i++) {
+ for (i = 0; i < MAX_MCS; i++) {
DP_STATS_AGGR(pdev, vdev, tx.pkt_type[0].mcs_count[i]);
DP_STATS_AGGR(pdev, vdev, tx.pkt_type[1].mcs_count[i]);
DP_STATS_AGGR(pdev, vdev, tx.pkt_type[2].mcs_count[i]);
@@ -3469,7 +3564,7 @@
DP_STATS_AGGR(pdev, vdev, rx.pkt_type[4].mcs_count[i]);
}
- for (i = 0; i < SUPPORTED_BW; i++) {
+ for (i = 0; i < MAX_BW; i++) {
DP_STATS_AGGR(pdev, vdev, tx.bw[i]);
DP_STATS_AGGR(pdev, vdev, rx.bw[i]);
}
@@ -3485,7 +3580,7 @@
}
- for (i = 0; i < MAX_MCS + 1; i++) {
+ for (i = 0; i < MAX_GI; i++) {
DP_STATS_AGGR(pdev, vdev, tx.sgi_count[i]);
DP_STATS_AGGR(pdev, vdev, rx.sgi_count[i]);
}
@@ -3501,16 +3596,10 @@
DP_STATS_AGGR(pdev, vdev, tx.retries);
DP_STATS_AGGR(pdev, vdev, tx.non_amsdu_cnt);
DP_STATS_AGGR(pdev, vdev, tx.amsdu_cnt);
- DP_STATS_AGGR(pdev, vdev, tx.dropped.fw_discard);
- DP_STATS_AGGR(pdev, vdev,
- tx.dropped.fw_discard_retired);
- DP_STATS_AGGR(pdev, vdev, tx.dropped.mpdu_age_out);
- DP_STATS_AGGR(pdev, vdev,
- tx.dropped.fw_discard_reason1);
- DP_STATS_AGGR(pdev, vdev,
- tx.dropped.fw_discard_reason2);
- DP_STATS_AGGR(pdev, vdev,
- tx.dropped.fw_discard_reason3);
+ DP_STATS_AGGR(pdev, vdev, tx.dropped.fw_rem);
+ DP_STATS_AGGR(pdev, vdev, tx.dropped.fw_rem_tx);
+ DP_STATS_AGGR(pdev, vdev, tx.dropped.fw_rem_notx);
+ DP_STATS_AGGR(pdev, vdev, tx.dropped.age_out);
DP_STATS_AGGR(pdev, vdev, rx.err.mic_err);
DP_STATS_AGGR(pdev, vdev, rx.err.decrypt_err);
@@ -3579,96 +3668,90 @@
static inline void
dp_print_pdev_tx_stats(struct dp_pdev *pdev)
{
- DP_TRACE_STATS(FATAL, "WLAN Tx Stats:\n");
- DP_TRACE_STATS(FATAL, "Received From Stack:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("PDEV Tx Stats:\n");
+ DP_PRINT_STATS("Received From Stack:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.rcvd.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d\n",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx_i.rcvd.bytes);
- DP_TRACE_STATS(FATAL, "Processed:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Processed:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.processed.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d\n",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx_i.processed.bytes);
- DP_TRACE_STATS(FATAL, "Completions:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Completions:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx.comp_pkt.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d\n",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx.comp_pkt.bytes);
- DP_TRACE_STATS(FATAL, "Dropped:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Dropped:");
+ DP_PRINT_STATS(" Total = %d",
pdev->stats.tx_i.dropped.dropped_pkt.num);
- DP_TRACE_STATS(FATAL, "Dma_map_error = %d",
+ DP_PRINT_STATS(" Dma_map_error = %d",
pdev->stats.tx_i.dropped.dma_error);
- DP_TRACE_STATS(FATAL, "Ring Full = %d",
+ DP_PRINT_STATS(" Ring Full = %d",
pdev->stats.tx_i.dropped.ring_full);
- DP_TRACE_STATS(FATAL, "Descriptor Not available = %d",
+ DP_PRINT_STATS(" Descriptor Not available = %d",
pdev->stats.tx_i.dropped.desc_na);
- DP_TRACE_STATS(FATAL, "HW enqueue failed= %d",
+ DP_PRINT_STATS(" HW enqueue failed= %d",
pdev->stats.tx_i.dropped.enqueue_fail);
- DP_TRACE_STATS(FATAL, "Resources Full = %d",
+ DP_PRINT_STATS(" Resources Full = %d",
pdev->stats.tx_i.dropped.res_full);
- DP_TRACE_STATS(FATAL, "Fw Discard = %d",
- pdev->stats.tx.dropped.fw_discard);
- DP_TRACE_STATS(FATAL, "Fw Discard Retired = %d",
- pdev->stats.tx.dropped.fw_discard_retired);
- DP_TRACE_STATS(FATAL, "Firmware Discard Untransmitted = %d",
- pdev->stats.tx.dropped.fw_discard_untransmitted);
- DP_TRACE_STATS(FATAL, "Mpdu Age Out = %d",
- pdev->stats.tx.dropped.mpdu_age_out);
- DP_TRACE_STATS(FATAL, "Firmware Discard Reason1 = %d",
- pdev->stats.tx.dropped.fw_discard_reason1);
- DP_TRACE_STATS(FATAL, "Firmware Discard Reason2 = %d",
- pdev->stats.tx.dropped.fw_discard_reason2);
- DP_TRACE_STATS(FATAL, "Firmware Discard Reason3 = %d\n",
- pdev->stats.tx.dropped.fw_discard_reason3);
- DP_TRACE_STATS(FATAL, "Scatter Gather:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS(" FW removed = %d",
+ pdev->stats.tx.dropped.fw_rem);
+ DP_PRINT_STATS(" FW removed transmitted = %d",
+ pdev->stats.tx.dropped.fw_rem_tx);
+ DP_PRINT_STATS(" FW removed untransmitted = %d",
+ pdev->stats.tx.dropped.fw_rem_notx);
+ DP_PRINT_STATS(" Aged Out from msdu/mpdu queues = %d",
+ pdev->stats.tx.dropped.age_out);
+ DP_PRINT_STATS("Scatter Gather:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.sg.sg_pkt.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx_i.sg.sg_pkt.bytes);
- DP_TRACE_STATS(FATAL, "Dropped By Host = %d",
+ DP_PRINT_STATS(" Dropped By Host = %d",
pdev->stats.tx_i.sg.dropped_host);
- DP_TRACE_STATS(FATAL, "Dropped By Target = %d\n",
+ DP_PRINT_STATS(" Dropped By Target = %d",
pdev->stats.tx_i.sg.dropped_target);
- DP_TRACE_STATS(FATAL, "Tso:\n");
- DP_TRACE_STATS(FATAL, "Number of Segments = %d",
+ DP_PRINT_STATS("TSO:");
+ DP_PRINT_STATS(" Number of Segments = %d",
pdev->stats.tx_i.tso.num_seg);
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.tso.tso_pkt.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx_i.tso.tso_pkt.bytes);
- DP_TRACE_STATS(FATAL, "Dropped By Host = %d\n",
+ DP_PRINT_STATS(" Dropped By Host = %d",
pdev->stats.tx_i.tso.dropped_host);
- DP_TRACE_STATS(FATAL, "Mcast Enhancement:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Mcast Enhancement:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.mcast_en.mcast_pkt.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx_i.mcast_en.mcast_pkt.bytes);
- DP_TRACE_STATS(FATAL, "Dropped: Map Errors = %d",
+ DP_PRINT_STATS(" Dropped: Map Errors = %d",
pdev->stats.tx_i.mcast_en.dropped_map_error);
- DP_TRACE_STATS(FATAL, "Dropped: Self Mac = %d",
+ DP_PRINT_STATS(" Dropped: Self Mac = %d",
pdev->stats.tx_i.mcast_en.dropped_self_mac);
- DP_TRACE_STATS(FATAL, "Dropped: Send Fail = %d",
+ DP_PRINT_STATS(" Dropped: Send Fail = %d",
pdev->stats.tx_i.mcast_en.dropped_send_fail);
- DP_TRACE_STATS(FATAL, "Unicast sent = %d\n",
+ DP_PRINT_STATS(" Unicast sent = %d",
pdev->stats.tx_i.mcast_en.ucast);
- DP_TRACE_STATS(FATAL, "Raw:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Raw:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.raw.raw_pkt.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx_i.raw.raw_pkt.bytes);
- DP_TRACE_STATS(FATAL, "DMA map error = %d\n",
+ DP_PRINT_STATS(" DMA map error = %d",
pdev->stats.tx_i.raw.dma_map_error);
- DP_TRACE_STATS(FATAL, "Reinjected:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Reinjected:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.reinject_pkts.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d\n",
- pdev->stats.tx_i.reinject_pkts.bytes);
- DP_TRACE_STATS(FATAL, "Inspected:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Bytes = %d\n",
+ pdev->stats.tx_i.reinject_pkts.bytes);
+ DP_PRINT_STATS("Inspected:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.tx_i.inspect_pkts.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d\n",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.tx_i.inspect_pkts.bytes);
}
@@ -3681,42 +3764,42 @@
static inline void
dp_print_pdev_rx_stats(struct dp_pdev *pdev)
{
- DP_TRACE_STATS(FATAL, "WLAN Rx Stats:\n");
- DP_TRACE_STATS(FATAL, "Received From HW (Per Rx Ring):\n");
- DP_TRACE_STATS(FATAL, "Packets = %d %d %d %d",
+ DP_PRINT_STATS("PDEV Rx Stats:\n");
+ DP_PRINT_STATS("Received From HW (Per Rx Ring):");
+ DP_PRINT_STATS(" Packets = %d %d %d %d",
pdev->stats.rx.rcvd_reo[0].num,
pdev->stats.rx.rcvd_reo[1].num,
pdev->stats.rx.rcvd_reo[2].num,
pdev->stats.rx.rcvd_reo[3].num);
- DP_TRACE_STATS(FATAL, "Bytes = %d %d %d %d\n",
+ DP_PRINT_STATS(" Bytes = %d %d %d %d",
pdev->stats.rx.rcvd_reo[0].bytes,
pdev->stats.rx.rcvd_reo[1].bytes,
pdev->stats.rx.rcvd_reo[2].bytes,
pdev->stats.rx.rcvd_reo[3].bytes);
- DP_TRACE_STATS(FATAL, "Replenished:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Replenished:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.replenish.pkts.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.replenish.pkts.bytes);
- DP_TRACE_STATS(FATAL, "Buffers Added To Freelist = %d\n",
+ DP_PRINT_STATS(" Buffers Added To Freelist = %d",
pdev->stats.buf_freelist);
- DP_TRACE_STATS(FATAL, "Dropped:\n");
- DP_TRACE_STATS(FATAL, "Total Packets With Msdu Not Done = %d\n",
+ DP_PRINT_STATS("Dropped:");
+ DP_PRINT_STATS(" msdu_not_done = %d",
pdev->stats.dropped.msdu_not_done);
- DP_TRACE_STATS(FATAL, "Sent To Stack:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Sent To Stack:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.rx.to_stack.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d\n",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.rx.to_stack.bytes);
- DP_TRACE_STATS(FATAL, "Multicast/Broadcast:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Multicast/Broadcast:");
+ DP_PRINT_STATS(" Packets = %d",
pdev->stats.rx.multicast.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d\n",
+ DP_PRINT_STATS(" Bytes = %d",
pdev->stats.rx.multicast.bytes);
- DP_TRACE_STATS(FATAL, "Errors:\n");
- DP_TRACE_STATS(FATAL, "Rxdma Ring Un-inititalized = %d",
+ DP_PRINT_STATS("Errors:");
+ DP_PRINT_STATS(" Rxdma Ring Un-inititalized = %d",
pdev->stats.replenish.rxdma_err);
- DP_TRACE_STATS(FATAL, "Desc Alloc Failed: = %d",
+ DP_PRINT_STATS(" Desc Alloc Failed: = %d",
pdev->stats.err.desc_alloc_fail);
}
@@ -3729,15 +3812,15 @@
static inline void
dp_print_soc_tx_stats(struct dp_soc *soc)
{
- DP_TRACE_STATS(FATAL, "SOC Tx Stats:\n");
- DP_TRACE_STATS(FATAL, "Tx Descriptors In Use = %d",
+ DP_PRINT_STATS("SOC Tx Stats:\n");
+ DP_PRINT_STATS("Tx Descriptors In Use = %d",
soc->stats.tx.desc_in_use);
- DP_TRACE_STATS(FATAL, "Invalid peer:\n");
- DP_TRACE_STATS(FATAL, "Packets = %d",
+ DP_PRINT_STATS("Invalid peer:");
+ DP_PRINT_STATS(" Packets = %d",
soc->stats.tx.tx_invalid_peer.num);
- DP_TRACE_STATS(FATAL, "Bytes = %d",
+ DP_PRINT_STATS(" Bytes = %d",
soc->stats.tx.tx_invalid_peer.bytes);
- DP_TRACE_STATS(FATAL, "Packets dropped due to TCL ring full = %d %d %d",
+ DP_PRINT_STATS("Packets dropped due to TCL ring full = %d %d %d",
soc->stats.tx.tcl_ring_full[0],
soc->stats.tx.tcl_ring_full[1],
soc->stats.tx.tcl_ring_full[2]);
@@ -3759,37 +3842,37 @@
char rxdma_error[DP_RXDMA_ERR_LENGTH];
uint8_t index = 0;
- DP_TRACE_STATS(FATAL, "SOC Rx Stats:\n");
- DP_TRACE_STATS(FATAL, "Errors:\n");
- DP_TRACE_STATS(FATAL, "Rx Decrypt Errors = %d",
+ DP_PRINT_STATS("SOC Rx Stats:\n");
+ DP_PRINT_STATS("Errors:\n");
+ DP_PRINT_STATS("Rx Decrypt Errors = %d",
(soc->stats.rx.err.rxdma_error[HAL_RXDMA_ERR_DECRYPT] +
soc->stats.rx.err.rxdma_error[HAL_RXDMA_ERR_TKIP_MIC]));
- DP_TRACE_STATS(FATAL, "Invalid RBM = %d",
+ DP_PRINT_STATS("Invalid RBM = %d",
soc->stats.rx.err.invalid_rbm);
- DP_TRACE_STATS(FATAL, "Invalid Vdev = %d",
+ DP_PRINT_STATS("Invalid Vdev = %d",
soc->stats.rx.err.invalid_vdev);
- DP_TRACE_STATS(FATAL, "Invalid Pdev = %d",
+ DP_PRINT_STATS("Invalid Pdev = %d",
soc->stats.rx.err.invalid_pdev);
- DP_TRACE_STATS(FATAL, "Invalid Peer = %d",
+ DP_PRINT_STATS("Invalid Peer = %d",
soc->stats.rx.err.rx_invalid_peer.num);
- DP_TRACE_STATS(FATAL, "HAL Ring Access Fail = %d",
+ DP_PRINT_STATS("HAL Ring Access Fail = %d",
soc->stats.rx.err.hal_ring_access_fail);
- for (i = 0; i < MAX_RXDMA_ERRORS; i++) {
+ for (i = 0; i < HAL_RXDMA_ERR_MAX; i++) {
index += qdf_snprint(&rxdma_error[index],
DP_RXDMA_ERR_LENGTH - index,
" %d", soc->stats.rx.err.rxdma_error[i]);
}
- DP_TRACE_STATS(FATAL, "RXDMA Error (0-31):%s",
+ DP_PRINT_STATS("RXDMA Error (0-31):%s",
rxdma_error);
index = 0;
- for (i = 0; i < REO_ERROR_TYPE_MAX; i++) {
+ for (i = 0; i < HAL_REO_ERR_MAX; i++) {
index += qdf_snprint(&reo_error[index],
DP_REO_ERR_LENGTH - index,
" %d", soc->stats.rx.err.reo_error[i]);
}
- DP_TRACE_STATS(FATAL, "REO Error(0-14):%s",
+ DP_PRINT_STATS("REO Error(0-14):%s",
reo_error);
}
@@ -3824,53 +3907,36 @@
dp_print_rx_rates(struct dp_vdev *vdev)
{
struct dp_pdev *pdev = (struct dp_pdev *)vdev->pdev;
- uint8_t i, pkt_type;
+ uint8_t i, mcs, pkt_type;
uint8_t index = 0;
- char rx_mcs[DOT11_MAX][DP_MCS_LENGTH];
char nss[DP_NSS_LENGTH];
- DP_TRACE_STATS(FATAL, "Rx Rate Info:\n");
+ DP_PRINT_STATS("Rx Rate Info:\n");
for (pkt_type = 0; pkt_type < DOT11_MAX; pkt_type++) {
index = 0;
- for (i = 0; i < MAX_MCS; i++) {
- index += qdf_snprint(&rx_mcs[pkt_type][index],
- DP_MCS_LENGTH - index,
- " %d ",
+ for (mcs = 0; mcs < MAX_MCS; mcs++) {
+ if (!dp_rate_string[pkt_type][mcs].valid)
+ continue;
+
+ DP_PRINT_STATS(" %s = %d",
+ dp_rate_string[pkt_type][mcs].mcs_type,
pdev->stats.rx.pkt_type[pkt_type].
- mcs_count[i]);
+ mcs_count[mcs]);
}
+
+ DP_PRINT_STATS("\n");
}
- DP_TRACE_STATS(FATAL, "11A MCS(0-7) = %s",
- rx_mcs[0]);
- DP_TRACE_STATS(FATAL, "11A MCS Invalid = %d",
- pdev->stats.rx.pkt_type[DOT11_A].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11B MCS(0-6) = %s",
- rx_mcs[1]);
- DP_TRACE_STATS(FATAL, "11B MCS Invalid = %d",
- pdev->stats.rx.pkt_type[DOT11_B].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11N MCS(0-7) = %s",
- rx_mcs[2]);
- DP_TRACE_STATS(FATAL, "11N MCS Invalid = %d",
- pdev->stats.rx.pkt_type[DOT11_N].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "Type 11AC MCS(0-9) = %s",
- rx_mcs[3]);
- DP_TRACE_STATS(FATAL, "11AC MCS Invalid = %d",
- pdev->stats.rx.pkt_type[DOT11_AC].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11AX MCS(0-11) = %s",
- rx_mcs[4]);
- DP_TRACE_STATS(FATAL, "11AX MCS Invalid = %d",
- pdev->stats.rx.pkt_type[DOT11_AX].mcs_count[MAX_MCS]);
index = 0;
for (i = 0; i < SS_COUNT; i++) {
index += qdf_snprint(&nss[index], DP_NSS_LENGTH - index,
" %d", pdev->stats.rx.nss[i]);
}
- DP_TRACE_STATS(FATAL, "NSS(0-7) = %s",
+ DP_PRINT_STATS("NSS(0-7) = %s",
nss);
- DP_TRACE_STATS(FATAL, "SGI ="
+ DP_PRINT_STATS("SGI ="
" 0.8us %d,"
" 0.4us %d,"
" 1.6us %d,"
@@ -3879,10 +3945,10 @@
pdev->stats.rx.sgi_count[1],
pdev->stats.rx.sgi_count[2],
pdev->stats.rx.sgi_count[3]);
- DP_TRACE_STATS(FATAL, "BW Counts = 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
+ DP_PRINT_STATS("BW Counts = 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
pdev->stats.rx.bw[0], pdev->stats.rx.bw[1],
pdev->stats.rx.bw[2], pdev->stats.rx.bw[3]);
- DP_TRACE_STATS(FATAL, "Reception Type ="
+ DP_PRINT_STATS("Reception Type ="
" SU: %d,"
" MU_MIMO:%d,"
" MU_OFDMA:%d,"
@@ -3891,14 +3957,14 @@
pdev->stats.rx.reception_type[1],
pdev->stats.rx.reception_type[2],
pdev->stats.rx.reception_type[3]);
- DP_TRACE_STATS(FATAL, "Aggregation:\n");
- DP_TRACE_STATS(FATAL, "Number of Msdu's Part of Ampdus = %d",
+ DP_PRINT_STATS("Aggregation:\n");
+ DP_PRINT_STATS("Number of Msdu's Part of Ampdus = %d",
pdev->stats.rx.ampdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's With No Mpdu Level Aggregation : %d",
+ DP_PRINT_STATS("Number of Msdu's With No Mpdu Level Aggregation : %d",
pdev->stats.rx.non_ampdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's Part of Amsdu: %d",
+ DP_PRINT_STATS("Number of Msdu's Part of Amsdu: %d",
pdev->stats.rx.amsdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's With No Msdu Level Aggregation: %d",
+ DP_PRINT_STATS("Number of Msdu's With No Msdu Level Aggregation: %d",
pdev->stats.rx.non_amsdu_cnt);
}
@@ -3912,44 +3978,27 @@
dp_print_tx_rates(struct dp_vdev *vdev)
{
struct dp_pdev *pdev = (struct dp_pdev *)vdev->pdev;
- uint8_t i, pkt_type;
- char mcs[DOT11_MAX][DP_MCS_LENGTH];
+ uint8_t mcs, pkt_type;
uint32_t index;
- DP_TRACE_STATS(FATAL, "Tx Rate Info:\n");
+ DP_PRINT_STATS("Tx Rate Info:\n");
for (pkt_type = 0; pkt_type < DOT11_MAX; pkt_type++) {
index = 0;
- for (i = 0; i < MAX_MCS; i++) {
- index += qdf_snprint(&mcs[pkt_type][index],
- DP_MCS_LENGTH - index,
- " %d ",
+ for (mcs = 0; mcs < MAX_MCS; mcs++) {
+ if (!dp_rate_string[pkt_type][mcs].valid)
+ continue;
+
+ DP_PRINT_STATS(" %s = %d",
+ dp_rate_string[pkt_type][mcs].mcs_type,
pdev->stats.tx.pkt_type[pkt_type].
- mcs_count[i]);
+ mcs_count[mcs]);
}
+
+ DP_PRINT_STATS("\n");
}
- DP_TRACE_STATS(FATAL, "11A MCS(0-7) = %s",
- mcs[0]);
- DP_TRACE_STATS(FATAL, "11A MCS Invalid = %d",
- pdev->stats.tx.pkt_type[DOT11_A].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11B MCS(0-6) = %s",
- mcs[1]);
- DP_TRACE_STATS(FATAL, "11B MCS Invalid = %d",
- pdev->stats.tx.pkt_type[DOT11_B].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11N MCS(0-7) = %s",
- mcs[2]);
- DP_TRACE_STATS(FATAL, "11N MCS Invalid = %d",
- pdev->stats.tx.pkt_type[DOT11_N].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "Type 11AC MCS(0-9) = %s",
- mcs[3]);
- DP_TRACE_STATS(FATAL, "11AC MCS Invalid = %d",
- pdev->stats.tx.pkt_type[DOT11_AC].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11AX MCS(0-11) = %s",
- mcs[4]);
- DP_TRACE_STATS(FATAL, "11AX MCS Invalid = %d",
- pdev->stats.tx.pkt_type[DOT11_AX].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "SGI ="
+ DP_PRINT_STATS("SGI ="
" 0.8us %d"
" 0.4us %d"
" 1.6us %d"
@@ -3958,18 +4007,21 @@
pdev->stats.tx.sgi_count[1],
pdev->stats.tx.sgi_count[2],
pdev->stats.tx.sgi_count[3]);
- DP_TRACE_STATS(FATAL, "BW Counts = 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
+
+ DP_PRINT_STATS("BW Counts = 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
pdev->stats.tx.bw[0], pdev->stats.tx.bw[1],
pdev->stats.tx.bw[2], pdev->stats.tx.bw[3]);
- DP_TRACE_STATS(FATAL, "OFDMA = %d", pdev->stats.tx.ofdma);
- DP_TRACE_STATS(FATAL, "STBC = %d", pdev->stats.tx.stbc);
- DP_TRACE_STATS(FATAL, "LDPC = %d", pdev->stats.tx.ldpc);
- DP_TRACE_STATS(FATAL, "Retries = %d", pdev->stats.tx.retries);
- DP_TRACE_STATS(FATAL, "Last ack rssi = %d\n", pdev->stats.tx.last_ack_rssi);
- DP_TRACE_STATS(FATAL, "Aggregation:\n");
- DP_TRACE_STATS(FATAL, "Number of Msdu's Part of Amsdu = %d",
+
+ DP_PRINT_STATS("OFDMA = %d", pdev->stats.tx.ofdma);
+ DP_PRINT_STATS("STBC = %d", pdev->stats.tx.stbc);
+ DP_PRINT_STATS("LDPC = %d", pdev->stats.tx.ldpc);
+ DP_PRINT_STATS("Retries = %d", pdev->stats.tx.retries);
+ DP_PRINT_STATS("Last ack rssi = %d\n", pdev->stats.tx.last_ack_rssi);
+
+ DP_PRINT_STATS("Aggregation:\n");
+ DP_PRINT_STATS("Number of Msdu's Part of Amsdu = %d",
pdev->stats.tx.amsdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's With No Msdu Level Aggregation = %d",
+ DP_PRINT_STATS("Number of Msdu's With No Msdu Level Aggregation = %d",
pdev->stats.tx.non_amsdu_cnt);
}
@@ -3981,83 +4033,59 @@
*/
static inline void dp_print_peer_stats(struct dp_peer *peer)
{
- uint8_t i, pkt_type;
- char tx_mcs[DOT11_MAX][DP_MCS_LENGTH];
- char rx_mcs[DOT11_MAX][DP_MCS_LENGTH];
+ uint8_t i, mcs, pkt_type;
uint32_t index;
char nss[DP_NSS_LENGTH];
- DP_TRACE_STATS(FATAL, "Node Tx Stats:\n");
- DP_TRACE_STATS(FATAL, "Total Packet Completions = %d",
+ DP_PRINT_STATS("Node Tx Stats:\n");
+ DP_PRINT_STATS("Total Packet Completions = %d",
peer->stats.tx.comp_pkt.num);
- DP_TRACE_STATS(FATAL, "Total Bytes Completions = %d",
+ DP_PRINT_STATS("Total Bytes Completions = %d",
peer->stats.tx.comp_pkt.bytes);
- DP_TRACE_STATS(FATAL, "Success Packets = %d",
+ DP_PRINT_STATS("Success Packets = %d",
peer->stats.tx.tx_success.num);
- DP_TRACE_STATS(FATAL, "Success Bytes = %d",
+ DP_PRINT_STATS("Success Bytes = %d",
peer->stats.tx.tx_success.bytes);
- DP_TRACE_STATS(FATAL, "Packets Failed = %d",
+ DP_PRINT_STATS("Packets Failed = %d",
peer->stats.tx.tx_failed);
- DP_TRACE_STATS(FATAL, "Packets In OFDMA = %d",
+ DP_PRINT_STATS("Packets In OFDMA = %d",
peer->stats.tx.ofdma);
- DP_TRACE_STATS(FATAL, "Packets In STBC = %d",
+ DP_PRINT_STATS("Packets In STBC = %d",
peer->stats.tx.stbc);
- DP_TRACE_STATS(FATAL, "Packets In LDPC = %d",
+ DP_PRINT_STATS("Packets In LDPC = %d",
peer->stats.tx.ldpc);
- DP_TRACE_STATS(FATAL, "Packet Retries = %d",
+ DP_PRINT_STATS("Packet Retries = %d",
peer->stats.tx.retries);
- DP_TRACE_STATS(FATAL, "Msdu's Not Part of Ampdu = %d",
- peer->stats.tx.non_amsdu_cnt);
- DP_TRACE_STATS(FATAL, "Mpdu's Part of Ampdu = %d",
+ DP_PRINT_STATS("MSDU's Part of AMSDU = %d",
peer->stats.tx.amsdu_cnt);
- DP_TRACE_STATS(FATAL, "Last Packet RSSI = %d",
+ DP_PRINT_STATS("Last Packet RSSI = %d",
peer->stats.tx.last_ack_rssi);
- DP_TRACE_STATS(FATAL, "Dropped At FW: FW Discard = %d",
- peer->stats.tx.dropped.fw_discard);
- DP_TRACE_STATS(FATAL, "Dropped At FW: FW Discard Retired = %d",
- peer->stats.tx.dropped.fw_discard_retired);
- DP_TRACE_STATS(FATAL, "Dropped At FW: FW Discard Untransmitted = %d",
- peer->stats.tx.dropped.fw_discard_untransmitted);
- DP_TRACE_STATS(FATAL, "Dropped : Mpdu Age Out = %d",
- peer->stats.tx.dropped.mpdu_age_out);
- DP_TRACE_STATS(FATAL, "Dropped : FW Discard Reason1 = %d",
- peer->stats.tx.dropped.fw_discard_reason1);
- DP_TRACE_STATS(FATAL, "Dropped : FW Discard Reason2 = %d",
- peer->stats.tx.dropped.fw_discard_reason2);
- DP_TRACE_STATS(FATAL, "Dropped : FW Discard Reason3 = %d",
- peer->stats.tx.dropped.fw_discard_reason3);
+ DP_PRINT_STATS("Dropped At FW: Removed = %d",
+ peer->stats.tx.dropped.fw_rem);
+ DP_PRINT_STATS("Dropped At FW: Removed transmitted = %d",
+ peer->stats.tx.dropped.fw_rem_tx);
+ DP_PRINT_STATS("Dropped At FW: Removed Untransmitted = %d",
+ peer->stats.tx.dropped.fw_rem_notx);
+ DP_PRINT_STATS("Dropped : Age Out = %d",
+ peer->stats.tx.dropped.age_out);
+
+ DP_PRINT_STATS("Rate Info:");
for (pkt_type = 0; pkt_type < DOT11_MAX; pkt_type++) {
index = 0;
- for (i = 0; i < MAX_MCS; i++) {
- index += qdf_snprint(&tx_mcs[pkt_type][index],
- DP_MCS_LENGTH - index,
- " %d ",
+ for (mcs = 0; mcs < MAX_MCS; mcs++) {
+ if (!dp_rate_string[pkt_type][mcs].valid)
+ continue;
+
+ DP_PRINT_STATS(" %s = %d",
+ dp_rate_string[pkt_type][mcs].mcs_type,
peer->stats.tx.pkt_type[pkt_type].
- mcs_count[i]);
+ mcs_count[mcs]);
}
+
+ DP_PRINT_STATS("\n");
}
- DP_TRACE_STATS(FATAL, "11A MCS(0-7) = %s",
- tx_mcs[0]);
- DP_TRACE_STATS(FATAL, "11A MCS Invalid = %d",
- peer->stats.tx.pkt_type[DOT11_A].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11B MCS(0-6) = %s",
- tx_mcs[1]);
- DP_TRACE_STATS(FATAL, "11B MCS Invalid = %d",
- peer->stats.tx.pkt_type[DOT11_B].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11N MCS(0-7) = %s",
- tx_mcs[2]);
- DP_TRACE_STATS(FATAL, "11N MCS Invalid = %d",
- peer->stats.tx.pkt_type[DOT11_N].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11AC MCS(0-9) = %s",
- tx_mcs[3]);
- DP_TRACE_STATS(FATAL, "11AC MCS Invalid = %d",
- peer->stats.tx.pkt_type[DOT11_AC].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11AX MCS(0-11) = %s",
- tx_mcs[4]);
- DP_TRACE_STATS(FATAL, "11AX MCS Invalid = %d",
- peer->stats.tx.pkt_type[DOT11_AX].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "SGI = "
+ DP_PRINT_STATS("SGI = "
" 0.8us %d"
" 0.4us %d"
" 1.6us %d"
@@ -4066,55 +4094,56 @@
peer->stats.tx.sgi_count[1],
peer->stats.tx.sgi_count[2],
peer->stats.tx.sgi_count[3]);
- DP_TRACE_STATS(FATAL, "BW Counts = 20MHZ %d 40MHZ %d 80MHZ %d 160MHZ %d\n",
+ DP_PRINT_STATS("BW Counts = 20MHZ %d 40MHZ %d 80MHZ %d 160MHZ %d\n",
peer->stats.tx.bw[0], peer->stats.tx.bw[1],
peer->stats.tx.bw[2], peer->stats.tx.bw[3]);
- DP_TRACE_STATS(FATAL, "Aggregation:\n");
- DP_TRACE_STATS(FATAL, "Number of Msdu's Part of Amsdu = %d",
+
+ DP_PRINT_STATS("Aggregation:");
+ DP_PRINT_STATS(" Number of Msdu's Part of Amsdu = %d",
peer->stats.tx.amsdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's With No Msdu Level Aggregation = %d\n",
+ DP_PRINT_STATS(" Number of Msdu's With No Msdu Level Aggregation = %d\n",
peer->stats.tx.non_amsdu_cnt);
- DP_TRACE_STATS(FATAL, "Node Rx Stats:\n");
- DP_TRACE_STATS(FATAL, "Packets Sent To Stack = %d",
+ DP_PRINT_STATS("Node Rx Stats:");
+ DP_PRINT_STATS("Packets Sent To Stack = %d",
peer->stats.rx.to_stack.num);
- DP_TRACE_STATS(FATAL, "Bytes Sent To Stack = %d",
+ DP_PRINT_STATS("Bytes Sent To Stack = %d",
peer->stats.rx.to_stack.bytes);
for (i = 0; i < CDP_MAX_RX_RINGS; i++) {
- DP_TRACE_STATS(FATAL, "Packets Received = %d",
+ DP_PRINT_STATS("Packets Received = %d",
peer->stats.rx.rcvd_reo[i].num);
- DP_TRACE_STATS(FATAL, "Bytes Received = %d",
+ DP_PRINT_STATS("Bytes Received = %d",
peer->stats.rx.rcvd_reo[i].bytes);
}
- DP_TRACE_STATS(FATAL, "Multicast Packets Received = %d",
+ DP_PRINT_STATS("Multicast Packets Received = %d",
peer->stats.rx.multicast.num);
- DP_TRACE_STATS(FATAL, "Multicast Bytes Received = %d",
+ DP_PRINT_STATS("Multicast Bytes Received = %d",
peer->stats.rx.multicast.bytes);
- DP_TRACE_STATS(FATAL, "WDS Packets Received = %d",
+ DP_PRINT_STATS("WDS Packets Received = %d",
peer->stats.rx.wds.num);
- DP_TRACE_STATS(FATAL, "WDS Bytes Received = %d",
+ DP_PRINT_STATS("WDS Bytes Received = %d",
peer->stats.rx.wds.bytes);
- DP_TRACE_STATS(FATAL, "Intra BSS Packets Received = %d",
+ DP_PRINT_STATS("Intra BSS Packets Received = %d",
peer->stats.rx.intra_bss.pkts.num);
- DP_TRACE_STATS(FATAL, "Intra BSS Bytes Received = %d",
+ DP_PRINT_STATS("Intra BSS Bytes Received = %d",
peer->stats.rx.intra_bss.pkts.bytes);
- DP_TRACE_STATS(FATAL, "Raw Packets Received = %d",
+ DP_PRINT_STATS("Raw Packets Received = %d",
peer->stats.rx.raw.num);
- DP_TRACE_STATS(FATAL, "Raw Bytes Received = %d",
+ DP_PRINT_STATS("Raw Bytes Received = %d",
peer->stats.rx.raw.bytes);
- DP_TRACE_STATS(FATAL, "Errors: MIC Errors = %d",
+ DP_PRINT_STATS("Errors: MIC Errors = %d",
peer->stats.rx.err.mic_err);
- DP_TRACE_STATS(FATAL, "Erros: Decryption Errors = %d",
+ DP_PRINT_STATS("Erros: Decryption Errors = %d",
peer->stats.rx.err.decrypt_err);
- DP_TRACE_STATS(FATAL, "Msdu's Received As Part of Ampdu = %d",
+ DP_PRINT_STATS("Msdu's Received As Part of Ampdu = %d",
peer->stats.rx.non_ampdu_cnt);
- DP_TRACE_STATS(FATAL, "Msdu's Recived As Ampdu = %d",
+ DP_PRINT_STATS("Msdu's Recived As Ampdu = %d",
peer->stats.rx.ampdu_cnt);
- DP_TRACE_STATS(FATAL, "Msdu's Received Not Part of Amsdu's = %d",
+ DP_PRINT_STATS("Msdu's Received Not Part of Amsdu's = %d",
peer->stats.rx.non_amsdu_cnt);
- DP_TRACE_STATS(FATAL, "MSDUs Received As Part of Amsdu = %d",
+ DP_PRINT_STATS("MSDUs Received As Part of Amsdu = %d",
peer->stats.rx.amsdu_cnt);
- DP_TRACE_STATS(FATAL, "SGI ="
+ DP_PRINT_STATS("SGI ="
" 0.8us %d"
" 0.4us %d"
" 1.6us %d"
@@ -4123,10 +4152,10 @@
peer->stats.rx.sgi_count[1],
peer->stats.rx.sgi_count[2],
peer->stats.rx.sgi_count[3]);
- DP_TRACE_STATS(FATAL, "BW Counts = 20MHZ %d 40MHZ %d 80MHZ %d 160MHZ %d",
+ DP_PRINT_STATS("BW Counts = 20MHZ %d 40MHZ %d 80MHZ %d 160MHZ %d",
peer->stats.rx.bw[0], peer->stats.rx.bw[1],
peer->stats.rx.bw[2], peer->stats.rx.bw[3]);
- DP_TRACE_STATS(FATAL, "Reception Type ="
+ DP_PRINT_STATS("Reception Type ="
" SU %d,"
" MU_MIMO %d,"
" MU_OFDMA %d,"
@@ -4136,53 +4165,38 @@
peer->stats.rx.reception_type[2],
peer->stats.rx.reception_type[3]);
+
for (pkt_type = 0; pkt_type < DOT11_MAX; pkt_type++) {
index = 0;
- for (i = 0; i < MAX_MCS; i++) {
- index += qdf_snprint(&rx_mcs[pkt_type][index],
- DP_MCS_LENGTH - index,
- " %d ",
- peer->stats.rx.pkt_type[pkt_type].
- mcs_count[i]);
- }
- }
+ for (mcs = 0; mcs < MAX_MCS; mcs++) {
+ if (!dp_rate_string[pkt_type][mcs].valid)
+ continue;
- DP_TRACE_STATS(FATAL, "11A MCS(0-7) = %s",
- rx_mcs[0]);
- DP_TRACE_STATS(FATAL, "11A MCS Invalid = %d",
- peer->stats.rx.pkt_type[DOT11_A].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11B MCS(0-6) = %s",
- rx_mcs[1]);
- DP_TRACE_STATS(FATAL, "11B MCS Invalid = %d",
- peer->stats.rx.pkt_type[DOT11_B].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11N MCS(0-7) = %s",
- rx_mcs[2]);
- DP_TRACE_STATS(FATAL, "11N MCS Invalid = %d",
- peer->stats.rx.pkt_type[DOT11_N].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11AC MCS(0-9) = %s",
- rx_mcs[3]);
- DP_TRACE_STATS(FATAL, "11AC MCS Invalid = %d",
- peer->stats.rx.pkt_type[DOT11_AC].mcs_count[MAX_MCS]);
- DP_TRACE_STATS(FATAL, "11AX MCS(0-11) = %s",
- rx_mcs[4]);
- DP_TRACE_STATS(FATAL, "11AX MCS Invalid = %d",
- peer->stats.rx.pkt_type[DOT11_AX].mcs_count[MAX_MCS]);
+ DP_PRINT_STATS(" %s = %d",
+ dp_rate_string[pkt_type][mcs].mcs_type,
+ peer->stats.rx.pkt_type[pkt_type].
+ mcs_count[mcs]);
+ }
+
+ DP_PRINT_STATS("\n");
+ }
index = 0;
for (i = 0; i < SS_COUNT; i++) {
index += qdf_snprint(&nss[index], DP_NSS_LENGTH - index,
" %d", peer->stats.rx.nss[i]);
}
- DP_TRACE_STATS(FATAL, "NSS(0-7) = %s\n",
+ DP_PRINT_STATS("NSS(0-7) = %s",
nss);
- DP_TRACE_STATS(FATAL, "Aggregation:\n");
- DP_TRACE_STATS(FATAL, "Number of Msdu's Part of Ampdu = %d",
+
+ DP_PRINT_STATS("Aggregation:");
+ DP_PRINT_STATS(" Msdu's Part of Ampdu = %d",
peer->stats.rx.ampdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's With No Mpdu Level Aggregation = %d",
+ DP_PRINT_STATS(" Msdu's With No Mpdu Level Aggregation = %d",
peer->stats.rx.non_ampdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's Part of Amsdu = %d",
+ DP_PRINT_STATS(" Msdu's Part of Amsdu = %d",
peer->stats.rx.amsdu_cnt);
- DP_TRACE_STATS(FATAL, "Number of Msdu's With No Msdu Level Aggregation = %d",
+ DP_PRINT_STATS(" Msdu's With No Msdu Level Aggregation = %d",
peer->stats.rx.non_amsdu_cnt);
}
@@ -4558,13 +4572,13 @@
DP_TRACE(FATAL, "total packets dropped: %u",
pdev->stats.tx.tx_failed);
DP_TRACE(FATAL, "mpdu age out: %u",
- pdev->stats.tx.dropped.mpdu_age_out);
- DP_TRACE(FATAL, "firmware discard reason1: %u",
- pdev->stats.tx.dropped.fw_discard_reason1);
- DP_TRACE(FATAL, "firmware discard reason2: %u",
- pdev->stats.tx.dropped.fw_discard_reason2);
- DP_TRACE(FATAL, "firmware discard reason3: %u",
- pdev->stats.tx.dropped.fw_discard_reason3);
+ pdev->stats.tx.dropped.age_out);
+ DP_TRACE(FATAL, "firmware removed: %u",
+ pdev->stats.tx.dropped.fw_rem);
+ DP_TRACE(FATAL, "firmware removed tx: %u",
+ pdev->stats.tx.dropped.fw_rem_tx);
+ DP_TRACE(FATAL, "firmware removed notx %u",
+ pdev->stats.tx.dropped.fw_rem_notx);
DP_TRACE(FATAL, "peer_invalid: %u",
pdev->soc->stats.tx.tx_invalid_peer.num);
@@ -4615,14 +4629,14 @@
DP_TRACE(FATAL, "Reo errors");
- for (error_code = 0; error_code < REO_ERROR_TYPE_MAX;
+ for (error_code = 0; error_code < HAL_REO_ERR_MAX;
error_code++) {
DP_TRACE(FATAL, "Reo error number (%u): %u msdus",
error_code,
pdev->soc->stats.rx.err.reo_error[error_code]);
}
- for (error_code = 0; error_code < MAX_RXDMA_ERRORS;
+ for (error_code = 0; error_code < HAL_RXDMA_ERR_MAX;
error_code++) {
DP_TRACE(FATAL, "Rxdma error number (%u): %u msdus",
error_code,
diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c
index 97f17d9..c3212d5 100644
--- a/dp/wifi3.0/dp_rx.c
+++ b/dp/wifi3.0/dp_rx.c
@@ -1215,11 +1215,11 @@
&& (pkt_type == DOT11_AC)));
DP_STATS_INCC(peer, rx.pkt_type[pkt_type].
mcs_count[MAX_MCS], 1,
- ((mcs >= MAX_MCS)
+ ((mcs >= (MAX_MCS-1))
&& (pkt_type == DOT11_AX)));
DP_STATS_INCC(peer, rx.pkt_type[pkt_type].
mcs_count[mcs], 1,
- ((mcs <= MAX_MCS)
+ ((mcs <= (MAX_MCS-1))
&& (pkt_type == DOT11_AX)));
/*
diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c
index 470549d..94fe5f7 100644
--- a/dp/wifi3.0/dp_tx.c
+++ b/dp/wifi3.0/dp_tx.c
@@ -1801,6 +1801,83 @@
#endif
+/**
+ * dp_tx_update_peer_stats() - Update peer stats from Tx completion indications
+ * @peer: Handle to DP peer
+ * @ts: pointer to HAL Tx completion stats
+ * @length: MSDU length
+ *
+ * Return: None
+ */
+static void dp_tx_update_peer_stats(struct dp_peer *peer,
+ struct hal_tx_completion_status *ts, uint32_t length)
+{
+ struct dp_pdev *pdev = peer->vdev->pdev;
+ struct dp_soc *soc = pdev->soc;
+
+ DP_STATS_INC_PKT(peer, tx.comp_pkt, 1, length);
+
+ if (!ts->release_src == HAL_TX_COMP_RELEASE_SOURCE_TQM)
+ return;
+
+ DP_STATS_INCC(peer, tx.tx_failed, 1,
+ !(ts->status == HAL_TX_TQM_RR_FRAME_ACKED));
+
+ DP_STATS_INCC(peer, tx.dropped.age_out, 1,
+ (ts->status == HAL_TX_TQM_RR_REM_CMD_AGED));
+
+ DP_STATS_INCC(peer, tx.dropped.fw_rem, 1,
+ (ts->status == HAL_TX_TQM_RR_REM_CMD_REM));
+
+ DP_STATS_INCC(peer, tx.dropped.fw_rem_notx, 1,
+ (ts->status == HAL_TX_TQM_RR_REM_CMD_NOTX));
+
+ DP_STATS_INCC(peer, tx.dropped.fw_rem_tx, 1,
+ (ts->status == HAL_TX_TQM_RR_REM_CMD_TX));
+
+ if (!ts->status == HAL_TX_TQM_RR_FRAME_ACKED)
+ return;
+
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[MAX_MCS], 1,
+ ((ts->mcs >= MAX_MCS_11A) && (ts->pkt_type == DOT11_A)));
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[ts->mcs], 1,
+ ((ts->mcs <= MAX_MCS_11A) && (ts->pkt_type == DOT11_A)));
+
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[MAX_MCS], 1,
+ ((ts->mcs >= MAX_MCS_11B) && (ts->pkt_type == DOT11_B)));
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[ts->mcs], 1,
+ ((ts->mcs <= MAX_MCS_11B) && (ts->pkt_type == DOT11_B)));
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[MAX_MCS], 1,
+ ((ts->mcs >= MAX_MCS_11A) && (ts->pkt_type == DOT11_N)));
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[ts->mcs], 1,
+ ((ts->mcs <= MAX_MCS_11A) && (ts->pkt_type == DOT11_N)));
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[MAX_MCS], 1,
+ ((ts->mcs >= MAX_MCS_11AC) && (ts->pkt_type == DOT11_AC)));
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[ts->mcs], 1,
+ ((ts->mcs <= MAX_MCS_11AC) && (ts->pkt_type == DOT11_AC)));
+
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[MAX_MCS], 1,
+ ((ts->mcs >= (MAX_MCS-1)) && (ts->pkt_type == DOT11_AX)));
+ DP_STATS_INCC(peer, tx.pkt_type[ts->pkt_type].mcs_count[ts->mcs], 1,
+ ((ts->mcs <= (MAX_MCS-1)) && (ts->pkt_type == DOT11_AX)));
+
+ DP_STATS_INC(peer, tx.sgi_count[ts->sgi], 1);
+ DP_STATS_INC(peer, tx.bw[ts->bw], 1);
+ DP_STATS_UPD(peer, tx.last_ack_rssi, ts->ack_frame_rssi);
+ DP_STATS_INC(peer, tx.wme_ac_type[TID_TO_WME_AC(ts->tid)], 1);
+ DP_STATS_INCC(peer, tx.stbc, 1, ts->stbc);
+ DP_STATS_INCC(peer, tx.ofdma, 1, ts->ofdma);
+ DP_STATS_INCC(peer, tx.ldpc, 1, ts->ldpc);
+ DP_STATS_INC_PKT(peer, tx.tx_success, 1, length);
+ DP_STATS_INCC(peer, tx.amsdu_cnt, 1, ts->msdu_part_of_amsdu);
+ DP_STATS_INCC(peer, tx.retries, 1, ts->transmit_cnt > 1);
+
+ if (soc->cdp_soc.ol_ops->update_dp_stats) {
+ soc->cdp_soc.ol_ops->update_dp_stats(pdev->osif_pdev,
+ &peer->stats, ts->peer_id,
+ UPDATE_PEER_STATS);
+ }
+}
/**
* dp_tx_comp_process_tx_status() - Parse and Dump Tx completion status info
@@ -1816,10 +1893,8 @@
struct dp_soc *soc = NULL;
struct dp_vdev *vdev = tx_desc->vdev;
struct dp_peer *peer = NULL;
- struct dp_pdev *pdev = NULL;
- uint8_t comp_status = 0;
- qdf_mem_zero(&ts, sizeof(struct hal_tx_completion_status));
hal_tx_comp_get_status(&tx_desc->comp, &ts);
+
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
"-------------------- \n"
"Tx Completion Stats: \n"
@@ -1849,16 +1924,23 @@
ts.ppdu_id, ts.transmit_cnt, ts.tid,
ts.peer_id);
- if (qdf_unlikely(tx_desc->vdev->mesh_vdev))
- dp_tx_comp_fill_tx_completion_stats(tx_desc, &ts);
-
if (!vdev) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
- "invalid peer");
- goto fail;
+ "invalid vdev");
+ goto out;
}
- soc = tx_desc->vdev->pdev->soc;
+ soc = vdev->pdev->soc;
+
+ /* Update SoC level stats */
+ DP_STATS_INCC(soc, tx.dropped_fw_removed, 1,
+ (ts.status == HAL_TX_TQM_RR_REM_CMD_REM));
+
+ /* Update per-packet stats */
+ if (qdf_unlikely(vdev->mesh_vdev))
+ dp_tx_comp_fill_tx_completion_stats(tx_desc, &ts);
+
+ /* Update peer level stats */
peer = dp_peer_find_by_id(soc, ts.peer_id);
if (!peer) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
@@ -1867,99 +1949,9 @@
goto out;
}
- DP_STATS_INC_PKT(peer, tx.comp_pkt, 1, length);
+ dp_tx_update_peer_stats(peer, &ts, length);
- if (HAL_TX_COMP_RELEASE_SOURCE_TQM ==
- hal_tx_comp_get_buffer_source(&tx_desc->comp)) {
- comp_status = hal_tx_comp_get_release_reason(&tx_desc->comp);
-
- DP_STATS_INCC(peer, tx.dropped.mpdu_age_out, 1,
- (comp_status == HAL_TX_TQM_RR_REM_CMD_AGED));
- DP_STATS_INCC(peer, tx.dropped.fw_discard_reason1, 1,
- (comp_status == HAL_TX_TQM_RR_FW_REASON1));
- DP_STATS_INCC(peer, tx.dropped.fw_discard_reason2, 1,
- (comp_status == HAL_TX_TQM_RR_FW_REASON2));
- DP_STATS_INCC(peer, tx.dropped.fw_discard_reason3, 1,
- (comp_status == HAL_TX_TQM_RR_FW_REASON3));
- DP_STATS_INCC(peer, tx.tx_failed, 1,
- comp_status != HAL_TX_TQM_RR_FRAME_ACKED);
-
- if (comp_status == HAL_TX_TQM_RR_FRAME_ACKED) {
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[MAX_MCS], 1,
- ((ts.mcs >= MAX_MCS_11A) && (ts.pkt_type
- == DOT11_A)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[ts.mcs], 1,
- ((ts.mcs <= MAX_MCS_11A) && (ts.pkt_type
- == DOT11_A)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[MAX_MCS], 1,
- ((ts.mcs >= MAX_MCS_11B)
- && (ts.pkt_type == DOT11_B)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[ts.mcs], 1,
- ((ts.mcs <= MAX_MCS_11B)
- && (ts.pkt_type == DOT11_B)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[MAX_MCS], 1,
- ((ts.mcs >= MAX_MCS_11A)
- && (ts.pkt_type == DOT11_N)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[ts.mcs], 1,
- ((ts.mcs <= MAX_MCS_11A)
- && (ts.pkt_type == DOT11_N)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[MAX_MCS], 1,
- ((ts.mcs >= MAX_MCS_11AC)
- && (ts.pkt_type == DOT11_AC)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[ts.mcs], 1,
- ((ts.mcs <= MAX_MCS_11AC)
- && (ts.pkt_type == DOT11_AC)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[MAX_MCS], 1,
- ((ts.mcs >= MAX_MCS)
- && (ts.pkt_type == DOT11_AX)));
- DP_STATS_INCC(peer, tx.pkt_type[ts.pkt_type].
- mcs_count[ts.mcs], 1,
- ((ts.mcs <= MAX_MCS)
- && (ts.pkt_type == DOT11_AX)));
-
- DP_STATS_INC(peer, tx.sgi_count[ts.sgi], 1);
- DP_STATS_INC(peer, tx.bw[ts.bw], 1);
- DP_STATS_UPD(peer, tx.last_ack_rssi, ts.ack_frame_rssi);
- DP_STATS_INC(peer, tx.wme_ac_type[TID_TO_WME_AC(ts.tid)]
- , 1);
- DP_STATS_INC_PKT(peer, tx.tx_success, 1, length);
- DP_STATS_INCC(peer, tx.stbc, 1, ts.stbc);
- DP_STATS_INCC(peer, tx.ofdma, 1, ts.ofdma);
- DP_STATS_INCC(peer, tx.ldpc, 1, ts.ldpc);
- DP_STATS_INCC(peer, tx.non_amsdu_cnt, 1,
- (ts.first_msdu && ts.last_msdu));
- DP_STATS_INCC(peer, tx.amsdu_cnt, 1,
- !(ts.first_msdu && ts.last_msdu));
- DP_STATS_INCC(peer, tx.retries, 1, ts.transmit_cnt > 1);
- }
- }
-
- /* TODO: This call is temporary.
- * Stats update has to be attached to the HTT PPDU message
- */
out:
- pdev = vdev->pdev;
-
- if (pdev->enhanced_stats_en && soc->cdp_soc.ol_ops->update_dp_stats) {
- if (peer) {
- soc->cdp_soc.ol_ops->update_dp_stats(pdev->osif_pdev,
- &peer->stats, ts.peer_id,
- UPDATE_PEER_STATS);
- }
- dp_aggregate_vdev_stats(tx_desc->vdev);
- soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev,
- &vdev->stats, vdev->vdev_id, UPDATE_VDEV_STATS);
- }
-fail:
return;
}
diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h
index 86f05c6..1587399 100644
--- a/dp/wifi3.0/dp_types.h
+++ b/dp/wifi3.0/dp_types.h
@@ -48,13 +48,10 @@
#include <hal_api_mon.h>
#include "hal_rx.h"
-#define MAX_TCL_RING 3
-#define MAX_RXDMA_ERRORS 32
-#define SUPPORTED_BW 4
-#define SUPPORTED_RECEPTION_TYPES 4
+#define MAX_BW 4
+#define MAX_RECEPTION_TYPES 4
#define REPT_MU_MIMO 1
#define REPT_MU_OFDMA_MIMO 3
-#define REO_ERROR_TYPE_MAX (HAL_REO_ERR_QUEUE_DESC_BLOCKED_SET+1)
#define DP_VO_TID 6
#define DP_MAX_INTERRUPT_CONTEXTS 8
@@ -72,19 +69,18 @@
#else
#define MAX_PDEV_CNT 3
#endif
+
#define MAX_LINK_DESC_BANKS 8
#define MAX_TXDESC_POOLS 4
#define MAX_RXDESC_POOLS 4
#define MAX_REO_DEST_RINGS 4
#define MAX_TCL_DATA_RINGS 4
-#define DP_MAX_TX_RINGS 8
-#define DP_MAX_RX_RINGS 8
#define MAX_IDLE_SCATTER_BUFS 16
#define DP_MAX_IRQ_PER_CONTEXT 12
#define DP_MAX_INTERRUPT_CONTEXTS 8
#define DEFAULT_HW_PEER_ID 0xffff
-#define MAX_TX_HW_QUEUES 3
+#define MAX_TX_HW_QUEUES MAX_TCL_DATA_RINGS
#define DP_MAX_INTERRUPT_CONTEXTS 8
#define DP_MAX_MECT_ENTRIES 64
@@ -446,6 +442,52 @@
struct dp_rx_tid rx_tid;
};
+/* SoC level data path statistics */
+struct dp_soc_stats {
+ /* SOC level TX stats */
+ struct {
+ /* packets dropped on tx because of no peer */
+ struct cdp_pkt_info tx_invalid_peer;
+ /* descriptors in each tcl ring */
+ uint32_t tcl_ring_full[MAX_TCL_DATA_RINGS];
+ /* Descriptors in use at soc */
+ uint32_t desc_in_use;
+ /* tqm_release_reason == FW removed */
+ uint32_t dropped_fw_removed;
+
+ } tx;
+
+ /* SOC level RX stats */
+ struct {
+ /* Rx errors */
+ /* Total Packets in Rx Error ring */
+ uint32_t err_ring_pkts;
+ /* No of Fragments */
+ uint32_t rx_frags;
+ struct {
+ /* Invalid RBM error count */
+ uint32_t invalid_rbm;
+ /* Invalid VDEV Error count */
+ uint32_t invalid_vdev;
+ /* Invalid PDEV error count */
+ uint32_t invalid_pdev;
+ /* Invalid PEER Error count */
+ struct cdp_pkt_info rx_invalid_peer;
+ /* HAL ring access Fail error count */
+ uint32_t hal_ring_access_fail;
+ /* RX DMA error count */
+ uint32_t rxdma_error[HAL_RXDMA_ERR_MAX];
+ /* REO Error count */
+ uint32_t reo_error[HAL_REO_ERR_MAX];
+ /* HAL REO ERR Count */
+ uint32_t hal_reo_error[MAX_REO_DEST_RINGS];
+ } err;
+
+ /* packet count per core - per ring */
+ uint64_t ring_packets[NR_CPUS][MAX_REO_DEST_RINGS];
+ } rx;
+};
+
#define DP_MAC_ADDR_LEN 6
union dp_align_mac_addr {
uint8_t raw[DP_MAC_ADDR_LEN];
@@ -679,46 +721,7 @@
int max_peers;
/* SoC level data path statistics */
- struct {
- /* SOC level TX stats */
- struct {
- /* packets dropped on tx because of no peer */
- struct cdp_pkt_info tx_invalid_peer;
- /* descriptors in each tcl ring */
- uint32_t tcl_ring_full[MAX_TCL_RING];
- /* Descriptors in use at soc */
- uint32_t desc_in_use;
- } tx;
- /* SOC level RX stats */
- struct {
- /* Rx errors */
- /* Total Packets in Rx Error ring */
- uint32_t err_ring_pkts;
- /* No of Fragments */
- uint32_t rx_frags;
- struct {
- /* Invalid RBM error count */
- uint32_t invalid_rbm;
- /* Invalid VDEV Error count */
- uint32_t invalid_vdev;
- /* Invalid PDEV error count */
- uint32_t invalid_pdev;
- /* Invalid PEER Error count */
- struct cdp_pkt_info rx_invalid_peer;
- /* HAL ring access Fail error count */
- uint32_t hal_ring_access_fail;
- /* RX DMA error count */
- uint32_t rxdma_error[MAX_RXDMA_ERRORS];
- /* REO Error count */
- uint32_t reo_error[REO_ERROR_TYPE_MAX];
- /* HAL REO ERR Count */
- uint32_t hal_reo_error[CDP_MAX_RX_RINGS];
- } err;
-
- /* packet count per core - per ring */
- uint64_t ring_packets[NR_CPUS][MAX_REO_DEST_RINGS];
- } rx;
- } stats;
+ struct dp_soc_stats stats;
/* Enable processing of Tx completion status words */
bool process_tx_status;
@@ -1247,4 +1250,5 @@
struct dp_tx_me_buf_t *next;
uint8_t data[DP_MAC_ADDR_LEN];
};
+
#endif /* _DP_TYPES_H_ */
diff --git a/dp/wifi3.0/hal_rx.h b/dp/wifi3.0/hal_rx.h
index a5f4437..a468082 100644
--- a/dp/wifi3.0/hal_rx.h
+++ b/dp/wifi3.0/hal_rx.h
@@ -1890,7 +1890,8 @@
HAL_REO_ERR_PN_CHECK_FAILED,
HAL_REO_ERR_2K_ERROR_HANDLING_FLAG_SET,
HAL_REO_ERR_PN_ERROR_HANDLING_FLAG_SET,
- HAL_REO_ERR_QUEUE_DESC_BLOCKED_SET
+ HAL_REO_ERR_QUEUE_DESC_BLOCKED_SET,
+ HAL_REO_ERR_MAX
};
/**
@@ -1933,7 +1934,8 @@
HAL_RXDMA_ERR_DA_TIMEOUT,
HAL_RXDMA_ERR_FLOW_TIMEOUT,
HAL_RXDMA_ERR_FLUSH_REQUEST,
- HAL_RXDMA_ERR_WAR = 31
+ HAL_RXDMA_ERR_WAR = 31,
+ HAL_RXDMA_ERR_MAX
};
/**
diff --git a/hal/wifi3.0/hal_tx.h b/hal/wifi3.0/hal_tx.h
index ad6064c..63e7442 100644
--- a/hal/wifi3.0/hal_tx.h
+++ b/hal/wifi3.0/hal_tx.h
@@ -125,6 +125,8 @@
---------------------------------------------------------------------------*/
/**
* struct hal_tx_completion_status - HAL Tx completion descriptor contents
+ * @status: frame acked/failed
+ * @release_src: release source = TQM/FW
* @ack_frame_rssi: RSSI of the received ACK or BA frame
* @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
* @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
@@ -152,6 +154,8 @@
* @peer_id: Peer ID of the flow or MPDU queue
*/
struct hal_tx_completion_status {
+ uint8_t status;
+ uint8_t release_src;
uint8_t ack_frame_rssi;
uint8_t first_msdu:1,
last_msdu:1,
@@ -161,9 +165,9 @@
stbc:1,
ldpc:1,
sgi:2,
- mcs:2,
+ mcs:4,
ofdma:1,
- tones_in_ru:10,
+ tones_in_ru:12,
valid:1;
uint32_t tsf;
uint32_t ppdu_id;
@@ -855,7 +859,6 @@
static inline void hal_tx_comp_get_status(void *desc,
struct hal_tx_completion_status *ts)
{
-
uint8_t rate_stats_valid = 0;
uint32_t rate_stats = 0;
@@ -900,6 +903,9 @@
rate_stats);
}
+ ts->release_src = hal_tx_comp_get_buffer_source(desc);
+ ts->status = hal_tx_comp_get_release_reason(desc);
+
ts->tsf = HAL_TX_DESC_GET(desc, WBM_RELEASE_RING_6,
TX_RATE_STATS_INFO_TX_RATE_STATS);
}
@@ -916,6 +922,9 @@
ts->last_msdu = HAL_TX_DESC_GET(desc, WBM_RELEASE_RING_4, LAST_MSDU);
ts->msdu_part_of_amsdu = HAL_TX_DESC_GET(desc, WBM_RELEASE_RING_4,
MSDU_PART_OF_AMSDU);
+
+ ts->release_src = hal_tx_comp_get_buffer_source(desc);
+ ts->status = hal_tx_comp_get_release_reason(desc);
}
#endif
diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h
index 77a8851..8c4613f 100644
--- a/wlan_cfg/wlan_cfg.h
+++ b/wlan_cfg/wlan_cfg.h
@@ -35,13 +35,10 @@
#define MAX_LINK_DESC_BANKS 8
#define MAX_TXDESC_POOLS 4
#define MAX_TCL_DATA_RINGS 4
-#define DP_MAX_TX_RINGS 8
-#define MAX_TX_HW_QUEUES 3
/* Rx configuration */
#define MAX_RXDESC_POOLS 4
#define MAX_REO_DEST_RINGS 4
-#define DP_MAX_RX_RINGS 8
#define MAX_RX_MAC_RINGS 2
/* Miscellaneous configuration */