All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vdpa: mandate 1.0 device
@ 2021-06-04  5:02 ` Jason Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2021-06-04  5:02 UTC (permalink / raw)
  To: mst, jasowang; +Cc: virtualization, linux-kernel, elic, parav

This patch mandates 1.0 for vDPA devices. The plan is never to support
transitional devices for vDPA devices in the future.

The reasons are:

- To have the semantic of normative statement in the virtio spec and
  eliminate the burden of transitional device for both vDPA bus and
  vDPA parent
- Eliminate the efforts for dealing with endian conversion in the
  management tool
- Mandate vDPA vendor to ship modern device instead of transitional
  device which is easily broken and unsafe
- Transitional device never work since the first day of vDPA

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/linux/vdpa.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index f311d227aa1b..11dd05b805a7 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -6,6 +6,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/vhost_iotlb.h>
+#include <uapi/linux/virtio_config.h>
 
 /**
  * struct vdpa_calllback - vDPA callback definition.
@@ -328,6 +329,11 @@ static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features)
 {
         const struct vdpa_config_ops *ops = vdev->config;
 
+        /* Mandating 1.0 to have semantics of normative statements in
+         * the spec. */
+        if (!(features & BIT_ULL(VIRTIO_F_VERSION_1)))
+		return -EINVAL;
+
 	vdev->features_valid = true;
         return ops->set_features(vdev, features);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] vdpa: mandate 1.0 device
@ 2021-06-04  5:02 ` Jason Wang
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2021-06-04  5:02 UTC (permalink / raw)
  To: mst, jasowang; +Cc: elic, linux-kernel, virtualization

This patch mandates 1.0 for vDPA devices. The plan is never to support
transitional devices for vDPA devices in the future.

The reasons are:

- To have the semantic of normative statement in the virtio spec and
  eliminate the burden of transitional device for both vDPA bus and
  vDPA parent
- Eliminate the efforts for dealing with endian conversion in the
  management tool
- Mandate vDPA vendor to ship modern device instead of transitional
  device which is easily broken and unsafe
- Transitional device never work since the first day of vDPA

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/linux/vdpa.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index f311d227aa1b..11dd05b805a7 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -6,6 +6,7 @@
 #include <linux/device.h>
 #include <linux/interrupt.h>
 #include <linux/vhost_iotlb.h>
+#include <uapi/linux/virtio_config.h>
 
 /**
  * struct vdpa_calllback - vDPA callback definition.
@@ -328,6 +329,11 @@ static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features)
 {
         const struct vdpa_config_ops *ops = vdev->config;
 
+        /* Mandating 1.0 to have semantics of normative statements in
+         * the spec. */
+        if (!(features & BIT_ULL(VIRTIO_F_VERSION_1)))
+		return -EINVAL;
+
 	vdev->features_valid = true;
         return ops->set_features(vdev, features);
 }
-- 
2.25.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] vdpa: mandate 1.0 device
  2021-06-04  5:02 ` Jason Wang
@ 2021-06-04  7:57   ` Stefano Garzarella
  -1 siblings, 0 replies; 5+ messages in thread
From: Stefano Garzarella @ 2021-06-04  7:57 UTC (permalink / raw)
  To: Jason Wang; +Cc: mst, elic, linux-kernel, virtualization

On Fri, Jun 04, 2021 at 01:02:51PM +0800, Jason Wang wrote:
>This patch mandates 1.0 for vDPA devices. The plan is never to support
>transitional devices for vDPA devices in the future.
>
>The reasons are:
>
>- To have the semantic of normative statement in the virtio spec and
>  eliminate the burden of transitional device for both vDPA bus and
>  vDPA parent
>- Eliminate the efforts for dealing with endian conversion in the
>  management tool
>- Mandate vDPA vendor to ship modern device instead of transitional
>  device which is easily broken and unsafe
>- Transitional device never work since the first day of vDPA
>
>Signed-off-by: Jason Wang <jasowang@redhat.com>
>---
> include/linux/vdpa.h | 6 ++++++
> 1 file changed, 6 insertions(+)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vdpa: mandate 1.0 device
@ 2021-06-04  7:57   ` Stefano Garzarella
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Garzarella @ 2021-06-04  7:57 UTC (permalink / raw)
  To: Jason Wang; +Cc: elic, virtualization, linux-kernel, mst

On Fri, Jun 04, 2021 at 01:02:51PM +0800, Jason Wang wrote:
>This patch mandates 1.0 for vDPA devices. The plan is never to support
>transitional devices for vDPA devices in the future.
>
>The reasons are:
>
>- To have the semantic of normative statement in the virtio spec and
>  eliminate the burden of transitional device for both vDPA bus and
>  vDPA parent
>- Eliminate the efforts for dealing with endian conversion in the
>  management tool
>- Mandate vDPA vendor to ship modern device instead of transitional
>  device which is easily broken and unsafe
>- Transitional device never work since the first day of vDPA
>
>Signed-off-by: Jason Wang <jasowang@redhat.com>
>---
> include/linux/vdpa.h | 6 ++++++
> 1 file changed, 6 insertions(+)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] vdpa: mandate 1.0 device
  2021-06-04  5:02 ` Jason Wang
  (?)
  (?)
@ 2021-06-06  6:31 ` Eli Cohen
  -1 siblings, 0 replies; 5+ messages in thread
From: Eli Cohen @ 2021-06-06  6:31 UTC (permalink / raw)
  To: Jason Wang; +Cc: mst, virtualization, linux-kernel, parav

On Fri, Jun 04, 2021 at 01:02:51PM +0800, Jason Wang wrote:
> This patch mandates 1.0 for vDPA devices. The plan is never to support
> transitional devices for vDPA devices in the future.
> 
> The reasons are:
> 
> - To have the semantic of normative statement in the virtio spec and
>   eliminate the burden of transitional device for both vDPA bus and
>   vDPA parent
> - Eliminate the efforts for dealing with endian conversion in the
>   management tool
> - Mandate vDPA vendor to ship modern device instead of transitional
>   device which is easily broken and unsafe
> - Transitional device never work since the first day of vDPA
Transitional devices never worked...

Reviewed-by: Eli Cohen <elic@nvidia.com>

> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  include/linux/vdpa.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index f311d227aa1b..11dd05b805a7 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -6,6 +6,7 @@
>  #include <linux/device.h>
>  #include <linux/interrupt.h>
>  #include <linux/vhost_iotlb.h>
> +#include <uapi/linux/virtio_config.h>
>  
>  /**
>   * struct vdpa_calllback - vDPA callback definition.
> @@ -328,6 +329,11 @@ static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features)
>  {
>          const struct vdpa_config_ops *ops = vdev->config;
>  
> +        /* Mandating 1.0 to have semantics of normative statements in
> +         * the spec. */
> +        if (!(features & BIT_ULL(VIRTIO_F_VERSION_1)))
> +		return -EINVAL;
> +
>  	vdev->features_valid = true;
>          return ops->set_features(vdev, features);
>  }
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-06  6:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04  5:02 [PATCH] vdpa: mandate 1.0 device Jason Wang
2021-06-04  5:02 ` Jason Wang
2021-06-04  7:57 ` Stefano Garzarella
2021-06-04  7:57   ` Stefano Garzarella
2021-06-06  6:31 ` Eli Cohen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.