From: Damien Le Moal <Damien.LeMoal@wdc.com> To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>, "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>, "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org> Cc: "sagi@grimberg.me" <sagi@grimberg.me>, "hch@lst.de" <hch@lst.de> Subject: Re: [PATCH 9/9] nvmet: add ZNS based I/O cmds handlers Date: Thu, 26 Nov 2020 08:45:52 +0000 [thread overview] Message-ID: <CH2PR04MB65223CC1546E8E9C22CCEF6EE7F90@CH2PR04MB6522.namprd04.prod.outlook.com> (raw) In-Reply-To: 20201126024043.3392-10-chaitanya.kulkarni@wdc.com On 2020/11/26 11:42, Chaitanya Kulkarni wrote: > Add zone-mgmt-send, zone-mgmt-recv and zone-zppend handlers for the s/zone-zppend/zone-append > bdev backend so that it can support zbd. s/zbd/zoned block devices (zbd is not an obvious acronym to all people) > > Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> > --- > drivers/nvme/target/Makefile | 3 +-- > drivers/nvme/target/io-cmd-bdev.c | 9 +++++++++ > drivers/nvme/target/zns.c | 6 +++--- > 3 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/drivers/nvme/target/Makefile b/drivers/nvme/target/Makefile > index bc147ff2df5d..15307b1cc713 100644 > --- a/drivers/nvme/target/Makefile > +++ b/drivers/nvme/target/Makefile > @@ -10,9 +10,8 @@ obj-$(CONFIG_NVME_TARGET_FCLOOP) += nvme-fcloop.o > obj-$(CONFIG_NVME_TARGET_TCP) += nvmet-tcp.o > > nvmet-y += core.o configfs.o admin-cmd.o fabrics-cmd.o \ > - discovery.o io-cmd-file.o io-cmd-bdev.o > + zns.o discovery.o io-cmd-file.o io-cmd-bdev.o OK. Now I understand the really not obvious #ifdef in zns.c. Isn't there a better way to do this ? If you move the code that must be unconditionally compiled to check support for ZNS/Zoned devices is moved out of zns.c, you would not need this dance with the Makefile and that will cleanup the code (read: less of it). > nvmet-$(CONFIG_NVME_TARGET_PASSTHRU) += passthru.o > -nvmet-$(CONFIG_BLK_DEV_ZONED) += zns.o > > nvme-loop-y += loop.o > nvmet-rdma-y += rdma.o > diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c > index f8a500983abd..4fcc8374b857 100644 > --- a/drivers/nvme/target/io-cmd-bdev.c > +++ b/drivers/nvme/target/io-cmd-bdev.c > @@ -453,6 +453,15 @@ u16 nvmet_bdev_parse_io_cmd(struct nvmet_req *req) > case nvme_cmd_write_zeroes: > req->execute = nvmet_bdev_execute_write_zeroes; > return 0; > + case nvme_cmd_zone_append: > + req->execute = nvmet_bdev_execute_zone_append; > + return 0; > + case nvme_cmd_zone_mgmt_recv: > + req->execute = nvmet_bdev_execute_zone_mgmt_recv; > + return 0; > + case nvme_cmd_zone_mgmt_send: > + req->execute = nvmet_bdev_execute_zone_mgmt_send; > + return 0; > default: > pr_err("unhandled cmd %d on qid %d\n", cmd->common.opcode, > req->sq->qid); > diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c > index 8ea6641a55e3..efd11d7a6f96 100644 > --- a/drivers/nvme/target/zns.c > +++ b/drivers/nvme/target/zns.c > @@ -361,17 +361,17 @@ void nvmet_bdev_execute_zone_append(struct nvmet_req *req) > } > > #else /* CONFIG_BLK_DEV_ZONED */ > -static void nvmet_execute_identify_cns_cs_ctrl(struct nvmet_req *req) > +void nvmet_execute_identify_cns_cs_ctrl(struct nvmet_req *req) > { > } > -static void nvmet_execute_identify_cns_cs_ns(struct nvmet_req *req) > +void nvmet_execute_identify_cns_cs_ns(struct nvmet_req *req) > { > } > u16 nvmet_process_zns_cis(struct nvmet_req *req, off_t *off) > { > return 0; > } > -static bool nvmet_bdev_zns_config(struct nvmet_ns *ns) > +bool nvmet_bdev_zns_config(struct nvmet_ns *ns) > { > return false; > } > -- Damien Le Moal Western Digital Research
WARNING: multiple messages have this Message-ID (diff)
From: Damien Le Moal <Damien.LeMoal@wdc.com> To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>, "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>, "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org> Cc: "sagi@grimberg.me" <sagi@grimberg.me>, "hch@lst.de" <hch@lst.de> Subject: Re: [PATCH 9/9] nvmet: add ZNS based I/O cmds handlers Date: Thu, 26 Nov 2020 08:45:52 +0000 [thread overview] Message-ID: <CH2PR04MB65223CC1546E8E9C22CCEF6EE7F90@CH2PR04MB6522.namprd04.prod.outlook.com> (raw) In-Reply-To: 20201126024043.3392-10-chaitanya.kulkarni@wdc.com On 2020/11/26 11:42, Chaitanya Kulkarni wrote: > Add zone-mgmt-send, zone-mgmt-recv and zone-zppend handlers for the s/zone-zppend/zone-append > bdev backend so that it can support zbd. s/zbd/zoned block devices (zbd is not an obvious acronym to all people) > > Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> > --- > drivers/nvme/target/Makefile | 3 +-- > drivers/nvme/target/io-cmd-bdev.c | 9 +++++++++ > drivers/nvme/target/zns.c | 6 +++--- > 3 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/drivers/nvme/target/Makefile b/drivers/nvme/target/Makefile > index bc147ff2df5d..15307b1cc713 100644 > --- a/drivers/nvme/target/Makefile > +++ b/drivers/nvme/target/Makefile > @@ -10,9 +10,8 @@ obj-$(CONFIG_NVME_TARGET_FCLOOP) += nvme-fcloop.o > obj-$(CONFIG_NVME_TARGET_TCP) += nvmet-tcp.o > > nvmet-y += core.o configfs.o admin-cmd.o fabrics-cmd.o \ > - discovery.o io-cmd-file.o io-cmd-bdev.o > + zns.o discovery.o io-cmd-file.o io-cmd-bdev.o OK. Now I understand the really not obvious #ifdef in zns.c. Isn't there a better way to do this ? If you move the code that must be unconditionally compiled to check support for ZNS/Zoned devices is moved out of zns.c, you would not need this dance with the Makefile and that will cleanup the code (read: less of it). > nvmet-$(CONFIG_NVME_TARGET_PASSTHRU) += passthru.o > -nvmet-$(CONFIG_BLK_DEV_ZONED) += zns.o > > nvme-loop-y += loop.o > nvmet-rdma-y += rdma.o > diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c > index f8a500983abd..4fcc8374b857 100644 > --- a/drivers/nvme/target/io-cmd-bdev.c > +++ b/drivers/nvme/target/io-cmd-bdev.c > @@ -453,6 +453,15 @@ u16 nvmet_bdev_parse_io_cmd(struct nvmet_req *req) > case nvme_cmd_write_zeroes: > req->execute = nvmet_bdev_execute_write_zeroes; > return 0; > + case nvme_cmd_zone_append: > + req->execute = nvmet_bdev_execute_zone_append; > + return 0; > + case nvme_cmd_zone_mgmt_recv: > + req->execute = nvmet_bdev_execute_zone_mgmt_recv; > + return 0; > + case nvme_cmd_zone_mgmt_send: > + req->execute = nvmet_bdev_execute_zone_mgmt_send; > + return 0; > default: > pr_err("unhandled cmd %d on qid %d\n", cmd->common.opcode, > req->sq->qid); > diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c > index 8ea6641a55e3..efd11d7a6f96 100644 > --- a/drivers/nvme/target/zns.c > +++ b/drivers/nvme/target/zns.c > @@ -361,17 +361,17 @@ void nvmet_bdev_execute_zone_append(struct nvmet_req *req) > } > > #else /* CONFIG_BLK_DEV_ZONED */ > -static void nvmet_execute_identify_cns_cs_ctrl(struct nvmet_req *req) > +void nvmet_execute_identify_cns_cs_ctrl(struct nvmet_req *req) > { > } > -static void nvmet_execute_identify_cns_cs_ns(struct nvmet_req *req) > +void nvmet_execute_identify_cns_cs_ns(struct nvmet_req *req) > { > } > u16 nvmet_process_zns_cis(struct nvmet_req *req, off_t *off) > { > return 0; > } > -static bool nvmet_bdev_zns_config(struct nvmet_ns *ns) > +bool nvmet_bdev_zns_config(struct nvmet_ns *ns) > { > return false; > } > -- Damien Le Moal Western Digital Research _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-11-26 8:45 UTC|newest] Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-26 2:40 [PATCH 0/9] nvmet: add genblk ZBD backend Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 2:40 ` [PATCH 1/9] block: export __bio_iov_append_get_pages() Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 8:09 ` Damien Le Moal 2020-11-26 8:09 ` Damien Le Moal 2020-11-26 2:40 ` [PATCH 2/9] nvmet: add ZNS support for bdev-ns Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 8:36 ` Damien Le Moal 2020-11-26 8:36 ` Damien Le Moal 2020-11-28 0:09 ` Chaitanya Kulkarni 2020-11-28 0:09 ` Chaitanya Kulkarni 2020-11-30 0:16 ` Damien Le Moal 2020-11-30 0:16 ` Damien Le Moal 2020-11-26 9:06 ` Damien Le Moal 2020-11-26 9:06 ` Damien Le Moal [not found] ` <BYAPR04MB496572575C9B29E682B0C25286F70@BYAPR04MB4965.namprd04.prod.outlook.com> 2020-11-30 0:18 ` Damien Le Moal 2020-11-30 0:18 ` Damien Le Moal 2020-11-26 2:40 ` [PATCH 3/9] nvmet: trim down id-desclist to use req->ns Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 2:40 ` [PATCH 4/9] nvmet: add NVME_CSI_ZNS in ns-desc for zbdev Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 2:40 ` [PATCH 5/9] nvmet: add cns-cs-ctrl in id-ctrl for ZNS bdev Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 8:39 ` Damien Le Moal 2020-11-26 8:39 ` Damien Le Moal 2020-11-26 2:40 ` [PATCH 6/9] nvmet: add cns-cs-ns " Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 8:40 ` Damien Le Moal 2020-11-26 8:40 ` Damien Le Moal [not found] ` <BYAPR04MB4965E885FFD93A530AF315B886F70@BYAPR04MB4965.namprd04.prod.outlook.com> 2020-11-30 0:21 ` Damien Le Moal 2020-11-30 0:21 ` Damien Le Moal 2020-11-26 2:40 ` [PATCH 7/9] nvmet: add zns cmd effects to support zbdev Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 8:40 ` Damien Le Moal 2020-11-26 8:40 ` Damien Le Moal 2020-11-26 2:40 ` [PATCH 8/9] nvmet: add zns bdev config support Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 2:40 ` [PATCH 9/9] nvmet: add ZNS based I/O cmds handlers Chaitanya Kulkarni 2020-11-26 2:40 ` Chaitanya Kulkarni 2020-11-26 8:45 ` Damien Le Moal [this message] 2020-11-26 8:45 ` Damien Le Moal 2020-11-26 8:07 ` [PATCH 0/9] nvmet: add genblk ZBD backend Damien Le Moal 2020-11-26 8:07 ` Damien Le Moal
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=CH2PR04MB65223CC1546E8E9C22CCEF6EE7F90@CH2PR04MB6522.namprd04.prod.outlook.com \ --to=damien.lemoal@wdc.com \ --cc=Chaitanya.Kulkarni@wdc.com \ --cc=hch@lst.de \ --cc=linux-block@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.