Lines Matching full:req

10 static void nvmet_execute_prop_set(struct nvmet_req *req)  in nvmet_execute_prop_set()  argument
12 u64 val = le64_to_cpu(req->cmd->prop_set.value); in nvmet_execute_prop_set()
15 if (!nvmet_check_transfer_len(req, 0)) in nvmet_execute_prop_set()
18 if (req->cmd->prop_set.attrib & 1) { in nvmet_execute_prop_set()
19 req->error_loc = in nvmet_execute_prop_set()
25 switch (le32_to_cpu(req->cmd->prop_set.offset)) { in nvmet_execute_prop_set()
27 nvmet_update_cc(req->sq->ctrl, val); in nvmet_execute_prop_set()
30 req->error_loc = in nvmet_execute_prop_set()
35 nvmet_req_complete(req, status); in nvmet_execute_prop_set()
38 static void nvmet_execute_prop_get(struct nvmet_req *req) in nvmet_execute_prop_get() argument
40 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_prop_get()
44 if (!nvmet_check_transfer_len(req, 0)) in nvmet_execute_prop_get()
47 if (req->cmd->prop_get.attrib & 1) { in nvmet_execute_prop_get()
48 switch (le32_to_cpu(req->cmd->prop_get.offset)) { in nvmet_execute_prop_get()
57 switch (le32_to_cpu(req->cmd->prop_get.offset)) { in nvmet_execute_prop_get()
73 if (status && req->cmd->prop_get.attrib & 1) { in nvmet_execute_prop_get()
74 req->error_loc = in nvmet_execute_prop_get()
77 req->error_loc = in nvmet_execute_prop_get()
81 req->cqe->result.u64 = cpu_to_le64(val); in nvmet_execute_prop_get()
82 nvmet_req_complete(req, status); in nvmet_execute_prop_get()
85 u16 nvmet_parse_fabrics_cmd(struct nvmet_req *req) in nvmet_parse_fabrics_cmd() argument
87 struct nvme_command *cmd = req->cmd; in nvmet_parse_fabrics_cmd()
91 req->execute = nvmet_execute_prop_set; in nvmet_parse_fabrics_cmd()
94 req->execute = nvmet_execute_prop_get; in nvmet_parse_fabrics_cmd()
99 req->error_loc = offsetof(struct nvmf_common_command, fctype); in nvmet_parse_fabrics_cmd()
106 static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req) in nvmet_install_queue() argument
108 struct nvmf_connect_command *c = &req->cmd->connect; in nvmet_install_queue()
114 old = cmpxchg(&req->sq->ctrl, NULL, ctrl); in nvmet_install_queue()
117 req->error_loc = offsetof(struct nvmf_connect_command, opcode); in nvmet_install_queue()
122 req->error_loc = offsetof(struct nvmf_connect_command, sqsize); in nvmet_install_queue()
128 nvmet_cq_setup(ctrl, req->cq, qid, sqsize + 1); in nvmet_install_queue()
129 nvmet_sq_setup(ctrl, req->sq, qid, sqsize + 1); in nvmet_install_queue()
132 req->sq->sqhd_disabled = true; in nvmet_install_queue()
133 req->cqe->sq_head = cpu_to_le16(0xffff); in nvmet_install_queue()
137 ret = ctrl->ops->install_queue(req->sq); in nvmet_install_queue()
148 req->sq->ctrl = NULL; in nvmet_install_queue()
152 static void nvmet_execute_admin_connect(struct nvmet_req *req) in nvmet_execute_admin_connect() argument
154 struct nvmf_connect_command *c = &req->cmd->connect; in nvmet_execute_admin_connect()
159 if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) in nvmet_execute_admin_connect()
168 status = nvmet_copy_from_sgl(req, 0, d, sizeof(*d)); in nvmet_execute_admin_connect()
173 req->cqe->result.u32 = 0; in nvmet_execute_admin_connect()
178 req->error_loc = offsetof(struct nvmf_connect_command, recfmt); in nvmet_execute_admin_connect()
187 req->cqe->result.u32 = IPO_IATTR_CONNECT_DATA(cntlid); in nvmet_execute_admin_connect()
191 status = nvmet_alloc_ctrl(d->subsysnqn, d->hostnqn, req, in nvmet_execute_admin_connect()
195 req->error_loc = in nvmet_execute_admin_connect()
204 status = nvmet_install_queue(ctrl, req); in nvmet_execute_admin_connect()
213 req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid); in nvmet_execute_admin_connect()
218 nvmet_req_complete(req, status); in nvmet_execute_admin_connect()
221 static void nvmet_execute_io_connect(struct nvmet_req *req) in nvmet_execute_io_connect() argument
223 struct nvmf_connect_command *c = &req->cmd->connect; in nvmet_execute_io_connect()
229 if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) in nvmet_execute_io_connect()
238 status = nvmet_copy_from_sgl(req, 0, d, sizeof(*d)); in nvmet_execute_io_connect()
243 req->cqe->result.u32 = 0; in nvmet_execute_io_connect()
254 req, &ctrl); in nvmet_execute_io_connect()
261 req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(qid); in nvmet_execute_io_connect()
265 status = nvmet_install_queue(ctrl, req); in nvmet_execute_io_connect()
268 req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid); in nvmet_execute_io_connect()
277 nvmet_req_complete(req, status); in nvmet_execute_io_connect()
285 u16 nvmet_parse_connect_cmd(struct nvmet_req *req) in nvmet_parse_connect_cmd() argument
287 struct nvme_command *cmd = req->cmd; in nvmet_parse_connect_cmd()
292 req->error_loc = offsetof(struct nvme_common_command, opcode); in nvmet_parse_connect_cmd()
298 req->error_loc = offsetof(struct nvmf_common_command, fctype); in nvmet_parse_connect_cmd()
303 req->execute = nvmet_execute_admin_connect; in nvmet_parse_connect_cmd()
305 req->execute = nvmet_execute_io_connect; in nvmet_parse_connect_cmd()