Skip to contentSkip to conversation

xen-block: introduces extra request to pass-through SCSI commands

RFC PATCH In review Bob Liu 6 participants 27 messages Feb 29, 2016 – Mar 3, 2016 1 message not in the archive

lore
Share & tools
lore

Bob Liu

author
#0 lore raw

RFC PATCH 1/1 xen-block: introduces extra request to pass-through SCSI commands

1) What is this patch about?
This patch introduces an new block operation (BLKIF_OP_EXTRA_FLAG). A request with BLKIF_OP_EXTRA_FLAG set means the following request is an extra request which is used to pass through SCSI commands.
This is like a simplified version of XEN_NETIF_EXTRA_* in netif.h. It can be extended easily to transmit other per-request/bio data from frontend to backend e.g Data Integrity Field per bio.

2) Why we need this?
Currently only raw data segments are transmitted from blkfront to blkback, which means some advanced features are lost.
* Guest knows nothing about features of the real backend storage. For example, on bare-metal environment INQUIRY SCSI command can be used to query storage device information. If it's a SSD or flash device we can have the option to use the device as a fast cache.
But this can't happen in current domU guests, because blkfront only knows it's just a normal virtual disk

* Failover Clusters in Windows
Failover clusters require SCSI-3 persistent reservation target disks, but now this can't work in domU.

3) Known issues:
* Security issues, how to 'validate' this extra request payload. E.g SCSI operates on LUN bases (the whole disk) while we really just want to operate on partitions

* Can't pass SCSI commands through if the backend storage driver is bio-based instead of request-based.

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as Xen-block.

* Much longer path:
ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-backend -> Target framework(LIO?) ->

With xen-block we only need:
ioctl() -> blkfront -> blkback ->

* xen-block has been existed for many years, widely used and more stable.

Welcome any input, thank you!

---
 xen/include/public/io/blkif.h |   73 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
xen/include/public/io/blkif.h +73 -0
index 99f0326..7c10bce 100644
@@ -635,6 +635,28 @@
 #define BLKIF_OP_INDIRECT          6
 
 /*
+ * Recognised only if "feature-extra-request" is present in backend xenbus info.
+ * A request with BLKIF_OP_EXTRA_FLAG indicates an extra request is followed
+ * in the shared ring buffer.
+ *
+ * By this way, extra data like SCSI command, DIF/DIX and other per-request/bio
+ * data can be transmitted from frontend to backend.
+ *
+ * The 'wire' format is like:
+ *  Request 1: xen_blkif_request
+ * [Request 2: xen_blkif_extra_request]    (only if request 1 has BLKIF_OP_EXTRA_FLAG)
+ *  Request 3: xen_blkif_request
+ *  Request 4: xen_blkif_request
+ * [Request 5: xen_blkif_extra_request]    (only if request 4 has BLKIF_OP_EXTRA_FLAG)
+ *  ...
+ *  Request N: xen_blkif_request
+ *
+ * If a backend does not recognize BLKIF_OP_EXTRA_FLAG, it should *not* create the
+ * "feature-extra-request" node!
+ */
+#define BLKIF_OP_EXTRA_FLAG (0x80)
+
+/*
  * Maximum scatter/gather segments per request.
  * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
  * NB. This could be 12 if the ring indexes weren't stored in the same page.
@@ -703,10 +725,61 @@ struct blkif_request_indirect {
 };
 typedef struct blkif_request_indirect blkif_request_indirect_t;
 
+enum blkif_extra_request_type {
+	BLKIF_EXTRA_TYPE_SCSI_CMD = 1,		/* Transmit SCSI command.  */
+};
+
+struct scsi_cmd_req {
+	/*
+	 * Grant mapping for transmiting SCSI command to backend, and
+	 * also receive sense data from backend.
+	 * One 4KB page is enough.
+	 */
+	grant_ref_t cmd_gref;
+	/* Length of SCSI command in the grant mapped page. */
+	unsigned int cmd_len;
+
+	/*
+	 * SCSI command may require transmiting data segment length less
+	 * than a sector(512 bytes).
+	 * Record num_sg and last segment length in extra request so that
+	 * backend can know about them.
+	 */
+	unsigned int num_sg;
+	unsigned int last_sg_len;
+};
+
+/*
+ * Extra request, must follow a normal-request and a normal-request can
+ * only be followed by one extra request.
+ */
+struct blkif_request_extra {
+	uint8_t type;		/* BLKIF_EXTRA_TYPE_* */
+	uint16_t _pad1;
+#ifndef CONFIG_X86_32
+	uint32_t _pad2;		/* offsetof(blkif_...,u.extra.id) == 8 */
+#endif
+	uint64_t id;
+	struct scsi_cmd_req scsi_cmd;
+} __attribute__((__packed__));
+typedef struct blkif_request_extra blkif_request_extra_t;
+
+struct scsi_cmd_res {
+	unsigned int resid_len;
+	/* Length of sense data returned in grant mapped page. */
+	unsigned int sense_len;
+};
+
+struct blkif_response_extra {
+	uint8_t type;  /* BLKIF_EXTRA_TYPE_* */
+	struct scsi_cmd_res scsi_cmd;
+} __attribute__((__packed__));
+
 struct blkif_response {
     uint64_t        id;              /* copied from request */
     uint8_t         operation;       /* copied from request */
     int16_t         status;          /* BLKIF_RSP_???       */
+    struct blkif_response_extra extra;
 };
 typedef struct blkif_response blkif_response_t;
 
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 18 lines · Bob Liu

1) What is this patch about?
This patch introduces an new block operation (BLKIF_OP_EXTRA_FLAG). A request with BLKIF_OP_EXTRA_FLAG set means the following request is an extra request which is used to pass through SCSI commands.
This is like a simplified version of XEN_NETIF_EXTRA_* in netif.h. It can be extended easily to transmit other per-request/bio data from frontend to backend e.g Data Integrity Field per bio.

2) Why we need this?
Currently only raw data segments are transmitted from blkfront to blkback, which means some advanced features are lost.
* Guest knows nothing about features of the real backend storage. For example, on bare-metal environment INQUIRY SCSI command can be used to query storage device information. If it's a SSD or flash device we can have the option to use the device as a fast cache.
But this can't happen in current domU guests, because blkfront only knows it's just a normal virtual disk

Quoted 8 lines

* Failover Clusters in Windows
Failover clusters require SCSI-3 persistent reservation target disks, but now this can't work in domU.

3) Known issues:
* Security issues, how to 'validate' this extra request payload. E.g SCSI operates on LUN bases (the whole disk) while we really just want to operate on partitions

It's not only validation: some operations just affect the whole LUN (e.g. Reserve/Release). And what about "multi-LUN" commands like "report LUNs"?

Quoted 5 lines

* Can't pass SCSI commands through if the backend storage driver is bio-based instead of request-based.

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as Xen-block.

pvSCSI won't need to support all types of backends. It's enough to support those where passing through SCSI commands makes sense.

Seems to be a similar issue as the above mentioned problem with bio-based backend storage drivers.

Quoted 5 lines

* Much longer path:

   ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-backend -> Target framework(LIO?) ->

   With xen-block we only need:
   ioctl() -> blkfront -> blkback ->

I'd like to see performance numbers before making a decision.

Quoted 1 line

* xen-block has been existed for many years, widely used and more stable.

Adding another SCSI passthrough capability wasn't accepted for pvSCSI (that's the reason I used the Target Framework). Why do you think it will be accepted for pvblk?

This is not my personal opinion, just a heads up from someone who had a try already. ;-)

Juergen

Quoted 93 lines

Welcome any input, thank you!

---
 xen/include/public/io/blkif.h |   73 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
xen/include/public/io/blkif.h +70 -0
index 99f0326..7c10bce 100644
@@ -635,6 +635,28 @@
 #define BLKIF_OP_INDIRECT          6
 
 /*
+ * Recognised only if "feature-extra-request" is present in backend xenbus info.
+ * A request with BLKIF_OP_EXTRA_FLAG indicates an extra request is followed
+ * in the shared ring buffer.
+ *
+ * By this way, extra data like SCSI command, DIF/DIX and other per-request/bio
+ * data can be transmitted from frontend to backend.
+ *
+ * The 'wire' format is like:
+ *  Request 1: xen_blkif_request
+ * [Request 2: xen_blkif_extra_request]    (only if request 1 has BLKIF_OP_EXTRA_FLAG)
+ *  Request 3: xen_blkif_request
+ *  Request 4: xen_blkif_request
+ * [Request 5: xen_blkif_extra_request]    (only if request 4 has BLKIF_OP_EXTRA_FLAG)
+ *  ...
+ *  Request N: xen_blkif_request
+ *
+ * If a backend does not recognize BLKIF_OP_EXTRA_FLAG, it should *not* create the
+ * "feature-extra-request" node!
+ */
+#define BLKIF_OP_EXTRA_FLAG (0x80)
+
+/*
  * Maximum scatter/gather segments per request.
  * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
  * NB. This could be 12 if the ring indexes weren't stored in the same page.
@@ -703,10 +725,61 @@ struct blkif_request_indirect {
 };
 typedef struct blkif_request_indirect blkif_request_indirect_t;
 
+enum blkif_extra_request_type {
+	BLKIF_EXTRA_TYPE_SCSI_CMD = 1,		/* Transmit SCSI command.  */
+};
+
+struct scsi_cmd_req {
+	/*
+	 * Grant mapping for transmiting SCSI command to backend, and
+	 * also receive sense data from backend.
+	 * One 4KB page is enough.
+	 */
+	grant_ref_t cmd_gref;
+	/* Length of SCSI command in the grant mapped page. */
+	unsigned int cmd_len;
+
+	/*
+	 * SCSI command may require transmiting data segment length less
+	 * than a sector(512 bytes).
+	 * Record num_sg and last segment length in extra request so that
+	 * backend can know about them.
+	 */
+	unsigned int num_sg;
+	unsigned int last_sg_len;
+};
+
+/*
+ * Extra request, must follow a normal-request and a normal-request can
+ * only be followed by one extra request.
+ */
+struct blkif_request_extra {
+	uint8_t type;		/* BLKIF_EXTRA_TYPE_* */
+	uint16_t _pad1;
+#ifndef CONFIG_X86_32
+	uint32_t _pad2;		/* offsetof(blkif_...,u.extra.id) == 8 */
+#endif
+	uint64_t id;
+	struct scsi_cmd_req scsi_cmd;
+} __attribute__((__packed__));
+typedef struct blkif_request_extra blkif_request_extra_t;
+
+struct scsi_cmd_res {
+	unsigned int resid_len;
+	/* Length of sense data returned in grant mapped page. */
+	unsigned int sense_len;
+};
+
+struct blkif_response_extra {
+	uint8_t type;  /* BLKIF_EXTRA_TYPE_* */
+	struct scsi_cmd_res scsi_cmd;

xen/include/public/io/blkif.h struct blkif_request_indirect { · line 785

Quoted 10 lines
xen/include/public/io/blkif.h +3 -0
+} __attribute__((__packed__));
+
 struct blkif_response {
     uint64_t        id;              /* copied from request */
     uint8_t         operation;       /* copied from request */
     int16_t         status;          /* BLKIF_RSP_???       */
+    struct blkif_response_extra extra;
 };
 typedef struct blkif_response blkif_response_t;
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 23 lines · Juergen Gross
Quoted 22 lines · Bob Liu

1) What is this patch about?
This patch introduces an new block operation (BLKIF_OP_EXTRA_FLAG). A request with BLKIF_OP_EXTRA_FLAG set means the following request is an extra request which is used to pass through SCSI commands.
This is like a simplified version of XEN_NETIF_EXTRA_* in netif.h. It can be extended easily to transmit other per-request/bio data from frontend to backend e.g Data Integrity Field per bio.

2) Why we need this?
Currently only raw data segments are transmitted from blkfront to blkback, which means some advanced features are lost.
* Guest knows nothing about features of the real backend storage. For example, on bare-metal environment INQUIRY SCSI command can be used to query storage device information. If it's a SSD or flash device we can have the option to use the device as a fast cache.
But this can't happen in current domU guests, because blkfront only knows it's just a normal virtual disk

* Failover Clusters in Windows
Failover clusters require SCSI-3 persistent reservation target disks, but now this can't work in domU.

Quoted 8 lines
Quoted 4 lines

3) Known issues:
* Security issues, how to 'validate' this extra request payload. E.g SCSI operates on LUN bases (the whole disk) while we really just want to operate on partitions

It's not only validation: some operations just affect the whole LUN (e.g. Reserve/Release). And what about "multi-LUN" commands like "report LUNs"?

Don't expose them. Bob and I want to get an idea of what would be a good compromise to allow some SCSI specific (or perhaps ATA specific or DIF/DIX?) type of commands go through the PV driver.

Would it be better if it was through XenBus? But that may not work for some that are tied closely to requests, such as DIF/DIX.

However the 'DISCARD' for example worked out - it is an umbrella for both SCSI UNMAP and ATA DISCARD operation and hides the complexity of the low level protocol. Could there be an 'INQ' ? Since the SCSI VPD is the most exhaustive in terms of details it may make sense to base it on that..?

Quoted 4 lines
Quoted 4 lines

* Can't pass SCSI commands through if the backend storage driver is bio-based instead of request-based.

Quoted 8 lines
Quoted 2 lines

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as Xen-block.

pvSCSI won't need to support all types of backends. It's enough to support those where passing through SCSI commands makes sense.

Seems to be a similar issue as the above mentioned problem with bio-based backend storage drivers.

In particular the ones we care about are:
- Multipath over FibreChannel devices.
- Linear mapping (LVM) over the multipath.
- And then potentially an filesystem on top of that
- .. and a raw file on the filesystem.

Having SCSI VPD 0x83 page sent to frontend for that would be good.

Not sure about SCSI reservations. Perhaps those are more of .. unique in that the implementation would have to make sure that the guest owns the whole LUN. But that is implementation question.

This is about the design - how would you envision to to cram in SCSI commands or DIF/DIX commands or ATA commands via PV block layer?

Quoted 8 lines
Quoted 6 lines

* Much longer path:

   ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-backend -> Target framework(LIO?) ->

   With xen-block we only need:
   ioctl() -> blkfront -> blkback ->

I'd like to see performance numbers before making a decision.

For SCSI INQ? <laughs>

Or are you talking about raw READ/WRITE?

Quoted 9 lines
Quoted 2 lines

* xen-block has been existed for many years, widely used and more stable.

Adding another SCSI passthrough capability wasn't accepted for pvSCSI (that's the reason I used the Target Framework). Why do you think it will be accepted for pvblk?

This is not my personal opinion, just a heads up from someone who had a try already. ;-)

Right. So SCSI passthrough out. What about mediated access for specific SCSI, or specific ATA, or DIF/DIX ones? And how would you do it knowing the SCSI maintainers much better than we do?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 64 lines · Konrad Rzeszutek Wilk
Quoted 23 lines · Juergen Gross
Quoted 22 lines · Bob Liu

1) What is this patch about?
This patch introduces an new block operation (BLKIF_OP_EXTRA_FLAG). A request with BLKIF_OP_EXTRA_FLAG set means the following request is an extra request which is used to pass through SCSI commands.
This is like a simplified version of XEN_NETIF_EXTRA_* in netif.h. It can be extended easily to transmit other per-request/bio data from frontend to backend e.g Data Integrity Field per bio.

2) Why we need this?
Currently only raw data segments are transmitted from blkfront to blkback, which means some advanced features are lost.
* Guest knows nothing about features of the real backend storage. For example, on bare-metal environment INQUIRY SCSI command can be used to query storage device information. If it's a SSD or flash device we can have the option to use the device as a fast cache.
But this can't happen in current domU guests, because blkfront only knows it's just a normal virtual disk

* Failover Clusters in Windows
Failover clusters require SCSI-3 persistent reservation target disks, but now this can't work in domU.

Quoted 8 lines
Quoted 4 lines

3) Known issues:
* Security issues, how to 'validate' this extra request payload. E.g SCSI operates on LUN bases (the whole disk) while we really just want to operate on partitions

It's not only validation: some operations just affect the whole LUN (e.g. Reserve/Release). And what about "multi-LUN" commands like "report LUNs"?

Don't expose them. Bob and I want to get an idea of what would be a good compromise to allow some SCSI specific (or perhaps ATA specific or DIF/DIX?) type of commands go through the PV driver.

Would it be better if it was through XenBus? But that may not work for some that are tied closely to requests, such as DIF/DIX.

However the 'DISCARD' for example worked out - it is an umbrella for both SCSI UNMAP and ATA DISCARD operation and hides the complexity of the low level protocol. Could there be an 'INQ' ? Since the SCSI VPD is the most exhaustive in terms of details it may make sense to base it on that..?

Quoted 4 lines
Quoted 4 lines

* Can't pass SCSI commands through if the backend storage driver is bio-based instead of request-based.

Quoted 8 lines
Quoted 2 lines

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as Xen-block.

pvSCSI won't need to support all types of backends. It's enough to support those where passing through SCSI commands makes sense.

Seems to be a similar issue as the above mentioned problem with bio-based backend storage drivers.

In particular the ones we care about are:
- Multipath over FibreChannel devices.
- Linear mapping (LVM) over the multipath.
- And then potentially an filesystem on top of that
- .. and a raw file on the filesystem.

Quoted 8 lines

Having SCSI VPD 0x83 page sent to frontend for that would be good.

Not sure about SCSI reservations. Perhaps those are more of .. unique in that the implementation would have to make sure that the guest owns the whole LUN. But that is implementation question.

This is about the design - how would you envision to to cram in SCSI commands or DIF/DIX commands or ATA commands via PV block layer?

Have some kind of abstraction which can be mapped to SCSI commands easily, but don't stick to the SCSI definitions. Use your own structures, commands etc. and build SCSI commands from those in the backend. This way you avoid having to emulate SCSI. Instead of naming it "SCSI passthrough" call it "special commands". :-) I would add only those operations you really need. Add an inquiry operation which returns the supported "special commands". The availability of the inquiry can be reported via Xenstore.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

* Much longer path:

   ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-backend -> Target framework(LIO?) ->
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

With xen-block we only need:

   ioctl() -> blkfront -> blkback ->

I'd like to see performance numbers before making a decision.

For SCSI INQ? <laughs>

Or are you talking about raw READ/WRITE?

READ/WRITE. I'm quite sure pvSCSI will be slower than pvblk, but I don't know how much slower.

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

* xen-block has been existed for many years, widely used and more stable.

Adding another SCSI passthrough capability wasn't accepted for pvSCSI (that's the reason I used the Target Framework). Why do you think it will be accepted for pvblk?

Quoted 6 lines
Quoted 2 lines

This is not my personal opinion, just a heads up from someone who had a try already. ;-)

Right. So SCSI passthrough out. What about mediated access for specific SCSI, or specific ATA, or DIF/DIX ones? And how would you do it knowing the SCSI maintainers much better than we do?

Don't call it SCSI command passthrough, or use the target framework. As stated above: I think renaming the whole feature is better. You'll avoid much trouble and weird configuration problems.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Bob Liu
Quoted 18 lines

-----Original Message-----
From: Bob Liu [mailto:[email protected]]
Sent: 29 February 2016 03:37
To: [email protected]
Cc: Ian Jackson; [email protected]; Roger Pau Monne; [email protected]; Paul Durrant; [email protected]; Bob Liu
Subject: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands

1) What is this patch about?
This patch introduces an new block operation (BLKIF_OP_EXTRA_FLAG). A request with BLKIF_OP_EXTRA_FLAG set means the following request is an extra request which is used to pass through SCSI commands. This is like a simplified version of XEN_NETIF_EXTRA_* in netif.h. It can be extended easily to transmit other per-request/bio data from frontend
to backend e.g Data Integrity Field per bio.

Quoted 12 lines

2) Why we need this?
Currently only raw data segments are transmitted from blkfront to blkback, which
means some advanced features are lost.
* Guest knows nothing about features of the real backend storage. For example, on bare-metal environment INQUIRY SCSI command
can be used
to query storage device information. If it's a SSD or flash device we can have the option to use the device as a fast cache. But this can't happen in current domU guests, because blkfront only knows it's just a normal virtual disk

That's the sort of information that should be advertised via xenstore then. There already feature flags for specific things but if some form of throughput/latency information is meaningful to a frontend stack then perhaps that can be advertised too.

Quoted 4 lines

* Failover Clusters in Windows
Failover clusters require SCSI-3 persistent reservation target disks, but now this can't work in domU.

That's true but allowing arbitrary SCSI messages through is not the way forward IMO. Just because Windows thinks every HBA is SCSI doesn't mean other OS do so I think reservation/release should have dedicated messages in the blkif protocol if it's desirable to support clustering in the frontend.

Quoted 6 lines

3) Known issues:
* Security issues, how to 'validate' this extra request payload. E.g SCSI operates on LUN bases (the whole disk) while we really just want
to
operate on partitions

Quoted 8 lines

* Can't pass SCSI commands through if the backend storage driver is bio-
based
instead of request-based.

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as
Xen-block.

LIO can interface to any block device in much the same way blkback does IIRC.

Quoted 7 lines

* Much longer path:

   ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-

backend -> Target framework(LIO?) ->

With xen-block we only need:

   ioctl() -> blkfront -> blkback ->

...and what happens if the block device that blkback is talking to is a SCSI LUN?

That latter path is also not true for Windows. You've got all the SCSI translation logic in the frontend when using blkif so that first path would collapse to:

Disk driver -> (SCSI) HBA Driver -> xen-scsiback -> LIO -> backstore -> XXX

Quoted 2 lines

* xen-block has been existed for many years, widely used and more stable.

It's definitely widely used, but it has had stability issues in recent times.

Paul

Quoted 112 lines

Welcome any input, thank you!

---
 xen/include/public/io/blkif.h |   73
+++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
xen/include/public/io/blkif.h +1 -0
index 99f0326..7c10bce 100644
@@ -635,6 +635,28 @@
 #define BLKIF_OP_INDIRECT          6
 
 /*
+ * Recognised only if "feature-extra-request" is present in backend xenbus

info.
+ * A request with BLKIF_OP_EXTRA_FLAG indicates an extra request is followed
+ * in the shared ring buffer.
+ *
+ * By this way, extra data like SCSI command, DIF/DIX and other per- request/bio
+ * data can be transmitted from frontend to backend.
+ *
+ * The 'wire' format is like:
+ * Request 1: xen_blkif_request
+ * [Request 2: xen_blkif_extra_request] (only if request 1 has
BLKIF_OP_EXTRA_FLAG)
+ * Request 3: xen_blkif_request
+ * Request 4: xen_blkif_request
+ * [Request 5: xen_blkif_extra_request] (only if request 4 has
BLKIF_OP_EXTRA_FLAG)
+ * ...
+ * Request N: xen_blkif_request
+ *
+ * If a backend does not recognize BLKIF_OP_EXTRA_FLAG, it should *not* create the
+ * "feature-extra-request" node!
+ */

xen/include/public/io/blkif.h +5 -0
+#define BLKIF_OP_EXTRA_FLAG (0x80)
+
+/*
  * Maximum scatter/gather segments per request.
  * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
  * NB. This could be 12 if the ring indexes weren't stored in the same page.
@@ -703,10 +725,61 @@ struct blkif_request_indirect {
 };
 typedef struct blkif_request_indirect blkif_request_indirect_t;
 
+enum blkif_extra_request_type {
+	BLKIF_EXTRA_TYPE_SCSI_CMD = 1,		/* Transmit SCSI

command. */

xen/include/public/io/blkif.h +31 -0
+};
+
+struct scsi_cmd_req {
+	/*
+	 * Grant mapping for transmiting SCSI command to backend, and
+	 * also receive sense data from backend.
+	 * One 4KB page is enough.
+	 */
+	grant_ref_t cmd_gref;
+	/* Length of SCSI command in the grant mapped page. */
+	unsigned int cmd_len;
+
+	/*
+	 * SCSI command may require transmiting data segment length less
+	 * than a sector(512 bytes).
+	 * Record num_sg and last segment length in extra request so that
+	 * backend can know about them.
+	 */
+	unsigned int num_sg;
+	unsigned int last_sg_len;
+};
+
+/*
+ * Extra request, must follow a normal-request and a normal-request can
+ * only be followed by one extra request.
+ */
+struct blkif_request_extra {
+	uint8_t type;		/* BLKIF_EXTRA_TYPE_* */
+	uint16_t _pad1;
+#ifndef CONFIG_X86_32
+	uint32_t _pad2;		/* offsetof(blkif_...,u.extra.id) == 8

*/

xen/include/public/io/blkif.h +18 -1
+#endif
+	uint64_t id;
+	struct scsi_cmd_req scsi_cmd;
+} __attribute__((__packed__));
+typedef struct blkif_request_extra blkif_request_extra_t;
+
+struct scsi_cmd_res {
+	unsigned int resid_len;
+	/* Length of sense data returned in grant mapped page. */
+	unsigned int sense_len;
+};
+
+struct blkif_response_extra {
+	uint8_t type;  /* BLKIF_EXTRA_TYPE_* */
+	struct scsi_cmd_res scsi_cmd;
+} __attribute__((__packed__));
+
 struct blkif_response {
     uint64_t        id;              /* copied from request */
     uint8_t         operation;       /* copied from request */
     int16_t         status;          /* BLKIF_RSP_???       */
+    struct blkif_response_extra extra;
 };
 typedef struct blkif_response blkif_response_t;
 
--
Quoted 1 line

1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
Quoted 31 lines · Paul Durrant
Quoted 18 lines

-----Original Message-----
From: Bob Liu [mailto:[email protected]]
Sent: 29 February 2016 03:37
To: [email protected]
Cc: Ian Jackson; [email protected]; Roger Pau Monne; [email protected]; Paul Durrant; [email protected]; Bob Liu
Subject: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands

1) What is this patch about?
This patch introduces an new block operation (BLKIF_OP_EXTRA_FLAG). A request with BLKIF_OP_EXTRA_FLAG set means the following request is an extra request which is used to pass through SCSI commands. This is like a simplified version of XEN_NETIF_EXTRA_* in netif.h. It can be extended easily to transmit other per-request/bio data from frontend
to backend e.g Data Integrity Field per bio.

Quoted 12 lines

2) Why we need this?
Currently only raw data segments are transmitted from blkfront to blkback, which
means some advanced features are lost.
* Guest knows nothing about features of the real backend storage. For example, on bare-metal environment INQUIRY SCSI command
can be used
to query storage device information. If it's a SSD or flash device we can have the option to use the device as a fast cache. But this can't happen in current domU guests, because blkfront only knows it's just a normal virtual disk

Quoted 1 line

That's the sort of information that should be advertised via xenstore then. There already feature flags for specific things but if some form of throughput/latency information is meaningful to a frontend stack then perhaps that can be advertised too.

Certainly could be put on the XenStore. Do you envision this being done pre guest creation (so toolstack does it), or the backend finds this and populates the XenStore keys?

Or that the frontend writes an XenStore key 'scsi-inq=vpd80' and the backend responds by populating an 'scsi-inq-vpd80=' <binary blob>'? If so can the XenStore accept binary payloads? Can it be more than 4K?

Quoted 7 lines
Quoted 5 lines

* Failover Clusters in Windows
Failover clusters require SCSI-3 persistent reservation target disks, but now this can't work in domU.

That's true but allowing arbitrary SCSI messages through is not the way forward IMO. Just because Windows thinks every HBA is SCSI doesn't mean other OS do so I think reservation/release should have dedicated messages in the blkif protocol if it's desirable to support clustering in the frontend.

Could you expand a bit on the 'dedicated message' you have in mind please?

Quoted 11 lines
Quoted 11 lines

3) Known issues:
* Security issues, how to 'validate' this extra request payload. E.g SCSI operates on LUN bases (the whole disk) while we really just want
to
operate on partitions

* Can't pass SCSI commands through if the backend storage driver is bio-
based
instead of request-based.

Quoted 6 lines
Quoted 4 lines

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as
Xen-block.

LIO can interface to any block device in much the same way blkback does IIRC.

But it can't do multipath or LVMs - which is an integral component.

Anyhow that is more of a implementation specific quirk.

Quoted 9 lines
Quoted 8 lines

* Much longer path:

   ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-

backend -> Target framework(LIO?) ->

With xen-block we only need:

   ioctl() -> blkfront -> blkback ->
Quoted 5 lines

...and what happens if the block device that blkback is talking to is a SCSI LUN?

That latter path is also not true for Windows. You've got all the SCSI translation logic in the frontend when using blkif so that first path would collapse to:

Disk driver -> (SCSI) HBA Driver -> xen-scsiback -> LIO -> backstore -> XXX

I don't know if it matters on the length of the path for say SCSI INQ. It isn't like that is performance specific. Neither are the clustering SCSI commands.

Quoted 5 lines
Quoted 3 lines

* xen-block has been existed for many years, widely used and more stable.

It's definitely widely used, but it has had stability issues in recent times.

Oh? Could you send the bug-reports to me and Roger, CC xen-devel and LKML please ?

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
Quoted 50 lines

-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:[email protected]]
Sent: 29 February 2016 14:56
To: Paul Durrant
Cc: Bob Liu; [email protected]; Ian Jackson; [email protected]; Roger Pau Monne; [email protected]
Subject: Re: [RFC PATCH] xen-block: introduces extra request to pass- through SCSI commands

Quoted 5 lines · Paul Durrant
Quoted 5 lines

-----Original Message-----
From: Bob Liu [mailto:[email protected]]
Sent: 29 February 2016 03:37
To: [email protected]
Cc: Ian Jackson; [email protected]; Roger Pau Monne;

[email protected];

Quoted 2 lines
Quoted 2 lines

Paul Durrant; [email protected]; Bob Liu
Subject: [RFC PATCH] xen-block: introduces extra request to pass-

through

Quoted 5 lines
Quoted 5 lines

SCSI commands

1) What is this patch about?
This patch introduces an new block operation (BLKIF_OP_EXTRA_FLAG). A request with BLKIF_OP_EXTRA_FLAG set means the following request

is an

Quoted 8 lines
Quoted 8 lines

extra request which is used to pass through SCSI commands. This is like a simplified version of XEN_NETIF_EXTRA_* in netif.h. It can be extended easily to transmit other per-request/bio data from frontend
to backend e.g Data Integrity Field per bio.

2) Why we need this?
Currently only raw data segments are transmitted from blkfront to

blkback,

Quoted 11 lines
Quoted 10 lines

which
means some advanced features are lost.
* Guest knows nothing about features of the real backend storage. For example, on bare-metal environment INQUIRY SCSI command
can be used
to query storage device information. If it's a SSD or flash device we can have the option to use the device as a fast cache. But this can't happen in current domU guests, because blkfront only knows it's just a normal virtual disk

Quoted 1 line

That's the sort of information that should be advertised via xenstore then.

There already feature flags for specific things but if some form of throughput/latency information is meaningful to a frontend stack then perhaps that can be advertised too.

Quoted 9 lines

Certainly could be put on the XenStore. Do you envision this being done pre guest creation (so toolstack does it), or the backend finds this and populates the XenStore keys?

Or that the frontend writes an XenStore key 'scsi-inq=vpd80' and the backend
responds by populating an 'scsi-inq-vpd80=' <binary blob>'? If so can the XenStore accept binary payloads? Can it be more than 4K?

I was thinking more along the lines of blkback creating xenstore keys with any relevant information. We have sector size and number of sectors already but I don't see any harm in having values for other quantities that may be useful to a frontend. Bouncing SCSI inquiries via xenstore was certainly not what I was thinking.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

* Failover Clusters in Windows
Failover clusters require SCSI-3 persistent reservation target disks, but now this can't work in domU.

Quoted 7 lines
Quoted 1 line

That's true but allowing arbitrary SCSI messages through is not the way

forward IMO. Just because Windows thinks every HBA is SCSI doesn't mean other OS do so I think reservation/release should have dedicated messages in the blkif protocol if it's desirable to support clustering in the frontend.

Could you expand a bit on the 'dedicated message' you have in mind please?

As in we create message types to reserve/release whatever backend is being used and the backend uses whatever mechanism is appropriate to deal with that. E.g. if it were qdisk talking to a raw file then that might just be an flock.

Quoted 17 lines
Quoted 4 lines
Quoted 4 lines

3) Known issues:
* Security issues, how to 'validate' this extra request payload. E.g SCSI operates on LUN bases (the whole disk) while we really just

want

Quoted 12 lines
Quoted 11 lines

to
operate on partitions

* Can't pass SCSI commands through if the backend storage driver is bio-
based
instead of request-based.

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as
Xen-block.

Quoted 5 lines
Quoted 1 line

LIO can interface to any block device in much the same way blkback does

IIRC.

But it can't do multipath or LVMs - which is an integral component.

Really? I was not aware of that limitation and it surprises me since AFAIK LIO can also use a raw file as a backstore which seems like it would be above either of those.

Quoted 24 lines

Anyhow that is more of a implementation specific quirk.

Quoted 10 lines
Quoted 8 lines

* Much longer path:

   ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-

backend -> Target framework(LIO?) ->

With xen-block we only need:

   ioctl() -> blkfront -> blkback ->

...and what happens if the block device that blkback is talking to is a SCSI

LUN?

Quoted 2 lines

That latter path is also not true for Windows. You've got all the SCSI

translation logic in the frontend when using blkif so that first path would collapse to:

Quoted 2 lines

Disk driver -> (SCSI) HBA Driver -> xen-scsiback -> LIO -> backstore -> XXX

I don't know if it matters on the length of the path for say SCSI INQ. It isn't like
that is performance specific. Neither are the clustering SCSI commands.

Quoted 1 line
Quoted 8 lines
Quoted 1 line
Quoted 1 line

* xen-block has been existed for many years, widely used and more

stable.

Quoted 3 lines
Quoted 1 line

It's definitely widely used, but it has had stability issues in recent times.

Oh? Could you send the bug-reports to me and Roger, CC xen-devel and LKML please ?

I was casting my mind back to incompatibilities that crept in with persistent grants. TBH I haven't used blkback much since then; I tend to use qemu qdisk as my backend these days.

Paul

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw

El 29/2/16 a les 16:28, Paul Durrant ha escrit:

Quoted 22 lines
Quoted 22 lines

-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:[email protected]]
Sent: 29 February 2016 14:56
To: Paul Durrant
Cc: Bob Liu; [email protected]; Ian Jackson; [email protected]; Roger Pau Monne; [email protected]
Subject: Re: [RFC PATCH] xen-block: introduces extra request to pass- through SCSI commands

Quoted 5 lines · Paul Durrant
Quoted 5 lines

-----Original Message-----
From: Bob Liu [mailto:[email protected]]
Sent: 29 February 2016 03:37
To: [email protected]
Cc: Ian Jackson; [email protected]; Roger Pau Monne;

[email protected];

Quoted 3 lines
Quoted 3 lines

Paul Durrant; [email protected]; Bob Liu
Subject: [RFC PATCH] xen-block: introduces extra request to pass-
* xen-block has been existed for many years, widely used and more

stable.

Quoted 2 lines
Quoted 1 line
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

It's definitely widely used, but it has had stability issues in recent times.

Oh? Could you send the bug-reports to me and Roger, CC xen-devel and LKML please ?

I was casting my mind back to incompatibilities that crept in with persistent grants. TBH I haven't used blkback much since then; I tend to use qemu qdisk as my backend these days.

FWIW, QEMU Qdisk also has persistent grants support... and was implemented more or less at the same time as blkback persistent grants.

Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw
Quoted 25 lines · Roger Pau Monné

El 29/2/16 a les 16:28, Paul Durrant ha escrit:

Quoted 24 lines
Quoted 24 lines

-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:[email protected]]
Sent: 29 February 2016 14:56
To: Paul Durrant
Cc: Bob Liu; [email protected]; Ian Jackson; [email protected]; Roger Pau Monne; [email protected]
Subject: Re: [RFC PATCH] xen-block: introduces extra request to pass- through SCSI commands

Quoted 5 lines · Paul Durrant
Quoted 5 lines

-----Original Message-----
From: Bob Liu [mailto:[email protected]]
Sent: 29 February 2016 03:37
To: [email protected]
Cc: Ian Jackson; [email protected]; Roger Pau Monne;

[email protected];

Quoted 3 lines
Quoted 3 lines

Paul Durrant; [email protected]; Bob Liu
Subject: [RFC PATCH] xen-block: introduces extra request to pass-
* xen-block has been existed for many years, widely used and more

stable.

Quoted 3 lines
Quoted 1 line

It's definitely widely used, but it has had stability issues in recent times.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Oh? Could you send the bug-reports to me and Roger, CC xen-devel and LKML please ?

I was casting my mind back to incompatibilities that crept in with persistent grants. TBH I haven't used blkback much since then; I tend to use qemu qdisk as my backend these days.

FWIW, QEMU Qdisk also has persistent grants support... and was implemented more or less at the same time as blkback persistent grants.

<nods>

Perhaps Pauls' definition of 'recent times' means == two years or so :-)

:-)

Quoted 3 lines

Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
Quoted 1 line

-----Original Message-----

[snip]

Quoted 4 lines
Quoted 1 line
Quoted 1 line

I was casting my mind back to incompatibilities that crept in with

persistent grants. TBH I haven't used blkback much since then; I tend to use qemu qdisk as my backend these days.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

FWIW, QEMU Qdisk also has persistent grants support... and was implemented more or less at the same time as blkback persistent grants.

<nods>

Perhaps Pauls' definition of 'recent times' means == two years or so :-)

:-)

Indeed. That's a blink of an eye for someone as ancient as me :-)

Paul

Quoted 3 lines
Quoted 3 lines

Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#10 lore raw
In reply to Bob Liu

Bob Liu writes ("[RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 3 lines

4) Alternative approach: Using PVSCSI instead:
* Doubt PVSCSI can support as many type of backend storage devices as Xen-block.

I don't understand why this would be the case. Your "extra requests" are SCSI CDBs, so your proposal only works with SCSI targets.

Quoted 2 lines

* Much longer path:

   ioctl() -> SCSI upper layer -> Middle layer -> PVSCSI-frontend -> PVSCSI-backend -> Target framework(LIO?) ->

The pvscsi pieces here is precisely the multiplexer that you really want, for this all to work correctly.

If you want your guests to be able to drive this thing properly, you need to make the thing look like a SCSI target anyway. So effectively you've reinvented PVSCSI.

When you say "longer path" do you really mean that the performance is poor ? I don't think this is due to the number of layers here. The layers are quite thin.

If there is a performance problem with PVSCSI then perhaps that should be investigated.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#11 lore raw

Ian Jackson writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 1 line

[stuff suggesting use of PVSCSI instead]

For the avoidance of doubt:

1. Thanks very much for bringing this proposal to us at the concept stage. It is much easier to discuss these matters in a constructive way before a lot of effort has been put into an implementation.

2. I should explain the downsides which I see in your proposal:

- Your suggestion has bad security properties: previously, the PV block protocol would present only a very simple and narrow interface. Your SCSI CDB passthrough proposal means that guests would be able to activate features in SCSI targets which would be unexpected and unintended by the host administrator. Such features would perhaps even be unknown to the host administrator.

This could be mitigated by making this feature configurable, of course, defaulting to off, along with clear documentation. But it's not a desirable property.

- For similar reasons it will often be difficult to use such a feature safely. Guest software in particular might expect that it can safely use whatever features it can see, and do all sorts of exciting things.

- It involves duplicating multiplexing logic which already exists in PVSCSI.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#12 lore raw
Quoted 22 lines · Ian Jackson

Ian Jackson writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 1 line

[stuff suggesting use of PVSCSI instead]

For the avoidance of doubt:

1. Thanks very much for bringing this proposal to us at the concept stage. It is much easier to discuss these matters in a constructive way before a lot of effort has been put into an implementation.

2. I should explain the downsides which I see in your proposal:

- Your suggestion has bad security properties: previously, the PV block protocol would present only a very simple and narrow interface. Your SCSI CDB passthrough proposal means that guests would be able to activate features in SCSI targets which would be unexpected and unintended by the host administrator. Such features would perhaps even be unknown to the host administrator.

This could be mitigated by making this feature configurable, of course, defaulting to off, along with clear documentation. But it's not a desirable property.

Quoted 8 lines

- For similar reasons it will often be difficult to use such a feature safely. Guest software in particular might expect that it can safely use whatever features it can see, and do all sorts of exciting things.

- It involves duplicating multiplexing logic which already exists in PVSCSI.

One thing I'm still not sure about PVSCSI is do we have the same security issue since LIO can interface to any block device. E.g when using a partition /dev/sda1 as the PVSCSI-backend, but the PVSCSI-frontend may send SCSI operates on LUN bases (the whole disk).

P.S. Thanks to all of you, it helps a lot!

Signature · 7 lines
Regards,
-Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#13 lore raw
In reply to Ian Jackson
Quoted 22 lines · Ian Jackson

Ian Jackson writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 1 line

[stuff suggesting use of PVSCSI instead]

For the avoidance of doubt:

1. Thanks very much for bringing this proposal to us at the concept stage. It is much easier to discuss these matters in a constructive way before a lot of effort has been put into an implementation.

2. I should explain the downsides which I see in your proposal:

- Your suggestion has bad security properties: previously, the PV block protocol would present only a very simple and narrow interface. Your SCSI CDB passthrough proposal means that guests would be able to activate features in SCSI targets which would be unexpected and unintended by the host administrator. Such features would perhaps even be unknown to the host administrator.

This could be mitigated by making this feature configurable, of course, defaulting to off, along with clear documentation. But it's not a desirable property.

Quoted 8 lines

- For similar reasons it will often be difficult to use such a feature safely. Guest software in particular might expect that it can safely use whatever features it can see, and do all sorts of exciting things.

- It involves duplicating multiplexing logic which already exists in PVSCSI.

One thing I'm still not sure about PVSCSI is do we have the same security issue since LIO can interface to any block device. E.g when using a partition /dev/sda1 as the PVSCSI-backend, but the PVSCSI-frontend may still send SCSI operates on LUN bases (the whole disk).

P.S. Thanks to all of you, it helps a lot!

Signature · 7 lines
Regards,
-Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#14 lore raw

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 2 lines

One thing I'm still not sure about PVSCSI is do we have the same security issue since LIO can interface to any block device. E.g when using a partition /dev/sda1 as the PVSCSI-backend, but the PVSCSI-frontend may still send SCSI operates on LUN bases (the whole disk).

I don't think you can use pvscsi to passthrough a partition such as /dev/sda1. Such a thing is not a SCSI command target.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#15 lore raw
Quoted 6 lines · Ian Jackson

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 2 lines

One thing I'm still not sure about PVSCSI is do we have the same security issue since LIO can interface to any block device. E.g when using a partition /dev/sda1 as the PVSCSI-backend, but the PVSCSI-frontend may still send SCSI operates on LUN bases (the whole disk).

I don't think you can use pvscsi to passthrough a partition such as /dev/sda1. Such a thing is not a SCSI command target.

It might be possible via the fileio target backend. In this case LUN based SCSI operations are ignored/refused/emulated by LIO.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#16 lore raw

Hi Juergen,

Quoted 11 lines · Juergen Gross
Quoted 6 lines · Ian Jackson

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 2 lines

One thing I'm still not sure about PVSCSI is do we have the same security issue since LIO can interface to any block device. E.g when using a partition /dev/sda1 as the PVSCSI-backend, but the PVSCSI-frontend may still send SCSI operates on LUN bases (the whole disk).

I don't think you can use pvscsi to passthrough a partition such as /dev/sda1. Such a thing is not a SCSI command target.

It might be possible via the fileio target backend. In this case LUN based SCSI operations are ignored/refused/emulated by LIO.

Do you know whether pvscsi can work on top of multipath(the device-mapper framework) or LVMs? Thank you!

Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#17 lore raw

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 1 line

Do you know whether pvscsi can work on top of multipath(the device-mapper framework) or LVMs?

No, it can't. devmapper and LVM work with the block device abstraction.

Implicitly you seem to be suggesting that you want to use dm-multipath and LVM, but also send other SCSI CDBs from the upper layers through to the underlying SCSI storage target.

I can't see how that could cause anything but pain. In many cases "the underlying SCSI storage target" wouldn't be well defined. Even if it was, these side channel SCSI commands are likely to Go Wrong in exciting ways.

What SCSI commands do you want to send ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#18 lore raw
Quoted 9 lines

-----Original Message-----
From: Ian Jackson [mailto:[email protected]]
Sent: 02 March 2016 11:41
To: Bob Liu
Cc: Juergen Gross; [email protected]; [email protected]; Roger Pau Monne; Paul Durrant; [email protected]
Subject: Re: [RFC PATCH] xen-block: introduces extra request to pass- through SCSI commands

Quoted 8 lines

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 1 line

Do you know whether pvscsi can work on top of multipath(the device-

mapper framework) or LVMs?

No, it can't. devmapper and LVM work with the block device abstraction.

Google suggests you can use LIO to present an LV as a virtual SCSI LUN, in which case pvscsi should work.

Paul

Quoted 4 lines

Implicitly you seem to be suggesting that you want to use dm-multipath and LVM, but also send other SCSI CDBs from the upper layers through to the underlying SCSI storage target.

Quoted 8 lines

I can't see how that could cause anything but pain. In many cases "the underlying SCSI storage target" wouldn't be well defined. Even if it was, these side channel SCSI commands are likely to Go Wrong in exciting ways.

What SCSI commands do you want to send ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#19 lore raw
Quoted 11 lines · Paul Durrant
Quoted 11 lines

-----Original Message-----
From: Ian Jackson [mailto:[email protected]]
Sent: 02 March 2016 11:41
To: Bob Liu
Cc: Juergen Gross; [email protected]; [email protected]; Roger Pau Monne; Paul Durrant; [email protected]
Subject: Re: [RFC PATCH] xen-block: introduces extra request to pass- through SCSI commands

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Do you know whether pvscsi can work on top of multipath(the device-

mapper framework) or LVMs?

No, it can't. devmapper and LVM work with the block device abstraction.

Google suggests you can use LIO to present an LV as a virtual SCSI LUN, in which case pvscsi should work.

Indeed: http://linux-iscsi.org/wiki/Targetcli#IBLOCK

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#20 lore raw
In reply to Ian Jackson
Quoted 10 lines · Ian Jackson

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 1 line

Do you know whether pvscsi can work on top of multipath(the device-mapper framework) or LVMs?

No, it can't. devmapper and LVM work with the block device abstraction.

Implicitly you seem to be suggesting that you want to use dm-multipath and LVM, but also send other SCSI CDBs from the upper layers through to the underlying SCSI storage target.

Exactly!

Quoted 7 lines

I can't see how that could cause anything but pain. In many cases "the underlying SCSI storage target" wouldn't be well defined. Even if it was, these side channel SCSI commands are likely to Go Wrong in exciting ways.

What SCSI commands do you want to send ?

* INQUIRY

* PERSISTENT RESERVE IN
* PERSISTENT RESERVE OUT
This is for Failover Clusters in Windows, not sure whether more commands are required. I didn't get a required scsi commands list in the failover document.

Signature · 7 lines
Regards,
-Bob

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#21 lore raw

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 9 lines · Ian Jackson
Quoted 6 lines

I can't see how that could cause anything but pain. In many cases "the underlying SCSI storage target" wouldn't be well defined. Even if it was, these side channel SCSI commands are likely to Go Wrong in exciting ways.

What SCSI commands do you want to send ?

* INQUIRY

... but why ?

Quoted 6 lines

* PERSISTENT RESERVE IN
* PERSISTENT RESERVE OUT

This is for Failover Clusters in Windows, not sure whether more commands are required. I didn't get a required scsi commands list in the failover document.

So you want to be able to reserve the volume against concurrent access ? If you're using LVM, such a reservation should apply to the LVM LV, not to the underlying physical storage device, clearly. So I think LIO [1] + PVSCSI might be what you want.

Ian.

[1] http://linux-iscsi.org/wiki/LIO

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#23 lore raw
Quoted 34 lines

-----Original Message-----
From: Konrad Rzeszutek Wilk [mailto:[email protected]]
Sent: 02 March 2016 17:23
To: Ian Jackson
Cc: Bob Liu; Juergen Gross; [email protected]; [email protected]; Roger Pau Monne; Paul Durrant
Subject: Re: [RFC PATCH] xen-block: introduces extra request to pass- through SCSI commands

Quoted 1 line · Ian Jackson

Bob Liu writes ("Re: [RFC PATCH] xen-block: introduces extra request to

pass-through SCSI commands"):

Quoted 11 lines
Quoted 9 lines · Ian Jackson
Quoted 6 lines

I can't see how that could cause anything but pain. In many cases "the underlying SCSI storage target" wouldn't be well defined. Even if it was, these side channel SCSI commands are likely to Go Wrong in exciting ways.

What SCSI commands do you want to send ?

* INQUIRY

... but why ?

Need to expose VPD information to the guest for application usage.

Quoted 8 lines
Quoted 7 lines

* PERSISTENT RESERVE IN
* PERSISTENT RESERVE OUT

This is for Failover Clusters in Windows, not sure whether more commands are required. I didn't get a required scsi commands list in the failover document.

Quoted 8 lines
Quoted 5 lines

So you want to be able to reserve the volume against concurrent access ? If you're using LVM, such a reservation should apply to the LVM LV, not to the underlying physical storage device, clearly. So I think LIO [1] + PVSCSI might be what you want.

Except it would mean writting a new Windows PV driver and replacing the existing block one.

Actually, that's quite desirable. The existing driver is actually a SCSI HBA driver (because that's all you can write is you use thr Windows STORPORT wrapper... which you need to if you want to pass WHQL) so making it use a PV scsi protocol would probably make it smaller since all the scsi <-> blkif translation code could be ripped out and all the stuff to synthesize INQUIRY responses based on vbd data in xenstore could go away too.

Paul

Quoted 5 lines
Quoted 5 lines

Ian.

[1] http://linux-iscsi.org/wiki/LIO

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#24 lore raw

Paul Durrant writes ("RE: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 7 lines

Actually, that's quite desirable. The existing driver is actually a SCSI HBA driver (because that's all you can write is you use thr Windows STORPORT wrapper... which you need to if you want to pass WHQL) so making it use a PV scsi protocol would probably make it smaller since all the scsi <-> blkif translation code could be ripped out and all the stuff to synthesize INQUIRY responses based on vbd data in xenstore could go away too.

Do non-Linux hosts have something like LIO ?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#25 lore raw
Quoted 10 lines · Ian Jackson

Paul Durrant writes ("RE: [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands"):

Quoted 7 lines

Actually, that's quite desirable. The existing driver is actually a SCSI HBA driver (because that's all you can write is you use thr Windows STORPORT wrapper... which you need to if you want to pass WHQL) so making it use a PV scsi protocol would probably make it smaller since all the scsi <-> blkif translation code could be ripped out and all the stuff to synthesize INQUIRY responses based on vbd data in xenstore could go away too.

Do non-Linux hosts have something like LIO ?

Are there any pvSCSI backends other than the one in Linux?

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#26 lore raw
Quoted 11 lines · Juergen Gross
Quoted 1 line · Ian Jackson

Paul Durrant writes ("RE: [RFC PATCH] xen-block: introduces extra

request to pass-through SCSI commands"):

Quoted 8 lines
Quoted 7 lines

Actually, that's quite desirable. The existing driver is actually a SCSI HBA driver (because that's all you can write is you use thr Windows STORPORT wrapper... which you need to if you want to pass WHQL) so making it use a PV scsi protocol would probably make it smaller since all the scsi <-> blkif translation code could be ripped out and all the stuff to synthesize INQUIRY responses based on vbd data in xenstore could go away too.

Wait a minute? You have that in the driver? Is this documented somewhere? Did I miss this in blkif.h?

Quoted 4 lines
Quoted 1 line

Do non-Linux hosts have something like LIO ?

Are there any pvSCSI backends other than the one in Linux?

Not that I know off.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#27 lore raw
Quoted 22 lines

-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Konrad Rzeszutek Wilk
Sent: 03 March 2016 14:07
To: Juergen Gross; Ian Jackson; Paul Durrant
Cc: [email protected]; [email protected]; Roger Pau Monne
Subject: Re: [Xen-devel] [RFC PATCH] xen-block: introduces extra request to pass-through SCSI commands

Quoted 11 lines · Juergen Gross
Quoted 1 line · Ian Jackson

Paul Durrant writes ("RE: [RFC PATCH] xen-block: introduces extra

request to pass-through SCSI commands"):

Quoted 8 lines
Quoted 7 lines

Actually, that's quite desirable. The existing driver is actually a SCSI HBA driver (because that's all you can write is you use thr Windows STORPORT wrapper... which you need to if you want to pass WHQL) so making it use a PV scsi protocol would probably make it smaller since all the scsi <-> blkif translation code could be ripped out and all the stuff to synthesize INQUIRY responses based on vbd data in xenstore could go away too.

Quoted 3 lines

Wait a minute? You have that in the driver? Is this documented somewhere? Did I miss this in blkif.h?

Yes, the Windows XENVBD driver has a whole load of code for synthesizing INQUIRY responses since that's how Windows probes for disks. There's nothing in blkif.h for any of this though since it’s an implementation detail of the Windows frontend. However, if you want to take a look, go to http://xenbits.xen.org/gitweb/?p=pvdrivers/win/xenvbd.git;a=blob;f=src/xenvbd/pdoinquiry.c. There's even code in there for base64 decoding VPD pages from xenstore! (That's a XenServer implementation artefact... I'm not recommending it as a way forward ;-))

Paul

Quoted 11 lines
Quoted 5 lines
Quoted 2 lines

Do non-Linux hosts have something like LIO ?

Are there any pvSCSI backends other than the one in Linux?

Not that I know off.

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel