nvme/tcp: enable interrupt mode support for TCP transport#60
Conversation
dee6812 to
0ef3b18
Compare
d32f6ad to
aa845ff
Compare
44b5c47 to
9aaeca2
Compare
a1b4f6d to
00e9888
Compare
00e9888 to
d584f93
Compare
|
Hi @c3y1huang Do you have documents to quickly ramp up on nvme/tcp layer? Thank you |
Maybe longhorn/longhorn#9834 (comment) helps. |
d584f93 to
8c25ff0
Compare
longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
…in interrupt mode longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
… asynchronously longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
…terrupt mode longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
…oid EBADF longhorn/longhorn-9834 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
8c25ff0 to
52394ba
Compare
|
Hello @c3y1huang
Can you point out where the queued requests are being flushed? Thank you. |
|
| rc = spdk_nvme_poll_group_process_completions(ctx->poll_group, 0, | ||
| nvme_transport_connect_qpair_fail); | ||
| } else { | ||
| rc = spdk_nvme_qpair_process_completions(qpair, 0); |
There was a problem hiding this comment.
Why do we need spdk_nvme_qpair_process_completions for none-fabrics case?
There was a problem hiding this comment.
The start_async_qpair_connect function is introduced to resolve the blocking busy-wait loop used for connection completion, allowing async handling of the connection state changes.
The logic originates from
spdk/lib/nvme/nvme_transport.c
Lines 525 to 532 in ea6cb0b
For TCP transport, this pattern is not strictly necessary since this PR introduces a poller to manage asynchronous connection states. However, I kept the unified logic across transports for consistency and to simplify the transport abstraction.
| } else { | ||
| /* | ||
| * Non-blocking path for TCP transport. Use a poller to complete connection | ||
| * asynchronously. | ||
| */ | ||
| rc = start_async_qpair_connect(qpair, nvme_qpair_connect_completion_cb, NULL); | ||
| if (rc != 0) { | ||
| SPDK_ERRLOG("Failed to start async connect: %d\n", rc); | ||
| goto err; |
There was a problem hiding this comment.
Sorry if my question does not make sense. Does it mean we also use poller for TCP transport even if in non-interrupt mode?
There was a problem hiding this comment.
For non-interrupt mode (qpair->async), it wouldn't walk through the logic in here.
The poller you are referencing gets unregistered once the IO pair leaves the connecting state. That is to resolve the blocking busy-wait loop issue when the NVMe-oF target and initiator run in the same process: https://github.com/longhorn/spdk/pull/60/files#diff-7c17adad72a592dee70af34689ed1d1dafbd224d0d5574c2cc857265b4cf9b82R538-R541
That said, at this stage, interrupt mode still partially relies on the periodic poller for:
- Admin Queue Operations: Still do periodic polling for keepalive and controller recovery.
- I/O Queue Completion: Polling is used to for command completion. [FEATURE] V2 volumes support interrupt mode longhorn#9834 (comment)
We’ll improve this later in longhorn/longhorn#11662.
Which issue(s) this PR fixes:
Issue longhorn/longhorn#9834
What this PR does / why we need it:
Support interrupt mode for NVMe TCP transport.
Special notes for your reviewer:
NoneAdditional documentation or context
longhorn/longhorn#9834 (comment)