Skip to content

Commit

Permalink
virtio: Fix no interrupt when not creating msi controller
Browse files Browse the repository at this point in the history
For ARM virt machine, if we use virt-2.7 which will not create ITS node,
the virtio-net can not recieve interrupts so it can't get ip address
through dhcp.
This fixes commit 83d768b(virtio: set ISR on dataplane notifications).

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
mstsirkin committed Feb 17, 2017
1 parent 97cd965 commit b4b9862
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions hw/virtio/virtio.c
Expand Up @@ -1584,6 +1584,12 @@ void virtio_notify_irqfd(VirtIODevice *vdev, VirtQueue *vq)
event_notifier_set(&vq->guest_notifier);
}

static void virtio_irq(VirtQueue *vq)
{
virtio_set_isr(vq->vdev, 0x1);
virtio_notify_vector(vq->vdev, vq->vector);
}

void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
{
bool should_notify;
Expand All @@ -1596,8 +1602,7 @@ void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
}

trace_virtio_notify(vdev, vq);
virtio_set_isr(vq->vdev, 0x1);
virtio_notify_vector(vdev, vq->vector);
virtio_irq(vq);
}

void virtio_notify_config(VirtIODevice *vdev)
Expand Down Expand Up @@ -2240,7 +2245,7 @@ static void virtio_queue_guest_notifier_read(EventNotifier *n)
{
VirtQueue *vq = container_of(n, VirtQueue, guest_notifier);
if (event_notifier_test_and_clear(n)) {
virtio_notify_vector(vq->vdev, vq->vector);
virtio_irq(vq);
}
}

Expand Down

0 comments on commit b4b9862

Please sign in to comment.