diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2018-02-28 15:30:54 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2018-04-10 16:06:22 -0400 |
commit | fb14ae8853e4f0347950f98e604fa2f4f3b3abe1 (patch) | |
tree | 734f67197f925ed212be6d3b4dea9757dd38bef6 | |
parent | ae741a855170fa97adabce7e48bdf9de71186a5f (diff) |
xprtrdma: "Support" call-only RPCs
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>
-rw-r--r-- | include/linux/sunrpc/clnt.h | 7 | ||||
-rw-r--r-- | net/sunrpc/sunrpc.h | 6 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 6 |
3 files changed, 13 insertions, 6 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index ed761f751ecb..9b11b6a0978c 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -217,5 +217,12 @@ void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *, struct rpc_xprt *); | |||
217 | bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt, | 217 | bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt, |
218 | const struct sockaddr *sap); | 218 | const struct sockaddr *sap); |
219 | void rpc_cleanup_clids(void); | 219 | void rpc_cleanup_clids(void); |
220 | |||
221 | static inline int rpc_reply_expected(struct rpc_task *task) | ||
222 | { | ||
223 | return (task->tk_msg.rpc_proc != NULL) && | ||
224 | (task->tk_msg.rpc_proc->p_decode != NULL); | ||
225 | } | ||
226 | |||
220 | #endif /* __KERNEL__ */ | 227 | #endif /* __KERNEL__ */ |
221 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 228 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/net/sunrpc/sunrpc.h b/net/sunrpc/sunrpc.h index f2b7cb540e61..09a0315ea77b 100644 --- a/net/sunrpc/sunrpc.h +++ b/net/sunrpc/sunrpc.h | |||
@@ -37,12 +37,6 @@ struct rpc_buffer { | |||
37 | char data[]; | 37 | char data[]; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static inline int rpc_reply_expected(struct rpc_task *task) | ||
41 | { | ||
42 | return (task->tk_msg.rpc_proc != NULL) && | ||
43 | (task->tk_msg.rpc_proc->p_decode != NULL); | ||
44 | } | ||
45 | |||
46 | static inline int sock_is_loopback(struct sock *sk) | 40 | static inline int sock_is_loopback(struct sock *sk) |
47 | { | 41 | { |
48 | struct dst_entry *dst; | 42 | struct dst_entry *dst; |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 08196896953d..7e39faa90c41 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -728,6 +728,12 @@ xprt_rdma_send_request(struct rpc_task *task) | |||
728 | 728 | ||
729 | rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len; | 729 | rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len; |
730 | rqst->rq_bytes_sent = 0; | 730 | rqst->rq_bytes_sent = 0; |
731 | |||
732 | /* An RPC with no reply will throw off credit accounting, | ||
733 | * so drop the connection to reset the credit grant. | ||
734 | */ | ||
735 | if (!rpc_reply_expected(task)) | ||
736 | goto drop_connection; | ||
731 | return 0; | 737 | return 0; |
732 | 738 | ||
733 | failed_marshal: | 739 | failed_marshal: |