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

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


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 23 Mar 2022 11:10:46 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gnfH39a5IFLykrlZuM9gfbuHOTbcItj5VeWY+wzlayg=; b=N4Pa0T+LTlQTfgXH7Xf+l/oXrVSJWQyQsOV4oJTfTAh8a4ieHzqzehnBoRWRLzn6PEND/16qgrYI2QHC0QYgmbK0DBDKDgxabfgmOL7dzuYVif0J5VsbQk4C3/rFMRGRB//Mlodc60VcyYhYiumW4ms2TDr/3DtaAOaSuYM0kIpvfITtmvPcrRvAAoAVowfxGDjTm4HMFsTmEkeDdIn5MkUh+UvHZE3S4Zw3Q+HkNmlX1UWeJleBhINsKsCETSzk009jY5E8odxIToY6Ajrt866hxCwutReEfrCMb3x1tTArWlrb89z0iAhdjg1HYL9WKJ+JLS7O88IBwp3I+UqwhA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N80MnU+Biy9Z8qZKVWzqbLbbUyLIuMdn86+2gLww6Z+nVZG/7pRPAGH6b1ILG2QJUJYKZfLDRCTahHHKjnrg1MVIylztwW6NP6d4YEa7MNCz2ZYCRiAbNIbFrKfOqBa/Anx7h4eruxabkb3TL5h8ntgwGBQXX+ZfBRV6Y8J0PFGhWai7Hrn2ojfpFFdkU5b8KicLhM1ZyELCtjdyGI2lyBDS6VcdLDRmLEXFS+g679l4sK2uA1VS567gptM8BLpA8WUZY4aQKnC0SBEeWFXaaVLrxsUfc2KwN0cPLsHd6JBpPLj1XAlXeTjcm44lr5dliiF/e3xyB4bF3aMX7ZBLig==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 23 Mar 2022 11:11:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYPpQ58aXPwYTvBkyN7CpMP587w6zM0CCA
  • Thread-topic: [PATCH v2] include/public: add command result definitions to vscsiif.h


> On 23 Mar 2022, at 08:58, Juergen Gross <jgross@xxxxxxxx> 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>
> ---
> V2:
> - put macro parameters in parentheses (Jan Beulich)
> - correct XEN_VSCSIIF_RSLT_HOST() (Jan Beulich)
> - more verbose result defines (Jan Beulich)
> - add reset result defines (Jan Beulich)
> ---
> xen/include/public/io/vscsiif.h | 51 +++++++++++++++++++++++++++++++++
> 1 file changed, 51 insertions(+)
> 
> diff --git a/xen/include/public/io/vscsiif.h b/xen/include/public/io/vscsiif.h
> index c9ceb1884d..8553b17cc6 100644
> --- a/xen/include/public/io/vscsiif.h
> +++ b/xen/include/public/io/vscsiif.h
> @@ -315,6 +315,57 @@ 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)    (((x) & 0x00ff0000) >> 16)
> +#define XEN_VSCSIIF_RSLT_HOST_OK                   0
> +/* Couldn't connect before timeout */
> +#define XEN_VSCSIIF_RSLT_HOST_NO_CONNECT           1
> +/* Bus busy through timeout */
> +#define XEN_VSCSIIF_RSLT_HOST_BUS_BUSY             2
> +/* Timed out for other reason */
> +#define XEN_VSCSIIF_RSLT_HOST_TIME_OUT             3
> +/* Bad target */
> +#define XEN_VSCSIIF_RSLT_HOST_BAD_TARGET           4
> +/* Abort for some other reason */
> +#define XEN_VSCSIIF_RSLT_HOST_ABORT                5
> +/* Parity error */
> +#define XEN_VSCSIIF_RSLT_HOST_PARITY               6
> +/* Internal error */
> +#define XEN_VSCSIIF_RSLT_HOST_ERROR                7
> +/* Reset by somebody */
> +#define XEN_VSCSIIF_RSLT_HOST_RESET                8
> +/* Unexpected interrupt */
> +#define XEN_VSCSIIF_RSLT_HOST_BAD_INTR             9
> +/* Force command past mid-layer */
> +#define XEN_VSCSIIF_RSLT_HOST_PASSTHROUGH         10
> +/* Retry requested */
> +#define XEN_VSCSIIF_RSLT_HOST_SOFT_ERROR          11
> +/* Hidden retry requested */
> +#define XEN_VSCSIIF_RSLT_HOST_IMM_RETRY           12
> +/* Requeue command requested */
> +#define XEN_VSCSIIF_RSLT_HOST_REQUEUE             13
> +/* Transport error disrupted I/O */
> +#define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_DISRUPTED 14
> +/* Transport class fastfailed */
> +#define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_FAILFAST  15
> +/* Permanent target failure */
> +#define XEN_VSCSIIF_RSLT_HOST_TARGET_FAILURE      16
> +/* Permanent nexus failure on path */
> +#define XEN_VSCSIIF_RSLT_HOST_NEXUS_FAILURE       17
> +/* Space allocation on device failed */
> +#define XEN_VSCSIIF_RSLT_HOST_ALLOC_FAILURE       18
> +/* Medium error */
> +#define XEN_VSCSIIF_RSLT_HOST_MEDIUM_ERROR        19
> +/* Transport marginal errors */
> +#define XEN_VSCSIIF_RSLT_HOST_TRANSPORT_MARGINAL  20

Hi Juergen,

Would it makes sense to define the values in hex like in 
include/scsi/scsi_status.h
so that they are more easy to compare?

However this looks good to me,

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>


> +
> +/* Result values of reset operations */
> +#define XEN_VSCSIIF_RSLT_RESET_SUCCESS  0x2002
> +#define XEN_VSCSIIF_RSLT_RESET_FAILED   0x2003
> +
> DEFINE_RING_TYPES(vscsiif, struct vscsiif_request, struct vscsiif_response);
> 
> 
> -- 
> 2.34.1
> 
> 




 


Rackspace

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