Lines Matching refs:ctrlr

27 nvmft_printf(struct nvmft_controller *ctrlr, const char *fmt, ...)  in nvmft_printf()  argument
37 sbuf_printf(&sb, "nvmft%u: ", ctrlr->cntlid); in nvmft_printf()
53 struct nvmft_controller *ctrlr; in nvmft_controller_alloc() local
55 ctrlr = malloc(sizeof(*ctrlr), M_NVMFT, M_WAITOK | M_ZERO); in nvmft_controller_alloc()
56 ctrlr->cntlid = cntlid; in nvmft_controller_alloc()
57 ctrlr->np = np; in nvmft_controller_alloc()
58 mtx_init(&ctrlr->lock, "nvmft controller", NULL, MTX_DEF); in nvmft_controller_alloc()
59 callout_init(&ctrlr->ka_timer, 1); in nvmft_controller_alloc()
60 TASK_INIT(&ctrlr->shutdown_task, 0, nvmft_controller_shutdown, ctrlr); in nvmft_controller_alloc()
61 TIMEOUT_TASK_INIT(taskqueue_thread, &ctrlr->terminate_task, 0, in nvmft_controller_alloc()
62 nvmft_controller_terminate, ctrlr); in nvmft_controller_alloc()
64 ctrlr->cdata = np->cdata; in nvmft_controller_alloc()
65 ctrlr->cdata.ctrlr_id = htole16(cntlid); in nvmft_controller_alloc()
66 memcpy(ctrlr->hostid, data->hostid, sizeof(ctrlr->hostid)); in nvmft_controller_alloc()
67 memcpy(ctrlr->hostnqn, data->hostnqn, sizeof(ctrlr->hostnqn)); in nvmft_controller_alloc()
68 ctrlr->hip.power_cycles[0] = 1; in nvmft_controller_alloc()
69 ctrlr->create_time = sbinuptime(); in nvmft_controller_alloc()
71 ctrlr->changed_ns = malloc(sizeof(*ctrlr->changed_ns), M_NVMFT, in nvmft_controller_alloc()
74 return (ctrlr); in nvmft_controller_alloc()
78 nvmft_controller_free(struct nvmft_controller *ctrlr) in nvmft_controller_free() argument
80 mtx_destroy(&ctrlr->lock); in nvmft_controller_free()
81 MPASS(ctrlr->io_qpairs == NULL); in nvmft_controller_free()
82 free(ctrlr->changed_ns, M_NVMFT); in nvmft_controller_free()
83 free(ctrlr, M_NVMFT); in nvmft_controller_free()
89 struct nvmft_controller *ctrlr = arg; in nvmft_keep_alive_timer() local
92 if (ctrlr->shutdown) in nvmft_keep_alive_timer()
95 traffic = atomic_readandclear_int(&ctrlr->ka_active_traffic); in nvmft_keep_alive_timer()
97 nvmft_printf(ctrlr, in nvmft_keep_alive_timer()
99 nvmft_controller_error(ctrlr, NULL, ETIMEDOUT); in nvmft_keep_alive_timer()
103 callout_schedule_sbt(&ctrlr->ka_timer, ctrlr->ka_sbt, 0, C_HARDCLOCK); in nvmft_keep_alive_timer()
111 struct nvmft_controller *ctrlr; in nvmft_handoff_admin_queue() local
139 TAILQ_FOREACH(ctrlr, &np->controllers, link) { in nvmft_handoff_admin_queue()
140 KASSERT(ctrlr->cntlid != cntlid, in nvmft_handoff_admin_queue()
146 ctrlr = nvmft_controller_alloc(np, cntlid, data); in nvmft_handoff_admin_queue()
151 nvmft_controller_free(ctrlr); in nvmft_handoff_admin_queue()
157 TAILQ_INSERT_TAIL(&np->controllers, ctrlr, link); in nvmft_handoff_admin_queue()
159 nvmft_printf(ctrlr, "associated with %.*s\n", in nvmft_handoff_admin_queue()
161 ctrlr->admin = qp; in nvmft_handoff_admin_queue()
162 ctrlr->trtype = trtype; in nvmft_handoff_admin_queue()
174 ctrlr->ka_sbt = mstosbt(roundup(kato, 1000)); in nvmft_handoff_admin_queue()
175 callout_reset_sbt(&ctrlr->ka_timer, ctrlr->ka_sbt, 0, in nvmft_handoff_admin_queue()
176 nvmft_keep_alive_timer, ctrlr, C_HARDCLOCK); in nvmft_handoff_admin_queue()
180 nvmft_finish_accept(qp, cmd, ctrlr); in nvmft_handoff_admin_queue()
190 struct nvmft_controller *ctrlr; in nvmft_handoff_io_queue() local
209 TAILQ_FOREACH(ctrlr, &np->controllers, link) { in nvmft_handoff_io_queue()
210 if (ctrlr->cntlid == cntlid) in nvmft_handoff_io_queue()
213 if (ctrlr == NULL) { in nvmft_handoff_io_queue()
216 ctrlr->cntlid, qid, (int)sizeof(data->hostnqn), in nvmft_handoff_io_queue()
224 if (memcmp(ctrlr->hostid, data->hostid, sizeof(ctrlr->hostid)) != 0) { in nvmft_handoff_io_queue()
226 nvmft_printf(ctrlr, in nvmft_handoff_io_queue()
234 if (memcmp(ctrlr->hostnqn, data->hostnqn, sizeof(ctrlr->hostnqn)) != 0) { in nvmft_handoff_io_queue()
236 nvmft_printf(ctrlr, in nvmft_handoff_io_queue()
247 mtx_lock(&ctrlr->lock); in nvmft_handoff_io_queue()
248 if (ctrlr->shutdown) { in nvmft_handoff_io_queue()
249 mtx_unlock(&ctrlr->lock); in nvmft_handoff_io_queue()
251 nvmft_printf(ctrlr, in nvmft_handoff_io_queue()
259 if (ctrlr->num_io_queues == 0) { in nvmft_handoff_io_queue()
260 mtx_unlock(&ctrlr->lock); in nvmft_handoff_io_queue()
262 nvmft_printf(ctrlr, in nvmft_handoff_io_queue()
270 if (cmd->qid > ctrlr->num_io_queues) { in nvmft_handoff_io_queue()
271 mtx_unlock(&ctrlr->lock); in nvmft_handoff_io_queue()
273 nvmft_printf(ctrlr, in nvmft_handoff_io_queue()
281 if (ctrlr->io_qpairs[qid - 1].qp != NULL) { in nvmft_handoff_io_queue()
282 mtx_unlock(&ctrlr->lock); in nvmft_handoff_io_queue()
284 nvmft_printf(ctrlr, in nvmft_handoff_io_queue()
293 ctrlr->io_qpairs[qid - 1].qp = qp; in nvmft_handoff_io_queue()
294 mtx_unlock(&ctrlr->lock); in nvmft_handoff_io_queue()
296 nvmft_finish_accept(qp, cmd, ctrlr); in nvmft_handoff_io_queue()
304 struct nvmft_controller *ctrlr = arg; in nvmft_controller_shutdown() local
312 mtx_lock(&ctrlr->lock); in nvmft_controller_shutdown()
313 for (u_int i = 0; i < ctrlr->num_io_queues; i++) { in nvmft_controller_shutdown()
314 if (ctrlr->io_qpairs[i].qp != NULL) { in nvmft_controller_shutdown()
315 ctrlr->io_qpairs[i].shutdown = true; in nvmft_controller_shutdown()
316 mtx_unlock(&ctrlr->lock); in nvmft_controller_shutdown()
317 nvmft_qpair_shutdown(ctrlr->io_qpairs[i].qp); in nvmft_controller_shutdown()
318 mtx_lock(&ctrlr->lock); in nvmft_controller_shutdown()
321 mtx_unlock(&ctrlr->lock); in nvmft_controller_shutdown()
324 nvmft_terminate_commands(ctrlr); in nvmft_controller_shutdown()
327 mtx_lock(&ctrlr->lock); in nvmft_controller_shutdown()
328 while (ctrlr->pending_commands != 0) in nvmft_controller_shutdown()
329 mtx_sleep(&ctrlr->pending_commands, &ctrlr->lock, 0, "nvmftsh", in nvmft_controller_shutdown()
331 mtx_unlock(&ctrlr->lock); in nvmft_controller_shutdown()
334 for (u_int i = 0; i < ctrlr->num_io_queues; i++) { in nvmft_controller_shutdown()
335 if (ctrlr->io_qpairs[i].qp != NULL) in nvmft_controller_shutdown()
336 nvmft_qpair_destroy(ctrlr->io_qpairs[i].qp); in nvmft_controller_shutdown()
338 free(ctrlr->io_qpairs, M_NVMFT); in nvmft_controller_shutdown()
339 ctrlr->io_qpairs = NULL; in nvmft_controller_shutdown()
341 mtx_lock(&ctrlr->lock); in nvmft_controller_shutdown()
342 ctrlr->num_io_queues = 0; in nvmft_controller_shutdown()
345 if (NVMEV(NVME_CSTS_REG_SHST, ctrlr->csts) == NVME_SHST_OCCURRING) { in nvmft_controller_shutdown()
346 ctrlr->csts &= ~NVMEM(NVME_CSTS_REG_SHST); in nvmft_controller_shutdown()
347 ctrlr->csts |= NVMEF(NVME_CSTS_REG_SHST, NVME_SHST_COMPLETE); in nvmft_controller_shutdown()
350 if (NVMEV(NVME_CSTS_REG_CFS, ctrlr->csts) == 0) { in nvmft_controller_shutdown()
351 ctrlr->csts &= ~NVMEM(NVME_CSTS_REG_RDY); in nvmft_controller_shutdown()
352 ctrlr->shutdown = false; in nvmft_controller_shutdown()
354 mtx_unlock(&ctrlr->lock); in nvmft_controller_shutdown()
362 if (ctrlr->admin_closed || NVMEV(NVME_CSTS_REG_CFS, ctrlr->csts) != 0) in nvmft_controller_shutdown()
363 nvmft_controller_terminate(ctrlr, 0); in nvmft_controller_shutdown()
366 &ctrlr->terminate_task, hz * 60 * 2); in nvmft_controller_shutdown()
372 struct nvmft_controller *ctrlr = arg; in nvmft_controller_terminate() local
377 mtx_lock(&ctrlr->lock); in nvmft_controller_terminate()
378 if (NVMEV(NVME_CC_REG_EN, ctrlr->cc) != 0) { in nvmft_controller_terminate()
379 mtx_unlock(&ctrlr->lock); in nvmft_controller_terminate()
381 if (ctrlr->ka_sbt != 0) in nvmft_controller_terminate()
382 callout_schedule_sbt(&ctrlr->ka_timer, ctrlr->ka_sbt, 0, in nvmft_controller_terminate()
388 ctrlr->shutdown = true; in nvmft_controller_terminate()
389 mtx_unlock(&ctrlr->lock); in nvmft_controller_terminate()
391 nvmft_qpair_destroy(ctrlr->admin); in nvmft_controller_terminate()
394 np = ctrlr->np; in nvmft_controller_terminate()
396 TAILQ_REMOVE(&np->controllers, ctrlr, link); in nvmft_controller_terminate()
399 free_unr(np->ids, ctrlr->cntlid); in nvmft_controller_terminate()
403 callout_drain(&ctrlr->ka_timer); in nvmft_controller_terminate()
405 nvmft_printf(ctrlr, "association terminated\n"); in nvmft_controller_terminate()
406 nvmft_controller_free(ctrlr); in nvmft_controller_terminate()
411 nvmft_controller_error(struct nvmft_controller *ctrlr, struct nvmft_qpair *qp, in nvmft_controller_error() argument
425 if (qp != ctrlr->admin) in nvmft_controller_error()
428 mtx_lock(&ctrlr->lock); in nvmft_controller_error()
429 if (ctrlr->shutdown) { in nvmft_controller_error()
430 ctrlr->admin_closed = true; in nvmft_controller_error()
431 mtx_unlock(&ctrlr->lock); in nvmft_controller_error()
435 if (NVMEV(NVME_CC_REG_EN, ctrlr->cc) == 0) { in nvmft_controller_error()
436 MPASS(ctrlr->num_io_queues == 0); in nvmft_controller_error()
437 mtx_unlock(&ctrlr->lock); in nvmft_controller_error()
455 &ctrlr->terminate_task, NULL) == 0) in nvmft_controller_error()
457 &ctrlr->terminate_task, 0); in nvmft_controller_error()
466 ctrlr->admin_closed = true; in nvmft_controller_error()
468 mtx_lock(&ctrlr->lock); in nvmft_controller_error()
471 if (ctrlr->shutdown) { in nvmft_controller_error()
472 mtx_unlock(&ctrlr->lock); in nvmft_controller_error()
476 ctrlr->csts |= NVMEF(NVME_CSTS_REG_CFS, 1); in nvmft_controller_error()
477 ctrlr->cc &= ~NVMEM(NVME_CC_REG_EN); in nvmft_controller_error()
478 ctrlr->shutdown = true; in nvmft_controller_error()
479 mtx_unlock(&ctrlr->lock); in nvmft_controller_error()
481 callout_stop(&ctrlr->ka_timer); in nvmft_controller_error()
482 taskqueue_enqueue(taskqueue_thread, &ctrlr->shutdown_task); in nvmft_controller_error()
536 handle_get_log_page(struct nvmft_controller *ctrlr, in handle_get_log_page() argument
581 mtx_lock(&ctrlr->lock); in handle_get_log_page()
582 hip = ctrlr->hip; in handle_get_log_page()
584 sbintime_getsec(ctrlr->busy_total) / 60; in handle_get_log_page()
586 sbintime_getsec(sbinuptime() - ctrlr->create_time) / 3600; in handle_get_log_page()
587 mtx_unlock(&ctrlr->lock); in handle_get_log_page()
598 if (offset >= sizeof(ctrlr->np->fp)) { in handle_get_log_page()
602 todo = sizeof(ctrlr->np->fp) - offset; in handle_get_log_page()
607 m_copyback(m, 0, todo, (char *)&ctrlr->np->fp + offset); in handle_get_log_page()
614 if (offset >= sizeof(*ctrlr->changed_ns)) { in handle_get_log_page()
618 todo = sizeof(*ctrlr->changed_ns) - offset; in handle_get_log_page()
623 mtx_lock(&ctrlr->lock); in handle_get_log_page()
624 m_copyback(m, 0, todo, (char *)ctrlr->changed_ns + offset); in handle_get_log_page()
625 if (offset == 0 && len == sizeof(*ctrlr->changed_ns)) in handle_get_log_page()
626 memset(ctrlr->changed_ns, 0, in handle_get_log_page()
627 sizeof(*ctrlr->changed_ns)); in handle_get_log_page()
629 ctrlr->changed_ns_reported = false; in handle_get_log_page()
630 mtx_unlock(&ctrlr->lock); in handle_get_log_page()
637 nvmft_printf(ctrlr, "Unsupported page %#x for GET_LOG_PAGE\n", in handle_get_log_page()
645 nvmft_command_completed(ctrlr->admin, nc); in handle_get_log_page()
647 nvmft_send_generic_error(ctrlr->admin, nc, status); in handle_get_log_page()
658 handle_identify_command(struct nvmft_controller *ctrlr, in handle_identify_command() argument
668 if (data_len != sizeof(ctrlr->cdata)) { in handle_identify_command()
669 nvmft_printf(ctrlr, in handle_identify_command()
672 nvmft_send_generic_error(ctrlr->admin, nc, in handle_identify_command()
681 nvmft_dispatch_command(ctrlr->admin, nc, true); in handle_identify_command()
685 m = m_getml(sizeof(ctrlr->cdata), M_WAITOK); in handle_identify_command()
686 m_copyback(m, 0, sizeof(ctrlr->cdata), (void *)&ctrlr->cdata); in handle_identify_command()
688 sizeof(ctrlr->cdata)); in handle_identify_command()
704 nvmft_populate_active_nslist(ctrlr->np, nsid, nslist); in handle_identify_command()
714 nvmft_printf(ctrlr, "Unsupported CNS %#x for IDENTIFY\n", cns); in handle_identify_command()
720 nvmft_command_completed(ctrlr->admin, nc); in handle_identify_command()
722 nvmft_send_generic_error(ctrlr->admin, nc, status); in handle_identify_command()
727 handle_set_features(struct nvmft_controller *ctrlr, in handle_set_features() argument
756 mtx_lock(&ctrlr->lock); in handle_set_features()
757 if (ctrlr->num_io_queues != 0) { in handle_set_features()
758 mtx_unlock(&ctrlr->lock); in handle_set_features()
760 nvmft_send_generic_error(ctrlr->admin, nc, in handle_set_features()
766 ctrlr->num_io_queues = num_queues; in handle_set_features()
767 ctrlr->io_qpairs = io_qpairs; in handle_set_features()
768 mtx_unlock(&ctrlr->lock); in handle_set_features()
772 nvmft_send_response(ctrlr->admin, &cqe); in handle_set_features()
786 mtx_lock(&ctrlr->lock); in handle_set_features()
787 ctrlr->aer_mask = aer_mask; in handle_set_features()
788 mtx_unlock(&ctrlr->lock); in handle_set_features()
789 nvmft_send_success(ctrlr->admin, nc); in handle_set_features()
794 nvmft_printf(ctrlr, in handle_set_features()
800 nvmft_send_generic_error(ctrlr->admin, nc, NVME_SC_INVALID_FIELD); in handle_set_features()
805 update_cc(struct nvmft_controller *ctrlr, uint32_t new_cc, bool *need_shutdown) in update_cc() argument
807 struct nvmft_port *np = ctrlr->np; in update_cc()
812 mtx_lock(&ctrlr->lock); in update_cc()
815 if (ctrlr->shutdown) { in update_cc()
816 mtx_unlock(&ctrlr->lock); in update_cc()
820 if (!_nvmf_validate_cc(np->max_io_qsize, np->cap, ctrlr->cc, new_cc)) { in update_cc()
821 mtx_unlock(&ctrlr->lock); in update_cc()
825 changes = ctrlr->cc ^ new_cc; in update_cc()
826 ctrlr->cc = new_cc; in update_cc()
831 ctrlr->csts &= ~NVMEM(NVME_CSTS_REG_SHST); in update_cc()
832 ctrlr->csts |= NVMEF(NVME_CSTS_REG_SHST, NVME_SHST_OCCURRING); in update_cc()
833 ctrlr->cc &= ~NVMEM(NVME_CC_REG_EN); in update_cc()
834 ctrlr->shutdown = true; in update_cc()
836 nvmft_printf(ctrlr, "shutdown requested\n"); in update_cc()
842 nvmft_printf(ctrlr, "reset requested\n"); in update_cc()
843 ctrlr->shutdown = true; in update_cc()
846 ctrlr->csts |= NVMEF(NVME_CSTS_REG_RDY, 1); in update_cc()
848 mtx_unlock(&ctrlr->lock); in update_cc()
854 handle_property_get(struct nvmft_controller *ctrlr, struct nvmf_capsule *nc, in handle_property_get() argument
865 rsp.value.u64 = htole64(ctrlr->np->cap); in handle_property_get()
870 rsp.value.u32.low = ctrlr->cdata.ver; in handle_property_get()
875 rsp.value.u32.low = htole32(ctrlr->cc); in handle_property_get()
880 rsp.value.u32.low = htole32(ctrlr->csts); in handle_property_get()
886 nvmft_send_response(ctrlr->admin, &rsp); in handle_property_get()
889 nvmft_send_generic_error(ctrlr->admin, nc, NVME_SC_INVALID_FIELD); in handle_property_get()
893 handle_property_set(struct nvmft_controller *ctrlr, struct nvmf_capsule *nc, in handle_property_set() argument
903 if (!update_cc(ctrlr, le32toh(pset->value.u32.low), in handle_property_set()
911 nvmft_send_success(ctrlr->admin, nc); in handle_property_set()
913 callout_stop(&ctrlr->ka_timer); in handle_property_set()
914 taskqueue_enqueue(taskqueue_thread, &ctrlr->shutdown_task); in handle_property_set()
918 nvmft_send_generic_error(ctrlr->admin, nc, NVME_SC_INVALID_FIELD); in handle_property_set()
922 handle_admin_fabrics_command(struct nvmft_controller *ctrlr, in handle_admin_fabrics_command() argument
927 handle_property_get(ctrlr, nc, in handle_admin_fabrics_command()
931 handle_property_set(ctrlr, nc, in handle_admin_fabrics_command()
935 nvmft_printf(ctrlr, in handle_admin_fabrics_command()
937 nvmft_send_generic_error(ctrlr->admin, nc, in handle_admin_fabrics_command()
941 nvmft_printf(ctrlr, "DISCONNECT command on admin queue\n"); in handle_admin_fabrics_command()
942 nvmft_send_error(ctrlr->admin, nc, NVME_SCT_COMMAND_SPECIFIC, in handle_admin_fabrics_command()
946 nvmft_printf(ctrlr, "Unsupported fabrics command %#x\n", in handle_admin_fabrics_command()
948 nvmft_send_generic_error(ctrlr->admin, nc, in handle_admin_fabrics_command()
956 nvmft_handle_admin_command(struct nvmft_controller *ctrlr, in nvmft_handle_admin_command() argument
962 if (NVMEV(NVME_CC_REG_EN, ctrlr->cc) == 0 && in nvmft_handle_admin_command()
964 nvmft_printf(ctrlr, in nvmft_handle_admin_command()
966 nvmft_send_generic_error(ctrlr->admin, nc, in nvmft_handle_admin_command()
972 atomic_store_int(&ctrlr->ka_active_traffic, 1); in nvmft_handle_admin_command()
976 handle_get_log_page(ctrlr, nc, cmd); in nvmft_handle_admin_command()
979 handle_identify_command(ctrlr, nc, cmd); in nvmft_handle_admin_command()
982 handle_set_features(ctrlr, nc, cmd); in nvmft_handle_admin_command()
985 mtx_lock(&ctrlr->lock); in nvmft_handle_admin_command()
986 if (ctrlr->aer_pending == NVMFT_NUM_AER) { in nvmft_handle_admin_command()
987 mtx_unlock(&ctrlr->lock); in nvmft_handle_admin_command()
988 nvmft_send_error(ctrlr->admin, nc, in nvmft_handle_admin_command()
993 ctrlr->aer_cids[ctrlr->aer_pidx] = cmd->cid; in nvmft_handle_admin_command()
994 ctrlr->aer_pending++; in nvmft_handle_admin_command()
995 ctrlr->aer_pidx = (ctrlr->aer_pidx + 1) % NVMFT_NUM_AER; in nvmft_handle_admin_command()
996 mtx_unlock(&ctrlr->lock); in nvmft_handle_admin_command()
1001 nvmft_send_success(ctrlr->admin, nc); in nvmft_handle_admin_command()
1005 handle_admin_fabrics_command(ctrlr, nc, in nvmft_handle_admin_command()
1009 nvmft_printf(ctrlr, "Unsupported admin opcode %#x\n", cmd->opc); in nvmft_handle_admin_command()
1010 nvmft_send_generic_error(ctrlr->admin, nc, in nvmft_handle_admin_command()
1021 struct nvmft_controller *ctrlr = nvmft_qpair_ctrlr(qp); in nvmft_handle_io_command() local
1024 atomic_store_int(&ctrlr->ka_active_traffic, 1); in nvmft_handle_io_command()
1045 nvmft_printf(ctrlr, "Unsupported I/O opcode %#x\n", cmd->opc); in nvmft_handle_io_command()
1054 nvmft_report_aer(struct nvmft_controller *ctrlr, uint32_t aer_mask, in nvmft_report_aer() argument
1062 mtx_lock(&ctrlr->lock); in nvmft_report_aer()
1063 if ((ctrlr->aer_mask & aer_mask) == 0) { in nvmft_report_aer()
1064 mtx_unlock(&ctrlr->lock); in nvmft_report_aer()
1072 if (ctrlr->aer_pending == 0) { in nvmft_report_aer()
1073 mtx_unlock(&ctrlr->lock); in nvmft_report_aer()
1074 nvmft_printf(ctrlr, in nvmft_report_aer()
1081 cpl.cid = ctrlr->aer_cids[ctrlr->aer_cidx]; in nvmft_report_aer()
1082 ctrlr->aer_pending--; in nvmft_report_aer()
1083 ctrlr->aer_cidx = (ctrlr->aer_cidx + 1) % NVMFT_NUM_AER; in nvmft_report_aer()
1084 mtx_unlock(&ctrlr->lock); in nvmft_report_aer()
1090 nvmft_send_response(ctrlr->admin, &cpl); in nvmft_report_aer()
1094 nvmft_controller_lun_changed(struct nvmft_controller *ctrlr, int lun_id) in nvmft_controller_lun_changed() argument
1102 mtx_lock(&ctrlr->lock); in nvmft_controller_lun_changed()
1103 nslist = ctrlr->changed_ns; in nvmft_controller_lun_changed()
1112 mtx_unlock(&ctrlr->lock); in nvmft_controller_lun_changed()
1122 memset(ctrlr->changed_ns, 0, in nvmft_controller_lun_changed()
1123 sizeof(*ctrlr->changed_ns)); in nvmft_controller_lun_changed()
1124 ctrlr->changed_ns->ns[0] = 0xffffffff; in nvmft_controller_lun_changed()
1139 if (ctrlr->changed_ns_reported) { in nvmft_controller_lun_changed()
1140 mtx_unlock(&ctrlr->lock); in nvmft_controller_lun_changed()
1143 ctrlr->changed_ns_reported = true; in nvmft_controller_lun_changed()
1144 mtx_unlock(&ctrlr->lock); in nvmft_controller_lun_changed()
1146 nvmft_report_aer(ctrlr, NVME_ASYNC_EVENT_NS_ATTRIBUTE, 0x2, 0x0, in nvmft_controller_lun_changed()