Commit ca7f33aa authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Fix RPC call retransmission statistics

A retransmit should be when you successfully transmit an RPC call to
the server a second time.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 99875249
...@@ -1719,6 +1719,8 @@ call_connect_status(struct rpc_task *task) ...@@ -1719,6 +1719,8 @@ call_connect_status(struct rpc_task *task)
static void static void
call_transmit(struct rpc_task *task) call_transmit(struct rpc_task *task)
{ {
int is_retrans = RPC_WAS_SENT(task);
dprint_status(task); dprint_status(task);
task->tk_action = call_status; task->tk_action = call_status;
...@@ -1743,6 +1745,8 @@ call_transmit(struct rpc_task *task) ...@@ -1743,6 +1745,8 @@ call_transmit(struct rpc_task *task)
xprt_transmit(task); xprt_transmit(task);
if (task->tk_status < 0) if (task->tk_status < 0)
return; return;
if (is_retrans)
task->tk_client->cl_stats->rpcretrans++;
/* /*
* On success, ensure that we call xprt_end_transmit() before sleeping * On success, ensure that we call xprt_end_transmit() before sleeping
* in order to allow access to the socket to other RPC requests. * in order to allow access to the socket to other RPC requests.
...@@ -1983,7 +1987,6 @@ call_timeout(struct rpc_task *task) ...@@ -1983,7 +1987,6 @@ call_timeout(struct rpc_task *task)
rpcauth_invalcred(task); rpcauth_invalcred(task);
retry: retry:
clnt->cl_stats->rpcretrans++;
task->tk_action = call_bind; task->tk_action = call_bind;
task->tk_status = 0; task->tk_status = 0;
} }
...@@ -2026,7 +2029,6 @@ call_decode(struct rpc_task *task) ...@@ -2026,7 +2029,6 @@ call_decode(struct rpc_task *task)
if (req->rq_rcv_buf.len < 12) { if (req->rq_rcv_buf.len < 12) {
if (!RPC_IS_SOFT(task)) { if (!RPC_IS_SOFT(task)) {
task->tk_action = call_bind; task->tk_action = call_bind;
clnt->cl_stats->rpcretrans++;
goto out_retry; goto out_retry;
} }
dprintk("RPC: %s: too small RPC reply size (%d bytes)\n", dprintk("RPC: %s: too small RPC reply size (%d bytes)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment