Lines Matching refs:ctxt

129 	struct svc_rdma_recv_ctxt *ctxt;  in svc_rdma_recv_ctxt_alloc()  local
133 ctxt = kmalloc_node(sizeof(*ctxt), GFP_KERNEL, node); in svc_rdma_recv_ctxt_alloc()
134 if (!ctxt) in svc_rdma_recv_ctxt_alloc()
144 svc_rdma_recv_cid_init(rdma, &ctxt->rc_cid); in svc_rdma_recv_ctxt_alloc()
145 pcl_init(&ctxt->rc_call_pcl); in svc_rdma_recv_ctxt_alloc()
146 pcl_init(&ctxt->rc_read_pcl); in svc_rdma_recv_ctxt_alloc()
147 pcl_init(&ctxt->rc_write_pcl); in svc_rdma_recv_ctxt_alloc()
148 pcl_init(&ctxt->rc_reply_pcl); in svc_rdma_recv_ctxt_alloc()
150 ctxt->rc_recv_wr.next = NULL; in svc_rdma_recv_ctxt_alloc()
151 ctxt->rc_recv_wr.wr_cqe = &ctxt->rc_cqe; in svc_rdma_recv_ctxt_alloc()
152 ctxt->rc_recv_wr.sg_list = &ctxt->rc_recv_sge; in svc_rdma_recv_ctxt_alloc()
153 ctxt->rc_recv_wr.num_sge = 1; in svc_rdma_recv_ctxt_alloc()
154 ctxt->rc_cqe.done = svc_rdma_wc_receive; in svc_rdma_recv_ctxt_alloc()
155 ctxt->rc_recv_sge.addr = addr; in svc_rdma_recv_ctxt_alloc()
156 ctxt->rc_recv_sge.length = rdma->sc_max_req_size; in svc_rdma_recv_ctxt_alloc()
157 ctxt->rc_recv_sge.lkey = rdma->sc_pd->local_dma_lkey; in svc_rdma_recv_ctxt_alloc()
158 ctxt->rc_recv_buf = buffer; in svc_rdma_recv_ctxt_alloc()
159 return ctxt; in svc_rdma_recv_ctxt_alloc()
164 kfree(ctxt); in svc_rdma_recv_ctxt_alloc()
170 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_recv_ctxt_destroy() argument
172 ib_dma_unmap_single(rdma->sc_pd->device, ctxt->rc_recv_sge.addr, in svc_rdma_recv_ctxt_destroy()
173 ctxt->rc_recv_sge.length, DMA_FROM_DEVICE); in svc_rdma_recv_ctxt_destroy()
174 kfree(ctxt->rc_recv_buf); in svc_rdma_recv_ctxt_destroy()
175 kfree(ctxt); in svc_rdma_recv_ctxt_destroy()
185 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_recv_ctxts_destroy() local
189 ctxt = llist_entry(node, struct svc_rdma_recv_ctxt, rc_node); in svc_rdma_recv_ctxts_destroy()
190 svc_rdma_recv_ctxt_destroy(rdma, ctxt); in svc_rdma_recv_ctxts_destroy()
202 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_recv_ctxt_get() local
208 ctxt = llist_entry(node, struct svc_rdma_recv_ctxt, rc_node); in svc_rdma_recv_ctxt_get()
211 ctxt->rc_page_count = 0; in svc_rdma_recv_ctxt_get()
212 return ctxt; in svc_rdma_recv_ctxt_get()
215 ctxt = svc_rdma_recv_ctxt_alloc(rdma); in svc_rdma_recv_ctxt_get()
216 if (!ctxt) in svc_rdma_recv_ctxt_get()
228 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_recv_ctxt_put() argument
230 pcl_free(&ctxt->rc_call_pcl); in svc_rdma_recv_ctxt_put()
231 pcl_free(&ctxt->rc_read_pcl); in svc_rdma_recv_ctxt_put()
232 pcl_free(&ctxt->rc_write_pcl); in svc_rdma_recv_ctxt_put()
233 pcl_free(&ctxt->rc_reply_pcl); in svc_rdma_recv_ctxt_put()
235 llist_add(&ctxt->rc_node, &rdma->sc_recv_ctxts); in svc_rdma_recv_ctxt_put()
249 struct svc_rdma_recv_ctxt *ctxt = vctxt; in svc_rdma_release_ctxt() local
253 if (ctxt) in svc_rdma_release_ctxt()
254 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_release_ctxt()
261 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_refresh_recvs() local
270 ctxt = svc_rdma_recv_ctxt_get(rdma); in svc_rdma_refresh_recvs()
271 if (!ctxt) in svc_rdma_refresh_recvs()
274 trace_svcrdma_post_recv(ctxt); in svc_rdma_refresh_recvs()
275 ctxt->rc_recv_wr.next = recv_chain; in svc_rdma_refresh_recvs()
276 recv_chain = &ctxt->rc_recv_wr; in svc_rdma_refresh_recvs()
290 ctxt = container_of(bad_wr, struct svc_rdma_recv_ctxt, in svc_rdma_refresh_recvs()
293 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_refresh_recvs()
321 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_wc_receive() local
326 ctxt = container_of(cqe, struct svc_rdma_recv_ctxt, rc_cqe); in svc_rdma_wc_receive()
330 trace_svcrdma_wc_recv(wc, &ctxt->rc_cid); in svc_rdma_wc_receive()
346 ctxt->rc_byte_len = wc->byte_len; in svc_rdma_wc_receive()
349 list_add_tail(&ctxt->rc_list, &rdma->sc_rq_dto_q); in svc_rdma_wc_receive()
359 trace_svcrdma_wc_recv_flush(wc, &ctxt->rc_cid); in svc_rdma_wc_receive()
361 trace_svcrdma_wc_recv_err(wc, &ctxt->rc_cid); in svc_rdma_wc_receive()
363 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_wc_receive()
374 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_flush_recv_queues() local
376 while ((ctxt = svc_rdma_next_recv_ctxt(&rdma->sc_rq_dto_q))) { in svc_rdma_flush_recv_queues()
377 list_del(&ctxt->rc_list); in svc_rdma_flush_recv_queues()
378 svc_rdma_recv_ctxt_put(rdma, ctxt); in svc_rdma_flush_recv_queues()
383 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_build_arg_xdr() argument
387 arg->head[0].iov_base = ctxt->rc_recv_buf; in svc_rdma_build_arg_xdr()
388 arg->head[0].iov_len = ctxt->rc_byte_len; in svc_rdma_build_arg_xdr()
393 arg->buflen = ctxt->rc_byte_len; in svc_rdma_build_arg_xdr()
394 arg->len = ctxt->rc_byte_len; in svc_rdma_build_arg_xdr()
590 struct svc_rdma_recv_ctxt *ctxt) in svc_rdma_get_inv_rkey() argument
596 ctxt->rc_inv_rkey = 0; in svc_rdma_get_inv_rkey()
602 pcl_for_each_chunk(chunk, &ctxt->rc_call_pcl) { in svc_rdma_get_inv_rkey()
610 pcl_for_each_chunk(chunk, &ctxt->rc_read_pcl) { in svc_rdma_get_inv_rkey()
618 pcl_for_each_chunk(chunk, &ctxt->rc_write_pcl) { in svc_rdma_get_inv_rkey()
626 pcl_for_each_chunk(chunk, &ctxt->rc_reply_pcl) { in svc_rdma_get_inv_rkey()
634 ctxt->rc_inv_rkey = inv_rkey; in svc_rdma_get_inv_rkey()
796 struct svc_rdma_recv_ctxt *ctxt; in svc_rdma_recvfrom() local
807 ctxt = NULL; in svc_rdma_recvfrom()
809 ctxt = svc_rdma_next_recv_ctxt(&rdma_xprt->sc_rq_dto_q); in svc_rdma_recvfrom()
810 if (ctxt) in svc_rdma_recvfrom()
811 list_del(&ctxt->rc_list); in svc_rdma_recvfrom()
819 if (!ctxt) in svc_rdma_recvfrom()
824 ctxt->rc_recv_sge.addr, ctxt->rc_byte_len, in svc_rdma_recvfrom()
826 svc_rdma_build_arg_xdr(rqstp, ctxt); in svc_rdma_recvfrom()
828 ret = svc_rdma_xdr_decode_req(&rqstp->rq_arg, ctxt); in svc_rdma_recvfrom()
834 if (svc_rdma_is_reverse_direction_reply(xprt, ctxt)) in svc_rdma_recvfrom()
837 svc_rdma_get_inv_rkey(rdma_xprt, ctxt); in svc_rdma_recvfrom()
839 if (!pcl_is_empty(&ctxt->rc_read_pcl) || in svc_rdma_recvfrom()
840 !pcl_is_empty(&ctxt->rc_call_pcl)) { in svc_rdma_recvfrom()
841 ret = svc_rdma_process_read_list(rdma_xprt, rqstp, ctxt); in svc_rdma_recvfrom()
846 rqstp->rq_xprt_ctxt = ctxt; in svc_rdma_recvfrom()
853 svc_rdma_send_error(rdma_xprt, ctxt, ret); in svc_rdma_recvfrom()
854 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); in svc_rdma_recvfrom()
859 svc_rdma_send_error(rdma_xprt, ctxt, ret); in svc_rdma_recvfrom()
860 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); in svc_rdma_recvfrom()
865 svc_rdma_handle_bc_reply(rqstp, ctxt); in svc_rdma_recvfrom()
867 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); in svc_rdma_recvfrom()