]> git.ipfire.org Git - thirdparty/iproute2.git/commit
vdpa: Add support for reading vdpa device statistics
authorEli Cohen <elic@nvidia.com>
Wed, 15 Jun 2022 03:46:16 +0000 (06:46 +0300)
committerDavid Ahern <dsahern@kernel.org>
Sun, 19 Jun 2022 16:09:32 +0000 (10:09 -0600)
commit6f97e9c9337b9c083ea0719b633622bcfef5d77b
tree9eb18f1687e661f5c3ce0f70cc929e9907b5c9a4
parentbfffaf1360916a5acc80c96008cb70b038476e00
vdpa: Add support for reading vdpa device statistics

Read statistics of a vdpa device. The specific data is a received as a
pair of attribute name and attribute value.

Examples:
1. Read statistics for the virtqueue at index 1

$ vdpa dev vstats show vdpa-a qidx 1
vdpa-a:
vdpa-a: queue_type tx received_desc 321812 completed_desc 321812

2. Read statistics for the virtqueue at index 16
$ vdpa dev vstats show vdpa-a qidx 16
vdpa-a: queue_type control_vq received_desc 17 completed_desc 17

3. Read statisitics for the virtqueue at index 0 with json output
$ vdpa -j dev vstats show vdpa-a qidx 0
{"vstats":{"vdpa-a":{"queue_type":"rx","received_desc":114855,"completed_desc":114617}}}

4. Read statistics for the virtqueue at index 0 with preety json
   output
$ vdpa -jp dev vstats show vdpa-a qidx 0
vdpa -jp dev vstats show vdpa-a qidx 0
{
    "vstats": {
        "vdpa-a": {
            "queue_type": "rx",
            "received_desc": 114855,
            "completed_desc": 114617
        }
    }
}

Signed-off-by: Eli Cohen <elic@nvidia.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
vdpa/include/uapi/linux/vdpa.h
vdpa/vdpa.c