From: Tiwei Bie Date: Tue, 19 Mar 2019 06:43:10 +0000 (+0800) Subject: net/virtio: add interrupt helper for split ring X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=13cd890d0105c3ffde3e62ed069cfa913eec5b3c;p=dpdk.git 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 Reviewed-by: Jens Freimann Reviewed-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h index 6dab7db8e0..5cea7cb4a2 100644 --- a/drivers/net/virtio/virtqueue.h +++ b/drivers/net/virtio/virtqueue.h @@ -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); } /**