aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-05-07 15:28:15 -0400
committerJ. Bruce Fields <bfields@redhat.com>2018-05-11 15:48:57 -0400
commit986b78894b268f605e9ea055b99959bdce0e5945 (patch)
treefae8bb05a2a7a9091ac7d7e08aee7a1b417e4c79
parent25fd86eca11c26bad2aede6dd4709ff58f89c7cb (diff)
svcrdma: Remove post_send_wr
Clean up: Now that the send_wr is part of the svc_rdma_send_ctxt, svc_rdma_post_send_wr is nearly empty. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--include/linux/sunrpc/svc_rdma.h3
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_backchannel.c3
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_recvfrom.c3
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_sendto.c47
4 files changed, 16 insertions, 40 deletions
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index bfb8824e31e1..a8bfc214614b 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -202,9 +202,6 @@ extern int svc_rdma_send(struct svcxprt_rdma *rdma, struct ib_send_wr *wr);
202extern int svc_rdma_map_reply_hdr(struct svcxprt_rdma *rdma, 202extern int svc_rdma_map_reply_hdr(struct svcxprt_rdma *rdma,
203 struct svc_rdma_send_ctxt *ctxt, 203 struct svc_rdma_send_ctxt *ctxt,
204 __be32 *rdma_resp, unsigned int len); 204 __be32 *rdma_resp, unsigned int len);
205extern int svc_rdma_post_send_wr(struct svcxprt_rdma *rdma,
206 struct svc_rdma_send_ctxt *ctxt,
207 u32 inv_rkey);
208extern int svc_rdma_sendto(struct svc_rqst *); 205extern int svc_rdma_sendto(struct svc_rqst *);
209 206
210/* svc_rdma_transport.c */ 207/* svc_rdma_transport.c */
diff --git a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
index 95e33511cc6f..40f5e4afbcc8 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c
@@ -139,7 +139,8 @@ static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma,
139 * the rq_buffer before all retransmits are complete. 139 * the rq_buffer before all retransmits are complete.
140 */ 140 */
141 get_page(virt_to_page(rqst->rq_buffer)); 141 get_page(virt_to_page(rqst->rq_buffer));
142 ret = svc_rdma_post_send_wr(rdma, ctxt, 0); 142 ctxt->sc_send_wr.opcode = IB_WR_SEND;
143 ret = svc_rdma_send(rdma, &ctxt->sc_send_wr);
143 if (ret) 144 if (ret)
144 goto out_unmap; 145 goto out_unmap;
145 146
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
index 2d1e0db4c869..68648e6c5be2 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
@@ -642,7 +642,8 @@ static void svc_rdma_send_error(struct svcxprt_rdma *xprt,
642 return; 642 return;
643 } 643 }
644 644
645 ret = svc_rdma_post_send_wr(xprt, ctxt, 0); 645 ctxt->sc_send_wr.opcode = IB_WR_SEND;
646 ret = svc_rdma_send(xprt, &ctxt->sc_send_wr);
646 if (ret) 647 if (ret)
647 svc_rdma_send_ctxt_put(xprt, ctxt); 648 svc_rdma_send_ctxt_put(xprt, ctxt);
648} 649}
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 53d8db6bfaf2..0ebdc0c76483 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -630,35 +630,6 @@ static void svc_rdma_save_io_pages(struct svc_rqst *rqstp,
630 rqstp->rq_next_page = rqstp->rq_respages + 1; 630 rqstp->rq_next_page = rqstp->rq_respages + 1;
631} 631}
632 632
633/**
634 * svc_rdma_post_send_wr - Set up and post one Send Work Request
635 * @rdma: controlling transport
636 * @ctxt: op_ctxt for transmitting the Send WR
637 * @inv_rkey: R_key argument to Send With Invalidate, or zero
638 *
639 * Returns:
640 * %0 if the Send* was posted successfully,
641 * %-ENOTCONN if the connection was lost or dropped,
642 * %-EINVAL if there was a problem with the Send we built,
643 * %-ENOMEM if ib_post_send failed.
644 */
645int svc_rdma_post_send_wr(struct svcxprt_rdma *rdma,
646 struct svc_rdma_send_ctxt *ctxt,
647 u32 inv_rkey)
648{
649 dprintk("svcrdma: posting Send WR with %u sge(s)\n",
650 ctxt->sc_send_wr.num_sge);
651
652 if (inv_rkey) {
653 ctxt->sc_send_wr.opcode = IB_WR_SEND_WITH_INV;
654 ctxt->sc_send_wr.ex.invalidate_rkey = inv_rkey;
655 } else {
656 ctxt->sc_send_wr.opcode = IB_WR_SEND;
657 }
658
659 return svc_rdma_send(rdma, &ctxt->sc_send_wr);
660}
661
662/* Prepare the portion of the RPC Reply that will be transmitted 633/* Prepare the portion of the RPC Reply that will be transmitted
663 * via RDMA Send. The RPC-over-RDMA transport header is prepared 634 * via RDMA Send. The RPC-over-RDMA transport header is prepared
664 * in sc_sges[0], and the RPC xdr_buf is prepared in following sges. 635 * in sc_sges[0], and the RPC xdr_buf is prepared in following sges.
@@ -683,7 +654,6 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma,
683 __be32 *wr_lst, __be32 *rp_ch) 654 __be32 *wr_lst, __be32 *rp_ch)
684{ 655{
685 struct svc_rdma_send_ctxt *ctxt; 656 struct svc_rdma_send_ctxt *ctxt;
686 u32 inv_rkey;
687 int ret; 657 int ret;
688 658
689 ctxt = svc_rdma_send_ctxt_get(rdma); 659 ctxt = svc_rdma_send_ctxt_get(rdma);
@@ -704,10 +674,16 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma,
704 674
705 svc_rdma_save_io_pages(rqstp, ctxt); 675 svc_rdma_save_io_pages(rqstp, ctxt);
706 676
707 inv_rkey = 0; 677 ctxt->sc_send_wr.opcode = IB_WR_SEND;
708 if (rdma->sc_snd_w_inv) 678 if (rdma->sc_snd_w_inv) {
709 inv_rkey = svc_rdma_get_inv_rkey(rdma_argp, wr_lst, rp_ch); 679 ctxt->sc_send_wr.ex.invalidate_rkey =
710 ret = svc_rdma_post_send_wr(rdma, ctxt, inv_rkey); 680 svc_rdma_get_inv_rkey(rdma_argp, wr_lst, rp_ch);
681 if (ctxt->sc_send_wr.ex.invalidate_rkey)
682 ctxt->sc_send_wr.opcode = IB_WR_SEND_WITH_INV;
683 }
684 dprintk("svcrdma: posting Send WR with %u sge(s)\n",
685 ctxt->sc_send_wr.num_sge);
686 ret = svc_rdma_send(rdma, &ctxt->sc_send_wr);
711 if (ret) 687 if (ret)
712 goto err; 688 goto err;
713 689
@@ -750,7 +726,8 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
750 726
751 svc_rdma_save_io_pages(rqstp, ctxt); 727 svc_rdma_save_io_pages(rqstp, ctxt);
752 728
753 ret = svc_rdma_post_send_wr(rdma, ctxt, 0); 729 ctxt->sc_send_wr.opcode = IB_WR_SEND;
730 ret = svc_rdma_send(rdma, &ctxt->sc_send_wr);
754 if (ret) 731 if (ret)
755 goto err; 732 goto err;
756 733