Lines Matching refs:req

10 static void nvmet_execute_prop_set(struct nvmet_req *req)
12 u64 val = le64_to_cpu(req->cmd->prop_set.value);
15 if (!nvmet_check_transfer_len(req, 0))
18 if (req->cmd->prop_set.attrib & 1) {
19 req->error_loc =
25 switch (le32_to_cpu(req->cmd->prop_set.offset)) {
27 nvmet_update_cc(req->sq->ctrl, val);
30 req->error_loc =
35 nvmet_req_complete(req, status);
38 static void nvmet_execute_prop_get(struct nvmet_req *req)
40 struct nvmet_ctrl *ctrl = req->sq->ctrl;
44 if (!nvmet_check_transfer_len(req, 0))
47 if (req->cmd->prop_get.attrib & 1) {
48 switch (le32_to_cpu(req->cmd->prop_get.offset)) {
57 switch (le32_to_cpu(req->cmd->prop_get.offset)) {
76 if (status && req->cmd->prop_get.attrib & 1) {
77 req->error_loc =
80 req->error_loc =
84 req->cqe->result.u64 = cpu_to_le64(val);
85 nvmet_req_complete(req, status);
88 u32 nvmet_fabrics_admin_cmd_data_len(struct nvmet_req *req)
90 struct nvme_command *cmd = req->cmd;
95 return nvmet_auth_send_data_len(req);
97 return nvmet_auth_receive_data_len(req);
104 u16 nvmet_parse_fabrics_admin_cmd(struct nvmet_req *req)
106 struct nvme_command *cmd = req->cmd;
110 req->execute = nvmet_execute_prop_set;
113 req->execute = nvmet_execute_prop_get;
117 req->execute = nvmet_execute_auth_send;
120 req->execute = nvmet_execute_auth_receive;
126 req->error_loc = offsetof(struct nvmf_common_command, fctype);
133 u32 nvmet_fabrics_io_cmd_data_len(struct nvmet_req *req)
135 struct nvme_command *cmd = req->cmd;
140 return nvmet_auth_send_data_len(req);
142 return nvmet_auth_receive_data_len(req);
149 u16 nvmet_parse_fabrics_io_cmd(struct nvmet_req *req)
151 struct nvme_command *cmd = req->cmd;
156 req->execute = nvmet_execute_auth_send;
159 req->execute = nvmet_execute_auth_receive;
165 req->error_loc = offsetof(struct nvmf_common_command, fctype);
172 static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req)
174 struct nvmf_connect_command *c = &req->cmd->connect;
183 req->error_loc = offsetof(struct nvmf_connect_command, sqsize);
184 req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(sqsize);
191 req->error_loc = offsetof(struct nvmf_connect_command, qid);
199 req->error_loc = offsetof(struct nvmf_connect_command, sqsize);
200 req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(sqsize);
204 old = cmpxchg(&req->sq->ctrl, NULL, ctrl);
207 req->error_loc = offsetof(struct nvmf_connect_command, opcode);
212 old = cmpxchg(&req->cq->ctrl, NULL, ctrl);
215 req->error_loc = offsetof(struct nvmf_connect_command, opcode);
220 nvmet_cq_setup(ctrl, req->cq, qid, sqsize + 1);
221 nvmet_sq_setup(ctrl, req->sq, qid, sqsize + 1);
224 req->sq->sqhd_disabled = true;
225 req->cqe->sq_head = cpu_to_le16(0xffff);
229 ret = ctrl->ops->install_queue(req->sq);
241 req->sq->ctrl = NULL;
267 static void nvmet_execute_admin_connect(struct nvmet_req *req)
269 struct nvmf_connect_command *c = &req->cmd->connect;
273 .port = req->port,
274 .sq = req->sq,
275 .ops = req->ops,
276 .p2p_client = req->p2p_client,
280 if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data)))
289 args.status = nvmet_copy_from_sgl(req, 0, d, sizeof(*d));
321 args.status = nvmet_install_queue(ctrl, req);
327 args.result = cpu_to_le32(nvmet_connect_result(ctrl, req->sq));
331 req->error_loc = args.error_loc;
332 req->cqe->result.u32 = args.result;
333 nvmet_req_complete(req, args.status);
336 static void nvmet_execute_io_connect(struct nvmet_req *req)
338 struct nvmf_connect_command *c = &req->cmd->connect;
344 if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data)))
353 status = nvmet_copy_from_sgl(req, 0, d, sizeof(*d));
367 le16_to_cpu(d->cntlid), req);
376 req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(qid);
380 status = nvmet_install_queue(ctrl, req);
385 req->cqe->result.u32 = cpu_to_le32(nvmet_connect_result(ctrl, req->sq));
389 nvmet_req_complete(req, status);
397 u32 nvmet_connect_cmd_data_len(struct nvmet_req *req)
399 struct nvme_command *cmd = req->cmd;
408 u16 nvmet_parse_connect_cmd(struct nvmet_req *req)
410 struct nvme_command *cmd = req->cmd;
415 req->error_loc = offsetof(struct nvme_common_command, opcode);
421 req->error_loc = offsetof(struct nvmf_common_command, fctype);
426 req->execute = nvmet_execute_admin_connect;
428 req->execute = nvmet_execute_io_connect;