Skip to content

Commit 0ef3b18

Browse files
committed
nvme: non-blocking I/O qpair connect for TCP in interrupt mode
longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
1 parent 0b21fe0 commit 0ef3b18

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/nvme/nvme_transport.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,13 @@ nvme_transport_ctrlr_connect_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nv
523523
}
524524
}
525525

526-
if (!qpair->async) {
526+
/* For the TCP transport, we poll the I/O queue periodically using g_opts.nvme_ioq_poll_period_us,
527+
* and do no wait synchronously for the qpair to connect. This allows the NVMe-oF
528+
* initiator to send the command and gives the target an opportunity to process
529+
* and respond without blocking. This unblocks when the initiator and target
530+
* are running on the same host.
531+
*/
532+
if (!qpair->async && (ctrlr->trid.trtype != SPDK_NVME_TRANSPORT_TCP)) {
527533
/* Busy wait until the qpair exits the connecting state */
528534
while (nvme_qpair_get_state(qpair) == NVME_QPAIR_CONNECTING) {
529535
if (qpair->poll_group && spdk_nvme_ctrlr_is_fabrics(ctrlr)) {

0 commit comments

Comments
 (0)