RE: [PATCH 1/2] vdpa: Add support for querying statistics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> From: Jason Wang <jasowang@xxxxxxxxxx>
> Sent: Friday, November 19, 2021 8:12 AM
> 
> On Thu, Nov 18, 2021 at 1:58 PM Eli Cohen <elic@xxxxxxxxxx> wrote:
> >
> > Add support for querying virtqueue statistics. Supported statistics are:
> >
> > Received_desc - number of descriptors received for the virtqueue
> > completed_desc - number of descriptors completed for the virtqueue
> >
> > A new callback was added to vdpa_config_ops which provides the means
> > for the vdpa driver to return statistics results.
> >
> > The interface allows for reading all the supported virtqueues,
> > including the control virtqueue if it exists, by returning the next
> > queue index to query.
> >
> > Examples:
> > 1. Read statisitics for the virtqueue at index 1 $ vdpa dev stats show
> > vdpa-a index 1
> > vdpa-a:
> > index 1 tx received_desc 21 completed_desc 21
> >
> > 2. Read statisitics for all the virtqueues vdpa dev stats show vdpa-a
> > vdpa-a:
> > index 0 rx received_desc 256 completed_desc 12 index 1 tx
> > received_desc 21 completed_desc 21 index 2 ctrl received_desc 0
> > completed_desc 0
> 
> Adding Adrian and Laurent.
> 
> It's quite useful but I think it's vendor specific statistics.  
These are vdpa device specific of Linux.
And are very generic of the VQ for all device types.

> I wonder if it's better
> to use "vendor" prefix in the protocol, then we use this instead:
> 
> vdpa dev vendor-stats show vdpa-a
> 
May be. Lets evaluate if stats of this patch are generic enough or not.
 
> Or if we want to make it standard is exposing virtio index better?
> 
> qid 0 last_avail_idx X avail_idx Y last_used_idx M used_idx N
> 
I did consider this option a while back. Shows indices are equally useful.
I think we should show that as vq info, along with other VQ attributes (addr, len).
$ vdpa dev show vq

But showing indices are not less statistics and more current state of the queue.
For example roll over of the indices won't cover absolute number of descriptors processed for the queue.
And even if we make them u64 (not good), non_developer end user needs to keep using side calculator to count the delta.

So I think useful q indices belong to q info.

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux