Lines Matching refs:ctrl

17 	struct nvmet_ctrl *ctrl = req->sq->ctrl;  in nvmet_execute_delete_sq()  local
21 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_execute_delete_sq()
31 status = nvmet_check_sqid(ctrl, sqid, false); in nvmet_execute_delete_sq()
35 status = ctrl->ops->delete_sq(ctrl, sqid); in nvmet_execute_delete_sq()
43 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_create_sq() local
52 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_execute_create_sq()
62 status = nvmet_check_sqid(ctrl, sqid, true); in nvmet_execute_create_sq()
77 if (!qsize || qsize > NVME_CAP_MQES(ctrl->cap)) { in nvmet_execute_create_sq()
82 status = ctrl->ops->create_sq(ctrl, sqid, sq_flags, qsize, prp1); in nvmet_execute_create_sq()
90 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_delete_cq() local
94 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_execute_delete_cq()
104 status = nvmet_check_cqid(ctrl, cqid); in nvmet_execute_delete_cq()
108 status = ctrl->ops->delete_cq(ctrl, cqid); in nvmet_execute_delete_cq()
116 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_create_cq() local
125 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_execute_create_cq()
135 status = nvmet_check_cqid(ctrl, cqid); in nvmet_execute_create_cq()
139 if (!qsize || qsize > NVME_CAP_MQES(ctrl->cap)) { in nvmet_execute_create_cq()
144 status = ctrl->ops->create_cq(ctrl, cqid, cq_flags, qsize, in nvmet_execute_create_cq()
168 return sizeof(req->sq->ctrl->hostid); in nvmet_feat_data_len()
186 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_get_log_page_error() local
192 spin_lock_irqsave(&ctrl->error_lock, flags); in nvmet_execute_get_log_page_error()
193 slot = ctrl->err_counter % NVMET_ERROR_LOG_SLOTS; in nvmet_execute_get_log_page_error()
196 if (nvmet_copy_to_sgl(req, offset, &ctrl->slots[slot], in nvmet_execute_get_log_page_error()
206 spin_unlock_irqrestore(&ctrl->error_lock, flags); in nvmet_execute_get_log_page_error()
274 struct nvmet_ctrl *ctrl; in nvmet_get_smart_log_all() local
277 ctrl = req->sq->ctrl; in nvmet_get_smart_log_all()
278 nvmet_for_each_enabled_ns(&ctrl->subsys->namespaces, idx, ns) { in nvmet_get_smart_log_all()
357 spin_lock_irqsave(&req->sq->ctrl->error_lock, flags); in nvmet_execute_get_log_page_smart()
358 put_unaligned_le64(req->sq->ctrl->err_counter, in nvmet_execute_get_log_page_smart()
360 spin_unlock_irqrestore(&req->sq->ctrl->error_lock, flags); in nvmet_execute_get_log_page_smart()
369 static void nvmet_get_cmd_effects_admin(struct nvmet_ctrl *ctrl, in nvmet_get_cmd_effects_admin() argument
373 if (nvmet_is_pci_ctrl(ctrl)) { in nvmet_get_cmd_effects_admin()
417 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_get_log_cmd_effects_ns() local
429 nvmet_get_cmd_effects_admin(ctrl, log); in nvmet_execute_get_log_cmd_effects_ns()
437 nvmet_get_cmd_effects_admin(ctrl, log); in nvmet_execute_get_log_cmd_effects_ns()
455 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_get_log_changed_ns() local
462 mutex_lock(&ctrl->lock); in nvmet_execute_get_log_changed_ns()
463 if (ctrl->nr_changed_ns == U32_MAX) in nvmet_execute_get_log_changed_ns()
466 len = ctrl->nr_changed_ns * sizeof(__le32); in nvmet_execute_get_log_changed_ns()
467 status = nvmet_copy_to_sgl(req, 0, ctrl->changed_ns_list, len); in nvmet_execute_get_log_changed_ns()
470 ctrl->nr_changed_ns = 0; in nvmet_execute_get_log_changed_ns()
472 mutex_unlock(&ctrl->lock); in nvmet_execute_get_log_changed_ns()
480 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_format_ana_group() local
486 nvmet_for_each_enabled_ns(&ctrl->subsys->namespaces, idx, ns) { in nvmet_format_ana_group()
660 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_ctrl() local
661 struct nvmet_subsys *subsys = ctrl->subsys; in nvmet_execute_identify_ctrl()
681 memcpy(id->sn, ctrl->subsys->serial, NVMET_SN_MAX_SIZE); in nvmet_execute_identify_ctrl()
691 if (nvmet_is_disc_subsys(ctrl->subsys)) in nvmet_execute_identify_ctrl()
701 if (ctrl->ops->get_mdts) in nvmet_execute_identify_ctrl()
702 id->mdts = ctrl->ops->get_mdts(ctrl); in nvmet_execute_identify_ctrl()
706 id->cntlid = cpu_to_le16(ctrl->cntlid); in nvmet_execute_identify_ctrl()
707 id->ver = cpu_to_le32(ctrl->subsys->ver); in nvmet_execute_identify_ctrl()
712 if (nvmet_is_pci_ctrl(ctrl)) in nvmet_execute_identify_ctrl()
740 id->maxcmd = cpu_to_le16(NVMET_MAX_CMD(ctrl)); in nvmet_execute_identify_ctrl()
760 if (ctrl->ops->flags & NVMF_KEYED_SGLS) in nvmet_execute_identify_ctrl()
765 strscpy(id->subnqn, ctrl->subsys->subsysnqn, sizeof(id->subnqn)); in nvmet_execute_identify_ctrl()
772 if (!ctrl->pi_support) in nvmet_execute_identify_ctrl()
779 id->msdbd = ctrl->ops->msdbd; in nvmet_execute_identify_ctrl()
891 if (req->sq->ctrl->pi_support && nvmet_ns_has_pi(req->ns)) { in nvmet_execute_identify_ns()
916 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_endgrp_list() local
929 nvmet_for_each_enabled_ns(&ctrl->subsys->namespaces, idx, ns) { in nvmet_execute_identify_endgrp_list()
948 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_nslist() local
972 nvmet_for_each_enabled_ns(&ctrl->subsys->namespaces, idx, ns) { in nvmet_execute_identify_nslist()
1238 nvmet_stop_keep_alive_timer(req->sq->ctrl); in nvmet_set_feat_kato()
1239 req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); in nvmet_set_feat_kato()
1240 nvmet_start_keep_alive_timer(req->sq->ctrl); in nvmet_set_feat_kato()
1242 nvmet_set_result(req, req->sq->ctrl->kato); in nvmet_set_feat_kato()
1256 WRITE_ONCE(req->sq->ctrl->aen_enabled, val32); in nvmet_set_feat_async_event()
1264 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_set_feat_host_id() local
1266 if (!nvmet_is_pci_ctrl(ctrl)) in nvmet_set_feat_host_id()
1283 return nvmet_copy_from_sgl(req, 0, &req->sq->ctrl->hostid, in nvmet_set_feat_host_id()
1284 sizeof(req->sq->ctrl->hostid)); in nvmet_set_feat_host_id()
1289 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_set_feat_irq_coalesce() local
1300 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_set_feat_irq_coalesce()
1305 return ctrl->ops->set_feature(ctrl, NVME_FEAT_IRQ_COALESCE, &irqc); in nvmet_set_feat_irq_coalesce()
1310 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_set_feat_irq_config() local
1321 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_set_feat_irq_config()
1326 return ctrl->ops->set_feature(ctrl, NVME_FEAT_IRQ_CONFIG, &irqcfg); in nvmet_set_feat_irq_config()
1331 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_set_feat_arbitration() local
1340 if (!ctrl->ops->set_feature) { in nvmet_set_feat_arbitration()
1345 return ctrl->ops->set_feature(ctrl, NVME_FEAT_ARBITRATION, &arb); in nvmet_set_feat_arbitration()
1426 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_get_feat_irq_coalesce() local
1434 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_get_feat_irq_coalesce()
1439 status = ctrl->ops->get_feature(ctrl, NVME_FEAT_IRQ_COALESCE, &irqc); in nvmet_get_feat_irq_coalesce()
1450 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_get_feat_irq_config() local
1459 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_get_feat_irq_config()
1464 status = ctrl->ops->get_feature(ctrl, NVME_FEAT_IRQ_CONFIG, &irqcfg); in nvmet_get_feat_irq_config()
1475 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_get_feat_arbitration() local
1479 if (!ctrl->ops->get_feature) { in nvmet_get_feat_arbitration()
1484 status = ctrl->ops->get_feature(ctrl, NVME_FEAT_ARBITRATION, &arb); in nvmet_get_feat_arbitration()
1499 nvmet_set_result(req, req->sq->ctrl->kato * 1000); in nvmet_get_feat_kato()
1504 nvmet_set_result(req, READ_ONCE(req->sq->ctrl->aen_enabled)); in nvmet_get_feat_async_event()
1563 status = nvmet_copy_to_sgl(req, 0, &req->sq->ctrl->hostid, in nvmet_execute_get_features()
1564 sizeof(req->sq->ctrl->hostid)); in nvmet_execute_get_features()
1584 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_async_event() local
1589 mutex_lock(&ctrl->lock); in nvmet_execute_async_event()
1590 if (ctrl->nr_async_event_cmds >= NVMET_ASYNC_EVENTS) { in nvmet_execute_async_event()
1591 mutex_unlock(&ctrl->lock); in nvmet_execute_async_event()
1595 ctrl->async_event_cmds[ctrl->nr_async_event_cmds++] = req; in nvmet_execute_async_event()
1596 mutex_unlock(&ctrl->lock); in nvmet_execute_async_event()
1598 queue_work(nvmet_wq, &ctrl->async_event_work); in nvmet_execute_async_event()
1603 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_keep_alive() local
1609 if (!ctrl->kato) { in nvmet_execute_keep_alive()
1615 ctrl->cntlid, ctrl->kato); in nvmet_execute_keep_alive()
1616 mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ); in nvmet_execute_keep_alive()
1657 if (nvmet_is_pci_ctrl(req->sq->ctrl) && !req->sq->qid && in nvmet_parse_admin_cmd()