xref: /linux/net/sunrpc/xprtrdma/backchannel.c (revision b6e717cbf28c8348d34be472f119b0ea82e5e8e7)
1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
2f531a5dbSChuck Lever /*
3f531a5dbSChuck Lever  * Copyright (c) 2015 Oracle.  All rights reserved.
4f531a5dbSChuck Lever  *
5f531a5dbSChuck Lever  * Support for backward direction RPCs on RPC/RDMA.
6f531a5dbSChuck Lever  */
7f531a5dbSChuck Lever 
8f531a5dbSChuck Lever #include <linux/module.h>
963cae470SChuck Lever #include <linux/sunrpc/xprt.h>
1063cae470SChuck Lever #include <linux/sunrpc/svc.h>
1176566773SChuck Lever #include <linux/sunrpc/svc_xprt.h>
12f531a5dbSChuck Lever 
13f531a5dbSChuck Lever #include "xprt_rdma.h"
14*b6e717cbSChuck Lever #include <trace/events/rpcrdma.h>
15f531a5dbSChuck Lever 
16f531a5dbSChuck Lever #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
17f531a5dbSChuck Lever # define RPCDBG_FACILITY	RPCDBG_TRANS
18f531a5dbSChuck Lever #endif
19f531a5dbSChuck Lever 
20c8bbe0c7SChuck Lever #undef RPCRDMA_BACKCHANNEL_DEBUG
2163cae470SChuck Lever 
22f531a5dbSChuck Lever static void rpcrdma_bc_free_rqst(struct rpcrdma_xprt *r_xprt,
23f531a5dbSChuck Lever 				 struct rpc_rqst *rqst)
24f531a5dbSChuck Lever {
25f531a5dbSChuck Lever 	struct rpcrdma_buffer *buf = &r_xprt->rx_buf;
26f531a5dbSChuck Lever 	struct rpcrdma_req *req = rpcr_to_rdmar(rqst);
27f531a5dbSChuck Lever 
28f531a5dbSChuck Lever 	spin_lock(&buf->rb_reqslock);
29f531a5dbSChuck Lever 	list_del(&req->rl_all);
30f531a5dbSChuck Lever 	spin_unlock(&buf->rb_reqslock);
31f531a5dbSChuck Lever 
3213650c23SChuck Lever 	rpcrdma_destroy_req(req);
33f531a5dbSChuck Lever 
34f531a5dbSChuck Lever 	kfree(rqst);
35f531a5dbSChuck Lever }
36f531a5dbSChuck Lever 
37f531a5dbSChuck Lever static int rpcrdma_bc_setup_rqst(struct rpcrdma_xprt *r_xprt,
38f531a5dbSChuck Lever 				 struct rpc_rqst *rqst)
39f531a5dbSChuck Lever {
40f531a5dbSChuck Lever 	struct rpcrdma_regbuf *rb;
41f531a5dbSChuck Lever 	struct rpcrdma_req *req;
42f531a5dbSChuck Lever 	size_t size;
43f531a5dbSChuck Lever 
44f531a5dbSChuck Lever 	req = rpcrdma_create_req(r_xprt);
45abfb6897SDan Carpenter 	if (IS_ERR(req))
46abfb6897SDan Carpenter 		return PTR_ERR(req);
47f531a5dbSChuck Lever 
4808cf2efdSChuck Lever 	size = r_xprt->rx_data.inline_rsize;
4913650c23SChuck Lever 	rb = rpcrdma_alloc_regbuf(size, DMA_TO_DEVICE, GFP_KERNEL);
50f531a5dbSChuck Lever 	if (IS_ERR(rb))
51f531a5dbSChuck Lever 		goto out_fail;
52f531a5dbSChuck Lever 	req->rl_sendbuf = rb;
5362aee0e3SChuck Lever 	xdr_buf_init(&rqst->rq_snd_buf, rb->rg_base,
5462aee0e3SChuck Lever 		     min_t(size_t, size, PAGE_SIZE));
555a6d1db4SChuck Lever 	rpcrdma_set_xprtdata(rqst, req);
56f531a5dbSChuck Lever 	return 0;
57f531a5dbSChuck Lever 
58f531a5dbSChuck Lever out_fail:
59f531a5dbSChuck Lever 	rpcrdma_bc_free_rqst(r_xprt, rqst);
60f531a5dbSChuck Lever 	return -ENOMEM;
61f531a5dbSChuck Lever }
62f531a5dbSChuck Lever 
63f531a5dbSChuck Lever /* Allocate and add receive buffers to the rpcrdma_buffer's
64f531a5dbSChuck Lever  * existing list of rep's. These are released when the
65f531a5dbSChuck Lever  * transport is destroyed.
66f531a5dbSChuck Lever  */
67f531a5dbSChuck Lever static int rpcrdma_bc_setup_reps(struct rpcrdma_xprt *r_xprt,
68f531a5dbSChuck Lever 				 unsigned int count)
69f531a5dbSChuck Lever {
70f531a5dbSChuck Lever 	int rc = 0;
71f531a5dbSChuck Lever 
72f531a5dbSChuck Lever 	while (count--) {
73d698c4a0SChuck Lever 		rc = rpcrdma_create_rep(r_xprt);
74d698c4a0SChuck Lever 		if (rc)
75f531a5dbSChuck Lever 			break;
76f531a5dbSChuck Lever 	}
77f531a5dbSChuck Lever 	return rc;
78f531a5dbSChuck Lever }
79f531a5dbSChuck Lever 
80f531a5dbSChuck Lever /**
81f531a5dbSChuck Lever  * xprt_rdma_bc_setup - Pre-allocate resources for handling backchannel requests
82f531a5dbSChuck Lever  * @xprt: transport associated with these backchannel resources
83f531a5dbSChuck Lever  * @reqs: number of concurrent incoming requests to expect
84f531a5dbSChuck Lever  *
85f531a5dbSChuck Lever  * Returns 0 on success; otherwise a negative errno
86f531a5dbSChuck Lever  */
87f531a5dbSChuck Lever int xprt_rdma_bc_setup(struct rpc_xprt *xprt, unsigned int reqs)
88f531a5dbSChuck Lever {
89f531a5dbSChuck Lever 	struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
90f531a5dbSChuck Lever 	struct rpcrdma_buffer *buffer = &r_xprt->rx_buf;
91f531a5dbSChuck Lever 	struct rpc_rqst *rqst;
92f531a5dbSChuck Lever 	unsigned int i;
93f531a5dbSChuck Lever 	int rc;
94f531a5dbSChuck Lever 
95f531a5dbSChuck Lever 	/* The backchannel reply path returns each rpc_rqst to the
96f531a5dbSChuck Lever 	 * bc_pa_list _after_ the reply is sent. If the server is
97f531a5dbSChuck Lever 	 * faster than the client, it can send another backward
98f531a5dbSChuck Lever 	 * direction request before the rpc_rqst is returned to the
99f531a5dbSChuck Lever 	 * list. The client rejects the request in this case.
100f531a5dbSChuck Lever 	 *
101f531a5dbSChuck Lever 	 * Twice as many rpc_rqsts are prepared to ensure there is
102f531a5dbSChuck Lever 	 * always an rpc_rqst available as soon as a reply is sent.
103f531a5dbSChuck Lever 	 */
104124fa17dSChuck Lever 	if (reqs > RPCRDMA_BACKWARD_WRS >> 1)
105124fa17dSChuck Lever 		goto out_err;
106124fa17dSChuck Lever 
107f531a5dbSChuck Lever 	for (i = 0; i < (reqs << 1); i++) {
108f531a5dbSChuck Lever 		rqst = kzalloc(sizeof(*rqst), GFP_KERNEL);
109d2c23c00SMarkus Elfring 		if (!rqst)
110f531a5dbSChuck Lever 			goto out_free;
111d2c23c00SMarkus Elfring 
112c8bbe0c7SChuck Lever 		dprintk("RPC:       %s: new rqst %p\n", __func__, rqst);
113f531a5dbSChuck Lever 
114f531a5dbSChuck Lever 		rqst->rq_xprt = &r_xprt->rx_xprt;
115f531a5dbSChuck Lever 		INIT_LIST_HEAD(&rqst->rq_list);
116f531a5dbSChuck Lever 		INIT_LIST_HEAD(&rqst->rq_bc_list);
11730b5416bSChuck Lever 		__set_bit(RPC_BC_PA_IN_USE, &rqst->rq_bc_pa_state);
118f531a5dbSChuck Lever 
119f531a5dbSChuck Lever 		if (rpcrdma_bc_setup_rqst(r_xprt, rqst))
120f531a5dbSChuck Lever 			goto out_free;
121f531a5dbSChuck Lever 
122f531a5dbSChuck Lever 		spin_lock_bh(&xprt->bc_pa_lock);
123f531a5dbSChuck Lever 		list_add(&rqst->rq_bc_pa_list, &xprt->bc_pa_list);
124f531a5dbSChuck Lever 		spin_unlock_bh(&xprt->bc_pa_lock);
125f531a5dbSChuck Lever 	}
126f531a5dbSChuck Lever 
127f531a5dbSChuck Lever 	rc = rpcrdma_bc_setup_reps(r_xprt, reqs);
128f531a5dbSChuck Lever 	if (rc)
129f531a5dbSChuck Lever 		goto out_free;
130f531a5dbSChuck Lever 
131f531a5dbSChuck Lever 	rc = rpcrdma_ep_post_extra_recv(r_xprt, reqs);
132f531a5dbSChuck Lever 	if (rc)
133f531a5dbSChuck Lever 		goto out_free;
134f531a5dbSChuck Lever 
135f531a5dbSChuck Lever 	buffer->rb_bc_srv_max_requests = reqs;
136f531a5dbSChuck Lever 	request_module("svcrdma");
137fc1eb807SChuck Lever 	trace_xprtrdma_cb_setup(r_xprt, reqs);
138f531a5dbSChuck Lever 	return 0;
139f531a5dbSChuck Lever 
140f531a5dbSChuck Lever out_free:
141f531a5dbSChuck Lever 	xprt_rdma_bc_destroy(xprt, reqs);
142f531a5dbSChuck Lever 
143124fa17dSChuck Lever out_err:
144f531a5dbSChuck Lever 	pr_err("RPC:       %s: setup backchannel transport failed\n", __func__);
145f531a5dbSChuck Lever 	return -ENOMEM;
146f531a5dbSChuck Lever }
147f531a5dbSChuck Lever 
148f531a5dbSChuck Lever /**
14976566773SChuck Lever  * xprt_rdma_bc_up - Create transport endpoint for backchannel service
15076566773SChuck Lever  * @serv: server endpoint
15176566773SChuck Lever  * @net: network namespace
15276566773SChuck Lever  *
15376566773SChuck Lever  * The "xprt" is an implied argument: it supplies the name of the
15476566773SChuck Lever  * backchannel transport class.
15576566773SChuck Lever  *
15676566773SChuck Lever  * Returns zero on success, negative errno on failure
15776566773SChuck Lever  */
15876566773SChuck Lever int xprt_rdma_bc_up(struct svc_serv *serv, struct net *net)
15976566773SChuck Lever {
16076566773SChuck Lever 	int ret;
16176566773SChuck Lever 
16276566773SChuck Lever 	ret = svc_create_xprt(serv, "rdma-bc", net, PF_INET, 0, 0);
16376566773SChuck Lever 	if (ret < 0)
16476566773SChuck Lever 		return ret;
16576566773SChuck Lever 	return 0;
16676566773SChuck Lever }
16776566773SChuck Lever 
16876566773SChuck Lever /**
1696b26cc8cSChuck Lever  * xprt_rdma_bc_maxpayload - Return maximum backchannel message size
1706b26cc8cSChuck Lever  * @xprt: transport
1716b26cc8cSChuck Lever  *
1726b26cc8cSChuck Lever  * Returns maximum size, in bytes, of a backchannel message
1736b26cc8cSChuck Lever  */
1746b26cc8cSChuck Lever size_t xprt_rdma_bc_maxpayload(struct rpc_xprt *xprt)
1756b26cc8cSChuck Lever {
1766b26cc8cSChuck Lever 	struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
1776b26cc8cSChuck Lever 	struct rpcrdma_create_data_internal *cdata = &r_xprt->rx_data;
1786b26cc8cSChuck Lever 	size_t maxmsg;
1796b26cc8cSChuck Lever 
1806b26cc8cSChuck Lever 	maxmsg = min_t(unsigned int, cdata->inline_rsize, cdata->inline_wsize);
18162aee0e3SChuck Lever 	maxmsg = min_t(unsigned int, maxmsg, PAGE_SIZE);
1826b26cc8cSChuck Lever 	return maxmsg - RPCRDMA_HDRLEN_MIN;
1836b26cc8cSChuck Lever }
1846b26cc8cSChuck Lever 
185cf73daf5SChuck Lever static int rpcrdma_bc_marshal_reply(struct rpc_rqst *rqst)
18683128a60SChuck Lever {
1877ec910e7SChuck Lever 	struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(rqst->rq_xprt);
18883128a60SChuck Lever 	struct rpcrdma_req *req = rpcr_to_rdmar(rqst);
1897ec910e7SChuck Lever 	__be32 *p;
19083128a60SChuck Lever 
1917ec910e7SChuck Lever 	rpcrdma_set_xdrlen(&req->rl_hdrbuf, 0);
1927ec910e7SChuck Lever 	xdr_init_encode(&req->rl_stream, &req->rl_hdrbuf,
1937ec910e7SChuck Lever 			req->rl_rdmabuf->rg_base);
1947ec910e7SChuck Lever 
1957ec910e7SChuck Lever 	p = xdr_reserve_space(&req->rl_stream, 28);
1967ec910e7SChuck Lever 	if (unlikely(!p))
1977ec910e7SChuck Lever 		return -EIO;
1987ec910e7SChuck Lever 	*p++ = rqst->rq_xid;
1997ec910e7SChuck Lever 	*p++ = rpcrdma_version;
2007ec910e7SChuck Lever 	*p++ = cpu_to_be32(r_xprt->rx_buf.rb_bc_srv_max_requests);
2017ec910e7SChuck Lever 	*p++ = rdma_msg;
2027ec910e7SChuck Lever 	*p++ = xdr_zero;
2037ec910e7SChuck Lever 	*p++ = xdr_zero;
2047ec910e7SChuck Lever 	*p = xdr_zero;
20583128a60SChuck Lever 
206857f9acaSChuck Lever 	if (rpcrdma_prepare_send_sges(r_xprt, req, RPCRDMA_HDRLEN_MIN,
207655fec69SChuck Lever 				      &rqst->rq_snd_buf, rpcrdma_noch))
20854cbd6b0SChuck Lever 		return -EIO;
209fc1eb807SChuck Lever 
210fc1eb807SChuck Lever 	trace_xprtrdma_cb_reply(rqst);
211655fec69SChuck Lever 	return 0;
21283128a60SChuck Lever }
21383128a60SChuck Lever 
21483128a60SChuck Lever /**
215cf73daf5SChuck Lever  * xprt_rdma_bc_send_reply - marshal and send a backchannel reply
216cf73daf5SChuck Lever  * @rqst: RPC rqst with a backchannel RPC reply in rq_snd_buf
217cf73daf5SChuck Lever  *
218cf73daf5SChuck Lever  * Caller holds the transport's write lock.
219cf73daf5SChuck Lever  *
220cf73daf5SChuck Lever  * Returns:
221cf73daf5SChuck Lever  *	%0 if the RPC message has been sent
222cf73daf5SChuck Lever  *	%-ENOTCONN if the caller should reconnect and call again
223cf73daf5SChuck Lever  *	%-EIO if a permanent error occurred and the request was not
224cf73daf5SChuck Lever  *		sent. Do not try to send this message again.
225cf73daf5SChuck Lever  */
226cf73daf5SChuck Lever int xprt_rdma_bc_send_reply(struct rpc_rqst *rqst)
227cf73daf5SChuck Lever {
228cf73daf5SChuck Lever 	struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(rqst->rq_xprt);
229cf73daf5SChuck Lever 	struct rpcrdma_req *req = rpcr_to_rdmar(rqst);
230cf73daf5SChuck Lever 	int rc;
231cf73daf5SChuck Lever 
232cf73daf5SChuck Lever 	if (!xprt_connected(rqst->rq_xprt))
233cf73daf5SChuck Lever 		goto drop_connection;
234cf73daf5SChuck Lever 
235cf73daf5SChuck Lever 	rc = rpcrdma_bc_marshal_reply(rqst);
236cf73daf5SChuck Lever 	if (rc < 0)
237cf73daf5SChuck Lever 		goto failed_marshal;
238cf73daf5SChuck Lever 
239cf73daf5SChuck Lever 	if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
240cf73daf5SChuck Lever 		goto drop_connection;
241cf73daf5SChuck Lever 	return 0;
242cf73daf5SChuck Lever 
243cf73daf5SChuck Lever failed_marshal:
244cf73daf5SChuck Lever 	if (rc != -ENOTCONN)
245cf73daf5SChuck Lever 		return rc;
246cf73daf5SChuck Lever drop_connection:
247cf73daf5SChuck Lever 	xprt_disconnect_done(rqst->rq_xprt);
248cf73daf5SChuck Lever 	return -ENOTCONN;
249cf73daf5SChuck Lever }
250cf73daf5SChuck Lever 
251cf73daf5SChuck Lever /**
252f531a5dbSChuck Lever  * xprt_rdma_bc_destroy - Release resources for handling backchannel requests
253f531a5dbSChuck Lever  * @xprt: transport associated with these backchannel resources
254f531a5dbSChuck Lever  * @reqs: number of incoming requests to destroy; ignored
255f531a5dbSChuck Lever  */
256f531a5dbSChuck Lever void xprt_rdma_bc_destroy(struct rpc_xprt *xprt, unsigned int reqs)
257f531a5dbSChuck Lever {
258f531a5dbSChuck Lever 	struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
259f531a5dbSChuck Lever 	struct rpc_rqst *rqst, *tmp;
260f531a5dbSChuck Lever 
261f531a5dbSChuck Lever 	spin_lock_bh(&xprt->bc_pa_lock);
262f531a5dbSChuck Lever 	list_for_each_entry_safe(rqst, tmp, &xprt->bc_pa_list, rq_bc_pa_list) {
263f531a5dbSChuck Lever 		list_del(&rqst->rq_bc_pa_list);
264f531a5dbSChuck Lever 		spin_unlock_bh(&xprt->bc_pa_lock);
265f531a5dbSChuck Lever 
266f531a5dbSChuck Lever 		rpcrdma_bc_free_rqst(r_xprt, rqst);
267f531a5dbSChuck Lever 
268f531a5dbSChuck Lever 		spin_lock_bh(&xprt->bc_pa_lock);
269f531a5dbSChuck Lever 	}
270f531a5dbSChuck Lever 	spin_unlock_bh(&xprt->bc_pa_lock);
271f531a5dbSChuck Lever }
272f531a5dbSChuck Lever 
273f531a5dbSChuck Lever /**
274f531a5dbSChuck Lever  * xprt_rdma_bc_free_rqst - Release a backchannel rqst
275f531a5dbSChuck Lever  * @rqst: request to release
276f531a5dbSChuck Lever  */
277f531a5dbSChuck Lever void xprt_rdma_bc_free_rqst(struct rpc_rqst *rqst)
278f531a5dbSChuck Lever {
279f531a5dbSChuck Lever 	struct rpc_xprt *xprt = rqst->rq_xprt;
280f531a5dbSChuck Lever 
281c8bbe0c7SChuck Lever 	dprintk("RPC:       %s: freeing rqst %p (req %p)\n",
282c8bbe0c7SChuck Lever 		__func__, rqst, rpcr_to_rdmar(rqst));
283c8bbe0c7SChuck Lever 
284f531a5dbSChuck Lever 	spin_lock_bh(&xprt->bc_pa_lock);
285f531a5dbSChuck Lever 	list_add_tail(&rqst->rq_bc_pa_list, &xprt->bc_pa_list);
286f531a5dbSChuck Lever 	spin_unlock_bh(&xprt->bc_pa_lock);
287f531a5dbSChuck Lever }
28863cae470SChuck Lever 
28963cae470SChuck Lever /**
29063cae470SChuck Lever  * rpcrdma_bc_receive_call - Handle a backward direction call
2919ab6d89eSChuck Lever  * @r_xprt: transport receiving the call
29263cae470SChuck Lever  * @rep: receive buffer containing the call
29363cae470SChuck Lever  *
29463cae470SChuck Lever  * Operational assumptions:
29563cae470SChuck Lever  *    o Backchannel credits are ignored, just as the NFS server
29663cae470SChuck Lever  *      forechannel currently does
29763cae470SChuck Lever  *    o The ULP manages a replay cache (eg, NFSv4.1 sessions).
29863cae470SChuck Lever  *      No replay detection is done at the transport level
29963cae470SChuck Lever  */
30063cae470SChuck Lever void rpcrdma_bc_receive_call(struct rpcrdma_xprt *r_xprt,
30163cae470SChuck Lever 			     struct rpcrdma_rep *rep)
30263cae470SChuck Lever {
30363cae470SChuck Lever 	struct rpc_xprt *xprt = &r_xprt->rx_xprt;
30463cae470SChuck Lever 	struct svc_serv *bc_serv;
30563cae470SChuck Lever 	struct rpcrdma_req *req;
30663cae470SChuck Lever 	struct rpc_rqst *rqst;
30763cae470SChuck Lever 	struct xdr_buf *buf;
30863cae470SChuck Lever 	size_t size;
30963cae470SChuck Lever 	__be32 *p;
31063cae470SChuck Lever 
31141c8f70fSChuck Lever 	p = xdr_inline_decode(&rep->rr_stream, 0);
31241c8f70fSChuck Lever 	size = xdr_stream_remaining(&rep->rr_stream);
31341c8f70fSChuck Lever 
31463cae470SChuck Lever #ifdef RPCRDMA_BACKCHANNEL_DEBUG
31563cae470SChuck Lever 	pr_info("RPC:       %s: callback XID %08x, length=%u\n",
31641c8f70fSChuck Lever 		__func__, be32_to_cpup(p), size);
31741c8f70fSChuck Lever 	pr_info("RPC:       %s: %*ph\n", __func__, size, p);
31863cae470SChuck Lever #endif
31963cae470SChuck Lever 
32063cae470SChuck Lever 	/* Grab a free bc rqst */
32163cae470SChuck Lever 	spin_lock(&xprt->bc_pa_lock);
32263cae470SChuck Lever 	if (list_empty(&xprt->bc_pa_list)) {
32363cae470SChuck Lever 		spin_unlock(&xprt->bc_pa_lock);
32463cae470SChuck Lever 		goto out_overflow;
32563cae470SChuck Lever 	}
32663cae470SChuck Lever 	rqst = list_first_entry(&xprt->bc_pa_list,
32763cae470SChuck Lever 				struct rpc_rqst, rq_bc_pa_list);
32863cae470SChuck Lever 	list_del(&rqst->rq_bc_pa_list);
32963cae470SChuck Lever 	spin_unlock(&xprt->bc_pa_lock);
33063cae470SChuck Lever 
33163cae470SChuck Lever 	/* Prepare rqst */
33263cae470SChuck Lever 	rqst->rq_reply_bytes_recvd = 0;
33363cae470SChuck Lever 	rqst->rq_bytes_sent = 0;
33441c8f70fSChuck Lever 	rqst->rq_xid = *p;
3359f74660bSChuck Lever 
3369f74660bSChuck Lever 	rqst->rq_private_buf.len = size;
33763cae470SChuck Lever 
33863cae470SChuck Lever 	buf = &rqst->rq_rcv_buf;
33963cae470SChuck Lever 	memset(buf, 0, sizeof(*buf));
34063cae470SChuck Lever 	buf->head[0].iov_base = p;
34163cae470SChuck Lever 	buf->head[0].iov_len = size;
34263cae470SChuck Lever 	buf->len = size;
34363cae470SChuck Lever 
34463cae470SChuck Lever 	/* The receive buffer has to be hooked to the rpcrdma_req
34541c8f70fSChuck Lever 	 * so that it is not released while the req is pointing
34641c8f70fSChuck Lever 	 * to its buffer, and so that it can be reposted after
34741c8f70fSChuck Lever 	 * the Upper Layer is done decoding it.
34863cae470SChuck Lever 	 */
34963cae470SChuck Lever 	req = rpcr_to_rdmar(rqst);
35063cae470SChuck Lever 	req->rl_reply = rep;
351fc1eb807SChuck Lever 	trace_xprtrdma_cb_call(rqst);
35263cae470SChuck Lever 
35363cae470SChuck Lever 	/* Queue rqst for ULP's callback service */
35463cae470SChuck Lever 	bc_serv = xprt->bc_serv;
35563cae470SChuck Lever 	spin_lock(&bc_serv->sv_cb_lock);
35663cae470SChuck Lever 	list_add(&rqst->rq_bc_list, &bc_serv->sv_cb_list);
35763cae470SChuck Lever 	spin_unlock(&bc_serv->sv_cb_lock);
35863cae470SChuck Lever 
35963cae470SChuck Lever 	wake_up(&bc_serv->sv_cb_waitq);
36063cae470SChuck Lever 
36163cae470SChuck Lever 	r_xprt->rx_stats.bcall_count++;
36263cae470SChuck Lever 	return;
36363cae470SChuck Lever 
36463cae470SChuck Lever out_overflow:
36563cae470SChuck Lever 	pr_warn("RPC/RDMA backchannel overflow\n");
36663cae470SChuck Lever 	xprt_disconnect_done(xprt);
36763cae470SChuck Lever 	/* This receive buffer gets reposted automatically
36863cae470SChuck Lever 	 * when the connection is re-established.
36963cae470SChuck Lever 	 */
37063cae470SChuck Lever 	return;
37163cae470SChuck Lever }
372