qcacmn: Update netdevice stats to reflect ifconfig counters

netdevice_stats structure tx/rx/drop/error counters are assigned
proper values

Change-Id: I8e123a810a02292339a34b54bfebe3a56ae99dbd
This commit is contained in:
Anish Nataraj
2018-03-14 14:27:13 +05:30
committed by nshrivas
parent 0573462cb2
commit f12b0a3463
4 changed files with 48 additions and 13 deletions

View File

@@ -4743,6 +4743,33 @@ static inline void dp_aggregate_pdev_stats(struct dp_pdev *pdev)
}
/**
* dp_pdev_getstats() - get pdev packet level stats
* @pdev_handle: Datapath PDEV handle
* @stats: cdp network device stats structure
*
* Return: void
*/
static void dp_pdev_getstats(struct cdp_pdev *pdev_handle,
struct cdp_dev_stats *stats)
{
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
dp_aggregate_pdev_stats(pdev);
stats->tx_packets = pdev->stats.tx_i.rcvd.num;
stats->tx_bytes = pdev->stats.tx_i.rcvd.bytes;
stats->tx_errors = pdev->stats.tx.tx_failed +
pdev->stats.tx_i.dropped.dropped_pkt.num;
stats->tx_dropped = stats->tx_errors;
stats->rx_packets = pdev->stats.rx.unicast.num +
pdev->stats.rx.multicast.num;
stats->rx_bytes = pdev->stats.rx.unicast.bytes +
pdev->stats.rx.multicast.bytes;
}
/**
* dp_print_pdev_tx_stats(): Print Pdev level TX stats
* @pdev: DP_PDEV Handle
@@ -4952,8 +4979,6 @@ dp_print_soc_tx_stats(struct dp_soc *soc)
soc->stats.tx.tcl_ring_full[2]);
}
/**
* dp_print_soc_rx_stats: Print SOC level Rx stats
* @soc: DP_SOC Handle
@@ -6617,6 +6642,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
.txrx_get_vdev_mac_addr = dp_get_vdev_mac_addr_wifi3,
.txrx_get_vdev_from_vdev_id = dp_get_vdev_from_vdev_id_wifi3,
.txrx_get_ctrl_pdev_from_vdev = dp_get_ctrl_pdev_from_vdev_wifi3,
.txrx_ath_getstats = dp_pdev_getstats,
.addba_requestprocess = dp_addba_requestprocess_wifi3,
.addba_responsesetup = dp_addba_responsesetup_wifi3,
.delba_process = dp_delba_process_wifi3,