[PATCH 2/2] nvmet-tcp: fix connect error when setting param_inline_data_size to zero.
Sagi Grimberg
sagi at grimberg.me
Fri May 21 11:04:23 PDT 2021
>>> +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..
More information about the Linux-nvme
mailing list