[PATCH v2 2/2] nvme-tcp: send H2CData PDUs based on MAXH2CDATA
Sagi Grimberg
sagi at grimberg.me
Tue Nov 23 01:09:08 PST 2021
>>> @@ -933,6 +934,7 @@ static int nvme_tcp_try_send_data(struct nvme_tcp_request *req)
>>> {
>>> struct nvme_tcp_queue *queue = req->queue;
>>> int req_data_len = req->data_len;
>>> + u32 h2cdata_left = req->h2cdata_left;
>>
>> No need for the local variable, the reference only happens when the
>> pdu data transfer is completed.
>
> As this function also executes for inline data it is possible that completion
> gets processed and request gets allocated for new cmd before
> if (req->h2cdata_left) check, nvme_tcp_setup_cmd_pdu() will set
> req->h2cdata_left to 0 so it will work but it does not look correct
> to me. IMO we should use local variable here.
I see. that's fine then.
More information about the Linux-nvme
mailing list