[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5c64c38-066c-013c-7a79-46230e439c5e@deltatee.com>
Date: Fri, 24 Jul 2020 13:40:20 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: Keith Busch <kbusch@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>, Jens Axboe <axboe@...com>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>,
Max Gurtovoy <maxg@...lanox.com>,
Stephen Bates <sbates@...thlin.com>
Subject: Re: [PATCH v16 6/9] nvmet-passthru: Add passthru code to process
commands
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
Powered by blists - more mailing lists