// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015-2018 Oracle. All rights reserved. * * Support for reverse-direction RPCs on RPC/RDMA (server-side). */ #include <linux/sunrpc/svc_rdma.h> #include "xprt_rdma.h" #include <trace/events/rpcrdma.h> /** * svc_rdma_handle_bc_reply - Process incoming backchannel Reply * @rqstp: resources for handling the Reply * @rctxt: Received message * */ void svc_rdma_handle_bc_reply(struct svc_rqst *rqstp, struct svc_rdma_recv_ctxt *rctxt) { … } /* Send a reverse-direction RPC Call. * * Caller holds the connection's mutex and has already marshaled * the RPC/RDMA request. * * This is similar to svc_rdma_send_reply_msg, but takes a struct * rpc_rqst instead, does not support chunks, and avoids blocking * memory allocation. * * XXX: There is still an opportunity to block in svc_rdma_send() * if there are no SQ entries to post the Send. This may occur if * the adapter has a small maximum SQ depth. */ static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst, struct svc_rdma_send_ctxt *sctxt) { … } /* Server-side transport endpoint wants a whole page for its send * buffer. The client RPC code constructs the RPC header in this * buffer before it invokes ->send_request. */ static int xprt_rdma_bc_allocate(struct rpc_task *task) { … } static void xprt_rdma_bc_free(struct rpc_task *task) { … } static int rpcrdma_bc_send_request(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst) { … } /** * xprt_rdma_bc_send_request - Send a reverse-direction Call * @rqst: rpc_rqst containing Call message to be sent * * Return values: * %0 if the message was sent successfully * %ENOTCONN if the message was not sent */ static int xprt_rdma_bc_send_request(struct rpc_rqst *rqst) { … } static void xprt_rdma_bc_close(struct rpc_xprt *xprt) { … } static void xprt_rdma_bc_put(struct rpc_xprt *xprt) { … } static const struct rpc_xprt_ops xprt_rdma_bc_procs = …; static const struct rpc_timeout xprt_rdma_bc_timeout = …; /* It shouldn't matter if the number of backchannel session slots * doesn't match the number of RPC/RDMA credits. That just means * one or the other will have extra slots that aren't used. */ static struct rpc_xprt * xprt_setup_rdma_bc(struct xprt_create *args) { … } struct xprt_class xprt_rdma_bc = …;