All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi
@ 2018-08-08 19:52 Greg Edwards
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 1/3] vhost-user-scsi: move host_features into VHostSCSICommon Greg Edwards
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Greg Edwards @ 2018-08-08 19:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Fam Zheng, Michael S. Tsirkin,
	Nicholas A. Bellinger, Felipe Franciosi, Greg Edwards

Unify the get_features functions for vhost-scsi and vhost-user-scsi, including
their use of host_features, and expose a new 't10_pi' property to enable
negotiation of the VIRTIO_SCSI_F_T10_PI feature bit with the backend.

Greg Edwards (3):
  vhost-user-scsi: move host_features into VHostSCSICommon
  vhost-scsi: unify vhost-scsi get_features implementations
  vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI

 hw/scsi/vhost-scsi-common.c           |  3 +++
 hw/scsi/vhost-scsi.c                  |  3 +++
 hw/scsi/vhost-user-scsi.c             | 28 ++++++++++-----------------
 include/hw/virtio/vhost-scsi-common.h |  1 +
 include/hw/virtio/vhost-user-scsi.h   |  1 -
 5 files changed, 17 insertions(+), 19 deletions(-)

-- 
2.17.1

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

* [Qemu-devel] [PATCH 1/3] vhost-user-scsi: move host_features into VHostSCSICommon
  2018-08-08 19:52 [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Greg Edwards
@ 2018-08-08 19:52 ` Greg Edwards
  2018-08-10  0:13   ` Felipe Franciosi
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 2/3] vhost-scsi: unify vhost-scsi get_features implementations Greg Edwards
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Greg Edwards @ 2018-08-08 19:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Fam Zheng, Michael S. Tsirkin,
	Nicholas A. Bellinger, Felipe Franciosi, Greg Edwards

In preparation for having vhost-scsi also make use of host_features,
move it from struct VHostUserSCSI into struct VHostSCSICommon.

Signed-off-by: Greg Edwards <gedwards@ddn.com>
---
 hw/scsi/vhost-user-scsi.c             | 15 ++++++++-------
 include/hw/virtio/vhost-scsi-common.h |  1 +
 include/hw/virtio/vhost-user-scsi.h   |  1 -
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c
index 9355cfdf07f9..694cb801209a 100644
--- a/hw/scsi/vhost-user-scsi.c
+++ b/hw/scsi/vhost-user-scsi.c
@@ -141,9 +141,10 @@ static uint64_t vhost_user_scsi_get_features(VirtIODevice *vdev,
                                              uint64_t features, Error **errp)
 {
     VHostUserSCSI *s = VHOST_USER_SCSI(vdev);
+    VHostSCSICommon *vsc = VHOST_SCSI_COMMON(s);
 
     /* Turn on predefined features supported by this device */
-    features |= s->host_features;
+    features |= vsc->host_features;
 
     return vhost_scsi_common_get_features(vdev, features, errp);
 }
@@ -157,12 +158,12 @@ static Property vhost_user_scsi_properties[] = {
     DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors,
                        0xFFFF),
     DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSICommon, conf.cmd_per_lun, 128),
-    DEFINE_PROP_BIT64("hotplug", VHostUserSCSI, host_features,
-                                                VIRTIO_SCSI_F_HOTPLUG,
-                                                true),
-    DEFINE_PROP_BIT64("param_change", VHostUserSCSI, host_features,
-                                                     VIRTIO_SCSI_F_CHANGE,
-                                                     true),
+    DEFINE_PROP_BIT64("hotplug", VHostSCSICommon, host_features,
+                                                  VIRTIO_SCSI_F_HOTPLUG,
+                                                  true),
+    DEFINE_PROP_BIT64("param_change", VHostSCSICommon, host_features,
+                                                       VIRTIO_SCSI_F_CHANGE,
+                                                       true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/virtio/vhost-scsi-common.h b/include/hw/virtio/vhost-scsi-common.h
index 4553be4bc378..57fb1d87b51d 100644
--- a/include/hw/virtio/vhost-scsi-common.h
+++ b/include/hw/virtio/vhost-scsi-common.h
@@ -35,6 +35,7 @@ typedef struct VHostSCSICommon {
     int channel;
     int target;
     int lun;
+    uint64_t host_features;
 } VHostSCSICommon;
 
 int vhost_scsi_common_start(VHostSCSICommon *vsc);
diff --git a/include/hw/virtio/vhost-user-scsi.h b/include/hw/virtio/vhost-user-scsi.h
index 3ec34ae867ab..e429cacd8e06 100644
--- a/include/hw/virtio/vhost-user-scsi.h
+++ b/include/hw/virtio/vhost-user-scsi.h
@@ -30,7 +30,6 @@
 
 typedef struct VHostUserSCSI {
     VHostSCSICommon parent_obj;
-    uint64_t host_features;
     VhostUserState *vhost_user;
 } VHostUserSCSI;
 
-- 
2.17.1

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

* [Qemu-devel] [PATCH 2/3] vhost-scsi: unify vhost-scsi get_features implementations
  2018-08-08 19:52 [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Greg Edwards
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 1/3] vhost-user-scsi: move host_features into VHostSCSICommon Greg Edwards
@ 2018-08-08 19:52 ` Greg Edwards
  2018-08-10  0:13   ` Felipe Franciosi
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 3/3] vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI Greg Edwards
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Greg Edwards @ 2018-08-08 19:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Fam Zheng, Michael S. Tsirkin,
	Nicholas A. Bellinger, Felipe Franciosi, Greg Edwards

Move the enablement of preset host features into the common
vhost_scsi_common_get_features() function.  This is in preparation for
having vhost-scsi also make use of host_features.

Signed-off-by: Greg Edwards <gedwards@ddn.com>
---
 hw/scsi/vhost-scsi-common.c |  3 +++
 hw/scsi/vhost-user-scsi.c   | 14 +-------------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c
index e2a5828af137..b7fbab65dd17 100644
--- a/hw/scsi/vhost-scsi-common.c
+++ b/hw/scsi/vhost-scsi-common.c
@@ -96,6 +96,9 @@ uint64_t vhost_scsi_common_get_features(VirtIODevice *vdev, uint64_t features,
 {
     VHostSCSICommon *vsc = VHOST_SCSI_COMMON(vdev);
 
+    /* Turn on predefined features supported by this device */
+    features |= vsc->host_features;
+
     return vhost_get_features(&vsc->dev, vsc->feature_bits, features);
 }
 
diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c
index 694cb801209a..26491daaa0bf 100644
--- a/hw/scsi/vhost-user-scsi.c
+++ b/hw/scsi/vhost-user-scsi.c
@@ -137,18 +137,6 @@ static void vhost_user_scsi_unrealize(DeviceState *dev, Error **errp)
     }
 }
 
-static uint64_t vhost_user_scsi_get_features(VirtIODevice *vdev,
-                                             uint64_t features, Error **errp)
-{
-    VHostUserSCSI *s = VHOST_USER_SCSI(vdev);
-    VHostSCSICommon *vsc = VHOST_SCSI_COMMON(s);
-
-    /* Turn on predefined features supported by this device */
-    features |= vsc->host_features;
-
-    return vhost_scsi_common_get_features(vdev, features, errp);
-}
-
 static Property vhost_user_scsi_properties[] = {
     DEFINE_PROP_CHR("chardev", VirtIOSCSICommon, conf.chardev),
     DEFINE_PROP_UINT32("boot_tpgt", VirtIOSCSICommon, conf.boot_tpgt, 0),
@@ -188,7 +176,7 @@ static void vhost_user_scsi_class_init(ObjectClass *klass, void *data)
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
     vdc->realize = vhost_user_scsi_realize;
     vdc->unrealize = vhost_user_scsi_unrealize;
-    vdc->get_features = vhost_user_scsi_get_features;
+    vdc->get_features = vhost_scsi_common_get_features;
     vdc->set_config = vhost_scsi_common_set_config;
     vdc->set_status = vhost_user_scsi_set_status;
     fwc->get_dev_path = vhost_scsi_common_get_fw_dev_path;
-- 
2.17.1

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

* [Qemu-devel] [PATCH 3/3] vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI
  2018-08-08 19:52 [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Greg Edwards
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 1/3] vhost-user-scsi: move host_features into VHostSCSICommon Greg Edwards
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 2/3] vhost-scsi: unify vhost-scsi get_features implementations Greg Edwards
@ 2018-08-08 19:52 ` Greg Edwards
  2018-08-10  0:15   ` Felipe Franciosi
  2018-08-14  2:48 ` [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Fam Zheng
  2018-08-20 14:29 ` Paolo Bonzini
  4 siblings, 1 reply; 9+ messages in thread
From: Greg Edwards @ 2018-08-08 19:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Fam Zheng, Michael S. Tsirkin,
	Nicholas A. Bellinger, Felipe Franciosi, Greg Edwards

Allow toggling on/off the VIRTIO_SCSI_F_T10_PI feature bit for both
vhost-scsi and vhost-user-scsi devices.

Signed-off-by: Greg Edwards <gedwards@ddn.com>
---
 hw/scsi/vhost-scsi.c      | 3 +++
 hw/scsi/vhost-user-scsi.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 9c1bea8ff327..becf55008553 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -238,6 +238,9 @@ static Property vhost_scsi_properties[] = {
     DEFINE_PROP_UINT32("max_sectors", VirtIOSCSICommon, conf.max_sectors,
                        0xFFFF),
     DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSICommon, conf.cmd_per_lun, 128),
+    DEFINE_PROP_BIT64("t10_pi", VHostSCSICommon, host_features,
+                                                 VIRTIO_SCSI_F_T10_PI,
+                                                 false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c
index 26491daaa0bf..2e1ba4a87bb1 100644
--- a/hw/scsi/vhost-user-scsi.c
+++ b/hw/scsi/vhost-user-scsi.c
@@ -152,6 +152,9 @@ static Property vhost_user_scsi_properties[] = {
     DEFINE_PROP_BIT64("param_change", VHostSCSICommon, host_features,
                                                        VIRTIO_SCSI_F_CHANGE,
                                                        true),
+    DEFINE_PROP_BIT64("t10_pi", VHostSCSICommon, host_features,
+                                                 VIRTIO_SCSI_F_T10_PI,
+                                                 false),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
2.17.1

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

* Re: [Qemu-devel] [PATCH 1/3] vhost-user-scsi: move host_features into VHostSCSICommon
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 1/3] vhost-user-scsi: move host_features into VHostSCSICommon Greg Edwards
@ 2018-08-10  0:13   ` Felipe Franciosi
  0 siblings, 0 replies; 9+ messages in thread
From: Felipe Franciosi @ 2018-08-10  0:13 UTC (permalink / raw)
  To: Greg Edwards, qemu-devel
  Cc: Paolo Bonzini, Fam Zheng, Michael S. Tsirkin, Nicholas A. Bellinger


> On 8 Aug 2018, at 12:52, Greg Edwards <gedwards@ddn.com> wrote:
> 
> In preparation for having vhost-scsi also make use of host_features,
> move it from struct VHostUserSCSI into struct VHostSCSICommon.
> 
> Signed-off-by: Greg Edwards <gedwards@ddn.com>
> ---
> hw/scsi/vhost-user-scsi.c             | 15 ++++++++-------
> include/hw/virtio/vhost-scsi-common.h |  1 +
> include/hw/virtio/vhost-user-scsi.h   |  1 -
> 3 files changed, 9 insertions(+), 8 deletions(-)
> 

Reviewed-by: Felipe Franciosi <felipe@nutanix.com>

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

* Re: [Qemu-devel] [PATCH 2/3] vhost-scsi: unify vhost-scsi get_features implementations
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 2/3] vhost-scsi: unify vhost-scsi get_features implementations Greg Edwards
@ 2018-08-10  0:13   ` Felipe Franciosi
  0 siblings, 0 replies; 9+ messages in thread
From: Felipe Franciosi @ 2018-08-10  0:13 UTC (permalink / raw)
  To: Greg Edwards, qemu-devel
  Cc: Paolo Bonzini, Fam Zheng, Michael S. Tsirkin, Nicholas A. Bellinger


> On 8 Aug 2018, at 12:52, Greg Edwards <gedwards@ddn.com> wrote:
> 
> Move the enablement of preset host features into the common
> vhost_scsi_common_get_features() function.  This is in preparation for
> having vhost-scsi also make use of host_features.
> 
> Signed-off-by: Greg Edwards <gedwards@ddn.com>
> ---
> hw/scsi/vhost-scsi-common.c |  3 +++
> hw/scsi/vhost-user-scsi.c   | 14 +-------------
> 2 files changed, 4 insertions(+), 13 deletions(-)

Reviewed-by: Felipe Franciosi <felipe@nutanix.com>

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

* Re: [Qemu-devel] [PATCH 3/3] vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 3/3] vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI Greg Edwards
@ 2018-08-10  0:15   ` Felipe Franciosi
  0 siblings, 0 replies; 9+ messages in thread
From: Felipe Franciosi @ 2018-08-10  0:15 UTC (permalink / raw)
  To: Greg Edwards, qemu-devel
  Cc: Paolo Bonzini, Fam Zheng, Michael S. Tsirkin, Nicholas A. Bellinger


> On 8 Aug 2018, at 12:52, Greg Edwards <gedwards@ddn.com> wrote:
> 
> Allow toggling on/off the VIRTIO_SCSI_F_T10_PI feature bit for both
> vhost-scsi and vhost-user-scsi devices.
> 
> Signed-off-by: Greg Edwards <gedwards@ddn.com>
> ---
> hw/scsi/vhost-scsi.c      | 3 +++
> hw/scsi/vhost-user-scsi.c | 3 +++
> 2 files changed, 6 insertions(+)

Reviewed-by: Felipe Franciosi <felipe@nutanix.com>

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

* Re: [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi
  2018-08-08 19:52 [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Greg Edwards
                   ` (2 preceding siblings ...)
  2018-08-08 19:52 ` [Qemu-devel] [PATCH 3/3] vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI Greg Edwards
@ 2018-08-14  2:48 ` Fam Zheng
  2018-08-20 14:29 ` Paolo Bonzini
  4 siblings, 0 replies; 9+ messages in thread
From: Fam Zheng @ 2018-08-14  2:48 UTC (permalink / raw)
  To: Greg Edwards
  Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin,
	Nicholas A. Bellinger, Felipe Franciosi

On Wed, 08/08 13:52, Greg Edwards wrote:
> Unify the get_features functions for vhost-scsi and vhost-user-scsi, including
> their use of host_features, and expose a new 't10_pi' property to enable
> negotiation of the VIRTIO_SCSI_F_T10_PI feature bit with the backend.
> 
> Greg Edwards (3):
>   vhost-user-scsi: move host_features into VHostSCSICommon
>   vhost-scsi: unify vhost-scsi get_features implementations
>   vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI
> 
>  hw/scsi/vhost-scsi-common.c           |  3 +++
>  hw/scsi/vhost-scsi.c                  |  3 +++
>  hw/scsi/vhost-user-scsi.c             | 28 ++++++++++-----------------
>  include/hw/virtio/vhost-scsi-common.h |  1 +
>  include/hw/virtio/vhost-user-scsi.h   |  1 -
>  5 files changed, 17 insertions(+), 19 deletions(-)


Reviewed-by: Fam Zheng <famz@redhat.com>

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

* Re: [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi
  2018-08-08 19:52 [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Greg Edwards
                   ` (3 preceding siblings ...)
  2018-08-14  2:48 ` [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Fam Zheng
@ 2018-08-20 14:29 ` Paolo Bonzini
  4 siblings, 0 replies; 9+ messages in thread
From: Paolo Bonzini @ 2018-08-20 14:29 UTC (permalink / raw)
  To: Greg Edwards, qemu-devel
  Cc: Fam Zheng, Michael S. Tsirkin, Nicholas A. Bellinger, Felipe Franciosi

On 08/08/2018 21:52, Greg Edwards wrote:
> Unify the get_features functions for vhost-scsi and vhost-user-scsi, including
> their use of host_features, and expose a new 't10_pi' property to enable
> negotiation of the VIRTIO_SCSI_F_T10_PI feature bit with the backend.
> 
> Greg Edwards (3):
>   vhost-user-scsi: move host_features into VHostSCSICommon
>   vhost-scsi: unify vhost-scsi get_features implementations
>   vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI
> 
>  hw/scsi/vhost-scsi-common.c           |  3 +++
>  hw/scsi/vhost-scsi.c                  |  3 +++
>  hw/scsi/vhost-user-scsi.c             | 28 ++++++++++-----------------
>  include/hw/virtio/vhost-scsi-common.h |  1 +
>  include/hw/virtio/vhost-user-scsi.h   |  1 -
>  5 files changed, 17 insertions(+), 19 deletions(-)
> 

Queued, thanks.

Paolo

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

end of thread, other threads:[~2018-08-20 14:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 19:52 [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Greg Edwards
2018-08-08 19:52 ` [Qemu-devel] [PATCH 1/3] vhost-user-scsi: move host_features into VHostSCSICommon Greg Edwards
2018-08-10  0:13   ` Felipe Franciosi
2018-08-08 19:52 ` [Qemu-devel] [PATCH 2/3] vhost-scsi: unify vhost-scsi get_features implementations Greg Edwards
2018-08-10  0:13   ` Felipe Franciosi
2018-08-08 19:52 ` [Qemu-devel] [PATCH 3/3] vhost-scsi: expose 't10_pi' property for VIRTIO_SCSI_F_T10_PI Greg Edwards
2018-08-10  0:15   ` Felipe Franciosi
2018-08-14  2:48 ` [Qemu-devel] [PATCH 0/3] expose VIRTIO_SCSI_F_T10_PI for vhost-scsi and vhost-user-scsi Fam Zheng
2018-08-20 14:29 ` Paolo Bonzini

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.