mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 00:54:09 +08:00
nvmet: set maxcmd to be per controller
This is a preparation for having a dynamic configuration of max queue size for a controller. Make sure that the maxcmd field stays the same as the MQES (+1) value as we do today. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Israel Rukshin <israelr@nvidia.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
parent
143667ee9a
commit
63e8fd6240
@ -428,7 +428,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
|
||||
id->cqes = (0x4 << 4) | 0x4;
|
||||
|
||||
/* no enforcement soft-limit for maxcmd - pick arbitrary high value */
|
||||
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
|
||||
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD(ctrl));
|
||||
|
||||
id->nn = cpu_to_le32(NVMET_MAX_NAMESPACES);
|
||||
id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES);
|
||||
|
@ -282,7 +282,7 @@ static void nvmet_execute_disc_identify(struct nvmet_req *req)
|
||||
id->lpa = (1 << 2);
|
||||
|
||||
/* no enforcement soft-limit for maxcmd - pick arbitrary high value */
|
||||
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
|
||||
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD(ctrl));
|
||||
|
||||
id->sgls = cpu_to_le32(1 << 0); /* we always support SGLs */
|
||||
if (ctrl->ops->flags & NVMF_KEYED_SGLS)
|
||||
|
@ -545,7 +545,7 @@ void nvmet_add_async_event(struct nvmet_ctrl *ctrl, u8 event_type,
|
||||
|
||||
#define NVMET_QUEUE_SIZE 1024
|
||||
#define NVMET_NR_QUEUES 128
|
||||
#define NVMET_MAX_CMD NVMET_QUEUE_SIZE
|
||||
#define NVMET_MAX_CMD(ctrl) (NVME_CAP_MQES(ctrl->cap) + 1)
|
||||
|
||||
/*
|
||||
* Nice round number that makes a list of nsids fit into a page.
|
||||
|
@ -132,7 +132,7 @@ static u16 nvmet_passthru_override_id_ctrl(struct nvmet_req *req)
|
||||
|
||||
id->sqes = min_t(__u8, ((0x6 << 4) | 0x6), id->sqes);
|
||||
id->cqes = min_t(__u8, ((0x4 << 4) | 0x4), id->cqes);
|
||||
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD);
|
||||
id->maxcmd = cpu_to_le16(NVMET_MAX_CMD(ctrl));
|
||||
|
||||
/* don't support fuse commands */
|
||||
id->fuses = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user