Skip to content

Commit 425a507

Browse files
committed
vdpa: allow a 32 bit vq alignment
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 <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 5038a56 commit 425a507

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/vdpa/ifcvf/ifcvf_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static u32 ifcvf_vdpa_get_vendor_id(struct vdpa_device *vdpa_dev)
226226
return IFCVF_SUBSYS_VENDOR_ID;
227227
}
228228

229-
static u16 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
229+
static u32 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
230230
{
231231
return IFCVF_QUEUE_ALIGNMENT;
232232
}

drivers/vdpa/vdpa_sim/vdpa_sim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static u64 vdpasim_get_vq_state(struct vdpa_device *vdpa, u16 idx)
435435
return vrh->last_avail_idx;
436436
}
437437

438-
static u16 vdpasim_get_vq_align(struct vdpa_device *vdpa)
438+
static u32 vdpasim_get_vq_align(struct vdpa_device *vdpa)
439439
{
440440
return VDPASIM_QUEUE_ALIGN;
441441
}

include/linux/vdpa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct vdpa_config_ops {
164164
u64 (*get_vq_state)(struct vdpa_device *vdev, u16 idx);
165165

166166
/* Device ops */
167-
u16 (*get_vq_align)(struct vdpa_device *vdev);
167+
u32 (*get_vq_align)(struct vdpa_device *vdev);
168168
u64 (*get_features)(struct vdpa_device *vdev);
169169
int (*set_features)(struct vdpa_device *vdev, u64 features);
170170
void (*set_config_cb)(struct vdpa_device *vdev,

0 commit comments

Comments
 (0)