From: Max Gurtovoy <maxg@mellanox.com>
To: jgg@mellanox.com, linux-nvme@lists.infradead.org,
sagi@grimberg.me, hch@lst.de, kbusch@kernel.org,
Chaitanya.Kulkarni@wdc.com
Cc: krishna2@chelsio.com, Max Gurtovoy <maxg@mellanox.com>,
bharat@chelsio.com, nirranjan@chelsio.com, bvanassche@acm.org
Subject: [PATCH V2 1/3] nvmet: Add get_mdts op for controllers
Date: Thu, 5 Mar 2020 11:55:28 +0200 [thread overview]
Message-ID: <20200305095530.132858-1-maxg@mellanox.com> (raw)
Some transports, such as RDMA, would like to set the Maximum Data
Transfer Size (MDTS) according to device/port/ctrl characteristics.
This will enable the transport to set the optimal MDTS according to
controller needs and device capabilities. Add a new nvmet transport
op that is called during ctrl identification. This will not effect
transports that don't implement this option. The return value of the new
op is according to the NVMe spec definition for MDTS.
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
---
changes from V1:
- renamed set_mdts to get_mdts (Bart)
- added const for ctrl argument (Bart)
- updated commit message to explain return value of the new op (Bart)
---
drivers/nvme/target/admin-cmd.c | 8 ++++++--
drivers/nvme/target/nvmet.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
index c0aa9c3..b9ec489 100644
--- a/drivers/nvme/target/admin-cmd.c
+++ b/drivers/nvme/target/admin-cmd.c
@@ -369,8 +369,12 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
/* we support multiple ports, multiples hosts and ANA: */
id->cmic = (1 << 0) | (1 << 1) | (1 << 3);
- /* no limit on data transfer sizes for now */
- id->mdts = 0;
+ /* Limit MDTS according to transport capability */
+ if (ctrl->ops->get_mdts)
+ id->mdts = ctrl->ops->get_mdts(ctrl);
+ else
+ id->mdts = 0;
+
id->cntlid = cpu_to_le16(ctrl->cntlid);
id->ver = cpu_to_le32(ctrl->subsys->ver);
diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
index 42ba2dd..421dff3 100644
--- a/drivers/nvme/target/nvmet.h
+++ b/drivers/nvme/target/nvmet.h
@@ -289,6 +289,7 @@ struct nvmet_fabrics_ops {
struct nvmet_port *port, char *traddr);
u16 (*install_queue)(struct nvmet_sq *nvme_sq);
void (*discovery_chg)(struct nvmet_port *port);
+ u8 (*get_mdts)(const struct nvmet_ctrl *ctrl);
};
#define NVMET_MAX_INLINE_BIOVEC 8
--
1.8.3.1
_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next reply other threads:[~2020-03-05 11:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 9:55 Max Gurtovoy [this message]
2020-03-05 9:55 ` [PATCH V2 2/3] nvmet-rdma: Implement get_mdts controller op Max Gurtovoy
2020-03-05 20:44 ` Sagi Grimberg
2020-03-05 23:01 ` Max Gurtovoy
2020-03-05 9:55 ` [PATCH V2 3/3] nvmet-rdma: allocate RW ctxs according to mdts Max Gurtovoy
2020-03-05 20:49 ` Sagi Grimberg
2020-03-05 22:59 ` Max Gurtovoy
2020-03-06 1:19 ` Sagi Grimberg
2020-03-05 20:40 ` [PATCH V2 1/3] nvmet: Add get_mdts op for controllers Sagi Grimberg
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=20200305095530.132858-1-maxg@mellanox.com \
--to=maxg@mellanox.com \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=bharat@chelsio.com \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=jgg@mellanox.com \
--cc=kbusch@kernel.org \
--cc=krishna2@chelsio.com \
--cc=linux-nvme@lists.infradead.org \
--cc=nirranjan@chelsio.com \
--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