1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| The vdpa management tool(from iproute2) can be used to communicate with the vDPA framework in the kernel using netlink vDPA API. It allows to create and destroy new devices, and control their parameters.
An example using the in-kernel simulators:
$ modprobe vdpa-sim-net $ modprobe vdpa-sim-blk
$ vdpa mgmtdev show vdpasim_blk: supported_classes block vdpasim_net: supported_classes net
$ vdpa dev add name vdpa-net1 mgmtdev vdpasim_net
$ vdpa dev add name vdpa-blk1 mgmtdev vdpasim_blk
$ vdpa dev show vdpa-net1: type network mgmtdev vdpasim_net vendor_id 0 max_vqs 2 max_vq_size 256 vdpa-blk1: type block mgmtdev vdpasim_blk vendor_id 0 max_vqs 1 max_vq_size 256
$ vdpa dev show -jp { "dev": { "vdpa-net1": { "type": "network", "mgmtdev": "vdpasim_net", "vendor_id": 0, "max_vqs": 2, "max_vq_size": 256 }, "vdpa-blk1": { "type": "block", "mgmtdev": "vdpasim_blk", "vendor_id": 0, "max_vqs": 1, "max_vq_size": 256 } } }
$ ls /sys/bus/vdpa/devices
$ ls -l /sys/bus/vdpa/devices/vdpa0/driver
$ echo vdpa0 > /sys/bus/vdpa/drivers/vhost_vdpa/unbind $ echo vdpa0 > /sys/bus/vdpa/drivers/virtio_vdpa/bind
$ ls /sys/bus/vdpa/drivers
|