diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-13 00:27:01 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-06-12 08:57:02 -0400 |
commit | ebf9a5a99c1a464afe0b4dfa64416fc8b273bc5c (patch) | |
tree | b5f0631172db5d97e0a5c6b8a6bc0f83c4a4eed5 /Documentation/lguest | |
parent | a6c372de6e4b9a8188b66badcee3e3792eccdd26 (diff) |
lguest: remove invalid interrupt forcing logic.
20887611523e749d99cc7d64ff6c97d27529fbae (lguest: notify on empty) introduced
lguest support for the VIRTIO_F_NOTIFY_ON_EMPTY flag, but in fact it turned on
interrupts all the time.
Because we always process one buffer at a time, the inflight count is always 0
when call trigger_irq and so we always ignore VRING_AVAIL_F_NO_INTERRUPT from
the Guest.
It should be looking to see if there are more buffers in the Guest's queue:
if it's empty, then we force an interrupt.
This makes little difference, since we usually have an empty queue; but
that's the subject of another patch.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'Documentation/lguest')
-rw-r--r-- | Documentation/lguest/lguest.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 1e31d1ec12a3..9f3240c45718 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
@@ -172,9 +172,6 @@ struct virtqueue | |||
172 | /* The routine to call when the Guest pings us, or timeout. */ | 172 | /* The routine to call when the Guest pings us, or timeout. */ |
173 | void (*handle_output)(struct virtqueue *me, bool timeout); | 173 | void (*handle_output)(struct virtqueue *me, bool timeout); |
174 | 174 | ||
175 | /* Outstanding buffers */ | ||
176 | unsigned int inflight; | ||
177 | |||
178 | /* Is this blocked awaiting a timer? */ | 175 | /* Is this blocked awaiting a timer? */ |
179 | bool blocked; | 176 | bool blocked; |
180 | }; | 177 | }; |
@@ -699,7 +696,6 @@ static unsigned get_vq_desc(struct virtqueue *vq, | |||
699 | errx(1, "Looped descriptor"); | 696 | errx(1, "Looped descriptor"); |
700 | } while ((i = next_desc(vq, i)) != vq->vring.num); | 697 | } while ((i = next_desc(vq, i)) != vq->vring.num); |
701 | 698 | ||
702 | vq->inflight++; | ||
703 | return head; | 699 | return head; |
704 | } | 700 | } |
705 | 701 | ||
@@ -717,7 +713,6 @@ static void add_used(struct virtqueue *vq, unsigned int head, int len) | |||
717 | /* Make sure buffer is written before we update index. */ | 713 | /* Make sure buffer is written before we update index. */ |
718 | wmb(); | 714 | wmb(); |
719 | vq->vring.used->idx++; | 715 | vq->vring.used->idx++; |
720 | vq->inflight--; | ||
721 | } | 716 | } |
722 | 717 | ||
723 | /* This actually sends the interrupt for this virtqueue */ | 718 | /* This actually sends the interrupt for this virtqueue */ |
@@ -727,7 +722,7 @@ static void trigger_irq(struct virtqueue *vq) | |||
727 | 722 | ||
728 | /* If they don't want an interrupt, don't send one, unless empty. */ | 723 | /* If they don't want an interrupt, don't send one, unless empty. */ |
729 | if ((vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) | 724 | if ((vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT) |
730 | && vq->inflight) | 725 | && lg_last_avail(vq) != vq->vring.avail->idx) |
731 | return; | 726 | return; |
732 | 727 | ||
733 | /* Send the Guest an interrupt tell them we used something up. */ | 728 | /* Send the Guest an interrupt tell them we used something up. */ |
@@ -1171,7 +1166,6 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
1171 | vq->next = NULL; | 1166 | vq->next = NULL; |
1172 | vq->last_avail_idx = 0; | 1167 | vq->last_avail_idx = 0; |
1173 | vq->dev = dev; | 1168 | vq->dev = dev; |
1174 | vq->inflight = 0; | ||
1175 | vq->blocked = false; | 1169 | vq->blocked = false; |
1176 | 1170 | ||
1177 | /* Initialize the configuration. */ | 1171 | /* Initialize the configuration. */ |