Virtualization Archive mirror
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric  Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"Michael S.  Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Alexei  Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@google.com>,
	Amritha  Nambiar <amritha.nambiar@intel.com>,
	Larysa Zaremba <larysa.zaremba@intel.com>,
	Sridhar Samudrala <sridhar.samudrala@intel.com>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	virtualization@lists.linux.dev, bpf@vger.kernel.org
Subject: Re: [PATCH net-next v6 8/8] virtio-net: support queue stat
Date: Thu, 25 Apr 2024 15:14:34 +0800	[thread overview]
Message-ID: <1714029274.2610173-1-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <20240424204422.71c20b3f@kernel.org>

On Wed, 24 Apr 2024 20:44:22 -0700, Jakub Kicinski <kuba@kernel.org> wrote:
> On Tue, 23 Apr 2024 19:31:41 +0800 Xuan Zhuo wrote:
> > +static void virtnet_get_base_stats(struct net_device *dev,
> > +				   struct netdev_queue_stats_rx *rx,
> > +				   struct netdev_queue_stats_tx *tx)
> > +{
> > +	/* The queue stats of the virtio-net will not be reset. So here we
> > +	 * return 0.
> > +	 */
> > +	rx->bytes = 0;
> > +	rx->packets = 0;
> > +	rx->alloc_fail = 0;
> > +	rx->hw_drops = 0;
> > +	rx->hw_drop_overruns = 0;
> > +	rx->csum_unnecessary = 0;
> > +	rx->csum_none = 0;
> > +	rx->csum_bad = 0;
> > +	rx->hw_gro_packets = 0;
> > +	rx->hw_gro_bytes = 0;
> > +	rx->hw_gro_wire_packets = 0;
> > +	rx->hw_gro_wire_bytes = 0;
> > +	rx->hw_drop_ratelimits = 0;
> > +
> > +	tx->bytes = 0;
> > +	tx->packets = 0;
> > +	tx->hw_drops = 0;
> > +	tx->hw_drop_errors = 0;
> > +	tx->csum_none = 0;
> > +	tx->needs_csum = 0;
> > +	tx->hw_gso_packets = 0;
> > +	tx->hw_gso_bytes = 0;
> > +	tx->hw_gso_wire_packets = 0;
> > +	tx->hw_gso_wire_bytes = 0;
> > +	tx->hw_drop_ratelimits = 0;
>
> Doesn't this need to be conditional based on device capabilities?
> We should only assign the stats that the device is collecting
> (both in base stats and per-queue).


Will be fixed in next version.

Thanks.

      reply	other threads:[~2024-04-25  7:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 11:31 [PATCH net-next v6 0/8] virtio-net: support device stats Xuan Zhuo
2024-04-23 11:31 ` [PATCH net-next v6 1/8] virtio_net: introduce device stats feature and structures Xuan Zhuo
2024-04-23 11:31 ` [PATCH net-next v6 2/8] virtio_net: remove "_queue" from ethtool -S Xuan Zhuo
2024-04-23 11:31 ` [PATCH net-next v6 3/8] virtio_net: support device stats Xuan Zhuo
2024-04-24  2:57   ` Jason Wang
2024-04-23 11:31 ` [PATCH net-next v6 4/8] virtio_net: device stats helpers support driver stats Xuan Zhuo
2024-04-24  3:52   ` Jason Wang
2024-04-23 11:31 ` [PATCH net-next v6 5/8] virtio_net: add the total stats field Xuan Zhuo
2024-04-24  3:52   ` Jason Wang
2024-04-24  8:21     ` Xuan Zhuo
2024-04-23 11:31 ` [PATCH net-next v6 6/8] virtio_net: rename stat tx_timeout to timeout Xuan Zhuo
2024-04-24  3:55   ` Jason Wang
2024-04-24  8:23     ` Xuan Zhuo
2024-04-23 11:31 ` [PATCH net-next v6 7/8] netdev: add queue stats Xuan Zhuo
2024-04-23 11:31 ` [PATCH net-next v6 8/8] virtio-net: support queue stat Xuan Zhuo
2024-04-25  3:44   ` Jakub Kicinski
2024-04-25  7:14     ` Xuan Zhuo [this message]

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=1714029274.2610173-1-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=amritha.nambiar@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=larysa.zaremba@intel.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.com \
    --cc=sridhar.samudrala@intel.com \
    --cc=virtualization@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).