On Thu, 24 Nov 2022 15:33:35 +0800 Junfeng Guo <junfeng....@intel.com> wrote:
> +static int > +gve_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > +{ > + uint16_t i; > + > + for (i = 0; i < dev->data->nb_tx_queues; i++) { > + struct gve_tx_queue *txq = dev->data->tx_queues[i]; > + if (txq == NULL) > + continue; > + > + stats->opackets += txq->packets; > + stats->obytes += txq->bytes; > + stats->oerrors += txq->errors; > + } > + > + for (i = 0; i < dev->data->nb_rx_queues; i++) { > + struct gve_rx_queue *rxq = dev->data->rx_queues[i]; > + if (rxq == NULL) > + continue; > + > + stats->ipackets += rxq->packets; > + stats->ibytes += rxq->bytes; > + stats->ierrors += rxq->errors; > + stats->rx_nombuf += rxq->no_mbufs; > + } > + > + return 0; > +} > + The driver should be filling in the per-queue stats as well. q_ipackets, q_opackets, q_ibytes, q_obytes, q_errors