Commit 018f3405 authored by Chuck Lever's avatar Chuck Lever

svcrdma: Move the svc_rdma_cc_init() call

Now that the chunk_ctxt for Reads is no longer dynamically allocated
it can be initialized once for the life of the object that contains
it (struct svc_rdma_recv_ctxt).
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 57666bbb
...@@ -211,6 +211,8 @@ extern int svc_rdma_recvfrom(struct svc_rqst *); ...@@ -211,6 +211,8 @@ extern int svc_rdma_recvfrom(struct svc_rqst *);
/* svc_rdma_rw.c */ /* svc_rdma_rw.c */
extern void svc_rdma_destroy_rw_ctxts(struct svcxprt_rdma *rdma); extern void svc_rdma_destroy_rw_ctxts(struct svcxprt_rdma *rdma);
extern void svc_rdma_cc_init(struct svcxprt_rdma *rdma,
struct svc_rdma_chunk_ctxt *cc);
extern int svc_rdma_send_write_chunk(struct svcxprt_rdma *rdma, extern int svc_rdma_send_write_chunk(struct svcxprt_rdma *rdma,
const struct svc_rdma_chunk *chunk, const struct svc_rdma_chunk *chunk,
const struct xdr_buf *xdr); const struct xdr_buf *xdr);
......
...@@ -156,6 +156,7 @@ svc_rdma_recv_ctxt_alloc(struct svcxprt_rdma *rdma) ...@@ -156,6 +156,7 @@ svc_rdma_recv_ctxt_alloc(struct svcxprt_rdma *rdma)
ctxt->rc_recv_sge.length = rdma->sc_max_req_size; ctxt->rc_recv_sge.length = rdma->sc_max_req_size;
ctxt->rc_recv_sge.lkey = rdma->sc_pd->local_dma_lkey; ctxt->rc_recv_sge.lkey = rdma->sc_pd->local_dma_lkey;
ctxt->rc_recv_buf = buffer; ctxt->rc_recv_buf = buffer;
svc_rdma_cc_init(rdma, &ctxt->rc_cc);
return ctxt; return ctxt;
fail2: fail2:
......
...@@ -153,7 +153,12 @@ static void svc_rdma_cc_cid_init(struct svcxprt_rdma *rdma, ...@@ -153,7 +153,12 @@ static void svc_rdma_cc_cid_init(struct svcxprt_rdma *rdma,
cid->ci_completion_id = atomic_inc_return(&rdma->sc_completion_ids); cid->ci_completion_id = atomic_inc_return(&rdma->sc_completion_ids);
} }
static void svc_rdma_cc_init(struct svcxprt_rdma *rdma, /**
* svc_rdma_cc_init - Initialize an svc_rdma_chunk_ctxt
* @rdma: controlling transport instance
* @cc: svc_rdma_chunk_ctxt to be initialized
*/
void svc_rdma_cc_init(struct svcxprt_rdma *rdma,
struct svc_rdma_chunk_ctxt *cc) struct svc_rdma_chunk_ctxt *cc)
{ {
svc_rdma_cc_cid_init(rdma, &cc->cc_cid); svc_rdma_cc_cid_init(rdma, &cc->cc_cid);
...@@ -1101,8 +1106,8 @@ int svc_rdma_process_read_list(struct svcxprt_rdma *rdma, ...@@ -1101,8 +1106,8 @@ int svc_rdma_process_read_list(struct svcxprt_rdma *rdma,
struct svc_rdma_chunk_ctxt *cc = &head->rc_cc; struct svc_rdma_chunk_ctxt *cc = &head->rc_cc;
int ret; int ret;
svc_rdma_cc_init(rdma, cc);
cc->cc_cqe.done = svc_rdma_wc_read_done; cc->cc_cqe.done = svc_rdma_wc_read_done;
cc->cc_sqecount = 0;
head->rc_pageoff = 0; head->rc_pageoff = 0;
head->rc_curpage = 0; head->rc_curpage = 0;
head->rc_readbytes = 0; head->rc_readbytes = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment