vdpa: allow a 32 bit vq alignment
Subsystems (2)
Michael S. Tsirkin
maintainerPATCH 1/1 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.
--- drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 +- include/linux/vdpa.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/vdpa/ifcvf/ifcvf_main.c +1 -1
@@ -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 ; }
drivers/vdpa/vdpa_sim/vdpa_sim.c +1 -1
@@ -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 ; }
include/linux/vdpa.h +1 -1
@@ -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,
Signature · 1 line
MST
Quoted 9 lines · Michael S. Tsirkin
get_vq_alignreturns 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.Cc "Zhu, Lingshan" <[email protected]>Reported-by Arnd Bergmann <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
Quoted 44 lines
drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 +- include/linux/vdpa.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/vdpa/ifcvf/ifcvf_main.c +1
-1@@ -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 ; }drivers/vdpa/vdpa_sim/vdpa_sim.c +1
-1@@ -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 ; }include/linux/vdpa.h +1
-1@@ -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,
Cc Ling Shan.
Quoted 53 lines · Michael S. Tsirkin
get_vq_alignreturns 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.Cc "Zhu, Lingshan" <[email protected]>Reported-by Arnd Bergmann <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>--- drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim.c | 2 +- include/linux/vdpa.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/vdpa/ifcvf/ifcvf_main.c +1
-1@@ -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 ; }drivers/vdpa/vdpa_sim/vdpa_sim.c +1
-1@@ -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 ; }include/linux/vdpa.h +1
-1@@ -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,
Quoted 47 lines · Jason Wang
Cc Ling Shan.
Quoted 44 lines · Michael S. Tsirkin
get_vq_alignreturns 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.Cc "Zhu, Lingshan" <[email protected]>Reported-by Arnd Bergmann <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>---
drivers/vdpa/ifcvf/ifcvf_main.c | 2 +-
drivers/vdpa/vdpa_sim/vdpa_sim.c| 2 +-
include/linux/vdpa.h | 2 +-3 files changed, 3 insertions(+), 3 deletions(-)drivers/vdpa/ifcvf/ifcvf_main.c +1
-0@@ -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;}
drivers/vdpa/vdpa_sim/vdpa_sim.c +1
-0@@ -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;}
include/linux/vdpa.h +0
-0
Quoted 9 lines
include/linux/vdpa.h struct vdpa_config_ops { · line 169
Quoted 8 lines
include/linux/vdpa.h +1
-1@@ -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,
looks good to me
Thanks,
BR
Zhu Lingshan