All of lore.kernel.org
 help / color / mirror / Atom feed
* [SPDK] Re: How to manage a persistent connection to a discovery controller over TCP from a Host computer
@ 2022-03-16  0:43 Harris, James R
  0 siblings, 0 replies; only message in thread
From: Harris, James R @ 2022-03-16  0:43 UTC (permalink / raw)
  To: spdk

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

Hi Martin,

The SPDK nvme driver doesn't have an interrupt mode today.  The polling is performed by calling spdk_nvme_ctrlr_process_admin_completions() repeatedly, although most SPDK-based applications will do other work between calls to this function.  Being able to expose the underlying spdk_posix_sock's fd is something that's been discussed before and wouldn't be difficult, if that's something you're interested in digging into.  It would primarily need some work on how to cleanly expose this through the main nvme driver API.

Regarding AENs, the AEN is never discarded, as long as you called spdk_nvme_ctrlr_register_aer_callback() to register a callback function when the discovery ctrlr was initially attached.  If you issue a Get Log Page at the same time as an AEN, you will get both a callback on the function that you registered for AER, followed sometime later by a callback for the function you provided when submitting the Get Log Page (when that command completes).

Regards,

Jim



On 3/15/22, 7:51 AM, "martin.belanger(a)dell.com" <martin.belanger(a)dell.com> wrote:

    I'm new to SPDK and I'm trying to figure out how to use it from a host to connect to a Discovery Controller. More precisely, I'm looking at the recently ratified TP8010, which defines the Central Discovery Controller (CDC). My goal is to establish a persistent connection to a CDC over TCP, to perform Get Discovery Log Page commands, and monitor for "Discovery Log Page Changed" AENs.

    I've been reading the documentation and I have a few questions. My first question is about polling. The documentation mentions that the SPDK driver uses polling instead of interrupts to avoid the overhead of context switches. And avoiding context switches results in better performances. I'm curious about how polling is done. Is polling performed continuously in a tight loop without any blocking? In other words, does polling consume 100% CPU? Having processes that consume large amounts of CPU is not something that I can afford on my host. Is there a way to operate in interrupt mode instead? That is, can I use a blocking poll() (or epoll() or select()) on the file descriptor associated with the socket connection?

    My second question is about AENs and how they are handled. AENs, by definition, are asynchronous. What if an AEN is sent while I issue a command? For example, let's say I issue a Get Discovery Log Page (DLP) command and at the very same time the CDC sends an AEN. I was looking at the code and it looks like when one issues a command the SPDK starts polling for the response. In this case, the SPDK would not get the response to the Get DLP command, but instead would get an AEN. How is that handled? Is the AEN just discarded?
    _______________________________________________
    SPDK mailing list -- spdk(a)lists.01.org
    To unsubscribe send an email to spdk-leave(a)lists.01.org


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-16  0:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  0:43 [SPDK] Re: How to manage a persistent connection to a discovery controller over TCP from a Host computer Harris, James R

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.