Lines Matching refs:ctrl

99  * @ctrl:	Host NVMe controller instance which we got the address
103 int nvmf_get_address(struct nvme_ctrl *ctrl, char *buf, int size)
107 if (ctrl->opts->mask & NVMF_OPT_TRADDR)
108 len += scnprintf(buf, size, "traddr=%s", ctrl->opts->traddr);
109 if (ctrl->opts->mask & NVMF_OPT_TRSVCID)
111 (len) ? "," : "", ctrl->opts->trsvcid);
112 if (ctrl->opts->mask & NVMF_OPT_HOST_TRADDR)
114 (len) ? "," : "", ctrl->opts->host_traddr);
123 * @ctrl: Host NVMe controller instance maintaining the admin
142 int nvmf_reg_read32(struct nvme_ctrl *ctrl, u32 off, u32 *val)
153 ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res, NULL, 0, 0,
159 dev_err(ctrl->device,
169 * @ctrl: Host NVMe controller instance maintaining the admin
188 int nvmf_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val)
200 ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res, NULL, 0, 0,
206 dev_err(ctrl->device,
215 * @ctrl: Host NVMe controller instance maintaining the admin
234 int nvmf_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val)
246 ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, NULL, NULL, 0, 0,
249 dev_err(ctrl->device,
260 * @ctrl: the specific /dev/nvmeX device that had the error.
271 static void nvmf_log_connect_error(struct nvme_ctrl *ctrl,
285 dev_err(ctrl->device,
290 dev_err(ctrl->device,
295 dev_err(ctrl->device,
300 dev_err(ctrl->device,
310 dev_err(ctrl->device,
315 dev_err(ctrl->device,
323 dev_err(ctrl->device,
329 dev_err(ctrl->device,
334 dev_err(ctrl->device,
340 dev_err(ctrl->device,
345 dev_err(ctrl->device,
355 * @ctrl: Host nvme controller instance used to request
372 int nvmf_connect_admin_queue(struct nvme_ctrl *ctrl)
389 cmd.connect.kato = ctrl->kato ?
390 cpu_to_le32((ctrl->kato + NVME_KATO_GRACE) * 1000) : 0;
392 if (ctrl->opts->disable_sqflow)
399 uuid_copy(&data->hostid, &ctrl->opts->host->id);
401 strncpy(data->subsysnqn, ctrl->opts->subsysnqn, NVMF_NQN_SIZE);
402 strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE);
404 ret = __nvme_submit_sync_cmd(ctrl->fabrics_q, &cmd, &res,
408 nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
413 ctrl->cntlid = le16_to_cpu(res.u16);
424 * @ctrl: Host nvme controller instance used to establish an
442 int nvmf_connect_io_queue(struct nvme_ctrl *ctrl, u16 qid, bool poll)
453 cmd.connect.sqsize = cpu_to_le16(ctrl->sqsize);
455 if (ctrl->opts->disable_sqflow)
462 uuid_copy(&data->hostid, &ctrl->opts->host->id);
463 data->cntlid = cpu_to_le16(ctrl->cntlid);
464 strncpy(data->subsysnqn, ctrl->opts->subsysnqn, NVMF_NQN_SIZE);
465 strncpy(data->hostnqn, ctrl->opts->host->nqn, NVMF_NQN_SIZE);
467 ret = __nvme_submit_sync_cmd(ctrl->connect_q, &cmd, &res,
471 nvmf_log_connect_error(ctrl, ret, le32_to_cpu(res.u32),
479 bool nvmf_should_reconnect(struct nvme_ctrl *ctrl)
481 if (ctrl->opts->max_reconnects == -1 ||
482 ctrl->nr_reconnects < ctrl->opts->max_reconnects)
552 blk_status_t nvmf_fail_nonready_command(struct nvme_ctrl *ctrl,
555 if (ctrl->state != NVME_CTRL_DELETING_NOIO &&
556 ctrl->state != NVME_CTRL_DEAD &&
567 bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
580 if (rq->q == ctrl->admin_q && (req->flags & NVME_REQ_USERCMD))
587 switch (ctrl->state) {
879 pr_warn("unknown parameter or missing value '%s' in ctrl creation request\n",
930 bool nvmf_ip_options_match(struct nvme_ctrl *ctrl,
933 if (!nvmf_ctlr_matches_baseopts(ctrl, opts) ||
934 strcmp(opts->traddr, ctrl->opts->traddr) ||
935 strcmp(opts->trsvcid, ctrl->opts->trsvcid))
948 (ctrl->opts->mask & NVMF_OPT_HOST_TRADDR)) {
949 if (strcmp(opts->host_traddr, ctrl->opts->host_traddr))
952 (ctrl->opts->mask & NVMF_OPT_HOST_TRADDR)) {
1003 struct nvme_ctrl *ctrl;
1050 ctrl = ops->create_ctrl(dev, opts);
1051 if (IS_ERR(ctrl)) {
1052 ret = PTR_ERR(ctrl);
1057 return ctrl;
1077 struct nvme_ctrl *ctrl;
1094 ctrl = nvmf_create_ctrl(nvmf_device, buf);
1095 if (IS_ERR(ctrl)) {
1096 ret = PTR_ERR(ctrl);
1100 seq_file->private = ctrl;
1110 struct nvme_ctrl *ctrl;
1114 ctrl = seq_file->private;
1115 if (!ctrl) {
1121 ctrl->instance, ctrl->cntlid);
1141 struct nvme_ctrl *ctrl = seq_file->private;
1143 if (ctrl)
1144 nvme_put_ctrl(ctrl);