Commit 5bbfea1e authored by Wu Zongyong's avatar Wu Zongyong Committed by Michael S. Tsirkin

vp_vdpa: add vq irq offloading support

This patch implements the get_vq_irq() callback for virtio pci devices
to allow irq offloading.
Signed-off-by: default avatarWu Zongyong <wuzongyong@linux.alibaba.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/bb091e5505db704dd620f8854a7aebc921d2a752.1635493219.git.wuzongyong@linux.alibaba.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent d0ae1fbf
...@@ -76,6 +76,17 @@ static u8 vp_vdpa_get_status(struct vdpa_device *vdpa) ...@@ -76,6 +76,17 @@ static u8 vp_vdpa_get_status(struct vdpa_device *vdpa)
return vp_modern_get_status(mdev); return vp_modern_get_status(mdev);
} }
static int vp_vdpa_get_vq_irq(struct vdpa_device *vdpa, u16 idx)
{
struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa);
int irq = vp_vdpa->vring[idx].irq;
if (irq == VIRTIO_MSI_NO_VECTOR)
return -EINVAL;
return irq;
}
static void vp_vdpa_free_irq(struct vp_vdpa *vp_vdpa) static void vp_vdpa_free_irq(struct vp_vdpa *vp_vdpa)
{ {
struct virtio_pci_modern_device *mdev = &vp_vdpa->mdev; struct virtio_pci_modern_device *mdev = &vp_vdpa->mdev;
...@@ -427,6 +438,7 @@ static const struct vdpa_config_ops vp_vdpa_ops = { ...@@ -427,6 +438,7 @@ static const struct vdpa_config_ops vp_vdpa_ops = {
.get_config = vp_vdpa_get_config, .get_config = vp_vdpa_get_config,
.set_config = vp_vdpa_set_config, .set_config = vp_vdpa_set_config,
.set_config_cb = vp_vdpa_set_config_cb, .set_config_cb = vp_vdpa_set_config_cb,
.get_vq_irq = vp_vdpa_get_vq_irq,
}; };
static void vp_vdpa_free_irq_vectors(void *data) static void vp_vdpa_free_irq_vectors(void *data)
......
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