[PATCH] net/gve: add support for basic stats
Ferruh Yigit
ferruh.yigit at amd.com
Thu Nov 24 18:26:01 CET 2022
On 11/24/2022 4:59 PM, Stephen Hemminger wrote:
> On Thu, 24 Nov 2022 15:33:35 +0800
> Junfeng Guo <junfeng.guo at 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
Hi Stephen,
Queue stats moved to xstats, and there is a long term goal to move all
queue stats from basic stats to xstats for all PMDs, and remove interim
'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' flag.
That is why request to new PMDs is to not introduce queue stats in basic
stats, but in xstats.
More information about the dev
mailing list