[08/10] net/virtio: add interrupt helper for split ring
Checks
Commit Message
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>
---
drivers/net/virtio/virtqueue.h | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
Comments
On Tue, Mar 19, 2019 at 02:43:10PM +0800, Tiwei Bie wrote:
>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>
>---
> drivers/net/virtio/virtqueue.h | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
On 3/19/19 7:43 AM, Tiwei Bie wrote:
> 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>
> ---
> drivers/net/virtio/virtqueue.h | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
@@ -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);
}
/**