Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123975
b: refs/heads/master
c: 498af14
h: refs/heads/master
i:
  123973: d5692cc
  123971: bc4b406
  123967: 8723461
v: v3
  • Loading branch information
Rusty Russell committed Dec 29, 2008
1 parent 490a43b commit 48b3509
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f0d1d7f2286c8a02dab69f5f0bd51681fab161e
refs/heads/master: 498af14783935af487d17dbee4ac451783cbc2b7
4 changes: 2 additions & 2 deletions trunk/drivers/virtio/virtio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
info->queue_index = index;
info->num = num;

size = PAGE_ALIGN(vring_size(num, PAGE_SIZE));
size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN));
info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO);
if (info->queue == NULL) {
err = -ENOMEM;
Expand Down Expand Up @@ -290,7 +290,7 @@ static void vp_del_vq(struct virtqueue *vq)
iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);
iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);

size = PAGE_ALIGN(vring_size(info->num, PAGE_SIZE));
size = PAGE_ALIGN(vring_size(info->num, VIRTIO_PCI_VRING_ALIGN));
free_pages_exact(info->queue, size);
kfree(info);
}
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/virtio_pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@
/* How many bits to shift physical queue address written to QUEUE_PFN.
* 12 is historical, and due to x86 page size. */
#define VIRTIO_PCI_QUEUE_ADDR_SHIFT 12

/* The alignment to use between consumer and producer parts of vring.
* x86 pagesize again. */
#define VIRTIO_PCI_VRING_ALIGN 4096
#endif

0 comments on commit 48b3509

Please sign in to comment.