[SPDK] How to manage a persistent connection to a discovery controller over TCP from a Host computer
martin.belanger at dell.com Tue, 15 Mar 2022 14:51:13 +0000
| Newsgroups | dev.linux.lists.spdk |
|---|---|
| Message-ID | <[email protected]> |
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?