mirror of
https://github.com/ipxe/ipxe
synced 2026-02-05 19:12:46 +03:00
[virtio] Cap queue size to MAX_QUEUE_NUM
vpm_find_vqs incorrectly accepted the host provided queue size with no regard to iPXE's internal limitations. Virtio 1.0 makes it possible for the driver to override the queue size to reduce memory requirements and iPXE is a great use case for this feature. Also removing the extra vq->vring.num assignment which is already handled in vring_init. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
dfbbc16ae3
commit
e45451c699
@@ -95,7 +95,7 @@ static inline void vring_init(struct vring *vr,
|
||||
unsigned int i;
|
||||
unsigned long pa;
|
||||
|
||||
vr->num = num;
|
||||
vr->num = num;
|
||||
|
||||
/* physical address of desc must be page aligned */
|
||||
|
||||
@@ -103,13 +103,13 @@ static inline void vring_init(struct vring *vr,
|
||||
pa = (pa + PAGE_MASK) & ~PAGE_MASK;
|
||||
vr->desc = phys_to_virt(pa);
|
||||
|
||||
vr->avail = (struct vring_avail *)&vr->desc[num];
|
||||
vr->avail = (struct vring_avail *)&vr->desc[num];
|
||||
|
||||
/* physical address of used must be page aligned */
|
||||
|
||||
pa = virt_to_phys(&vr->avail->ring[num]);
|
||||
pa = (pa + PAGE_MASK) & ~PAGE_MASK;
|
||||
vr->used = phys_to_virt(pa);
|
||||
vr->used = phys_to_virt(pa);
|
||||
|
||||
for (i = 0; i < num - 1; i++)
|
||||
vr->desc[i].next = i + 1;
|
||||
|
||||
Reference in New Issue
Block a user