Skip to content

Commit 286dd18

Browse files
gaojunhao0504acrnsi
authored andcommitted
dm: virtio: bugfix for polling mode
In vxworks, virtio-console FE driver only initiate 2 virtqueues, but BE creates 2+ virtqueues for it. So the rest of the virtqueues are not initiated. vq->used->flags cannot be used directly without any condition. Tracked-On: #3203 Signed-off-by: Gao Junhao <junhao.gao@intel.com> Reviewed-by: Yu Wang <yu1.wang@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
1 parent 4c09051 commit 286dd18

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

devicemodel/hw/pci/virtio/virtio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ virtio_poll_timer(void *arg, uint64_t nexp)
8686

8787
for (i = 0; i < base->vops->nvq; i++) {
8888
vq = &base->queues[i];
89+
if(!vq_ring_ready(vq))
90+
continue;
8991
vq->used->flags |= VRING_USED_F_NO_NOTIFY;
9092
/* TODO: call notify when necessary */
9193
if (vq->notify)

0 commit comments

Comments
 (0)