Thread (10 messages) 10 messages, 3 authors, 2021-05-25

Re: [PATCH 2/2] nvmet-tcp: fix connect error when setting param_inline_data_size to zero.

From: Sagi Grimberg <sagi@grimberg.me>
Date: 2021-05-21 18:04:40

quoted
quoted
+static inline int nvmet_tcp_inline_data_size(struct nvmet_tcp_cmd *cmd)
+{
+     struct nvmet_tcp_queue *queue = cmd->queue;
+     struct nvme_command *nvme_cmd = cmd->req.cmd;
+     int inline_data_size = NVME_TCP_ADMIN_CCSZ;
+     u16 qid = 0;
+
+     if (likely(queue->nvme_sq.ctrl)) {
+             /* The connect admin/io queue has been executed. */
+             qid = queue->nvme_sq.qid;
+             if (qid)
+                     inline_data_size = cmd->req.port->inline_data_size;
+     } else if (nvme_cmd->connect.qid)
+             inline_data_size = cmd->req.port->inline_data_size;
How can a connection to an I/O queue arrive without having the ctrl
reference installed? Is this for the failure case?
Hi Sagi,
AFAIK after the host finishes setting up the admin queue,
it connects to the io queue and sends the io-connect command. At this
point the nvmet_tcp_queue is firstly allocated and does not have a valid
queue->nvme_sq.ctrl. It is assigned after io-connect in nvmet_install_queue().
So this function tries to find the correct queue number before or after a
fabrics connect command.
Why do you need the inline_data_size before the connect? its only
relevant for nvme I/O..

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help