From: Juergen Gross <jgross@suse.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] include/public: add command result definitions to vscsiif.h
Date: Wed, 23 Mar 2022 13:12:02 +0100 [thread overview]
Message-ID: <018d1ab1-c661-2e4c-1e70-ee0f8f3f24ce@suse.com> (raw)
In-Reply-To: <C69C67B6-4959-4594-A32B-78044CB0EDB2@arm.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 3636 bytes --]
On 23.03.22 12:10, Luca Fancellu wrote:
>
>
>> On 23 Mar 2022, at 08:58, Juergen Gross <jgross@suse.com> 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@suse.com>
>> ---
>> 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?
They are not meant to be compared, even if they have (today) the same
value.
>
> However this looks good to me,
>
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Thanks,
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
next prev parent reply other threads:[~2022-03-23 12:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 8:58 [PATCH v2] include/public: add command result definitions to vscsiif.h Juergen Gross
2022-03-23 11:10 ` Luca Fancellu
2022-03-23 11:22 ` Luca Fancellu
2022-03-23 12:13 ` Juergen Gross
2022-03-23 12:12 ` Juergen Gross [this message]
2022-04-19 8:34 ` Juergen Gross
2022-04-19 9:24 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=018d1ab1-c661-2e4c-1e70-ee0f8f3f24ce@suse.com \
--to=jgross@suse.com \
--cc=Luca.Fancellu@arm.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.