From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0511957127862305998==" MIME-Version: 1.0 From: Harris, James R Subject: [SPDK] Re: How to manage a persistent connection to a discovery controller over TCP from a Host computer Date: Wed, 16 Mar 2022 00:43:51 +0000 Message-ID: In-Reply-To: 20220315145113.2873.95332@ml01.vlan13.01.org List-ID: To: spdk@lists.01.org --===============0511957127862305998== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 i= s 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 so= me 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 dis= covery ctrlr was initially attached. If you issue a Get Log Page at the sa= me time as an AEN, you will get both a callback on the function that you re= gistered for AER, followed sometime later by a callback for the function yo= u provided when submitting the Get Log Page (when that command completes). Regards, Jim =EF=BB=BFOn 3/15/22, 7:51 AM, "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 re= cently ratified TP8010, which defines the Central Discovery Controller (CDC= ). My goal is to establish a persistent connection to a CDC over TCP, to pe= rform 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 firs= t question is about polling. The documentation mentions that the SPDK drive= r uses polling instead of interrupts to avoid the overhead of context switc= hes. And avoiding context switches results in better performances. I'm curi= ous 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 def= inition, 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 a= t 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 respo= nse. In this case, the SPDK would not get the response to the Get DLP comma= nd, but instead would get an AEN. How is that handled? Is the AEN just disc= arded? _______________________________________________ SPDK mailing list -- spdk(a)lists.01.org To unsubscribe send an email to spdk-leave(a)lists.01.org --===============0511957127862305998==--