net/virtio: add interrupt helper for split ring

Add a helper for disabling interrupts in split ring to make the
code consistent with the corresponding code in packed ring.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
Tiwei Bie 2019-03-19 14:43:10 +08:00 committed by Ferruh Yigit
parent bc80357cd6
commit 13cd890d01

View File

@ -317,7 +317,7 @@ vring_desc_init_split(struct vring_desc *dp, uint16_t n)
}
/**
* Tell the backend not to interrupt us.
* Tell the backend not to interrupt us. Implementation for packed virtqueues.
*/
static inline void
virtqueue_disable_intr_packed(struct virtqueue *vq)
@ -329,6 +329,15 @@ virtqueue_disable_intr_packed(struct virtqueue *vq)
}
}
/**
* Tell the backend not to interrupt us. Implementation for split virtqueues.
*/
static inline void
virtqueue_disable_intr_split(struct virtqueue *vq)
{
vq->vq_split.ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
}
/**
* Tell the backend not to interrupt us.
*/
@ -338,7 +347,7 @@ virtqueue_disable_intr(struct virtqueue *vq)
if (vtpci_packed_queue(vq->hw))
virtqueue_disable_intr_packed(vq);
else
vq->vq_split.ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
virtqueue_disable_intr_split(vq);
}
/**