Lines Matching refs:ctxt
87 * from rqstp::rq_pages into ctxt::pages. The consumed elements of
129 struct svc_rdma_recv_ctxt *ctxt;
133 ctxt = kmalloc_node(sizeof(*ctxt), GFP_KERNEL, node);
134 if (!ctxt)
144 svc_rdma_recv_cid_init(rdma, &ctxt->rc_cid);
145 pcl_init(&ctxt->rc_call_pcl);
146 pcl_init(&ctxt->rc_read_pcl);
147 pcl_init(&ctxt->rc_write_pcl);
148 pcl_init(&ctxt->rc_reply_pcl);
150 ctxt->rc_recv_wr.next = NULL;
151 ctxt->rc_recv_wr.wr_cqe = &ctxt->rc_cqe;
152 ctxt->rc_recv_wr.sg_list = &ctxt->rc_recv_sge;
153 ctxt->rc_recv_wr.num_sge = 1;
154 ctxt->rc_cqe.done = svc_rdma_wc_receive;
155 ctxt->rc_recv_sge.addr = addr;
156 ctxt->rc_recv_sge.length = rdma->sc_max_req_size;
157 ctxt->rc_recv_sge.lkey = rdma->sc_pd->local_dma_lkey;
158 ctxt->rc_recv_buf = buffer;
159 return ctxt;
164 kfree(ctxt);
170 struct svc_rdma_recv_ctxt *ctxt)
172 ib_dma_unmap_single(rdma->sc_pd->device, ctxt->rc_recv_sge.addr,
173 ctxt->rc_recv_sge.length, DMA_FROM_DEVICE);
174 kfree(ctxt->rc_recv_buf);
175 kfree(ctxt);
185 struct svc_rdma_recv_ctxt *ctxt;
189 ctxt = llist_entry(node, struct svc_rdma_recv_ctxt, rc_node);
190 svc_rdma_recv_ctxt_destroy(rdma, ctxt);
202 struct svc_rdma_recv_ctxt *ctxt;
208 ctxt = llist_entry(node, struct svc_rdma_recv_ctxt, rc_node);
211 ctxt->rc_page_count = 0;
212 return ctxt;
215 ctxt = svc_rdma_recv_ctxt_alloc(rdma);
216 if (!ctxt)
224 * @ctxt: object to return to the free list
228 struct svc_rdma_recv_ctxt *ctxt)
230 pcl_free(&ctxt->rc_call_pcl);
231 pcl_free(&ctxt->rc_read_pcl);
232 pcl_free(&ctxt->rc_write_pcl);
233 pcl_free(&ctxt->rc_reply_pcl);
235 llist_add(&ctxt->rc_node, &rdma->sc_recv_ctxts);
249 struct svc_rdma_recv_ctxt *ctxt = vctxt;
253 if (ctxt)
254 svc_rdma_recv_ctxt_put(rdma, ctxt);
261 struct svc_rdma_recv_ctxt *ctxt;
270 ctxt = svc_rdma_recv_ctxt_get(rdma);
271 if (!ctxt)
274 trace_svcrdma_post_recv(ctxt);
275 ctxt->rc_recv_wr.next = recv_chain;
276 recv_chain = &ctxt->rc_recv_wr;
290 ctxt = container_of(bad_wr, struct svc_rdma_recv_ctxt,
293 svc_rdma_recv_ctxt_put(rdma, ctxt);
321 struct svc_rdma_recv_ctxt *ctxt;
326 ctxt = container_of(cqe, struct svc_rdma_recv_ctxt, rc_cqe);
330 trace_svcrdma_wc_recv(wc, &ctxt->rc_cid);
346 ctxt->rc_byte_len = wc->byte_len;
349 list_add_tail(&ctxt->rc_list, &rdma->sc_rq_dto_q);
359 trace_svcrdma_wc_recv_flush(wc, &ctxt->rc_cid);
361 trace_svcrdma_wc_recv_err(wc, &ctxt->rc_cid);
363 svc_rdma_recv_ctxt_put(rdma, ctxt);
374 struct svc_rdma_recv_ctxt *ctxt;
376 while ((ctxt = svc_rdma_next_recv_ctxt(&rdma->sc_rq_dto_q))) {
377 list_del(&ctxt->rc_list);
378 svc_rdma_recv_ctxt_put(rdma, ctxt);
383 struct svc_rdma_recv_ctxt *ctxt)
387 arg->head[0].iov_base = ctxt->rc_recv_buf;
388 arg->head[0].iov_len = ctxt->rc_byte_len;
393 arg->buflen = ctxt->rc_byte_len;
394 arg->len = ctxt->rc_byte_len;
584 struct svc_rdma_recv_ctxt *ctxt)
590 ctxt->rc_inv_rkey = 0;
596 pcl_for_each_chunk(chunk, &ctxt->rc_call_pcl) {
604 pcl_for_each_chunk(chunk, &ctxt->rc_read_pcl) {
612 pcl_for_each_chunk(chunk, &ctxt->rc_write_pcl) {
620 pcl_for_each_chunk(chunk, &ctxt->rc_reply_pcl) {
628 ctxt->rc_inv_rkey = inv_rkey;
770 * when there are no remaining ctxt's to process.
772 * The next ctxt is removed from the "receive" lists.
774 * - If the ctxt completes a Receive, then construct the Call
790 struct svc_rdma_recv_ctxt *ctxt;
801 ctxt = NULL;
803 ctxt = svc_rdma_next_recv_ctxt(&rdma_xprt->sc_rq_dto_q);
804 if (ctxt)
805 list_del(&ctxt->rc_list);
813 if (!ctxt)
818 ctxt->rc_recv_sge.addr, ctxt->rc_byte_len,
820 svc_rdma_build_arg_xdr(rqstp, ctxt);
822 ret = svc_rdma_xdr_decode_req(&rqstp->rq_arg, ctxt);
828 if (svc_rdma_is_reverse_direction_reply(xprt, ctxt))
831 svc_rdma_get_inv_rkey(rdma_xprt, ctxt);
833 if (!pcl_is_empty(&ctxt->rc_read_pcl) ||
834 !pcl_is_empty(&ctxt->rc_call_pcl)) {
835 ret = svc_rdma_process_read_list(rdma_xprt, rqstp, ctxt);
840 rqstp->rq_xprt_ctxt = ctxt;
847 svc_rdma_send_error(rdma_xprt, ctxt, ret);
848 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt);
853 svc_rdma_send_error(rdma_xprt, ctxt, ret);
854 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt);
859 svc_rdma_handle_bc_reply(rqstp, ctxt);
861 svc_rdma_recv_ctxt_put(rdma_xprt, ctxt);