qcacld-3.0: Add histogram for MSDUs per RX indication

Add histogram for MSDUs per HTT RX indication
message and update drop counters in RX path.

Change-Id: Ia861f6cd3d6a91f01a07f9bc4e2bc3afcf62c8f2
CRs-Fixed: 999861
This commit is contained in:
Nirav Shah
2016-04-25 10:15:04 +05:30
committato da Gerrit - the friendly Code Review server
parent 9db91ba92c
commit 6a4eee661c
5 ha cambiato i file con 96 aggiunte e 5 eliminazioni

Vedi File

@@ -1654,6 +1654,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
/* Get the total number of MSDUs */
msdu_count = HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(*(msg_word + 1));
HTT_RX_CHECK_MSDU_COUNT(msdu_count);
ol_rx_update_histogram_stats(msdu_count);
msg_word =
(uint32_t *) (rx_ind_data + HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES);

Vedi File

@@ -80,6 +80,7 @@ struct ol_txrx_stats_tx_dropped {
couldn't get an ack for */
struct ol_txrx_stats_elem no_ack;
};
struct ol_txrx_stats_tx_histogram {
uint32_t pkts_1;
uint32_t pkts_2_10;
@@ -112,6 +113,16 @@ struct ol_txrx_stats_tx {
/*
* RX
*/
struct ol_txrx_stats_rx_histogram {
uint32_t pkts_1;
uint32_t pkts_2_10;
uint32_t pkts_11_20;
uint32_t pkts_21_30;
uint32_t pkts_31_40;
uint32_t pkts_41_50;
uint32_t pkts_51_60;
uint32_t pkts_61_plus;
};
struct ol_txrx_stats_rx_ibss_fwd {
/* MSDUs forwarded to network stack */
u_int32_t packets_stack;
@@ -123,7 +134,11 @@ struct ol_txrx_stats_rx_ibss_fwd {
struct ol_txrx_stats_rx {
/* MSDUs given to the OS shim */
struct ol_txrx_stats_elem delivered;
struct ol_txrx_stats_elem dropped_err;
struct ol_txrx_stats_elem dropped_mic_err;
struct ol_txrx_stats_elem dropped_peer_invalid;
struct ol_txrx_stats_rx_ibss_fwd intra_bss_fwd;
struct ol_txrx_stats_rx_histogram rx_ind_histogram;
};
struct ol_txrx_stats {
struct ol_txrx_stats_tx tx;

Vedi File

@@ -103,6 +103,41 @@ void ol_rx_trigger_restore(htt_pdev_handle htt_pdev, qdf_nbuf_t head_msdu,
}
#endif
/**
* ol_rx_update_histogram_stats() - update rx histogram statistics
* @msdu_count: msdu count
*
* Return: none
*/
void ol_rx_update_histogram_stats(uint32_t msdu_count)
{
struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
if (!pdev) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
"%s pdev is NULL\n", __func__);
return;
}
if (msdu_count > 60) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_61_plus, 1);
} else if (msdu_count > 50) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_51_60, 1);
} else if (msdu_count > 40) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_41_50, 1);
} else if (msdu_count > 30) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_31_40, 1);
} else if (msdu_count > 20) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_21_30, 1);
} else if (msdu_count > 10) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_11_20, 1);
} else if (msdu_count > 1) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_2_10, 1);
} else if (msdu_count == 1) {
TXRX_STATS_ADD(pdev, pub.rx.rx_ind_histogram.pkts_1, 1);
}
}
static void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev,
void *rx_mpdu_desc, qdf_nbuf_t msdu)
{
@@ -808,6 +843,7 @@ ol_rx_mic_error_handler(
struct ol_txrx_vdev_t *vdev = NULL;
if (pdev) {
TXRX_STATS_MSDU_INCR(pdev, rx.dropped_mic_err, msdu);
peer = ol_txrx_peer_find_by_id(pdev, peer_id);
if (peer) {
vdev = peer->vdev;
@@ -1298,6 +1334,8 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
while (head_msdu) {
qdf_nbuf_t msdu = head_msdu;
head_msdu = qdf_nbuf_next(head_msdu);
TXRX_STATS_MSDU_INCR(pdev,
rx.dropped_peer_invalid, msdu);
htt_rx_desc_frame_free(htt_pdev, msdu);
}
return;

Vedi File

@@ -56,6 +56,7 @@ void
ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev,
uint32_t msdu_count,
uint32_t *msg_word);
void ol_rx_update_histogram_stats(uint32_t msdu_count);
void
ol_rx_mic_error_handler(

Vedi File

@@ -2995,10 +2995,10 @@ ol_txrx_stats(uint8_t vdev_id, char *buffer, unsigned buf_len)
void ol_txrx_stats_display(ol_txrx_pdev_handle pdev)
{
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, "txrx stats:");
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
" tx: sent %lld msdus (%lld B), "
" rejected %lld (%lld B), dropped %lld (%lld B)",
"TX PATH Statistics:");
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"sent %lld msdus (%lld B), rejected %lld (%lld B), dropped %lld (%lld B)",
pdev->stats.pub.tx.delivered.pkts,
pdev->stats.pub.tx.delivered.bytes,
pdev->stats.pub.tx.dropped.host_reject.pkts,
@@ -3038,18 +3038,46 @@ void ol_txrx_stats_display(ol_txrx_pdev_handle pdev)
pdev->stats.pub.tx.comp_histogram.pkts_51_60,
pdev->stats.pub.tx.comp_histogram.pkts_61_plus);
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
" rx: %lld ppdus, %lld mpdus, %lld msdus, %lld bytes, %lld errs",
"RX PATH Statistics:");
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"%lld ppdus, %lld mpdus, %lld msdus, %lld bytes\n"
"dropped: err %lld (%lld B), peer_invalid %lld (%lld B), mic_err %lld (%lld B)",
pdev->stats.priv.rx.normal.ppdus,
pdev->stats.priv.rx.normal.mpdus,
pdev->stats.pub.rx.delivered.pkts,
pdev->stats.pub.rx.delivered.bytes,
pdev->stats.priv.rx.err.mpdu_bad);
pdev->stats.pub.rx.dropped_err.pkts,
pdev->stats.pub.rx.dropped_err.bytes,
pdev->stats.pub.rx.dropped_peer_invalid.pkts,
pdev->stats.pub.rx.dropped_peer_invalid.bytes,
pdev->stats.pub.rx.dropped_mic_err.pkts,
pdev->stats.pub.rx.dropped_mic_err.bytes);
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
" fwd to stack %d, fwd to fw %d, fwd to stack & fw %d\n",
pdev->stats.pub.rx.intra_bss_fwd.packets_stack,
pdev->stats.pub.rx.intra_bss_fwd.packets_fwd,
pdev->stats.pub.rx.intra_bss_fwd.packets_stack_n_fwd);
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
"rx packets per HTT indication:\n"
"Single Packet %d\n"
" 2-10 Packets %d\n"
"11-20 Packets %d\n"
"21-30 Packets %d\n"
"31-40 Packets %d\n"
"41-50 Packets %d\n"
"51-60 Packets %d\n"
" 60+ Packets %d\n",
pdev->stats.pub.rx.rx_ind_histogram.pkts_1,
pdev->stats.pub.rx.rx_ind_histogram.pkts_2_10,
pdev->stats.pub.rx.rx_ind_histogram.pkts_11_20,
pdev->stats.pub.rx.rx_ind_histogram.pkts_21_30,
pdev->stats.pub.rx.rx_ind_histogram.pkts_31_40,
pdev->stats.pub.rx.rx_ind_histogram.pkts_41_50,
pdev->stats.pub.rx.rx_ind_histogram.pkts_51_60,
pdev->stats.pub.rx.rx_ind_histogram.pkts_61_plus);
}
void ol_txrx_stats_clear(ol_txrx_pdev_handle pdev)
@@ -3563,6 +3591,8 @@ static void ol_rx_data_cb(struct ol_txrx_pdev_t *pdev,
ret = data_rx(osif_dev, buf);
if (ret != QDF_STATUS_SUCCESS) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "Frame Rx to HDD failed");
if (pdev)
TXRX_STATS_MSDU_INCR(pdev, rx.dropped_err, buf);
qdf_nbuf_free(buf);
}
buf = next_buf;
@@ -3574,6 +3604,9 @@ free_buf:
buf = buf_list;
while (buf) {
next_buf = qdf_nbuf_queue_next(buf);
if (pdev)
TXRX_STATS_MSDU_INCR(pdev,
rx.dropped_peer_invalid, buf);
qdf_nbuf_free(buf);
buf = next_buf;
}
@@ -3675,6 +3708,9 @@ drop_rx_buf:
buf = rx_buf_list;
while (buf) {
next_buf = qdf_nbuf_queue_next(buf);
if (pdev)
TXRX_STATS_MSDU_INCR(pdev,
rx.dropped_peer_invalid, buf);
qdf_nbuf_free(buf);
buf = next_buf;
}