Lines Matching refs:rep
83 static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep);
184 struct rpcrdma_rep *rep = container_of(cqe, struct rpcrdma_rep, in rpcrdma_wc_receive() local
195 rpcrdma_set_xdrlen(&rep->rr_hdrbuf, wc->byte_len); in rpcrdma_wc_receive()
196 rep->rr_wc_flags = wc->wc_flags; in rpcrdma_wc_receive()
197 rep->rr_inv_rkey = wc->ex.invalidate_rkey; in rpcrdma_wc_receive()
199 ib_dma_sync_single_for_cpu(rdmab_device(rep->rr_rdmabuf), in rpcrdma_wc_receive()
200 rdmab_addr(rep->rr_rdmabuf), in rpcrdma_wc_receive()
203 rpcrdma_reply_handler(rep); in rpcrdma_wc_receive()
208 rpcrdma_rep_destroy(rep); in rpcrdma_wc_receive()
961 struct rpcrdma_rep *rep; in rpcrdma_rep_create() local
963 rep = kzalloc(sizeof(*rep), GFP_KERNEL); in rpcrdma_rep_create()
964 if (rep == NULL) in rpcrdma_rep_create()
967 rep->rr_rdmabuf = rpcrdma_regbuf_alloc(r_xprt->rx_ep->re_inline_recv, in rpcrdma_rep_create()
969 if (!rep->rr_rdmabuf) in rpcrdma_rep_create()
972 if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf)) in rpcrdma_rep_create()
975 xdr_buf_init(&rep->rr_hdrbuf, rdmab_data(rep->rr_rdmabuf), in rpcrdma_rep_create()
976 rdmab_length(rep->rr_rdmabuf)); in rpcrdma_rep_create()
977 rep->rr_cqe.done = rpcrdma_wc_receive; in rpcrdma_rep_create()
978 rep->rr_rxprt = r_xprt; in rpcrdma_rep_create()
979 rep->rr_recv_wr.next = NULL; in rpcrdma_rep_create()
980 rep->rr_recv_wr.wr_cqe = &rep->rr_cqe; in rpcrdma_rep_create()
981 rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov; in rpcrdma_rep_create()
982 rep->rr_recv_wr.num_sge = 1; in rpcrdma_rep_create()
983 rep->rr_temp = temp; in rpcrdma_rep_create()
984 list_add(&rep->rr_all, &r_xprt->rx_buf.rb_all_reps); in rpcrdma_rep_create()
985 return rep; in rpcrdma_rep_create()
988 rpcrdma_regbuf_free(rep->rr_rdmabuf); in rpcrdma_rep_create()
990 kfree(rep); in rpcrdma_rep_create()
998 static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep) in rpcrdma_rep_destroy() argument
1000 list_del(&rep->rr_all); in rpcrdma_rep_destroy()
1001 rpcrdma_regbuf_free(rep->rr_rdmabuf); in rpcrdma_rep_destroy()
1002 kfree(rep); in rpcrdma_rep_destroy()
1017 struct rpcrdma_rep *rep) in rpcrdma_rep_put() argument
1019 llist_add(&rep->rr_node, &buf->rb_free_reps); in rpcrdma_rep_put()
1025 struct rpcrdma_rep *rep; in rpcrdma_reps_unmap() local
1027 list_for_each_entry(rep, &buf->rb_all_reps, rr_all) { in rpcrdma_reps_unmap()
1028 rpcrdma_regbuf_dma_unmap(rep->rr_rdmabuf); in rpcrdma_reps_unmap()
1029 rep->rr_temp = true; in rpcrdma_reps_unmap()
1035 struct rpcrdma_rep *rep; in rpcrdma_reps_destroy() local
1037 while ((rep = rpcrdma_rep_get_locked(buf)) != NULL) in rpcrdma_reps_destroy()
1038 rpcrdma_rep_destroy(rep); in rpcrdma_reps_destroy()
1243 void rpcrdma_recv_buffer_put(struct rpcrdma_rep *rep) in rpcrdma_recv_buffer_put() argument
1245 rpcrdma_rep_put(&rep->rr_rxprt->rx_buf, rep); in rpcrdma_recv_buffer_put()
1388 struct rpcrdma_rep *rep; in rpcrdma_post_recvs() local
1404 rep = rpcrdma_rep_get_locked(buf); in rpcrdma_post_recvs()
1405 if (rep && rep->rr_temp) { in rpcrdma_post_recvs()
1406 rpcrdma_rep_destroy(rep); in rpcrdma_post_recvs()
1409 if (!rep) in rpcrdma_post_recvs()
1410 rep = rpcrdma_rep_create(r_xprt, temp); in rpcrdma_post_recvs()
1411 if (!rep) in rpcrdma_post_recvs()
1414 trace_xprtrdma_post_recv(rep); in rpcrdma_post_recvs()
1415 rep->rr_recv_wr.next = wr; in rpcrdma_post_recvs()
1416 wr = &rep->rr_recv_wr; in rpcrdma_post_recvs()
1429 struct rpcrdma_rep *rep; in rpcrdma_post_recvs() local
1431 rep = container_of(wr, struct rpcrdma_rep, rr_recv_wr); in rpcrdma_post_recvs()
1433 rpcrdma_recv_buffer_put(rep); in rpcrdma_post_recvs()