Skip to content

Commit

Permalink
xprtrdma: "Support" call-only RPCs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chuck Lever authored and Anna Schumaker committed Apr 10, 2018
1 parent ae741a8 commit fb14ae8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions include/linux/sunrpc/clnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
6 changes: 0 additions & 6 deletions net/sunrpc/sunrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fb14ae8

Please sign in to comment.