Lines Matching refs:rdma

54 svc_rdma_get_rw_ctxt(struct svcxprt_rdma *rdma, unsigned int sges)  in svc_rdma_get_rw_ctxt()  argument
59 spin_lock(&rdma->sc_rw_ctxt_lock); in svc_rdma_get_rw_ctxt()
60 node = llist_del_first(&rdma->sc_rw_ctxts); in svc_rdma_get_rw_ctxt()
61 spin_unlock(&rdma->sc_rw_ctxt_lock); in svc_rdma_get_rw_ctxt()
83 trace_svcrdma_no_rwctx_err(rdma, sges); in svc_rdma_get_rw_ctxt()
87 static void __svc_rdma_put_rw_ctxt(struct svcxprt_rdma *rdma, in __svc_rdma_put_rw_ctxt() argument
95 static void svc_rdma_put_rw_ctxt(struct svcxprt_rdma *rdma, in svc_rdma_put_rw_ctxt() argument
98 __svc_rdma_put_rw_ctxt(rdma, ctxt, &rdma->sc_rw_ctxts); in svc_rdma_put_rw_ctxt()
106 void svc_rdma_destroy_rw_ctxts(struct svcxprt_rdma *rdma) in svc_rdma_destroy_rw_ctxts() argument
111 while ((node = llist_del_first(&rdma->sc_rw_ctxts)) != NULL) { in svc_rdma_destroy_rw_ctxts()
128 static int svc_rdma_rw_ctx_init(struct svcxprt_rdma *rdma, in svc_rdma_rw_ctx_init() argument
135 ret = rdma_rw_ctx_init(&ctxt->rw_ctx, rdma->sc_qp, rdma->sc_port_num, in svc_rdma_rw_ctx_init()
139 svc_rdma_put_rw_ctxt(rdma, ctxt); in svc_rdma_rw_ctx_init()
140 trace_svcrdma_dma_map_rw_err(rdma, ctxt->rw_nents, ret); in svc_rdma_rw_ctx_init()
164 static void svc_rdma_cc_cid_init(struct svcxprt_rdma *rdma, in svc_rdma_cc_cid_init() argument
167 cid->ci_queue_id = rdma->sc_sq_cq->res.id; in svc_rdma_cc_cid_init()
168 cid->ci_completion_id = atomic_inc_return(&rdma->sc_completion_ids); in svc_rdma_cc_cid_init()
171 static void svc_rdma_cc_init(struct svcxprt_rdma *rdma, in svc_rdma_cc_init() argument
174 svc_rdma_cc_cid_init(rdma, &cc->cc_cid); in svc_rdma_cc_init()
175 cc->cc_rdma = rdma; in svc_rdma_cc_init()
189 struct svcxprt_rdma *rdma = cc->cc_rdma; in svc_rdma_cc_release() local
198 rdma_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_cc_release()
199 rdma->sc_port_num, ctxt->rw_sg_table.sgl, in svc_rdma_cc_release()
201 __svc_rdma_put_rw_ctxt(rdma, ctxt, &free); in svc_rdma_cc_release()
209 llist_add_batch(first, last, &rdma->sc_rw_ctxts); in svc_rdma_cc_release()
232 svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma, in svc_rdma_write_info_alloc() argument
244 svc_rdma_cc_init(rdma, &info->wi_cc); in svc_rdma_write_info_alloc()
267 struct svcxprt_rdma *rdma = cc->cc_rdma; in svc_rdma_write_done() local
282 svc_rdma_wake_send_waiters(rdma, cc->cc_sqecount); in svc_rdma_write_done()
285 svc_xprt_deferred_close(&rdma->sc_xprt); in svc_rdma_write_done()
303 svc_rdma_read_info_alloc(struct svcxprt_rdma *rdma) in svc_rdma_read_info_alloc() argument
311 svc_rdma_cc_init(rdma, &info->ri_cc); in svc_rdma_read_info_alloc()
363 struct svcxprt_rdma *rdma = cc->cc_rdma; in svc_rdma_post_chunk_ctxt() local
370 if (cc->cc_sqecount > rdma->sc_sq_depth) in svc_rdma_post_chunk_ctxt()
379 first_wr = rdma_rw_ctx_wrs(&ctxt->rw_ctx, rdma->sc_qp, in svc_rdma_post_chunk_ctxt()
380 rdma->sc_port_num, cqe, first_wr); in svc_rdma_post_chunk_ctxt()
386 &rdma->sc_sq_avail) > 0) { in svc_rdma_post_chunk_ctxt()
388 ret = ib_post_send(rdma->sc_qp, first_wr, &bad_wr); in svc_rdma_post_chunk_ctxt()
395 trace_svcrdma_sq_full(rdma); in svc_rdma_post_chunk_ctxt()
396 atomic_add(cc->cc_sqecount, &rdma->sc_sq_avail); in svc_rdma_post_chunk_ctxt()
397 wait_event(rdma->sc_send_wait, in svc_rdma_post_chunk_ctxt()
398 atomic_read(&rdma->sc_sq_avail) > cc->cc_sqecount); in svc_rdma_post_chunk_ctxt()
399 trace_svcrdma_sq_retry(rdma); in svc_rdma_post_chunk_ctxt()
402 trace_svcrdma_sq_post_err(rdma, ret); in svc_rdma_post_chunk_ctxt()
403 svc_xprt_deferred_close(&rdma->sc_xprt); in svc_rdma_post_chunk_ctxt()
409 atomic_add(cc->cc_sqecount, &rdma->sc_sq_avail); in svc_rdma_post_chunk_ctxt()
410 wake_up(&rdma->sc_send_wait); in svc_rdma_post_chunk_ctxt()
472 struct svcxprt_rdma *rdma = cc->cc_rdma; in svc_rdma_build_writes() local
488 ctxt = svc_rdma_get_rw_ctxt(rdma, in svc_rdma_build_writes()
495 ret = svc_rdma_rw_ctx_init(rdma, ctxt, offset, seg->rs_handle, in svc_rdma_build_writes()
515 trace_svcrdma_small_wrch_err(rdma, remaining, info->wi_seg_no, in svc_rdma_build_writes()
614 int svc_rdma_send_write_chunk(struct svcxprt_rdma *rdma, in svc_rdma_send_write_chunk() argument
622 info = svc_rdma_write_info_alloc(rdma, chunk); in svc_rdma_send_write_chunk()
655 int svc_rdma_send_reply_chunk(struct svcxprt_rdma *rdma, in svc_rdma_send_reply_chunk() argument
668 info = svc_rdma_write_info_alloc(rdma, chunk); in svc_rdma_send_reply_chunk()
1116 int svc_rdma_process_read_list(struct svcxprt_rdma *rdma, in svc_rdma_process_read_list() argument
1124 info = svc_rdma_read_info_alloc(rdma); in svc_rdma_process_read_list()