OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [PATCH v17] virtio-net: support device stats



> 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.



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]