]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/virtio/virtqueue.h
net/virtio: add Rx interrupt enable/disable functions
[dpdk.git] / drivers / net / virtio / virtqueue.h
index b1070e0599f79c2fd2a654a1092347b11ee46527..f9e37367675d6d1105884fc79d7c54fa716b7688 100644 (file)
@@ -274,7 +274,21 @@ vring_desc_init(struct vring_desc *dp, uint16_t n)
 /**
  * Tell the backend not to interrupt us.
  */
-void virtqueue_disable_intr(struct virtqueue *vq);
+static inline void
+virtqueue_disable_intr(struct virtqueue *vq)
+{
+       vq->vq_ring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
+}
+
+/**
+ * Tell the backend to interrupt us.
+ */
+static inline void
+virtqueue_enable_intr(struct virtqueue *vq)
+{
+       vq->vq_ring.avail->flags &= (~VRING_AVAIL_F_NO_INTERRUPT);
+}
+
 /**
  *  Dump virtqueue internal structures, for debug purpose only.
  */