* [PATCH] vdpa: allow a 32 bit vq alignment
@ 2020-04-09 20:28 Michael S. Tsirkin
2020-04-10 2:31 ` Jason Wang
2020-04-10 6:21 ` Jason Wang
0 siblings, 2 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2020-04-09 20:28 UTC (permalink / raw)
To: linux-kernel; +Cc: Arnd Bergmann, Jason Wang, virtualization
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.
Cc: "Zhu, Lingshan" <lingshan.zhu@intel.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
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(-)
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index 28d9e5de5675..abf6a061cab6 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -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;
}
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index 72863d01a12a..7957d2d41fc4 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -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;
}
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 733acfb7ef84..5453af87a33e 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -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,
--
MST
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] vdpa: allow a 32 bit vq alignment
2020-04-09 20:28 [PATCH] vdpa: allow a 32 bit vq alignment Michael S. Tsirkin
@ 2020-04-10 2:31 ` Jason Wang
2020-04-10 6:21 ` Jason Wang
1 sibling, 0 replies; 4+ messages in thread
From: Jason Wang @ 2020-04-10 2:31 UTC (permalink / raw)
To: Michael S. Tsirkin, linux-kernel; +Cc: Arnd Bergmann, virtualization
On 2020/4/10 上午4:28, Michael S. Tsirkin wrote:
> 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.
>
> Cc: "Zhu, Lingshan" <lingshan.zhu@intel.com>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
Acked-by: Jason Wang <jasowang@redhat.com>
> 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(-)
>
> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
> index 28d9e5de5675..abf6a061cab6 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
> @@ -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;
> }
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index 72863d01a12a..7957d2d41fc4 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -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;
> }
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 733acfb7ef84..5453af87a33e 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -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,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vdpa: allow a 32 bit vq alignment
2020-04-09 20:28 [PATCH] vdpa: allow a 32 bit vq alignment Michael S. Tsirkin
2020-04-10 2:31 ` Jason Wang
@ 2020-04-10 6:21 ` Jason Wang
2020-04-10 6:24 ` Zhu, Lingshan
1 sibling, 1 reply; 4+ messages in thread
From: Jason Wang @ 2020-04-10 6:21 UTC (permalink / raw)
To: Michael S. Tsirkin, linux-kernel
Cc: Arnd Bergmann, virtualization, Zhu, Lingshan
Cc Ling Shan.
On 2020/4/10 上午4:28, Michael S. Tsirkin wrote:
> 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.
>
> Cc: "Zhu, Lingshan" <lingshan.zhu@intel.com>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 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(-)
>
> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
> index 28d9e5de5675..abf6a061cab6 100644
> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
> @@ -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;
> }
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> index 72863d01a12a..7957d2d41fc4 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
> @@ -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;
> }
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 733acfb7ef84..5453af87a33e 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -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,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vdpa: allow a 32 bit vq alignment
2020-04-10 6:21 ` Jason Wang
@ 2020-04-10 6:24 ` Zhu, Lingshan
0 siblings, 0 replies; 4+ messages in thread
From: Zhu, Lingshan @ 2020-04-10 6:24 UTC (permalink / raw)
To: Jason Wang, Michael S. Tsirkin, linux-kernel
Cc: Arnd Bergmann, virtualization
On 4/10/2020 2:21 PM, Jason Wang wrote:
> Cc Ling Shan.
>
> On 2020/4/10 上午4:28, Michael S. Tsirkin wrote:
>> 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.
>>
>> Cc: "Zhu, Lingshan" <lingshan.zhu@intel.com>
>> Reported-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>> ---
>> 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(-)
>>
>> diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c
>> b/drivers/vdpa/ifcvf/ifcvf_main.c
>> index 28d9e5de5675..abf6a061cab6 100644
>> --- a/drivers/vdpa/ifcvf/ifcvf_main.c
>> +++ b/drivers/vdpa/ifcvf/ifcvf_main.c
>> @@ -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;
>> }
>> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c
>> b/drivers/vdpa/vdpa_sim/vdpa_sim.c
>> index 72863d01a12a..7957d2d41fc4 100644
>> --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
>> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
>> @@ -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;
>> }
>> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
>> index 733acfb7ef84..5453af87a33e 100644
>> --- a/include/linux/vdpa.h
>> +++ b/include/linux/vdpa.h
>> @@ -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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-10 6:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 20:28 [PATCH] vdpa: allow a 32 bit vq alignment Michael S. Tsirkin
2020-04-10 2:31 ` Jason Wang
2020-04-10 6:21 ` Jason Wang
2020-04-10 6:24 ` Zhu, Lingshan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).