diff options
author | Christoph Hellwig <hch@lst.de> | 2017-02-05 12:15:22 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2017-02-27 13:54:04 -0500 |
commit | fb5e31d970ce8b4941f03ed765d7dbefc39f22d9 (patch) | |
tree | f7b64532549f35aad0933fae46346e59151d3a71 | |
parent | 52a61516125fa9a21b3bdf4f90928308e2e5573f (diff) |
virtio: allow drivers to request IRQ affinity when creating VQs
Add a struct irq_affinity pointer to the find_vqs methods, which if set
is used to tell the PCI layer to create the MSI-X vectors for our I/O
virtqueues with the proper affinity from the start. Compared to after
the fact affinity hints this gives us an instantly working setup and
allows to allocate the irq descritors node-local and avoid interconnect
traffic. Last but not least this will allow blk-mq queues are created
based on the interrupt affinity for storage drivers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | drivers/block/virtio_blk.c | 3 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 2 | ||||
-rw-r--r-- | drivers/crypto/virtio/virtio_crypto_core.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_kms.c | 2 | ||||
-rw-r--r-- | drivers/misc/mic/vop/vop_main.c | 2 | ||||
-rw-r--r-- | drivers/net/caif/caif_virtio.c | 3 | ||||
-rw-r--r-- | drivers/net/virtio_net.c | 2 | ||||
-rw-r--r-- | drivers/remoteproc/remoteproc_virtio.c | 3 | ||||
-rw-r--r-- | drivers/rpmsg/virtio_rpmsg_bus.c | 2 | ||||
-rw-r--r-- | drivers/s390/virtio/kvm_virtio.c | 3 | ||||
-rw-r--r-- | drivers/s390/virtio/virtio_ccw.c | 3 | ||||
-rw-r--r-- | drivers/scsi/virtio_scsi.c | 3 | ||||
-rw-r--r-- | drivers/virtio/virtio_balloon.c | 3 | ||||
-rw-r--r-- | drivers/virtio/virtio_input.c | 3 | ||||
-rw-r--r-- | drivers/virtio/virtio_mmio.c | 3 | ||||
-rw-r--r-- | drivers/virtio/virtio_pci_common.c | 19 | ||||
-rw-r--r-- | drivers/virtio/virtio_pci_common.h | 5 | ||||
-rw-r--r-- | drivers/virtio/virtio_pci_modern.c | 7 | ||||
-rw-r--r-- | include/linux/virtio_config.h | 9 | ||||
-rw-r--r-- | net/vmw_vsock/virtio_transport.c | 3 |
20 files changed, 48 insertions, 34 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 10332c24f961..c54118bdc67d 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c | |||
@@ -411,7 +411,8 @@ static int init_vq(struct virtio_blk *vblk) | |||
411 | } | 411 | } |
412 | 412 | ||
413 | /* Discover virtqueues and write information to configuration. */ | 413 | /* Discover virtqueues and write information to configuration. */ |
414 | err = vdev->config->find_vqs(vdev, num_vqs, vqs, callbacks, names); | 414 | err = vdev->config->find_vqs(vdev, num_vqs, vqs, callbacks, names, |
415 | NULL); | ||
415 | if (err) | 416 | if (err) |
416 | goto out; | 417 | goto out; |
417 | 418 | ||
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 17857beb4892..6266c0568e1d 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -1939,7 +1939,7 @@ static int init_vqs(struct ports_device *portdev) | |||
1939 | /* Find the queues. */ | 1939 | /* Find the queues. */ |
1940 | err = portdev->vdev->config->find_vqs(portdev->vdev, nr_queues, vqs, | 1940 | err = portdev->vdev->config->find_vqs(portdev->vdev, nr_queues, vqs, |
1941 | io_callbacks, | 1941 | io_callbacks, |
1942 | (const char **)io_names); | 1942 | (const char **)io_names, NULL); |
1943 | if (err) | 1943 | if (err) |
1944 | goto free; | 1944 | goto free; |
1945 | 1945 | ||
diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c index fe70ec823b27..0aa2f045543b 100644 --- a/drivers/crypto/virtio/virtio_crypto_core.c +++ b/drivers/crypto/virtio/virtio_crypto_core.c | |||
@@ -119,7 +119,7 @@ static int virtcrypto_find_vqs(struct virtio_crypto *vi) | |||
119 | } | 119 | } |
120 | 120 | ||
121 | ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks, | 121 | ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks, |
122 | names); | 122 | names, NULL); |
123 | if (ret) | 123 | if (ret) |
124 | goto err_find; | 124 | goto err_find; |
125 | 125 | ||
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index 1235519853f4..e975fa5b0a32 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c | |||
@@ -172,7 +172,7 @@ int virtio_gpu_driver_load(struct drm_device *dev, unsigned long flags) | |||
172 | vgdev->has_virgl_3d ? "enabled" : "not available"); | 172 | vgdev->has_virgl_3d ? "enabled" : "not available"); |
173 | 173 | ||
174 | ret = vgdev->vdev->config->find_vqs(vgdev->vdev, 2, vqs, | 174 | ret = vgdev->vdev->config->find_vqs(vgdev->vdev, 2, vqs, |
175 | callbacks, names); | 175 | callbacks, names, NULL); |
176 | if (ret) { | 176 | if (ret) { |
177 | DRM_ERROR("failed to find virt queues\n"); | 177 | DRM_ERROR("failed to find virt queues\n"); |
178 | goto err_vqs; | 178 | goto err_vqs; |
diff --git a/drivers/misc/mic/vop/vop_main.c b/drivers/misc/mic/vop/vop_main.c index 1a2b67f3183d..c2e29d7f0de8 100644 --- a/drivers/misc/mic/vop/vop_main.c +++ b/drivers/misc/mic/vop/vop_main.c | |||
@@ -374,7 +374,7 @@ unmap: | |||
374 | static int vop_find_vqs(struct virtio_device *dev, unsigned nvqs, | 374 | static int vop_find_vqs(struct virtio_device *dev, unsigned nvqs, |
375 | struct virtqueue *vqs[], | 375 | struct virtqueue *vqs[], |
376 | vq_callback_t *callbacks[], | 376 | vq_callback_t *callbacks[], |
377 | const char * const names[]) | 377 | const char * const names[], struct irq_affinity *desc) |
378 | { | 378 | { |
379 | struct _vop_vdev *vdev = to_vopvdev(dev); | 379 | struct _vop_vdev *vdev = to_vopvdev(dev); |
380 | struct vop_device *vpdev = vdev->vpdev; | 380 | struct vop_device *vpdev = vdev->vpdev; |
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index b306210b02b7..bc0eb47eccee 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c | |||
@@ -679,7 +679,8 @@ static int cfv_probe(struct virtio_device *vdev) | |||
679 | goto err; | 679 | goto err; |
680 | 680 | ||
681 | /* Get the TX virtio ring. This is a "guest side vring". */ | 681 | /* Get the TX virtio ring. This is a "guest side vring". */ |
682 | err = vdev->config->find_vqs(vdev, 1, &cfv->vq_tx, &vq_cbs, &names); | 682 | err = vdev->config->find_vqs(vdev, 1, &cfv->vq_tx, &vq_cbs, &names, |
683 | NULL); | ||
683 | if (err) | 684 | if (err) |
684 | goto err; | 685 | goto err; |
685 | 686 | ||
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 765c2d6358da..9be74c2dfb22 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -2003,7 +2003,7 @@ static int virtnet_find_vqs(struct virtnet_info *vi) | |||
2003 | } | 2003 | } |
2004 | 2004 | ||
2005 | ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks, | 2005 | ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks, |
2006 | names); | 2006 | names, NULL); |
2007 | if (ret) | 2007 | if (ret) |
2008 | goto err_find; | 2008 | goto err_find; |
2009 | 2009 | ||
diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index 364411fb7734..0142cc3f0c91 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c | |||
@@ -137,7 +137,8 @@ static void rproc_virtio_del_vqs(struct virtio_device *vdev) | |||
137 | static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs, | 137 | static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs, |
138 | struct virtqueue *vqs[], | 138 | struct virtqueue *vqs[], |
139 | vq_callback_t *callbacks[], | 139 | vq_callback_t *callbacks[], |
140 | const char * const names[]) | 140 | const char * const names[], |
141 | struct irq_affinity *desc) | ||
141 | { | 142 | { |
142 | int i, ret; | 143 | int i, ret; |
143 | 144 | ||
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 3090b0d3072f..5e66e081027e 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c | |||
@@ -869,7 +869,7 @@ static int rpmsg_probe(struct virtio_device *vdev) | |||
869 | init_waitqueue_head(&vrp->sendq); | 869 | init_waitqueue_head(&vrp->sendq); |
870 | 870 | ||
871 | /* We expect two virtqueues, rx and tx (and in this order) */ | 871 | /* We expect two virtqueues, rx and tx (and in this order) */ |
872 | err = vdev->config->find_vqs(vdev, 2, vqs, vq_cbs, names); | 872 | err = vdev->config->find_vqs(vdev, 2, vqs, vq_cbs, names, NULL); |
873 | if (err) | 873 | if (err) |
874 | goto free_vrp; | 874 | goto free_vrp; |
875 | 875 | ||
diff --git a/drivers/s390/virtio/kvm_virtio.c b/drivers/s390/virtio/kvm_virtio.c index 5e5c11f37b24..2ce0b3eb2efe 100644 --- a/drivers/s390/virtio/kvm_virtio.c +++ b/drivers/s390/virtio/kvm_virtio.c | |||
@@ -255,7 +255,8 @@ static void kvm_del_vqs(struct virtio_device *vdev) | |||
255 | static int kvm_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 255 | static int kvm_find_vqs(struct virtio_device *vdev, unsigned nvqs, |
256 | struct virtqueue *vqs[], | 256 | struct virtqueue *vqs[], |
257 | vq_callback_t *callbacks[], | 257 | vq_callback_t *callbacks[], |
258 | const char * const names[]) | 258 | const char * const names[], |
259 | struct irq_affinity *desc) | ||
259 | { | 260 | { |
260 | struct kvm_device *kdev = to_kvmdev(vdev); | 261 | struct kvm_device *kdev = to_kvmdev(vdev); |
261 | int i; | 262 | int i; |
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 070c4da95f48..304d3b3cbfd3 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c | |||
@@ -628,7 +628,8 @@ out: | |||
628 | static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 628 | static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, |
629 | struct virtqueue *vqs[], | 629 | struct virtqueue *vqs[], |
630 | vq_callback_t *callbacks[], | 630 | vq_callback_t *callbacks[], |
631 | const char * const names[]) | 631 | const char * const names[], |
632 | struct irq_affinity *desc) | ||
632 | { | 633 | { |
633 | struct virtio_ccw_device *vcdev = to_vc_device(vdev); | 634 | struct virtio_ccw_device *vcdev = to_vc_device(vdev); |
634 | unsigned long *indicatorp = NULL; | 635 | unsigned long *indicatorp = NULL; |
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index c680d7641311..c9c5ea0611e9 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c | |||
@@ -941,7 +941,8 @@ static int virtscsi_init(struct virtio_device *vdev, | |||
941 | } | 941 | } |
942 | 942 | ||
943 | /* Discover virtqueues and write information to configuration. */ | 943 | /* Discover virtqueues and write information to configuration. */ |
944 | err = vdev->config->find_vqs(vdev, num_vqs, vqs, callbacks, names); | 944 | err = vdev->config->find_vqs(vdev, num_vqs, vqs, callbacks, names, |
945 | NULL); | ||
945 | if (err) | 946 | if (err) |
946 | goto out; | 947 | goto out; |
947 | 948 | ||
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 181793f07852..36c9c8fcb7f8 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -413,7 +413,8 @@ static int init_vqs(struct virtio_balloon *vb) | |||
413 | * optionally stat. | 413 | * optionally stat. |
414 | */ | 414 | */ |
415 | nvqs = virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ) ? 3 : 2; | 415 | nvqs = virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_STATS_VQ) ? 3 : 2; |
416 | err = vb->vdev->config->find_vqs(vb->vdev, nvqs, vqs, callbacks, names); | 416 | err = vb->vdev->config->find_vqs(vb->vdev, nvqs, vqs, callbacks, names, |
417 | NULL); | ||
417 | if (err) | 418 | if (err) |
418 | return err; | 419 | return err; |
419 | 420 | ||
diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c index 350a2a5a49db..79f1293cda93 100644 --- a/drivers/virtio/virtio_input.c +++ b/drivers/virtio/virtio_input.c | |||
@@ -173,7 +173,8 @@ static int virtinput_init_vqs(struct virtio_input *vi) | |||
173 | static const char * const names[] = { "events", "status" }; | 173 | static const char * const names[] = { "events", "status" }; |
174 | int err; | 174 | int err; |
175 | 175 | ||
176 | err = vi->vdev->config->find_vqs(vi->vdev, 2, vqs, cbs, names); | 176 | err = vi->vdev->config->find_vqs(vi->vdev, 2, vqs, cbs, names, |
177 | NULL); | ||
177 | if (err) | 178 | if (err) |
178 | return err; | 179 | return err; |
179 | vi->evt = vqs[0]; | 180 | vi->evt = vqs[0]; |
diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 08357d70a891..78343b8f9034 100644 --- a/drivers/virtio/virtio_mmio.c +++ b/drivers/virtio/virtio_mmio.c | |||
@@ -446,7 +446,8 @@ error_available: | |||
446 | static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 446 | static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, |
447 | struct virtqueue *vqs[], | 447 | struct virtqueue *vqs[], |
448 | vq_callback_t *callbacks[], | 448 | vq_callback_t *callbacks[], |
449 | const char * const names[]) | 449 | const char * const names[], |
450 | struct irq_affinity *desc) | ||
450 | { | 451 | { |
451 | struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); | 452 | struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); |
452 | unsigned int irq = platform_get_irq(vm_dev->pdev, 0); | 453 | unsigned int irq = platform_get_irq(vm_dev->pdev, 0); |
diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index 822f8e5dcee4..7902e920fc73 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c | |||
@@ -143,22 +143,28 @@ void vp_del_vqs(struct virtio_device *vdev) | |||
143 | 143 | ||
144 | static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, | 144 | static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, |
145 | struct virtqueue *vqs[], vq_callback_t *callbacks[], | 145 | struct virtqueue *vqs[], vq_callback_t *callbacks[], |
146 | const char * const names[]) | 146 | const char * const names[], struct irq_affinity *desc) |
147 | { | 147 | { |
148 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); | 148 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); |
149 | const char *name = dev_name(&vp_dev->vdev.dev); | 149 | const char *name = dev_name(&vp_dev->vdev.dev); |
150 | int i, err = -ENOMEM, allocated_vectors, nvectors; | 150 | int i, err = -ENOMEM, allocated_vectors, nvectors; |
151 | unsigned flags = PCI_IRQ_MSIX; | ||
151 | bool shared = false; | 152 | bool shared = false; |
152 | u16 msix_vec; | 153 | u16 msix_vec; |
153 | 154 | ||
155 | if (desc) { | ||
156 | flags |= PCI_IRQ_AFFINITY; | ||
157 | desc->pre_vectors++; /* virtio config vector */ | ||
158 | } | ||
159 | |||
154 | nvectors = 1; | 160 | nvectors = 1; |
155 | for (i = 0; i < nvqs; i++) | 161 | for (i = 0; i < nvqs; i++) |
156 | if (callbacks[i]) | 162 | if (callbacks[i]) |
157 | nvectors++; | 163 | nvectors++; |
158 | 164 | ||
159 | /* Try one vector per queue first. */ | 165 | /* Try one vector per queue first. */ |
160 | err = pci_alloc_irq_vectors(vp_dev->pci_dev, nvectors, nvectors, | 166 | err = pci_alloc_irq_vectors_affinity(vp_dev->pci_dev, nvectors, |
161 | PCI_IRQ_MSIX); | 167 | nvectors, flags, desc); |
162 | if (err < 0) { | 168 | if (err < 0) { |
163 | /* Fallback to one vector for config, one shared for queues. */ | 169 | /* Fallback to one vector for config, one shared for queues. */ |
164 | shared = true; | 170 | shared = true; |
@@ -308,13 +314,12 @@ out_remove_vqs: | |||
308 | 314 | ||
309 | /* the config->find_vqs() implementation */ | 315 | /* the config->find_vqs() implementation */ |
310 | int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 316 | int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, |
311 | struct virtqueue *vqs[], | 317 | struct virtqueue *vqs[], vq_callback_t *callbacks[], |
312 | vq_callback_t *callbacks[], | 318 | const char * const names[], struct irq_affinity *desc) |
313 | const char * const names[]) | ||
314 | { | 319 | { |
315 | int err; | 320 | int err; |
316 | 321 | ||
317 | err = vp_find_vqs_msix(vdev, nvqs, vqs, callbacks, names); | 322 | err = vp_find_vqs_msix(vdev, nvqs, vqs, callbacks, names, desc); |
318 | if (!err) | 323 | if (!err) |
319 | return 0; | 324 | return 0; |
320 | return vp_find_vqs_intx(vdev, nvqs, vqs, callbacks, names); | 325 | return vp_find_vqs_intx(vdev, nvqs, vqs, callbacks, names); |
diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h index 217ca876eed7..a6ad9ec6baef 100644 --- a/drivers/virtio/virtio_pci_common.h +++ b/drivers/virtio/virtio_pci_common.h | |||
@@ -97,9 +97,8 @@ bool vp_notify(struct virtqueue *vq); | |||
97 | void vp_del_vqs(struct virtio_device *vdev); | 97 | void vp_del_vqs(struct virtio_device *vdev); |
98 | /* the config->find_vqs() implementation */ | 98 | /* the config->find_vqs() implementation */ |
99 | int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 99 | int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, |
100 | struct virtqueue *vqs[], | 100 | struct virtqueue *vqs[], vq_callback_t *callbacks[], |
101 | vq_callback_t *callbacks[], | 101 | const char * const names[], struct irq_affinity *desc); |
102 | const char * const names[]); | ||
103 | const char *vp_bus_name(struct virtio_device *vdev); | 102 | const char *vp_bus_name(struct virtio_device *vdev); |
104 | 103 | ||
105 | /* Setup the affinity for a virtqueue: | 104 | /* Setup the affinity for a virtqueue: |
diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index e5ce31091953..a7a0981e441c 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/drivers/virtio/virtio_pci_modern.c | |||
@@ -384,13 +384,12 @@ err_map_notify: | |||
384 | } | 384 | } |
385 | 385 | ||
386 | static int vp_modern_find_vqs(struct virtio_device *vdev, unsigned nvqs, | 386 | static int vp_modern_find_vqs(struct virtio_device *vdev, unsigned nvqs, |
387 | struct virtqueue *vqs[], | 387 | struct virtqueue *vqs[], vq_callback_t *callbacks[], |
388 | vq_callback_t *callbacks[], | 388 | const char * const names[], struct irq_affinity *desc) |
389 | const char * const names[]) | ||
390 | { | 389 | { |
391 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); | 390 | struct virtio_pci_device *vp_dev = to_vp_device(vdev); |
392 | struct virtqueue *vq; | 391 | struct virtqueue *vq; |
393 | int rc = vp_find_vqs(vdev, nvqs, vqs, callbacks, names); | 392 | int rc = vp_find_vqs(vdev, nvqs, vqs, callbacks, names, desc); |
394 | 393 | ||
395 | if (rc) | 394 | if (rc) |
396 | return rc; | 395 | return rc; |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 26c155bb639b..2ebe506fe41a 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #include <linux/virtio_byteorder.h> | 7 | #include <linux/virtio_byteorder.h> |
8 | #include <uapi/linux/virtio_config.h> | 8 | #include <uapi/linux/virtio_config.h> |
9 | 9 | ||
10 | struct irq_affinity; | ||
11 | |||
10 | /** | 12 | /** |
11 | * virtio_config_ops - operations for configuring a virtio device | 13 | * virtio_config_ops - operations for configuring a virtio device |
12 | * @get: read the value of a configuration field | 14 | * @get: read the value of a configuration field |
@@ -68,9 +70,8 @@ struct virtio_config_ops { | |||
68 | void (*set_status)(struct virtio_device *vdev, u8 status); | 70 | void (*set_status)(struct virtio_device *vdev, u8 status); |
69 | void (*reset)(struct virtio_device *vdev); | 71 | void (*reset)(struct virtio_device *vdev); |
70 | int (*find_vqs)(struct virtio_device *, unsigned nvqs, | 72 | int (*find_vqs)(struct virtio_device *, unsigned nvqs, |
71 | struct virtqueue *vqs[], | 73 | struct virtqueue *vqs[], vq_callback_t *callbacks[], |
72 | vq_callback_t *callbacks[], | 74 | const char * const names[], struct irq_affinity *desc); |
73 | const char * const names[]); | ||
74 | void (*del_vqs)(struct virtio_device *); | 75 | void (*del_vqs)(struct virtio_device *); |
75 | u64 (*get_features)(struct virtio_device *vdev); | 76 | u64 (*get_features)(struct virtio_device *vdev); |
76 | int (*finalize_features)(struct virtio_device *vdev); | 77 | int (*finalize_features)(struct virtio_device *vdev); |
@@ -169,7 +170,7 @@ struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev, | |||
169 | vq_callback_t *callbacks[] = { c }; | 170 | vq_callback_t *callbacks[] = { c }; |
170 | const char *names[] = { n }; | 171 | const char *names[] = { n }; |
171 | struct virtqueue *vq; | 172 | struct virtqueue *vq; |
172 | int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names); | 173 | int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names, NULL); |
173 | if (err < 0) | 174 | if (err < 0) |
174 | return ERR_PTR(err); | 175 | return ERR_PTR(err); |
175 | return vq; | 176 | return vq; |
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 6788264acc63..9d24c0e958b1 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c | |||
@@ -532,7 +532,8 @@ static int virtio_vsock_probe(struct virtio_device *vdev) | |||
532 | vsock->vdev = vdev; | 532 | vsock->vdev = vdev; |
533 | 533 | ||
534 | ret = vsock->vdev->config->find_vqs(vsock->vdev, VSOCK_VQ_MAX, | 534 | ret = vsock->vdev->config->find_vqs(vsock->vdev, VSOCK_VQ_MAX, |
535 | vsock->vqs, callbacks, names); | 535 | vsock->vqs, callbacks, names, |
536 | NULL); | ||
536 | if (ret < 0) | 537 | if (ret < 0) |
537 | goto out; | 538 | goto out; |
538 | 539 | ||