aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/lguest/lguest.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 84c471b07c27..20f8253881b3 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -151,6 +151,9 @@ struct virtqueue
151 /* Last available index we saw. */ 151 /* Last available index we saw. */
152 u16 last_avail_idx; 152 u16 last_avail_idx;
153 153
154 /* How many are used since we sent last irq? */
155 unsigned int pending_used;
156
154 /* Eventfd where Guest notifications arrive. */ 157 /* Eventfd where Guest notifications arrive. */
155 int eventfd; 158 int eventfd;
156 159
@@ -556,6 +559,11 @@ static void trigger_irq(struct virtqueue *vq)
556{ 559{
557 unsigned long buf[] = { LHREQ_IRQ, vq->config.irq }; 560 unsigned long buf[] = { LHREQ_IRQ, vq->config.irq };
558 561
562 /* Don't inform them if nothing used. */
563 if (!vq->pending_used)
564 return;
565 vq->pending_used = 0;
566
559 /* If they don't want an interrupt, don't send one, unless empty. */ 567 /* If they don't want an interrupt, don't send one, unless empty. */
560 if ((vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) 568 if ((vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)
561 && lg_last_avail(vq) != vq->vring.avail->idx) 569 && lg_last_avail(vq) != vq->vring.avail->idx)
@@ -647,6 +655,7 @@ static void add_used(struct virtqueue *vq, unsigned int head, int len)
647 /* Make sure buffer is written before we update index. */ 655 /* Make sure buffer is written before we update index. */
648 wmb(); 656 wmb();
649 vq->vring.used->idx++; 657 vq->vring.used->idx++;
658 vq->pending_used++;
650} 659}
651 660
652/* And here's the combo meal deal. Supersize me! */ 661/* And here's the combo meal deal. Supersize me! */