Message ID | 20191009192530.13079-5-logang@deltatee.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | nvmet: add target passthru commands support | expand |
On Wed, Oct 09, 2019 at 01:25:21PM -0600, Logan Gunthorpe wrote: > This function will be needed by the upcoming passthru code. > > Passthru will need an emulated version of identify_desclist which > copies the eui64, uuid and nguid from the passed-thru controller into > the request SGL. > > [chaitanya.kulkarni@wdc.com: this was factored out of a patch > originally authored by Chaitanya] > Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> > Signed-off-by: Logan Gunthorpe <logang@deltatee.com> > Reviewed-by: Sagi Grimberg <sagi@grimberg.me> > --- Looks fine Reviewed-by: Keith Busch <kbusch@kernel.org>
On Wed, Oct 09, 2019 at 01:25:21PM -0600, Logan Gunthorpe wrote: > This function will be needed by the upcoming passthru code. > > Passthru will need an emulated version of identify_desclist which > copies the eui64, uuid and nguid from the passed-thru controller into > the request SGL. I don't like the way this is handled. We should avoid faking up behavior not supported if this really is a passthrough interface. For this particular case this means: 1) report the vs field that the actual controller reports 2) if that is below 1.2.1 bump it to that, but no further (and maybe print a warning) 3) don't emulate the namespace descriptor CNS ever
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c index 831a062d27cb..67b6642bb628 100644 --- a/drivers/nvme/target/admin-cmd.c +++ b/drivers/nvme/target/admin-cmd.c @@ -506,8 +506,8 @@ static void nvmet_execute_identify_nslist(struct nvmet_req *req) nvmet_req_complete(req, status); } -static u16 nvmet_copy_ns_identifier(struct nvmet_req *req, u8 type, u8 len, - void *id, off_t *off) +u16 nvmet_copy_ns_identifier(struct nvmet_req *req, u8 type, u8 len, + void *id, off_t *off) { struct nvme_ns_id_desc desc = { .nidt = type, diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h index 3d313a6452cc..5dfd4e0ae096 100644 --- a/drivers/nvme/target/nvmet.h +++ b/drivers/nvme/target/nvmet.h @@ -489,6 +489,8 @@ u16 nvmet_bdev_flush(struct nvmet_req *req); u16 nvmet_file_flush(struct nvmet_req *req); void nvmet_ns_changed(struct nvmet_subsys *subsys, u32 nsid); +u16 nvmet_copy_ns_identifier(struct nvmet_req *req, u8 type, u8 len, + void *id, off_t *off); static inline u32 nvmet_rw_len(struct nvmet_req *req) { return ((u32)le16_to_cpu(req->cmd->rw.length) + 1) <<