]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
xprtrdma: "Support" call-only RPCs
authorChuck Lever <chuck.lever@oracle.com>
Wed, 28 Feb 2018 20:30:54 +0000 (15:30 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 10 Apr 2018 20:06:22 +0000 (16:06 -0400)
RPC-over-RDMA version 1 credit accounting relies on there being a
response message for every RPC Call. This means that RPC procedures
that have no reply will disrupt credit accounting, just in the same
way as a retransmit would (since it is sent because no reply has
arrived). Deal with the "no reply" case the same way.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
include/linux/sunrpc/clnt.h
net/sunrpc/sunrpc.h
net/sunrpc/xprtrdma/transport.c

index ed761f751ecbd954ee440d864d2ba7ee47a3f3f9..9b11b6a0978c95467761d142716c873ac5c201d4 100644 (file)
@@ -217,5 +217,12 @@ void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *, struct rpc_xprt *);
 bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
                        const struct sockaddr *sap);
 void rpc_cleanup_clids(void);
+
+static inline int rpc_reply_expected(struct rpc_task *task)
+{
+       return (task->tk_msg.rpc_proc != NULL) &&
+               (task->tk_msg.rpc_proc->p_decode != NULL);
+}
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_SUNRPC_CLNT_H */
index f2b7cb540e61997ce427e132f7d0f20cada5a46e..09a0315ea77b3955115aa3db9abe891b518799c9 100644 (file)
@@ -37,12 +37,6 @@ struct rpc_buffer {
        char    data[];
 };
 
-static inline int rpc_reply_expected(struct rpc_task *task)
-{
-       return (task->tk_msg.rpc_proc != NULL) &&
-               (task->tk_msg.rpc_proc->p_decode != NULL);
-}
-
 static inline int sock_is_loopback(struct sock *sk)
 {
        struct dst_entry *dst;
index 08196896953db706ff1c6517bb1aae912848ca66..7e39faa90c41e48854a46c66d87e7c00bf878c76 100644 (file)
@@ -728,6 +728,12 @@ xprt_rdma_send_request(struct rpc_task *task)
 
        rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len;
        rqst->rq_bytes_sent = 0;
+
+       /* An RPC with no reply will throw off credit accounting,
+        * so drop the connection to reset the credit grant.
+        */
+       if (!rpc_reply_expected(task))
+               goto drop_connection;
        return 0;
 
 failed_marshal: