]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/nvme/target/loop.c
nvme: centralize AEN defines
[mirror_ubuntu-bionic-kernel.git] / drivers / nvme / target / loop.c
index bc95c6ed531af58d126d919290dcb4a108d62d2e..7258b796f209c1fc392055c5b0dd5b7a0b66a609 100644 (file)
 
 #define NVME_LOOP_MAX_SEGMENTS         256
 
-/*
- * We handle AEN commands ourselves and don't even let the
- * block layer know about them.
- */
-#define NVME_LOOP_NR_AEN_COMMANDS      1
-#define NVME_LOOP_AQ_BLKMQ_DEPTH       \
-       (NVME_AQ_DEPTH - NVME_LOOP_NR_AEN_COMMANDS)
-
 struct nvme_loop_iod {
        struct nvme_request     nvme_req;
        struct nvme_command     cmd;
@@ -112,7 +104,7 @@ static void nvme_loop_queue_response(struct nvmet_req *req)
         * for them but rather special case them here.
         */
        if (unlikely(nvme_loop_queue_idx(queue) == 0 &&
-                       cqe->command_id >= NVME_LOOP_AQ_BLKMQ_DEPTH)) {
+                       cqe->command_id >= NVME_AQ_BLK_MQ_DEPTH)) {
                nvme_complete_async_event(&queue->ctrl->ctrl, cqe->status,
                                &cqe->result);
        } else {
@@ -200,7 +192,7 @@ static void nvme_loop_submit_async_event(struct nvme_ctrl *arg, int aer_idx)
 
        memset(&iod->cmd, 0, sizeof(iod->cmd));
        iod->cmd.common.opcode = nvme_admin_async_event;
-       iod->cmd.common.command_id = NVME_LOOP_AQ_BLKMQ_DEPTH;
+       iod->cmd.common.command_id = NVME_AQ_BLK_MQ_DEPTH;
        iod->cmd.common.flags |= NVME_CMD_SGL_METABUF;
 
        if (!nvmet_req_init(&iod->req, &queue->nvme_cq, &queue->nvme_sq,
@@ -356,7 +348,7 @@ static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
 
        memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set));
        ctrl->admin_tag_set.ops = &nvme_loop_admin_mq_ops;
-       ctrl->admin_tag_set.queue_depth = NVME_LOOP_AQ_BLKMQ_DEPTH;
+       ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH;
        ctrl->admin_tag_set.reserved_tags = 2; /* connect + keep-alive */
        ctrl->admin_tag_set.numa_node = NUMA_NO_NODE;
        ctrl->admin_tag_set.cmd_size = sizeof(struct nvme_loop_iod) +