Lines Matching refs:rdma

8 #include <rdma/rw.h>
55 svc_rdma_get_rw_ctxt(struct svcxprt_rdma *rdma, unsigned int sges)
57 struct ib_device *dev = rdma->sc_cm_id->device;
62 spin_lock(&rdma->sc_rw_ctxt_lock);
63 node = llist_del_first(&rdma->sc_rw_ctxts);
64 spin_unlock(&rdma->sc_rw_ctxt_lock);
87 trace_svcrdma_rwctx_empty(rdma, sges);
98 static void svc_rdma_put_rw_ctxt(struct svcxprt_rdma *rdma,
101 __svc_rdma_put_rw_ctxt(ctxt, &rdma->sc_rw_ctxts);
106 * @rdma: transport about to be destroyed
109 void svc_rdma_destroy_rw_ctxts(struct svcxprt_rdma *rdma)
114 while ((node = llist_del_first(&rdma->sc_rw_ctxts)) != NULL) {
122 * @rdma: controlling transport instance
131 static int svc_rdma_rw_ctx_init(struct svcxprt_rdma *rdma,
138 ret = rdma_rw_ctx_init(&ctxt->rw_ctx, rdma->sc_qp, rdma->sc_port_num,
142 trace_svcrdma_dma_map_rw_err(rdma, offset, handle,
144 svc_rdma_put_rw_ctxt(rdma, ctxt);
151 * @rdma: controlling transport instance
154 void svc_rdma_cc_init(struct svcxprt_rdma *rdma,
160 svc_rdma_send_cid_init(rdma, cid);
168 * @rdma: controlling transport instance
172 void svc_rdma_cc_release(struct svcxprt_rdma *rdma,
186 rdma_rw_ctx_destroy(&ctxt->rw_ctx, rdma->sc_qp,
187 rdma->sc_port_num, ctxt->rw_sg_table.sgl,
197 llist_add_batch(first, last, &rdma->sc_rw_ctxts);
201 svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma,
207 ibdev_to_node(rdma->sc_cm_id->device));
211 info->wi_rdma = rdma;
213 svc_rdma_cc_init(rdma, &info->wi_cc);
235 * @rdma: controlling transport
238 void svc_rdma_reply_chunk_release(struct svcxprt_rdma *rdma,
245 svc_rdma_cc_release(rdma, cc, DMA_TO_DEVICE);
260 struct svcxprt_rdma *rdma = cq->cq_context;
273 svc_xprt_deferred_close(&rdma->sc_xprt);
285 struct svcxprt_rdma *rdma = cq->cq_context;
303 svc_rdma_wake_send_waiters(rdma, cc->cc_sqecount);
306 svc_xprt_deferred_close(&rdma->sc_xprt);
319 struct svcxprt_rdma *rdma = cq->cq_context;
325 svc_rdma_wake_send_waiters(rdma, cc->cc_sqecount);
333 spin_lock(&rdma->sc_rq_dto_lock);
334 list_add_tail(&ctxt->rc_list, &rdma->sc_read_complete_q);
336 set_bit(XPT_DATA, &rdma->sc_xprt.xpt_flags);
337 spin_unlock(&rdma->sc_rq_dto_lock);
338 svc_xprt_enqueue(&rdma->sc_xprt);
351 svc_rdma_cc_release(rdma, cc, DMA_FROM_DEVICE);
352 svc_rdma_recv_ctxt_put(rdma, ctxt);
353 svc_xprt_deferred_close(&rdma->sc_xprt);
362 static int svc_rdma_post_chunk_ctxt(struct svcxprt_rdma *rdma,
373 if (cc->cc_sqecount > rdma->sc_sq_depth)
382 first_wr = rdma_rw_ctx_wrs(&ctxt->rw_ctx, rdma->sc_qp,
383 rdma->sc_port_num, cqe, first_wr);
389 &rdma->sc_sq_avail) > 0) {
391 ret = ib_post_send(rdma->sc_qp, first_wr, &bad_wr);
398 trace_svcrdma_sq_full(rdma, &cc->cc_cid);
399 atomic_add(cc->cc_sqecount, &rdma->sc_sq_avail);
400 wait_event(rdma->sc_send_wait,
401 atomic_read(&rdma->sc_sq_avail) > cc->cc_sqecount);
402 trace_svcrdma_sq_retry(rdma, &cc->cc_cid);
405 trace_svcrdma_sq_post_err(rdma, &cc->cc_cid, ret);
406 svc_xprt_deferred_close(&rdma->sc_xprt);
412 atomic_add(cc->cc_sqecount, &rdma->sc_sq_avail);
413 wake_up(&rdma->sc_send_wait);
475 struct svcxprt_rdma *rdma = info->wi_rdma;
491 ctxt = svc_rdma_get_rw_ctxt(rdma,
498 ret = svc_rdma_rw_ctx_init(rdma, ctxt, offset, seg->rs_handle,
532 * %-EIO if an rdma-rw error occurred
553 * %-EIO if an rdma-rw error occurred
575 * %-EIO if an rdma-rw error occurred
604 static int svc_rdma_send_write_chunk(struct svcxprt_rdma *rdma,
617 info = svc_rdma_write_info_alloc(rdma, chunk);
627 ret = svc_rdma_post_chunk_ctxt(rdma, cc);
639 * @rdma: controlling RDMA transport
646 int svc_rdma_send_write_list(struct svcxprt_rdma *rdma,
656 ret = svc_rdma_send_write_chunk(rdma, chunk, xdr);
665 * @rdma: controlling RDMA transport
678 int svc_rdma_prepare_reply_chunk(struct svcxprt_rdma *rdma,
691 info->wi_rdma = rdma;
708 first_wr = rdma_rw_ctx_wrs(&rwc->rw_ctx, rdma->sc_qp,
709 rdma->sc_port_num, cqe, first_wr);
735 struct svcxprt_rdma *rdma = svc_rdma_rqst_rdma(rqstp);
744 ctxt = svc_rdma_get_rw_ctxt(rdma, sge_no);
772 ret = svc_rdma_rw_ctx_init(rdma, ctxt, segment->rs_offset,
1094 * @rdma: controlling RDMA transport
1115 int svc_rdma_process_read_list(struct svcxprt_rdma *rdma,
1140 ret = svc_rdma_post_chunk_ctxt(rdma, cc);