linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
	Stephen Bates <sbates@raithlin.com>, Jens Axboe <axboe@fb.com>,
	Max Gurtovoy <maxg@mellanox.com>, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v16 6/9] nvmet-passthru: Add passthru code to process commands
Date: Fri, 24 Jul 2020 13:40:20 -0600	[thread overview]
Message-ID: <d5c64c38-066c-013c-7a79-46230e439c5e@deltatee.com> (raw)
In-Reply-To: <20200724193351.GA2857771@dhcp-10-100-145-180.wdl.wdc.com>



On 2020-07-24 1:33 p.m., Keith Busch wrote:
> On Fri, Jul 24, 2020 at 11:25:17AM -0600, Logan Gunthorpe wrote:
>> +	/*
>> +	 * The passthru NVMe driver may have a limit on the number of segments
>> +	 * which depends on the host's memory fragementation. To solve this,
>> +	 * ensure mdts is limitted to the pages equal to the number of
> 
>                           limited
> 
>> +	/* don't support fuse commands */
>> +	id->fuses = 0;
> 
> If a host were to set a fuse, the target should return an Invalid Field
> error. Just to future-proof, rejecting commands with any flags set
> (other than SGL, which you handled in patch 1/9) is probably what should
> happen, like:

> 
>> +u16 nvmet_parse_passthru_io_cmd(struct nvmet_req *req)
>> +{
> 
> 	if (req->cmd->common.flags & ~NVME_CMD_SGL_ALL)
> 		return NVME_SC_INVALID_FIELD;


Yes, this seems like a good idea. I can add it.

> Or maybe we could obviate the need for 1/9 with something like:
> 
> 	req->cmd->common.flags &= ~NVME_CMD_SGL_ALL;
> 	if (req->cmd->common.flags)
> 		return NVME_SC_INVALID_FIELD;

We used to clear the SGL flags in the target passthru code but Christoph
asked that it be done in the host code, hence patch 1/9.

Logan

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

  reply	other threads:[~2020-07-24 19:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 17:25 [PATCH v16 0/9] nvmet: add target passthru commands support Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 1/9] nvme-core: Clear any SGL flags in passthru commands Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 2/9] nvme: Create helper function to obtain command effects Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 3/9] nvme: Introduce nvme_execute_passthru_rq to call nvme_passthru_[start|end]() Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 4/9] nvme-core: Introduce nvme_ctrl_get_by_path() Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 5/9] nvme: Export nvme_find_get_ns() and nvme_put_ns() Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 6/9] nvmet-passthru: Add passthru code to process commands Logan Gunthorpe
2020-07-24 19:33   ` Keith Busch
2020-07-24 19:40     ` Logan Gunthorpe [this message]
2020-07-26 15:41     ` Christoph Hellwig
2020-07-27 15:44       ` Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 7/9] nvmet-passthru: Add enable/disable helpers Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 8/9] nvmet-configfs: Introduce passthru configfs interface Logan Gunthorpe
2020-07-24 17:25 ` [PATCH v16 9/9] nvmet-passthru: Introduce NVMet passthru Kconfig option Logan Gunthorpe
2020-07-24 19:35 ` [PATCH v16 0/9] nvmet: add target passthru commands support Keith Busch

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=d5c64c38-066c-013c-7a79-46230e439c5e@deltatee.com \
    --to=logang@deltatee.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=maxg@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=sbates@raithlin.com \
    /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).