diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-12-03 11:01:58 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-12-09 14:42:02 -0500 |
commit | f30eaf4a09482c8dad0f65c616de10a2321839c9 (patch) | |
tree | a2fa0d476f8c7aa0c7d9a53fe1a762b5e88b1b49 | |
parent | 3ec7a77bb3089bb01032fdbd958eb5c29da58b49 (diff) |
virtio_pci: use priv for vq notification
slightly reduce the amount of pointer chasing this needs to do.
More importantly, this will easily generalize to virtio 1.0.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | drivers/virtio/virtio_pci.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 6a7b8bff51e5..7b82eb5c0c5a 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c | |||
@@ -204,11 +204,9 @@ static void vp_reset(struct virtio_device *vdev) | |||
204 | /* the notify function used when creating a virt queue */ | 204 | /* the notify function used when creating a virt queue */ |
205 | static bool vp_notify(struct virtqueue *vq) | 205 | static bool vp_notify(struct virtqueue *vq) |
206 | { | 206 | { |
207 | struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); | ||
208 | |||
209 | /* we write the queue's selector into the notification register to | 207 | /* we write the queue's selector into the notification register to |
210 | * signal the other end */ | 208 | * signal the other end */ |
211 | iowrite16(vq->index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY); | 209 | iowrite16(vq->index, (void __iomem *)vq->priv); |
212 | return true; | 210 | return true; |
213 | } | 211 | } |
214 | 212 | ||
@@ -437,6 +435,7 @@ static struct virtqueue *setup_vq(struct virtio_device *vdev, unsigned index, | |||
437 | goto out_activate_queue; | 435 | goto out_activate_queue; |
438 | } | 436 | } |
439 | 437 | ||
438 | vq->priv = (void __force *)vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY; | ||
440 | info->vq = vq; | 439 | info->vq = vq; |
441 | 440 | ||
442 | if (msix_vec != VIRTIO_MSI_NO_VECTOR) { | 441 | if (msix_vec != VIRTIO_MSI_NO_VECTOR) { |