From: Stephen Hemminger <stephen@networkplumber.org>
To: Junfeng Guo <junfeng.guo@intel.com>
Cc: qi.z.zhang@intel.com, jingjing.wu@intel.com,
ferruh.yigit@amd.com, beilei.xing@intel.com, dev@dpdk.org,
jeroendb@google.com, rushilg@google.com, jrkim@google.com,
Xiaoyun Li <xiaoyun.li@intel.com>
Subject: Re: [PATCH] net/gve: add support for basic stats
Date: Thu, 24 Nov 2022 08:59:26 -0800 [thread overview]
Message-ID: <20221124085926.46430390@hermes.local> (raw)
In-Reply-To: <20221124073335.3985214-1-junfeng.guo@intel.com>
On Thu, 24 Nov 2022 15:33:35 +0800
Junfeng Guo <junfeng.guo@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
next prev parent reply other threads:[~2022-11-24 16:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 7:33 [PATCH] net/gve: add support for basic stats Junfeng Guo
2022-11-24 16:59 ` Stephen Hemminger [this message]
2022-11-24 17:26 ` Ferruh Yigit
2022-11-26 3:16 ` Rushil Gupta
2022-11-26 17:34 ` Stephen Hemminger
2022-11-28 11:12 ` Ferruh Yigit
2022-11-28 17:24 ` Stephen Hemminger
2022-11-29 1:42 ` Guo, Junfeng
2022-12-07 15:09 ` Ferruh Yigit
2022-12-07 16:39 ` Stephen Hemminger
2022-12-19 19:17 ` Rushil Gupta
2022-12-19 19:38 ` Joshua Washington
2023-01-18 16:22 ` Ferruh Yigit
2023-01-31 1:51 ` Joshua Washington
2023-01-31 10:05 ` Ferruh Yigit
2023-02-02 23:00 ` Joshua Washington
2023-02-03 17:39 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221124085926.46430390@hermes.local \
--to=stephen@networkplumber.org \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=jeroendb@google.com \
--cc=jingjing.wu@intel.com \
--cc=jrkim@google.com \
--cc=junfeng.guo@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=rushilg@google.com \
--cc=xiaoyun.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.