Lines Matching refs:ctxt
135 struct svc_rdma_send_ctxt *ctxt; in svc_rdma_send_ctxt_alloc() local
141 size = sizeof(*ctxt); in svc_rdma_send_ctxt_alloc()
143 ctxt = kmalloc(size, GFP_KERNEL); in svc_rdma_send_ctxt_alloc()
144 if (!ctxt) in svc_rdma_send_ctxt_alloc()
154 svc_rdma_send_cid_init(rdma, &ctxt->sc_cid); in svc_rdma_send_ctxt_alloc()
156 ctxt->sc_send_wr.next = NULL; in svc_rdma_send_ctxt_alloc()
157 ctxt->sc_send_wr.wr_cqe = &ctxt->sc_cqe; in svc_rdma_send_ctxt_alloc()
158 ctxt->sc_send_wr.sg_list = ctxt->sc_sges; in svc_rdma_send_ctxt_alloc()
159 ctxt->sc_send_wr.send_flags = IB_SEND_SIGNALED; in svc_rdma_send_ctxt_alloc()
160 ctxt->sc_cqe.done = svc_rdma_wc_send; in svc_rdma_send_ctxt_alloc()
161 ctxt->sc_xprt_buf = buffer; in svc_rdma_send_ctxt_alloc()
162 xdr_buf_init(&ctxt->sc_hdrbuf, ctxt->sc_xprt_buf, in svc_rdma_send_ctxt_alloc()
164 ctxt->sc_sges[0].addr = addr; in svc_rdma_send_ctxt_alloc()
167 ctxt->sc_sges[i].lkey = rdma->sc_pd->local_dma_lkey; in svc_rdma_send_ctxt_alloc()
168 return ctxt; in svc_rdma_send_ctxt_alloc()
173 kfree(ctxt); in svc_rdma_send_ctxt_alloc()
185 struct svc_rdma_send_ctxt *ctxt; in svc_rdma_send_ctxts_destroy() local
187 while ((ctxt = svc_rdma_next_send_ctxt(&rdma->sc_send_ctxts))) { in svc_rdma_send_ctxts_destroy()
188 list_del(&ctxt->sc_list); in svc_rdma_send_ctxts_destroy()
190 ctxt->sc_sges[0].addr, in svc_rdma_send_ctxts_destroy()
193 kfree(ctxt->sc_xprt_buf); in svc_rdma_send_ctxts_destroy()
194 kfree(ctxt); in svc_rdma_send_ctxts_destroy()
207 struct svc_rdma_send_ctxt *ctxt; in svc_rdma_send_ctxt_get() local
210 ctxt = svc_rdma_next_send_ctxt(&rdma->sc_send_ctxts); in svc_rdma_send_ctxt_get()
211 if (!ctxt) in svc_rdma_send_ctxt_get()
213 list_del(&ctxt->sc_list); in svc_rdma_send_ctxt_get()
217 rpcrdma_set_xdrlen(&ctxt->sc_hdrbuf, 0); in svc_rdma_send_ctxt_get()
218 xdr_init_encode(&ctxt->sc_stream, &ctxt->sc_hdrbuf, in svc_rdma_send_ctxt_get()
219 ctxt->sc_xprt_buf, NULL); in svc_rdma_send_ctxt_get()
221 ctxt->sc_send_wr.num_sge = 0; in svc_rdma_send_ctxt_get()
222 ctxt->sc_cur_sge_no = 0; in svc_rdma_send_ctxt_get()
223 ctxt->sc_page_count = 0; in svc_rdma_send_ctxt_get()
224 return ctxt; in svc_rdma_send_ctxt_get()
228 ctxt = svc_rdma_send_ctxt_alloc(rdma); in svc_rdma_send_ctxt_get()
229 if (!ctxt) in svc_rdma_send_ctxt_get()
242 struct svc_rdma_send_ctxt *ctxt) in svc_rdma_send_ctxt_put() argument
250 for (i = 1; i < ctxt->sc_send_wr.num_sge; i++) { in svc_rdma_send_ctxt_put()
252 ctxt->sc_sges[i].addr, in svc_rdma_send_ctxt_put()
253 ctxt->sc_sges[i].length, in svc_rdma_send_ctxt_put()
256 ctxt->sc_sges[i].addr, in svc_rdma_send_ctxt_put()
257 ctxt->sc_sges[i].length); in svc_rdma_send_ctxt_put()
260 for (i = 0; i < ctxt->sc_page_count; ++i) in svc_rdma_send_ctxt_put()
261 put_page(ctxt->sc_pages[i]); in svc_rdma_send_ctxt_put()
264 list_add(&ctxt->sc_list, &rdma->sc_send_ctxts); in svc_rdma_send_ctxt_put()
280 struct svc_rdma_send_ctxt *ctxt = in svc_rdma_wc_send() local
283 trace_svcrdma_wc_send(wc, &ctxt->sc_cid); in svc_rdma_wc_send()
288 svc_rdma_send_ctxt_put(rdma, ctxt); in svc_rdma_wc_send()
304 int svc_rdma_send(struct svcxprt_rdma *rdma, struct svc_rdma_send_ctxt *ctxt) in svc_rdma_send() argument
306 struct ib_send_wr *wr = &ctxt->sc_send_wr; in svc_rdma_send()
331 trace_svcrdma_post_send(ctxt); in svc_rdma_send()
510 struct svc_rdma_send_ctxt *ctxt, in svc_rdma_dma_map_page() argument
523 ctxt->sc_sges[ctxt->sc_cur_sge_no].addr = dma_addr; in svc_rdma_dma_map_page()
524 ctxt->sc_sges[ctxt->sc_cur_sge_no].length = len; in svc_rdma_dma_map_page()
525 ctxt->sc_send_wr.num_sge++; in svc_rdma_dma_map_page()
536 struct svc_rdma_send_ctxt *ctxt, in svc_rdma_dma_map_buf() argument
540 return svc_rdma_dma_map_page(rdma, ctxt, virt_to_page(base), in svc_rdma_dma_map_buf()
755 struct svc_rdma_send_ctxt *ctxt) in svc_rdma_save_io_pages() argument
759 ctxt->sc_page_count += pages; in svc_rdma_save_io_pages()
761 ctxt->sc_pages[i] = rqstp->rq_respages[i]; in svc_rdma_save_io_pages()