Lines Matching +full:ctrl +full:- +full:len

1 // SPDX-License-Identifier: GPL-2.0
4 * Copyright (c) 2015-2016 HGST, a Western Digital Company.
17 u32 len = le16_to_cpu(cmd->get_log_page.numdu); in nvmet_get_log_page_len() local
19 len <<= 16; in nvmet_get_log_page_len()
20 len += le16_to_cpu(cmd->get_log_page.numdl); in nvmet_get_log_page_len()
22 len += 1; in nvmet_get_log_page_len()
23 len *= sizeof(u32); in nvmet_get_log_page_len()
25 return len; in nvmet_get_log_page_len()
32 return sizeof(req->sq->ctrl->hostid); in nvmet_feat_data_len()
40 return le64_to_cpu(cmd->get_log_page.lpo); in nvmet_get_log_page_offset()
45 nvmet_req_complete(req, nvmet_zero_sgl(req, 0, req->transfer_len)); in nvmet_execute_get_log_page_noop()
50 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_get_log_page_error() local
56 spin_lock_irqsave(&ctrl->error_lock, flags); in nvmet_execute_get_log_page_error()
57 slot = ctrl->err_counter % NVMET_ERROR_LOG_SLOTS; in nvmet_execute_get_log_page_error()
60 if (nvmet_copy_to_sgl(req, offset, &ctrl->slots[slot], in nvmet_execute_get_log_page_error()
65 slot = NVMET_ERROR_LOG_SLOTS - 1; in nvmet_execute_get_log_page_error()
67 slot--; in nvmet_execute_get_log_page_error()
70 spin_unlock_irqrestore(&ctrl->error_lock, flags); in nvmet_execute_get_log_page_error()
80 ns = nvmet_find_namespace(req->sq->ctrl, req->cmd->get_log_page.nsid); in nvmet_get_smart_log_nsid()
83 le32_to_cpu(req->cmd->get_log_page.nsid)); in nvmet_get_smart_log_nsid()
84 req->error_loc = offsetof(struct nvme_rw_command, nsid); in nvmet_get_smart_log_nsid()
89 if (!ns->bdev) in nvmet_get_smart_log_nsid()
92 host_reads = part_stat_read(ns->bdev->bd_part, ios[READ]); in nvmet_get_smart_log_nsid()
93 data_units_read = DIV_ROUND_UP(part_stat_read(ns->bdev->bd_part, in nvmet_get_smart_log_nsid()
95 host_writes = part_stat_read(ns->bdev->bd_part, ios[WRITE]); in nvmet_get_smart_log_nsid()
96 data_units_written = DIV_ROUND_UP(part_stat_read(ns->bdev->bd_part, in nvmet_get_smart_log_nsid()
99 put_unaligned_le64(host_reads, &slog->host_reads[0]); in nvmet_get_smart_log_nsid()
100 put_unaligned_le64(data_units_read, &slog->data_units_read[0]); in nvmet_get_smart_log_nsid()
101 put_unaligned_le64(host_writes, &slog->host_writes[0]); in nvmet_get_smart_log_nsid()
102 put_unaligned_le64(data_units_written, &slog->data_units_written[0]); in nvmet_get_smart_log_nsid()
115 struct nvmet_ctrl *ctrl; in nvmet_get_smart_log_all() local
118 ctrl = req->sq->ctrl; in nvmet_get_smart_log_all()
119 xa_for_each(&ctrl->subsys->namespaces, idx, ns) { in nvmet_get_smart_log_all()
121 if (!ns->bdev) in nvmet_get_smart_log_all()
123 host_reads += part_stat_read(ns->bdev->bd_part, ios[READ]); in nvmet_get_smart_log_all()
125 part_stat_read(ns->bdev->bd_part, sectors[READ]), 1000); in nvmet_get_smart_log_all()
126 host_writes += part_stat_read(ns->bdev->bd_part, ios[WRITE]); in nvmet_get_smart_log_all()
128 part_stat_read(ns->bdev->bd_part, sectors[WRITE]), 1000); in nvmet_get_smart_log_all()
131 put_unaligned_le64(host_reads, &slog->host_reads[0]); in nvmet_get_smart_log_all()
132 put_unaligned_le64(data_units_read, &slog->data_units_read[0]); in nvmet_get_smart_log_all()
133 put_unaligned_le64(host_writes, &slog->host_writes[0]); in nvmet_get_smart_log_all()
134 put_unaligned_le64(data_units_written, &slog->data_units_written[0]); in nvmet_get_smart_log_all()
145 if (req->transfer_len != sizeof(*log)) in nvmet_execute_get_log_page_smart()
152 if (req->cmd->get_log_page.nsid == cpu_to_le32(NVME_NSID_ALL)) in nvmet_execute_get_log_page_smart()
159 spin_lock_irqsave(&req->sq->ctrl->error_lock, flags); in nvmet_execute_get_log_page_smart()
160 put_unaligned_le64(req->sq->ctrl->err_counter, in nvmet_execute_get_log_page_smart()
161 &log->num_err_log_entries); in nvmet_execute_get_log_page_smart()
162 spin_unlock_irqrestore(&req->sq->ctrl->error_lock, flags); in nvmet_execute_get_log_page_smart()
180 log->acs[nvme_admin_get_log_page] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
181 log->acs[nvme_admin_identify] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
182 log->acs[nvme_admin_abort_cmd] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
183 log->acs[nvme_admin_set_features] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
184 log->acs[nvme_admin_get_features] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
185 log->acs[nvme_admin_async_event] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
186 log->acs[nvme_admin_keep_alive] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
188 log->iocs[nvme_cmd_read] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
189 log->iocs[nvme_cmd_write] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
190 log->iocs[nvme_cmd_flush] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
191 log->iocs[nvme_cmd_dsm] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
192 log->iocs[nvme_cmd_write_zeroes] = cpu_to_le32(1 << 0); in nvmet_execute_get_log_cmd_effects_ns()
203 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_get_log_changed_ns() local
205 size_t len; in nvmet_execute_get_log_changed_ns() local
207 if (req->transfer_len != NVME_MAX_CHANGED_NAMESPACES * sizeof(__le32)) in nvmet_execute_get_log_changed_ns()
210 mutex_lock(&ctrl->lock); in nvmet_execute_get_log_changed_ns()
211 if (ctrl->nr_changed_ns == U32_MAX) in nvmet_execute_get_log_changed_ns()
212 len = sizeof(__le32); in nvmet_execute_get_log_changed_ns()
214 len = ctrl->nr_changed_ns * sizeof(__le32); in nvmet_execute_get_log_changed_ns()
215 status = nvmet_copy_to_sgl(req, 0, ctrl->changed_ns_list, len); in nvmet_execute_get_log_changed_ns()
217 status = nvmet_zero_sgl(req, len, req->transfer_len - len); in nvmet_execute_get_log_changed_ns()
218 ctrl->nr_changed_ns = 0; in nvmet_execute_get_log_changed_ns()
220 mutex_unlock(&ctrl->lock); in nvmet_execute_get_log_changed_ns()
228 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_format_ana_group() local
233 if (!(req->cmd->get_log_page.lsp & NVME_ANA_LOG_RGO)) { in nvmet_format_ana_group()
234 xa_for_each(&ctrl->subsys->namespaces, idx, ns) in nvmet_format_ana_group()
235 if (ns->anagrpid == grpid) in nvmet_format_ana_group()
236 desc->nsids[count++] = cpu_to_le32(ns->nsid); in nvmet_format_ana_group()
239 desc->grpid = cpu_to_le32(grpid); in nvmet_format_ana_group()
240 desc->nnsids = cpu_to_le32(count); in nvmet_format_ana_group()
241 desc->chgcnt = cpu_to_le64(nvmet_ana_chgcnt); in nvmet_format_ana_group()
242 desc->state = req->port->ana_state[grpid]; in nvmet_format_ana_group()
243 memset(desc->rsvd17, 0, sizeof(desc->rsvd17)); in nvmet_format_ana_group()
252 size_t len; in nvmet_execute_get_log_page_ana() local
267 len = nvmet_format_ana_group(req, grpid, desc); in nvmet_execute_get_log_page_ana()
268 status = nvmet_copy_to_sgl(req, offset, desc, len); in nvmet_execute_get_log_page_ana()
271 offset += len; in nvmet_execute_get_log_page_ana()
294 if (!nvmet_check_transfer_len(req, nvmet_get_log_page_len(req->cmd))) in nvmet_execute_get_log_page()
297 switch (req->cmd->get_log_page.lid) { in nvmet_execute_get_log_page()
317 req->cmd->get_log_page.lid, req->sq->qid); in nvmet_execute_get_log_page()
318 req->error_loc = offsetof(struct nvme_get_log_page_command, lid); in nvmet_execute_get_log_page()
329 subsys_model = rcu_dereference(subsys->model); in nvmet_id_set_model_number()
331 model = subsys_model->number; in nvmet_id_set_model_number()
332 memcpy_and_pad(id->mn, sizeof(id->mn), model, strlen(model), ' '); in nvmet_id_set_model_number()
338 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_ctrl() local
350 id->vid = 0; in nvmet_execute_identify_ctrl()
351 id->ssvid = 0; in nvmet_execute_identify_ctrl()
353 memset(id->sn, ' ', sizeof(id->sn)); in nvmet_execute_identify_ctrl()
354 bin2hex(id->sn, &ctrl->subsys->serial, in nvmet_execute_identify_ctrl()
355 min(sizeof(ctrl->subsys->serial), sizeof(id->sn) / 2)); in nvmet_execute_identify_ctrl()
356 nvmet_id_set_model_number(id, ctrl->subsys); in nvmet_execute_identify_ctrl()
357 memcpy_and_pad(id->fr, sizeof(id->fr), in nvmet_execute_identify_ctrl()
360 id->rab = 6; in nvmet_execute_identify_ctrl()
368 id->cmic = (1 << 0) | (1 << 1) | (1 << 3); in nvmet_execute_identify_ctrl()
371 if (ctrl->ops->get_mdts) in nvmet_execute_identify_ctrl()
372 id->mdts = ctrl->ops->get_mdts(ctrl); in nvmet_execute_identify_ctrl()
374 id->mdts = 0; in nvmet_execute_identify_ctrl()
376 id->cntlid = cpu_to_le16(ctrl->cntlid); in nvmet_execute_identify_ctrl()
377 id->ver = cpu_to_le32(ctrl->subsys->ver); in nvmet_execute_identify_ctrl()
380 id->oaes = cpu_to_le32(NVMET_AEN_CFG_OPTIONAL); in nvmet_execute_identify_ctrl()
381 id->ctratt = cpu_to_le32(NVME_CTRL_ATTR_HID_128_BIT | in nvmet_execute_identify_ctrl()
384 id->oacs = 0; in nvmet_execute_identify_ctrl()
391 id->acl = 3; in nvmet_execute_identify_ctrl()
393 id->aerl = NVMET_ASYNC_EVENTS - 1; in nvmet_execute_identify_ctrl()
395 /* first slot is read-only, only one slot supported */ in nvmet_execute_identify_ctrl()
396 id->frmw = (1 << 0) | (1 << 1); in nvmet_execute_identify_ctrl()
397 id->lpa = (1 << 0) | (1 << 1) | (1 << 2); in nvmet_execute_identify_ctrl()
398 id->elpe = NVMET_ERROR_LOG_SLOTS - 1; in nvmet_execute_identify_ctrl()
399 id->npss = 0; in nvmet_execute_identify_ctrl()
401 /* We support keep-alive timeout in granularity of seconds */ in nvmet_execute_identify_ctrl()
402 id->kas = cpu_to_le16(NVMET_KAS); in nvmet_execute_identify_ctrl()
404 id->sqes = (0x6 << 4) | 0x6; in nvmet_execute_identify_ctrl()
405 id->cqes = (0x4 << 4) | 0x4; in nvmet_execute_identify_ctrl()
407 /* no enforcement soft-limit for maxcmd - pick arbitrary high value */ in nvmet_execute_identify_ctrl()
408 id->maxcmd = cpu_to_le16(NVMET_MAX_CMD); in nvmet_execute_identify_ctrl()
410 id->nn = cpu_to_le32(ctrl->subsys->max_nsid); in nvmet_execute_identify_ctrl()
411 id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES); in nvmet_execute_identify_ctrl()
412 id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM | in nvmet_execute_identify_ctrl()
416 id->vwc = NVME_CTRL_VWC_PRESENT; in nvmet_execute_identify_ctrl()
422 id->awun = 0; in nvmet_execute_identify_ctrl()
423 id->awupf = 0; in nvmet_execute_identify_ctrl()
425 id->sgls = cpu_to_le32(1 << 0); /* we always support SGLs */ in nvmet_execute_identify_ctrl()
426 if (ctrl->ops->flags & NVMF_KEYED_SGLS) in nvmet_execute_identify_ctrl()
427 id->sgls |= cpu_to_le32(1 << 2); in nvmet_execute_identify_ctrl()
428 if (req->port->inline_data_size) in nvmet_execute_identify_ctrl()
429 id->sgls |= cpu_to_le32(1 << 20); in nvmet_execute_identify_ctrl()
431 strlcpy(id->subnqn, ctrl->subsys->subsysnqn, sizeof(id->subnqn)); in nvmet_execute_identify_ctrl()
434 * Max command capsule size is sqe + in-capsule data size. in nvmet_execute_identify_ctrl()
435 * Disable in-capsule data for Metadata capable controllers. in nvmet_execute_identify_ctrl()
438 if (!ctrl->pi_support) in nvmet_execute_identify_ctrl()
439 cmd_capsule_size += req->port->inline_data_size; in nvmet_execute_identify_ctrl()
440 id->ioccsz = cpu_to_le32(cmd_capsule_size / 16); in nvmet_execute_identify_ctrl()
443 id->iorcsz = cpu_to_le32(sizeof(struct nvme_completion) / 16); in nvmet_execute_identify_ctrl()
445 id->msdbd = ctrl->ops->msdbd; in nvmet_execute_identify_ctrl()
447 id->anacap = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4); in nvmet_execute_identify_ctrl()
448 id->anatt = 10; /* random value */ in nvmet_execute_identify_ctrl()
449 id->anagrpmax = cpu_to_le32(NVMET_MAX_ANAGRPS); in nvmet_execute_identify_ctrl()
450 id->nanagrpid = cpu_to_le32(NVMET_MAX_ANAGRPS); in nvmet_execute_identify_ctrl()
456 id->psd[0].max_power = cpu_to_le16(0x9c4); in nvmet_execute_identify_ctrl()
457 id->psd[0].entry_lat = cpu_to_le32(0x10); in nvmet_execute_identify_ctrl()
458 id->psd[0].exit_lat = cpu_to_le32(0x4); in nvmet_execute_identify_ctrl()
460 id->nwpc = 1 << 0; /* write protect and no write protect */ in nvmet_execute_identify_ctrl()
471 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_ns() local
476 if (le32_to_cpu(req->cmd->identify.nsid) == NVME_NSID_ALL) { in nvmet_execute_identify_ns()
477 req->error_loc = offsetof(struct nvme_identify, nsid); in nvmet_execute_identify_ns()
489 ns = nvmet_find_namespace(ctrl, req->cmd->identify.nsid); in nvmet_execute_identify_ns()
499 id->ncap = id->nsze = cpu_to_le64(ns->size >> ns->blksize_shift); in nvmet_execute_identify_ns()
500 switch (req->port->ana_state[ns->anagrpid]) { in nvmet_execute_identify_ns()
505 id->nuse = id->nsze; in nvmet_execute_identify_ns()
509 if (ns->bdev) in nvmet_execute_identify_ns()
510 nvmet_bdev_set_limits(ns->bdev, id); in nvmet_execute_identify_ns()
516 id->nlbaf = 0; in nvmet_execute_identify_ns()
517 id->flbas = 0; in nvmet_execute_identify_ns()
523 id->nmic = (1 << 0); in nvmet_execute_identify_ns()
524 id->anagrpid = cpu_to_le32(ns->anagrpid); in nvmet_execute_identify_ns()
526 memcpy(&id->nguid, &ns->nguid, sizeof(id->nguid)); in nvmet_execute_identify_ns()
528 id->lbaf[0].ds = ns->blksize_shift; in nvmet_execute_identify_ns()
530 if (ctrl->pi_support && nvmet_ns_has_pi(ns)) { in nvmet_execute_identify_ns()
531 id->dpc = NVME_NS_DPC_PI_FIRST | NVME_NS_DPC_PI_LAST | in nvmet_execute_identify_ns()
534 id->mc = NVME_MC_EXTENDED_LBA; in nvmet_execute_identify_ns()
535 id->dps = ns->pi_type; in nvmet_execute_identify_ns()
536 id->flbas = NVME_NS_FLBAS_META_EXT; in nvmet_execute_identify_ns()
537 id->lbaf[0].ms = cpu_to_le16(ns->metadata_size); in nvmet_execute_identify_ns()
540 if (ns->readonly) in nvmet_execute_identify_ns()
541 id->nsattr |= (1 << 0); in nvmet_execute_identify_ns()
553 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_nslist() local
556 u32 min_nsid = le32_to_cpu(req->cmd->identify.nsid); in nvmet_execute_identify_nslist()
567 xa_for_each(&ctrl->subsys->namespaces, idx, ns) { in nvmet_execute_identify_nslist()
568 if (ns->nsid <= min_nsid) in nvmet_execute_identify_nslist()
570 list[i++] = cpu_to_le32(ns->nsid); in nvmet_execute_identify_nslist()
582 static u16 nvmet_copy_ns_identifier(struct nvmet_req *req, u8 type, u8 len, in nvmet_copy_ns_identifier() argument
587 .nidl = len, in nvmet_copy_ns_identifier()
596 status = nvmet_copy_to_sgl(req, *off, id, len); in nvmet_copy_ns_identifier()
599 *off += len; in nvmet_copy_ns_identifier()
610 ns = nvmet_find_namespace(req->sq->ctrl, req->cmd->identify.nsid); in nvmet_execute_identify_desclist()
612 req->error_loc = offsetof(struct nvme_identify, nsid); in nvmet_execute_identify_desclist()
617 if (memchr_inv(&ns->uuid, 0, sizeof(ns->uuid))) { in nvmet_execute_identify_desclist()
620 &ns->uuid, &off); in nvmet_execute_identify_desclist()
624 if (memchr_inv(ns->nguid, 0, sizeof(ns->nguid))) { in nvmet_execute_identify_desclist()
627 &ns->nguid, &off); in nvmet_execute_identify_desclist()
632 if (sg_zero_buffer(req->sg, req->sg_cnt, NVME_IDENTIFY_DATA_SIZE - off, in nvmet_execute_identify_desclist()
633 off) != NVME_IDENTIFY_DATA_SIZE - off) in nvmet_execute_identify_desclist()
646 switch (req->cmd->identify.cns) { in nvmet_execute_identify()
658 req->cmd->identify.cns, req->sq->qid); in nvmet_execute_identify()
659 req->error_loc = offsetof(struct nvme_identify, cns); in nvmet_execute_identify()
682 if (req->ns->file) in nvmet_write_protect_flush_sync()
688 pr_err("write protect flush failed nsid: %u\n", req->ns->nsid); in nvmet_write_protect_flush_sync()
694 u32 write_protect = le32_to_cpu(req->cmd->common.cdw11); in nvmet_set_feat_write_protect()
695 struct nvmet_subsys *subsys = req->sq->ctrl->subsys; in nvmet_set_feat_write_protect()
698 req->ns = nvmet_find_namespace(req->sq->ctrl, req->cmd->rw.nsid); in nvmet_set_feat_write_protect()
699 if (unlikely(!req->ns)) { in nvmet_set_feat_write_protect()
700 req->error_loc = offsetof(struct nvme_common_command, nsid); in nvmet_set_feat_write_protect()
704 mutex_lock(&subsys->lock); in nvmet_set_feat_write_protect()
707 req->ns->readonly = true; in nvmet_set_feat_write_protect()
710 req->ns->readonly = false; in nvmet_set_feat_write_protect()
713 req->ns->readonly = false; in nvmet_set_feat_write_protect()
721 nvmet_ns_changed(subsys, req->ns->nsid); in nvmet_set_feat_write_protect()
722 mutex_unlock(&subsys->lock); in nvmet_set_feat_write_protect()
728 u32 val32 = le32_to_cpu(req->cmd->common.cdw11); in nvmet_set_feat_kato()
730 nvmet_stop_keep_alive_timer(req->sq->ctrl); in nvmet_set_feat_kato()
731 req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); in nvmet_set_feat_kato()
732 nvmet_start_keep_alive_timer(req->sq->ctrl); in nvmet_set_feat_kato()
734 nvmet_set_result(req, req->sq->ctrl->kato); in nvmet_set_feat_kato()
741 u32 val32 = le32_to_cpu(req->cmd->common.cdw11); in nvmet_set_feat_async_event()
744 req->error_loc = offsetof(struct nvme_common_command, cdw11); in nvmet_set_feat_async_event()
748 WRITE_ONCE(req->sq->ctrl->aen_enabled, val32); in nvmet_set_feat_async_event()
756 struct nvmet_subsys *subsys = req->sq->ctrl->subsys; in nvmet_execute_set_features()
757 u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10); in nvmet_execute_set_features()
758 u32 cdw11 = le32_to_cpu(req->cmd->common.cdw11); in nvmet_execute_set_features()
775 (subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16)); in nvmet_execute_set_features()
790 req->error_loc = offsetof(struct nvme_common_command, cdw10); in nvmet_execute_set_features()
800 struct nvmet_subsys *subsys = req->sq->ctrl->subsys; in nvmet_get_feat_write_protect()
803 req->ns = nvmet_find_namespace(req->sq->ctrl, req->cmd->common.nsid); in nvmet_get_feat_write_protect()
804 if (!req->ns) { in nvmet_get_feat_write_protect()
805 req->error_loc = offsetof(struct nvme_common_command, nsid); in nvmet_get_feat_write_protect()
808 mutex_lock(&subsys->lock); in nvmet_get_feat_write_protect()
809 if (req->ns->readonly == true) in nvmet_get_feat_write_protect()
814 mutex_unlock(&subsys->lock); in nvmet_get_feat_write_protect()
821 nvmet_set_result(req, req->sq->ctrl->kato * 1000); in nvmet_get_feat_kato()
826 nvmet_set_result(req, READ_ONCE(req->sq->ctrl->aen_enabled)); in nvmet_get_feat_async_event()
831 struct nvmet_subsys *subsys = req->sq->ctrl->subsys; in nvmet_execute_get_features()
832 u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10); in nvmet_execute_get_features()
868 (subsys->max_qid-1) | ((subsys->max_qid-1) << 16)); in nvmet_execute_get_features()
874 /* need 128-bit host identifier flag */ in nvmet_execute_get_features()
875 if (!(req->cmd->common.cdw11 & cpu_to_le32(1 << 0))) { in nvmet_execute_get_features()
876 req->error_loc = in nvmet_execute_get_features()
882 status = nvmet_copy_to_sgl(req, 0, &req->sq->ctrl->hostid, in nvmet_execute_get_features()
883 sizeof(req->sq->ctrl->hostid)); in nvmet_execute_get_features()
889 req->error_loc = in nvmet_execute_get_features()
900 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_async_event() local
905 mutex_lock(&ctrl->lock); in nvmet_execute_async_event()
906 if (ctrl->nr_async_event_cmds >= NVMET_ASYNC_EVENTS) { in nvmet_execute_async_event()
907 mutex_unlock(&ctrl->lock); in nvmet_execute_async_event()
911 ctrl->async_event_cmds[ctrl->nr_async_event_cmds++] = req; in nvmet_execute_async_event()
912 mutex_unlock(&ctrl->lock); in nvmet_execute_async_event()
914 schedule_work(&ctrl->async_event_work); in nvmet_execute_async_event()
919 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_keep_alive() local
924 pr_debug("ctrl %d update keep-alive timer for %d secs\n", in nvmet_execute_keep_alive()
925 ctrl->cntlid, ctrl->kato); in nvmet_execute_keep_alive()
927 mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ); in nvmet_execute_keep_alive()
933 struct nvme_command *cmd = req->cmd; in nvmet_parse_admin_cmd()
938 if (req->sq->ctrl->subsys->type == NVME_NQN_DISC) in nvmet_parse_admin_cmd()
948 switch (cmd->common.opcode) { in nvmet_parse_admin_cmd()
950 req->execute = nvmet_execute_get_log_page; in nvmet_parse_admin_cmd()
953 req->execute = nvmet_execute_identify; in nvmet_parse_admin_cmd()
956 req->execute = nvmet_execute_abort; in nvmet_parse_admin_cmd()
959 req->execute = nvmet_execute_set_features; in nvmet_parse_admin_cmd()
962 req->execute = nvmet_execute_get_features; in nvmet_parse_admin_cmd()
965 req->execute = nvmet_execute_async_event; in nvmet_parse_admin_cmd()
968 req->execute = nvmet_execute_keep_alive; in nvmet_parse_admin_cmd()
972 pr_err("unhandled cmd %d on qid %d\n", cmd->common.opcode, in nvmet_parse_admin_cmd()
973 req->sq->qid); in nvmet_parse_admin_cmd()
974 req->error_loc = offsetof(struct nvme_common_command, opcode); in nvmet_parse_admin_cmd()