Lines Matching refs:rep

72 static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep);
162 struct rpcrdma_rep *rep = container_of(cqe, struct rpcrdma_rep,
167 trace_xprtrdma_wc_receive(wc, &rep->rr_cid);
173 rpcrdma_set_xdrlen(&rep->rr_hdrbuf, wc->byte_len);
174 rep->rr_wc_flags = wc->wc_flags;
175 rep->rr_inv_rkey = wc->ex.invalidate_rkey;
177 ib_dma_sync_single_for_cpu(rdmab_device(rep->rr_rdmabuf),
178 rdmab_addr(rep->rr_rdmabuf),
181 rpcrdma_reply_handler(rep);
186 rpcrdma_rep_put(&r_xprt->rx_buf, rep);
927 struct rpcrdma_rep *rep;
929 rep = kzalloc(sizeof(*rep), XPRTRDMA_GFP_FLAGS);
930 if (rep == NULL)
933 rep->rr_rdmabuf = rpcrdma_regbuf_alloc(r_xprt->rx_ep->re_inline_recv,
935 if (!rep->rr_rdmabuf)
938 rep->rr_cid.ci_completion_id =
941 xdr_buf_init(&rep->rr_hdrbuf, rdmab_data(rep->rr_rdmabuf),
942 rdmab_length(rep->rr_rdmabuf));
943 rep->rr_cqe.done = rpcrdma_wc_receive;
944 rep->rr_rxprt = r_xprt;
945 rep->rr_recv_wr.next = NULL;
946 rep->rr_recv_wr.wr_cqe = &rep->rr_cqe;
947 rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov;
948 rep->rr_recv_wr.num_sge = 1;
949 rep->rr_temp = temp;
952 list_add(&rep->rr_all, &buf->rb_all_reps);
954 return rep;
957 kfree(rep);
962 static void rpcrdma_rep_free(struct rpcrdma_rep *rep)
964 rpcrdma_regbuf_free(rep->rr_rdmabuf);
965 kfree(rep);
968 static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep)
970 struct rpcrdma_buffer *buf = &rep->rr_rxprt->rx_buf;
973 list_del(&rep->rr_all);
976 rpcrdma_rep_free(rep);
993 * @rep: rep to release
996 void rpcrdma_rep_put(struct rpcrdma_buffer *buf, struct rpcrdma_rep *rep)
998 llist_add(&rep->rr_node, &buf->rb_free_reps);
1008 struct rpcrdma_rep *rep;
1010 list_for_each_entry(rep, &buf->rb_all_reps, rr_all) {
1011 rpcrdma_regbuf_dma_unmap(rep->rr_rdmabuf);
1012 rep->rr_temp = true; /* Mark this rep for destruction */
1018 struct rpcrdma_rep *rep;
1021 while ((rep = list_first_entry_or_null(&buf->rb_all_reps,
1024 list_del(&rep->rr_all);
1027 rpcrdma_rep_free(rep);
1035 * rpcrdma_buffer_create - Create initial set of req/rep objects
1334 struct rpcrdma_rep *rep;
1352 rep = rpcrdma_rep_get_locked(buf);
1353 if (rep && rep->rr_temp) {
1354 rpcrdma_rep_destroy(rep);
1357 if (!rep)
1358 rep = rpcrdma_rep_create(r_xprt, temp);
1359 if (!rep)
1361 if (!rpcrdma_regbuf_dma_map(r_xprt, rep->rr_rdmabuf)) {
1362 rpcrdma_rep_put(buf, rep);
1366 rep->rr_cid.ci_queue_id = ep->re_attr.recv_cq->res.id;
1367 trace_xprtrdma_post_recv(&rep->rr_cid);
1368 rep->rr_recv_wr.next = wr;
1369 wr = &rep->rr_recv_wr;
1381 struct rpcrdma_rep *rep;
1383 rep = container_of(wr, struct rpcrdma_rep, rr_recv_wr);
1385 rpcrdma_rep_put(buf, rep);