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()
85 if (!req->ns->bdev) in nvmet_get_smart_log_nsid()
88 host_reads = part_stat_read(req->ns->bdev, ios[READ]); in nvmet_get_smart_log_nsid()
90 DIV_ROUND_UP(part_stat_read(req->ns->bdev, sectors[READ]), 1000); in nvmet_get_smart_log_nsid()
91 host_writes = part_stat_read(req->ns->bdev, ios[WRITE]); in nvmet_get_smart_log_nsid()
93 DIV_ROUND_UP(part_stat_read(req->ns->bdev, sectors[WRITE]), 1000); in nvmet_get_smart_log_nsid()
95 put_unaligned_le64(host_reads, &slog->host_reads[0]); in nvmet_get_smart_log_nsid()
96 put_unaligned_le64(data_units_read, &slog->data_units_read[0]); in nvmet_get_smart_log_nsid()
97 put_unaligned_le64(host_writes, &slog->host_writes[0]); in nvmet_get_smart_log_nsid()
98 put_unaligned_le64(data_units_written, &slog->data_units_written[0]); in nvmet_get_smart_log_nsid()
109 struct nvmet_ctrl *ctrl; in nvmet_get_smart_log_all() local
112 ctrl = req->sq->ctrl; in nvmet_get_smart_log_all()
113 xa_for_each(&ctrl->subsys->namespaces, idx, ns) { in nvmet_get_smart_log_all()
115 if (!ns->bdev) in nvmet_get_smart_log_all()
117 host_reads += part_stat_read(ns->bdev, ios[READ]); in nvmet_get_smart_log_all()
119 part_stat_read(ns->bdev, sectors[READ]), 1000); in nvmet_get_smart_log_all()
120 host_writes += part_stat_read(ns->bdev, ios[WRITE]); in nvmet_get_smart_log_all()
122 part_stat_read(ns->bdev, sectors[WRITE]), 1000); in nvmet_get_smart_log_all()
125 put_unaligned_le64(host_reads, &slog->host_reads[0]); in nvmet_get_smart_log_all()
126 put_unaligned_le64(data_units_read, &slog->data_units_read[0]); in nvmet_get_smart_log_all()
127 put_unaligned_le64(host_writes, &slog->host_writes[0]); in nvmet_get_smart_log_all()
128 put_unaligned_le64(data_units_written, &slog->data_units_written[0]); in nvmet_get_smart_log_all()
139 if (req->transfer_len != sizeof(*log)) in nvmet_execute_get_log_page_smart()
146 if (req->cmd->get_log_page.nsid == cpu_to_le32(NVME_NSID_ALL)) in nvmet_execute_get_log_page_smart()
153 spin_lock_irqsave(&req->sq->ctrl->error_lock, flags); in nvmet_execute_get_log_page_smart()
154 put_unaligned_le64(req->sq->ctrl->err_counter, in nvmet_execute_get_log_page_smart()
155 &log->num_err_log_entries); in nvmet_execute_get_log_page_smart()
156 spin_unlock_irqrestore(&req->sq->ctrl->error_lock, flags); in nvmet_execute_get_log_page_smart()
167 log->acs[nvme_admin_get_log_page] = in nvmet_get_cmd_effects_nvm()
168 log->acs[nvme_admin_identify] = in nvmet_get_cmd_effects_nvm()
169 log->acs[nvme_admin_abort_cmd] = in nvmet_get_cmd_effects_nvm()
170 log->acs[nvme_admin_set_features] = in nvmet_get_cmd_effects_nvm()
171 log->acs[nvme_admin_get_features] = in nvmet_get_cmd_effects_nvm()
172 log->acs[nvme_admin_async_event] = in nvmet_get_cmd_effects_nvm()
173 log->acs[nvme_admin_keep_alive] = in nvmet_get_cmd_effects_nvm()
176 log->iocs[nvme_cmd_read] = in nvmet_get_cmd_effects_nvm()
177 log->iocs[nvme_cmd_flush] = in nvmet_get_cmd_effects_nvm()
178 log->iocs[nvme_cmd_dsm] = in nvmet_get_cmd_effects_nvm()
180 log->iocs[nvme_cmd_write] = in nvmet_get_cmd_effects_nvm()
181 log->iocs[nvme_cmd_write_zeroes] = in nvmet_get_cmd_effects_nvm()
187 log->iocs[nvme_cmd_zone_append] = in nvmet_get_cmd_effects_zns()
188 log->iocs[nvme_cmd_zone_mgmt_send] = in nvmet_get_cmd_effects_zns()
190 log->iocs[nvme_cmd_zone_mgmt_recv] = in nvmet_get_cmd_effects_zns()
205 switch (req->cmd->get_log_page.csi) { in nvmet_execute_get_log_cmd_effects_ns()
231 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_get_log_changed_ns() local
233 size_t len; in nvmet_execute_get_log_changed_ns() local
235 if (req->transfer_len != NVME_MAX_CHANGED_NAMESPACES * sizeof(__le32)) in nvmet_execute_get_log_changed_ns()
238 mutex_lock(&ctrl->lock); in nvmet_execute_get_log_changed_ns()
239 if (ctrl->nr_changed_ns == U32_MAX) in nvmet_execute_get_log_changed_ns()
240 len = sizeof(__le32); in nvmet_execute_get_log_changed_ns()
242 len = ctrl->nr_changed_ns * sizeof(__le32); in nvmet_execute_get_log_changed_ns()
243 status = nvmet_copy_to_sgl(req, 0, ctrl->changed_ns_list, len); in nvmet_execute_get_log_changed_ns()
245 status = nvmet_zero_sgl(req, len, req->transfer_len - len); in nvmet_execute_get_log_changed_ns()
246 ctrl->nr_changed_ns = 0; in nvmet_execute_get_log_changed_ns()
248 mutex_unlock(&ctrl->lock); in nvmet_execute_get_log_changed_ns()
256 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_format_ana_group() local
261 if (!(req->cmd->get_log_page.lsp & NVME_ANA_LOG_RGO)) { in nvmet_format_ana_group()
262 xa_for_each(&ctrl->subsys->namespaces, idx, ns) in nvmet_format_ana_group()
263 if (ns->anagrpid == grpid) in nvmet_format_ana_group()
264 desc->nsids[count++] = cpu_to_le32(ns->nsid); in nvmet_format_ana_group()
267 desc->grpid = cpu_to_le32(grpid); in nvmet_format_ana_group()
268 desc->nnsids = cpu_to_le32(count); in nvmet_format_ana_group()
269 desc->chgcnt = cpu_to_le64(nvmet_ana_chgcnt); in nvmet_format_ana_group()
270 desc->state = req->port->ana_state[grpid]; in nvmet_format_ana_group()
271 memset(desc->rsvd17, 0, sizeof(desc->rsvd17)); in nvmet_format_ana_group()
280 size_t len; in nvmet_execute_get_log_page_ana() local
295 len = nvmet_format_ana_group(req, grpid, desc); in nvmet_execute_get_log_page_ana()
296 status = nvmet_copy_to_sgl(req, offset, desc, len); in nvmet_execute_get_log_page_ana()
299 offset += len; in nvmet_execute_get_log_page_ana()
322 if (!nvmet_check_transfer_len(req, nvmet_get_log_page_len(req->cmd))) in nvmet_execute_get_log_page()
325 switch (req->cmd->get_log_page.lid) { in nvmet_execute_get_log_page()
345 req->cmd->get_log_page.lid, req->sq->qid); in nvmet_execute_get_log_page()
346 req->error_loc = offsetof(struct nvme_get_log_page_command, lid); in nvmet_execute_get_log_page()
352 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_ctrl() local
353 struct nvmet_subsys *subsys = ctrl->subsys; in nvmet_execute_identify_ctrl()
358 if (!subsys->subsys_discovered) { in nvmet_execute_identify_ctrl()
359 mutex_lock(&subsys->lock); in nvmet_execute_identify_ctrl()
360 subsys->subsys_discovered = true; in nvmet_execute_identify_ctrl()
361 mutex_unlock(&subsys->lock); in nvmet_execute_identify_ctrl()
371 id->vid = 0; in nvmet_execute_identify_ctrl()
372 id->ssvid = 0; in nvmet_execute_identify_ctrl()
374 memcpy(id->sn, ctrl->subsys->serial, NVMET_SN_MAX_SIZE); in nvmet_execute_identify_ctrl()
375 memcpy_and_pad(id->mn, sizeof(id->mn), subsys->model_number, in nvmet_execute_identify_ctrl()
376 strlen(subsys->model_number), ' '); in nvmet_execute_identify_ctrl()
377 memcpy_and_pad(id->fr, sizeof(id->fr), in nvmet_execute_identify_ctrl()
378 subsys->firmware_rev, strlen(subsys->firmware_rev), ' '); in nvmet_execute_identify_ctrl()
380 put_unaligned_le24(subsys->ieee_oui, id->ieee); in nvmet_execute_identify_ctrl()
382 id->rab = 6; in nvmet_execute_identify_ctrl()
384 if (nvmet_is_disc_subsys(ctrl->subsys)) in nvmet_execute_identify_ctrl()
385 id->cntrltype = NVME_CTRL_DISC; in nvmet_execute_identify_ctrl()
387 id->cntrltype = NVME_CTRL_IO; in nvmet_execute_identify_ctrl()
390 id->cmic = NVME_CTRL_CMIC_MULTI_PORT | NVME_CTRL_CMIC_MULTI_CTRL | in nvmet_execute_identify_ctrl()
394 if (ctrl->ops->get_mdts) in nvmet_execute_identify_ctrl()
395 id->mdts = ctrl->ops->get_mdts(ctrl); in nvmet_execute_identify_ctrl()
397 id->mdts = 0; in nvmet_execute_identify_ctrl()
399 id->cntlid = cpu_to_le16(ctrl->cntlid); in nvmet_execute_identify_ctrl()
400 id->ver = cpu_to_le32(ctrl->subsys->ver); in nvmet_execute_identify_ctrl()
403 id->oaes = cpu_to_le32(NVMET_AEN_CFG_OPTIONAL); in nvmet_execute_identify_ctrl()
404 id->ctratt = cpu_to_le32(NVME_CTRL_ATTR_HID_128_BIT | in nvmet_execute_identify_ctrl()
407 id->oacs = 0; in nvmet_execute_identify_ctrl()
414 id->acl = 3; in nvmet_execute_identify_ctrl()
416 id->aerl = NVMET_ASYNC_EVENTS - 1; in nvmet_execute_identify_ctrl()
418 /* first slot is read-only, only one slot supported */ in nvmet_execute_identify_ctrl()
419 id->frmw = (1 << 0) | (1 << 1); in nvmet_execute_identify_ctrl()
420 id->lpa = (1 << 0) | (1 << 1) | (1 << 2); in nvmet_execute_identify_ctrl()
421 id->elpe = NVMET_ERROR_LOG_SLOTS - 1; in nvmet_execute_identify_ctrl()
422 id->npss = 0; in nvmet_execute_identify_ctrl()
424 /* We support keep-alive timeout in granularity of seconds */ in nvmet_execute_identify_ctrl()
425 id->kas = cpu_to_le16(NVMET_KAS); in nvmet_execute_identify_ctrl()
427 id->sqes = (0x6 << 4) | 0x6; in nvmet_execute_identify_ctrl()
428 id->cqes = (0x4 << 4) | 0x4; in nvmet_execute_identify_ctrl()
430 /* no enforcement soft-limit for maxcmd - pick arbitrary high value */ in nvmet_execute_identify_ctrl()
431 id->maxcmd = cpu_to_le16(NVMET_MAX_CMD(ctrl)); in nvmet_execute_identify_ctrl()
433 id->nn = cpu_to_le32(NVMET_MAX_NAMESPACES); in nvmet_execute_identify_ctrl()
434 id->mnan = cpu_to_le32(NVMET_MAX_NAMESPACES); in nvmet_execute_identify_ctrl()
435 id->oncs = cpu_to_le16(NVME_CTRL_ONCS_DSM | in nvmet_execute_identify_ctrl()
439 id->vwc = NVME_CTRL_VWC_PRESENT; in nvmet_execute_identify_ctrl()
445 id->awun = 0; in nvmet_execute_identify_ctrl()
446 id->awupf = 0; in nvmet_execute_identify_ctrl()
448 id->sgls = cpu_to_le32(1 << 0); /* we always support SGLs */ in nvmet_execute_identify_ctrl()
449 if (ctrl->ops->flags & NVMF_KEYED_SGLS) in nvmet_execute_identify_ctrl()
450 id->sgls |= cpu_to_le32(1 << 2); in nvmet_execute_identify_ctrl()
451 if (req->port->inline_data_size) in nvmet_execute_identify_ctrl()
452 id->sgls |= cpu_to_le32(1 << 20); in nvmet_execute_identify_ctrl()
454 strscpy(id->subnqn, ctrl->subsys->subsysnqn, sizeof(id->subnqn)); in nvmet_execute_identify_ctrl()
457 * Max command capsule size is sqe + in-capsule data size. in nvmet_execute_identify_ctrl()
458 * Disable in-capsule data for Metadata capable controllers. in nvmet_execute_identify_ctrl()
461 if (!ctrl->pi_support) in nvmet_execute_identify_ctrl()
462 cmd_capsule_size += req->port->inline_data_size; in nvmet_execute_identify_ctrl()
463 id->ioccsz = cpu_to_le32(cmd_capsule_size / 16); in nvmet_execute_identify_ctrl()
466 id->iorcsz = cpu_to_le32(sizeof(struct nvme_completion) / 16); in nvmet_execute_identify_ctrl()
468 id->msdbd = ctrl->ops->msdbd; in nvmet_execute_identify_ctrl()
470 id->anacap = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4); in nvmet_execute_identify_ctrl()
471 id->anatt = 10; /* random value */ in nvmet_execute_identify_ctrl()
472 id->anagrpmax = cpu_to_le32(NVMET_MAX_ANAGRPS); in nvmet_execute_identify_ctrl()
473 id->nanagrpid = cpu_to_le32(NVMET_MAX_ANAGRPS); in nvmet_execute_identify_ctrl()
479 id->psd[0].max_power = cpu_to_le16(0x9c4); in nvmet_execute_identify_ctrl()
480 id->psd[0].entry_lat = cpu_to_le32(0x10); in nvmet_execute_identify_ctrl()
481 id->psd[0].exit_lat = cpu_to_le32(0x4); in nvmet_execute_identify_ctrl()
483 id->nwpc = 1 << 0; /* write protect and no write protect */ in nvmet_execute_identify_ctrl()
497 if (le32_to_cpu(req->cmd->identify.nsid) == NVME_NSID_ALL) { in nvmet_execute_identify_ns()
498 req->error_loc = offsetof(struct nvme_identify, nsid); in nvmet_execute_identify_ns()
516 if (nvmet_ns_revalidate(req->ns)) { in nvmet_execute_identify_ns()
517 mutex_lock(&req->ns->subsys->lock); in nvmet_execute_identify_ns()
518 nvmet_ns_changed(req->ns->subsys, req->ns->nsid); in nvmet_execute_identify_ns()
519 mutex_unlock(&req->ns->subsys->lock); in nvmet_execute_identify_ns()
526 id->ncap = id->nsze = in nvmet_execute_identify_ns()
527 cpu_to_le64(req->ns->size >> req->ns->blksize_shift); in nvmet_execute_identify_ns()
528 switch (req->port->ana_state[req->ns->anagrpid]) { in nvmet_execute_identify_ns()
533 id->nuse = id->nsze; in nvmet_execute_identify_ns()
537 if (req->ns->bdev) in nvmet_execute_identify_ns()
538 nvmet_bdev_set_limits(req->ns->bdev, id); in nvmet_execute_identify_ns()
544 id->nlbaf = 0; in nvmet_execute_identify_ns()
545 id->flbas = 0; in nvmet_execute_identify_ns()
551 id->nmic = NVME_NS_NMIC_SHARED; in nvmet_execute_identify_ns()
552 id->anagrpid = cpu_to_le32(req->ns->anagrpid); in nvmet_execute_identify_ns()
554 memcpy(&id->nguid, &req->ns->nguid, sizeof(id->nguid)); in nvmet_execute_identify_ns()
556 id->lbaf[0].ds = req->ns->blksize_shift; in nvmet_execute_identify_ns()
558 if (req->sq->ctrl->pi_support && nvmet_ns_has_pi(req->ns)) { in nvmet_execute_identify_ns()
559 id->dpc = NVME_NS_DPC_PI_FIRST | NVME_NS_DPC_PI_LAST | in nvmet_execute_identify_ns()
562 id->mc = NVME_MC_EXTENDED_LBA; in nvmet_execute_identify_ns()
563 id->dps = req->ns->pi_type; in nvmet_execute_identify_ns()
564 id->flbas = NVME_NS_FLBAS_META_EXT; in nvmet_execute_identify_ns()
565 id->lbaf[0].ms = cpu_to_le16(req->ns->metadata_size); in nvmet_execute_identify_ns()
568 if (req->ns->readonly) in nvmet_execute_identify_ns()
569 id->nsattr |= NVME_NS_ATTR_RO; in nvmet_execute_identify_ns()
582 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_identify_nslist() local
585 u32 min_nsid = le32_to_cpu(req->cmd->identify.nsid); in nvmet_execute_identify_nslist()
595 req->error_loc = offsetof(struct nvme_identify, nsid); in nvmet_execute_identify_nslist()
606 xa_for_each(&ctrl->subsys->namespaces, idx, ns) { in nvmet_execute_identify_nslist()
607 if (ns->nsid <= min_nsid) in nvmet_execute_identify_nslist()
609 list[i++] = cpu_to_le32(ns->nsid); in nvmet_execute_identify_nslist()
621 static u16 nvmet_copy_ns_identifier(struct nvmet_req *req, u8 type, u8 len, in nvmet_copy_ns_identifier() argument
626 .nidl = len, in nvmet_copy_ns_identifier()
635 status = nvmet_copy_to_sgl(req, *off, id, len); in nvmet_copy_ns_identifier()
638 *off += len; in nvmet_copy_ns_identifier()
652 if (memchr_inv(&req->ns->uuid, 0, sizeof(req->ns->uuid))) { in nvmet_execute_identify_desclist()
655 &req->ns->uuid, &off); in nvmet_execute_identify_desclist()
659 if (memchr_inv(req->ns->nguid, 0, sizeof(req->ns->nguid))) { in nvmet_execute_identify_desclist()
662 &req->ns->nguid, &off); in nvmet_execute_identify_desclist()
669 &req->ns->csi, &off); in nvmet_execute_identify_desclist()
673 if (sg_zero_buffer(req->sg, req->sg_cnt, NVME_IDENTIFY_DATA_SIZE - off, in nvmet_execute_identify_desclist()
674 off) != NVME_IDENTIFY_DATA_SIZE - off) in nvmet_execute_identify_desclist()
693 switch (req->cmd->identify.cns) { in nvmet_execute_identify()
707 switch (req->cmd->identify.csi) { in nvmet_execute_identify()
720 switch (req->cmd->identify.csi) { in nvmet_execute_identify()
735 req->cmd->identify.cns, req->sq->qid); in nvmet_execute_identify()
736 req->error_loc = offsetof(struct nvme_identify, cns); in nvmet_execute_identify()
759 if (req->ns->file) in nvmet_write_protect_flush_sync()
765 pr_err("write protect flush failed nsid: %u\n", req->ns->nsid); in nvmet_write_protect_flush_sync()
771 u32 write_protect = le32_to_cpu(req->cmd->common.cdw11); in nvmet_set_feat_write_protect()
779 mutex_lock(&subsys->lock); in nvmet_set_feat_write_protect()
782 req->ns->readonly = true; in nvmet_set_feat_write_protect()
785 req->ns->readonly = false; in nvmet_set_feat_write_protect()
788 req->ns->readonly = false; in nvmet_set_feat_write_protect()
796 nvmet_ns_changed(subsys, req->ns->nsid); in nvmet_set_feat_write_protect()
797 mutex_unlock(&subsys->lock); in nvmet_set_feat_write_protect()
803 u32 val32 = le32_to_cpu(req->cmd->common.cdw11); in nvmet_set_feat_kato()
805 nvmet_stop_keep_alive_timer(req->sq->ctrl); in nvmet_set_feat_kato()
806 req->sq->ctrl->kato = DIV_ROUND_UP(val32, 1000); in nvmet_set_feat_kato()
807 nvmet_start_keep_alive_timer(req->sq->ctrl); in nvmet_set_feat_kato()
809 nvmet_set_result(req, req->sq->ctrl->kato); in nvmet_set_feat_kato()
816 u32 val32 = le32_to_cpu(req->cmd->common.cdw11); in nvmet_set_feat_async_event()
819 req->error_loc = offsetof(struct nvme_common_command, cdw11); in nvmet_set_feat_async_event()
823 WRITE_ONCE(req->sq->ctrl->aen_enabled, val32); in nvmet_set_feat_async_event()
832 u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10); in nvmet_execute_set_features()
833 u32 cdw11 = le32_to_cpu(req->cmd->common.cdw11); in nvmet_execute_set_features()
850 (subsys->max_qid - 1) | ((subsys->max_qid - 1) << 16)); in nvmet_execute_set_features()
865 req->error_loc = offsetof(struct nvme_common_command, cdw10); in nvmet_execute_set_features()
882 mutex_lock(&subsys->lock); in nvmet_get_feat_write_protect()
883 if (req->ns->readonly == true) in nvmet_get_feat_write_protect()
888 mutex_unlock(&subsys->lock); in nvmet_get_feat_write_protect()
895 nvmet_set_result(req, req->sq->ctrl->kato * 1000); in nvmet_get_feat_kato()
900 nvmet_set_result(req, READ_ONCE(req->sq->ctrl->aen_enabled)); in nvmet_get_feat_async_event()
906 u32 cdw10 = le32_to_cpu(req->cmd->common.cdw10); in nvmet_execute_get_features()
942 (subsys->max_qid-1) | ((subsys->max_qid-1) << 16)); in nvmet_execute_get_features()
948 /* need 128-bit host identifier flag */ in nvmet_execute_get_features()
949 if (!(req->cmd->common.cdw11 & cpu_to_le32(1 << 0))) { in nvmet_execute_get_features()
950 req->error_loc = in nvmet_execute_get_features()
956 status = nvmet_copy_to_sgl(req, 0, &req->sq->ctrl->hostid, in nvmet_execute_get_features()
957 sizeof(req->sq->ctrl->hostid)); in nvmet_execute_get_features()
963 req->error_loc = in nvmet_execute_get_features()
974 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_async_event() local
979 mutex_lock(&ctrl->lock); in nvmet_execute_async_event()
980 if (ctrl->nr_async_event_cmds >= NVMET_ASYNC_EVENTS) { in nvmet_execute_async_event()
981 mutex_unlock(&ctrl->lock); in nvmet_execute_async_event()
985 ctrl->async_event_cmds[ctrl->nr_async_event_cmds++] = req; in nvmet_execute_async_event()
986 mutex_unlock(&ctrl->lock); in nvmet_execute_async_event()
988 queue_work(nvmet_wq, &ctrl->async_event_work); in nvmet_execute_async_event()
993 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_keep_alive() local
999 if (!ctrl->kato) { in nvmet_execute_keep_alive()
1004 pr_debug("ctrl %d update keep-alive timer for %d secs\n", in nvmet_execute_keep_alive()
1005 ctrl->cntlid, ctrl->kato); in nvmet_execute_keep_alive()
1006 mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ); in nvmet_execute_keep_alive()
1013 struct nvme_command *cmd = req->cmd; in nvmet_parse_admin_cmd()
1028 switch (cmd->common.opcode) { in nvmet_parse_admin_cmd()
1030 req->execute = nvmet_execute_get_log_page; in nvmet_parse_admin_cmd()
1033 req->execute = nvmet_execute_identify; in nvmet_parse_admin_cmd()
1036 req->execute = nvmet_execute_abort; in nvmet_parse_admin_cmd()
1039 req->execute = nvmet_execute_set_features; in nvmet_parse_admin_cmd()
1042 req->execute = nvmet_execute_get_features; in nvmet_parse_admin_cmd()
1045 req->execute = nvmet_execute_async_event; in nvmet_parse_admin_cmd()
1048 req->execute = nvmet_execute_keep_alive; in nvmet_parse_admin_cmd()