File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -356,7 +356,24 @@ static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
356
356
357
357
static size_t ifcvf_vdpa_get_config_size (struct vdpa_device * vdpa_dev )
358
358
{
359
- return sizeof (struct virtio_net_config );
359
+ struct ifcvf_adapter * adapter = vdpa_to_adapter (vdpa_dev );
360
+ struct ifcvf_hw * vf = vdpa_to_vf (vdpa_dev );
361
+ struct pci_dev * pdev = adapter -> pdev ;
362
+ size_t size ;
363
+
364
+ switch (vf -> dev_type ) {
365
+ case VIRTIO_ID_NET :
366
+ size = sizeof (struct virtio_net_config );
367
+ break ;
368
+ case VIRTIO_ID_BLOCK :
369
+ size = sizeof (struct virtio_blk_config );
370
+ break ;
371
+ default :
372
+ size = 0 ;
373
+ IFCVF_ERR (pdev , "VIRTIO ID %u not supported\n" , vf -> dev_type );
374
+ }
375
+
376
+ return size ;
360
377
}
361
378
362
379
static void ifcvf_vdpa_get_config (struct vdpa_device * vdpa_dev ,
You can’t perform that action at this time.
0 commit comments