Skip to content

Commit 97d0de8

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Clean up the post_send path
Clean up: Simplify the synopses of functions in the post_send path by combining the struct rpcrdma_ia and struct rpcrdma_ep arguments. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 253a516 commit 97d0de8

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

net/sunrpc/xprtrdma/backchannel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ int xprt_rdma_bc_send_reply(struct rpc_rqst *rqst)
115115
if (rc < 0)
116116
goto failed_marshal;
117117

118-
if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
118+
if (rpcrdma_post_sends(r_xprt, req))
119119
goto drop_connection;
120120
return 0;
121121

net/sunrpc/xprtrdma/frwr_ops.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,18 +374,22 @@ static void frwr_wc_fastreg(struct ib_cq *cq, struct ib_wc *wc)
374374
}
375375

376376
/**
377-
* frwr_send - post Send WR containing the RPC Call message
378-
* @ia: interface adapter
379-
* @req: Prepared RPC Call
377+
* frwr_send - post Send WRs containing the RPC Call message
378+
* @r_xprt: controlling transport instance
379+
* @req: prepared RPC Call
380380
*
381381
* For FRWR, chain any FastReg WRs to the Send WR. Only a
382382
* single ib_post_send call is needed to register memory
383383
* and then post the Send WR.
384384
*
385-
* Returns the result of ib_post_send.
385+
* Returns the return code from ib_post_send.
386+
*
387+
* Caller must hold the transport send lock to ensure that the
388+
* pointers to the transport's rdma_cm_id and QP are stable.
386389
*/
387-
int frwr_send(struct rpcrdma_ia *ia, struct rpcrdma_req *req)
390+
int frwr_send(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
388391
{
392+
struct rpcrdma_ia *ia = &r_xprt->rx_ia;
389393
struct ib_send_wr *post_wr;
390394
struct rpcrdma_mr *mr;
391395

net/sunrpc/xprtrdma/transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ xprt_rdma_send_request(struct rpc_rqst *rqst)
688688
goto drop_connection;
689689
rqst->rq_xtime = ktime_get();
690690

691-
if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
691+
if (rpcrdma_post_sends(r_xprt, req))
692692
goto drop_connection;
693693

694694
rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len;

net/sunrpc/xprtrdma/verbs.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,20 +1461,17 @@ static void rpcrdma_regbuf_free(struct rpcrdma_regbuf *rb)
14611461
}
14621462

14631463
/**
1464-
* rpcrdma_ep_post - Post WRs to a transport's Send Queue
1465-
* @ia: transport's device information
1466-
* @ep: transport's RDMA endpoint information
1464+
* rpcrdma_post_sends - Post WRs to a transport's Send Queue
1465+
* @r_xprt: controlling transport instance
14671466
* @req: rpcrdma_req containing the Send WR to post
14681467
*
14691468
* Returns 0 if the post was successful, otherwise -ENOTCONN
14701469
* is returned.
14711470
*/
1472-
int
1473-
rpcrdma_ep_post(struct rpcrdma_ia *ia,
1474-
struct rpcrdma_ep *ep,
1475-
struct rpcrdma_req *req)
1471+
int rpcrdma_post_sends(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
14761472
{
14771473
struct ib_send_wr *send_wr = &req->rl_wr;
1474+
struct rpcrdma_ep *ep = &r_xprt->rx_ep;
14781475
int rc;
14791476

14801477
if (!ep->rep_send_count || kref_read(&req->rl_kref) > 1) {
@@ -1485,7 +1482,7 @@ rpcrdma_ep_post(struct rpcrdma_ia *ia,
14851482
--ep->rep_send_count;
14861483
}
14871484

1488-
rc = frwr_send(ia, req);
1485+
rc = frwr_send(r_xprt, req);
14891486
trace_xprtrdma_post_send(req, rc);
14901487
if (rc)
14911488
return -ENOTCONN;

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ void rpcrdma_ia_close(struct rpcrdma_ia *);
467467
int rpcrdma_ep_connect(struct rpcrdma_ep *, struct rpcrdma_ia *);
468468
void rpcrdma_ep_disconnect(struct rpcrdma_ep *, struct rpcrdma_ia *);
469469

470-
int rpcrdma_ep_post(struct rpcrdma_ia *, struct rpcrdma_ep *,
471-
struct rpcrdma_req *);
470+
int rpcrdma_post_sends(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req);
472471
void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, bool temp);
473472

474473
/*
@@ -542,7 +541,7 @@ struct rpcrdma_mr_seg *frwr_map(struct rpcrdma_xprt *r_xprt,
542541
struct rpcrdma_mr_seg *seg,
543542
int nsegs, bool writing, __be32 xid,
544543
struct rpcrdma_mr *mr);
545-
int frwr_send(struct rpcrdma_ia *ia, struct rpcrdma_req *req);
544+
int frwr_send(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req);
546545
void frwr_reminv(struct rpcrdma_rep *rep, struct list_head *mrs);
547546
void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req);
548547
void frwr_unmap_async(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req);

0 commit comments

Comments
 (0)