Lines Matching refs:ctxt
130 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_recv_ctxt_alloc() local
134 ctxt = kmalloc(sizeof(*ctxt), GFP_KERNEL); in svc_rdma_recv_ctxt_alloc()
135 if (!ctxt) in svc_rdma_recv_ctxt_alloc()
145 svc_rdma_recv_cid_init(rdma, &ctxt->rc_cid); in svc_rdma_recv_ctxt_alloc()
147 ctxt->rc_recv_wr.next = NULL; in svc_rdma_recv_ctxt_alloc()
148 ctxt->rc_recv_wr.wr_cqe = &ctxt->rc_cqe; in svc_rdma_recv_ctxt_alloc()
149 ctxt->rc_recv_wr.sg_list = &ctxt->rc_recv_sge; in svc_rdma_recv_ctxt_alloc()
150 ctxt->rc_recv_wr.num_sge = 1; in svc_rdma_recv_ctxt_alloc()
151 ctxt->rc_cqe.done = svc_rdma_wc_receive; in svc_rdma_recv_ctxt_alloc()
152 ctxt->rc_recv_sge.addr = addr; in svc_rdma_recv_ctxt_alloc()
153 ctxt->rc_recv_sge.length = rdma->sc_max_req_size; in svc_rdma_recv_ctxt_alloc()
154 ctxt->rc_recv_sge.lkey = rdma->sc_pd->local_dma_lkey; in svc_rdma_recv_ctxt_alloc()
155 ctxt->rc_recv_buf = buffer; in svc_rdma_recv_ctxt_alloc()
156 ctxt->rc_temp = false; in svc_rdma_recv_ctxt_alloc()
157 return ctxt; in svc_rdma_recv_ctxt_alloc()
162 kfree(ctxt); in svc_rdma_recv_ctxt_alloc()
168 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_recv_ctxt_destroy() argument
170 ib_dma_unmap_single(rdma->sc_pd->device, ctxt->rc_recv_sge.addr, in svc_rdma_recv_ctxt_destroy()
171 ctxt->rc_recv_sge.length, DMA_FROM_DEVICE); in svc_rdma_recv_ctxt_destroy()
172 kfree(ctxt->rc_recv_buf); in svc_rdma_recv_ctxt_destroy()
173 kfree(ctxt); in svc_rdma_recv_ctxt_destroy()
183 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_recv_ctxts_destroy() local
187 ctxt = llist_entry(node, struct svc_rdma_recv_ctxt, rc_node); in svc_rdma_recv_ctxts_destroy()
188 svc_rdma_recv_ctxt_destroy(rdma, ctxt); in svc_rdma_recv_ctxts_destroy()
195 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_recv_ctxt_get() local
201 ctxt = llist_entry(node, struct svc_rdma_recv_ctxt, rc_node); in svc_rdma_recv_ctxt_get()
204 ctxt->rc_page_count = 0; in svc_rdma_recv_ctxt_get()
205 ctxt->rc_read_payload_length = 0; in svc_rdma_recv_ctxt_get()
206 return ctxt; in svc_rdma_recv_ctxt_get()
209 ctxt = svc_rdma_recv_ctxt_alloc(rdma); in svc_rdma_recv_ctxt_get()
210 if (!ctxt) in svc_rdma_recv_ctxt_get()
222 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_recv_ctxt_put() argument
226 for (i = 0; i < ctxt->rc_page_count; i++) in svc_rdma_recv_ctxt_put()
227 put_page(ctxt->rc_pages[i]); in svc_rdma_recv_ctxt_put()
229 if (!ctxt->rc_temp) in svc_rdma_recv_ctxt_put()
230 llist_add(&ctxt->rc_node, &rdma->sc_recv_ctxts); in svc_rdma_recv_ctxt_put()
232 svc_rdma_recv_ctxt_destroy(rdma, ctxt); in svc_rdma_recv_ctxt_put()
245 struct svc_rdma_recv_ctxt *ctxt = rqstp->rq_xprt_ctxt; in svc_rdma_release_rqst() local
251 if (ctxt) in svc_rdma_release_rqst()
252 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_release_rqst()
256 struct svc_rdma_recv_ctxt *ctxt) in __svc_rdma_post_recv() argument
260 trace_svcrdma_post_recv(ctxt); in __svc_rdma_post_recv()
261 ret = ib_post_recv(rdma->sc_qp, &ctxt->rc_recv_wr, NULL); in __svc_rdma_post_recv()
268 svc_rdma_recv_ctxt_put(rdma, ctxt); in __svc_rdma_post_recv()
274 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_post_recv() local
278 ctxt = svc_rdma_recv_ctxt_get(rdma); in svc_rdma_post_recv()
279 if (!ctxt) in svc_rdma_post_recv()
281 return __svc_rdma_post_recv(rdma, ctxt); in svc_rdma_post_recv()
292 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_post_recvs() local
297 ctxt = svc_rdma_recv_ctxt_get(rdma); in svc_rdma_post_recvs()
298 if (!ctxt) in svc_rdma_post_recvs()
300 ctxt->rc_temp = true; in svc_rdma_post_recvs()
301 ret = __svc_rdma_post_recv(rdma, ctxt); in svc_rdma_post_recvs()
320 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_wc_receive() local
323 ctxt = container_of(cqe, struct svc_rdma_recv_ctxt, rc_cqe); in svc_rdma_wc_receive()
325 trace_svcrdma_wc_receive(wc, &ctxt->rc_cid); in svc_rdma_wc_receive()
333 ctxt->rc_byte_len = wc->byte_len; in svc_rdma_wc_receive()
335 ctxt->rc_recv_sge.addr, in svc_rdma_wc_receive()
339 list_add_tail(&ctxt->rc_list, &rdma->sc_rq_dto_q); in svc_rdma_wc_receive()
349 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_wc_receive()
361 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_flush_recv_queues() local
363 while ((ctxt = svc_rdma_next_recv_ctxt(&rdma->sc_read_complete_q))) { in svc_rdma_flush_recv_queues()
364 list_del(&ctxt->rc_list); in svc_rdma_flush_recv_queues()
365 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_flush_recv_queues()
367 while ((ctxt = svc_rdma_next_recv_ctxt(&rdma->sc_rq_dto_q))) { in svc_rdma_flush_recv_queues()
368 list_del(&ctxt->rc_list); in svc_rdma_flush_recv_queues()
369 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_flush_recv_queues()
374 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_build_arg_xdr() argument
378 arg->head[0].iov_base = ctxt->rc_recv_buf; in svc_rdma_build_arg_xdr()
379 arg->head[0].iov_len = ctxt->rc_byte_len; in svc_rdma_build_arg_xdr()
384 arg->buflen = ctxt->rc_byte_len; in svc_rdma_build_arg_xdr()
385 arg->len = ctxt->rc_byte_len; in svc_rdma_build_arg_xdr()
560 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_get_inv_rkey() argument
565 ctxt->rc_inv_rkey = 0; in svc_rdma_get_inv_rkey()
571 p = ctxt->rc_recv_buf; in svc_rdma_get_inv_rkey()
608 ctxt->rc_inv_rkey = be32_to_cpu(inv_rkey); in svc_rdma_get_inv_rkey()
802 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_recvfrom() local
809 ctxt = svc_rdma_next_recv_ctxt(&rdma_xprt->sc_read_complete_q); in svc_rdma_recvfrom()
810 if (ctxt) { in svc_rdma_recvfrom()
811 list_del(&ctxt->rc_list); in svc_rdma_recvfrom()
813 rdma_read_complete(rqstp, ctxt); in svc_rdma_recvfrom()
816 ctxt = svc_rdma_next_recv_ctxt(&rdma_xprt->sc_rq_dto_q); in svc_rdma_recvfrom()
817 if (!ctxt) { in svc_rdma_recvfrom()
823 list_del(&ctxt->rc_list); in svc_rdma_recvfrom()
828 svc_rdma_build_arg_xdr(rqstp, ctxt); in svc_rdma_recvfrom()
837 ret = svc_rdma_xdr_decode_req(&rqstp->rq_arg, ctxt); in svc_rdma_recvfrom()
847 svc_rdma_get_inv_rkey(rdma_xprt, ctxt); in svc_rdma_recvfrom()
854 rqstp->rq_xprt_ctxt = ctxt; in svc_rdma_recvfrom()
860 ret = svc_rdma_recv_read_chunk(rdma_xprt, rqstp, ctxt, p); in svc_rdma_recvfrom()
866 svc_rdma_send_error(rdma_xprt, ctxt, ret); in svc_rdma_recvfrom()
867 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); in svc_rdma_recvfrom()
872 svc_rdma_send_error(rdma_xprt, ctxt, ret); in svc_rdma_recvfrom()
873 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); in svc_rdma_recvfrom()
877 svc_rdma_handle_bc_reply(rqstp, ctxt); in svc_rdma_recvfrom()
879 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); in svc_rdma_recvfrom()