/** * xprt_rdma_bc_setup - Pre-allocate resources for handling backchannel requests * @xprt: transport associated with these backchannel resources * @reqs: number of concurrent incoming requests to expect * * Returns 0 on success; otherwise a negative errno
*/ int xprt_rdma_bc_setup(struct rpc_xprt *xprt, unsignedint reqs)
{ struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
/** * xprt_rdma_bc_send_reply - marshal and send a backchannel reply * @rqst: RPC rqst with a backchannel RPC reply in rq_snd_buf * * Caller holds the transport's write lock. * * Returns: * %0 if the RPC message has been sent * %-ENOTCONN if the caller should reconnect and call again * %-EIO if a permanent error occurred and the request was not * sent. Do not try to send this message again.
*/ int xprt_rdma_bc_send_reply(struct rpc_rqst *rqst)
{ struct rpc_xprt *xprt = rqst->rq_xprt; struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); struct rpcrdma_req *req = rpcr_to_rdmar(rqst); int rc;
if (!xprt_connected(xprt)) return -ENOTCONN;
if (!xprt_request_get_cong(xprt, rqst)) return -EBADSLT;
rc = rpcrdma_bc_marshal_reply(rqst); if (rc < 0) goto failed_marshal;
if (frwr_send(r_xprt, req)) goto drop_connection; return 0;
/** * rpcrdma_bc_receive_call - Handle a reverse-direction Call * @r_xprt: transport receiving the call * @rep: receive buffer containing the call * * Operational assumptions: * o Backchannel credits are ignored, just as the NFS server * forechannel currently does * o The ULP manages a replay cache (eg, NFSv4.1 sessions). * No replay detection is done at the transport level
*/ void rpcrdma_bc_receive_call(struct rpcrdma_xprt *r_xprt, struct rpcrdma_rep *rep)
{ struct rpc_xprt *xprt = &r_xprt->rx_xprt; struct svc_serv *bc_serv; struct rpcrdma_req *req; struct rpc_rqst *rqst; struct xdr_buf *buf;
size_t size;
__be32 *p;
p = xdr_inline_decode(&rep->rr_stream, 0);
size = xdr_stream_remaining(&rep->rr_stream);
/* The receive buffer has to be hooked to the rpcrdma_req * so that it is not released while the req is pointing * to its buffer, and so that it can be reposted after * the Upper Layer is done decoding it.
*/
req = rpcr_to_rdmar(rqst);
req->rl_reply = rep;
trace_xprtrdma_cb_call(r_xprt, rqst);
/* Queue rqst for ULP's callback service */
bc_serv = xprt->bc_serv;
xprt_get(xprt);
lwq_enqueue(&rqst->rq_bc_list, &bc_serv->sv_cb_list);
svc_pool_wake_idle_thread(&bc_serv->sv_pools[0]);
r_xprt->rx_stats.bcall_count++; return;
out_overflow:
pr_warn("RPC/RDMA backchannel overflow\n");
xprt_force_disconnect(xprt); /* This receive buffer gets reposted automatically * when the connection is re-established.
*/ return;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.