Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7aa1f427 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Jens Axboe
Browse files

nvme: use a single NVME_AQ_DEPTH and relax it to 32



No need to differentiate fabrics from pci/loop, also lower
it to 32 as we don't really need 256 inflight admin commands.

Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6bfe0425
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -392,13 +392,7 @@ int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)
	cmd.connect.opcode = nvme_fabrics_command;
	cmd.connect.fctype = nvme_fabrics_type_connect;
	cmd.connect.qid = 0;

	/*
	 * fabrics spec sets a minimum of depth 32 for admin queue,
	 * so set the queue with this depth always until
	 * justification otherwise.
	 */
	cmd.connect.sqsize = cpu_to_le16(NVMF_AQ_DEPTH - 1);
	cmd.connect.sqsize = cpu_to_le16(NVME_AQ_DEPTH - 1);

	/*
	 * Set keep-alive timeout in seconds granularity (ms * 1000)
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
 */
#define NVME_FC_NR_AEN_COMMANDS	1
#define NVME_FC_AQ_BLKMQ_DEPTH	\
	(NVMF_AQ_DEPTH - NVME_FC_NR_AEN_COMMANDS)
	(NVME_AQ_DEPTH - NVME_FC_NR_AEN_COMMANDS)
#define AEN_CMDID_BASE		(NVME_FC_AQ_BLKMQ_DEPTH + 1)

enum nvme_fc_queue_flags {
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include "nvme.h"

#define NVME_Q_DEPTH		1024
#define NVME_AQ_DEPTH		256
#define SQ_SIZE(depth)		(depth * sizeof(struct nvme_command))
#define CQ_SIZE(depth)		(depth * sizeof(struct nvme_completion))

+5 −5
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
 */
#define NVME_RDMA_NR_AEN_COMMANDS      1
#define NVME_RDMA_AQ_BLKMQ_DEPTH       \
	(NVMF_AQ_DEPTH - NVME_RDMA_NR_AEN_COMMANDS)
	(NVME_AQ_DEPTH - NVME_RDMA_NR_AEN_COMMANDS)

struct nvme_rdma_device {
	struct ib_device       *dev;
@@ -719,7 +719,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work)
	if (ret)
		goto requeue;

	ret = nvme_rdma_init_queue(ctrl, 0, NVMF_AQ_DEPTH);
	ret = nvme_rdma_init_queue(ctrl, 0, NVME_AQ_DEPTH);
	if (ret)
		goto requeue;

@@ -1291,8 +1291,8 @@ static int nvme_rdma_route_resolved(struct nvme_rdma_queue *queue)
	 * specified by the Fabrics standard.
	 */
	if (priv.qid == 0) {
		priv.hrqsize = cpu_to_le16(NVMF_AQ_DEPTH);
		priv.hsqsize = cpu_to_le16(NVMF_AQ_DEPTH - 1);
		priv.hrqsize = cpu_to_le16(NVME_AQ_DEPTH);
		priv.hsqsize = cpu_to_le16(NVME_AQ_DEPTH - 1);
	} else {
		/*
		 * current interpretation of the fabrics spec
@@ -1530,7 +1530,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl)
{
	int error;

	error = nvme_rdma_init_queue(ctrl, 0, NVMF_AQ_DEPTH);
	error = nvme_rdma_init_queue(ctrl, 0, NVME_AQ_DEPTH);
	if (error)
		return error;

+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static void nvmet_format_discovery_entry(struct nvmf_disc_rsp_page_hdr *hdr,
	e->portid = port->disc_addr.portid;
	/* we support only dynamic controllers */
	e->cntlid = cpu_to_le16(NVME_CNTLID_DYNAMIC);
	e->asqsz = cpu_to_le16(NVMF_AQ_DEPTH);
	e->asqsz = cpu_to_le16(NVME_AQ_DEPTH);
	e->subtype = type;
	memcpy(e->trsvcid, port->disc_addr.trsvcid, NVMF_TRSVCID_SIZE);
	memcpy(e->traddr, port->disc_addr.traddr, NVMF_TRADDR_SIZE);
Loading