[PATCH 1/2] nvme-tcp: fix opcode reporting in the timeout handler

Chaitanya Kulkarni chaitanyak at nvidia.com
Tue Mar 14 22:14:58 PDT 2023


On 3/13/2023 1:56 AM, Sagi Grimberg wrote:
> For non in-capsule writes we reuse the request pdu space for a h2cdata
> pdu in order to avoid over allocating space (either preallocate or
> dynamically upon receving an r2t pdu). However if the request times out
> the core expects to find the opcode in the start of the request, which
> we override.
> 
> In order to prevent that, without sacrificing additional 24 bytes per
> request, we just use the tail of the command pdu space instead (last
> 24 bytes from the 72 bytes command pdu). That should make the command
> opcode always available, and we get away from allocating more space.
> 
> If in the future we would need the last 24 bytes of the nvme command
> available we would need to allocate a dedicated space for it in the
> request, but until then we can avoid doing so.
> 
> Reported-by: Akinobu Mita <akinobu.mita at gmail.com>
> Tested-by: Akinobu Mita <akinobu.mita at gmail.com>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---


This looks good to me.

Reviewed-by: Chaitanya Kulkarni <kkch at nvidia.com>

-ck




More information about the Linux-nvme mailing list