summaryrefslogtreecommitdiff
path: root/drivers/vdpa/ifcvf
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2021-03-15 19:34:44 +0300
committerMichael S. Tsirkin <mst@redhat.com>2021-05-03 11:55:53 +0300
commit442706f9f94d28fe3c9f188ae4ebbd6b40addffe (patch)
tree27fbf1922674767f6d4f0b63486b9c6c3f85e940 /drivers/vdpa/ifcvf
parentbc433e5e0d42d7892dcefb65686c9f1df126923a (diff)
downloadlinux-442706f9f94d28fe3c9f188ae4ebbd6b40addffe.tar.xz
vdpa: add get_config_size callback in vdpa_config_ops
This new callback is used to get the size of the configuration space of vDPA devices. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Link: https://lore.kernel.org/r/20210315163450.254396-9-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vdpa/ifcvf')
-rw-r--r--drivers/vdpa/ifcvf/ifcvf_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index a16753f1de5b..44d7586019da 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -351,6 +351,11 @@ static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
return IFCVF_QUEUE_ALIGNMENT;
}
+static size_t ifcvf_vdpa_get_config_size(struct vdpa_device *vdpa_dev)
+{
+ return sizeof(struct virtio_net_config);
+}
+
static void ifcvf_vdpa_get_config(struct vdpa_device *vdpa_dev,
unsigned int offset,
void *buf, unsigned int len)
@@ -411,6 +416,7 @@ static const struct vdpa_config_ops ifc_vdpa_ops = {
.get_device_id = ifcvf_vdpa_get_device_id,
.get_vendor_id = ifcvf_vdpa_get_vendor_id,
.get_vq_align = ifcvf_vdpa_get_vq_align,
+ .get_config_size = ifcvf_vdpa_get_config_size,
.get_config = ifcvf_vdpa_get_config,
.set_config = ifcvf_vdpa_set_config,
.set_config_cb = ifcvf_vdpa_set_config_cb,