From 6632efe40da2e4f78d75a2e4e7434fef14139e3e Mon Sep 17 00:00:00 2001 From: Bryan Venteicher Date: Thu, 4 Jul 2013 17:50:11 +0000 Subject: Convert VirtIO to use ithreads instead of taskqueues Contains projects/virtio commits: r245709: Each VirtIO device was scheduling its own taskqueue(9) to do the off-level interrupt handling. ithreads(9) is the more nature way to do this. The primary motivation for this work to better support network multiqueue. r245710: virtio: Change virtqueue intr handlers to return void r245711: virtio_blk: Remove interrupt taskqueue r245721: vtnet: Remove interrupt taskqueue r245722: virtio_scsi: Remove interrupt taskqueue r245747: vtnet: Remove taskqueue fields missed in r245721 MFC after: 1 month --- sys/dev/virtio/virtqueue.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'sys/dev/virtio/virtqueue.c') diff --git a/sys/dev/virtio/virtqueue.c b/sys/dev/virtio/virtqueue.c index 1553afaa6430..275a92dc75b4 100644 --- a/sys/dev/virtio/virtqueue.c +++ b/sys/dev/virtio/virtqueue.c @@ -414,18 +414,27 @@ virtqueue_nused(struct virtqueue *vq) } int -virtqueue_intr(struct virtqueue *vq) +virtqueue_intr_filter(struct virtqueue *vq) { - if (vq->vq_intrhand == NULL || - vq->vq_used_cons_idx == vq->vq_ring.used->idx) + if (__predict_false(vq->vq_intrhand == NULL)) + return (0); + if (vq->vq_used_cons_idx == vq->vq_ring.used->idx) return (0); - vq->vq_intrhand(vq->vq_intrhand_arg); + virtqueue_disable_intr(vq); return (1); } +void +virtqueue_intr(struct virtqueue *vq) +{ + + if (__predict_true(vq->vq_intrhand != NULL)) + vq->vq_intrhand(vq->vq_intrhand_arg); +} + int virtqueue_enable_intr(struct virtqueue *vq) { -- cgit v1.3