[dpdk-dev] [PATCH v3 15/18] net/axgbe: add generic transmit and receive stats support
Ferruh Yigit
ferruh.yigit at intel.com
Fri Mar 16 18:47:20 CET 2018
On 3/9/2018 8:42 AM, Ravi Kumar wrote:
> Signed-off-by: Ravi Kumar <Ravi1.kumar at amd.com>
<...>
> +static int
> +axgbe_dev_stats_get(struct rte_eth_dev *dev,
> + struct rte_eth_stats *stats)
> +{
> + struct axgbe_rx_queue *rxq;
> + struct axgbe_tx_queue *txq;
> + unsigned int i;
> +
> + for (i = 0; i < dev->data->nb_rx_queues; i++) {
> + rxq = dev->data->rx_queues[i];
> + stats->q_ipackets[i] = rxq->pkts;
> + stats->ipackets += rxq->pkts;
> + stats->q_ibytes[i] = rxq->bytes;
> + stats->ibytes += rxq->bytes;
> + }
> + for (i = 0; i < dev->data->nb_tx_queues; i++) {
> + txq = dev->data->tx_queues[i];
> + stats->q_opackets[i] = txq->pkts;
> + stats->opackets += txq->pkts;
> + stats->q_obytes[i] = txq->bytes;
> + stats->obytes += txq->bytes;
> + }
Just as a reminder of imissed and ierror, it is OK if they are not ready to use
in this stage.
<...>
More information about the dev
mailing list