@@ -174,6 +174,7 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,
174
174
static struct virtqueue * vp_setup_vq (struct virtio_device * vdev , unsigned int index ,
175
175
void (* callback )(struct virtqueue * vq ),
176
176
const char * name ,
177
+ u32 size ,
177
178
bool ctx ,
178
179
u16 msix_vec )
179
180
{
@@ -186,7 +187,7 @@ static struct virtqueue *vp_setup_vq(struct virtio_device *vdev, unsigned int in
186
187
if (!info )
187
188
return ERR_PTR (- ENOMEM );
188
189
189
- vq = vp_dev -> setup_vq (vp_dev , info , index , callback , name , ctx ,
190
+ vq = vp_dev -> setup_vq (vp_dev , info , index , callback , name , size , ctx ,
190
191
msix_vec );
191
192
if (IS_ERR (vq ))
192
193
goto out_info ;
@@ -283,7 +284,7 @@ void vp_del_vqs(struct virtio_device *vdev)
283
284
284
285
static int vp_find_vqs_msix (struct virtio_device * vdev , unsigned int nvqs ,
285
286
struct virtqueue * vqs [], vq_callback_t * callbacks [],
286
- const char * const names [], bool per_vq_vectors ,
287
+ const char * const names [], u32 sizes [], bool per_vq_vectors ,
287
288
const bool * ctx ,
288
289
struct irq_affinity * desc )
289
290
{
@@ -326,8 +327,8 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs,
326
327
else
327
328
msix_vec = VP_MSIX_VQ_VECTOR ;
328
329
vqs [i ] = vp_setup_vq (vdev , queue_idx ++ , callbacks [i ], names [i ],
329
- ctx ? ctx [i ] : false ,
330
- msix_vec );
330
+ sizes ? sizes [i ] : 0 ,
331
+ ctx ? ctx [ i ] : false, msix_vec );
331
332
if (IS_ERR (vqs [i ])) {
332
333
err = PTR_ERR (vqs [i ]);
333
334
goto error_find ;
@@ -357,7 +358,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned int nvqs,
357
358
358
359
static int vp_find_vqs_intx (struct virtio_device * vdev , unsigned int nvqs ,
359
360
struct virtqueue * vqs [], vq_callback_t * callbacks [],
360
- const char * const names [], const bool * ctx )
361
+ const char * const names [], u32 sizes [], const bool * ctx )
361
362
{
362
363
struct virtio_pci_device * vp_dev = to_vp_device (vdev );
363
364
int i , err , queue_idx = 0 ;
@@ -379,6 +380,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned int nvqs,
379
380
continue ;
380
381
}
381
382
vqs [i ] = vp_setup_vq (vdev , queue_idx ++ , callbacks [i ], names [i ],
383
+ sizes ? sizes [i ] : 0 ,
382
384
ctx ? ctx [i ] : false,
383
385
VIRTIO_MSI_NO_VECTOR );
384
386
if (IS_ERR (vqs [i ])) {
@@ -402,15 +404,15 @@ int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
402
404
int err ;
403
405
404
406
/* Try MSI-X with one vector per queue. */
405
- err = vp_find_vqs_msix (vdev , nvqs , vqs , callbacks , names , true, ctx , desc );
407
+ err = vp_find_vqs_msix (vdev , nvqs , vqs , callbacks , names , sizes , true, ctx , desc );
406
408
if (!err )
407
409
return 0 ;
408
410
/* Fallback: MSI-X with one vector for config, one shared for queues. */
409
- err = vp_find_vqs_msix (vdev , nvqs , vqs , callbacks , names , false, ctx , desc );
411
+ err = vp_find_vqs_msix (vdev , nvqs , vqs , callbacks , names , sizes , false, ctx , desc );
410
412
if (!err )
411
413
return 0 ;
412
414
/* Finally fall back to regular interrupts. */
413
- return vp_find_vqs_intx (vdev , nvqs , vqs , callbacks , names , ctx );
415
+ return vp_find_vqs_intx (vdev , nvqs , vqs , callbacks , names , sizes , ctx );
414
416
}
415
417
416
418
const char * vp_bus_name (struct virtio_device * vdev )
0 commit comments