All of lore.kernel.org
 help / color / mirror / Atom feed
* [SPDK] הנושא:  IO error for application targets
@ 2018-03-19 19:26 Shahar Salzman
  0 siblings, 0 replies; 3+ messages in thread
From: Shahar Salzman @ 2018-03-19 19:26 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3475 bytes --]

Hi Daniel,

Thanks for your help!
I will see if I can add some additional info that will "convince" the host not to hang on the device on the one hand but on the other hand, to fail the IO instead of returning an invalid buffer.
Some details on the setup: spdk is used as a target for our existing storage appliance (we were scsi only using scst up to now), integration is done via a bdev module which passes IO from spdk to/from the appliance using rings. We would be happy to share this bdev module if there is any interest in it.
Host is a standard centos using Linux nvme initiator, we simply did normal nvme discover/connect, and processes started to hang on nvme list.
Connectivity is 25g on the target going through a 100g switch, initiator is a VM using an sriov allocated port.

Shahar

-------- ����� ������ --------
����: Re: [SPDK] IO error for application targets
���: "Verkamp, Daniel"
��: Storage Performance Development Kit
����:

Hi Shahar,

The IO_STATUS_SCSI_ERROR and IO_STATUS_NVME_ERROR status codes should be set via spdk_bdev_io_complete_scsi_status() and spdk_bdev_io_complete_nvme_status(), respectively.  They can be used to store additional error information that the application can retrieve via spdk_bdev_io_get_scsi_status() and spdk_bdev_io_get_nvme_status().

What setup are you testing with dd? Is this exporting a bdev via iscsi_tgt, nvmf_tgt, or some other scenario?  Depending on the SPDK application, the extra error information you report might or might not be utilized.

Thanks,
-- Daniel

From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Shahar Salzman
Sent: Monday, March 19, 2018 8:17 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] IO error for application targets


Hi,



I am working on some application error scenarios and am wondering what return codes I should use.

I am running my own blockdev which routes IO to a userspace application, I am currently looking at a scenario where the NSID does not exist, but am also thinking about how to handle an IO which is out of bounds, and other such scenarios.



Looking at the blockdev completions, I can see only a limited set of IO errors I can return:
enum spdk_bdev_io_status {
/*
* NOMEM should be returned when a bdev module cannot start an I/O because of
*  some lack of resources.  It may not be returned for RESET I/O.  I/O completed
*  with NOMEM status will be retried after some I/O from the same channel have
*  completed.
*/
SPDK_BDEV_IO_STATUS_NOMEM = -4,
SPDK_BDEV_IO_STATUS_SCSI_ERROR = -3,
SPDK_BDEV_IO_STATUS_NVME_ERROR = -2,
SPDK_BDEV_IO_STATUS_FAILED = -1,
SPDK_BDEV_IO_STATUS_PENDING = 0,
SPDK_BDEV_IO_STATUS_SUCCESS = 1,
};


I tried both FAILED and NVME_ERROR running dd (read) to an invalid device, and each status gave me different results:

FAILED - process hangs in D state for 30 seconds, and eventually returns an IO error

NVME_ERROR - process returns immediately with some data (doesn't seem random, not sure if it what the application had in its buffer or if some transaction had been made)



I obviously prefer the FAILED return code, but I also get a blkid hung in D state, and other operations (e.g. disconnect) take a very long time.



What does the NVME_ERROR mean? Is there a way to give some more error information, e.g. something like enodev?



Thanks,

Shahar



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 9519 bytes --]

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

* Re: [SPDK] הנושא:  IO error for application targets
@ 2018-03-22 12:56 Shahar Salzman
  0 siblings, 0 replies; 3+ messages in thread
From: Shahar Salzman @ 2018-03-22 12:56 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 5867 bytes --]

Hi,

I have tried plating around with some return codes, tried:
- SPDK_NVME_SC_INVALID_NAMESPACE_OR_FORMAT
- SPDK_NVME_SC_NAMESPACE_NOT_ATTACHED

Both commands cause the initiator to hang while disconnecting NVMeF :-(

What I see in the application is that I am getting a constant flow of commands to offset 0 of the invalid device.
Looking at the stack of the disconnect process I can it is attempting to complete work to the nvme device, so it seems that the return codes I am trying are causing the initiator to retry the command.

[<ffffffff920ac3e4>] flush_work+0x124/0x1c0
[<ffffffffc0afb4cf>] nvme_rdma_del_ctrl+0x7f/0xb0 [nvme_rdma]
[<ffffffffc0b043b4>] nvme_sysfs_delete+0x34/0x50 [nvme_core]
[<ffffffff924d1060>] dev_attr_store+0x20/0x30
[<ffffffff922d4b9e>] sysfs_kf_write+0x3e/0x40
[<ffffffff922d4672>] kernfs_fop_write+0x132/0x1a0
[<ffffffff9224db48>] __vfs_write+0x38/0xe0
[<ffffffff9224dcb1>] vfs_write+0xc1/0x130
[<ffffffff9224ecea>] SyS_write+0x5a/0xb0
[<ffffffff9279dc77>] entry_SYSCALL_64_fastpath+0x1a/0xa9
[<ffffffffffffffff>] 0xffffffffffffffff

I am using a 4.9.6 kernel w/ Mellanox OFED 4.0-1.0.1.

Does anyone have experience with this type of scenario? It is not a valid scenario, but it may happen if we have a management bug (i.e. mapping the namespace with a wrong NSID), the behavior I would like from the initiator is not to hang, I can deal with the stale nvme devices.

Thanks,
Shahar
________________________________
From: Shahar Salzman
Sent: Tuesday, March 20, 2018 12:47:50 PM
To: Storage Performance Development Kit
Subject: Re: �����: [SPDK] IO error for application targets


Hi,


Regarding the specific scenario, an error where a namespace is added to the subsystem, but the application does not support this namespace (obviously this is an error in our internal management flow, I just don't want to brick the initiator when this happens).

Looking at the spec, it would seem that SPDK_NVME_SC_NAMESPACE_NOT_READY with the DNR bit set. Does this sound right? Is there a way to issue such a status + dnr from the bdev layer?


Shahar

________________________________
From: Shahar Salzman
Sent: Monday, March 19, 2018 9:26:11 PM
To: Storage Performance Development Kit
Subject: �����: [SPDK] IO error for application targets

Hi Daniel,

Thanks for your help!
I will see if I can add some additional info that will "convince" the host not to hang on the device on the one hand but on the other hand, to fail the IO instead of returning an invalid buffer.
Some details on the setup: spdk is used as a target for our existing storage appliance (we were scsi only using scst up to now), integration is done via a bdev module which passes IO from spdk to/from the appliance using rings. We would be happy to share this bdev module if there is any interest in it.
Host is a standard centos using Linux nvme initiator, we simply did normal nvme discover/connect, and processes started to hang on nvme list.
Connectivity is 25g on the target going through a 100g switch, initiator is a VM using an sriov allocated port.

Shahar

-------- ����� ������ --------
����: Re: [SPDK] IO error for application targets
���: "Verkamp, Daniel"
��: Storage Performance Development Kit
����:


Hi Shahar,



The IO_STATUS_SCSI_ERROR and IO_STATUS_NVME_ERROR status codes should be set via spdk_bdev_io_complete_scsi_status() and spdk_bdev_io_complete_nvme_status(), respectively.  They can be used to store additional error information that the application can retrieve via spdk_bdev_io_get_scsi_status() and spdk_bdev_io_get_nvme_status().



What setup are you testing with dd? Is this exporting a bdev via iscsi_tgt, nvmf_tgt, or some other scenario?  Depending on the SPDK application, the extra error information you report might or might not be utilized.



Thanks,

-- Daniel



From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Shahar Salzman
Sent: Monday, March 19, 2018 8:17 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] IO error for application targets



Hi,



I am working on some application error scenarios and am wondering what return codes I should use.

I am running my own blockdev which routes IO to a userspace application, I am currently looking at a scenario where the NSID does not exist, but am also thinking about how to handle an IO which is out of bounds, and other such scenarios.



Looking at the blockdev completions, I can see only a limited set of IO errors I can return:

enum spdk_bdev_io_status {

/*

* NOMEM should be returned when a bdev module cannot start an I/O because of

*  some lack of resources.  It may not be returned for RESET I/O.  I/O completed

*  with NOMEM status will be retried after some I/O from the same channel have

*  completed.

*/

SPDK_BDEV_IO_STATUS_NOMEM = -4,

SPDK_BDEV_IO_STATUS_SCSI_ERROR = -3,

SPDK_BDEV_IO_STATUS_NVME_ERROR = -2,

SPDK_BDEV_IO_STATUS_FAILED = -1,

SPDK_BDEV_IO_STATUS_PENDING = 0,

SPDK_BDEV_IO_STATUS_SUCCESS = 1,

};



I tried both FAILED and NVME_ERROR running dd (read) to an invalid device, and each status gave me different results:

FAILED - process hangs in D state for 30 seconds, and eventually returns an IO error

NVME_ERROR - process returns immediately with some data (doesn't seem random, not sure if it what the application had in its buffer or if some transaction had been made)



I obviously prefer the FAILED return code, but I also get a blkid hung in D state, and other operations (e.g. disconnect) take a very long time.



What does the NVME_ERROR mean? Is there a way to give some more error information, e.g. something like enodev?



Thanks,

Shahar



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 13654 bytes --]

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

* Re: [SPDK] הנושא:  IO error for application targets
@ 2018-03-20 10:47 Shahar Salzman
  0 siblings, 0 replies; 3+ messages in thread
From: Shahar Salzman @ 2018-03-20 10:47 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 4205 bytes --]

Hi,


Regarding the specific scenario, an error where a namespace is added to the subsystem, but the application does not support this namespace (obviously this is an error in our internal management flow, I just don't want to brick the initiator when this happens).

Looking at the spec, it would seem that SPDK_NVME_SC_NAMESPACE_NOT_READY with the DNR bit set. Does this sound right? Is there a way to issue such a status + dnr from the bdev layer?


Shahar

________________________________
From: Shahar Salzman
Sent: Monday, March 19, 2018 9:26:11 PM
To: Storage Performance Development Kit
Subject: �����: [SPDK] IO error for application targets

Hi Daniel,

Thanks for your help!
I will see if I can add some additional info that will "convince" the host not to hang on the device on the one hand but on the other hand, to fail the IO instead of returning an invalid buffer.
Some details on the setup: spdk is used as a target for our existing storage appliance (we were scsi only using scst up to now), integration is done via a bdev module which passes IO from spdk to/from the appliance using rings. We would be happy to share this bdev module if there is any interest in it.
Host is a standard centos using Linux nvme initiator, we simply did normal nvme discover/connect, and processes started to hang on nvme list.
Connectivity is 25g on the target going through a 100g switch, initiator is a VM using an sriov allocated port.

Shahar

-------- ����� ������ --------
����: Re: [SPDK] IO error for application targets
���: "Verkamp, Daniel"
��: Storage Performance Development Kit
����:


Hi Shahar,



The IO_STATUS_SCSI_ERROR and IO_STATUS_NVME_ERROR status codes should be set via spdk_bdev_io_complete_scsi_status() and spdk_bdev_io_complete_nvme_status(), respectively.  They can be used to store additional error information that the application can retrieve via spdk_bdev_io_get_scsi_status() and spdk_bdev_io_get_nvme_status().



What setup are you testing with dd? Is this exporting a bdev via iscsi_tgt, nvmf_tgt, or some other scenario?  Depending on the SPDK application, the extra error information you report might or might not be utilized.



Thanks,

-- Daniel



From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Shahar Salzman
Sent: Monday, March 19, 2018 8:17 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] IO error for application targets



Hi,



I am working on some application error scenarios and am wondering what return codes I should use.

I am running my own blockdev which routes IO to a userspace application, I am currently looking at a scenario where the NSID does not exist, but am also thinking about how to handle an IO which is out of bounds, and other such scenarios.



Looking at the blockdev completions, I can see only a limited set of IO errors I can return:

enum spdk_bdev_io_status {

/*

* NOMEM should be returned when a bdev module cannot start an I/O because of

*  some lack of resources.  It may not be returned for RESET I/O.  I/O completed

*  with NOMEM status will be retried after some I/O from the same channel have

*  completed.

*/

SPDK_BDEV_IO_STATUS_NOMEM = -4,

SPDK_BDEV_IO_STATUS_SCSI_ERROR = -3,

SPDK_BDEV_IO_STATUS_NVME_ERROR = -2,

SPDK_BDEV_IO_STATUS_FAILED = -1,

SPDK_BDEV_IO_STATUS_PENDING = 0,

SPDK_BDEV_IO_STATUS_SUCCESS = 1,

};



I tried both FAILED and NVME_ERROR running dd (read) to an invalid device, and each status gave me different results:

FAILED - process hangs in D state for 30 seconds, and eventually returns an IO error

NVME_ERROR - process returns immediately with some data (doesn't seem random, not sure if it what the application had in its buffer or if some transaction had been made)



I obviously prefer the FAILED return code, but I also get a blkid hung in D state, and other operations (e.g. disconnect) take a very long time.



What does the NVME_ERROR mean? Is there a way to give some more error information, e.g. something like enodev?



Thanks,

Shahar



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 10894 bytes --]

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

end of thread, other threads:[~2018-03-22 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 19:26 [SPDK] הנושא: IO error for application targets Shahar Salzman
2018-03-20 10:47 Shahar Salzman
2018-03-22 12:56 Shahar Salzman

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.