vdpa: allow a 32 bit vq alignment
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 9 Apr 2020 20:26:21 +0000 (16:26 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 17 Apr 2020 10:05:30 +0000 (06:05 -0400)
get_vq_align returns u16 now, but that's not enough for
systems/devices with 64K pages. All callers assign it to
a u32 variable anyway, so let's just change the return
value type to u32.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/ifcvf/ifcvf_main.c
drivers/vdpa/vdpa_sim/vdpa_sim.c
include/linux/vdpa.h

index 28d9e5d..abf6a06 100644 (file)
@@ -226,7 +226,7 @@ static u32 ifcvf_vdpa_get_vendor_id(struct vdpa_device *vdpa_dev)
        return IFCVF_SUBSYS_VENDOR_ID;
 }
 
-static u16 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
+static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
 {
        return IFCVF_QUEUE_ALIGNMENT;
 }
index 72863d0..7957d2d 100644 (file)
@@ -435,7 +435,7 @@ static u64 vdpasim_get_vq_state(struct vdpa_device *vdpa, u16 idx)
        return vrh->last_avail_idx;
 }
 
-static u16 vdpasim_get_vq_align(struct vdpa_device *vdpa)
+static u32 vdpasim_get_vq_align(struct vdpa_device *vdpa)
 {
        return VDPASIM_QUEUE_ALIGN;
 }
index 733acfb..5453af8 100644 (file)
@@ -164,7 +164,7 @@ struct vdpa_config_ops {
        u64 (*get_vq_state)(struct vdpa_device *vdev, u16 idx);
 
        /* Device ops */
-       u16 (*get_vq_align)(struct vdpa_device *vdev);
+       u32 (*get_vq_align)(struct vdpa_device *vdev);
        u64 (*get_features)(struct vdpa_device *vdev);
        int (*set_features)(struct vdpa_device *vdev, u64 features);
        void (*set_config_cb)(struct vdpa_device *vdev,