public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
	Jens Axboe <axboe@fb.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH] nvme-tcp: print correct opcode on timeout and error handling
Date: Wed, 8 Mar 2023 23:51:21 +0000	[thread overview]
Message-ID: <1e81d4f4-6b3a-ab7e-e81f-dd0af6590a50@nvidia.com> (raw)
In-Reply-To: <ba7cec63-2518-c68f-0dd6-b0a936132720@grimberg.me>

Sagi,

On 3/8/23 03:06, Sagi Grimberg wrote:
>
>> In timeout and error handling, various information is reported about the
>> command in error, but the printed opcode may not be correct
>>
>> The opcode is obtained from the nvme_command structure referenced by the
>> 'cmd' member in the nvme_request structure.
>> (i.e. nvme_req(req)->cmd->common.opcode)
>>
>> For the nvme-tcp driver, the 'cmd' member in the nvme_request structure
>> points to a structure within the page fragment allocated by
>> nvme_tcp_init_request().  This page fragment is used as a command 
>> capsule
>> PDU, and then may be reused as a h2c data PDU, so the nvme_command
>> referenced by the 'cmd' member has already been overwritten.
>>
>> To fix this problem, when setting up the nvme_command, keep the 
>> opcode in
>> a newly added member in the nvme_tcp_request and use that instead.
>
> I'm wandering if we should just not reuse the cmd pdu for a subsequent
> data pdu...
>
> It will take more space allocated per request (up to a few MBs for lots
> of requests and controllers)...
>
> but will prevent from propagating this to nvme core...
>

Is there a way we can do this without increasing the memory usage ?

-ck



  parent reply	other threads:[~2023-03-08 23:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 16:30 [PATCH] nvme-tcp: print correct opcode on timeout and error handling Akinobu Mita
2023-03-08 11:06 ` Sagi Grimberg
2023-03-08 15:31   ` Akinobu Mita
2023-03-08 23:51   ` Chaitanya Kulkarni [this message]
2023-03-08 23:57     ` Keith Busch
2023-03-09  1:46       ` Chaitanya Kulkarni
2023-03-09  9:10       ` Sagi Grimberg
2023-03-12 12:56         ` Akinobu Mita
2023-03-13  8:54           ` Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e81d4f4-6b3a-ab7e-e81f-dd0af6590a50@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=akinobu.mita@gmail.com \
    --cc=axboe@fb.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox