[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] include/public: add command result definitions to vscsiif.h


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Juergen Gross <jgross@xxxxxxxx>
  • Date: Mon, 14 Mar 2022 10:39:48 +0100
  • Delivery-date: Mon, 14 Mar 2022 09:39:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Ping?

On 28.02.22 12:22, Juergen Gross wrote:
The result field of struct vscsiif_response is lacking a detailed
definition. Today the Linux kernel internal scsi definitions are being
used, which is not a sane interface for a PV device driver.

Add macros to change that by using today's values in the XEN namespace.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
  xen/include/public/io/vscsiif.h | 27 +++++++++++++++++++++++++++
  1 file changed, 27 insertions(+)

diff --git a/xen/include/public/io/vscsiif.h b/xen/include/public/io/vscsiif.h
index c9ceb1884d..17a9033b43 100644
--- a/xen/include/public/io/vscsiif.h
+++ b/xen/include/public/io/vscsiif.h
@@ -315,6 +315,33 @@ struct vscsiif_response {
  };
  typedef struct vscsiif_response vscsiif_response_t;
+/* SCSI I/O status from vscsiif_response->rslt */
+#define XEN_VSCSIIF_RSLT_STATUS(x)  (x & 0x00ff)
+
+/* Host I/O status from vscsiif_response->rslt */
+#define XEN_VSCSIIF_RSLT_HOST(x)    ((unsigned)x >> 16)
+#define XEN_VSCSIIF_RSLT_HOST_OK         0
+#define XEN_VSCSIIF_RSLT_HOST_NO_CONN    1 /* Couldn't connect before timeout 
*/
+#define XEN_VSCSIIF_RSLT_HOST_BUS_BUSY   2 /* BUS busy through timeout */
+#define XEN_VSCSIIF_RSLT_HOST_TIME_OUT   3 /* TIMED OUT for other reason */
+#define XEN_VSCSIIF_RSLT_HOST_BAD_TARG   4 /* BAD target */
+#define XEN_VSCSIIF_RSLT_HOST_ABORT      5 /* Abort for some other reason */
+#define XEN_VSCSIIF_RSLT_HOST_PARITY     6 /* Parity error */
+#define XEN_VSCSIIF_RSLT_HOST_ERROR      7 /* Internal error */
+#define XEN_VSCSIIF_RSLT_HOST_RESET      8 /* Reset by somebody */
+#define XEN_VSCSIIF_RSLT_HOST_BAD_INTR   9 /* Unexpected interrupt */
+#define XEN_VSCSIIF_RSLT_HOST_PASSTHR   10 /* Force command past mid-layer */
+#define XEN_VSCSIIF_RSLT_HOST_SOFT_ERR  11 /* Retry requested */
+#define XEN_VSCSIIF_RSLT_HOST_IMM_RETR  12 /* Hidden retry requested */
+#define XEN_VSCSIIF_RSLT_HOST_REQUEUE   13 /* Requeue command requested */
+#define XEN_VSCSIIF_RSLT_HOST_DISRUPT   14 /* Transport error disrupted I/O */
+#define XEN_VSCSIIF_RSLT_HOST_FAILFAST  15 /* Transport class fastfailed */
+#define XEN_VSCSIIF_RSLT_HOST_TARG_FAIL 16 /* Permanent target failure */
+#define XEN_VSCSIIF_RSLT_HOST_NEX_FAIL  17 /* Permanent nexus failure on path 
*/
+#define XEN_VSCSIIF_RSLT_HOST_NOMEM     18 /* Space allocation failed */
+#define XEN_VSCSIIF_RSLT_HOST_MED_ERR   19 /* Medium error */
+#define XEN_VSCSIIF_RSLT_HOST_MARGINAL  20 /* Transport marginal errors */
+
  DEFINE_RING_TYPES(vscsiif, struct vscsiif_request, struct vscsiif_response);

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.