linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Sagi Grimberg <sagi@grimberg.me>
Cc: Hannes Reinecke <hare@suse.de>,
	"Ewan D. Milne" <emilne@redhat.com>,
	Daniel Wagner <dwagner@suse.de>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] nvme-tcp: Check if request has started before processing it
Date: Fri, 7 May 2021 13:40:52 -0700	[thread overview]
Message-ID: <20210507204052.GA1485586@dhcp-10-100-145-180.wdc.com> (raw)
In-Reply-To: <3156c563-94a4-4278-3835-b1f56f71869a@grimberg.me>

On Fri, May 07, 2021 at 01:26:11PM -0700, Sagi Grimberg wrote:
> 
> > > > > I would also mention, that a crash is not even the scariest issue that
> > > > > we can see here, because if the request happened to be reused we are
> > > > > in the silent data corruption realm...
> > > > 
> > > > If this does happen, I think we have to come up with some way to
> > > > mitigate it. We're not utilizing the full 16 bits of the command_id, so
> > > > maybe we can append something like a generation sequence number that can
> > > > be checked for validity.
> > > 
> > > That's actually a great idea. scsi needs unique tags so it encodes the
> > > hwq in the upper 16 bits giving the actual tag the lower 16 bits which
> > > is more than enough for a single queue. We can do the same with
> > > a gencnt that will increment in both submission and completion and we
> > > can validate against it.
> > > 
> > > This will be useful for all transports, so maintaining it in
> > > nvme_req(rq)->genctr and introducing a helper like:
> > > rq = nvme_find_tag(tagset, cqe->command_id)
> > > That will filter genctr, locate the request.
> > > 
> > > Also:
> > > nvme_validate_request_gen(rq, cqe->command_id) that would
> > > compare against it.
> > > 
> > > 
> > > And then a helper to set the command_id like:
> > > cmd->common.command_id = nvme_request_command_id(rq)
> > > that will both increment the genctr and build a command_id
> > > from it.
> > > 
> > > Thoughts?
> > > 
> > 
> > Well, that would require a modification to the CQE specification, no?
> > fmds was not amused when I proposed that :-(
> 
> Why would that require a modification to the CQE? it's just using say
> 4 msbits of the command_id to a running sequence...

I think Hannes was under the impression that the counter proposal wasn't
part of the "command_id". The host can encode whatever it wants in that
value, and the controller just has to return the same value.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-05-07 20:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 17:56 [PATCH v2] nvme-tcp: Check if request has started before processing it Daniel Wagner
2021-03-05 19:57 ` Sagi Grimberg
2021-03-11  9:43   ` Daniel Wagner
2021-03-15 17:16     ` Sagi Grimberg
2021-03-30 16:19       ` Ewan D. Milne
2021-03-30 17:34         ` Sagi Grimberg
2021-03-30 23:28           ` Keith Busch
2021-03-31  7:11             ` Hannes Reinecke
2021-03-31 21:01               ` Ewan D. Milne
2021-03-31 22:24                 ` Sagi Grimberg
2021-04-01  6:20                   ` Christoph Hellwig
2021-04-01  8:25                     ` Sagi Grimberg
2021-03-31 22:37             ` Sagi Grimberg
2021-05-06 15:36               ` Hannes Reinecke
2021-05-07 20:26                 ` Sagi Grimberg
2021-05-07 20:40                   ` Keith Busch [this message]
2021-05-07 23:22                     ` Sagi Grimberg
2021-05-08  0:03                       ` Keith Busch
2021-05-09 11:30                       ` Hannes Reinecke
2021-05-11 18:16                         ` Sagi Grimberg
2021-05-17 14:58                       ` Daniel Wagner

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=20210507204052.GA1485586@dhcp-10-100-145-180.wdc.com \
    --to=kbusch@kernel.org \
    --cc=axboe@fb.com \
    --cc=dwagner@suse.de \
    --cc=emilne@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).