Lines Matching refs: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_admin_cmd(struct nvmet_req *req) in nvmet_parse_fabrics_admin_cmd() argument
87 struct nvme_command *cmd = req->cmd; in nvmet_parse_fabrics_admin_cmd()
91 req->execute = nvmet_execute_prop_set; in nvmet_parse_fabrics_admin_cmd()
94 req->execute = nvmet_execute_prop_get; in nvmet_parse_fabrics_admin_cmd()
98 req->execute = nvmet_execute_auth_send; in nvmet_parse_fabrics_admin_cmd()
101 req->execute = nvmet_execute_auth_receive; in nvmet_parse_fabrics_admin_cmd()
107 req->error_loc = offsetof(struct nvmf_common_command, fctype); in nvmet_parse_fabrics_admin_cmd()
114 u16 nvmet_parse_fabrics_io_cmd(struct nvmet_req *req) in nvmet_parse_fabrics_io_cmd() argument
116 struct nvme_command *cmd = req->cmd; in nvmet_parse_fabrics_io_cmd()
121 req->execute = nvmet_execute_auth_send; in nvmet_parse_fabrics_io_cmd()
124 req->execute = nvmet_execute_auth_receive; in nvmet_parse_fabrics_io_cmd()
130 req->error_loc = offsetof(struct nvmf_common_command, fctype); in nvmet_parse_fabrics_io_cmd()
137 static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req) in nvmet_install_queue() argument
139 struct nvmf_connect_command *c = &req->cmd->connect; in nvmet_install_queue()
148 req->error_loc = offsetof(struct nvmf_connect_command, sqsize); in nvmet_install_queue()
149 req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(sqsize); in nvmet_install_queue()
156 req->error_loc = offsetof(struct nvmf_connect_command, qid); in nvmet_install_queue()
163 req->error_loc = offsetof(struct nvmf_connect_command, sqsize); in nvmet_install_queue()
164 req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(sqsize); in nvmet_install_queue()
168 old = cmpxchg(&req->sq->ctrl, NULL, ctrl); in nvmet_install_queue()
171 req->error_loc = offsetof(struct nvmf_connect_command, opcode); in nvmet_install_queue()
176 nvmet_cq_setup(ctrl, req->cq, qid, sqsize + 1); in nvmet_install_queue()
177 nvmet_sq_setup(ctrl, req->sq, qid, sqsize + 1); in nvmet_install_queue()
180 req->sq->sqhd_disabled = true; in nvmet_install_queue()
181 req->cqe->sq_head = cpu_to_le16(0xffff); in nvmet_install_queue()
185 ret = ctrl->ops->install_queue(req->sq); in nvmet_install_queue()
197 req->sq->ctrl = NULL; in nvmet_install_queue()
207 static void nvmet_execute_admin_connect(struct nvmet_req *req) in nvmet_execute_admin_connect() argument
209 struct nvmf_connect_command *c = &req->cmd->connect; in nvmet_execute_admin_connect()
215 if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) in nvmet_execute_admin_connect()
224 status = nvmet_copy_from_sgl(req, 0, d, sizeof(*d)); in nvmet_execute_admin_connect()
229 req->cqe->result.u32 = 0; in nvmet_execute_admin_connect()
234 req->error_loc = offsetof(struct nvmf_connect_command, recfmt); in nvmet_execute_admin_connect()
243 req->cqe->result.u32 = IPO_IATTR_CONNECT_DATA(cntlid); in nvmet_execute_admin_connect()
247 status = nvmet_alloc_ctrl(d->subsysnqn, d->hostnqn, req, in nvmet_execute_admin_connect()
267 status = nvmet_install_queue(ctrl, req); in nvmet_execute_admin_connect()
278 req->cqe->result.u32 = cpu_to_le32(nvmet_connect_result(ctrl)); in nvmet_execute_admin_connect()
282 nvmet_req_complete(req, status); in nvmet_execute_admin_connect()
285 static void nvmet_execute_io_connect(struct nvmet_req *req) in nvmet_execute_io_connect() argument
287 struct nvmf_connect_command *c = &req->cmd->connect; in nvmet_execute_io_connect()
293 if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data))) in nvmet_execute_io_connect()
302 status = nvmet_copy_from_sgl(req, 0, d, sizeof(*d)); in nvmet_execute_io_connect()
307 req->cqe->result.u32 = 0; in nvmet_execute_io_connect()
317 le16_to_cpu(d->cntlid), req); in nvmet_execute_io_connect()
326 req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(qid); in nvmet_execute_io_connect()
330 status = nvmet_install_queue(ctrl, req); in nvmet_execute_io_connect()
335 req->cqe->result.u32 = cpu_to_le32(nvmet_connect_result(ctrl)); in nvmet_execute_io_connect()
339 nvmet_req_complete(req, status); in nvmet_execute_io_connect()
347 u16 nvmet_parse_connect_cmd(struct nvmet_req *req) in nvmet_parse_connect_cmd() argument
349 struct nvme_command *cmd = req->cmd; in nvmet_parse_connect_cmd()
354 req->error_loc = offsetof(struct nvme_common_command, opcode); in nvmet_parse_connect_cmd()
360 req->error_loc = offsetof(struct nvmf_common_command, fctype); in nvmet_parse_connect_cmd()
365 req->execute = nvmet_execute_admin_connect; in nvmet_parse_connect_cmd()
367 req->execute = nvmet_execute_io_connect; in nvmet_parse_connect_cmd()