virtio-comment.lists.oasis-open.org archive mirror
 help / color / mirror / Atom feed
From: Parav Pandit <parav@nvidia.com>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	"virtio-comment@lists.oasis-open.org"
	<virtio-comment@lists.oasis-open.org>
Cc: "jasowang@redhat.com" <jasowang@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	David Edmondson <david.edmondson@oracle.com>
Subject: [virtio-comment] RE: [PATCH v17] virtio-net: support device stats
Date: Thu, 14 Sep 2023 02:55:56 +0000	[thread overview]
Message-ID: <PH0PR12MB54814C19D1B97675FCC56FBCDCF7A@PH0PR12MB5481.namprd12.prod.outlook.com> (raw)
In-Reply-To: <PH0PR12MB5481C32DA10A84488E421328DCF0A@PH0PR12MB5481.namprd12.prod.outlook.com>



> From: Parav Pandit <parav@nvidia.com>
> Sent: Wednesday, September 13, 2023 8:55 PM

> > +struct virtio_net_stats_reply_hdr {
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_CVQ       32
> > +
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_RX_BASIC  0
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_RX_CSUM   1
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_RX_GSO    2
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_RX_SPEED  3
> > +
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_TX_BASIC  16
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_TX_CSUM   17
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_TX_GSO    18
> > +#define VIRTIO_NET_STATS_TYPE_REPLY_TX_SPEED  19
> > +    u8 type;
> > +    u8 reserved;
> > +    le16 vq_index;
> > +    le32 size;

Even though we are not doing the switch logic at present, we keep the doors open for such advancement.
Most of the counters that we deal here will be applicable on switch port too instead of vq level too.
The only change would occur in future is: instead of vq_index, it will be switch port number for a VF etc.
So please keep le16 reserved adjacent to vq_index.

While doing that, to keep the header in 8B boundary, I think we can limit the size width to be 16-bit. 
The reason is, even though, 64K device (switch ports) sounds a lot today, in long run it may not be.

So 32-bit for resource identifier( le16 vq_index+ le16 reserved, or le32 switch_port later).
And 16-bit for size, that enables to cover 64K-1 = 8K-1 counters of width 64-bit a given statistics category, which is also good enough and expandable to more categories.


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/


      parent reply	other threads:[~2023-09-14  2:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07  6:05 [virtio-comment] [PATCH v17] virtio-net: support device stats Xuan Zhuo
2023-09-13 15:24 ` [virtio-comment] " Parav Pandit
2023-09-14  2:42   ` Parav Pandit
2023-09-14  2:55   ` Parav Pandit [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=PH0PR12MB54814C19D1B97675FCC56FBCDCF7A@PH0PR12MB5481.namprd12.prod.outlook.com \
    --to=parav@nvidia.com \
    --cc=david.edmondson@oracle.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=xuanzhuo@linux.alibaba.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 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).