Commit bfae1648 authored by Xie Yongji's avatar Xie Yongji Committed by Michael S. Tsirkin

vduse: Support get_vq_affinity callback

This implements get_vq_affinity callback so that
the virtio-blk driver can build the blk-mq queues
based on the irq callback affinity.
Signed-off-by: default avatarXie Yongji <xieyongji@bytedance.com>
Message-Id: <20230323053043.35-7-xieyongji@bytedance.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
parent 28f6288e
...@@ -722,6 +722,14 @@ static int vduse_vdpa_set_vq_affinity(struct vdpa_device *vdpa, u16 idx, ...@@ -722,6 +722,14 @@ static int vduse_vdpa_set_vq_affinity(struct vdpa_device *vdpa, u16 idx,
return 0; return 0;
} }
static const struct cpumask *
vduse_vdpa_get_vq_affinity(struct vdpa_device *vdpa, u16 idx)
{
struct vduse_dev *dev = vdpa_to_vduse(vdpa);
return &dev->vqs[idx]->irq_affinity;
}
static int vduse_vdpa_set_map(struct vdpa_device *vdpa, static int vduse_vdpa_set_map(struct vdpa_device *vdpa,
unsigned int asid, unsigned int asid,
struct vhost_iotlb *iotlb) struct vhost_iotlb *iotlb)
...@@ -773,6 +781,7 @@ static const struct vdpa_config_ops vduse_vdpa_config_ops = { ...@@ -773,6 +781,7 @@ static const struct vdpa_config_ops vduse_vdpa_config_ops = {
.set_config = vduse_vdpa_set_config, .set_config = vduse_vdpa_set_config,
.get_generation = vduse_vdpa_get_generation, .get_generation = vduse_vdpa_get_generation,
.set_vq_affinity = vduse_vdpa_set_vq_affinity, .set_vq_affinity = vduse_vdpa_set_vq_affinity,
.get_vq_affinity = vduse_vdpa_get_vq_affinity,
.reset = vduse_vdpa_reset, .reset = vduse_vdpa_reset,
.set_map = vduse_vdpa_set_map, .set_map = vduse_vdpa_set_map,
.free = vduse_vdpa_free, .free = vduse_vdpa_free,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment