Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: Revert "virtio: find_vqs() add arg sizes"

This reverts commit a10fba0377145fccefea4dc4dd5915b7ed87e546: the
proposed API isn't supported on all transports but no
effort was made to address this.

It might not be hard to fix if we want to: maybe just
rename size to size_hint and make sure legacy
transports ignore the hint.

But it's not sure what the benefit is in any case, so
let's drop it.

Fixes: a10fba037714 ("virtio: find_vqs() add arg sizes")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220816053602.173815-8-mst@redhat.com>

+10 -22
+1 -1
arch/um/drivers/virtio_uml.c
··· 1011 1011 1012 1012 static int vu_find_vqs(struct virtio_device *vdev, unsigned nvqs, 1013 1013 struct virtqueue *vqs[], vq_callback_t *callbacks[], 1014 - const char * const names[], u32 sizes[], const bool *ctx, 1014 + const char * const names[], const bool *ctx, 1015 1015 struct irq_affinity *desc) 1016 1016 { 1017 1017 struct virtio_uml_device *vu_dev = to_virtio_uml_device(vdev);
-1
drivers/platform/mellanox/mlxbf-tmfifo.c
··· 928 928 struct virtqueue *vqs[], 929 929 vq_callback_t *callbacks[], 930 930 const char * const names[], 931 - u32 sizes[], 932 931 const bool *ctx, 933 932 struct irq_affinity *desc) 934 933 {
-1
drivers/remoteproc/remoteproc_virtio.c
··· 158 158 struct virtqueue *vqs[], 159 159 vq_callback_t *callbacks[], 160 160 const char * const names[], 161 - u32 sizes[], 162 161 const bool * ctx, 163 162 struct irq_affinity *desc) 164 163 {
-1
drivers/s390/virtio/virtio_ccw.c
··· 637 637 struct virtqueue *vqs[], 638 638 vq_callback_t *callbacks[], 639 639 const char * const names[], 640 - u32 sizes[], 641 640 const bool *ctx, 642 641 struct irq_affinity *desc) 643 642 {
-1
drivers/virtio/virtio_mmio.c
··· 474 474 struct virtqueue *vqs[], 475 475 vq_callback_t *callbacks[], 476 476 const char * const names[], 477 - u32 sizes[], 478 477 const bool *ctx, 479 478 struct irq_affinity *desc) 480 479 {
+1 -1
drivers/virtio/virtio_pci_common.c
··· 396 396 /* the config->find_vqs() implementation */ 397 397 int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, 398 398 struct virtqueue *vqs[], vq_callback_t *callbacks[], 399 - const char * const names[], u32 sizes[], const bool *ctx, 399 + const char * const names[], const bool *ctx, 400 400 struct irq_affinity *desc) 401 401 { 402 402 int err;
+1 -1
drivers/virtio/virtio_pci_common.h
··· 110 110 /* the config->find_vqs() implementation */ 111 111 int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, 112 112 struct virtqueue *vqs[], vq_callback_t *callbacks[], 113 - const char * const names[], u32 sizes[], const bool *ctx, 113 + const char * const names[], const bool *ctx, 114 114 struct irq_affinity *desc); 115 115 const char *vp_bus_name(struct virtio_device *vdev); 116 116
+2 -5
drivers/virtio/virtio_pci_modern.c
··· 347 347 static int vp_modern_find_vqs(struct virtio_device *vdev, unsigned int nvqs, 348 348 struct virtqueue *vqs[], 349 349 vq_callback_t *callbacks[], 350 - const char * const names[], 351 - u32 sizes[], 352 - const bool *ctx, 350 + const char * const names[], const bool *ctx, 353 351 struct irq_affinity *desc) 354 352 { 355 353 struct virtio_pci_device *vp_dev = to_vp_device(vdev); 356 354 struct virtqueue *vq; 357 - int rc = vp_find_vqs(vdev, nvqs, vqs, callbacks, names, sizes, ctx, 358 - desc); 355 + int rc = vp_find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, desc); 359 356 360 357 if (rc) 361 358 return rc;
-1
drivers/virtio/virtio_vdpa.c
··· 269 269 struct virtqueue *vqs[], 270 270 vq_callback_t *callbacks[], 271 271 const char * const names[], 272 - u32 sizes[], 273 272 const bool *ctx, 274 273 struct irq_affinity *desc) 275 274 {
+5 -9
include/linux/virtio_config.h
··· 55 55 * include a NULL entry for vqs that do not need a callback 56 56 * names: array of virtqueue names (mainly for debugging) 57 57 * include a NULL entry for vqs unused by driver 58 - * sizes: array of virtqueue sizes 59 58 * Returns 0 on success or error status 60 59 * @del_vqs: free virtqueues found by find_vqs(). 61 60 * @synchronize_cbs: synchronize with the virtqueue callbacks (optional) ··· 103 104 void (*reset)(struct virtio_device *vdev); 104 105 int (*find_vqs)(struct virtio_device *, unsigned nvqs, 105 106 struct virtqueue *vqs[], vq_callback_t *callbacks[], 106 - const char * const names[], 107 - u32 sizes[], 108 - const bool *ctx, 107 + const char * const names[], const bool *ctx, 109 108 struct irq_affinity *desc); 110 109 void (*del_vqs)(struct virtio_device *); 111 110 void (*synchronize_cbs)(struct virtio_device *); ··· 212 215 const char *names[] = { n }; 213 216 struct virtqueue *vq; 214 217 int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names, NULL, 215 - NULL, NULL); 218 + NULL); 216 219 if (err < 0) 217 220 return ERR_PTR(err); 218 221 return vq; ··· 224 227 const char * const names[], 225 228 struct irq_affinity *desc) 226 229 { 227 - return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, 228 - NULL, desc); 230 + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, desc); 229 231 } 230 232 231 233 static inline ··· 233 237 const char * const names[], const bool *ctx, 234 238 struct irq_affinity *desc) 235 239 { 236 - return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, NULL, 237 - ctx, desc); 240 + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, 241 + desc); 238 242 } 239 243 240 244 /**