nvme tcp receive errors

Sagi Grimberg sagi at grimberg.me
Wed Apr 21 17:59:21 BST 2021


>> Can you retry with the following applied on top of what I sent you?
> 
> Thanks, we'll give this a try. Just a quick question on the first patch:
> 
>> --
>> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
>> index c60c1dcfb587..ff39d37e9793 100644
>> --- a/drivers/nvme/host/tcp.c
>> +++ b/drivers/nvme/host/tcp.c
>> @@ -63,6 +63,7 @@ struct nvme_tcp_request {
>>          /* send state */
>>          size_t                  offset;
>>          size_t                  data_sent;
>> +       size_t                  data_recvd;
>>          enum nvme_tcp_send_state state;
>>          enum nvme_tcp_cmd_state cmd_state;
>>   };
>> @@ -769,6 +770,7 @@ static int nvme_tcp_recv_data(struct nvme_tcp_queue
>> *queue, struct sk_buff *skb,
>>                  *len -= recv_len;
>>                  *offset += recv_len;
>>                  queue->data_remaining -= recv_len;
>> +               req->data_recvd += recv_len;
> 
> Does this need to get reset to 0 during the initial setup? It looks like
> a "req->data_recvd = 0" in nvme_tcp_setup_cmd_pdu() should happen, no?

Yes, this hunk is needed as well:
--
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 8e55d8bc0c50..226404239b49 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -2274,6 +2274,7 @@ static blk_status_t nvme_tcp_setup_cmd_pdu(struct 
nvme_ns *ns,
         req->state = NVME_TCP_SEND_CMD_PDU;
         req->offset = 0;
         req->data_sent = 0;
+       req->data_recvd = 0;
         req->pdu_len = 0;
         req->pdu_sent = 0;
         req->data_len = blk_rq_nr_phys_segments(rq) ?
--



More information about the Linux-nvme mailing list