qcacld-3.0: track connectivity stats for rx packets

Track connectivity stats for data rx packets through a
callback function hdd_tx_rx_collect_connectivity_stats_info().

Change-Id: I045ba694495876273691373a9d0a8995d4aa9c34
CRs-Fixed: 2161889
This commit is contained in:
Poddar, Siddarth 2018-01-09 11:24:58 +05:30 • committed by nshrivas
commit 3906e17e74
5 changed files with 68 additions and 1 deletions

View file

@ -597,6 +597,13 @@ bool cds_is_group_addr(uint8_t *mac_addr)
* Return: ARP stats IP to track.
*/
uint32_t cds_get_arp_stats_gw_ip(void *context);
/**
* cds_get_connectivity_stats_pkt_bitmap() - get pkt-type bitmap
* @context: osif dev context
*
* Return: pkt bitmap to track
*/
uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context);
void cds_incr_arp_stats_tx_tgt_delivered(void);
void cds_incr_arp_stats_tx_tgt_acked(void);

View file

@ -2776,6 +2776,25 @@ cds_print_htc_credit_history(uint32_t count, qdf_abstract_print *print,
}
#endif
uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context)
{
struct hdd_adapter *adapter = NULL;
adapter = (struct hdd_adapter *)context;
if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) {
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
"Magic cookie(%x) for adapter sanity verification is invalid",
adapter->magic);
return QDF_STATUS_E_FAILURE;
}
return adapter->pkt_type_bitmap;
}
/**
* cds_get_arp_stats_gw_ip() - get arp stats track IP
*
* Return: ARP stats IP to track
*/
uint32_t cds_get_arp_stats_gw_ip(void *context)
{
struct hdd_adapter *adapter = (struct hdd_adapter *)context;

View file

@ -629,6 +629,37 @@ static inline void ol_tx_timestamp(ol_txrx_pdev_handle pdev,
}
#endif
/**
* ol_tx_update_connectivity_stats() - update connectivity stats
* @tx_desc: tx desc
* @netbuf: buffer
* @status: htt status
*
*
* Return: none
*/
static void ol_tx_update_connectivity_stats(struct ol_tx_desc_t *tx_desc,
qdf_nbuf_t netbuf,
enum htt_tx_status status)
{
void *osif_dev;
ol_txrx_stats_rx_fp stats_rx = NULL;
uint8_t pkt_type = 0;
qdf_assert(tx_desc);
osif_dev = tx_desc->vdev->osif_dev;
stats_rx = tx_desc->vdev->stats_rx;
if (stats_rx) {
if (status != htt_tx_status_download_fail)
stats_rx(netbuf, osif_dev,
PKT_TYPE_TX_HOST_FW_SENT, &pkt_type);
if (status == htt_tx_status_ok)
stats_rx(netbuf, osif_dev,
PKT_TYPE_TX_ACK_CNT, &pkt_type);
}
}
/**
* ol_tx_update_arp_stats() - update ARP packet TX stats
* @tx_desc: tx desc
@ -671,6 +702,7 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev,
struct ol_tx_desc_t *tx_desc;
uint32_t byte_cnt = 0;
qdf_nbuf_t netbuf;
uint32_t pkt_type_bitmap;
tp_ol_packetdump_cb packetdump_cb;
uint32_t is_tx_desc_freed = 0;
struct htt_tx_compl_ind_append_tx_tstamp *txtstamp_list = NULL;
@ -712,6 +744,13 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev,
ol_tx_update_arp_stats(tx_desc, netbuf, status);
}
/* track connectivity stats */
pkt_type_bitmap = cds_get_connectivity_stats_pkt_bitmap(
tx_desc->vdev->osif_dev);
if (pkt_type_bitmap)
ol_tx_update_connectivity_stats(tx_desc, netbuf,
status);
if (tx_desc->pkt_type != OL_TX_FRM_TSO) {
packetdump_cb = pdev->ol_tx_packetdump_cb;
if (packetdump_cb)

View file

@ -2301,6 +2301,7 @@ static void ol_txrx_vdev_register(struct cdp_vdev *pvdev,
vdev->osif_dev = osif_vdev;
vdev->rx = txrx_ops->rx.rx;
vdev->stats_rx = txrx_ops->rx.stats_rx;
txrx_ops->tx.tx = ol_tx_data;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@ -1037,6 +1037,7 @@ struct ol_txrx_vdev_t {
* pseudo-peer)
*/
ol_txrx_rx_fp rx; /* receive function used by this vdev */
ol_txrx_stats_rx_fp stats_rx; /* receive function used by this vdev */
struct {
/*