Storage Performance Development Kit (SPDK)
 help / color / mirror / Atom feed
* [SPDK] Question regarding async event in target.
@ 2018-04-17 23:38 Sreeni Busam
  0 siblings, 0 replies; 2+ messages in thread
From: Sreeni Busam @ 2018-04-17 23:38 UTC (permalink / raw)
  To: spdk

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

Hello,

I am looking at how to register async events from initiator to target and handle SSD controller errors in the NVMF target. From the code in NVMF, I see there is only 1 async request. Is it not possible to have multiple async requests registered from initiator and handled between initiator and target?
Please let me know how to setup multiple requests at the same time. If you know how different controller errors can be handled, let me know.
spdk_nvmf_session_async_event_request(struct spdk_nvmf_request *req)
{
    struct spdk_nvmf_session *session = req->conn->sess;
    struct spdk_nvme_cpl *rsp = &req->rsp->nvme_cpl;

    assert(session->vcdata.aerl + 1 == 1);
    if (session->aer_req != NULL) {
        SPDK_TRACELOG(SPDK_TRACE_NVMF, "AERL exceeded\n");
        rsp->status.sct = SPDK_NVME_SCT_COMMAND_SPECIFIC;
        rsp->status.sc = SPDK_NVME_SC_ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED;
        return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
    }
    session->aer_req = req;

I appreciate your help.
Thank you,
Sreeni

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

^ permalink raw reply	[flat|nested] 2+ messages in thread
* Re: [SPDK] Question regarding async event in target.
@ 2018-04-18  0:21 Verkamp, Daniel
  0 siblings, 0 replies; 2+ messages in thread
From: Verkamp, Daniel @ 2018-04-18  0:21 UTC (permalink / raw)
  To: spdk

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

Hi Sreeni,

The SPDK NVMe-oF target did not ever complete AERs until very recently, which is why we had a simplistic stub implementation that only allowed a single AER.  Now that Changpeng has added Namespace Attribute Changed event reporting via AER, it probably  makes sense to revisit this limit.

It shouldn't be too difficult to change the single aer_req into a list of pending AER requests (plus maybe a count of outstanding AER requests so we don't have to count them every time a new one is submitted to ensure AERL isn't exceeded).  The code that should add a new AER request to the queue is in spdk_nvmf_ctrlr_async_event_request() in lib/nvmf/ctrlr.c, and the code that should pop them off the list is spdk_nvmf_ctrlr_async_event_ns_notice().

Thanks,
-- Daniel

From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Sreeni (Sreenivasa) Busam (Stellus)
Sent: Tuesday, April 17, 2018 4:39 PM
To: spdk(a)lists.01.org
Subject: [SPDK] Question regarding async event in target.

Hello,

I am looking at how to register async events from initiator to target and handle SSD controller errors in the NVMF target. From the code in NVMF, I see there is only 1 async request. Is it not possible to have multiple async requests registered from initiator and handled between initiator and target?
Please let me know how to setup multiple requests at the same time. If you know how different controller errors can be handled, let me know.
spdk_nvmf_session_async_event_request(struct spdk_nvmf_request *req)
{
    struct spdk_nvmf_session *session = req->conn->sess;
    struct spdk_nvme_cpl *rsp = &req->rsp->nvme_cpl;

    assert(session->vcdata.aerl + 1 == 1);
    if (session->aer_req != NULL) {
        SPDK_TRACELOG(SPDK_TRACE_NVMF, "AERL exceeded\n");
        rsp->status.sct = SPDK_NVME_SCT_COMMAND_SPECIFIC;
        rsp->status.sc = SPDK_NVME_SC_ASYNC_EVENT_REQUEST_LIMIT_EXCEEDED;
        return SPDK_NVMF_REQUEST_EXEC_STATUS_COMPLETE;
    }
    session->aer_req = req;

I appreciate your help.
Thank you,
Sreeni

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

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

end of thread, other threads:[~2018-04-18  0:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-17 23:38 [SPDK] Question regarding async event in target Sreeni Busam
  -- strict thread matches above, loose matches on Subject: below --
2018-04-18  0:21 Verkamp, Daniel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox