Lines Matching full:pdu

104 	void			*pdu;  member
150 void *pdu; member
260 return req->pdu; in nvme_tcp_req_cmd_pdu()
265 /* use the pdu space in the back for the data pdu */ in nvme_tcp_req_data_pdu()
266 return req->pdu + sizeof(struct nvme_tcp_cmd_pdu) - in nvme_tcp_req_data_pdu()
463 void *pdu, size_t len) in nvme_tcp_hdgst() argument
467 sg_init_one(&sg, pdu, len); in nvme_tcp_hdgst()
468 ahash_request_set_crypt(hash, &sg, pdu + len, len); in nvme_tcp_hdgst()
473 void *pdu, size_t pdu_len) in nvme_tcp_verify_hdgst() argument
475 struct nvme_tcp_hdr *hdr = pdu; in nvme_tcp_verify_hdgst()
486 recv_digest = *(__le32 *)(pdu + hdr->hlen); in nvme_tcp_verify_hdgst()
487 nvme_tcp_hdgst(queue->rcv_hash, pdu, pdu_len); in nvme_tcp_verify_hdgst()
488 exp_digest = *(__le32 *)(pdu + hdr->hlen); in nvme_tcp_verify_hdgst()
499 static int nvme_tcp_check_ddgst(struct nvme_tcp_queue *queue, void *pdu) in nvme_tcp_check_ddgst() argument
501 struct nvme_tcp_hdr *hdr = pdu; in nvme_tcp_check_ddgst()
524 page_frag_free(req->pdu); in nvme_tcp_exit_request()
533 struct nvme_tcp_cmd_pdu *pdu; in nvme_tcp_init_request() local
538 req->pdu = page_frag_alloc(&queue->pf_cache, in nvme_tcp_init_request()
541 if (!req->pdu) in nvme_tcp_init_request()
544 pdu = req->pdu; in nvme_tcp_init_request()
547 nvme_req(rq)->cmd = &pdu->cmd; in nvme_tcp_init_request()
625 struct nvme_tcp_data_pdu *pdu) in nvme_tcp_handle_c2h_data() argument
629 rq = nvme_find_rq(nvme_tcp_tagset(queue), pdu->command_id); in nvme_tcp_handle_c2h_data()
633 pdu->command_id, nvme_tcp_queue_id(queue)); in nvme_tcp_handle_c2h_data()
644 queue->data_remaining = le32_to_cpu(pdu->data_length); in nvme_tcp_handle_c2h_data()
646 if (pdu->hdr.flags & NVME_TCP_F_DATA_SUCCESS && in nvme_tcp_handle_c2h_data()
647 unlikely(!(pdu->hdr.flags & NVME_TCP_F_DATA_LAST))) { in nvme_tcp_handle_c2h_data()
649 "queue %d tag %#x SUCCESS set but not last PDU\n", in nvme_tcp_handle_c2h_data()
659 struct nvme_tcp_rsp_pdu *pdu) in nvme_tcp_handle_comp() argument
661 struct nvme_completion *cqe = &pdu->cqe; in nvme_tcp_handle_comp()
715 struct nvme_tcp_r2t_pdu *pdu) in nvme_tcp_handle_r2t() argument
719 u32 r2t_length = le32_to_cpu(pdu->r2t_length); in nvme_tcp_handle_r2t()
720 u32 r2t_offset = le32_to_cpu(pdu->r2t_offset); in nvme_tcp_handle_r2t()
722 rq = nvme_find_rq(nvme_tcp_tagset(queue), pdu->command_id); in nvme_tcp_handle_r2t()
726 pdu->command_id, nvme_tcp_queue_id(queue)); in nvme_tcp_handle_r2t()
755 req->ttag = pdu->ttag; in nvme_tcp_handle_r2t()
767 char *pdu = queue->pdu; in nvme_tcp_recv_pdu() local
772 &pdu[queue->pdu_offset], rcv_len); in nvme_tcp_recv_pdu()
783 hdr = queue->pdu; in nvme_tcp_recv_pdu()
785 ret = nvme_tcp_verify_hdgst(queue, queue->pdu, hdr->hlen); in nvme_tcp_recv_pdu()
792 ret = nvme_tcp_check_ddgst(queue, queue->pdu); in nvme_tcp_recv_pdu()
799 return nvme_tcp_handle_c2h_data(queue, (void *)queue->pdu); in nvme_tcp_recv_pdu()
802 return nvme_tcp_handle_comp(queue, (void *)queue->pdu); in nvme_tcp_recv_pdu()
805 return nvme_tcp_handle_r2t(queue, (void *)queue->pdu); in nvme_tcp_recv_pdu()
808 "unsupported pdu type (%d)\n", hdr->type); in nvme_tcp_recv_pdu()
824 struct nvme_tcp_data_pdu *pdu = (void *)queue->pdu; in nvme_tcp_recv_data() local
826 nvme_cid_to_rq(nvme_tcp_tagset(queue), pdu->command_id); in nvme_tcp_recv_data()
880 if (pdu->hdr.flags & NVME_TCP_F_DATA_SUCCESS) { in nvme_tcp_recv_data()
895 struct nvme_tcp_data_pdu *pdu = (void *)queue->pdu; in nvme_tcp_recv_ddgst() local
913 pdu->command_id); in nvme_tcp_recv_ddgst()
924 if (pdu->hdr.flags & NVME_TCP_F_DATA_SUCCESS) { in nvme_tcp_recv_ddgst()
926 pdu->command_id); in nvme_tcp_recv_ddgst()
1090 /* fully successful last send in current PDU */ in nvme_tcp_try_send_data()
1112 struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); in nvme_tcp_try_send_cmd_pdu() local
1117 int len = sizeof(*pdu) + hdgst - req->offset; in nvme_tcp_try_send_cmd_pdu()
1126 nvme_tcp_hdgst(queue->snd_hash, pdu, sizeof(*pdu)); in nvme_tcp_try_send_cmd_pdu()
1128 bvec_set_virt(&bvec, (void *)pdu + req->offset, len); in nvme_tcp_try_send_cmd_pdu()
1153 struct nvme_tcp_data_pdu *pdu = nvme_tcp_req_data_pdu(req); in nvme_tcp_try_send_data_pdu() local
1157 int len = sizeof(*pdu) - req->offset + hdgst; in nvme_tcp_try_send_data_pdu()
1161 nvme_tcp_hdgst(queue->snd_hash, pdu, sizeof(*pdu)); in nvme_tcp_try_send_data_pdu()
1166 bvec_set_virt(&bvec, (void *)pdu + req->offset, len); in nvme_tcp_try_send_data_pdu()
1355 page_frag_free(async->pdu); in nvme_tcp_free_async_req()
1364 async->pdu = page_frag_alloc(&queue->pf_cache, in nvme_tcp_alloc_async_req()
1367 if (!async->pdu) in nvme_tcp_alloc_async_req()
1394 kfree(queue->pdu); in nvme_tcp_free_queue()
1474 pr_err("queue %d: bad pdu length returned %d\n", in nvme_tcp_init_connection()
1771 queue->pdu = kmalloc(rcv_pdu_size, GFP_KERNEL); in nvme_tcp_alloc_queue()
1772 if (!queue->pdu) { in nvme_tcp_alloc_queue()
1806 kfree(queue->pdu); in nvme_tcp_alloc_queue()
1899 if (to_tcp_ctrl(ctrl)->async_req.pdu) { in nvme_tcp_free_admin_queue()
1902 to_tcp_ctrl(ctrl)->async_req.pdu = NULL; in nvme_tcp_free_admin_queue()
2438 struct nvme_tcp_cmd_pdu *pdu = ctrl->async_req.pdu; in nvme_tcp_submit_async_event() local
2439 struct nvme_command *cmd = &pdu->cmd; in nvme_tcp_submit_async_event()
2442 memset(pdu, 0, sizeof(*pdu)); in nvme_tcp_submit_async_event()
2443 pdu->hdr.type = nvme_tcp_cmd; in nvme_tcp_submit_async_event()
2445 pdu->hdr.flags |= NVME_TCP_F_HDGST; in nvme_tcp_submit_async_event()
2446 pdu->hdr.hlen = sizeof(*pdu); in nvme_tcp_submit_async_event()
2447 pdu->hdr.plen = cpu_to_le32(pdu->hdr.hlen + hdgst); in nvme_tcp_submit_async_event()
2475 struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); in nvme_tcp_timeout() local
2476 struct nvme_command *cmd = &pdu->cmd; in nvme_tcp_timeout()
2481 rq->tag, nvme_cid(rq), pdu->hdr.type, cmd->common.opcode, in nvme_tcp_timeout()
2514 struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); in nvme_tcp_map_data() local
2515 struct nvme_command *c = &pdu->cmd; in nvme_tcp_map_data()
2534 struct nvme_tcp_cmd_pdu *pdu = nvme_tcp_req_cmd_pdu(req); in nvme_tcp_setup_cmd_pdu() local
2560 pdu->hdr.type = nvme_tcp_cmd; in nvme_tcp_setup_cmd_pdu()
2561 pdu->hdr.flags = 0; in nvme_tcp_setup_cmd_pdu()
2563 pdu->hdr.flags |= NVME_TCP_F_HDGST; in nvme_tcp_setup_cmd_pdu()
2565 pdu->hdr.flags |= NVME_TCP_F_DDGST; in nvme_tcp_setup_cmd_pdu()
2568 pdu->hdr.hlen = sizeof(*pdu); in nvme_tcp_setup_cmd_pdu()
2569 pdu->hdr.pdo = req->pdu_len ? pdu->hdr.hlen + hdgst : 0; in nvme_tcp_setup_cmd_pdu()
2570 pdu->hdr.plen = in nvme_tcp_setup_cmd_pdu()
2571 cpu_to_le32(pdu->hdr.hlen + hdgst + req->pdu_len + ddgst); in nvme_tcp_setup_cmd_pdu()