aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-05-13 12:51:49 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-05-14 15:09:36 -0400
commitd60dbb20a74c2cfa142be0a34dac3c6547ea086c (patch)
tree7af95739f8fbbef11f490b5b58bf639dbbe8a181 /net
parent9c7e7e23371e629dbb3b341610a418cdf1c19d91 (diff)
SUNRPC: Move the task->tk_bytes_sent and tk_rtt to struct rpc_rqst
It seems strange to maintain stats for bytes_sent in one structure, and bytes received in another. Try to assemble all the RPC request-related stats in struct rpc_rqst Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/stats.c4
-rw-r--r--net/sunrpc/xprt.c4
-rw-r--r--net/sunrpc/xprtrdma/transport.c2
-rw-r--r--net/sunrpc/xprtsock.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index aacd95f0dce5..ea1046f3f9a3 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -156,13 +156,13 @@ void rpc_count_iostats(struct rpc_task *task)
156 op_metrics->om_ntrans += req->rq_ntrans; 156 op_metrics->om_ntrans += req->rq_ntrans;
157 op_metrics->om_timeouts += task->tk_timeouts; 157 op_metrics->om_timeouts += task->tk_timeouts;
158 158
159 op_metrics->om_bytes_sent += task->tk_bytes_sent; 159 op_metrics->om_bytes_sent += req->rq_xmit_bytes_sent;
160 op_metrics->om_bytes_recv += req->rq_reply_bytes_recvd; 160 op_metrics->om_bytes_recv += req->rq_reply_bytes_recvd;
161 161
162 delta = ktime_sub(req->rq_xtime, task->tk_start); 162 delta = ktime_sub(req->rq_xtime, task->tk_start);
163 op_metrics->om_queue = ktime_add(op_metrics->om_queue, delta); 163 op_metrics->om_queue = ktime_add(op_metrics->om_queue, delta);
164 164
165 op_metrics->om_rtt = ktime_add(op_metrics->om_rtt, task->tk_rtt); 165 op_metrics->om_rtt = ktime_add(op_metrics->om_rtt, req->rq_rtt);
166 166
167 delta = ktime_sub(ktime_get(), task->tk_start); 167 delta = ktime_sub(ktime_get(), task->tk_start);
168 op_metrics->om_execute = ktime_add(op_metrics->om_execute, delta); 168 op_metrics->om_execute = ktime_add(op_metrics->om_execute, delta);
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 8986b1b82862..65fe2e4e7cbf 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -780,7 +780,7 @@ static void xprt_update_rtt(struct rpc_task *task)
780 struct rpc_rqst *req = task->tk_rqstp; 780 struct rpc_rqst *req = task->tk_rqstp;
781 struct rpc_rtt *rtt = task->tk_client->cl_rtt; 781 struct rpc_rtt *rtt = task->tk_client->cl_rtt;
782 unsigned timer = task->tk_msg.rpc_proc->p_timer; 782 unsigned timer = task->tk_msg.rpc_proc->p_timer;
783 long m = usecs_to_jiffies(ktime_to_us(task->tk_rtt)); 783 long m = usecs_to_jiffies(ktime_to_us(req->rq_rtt));
784 784
785 if (timer) { 785 if (timer) {
786 if (req->rq_ntrans == 1) 786 if (req->rq_ntrans == 1)
@@ -805,7 +805,7 @@ void xprt_complete_rqst(struct rpc_task *task, int copied)
805 task->tk_pid, ntohl(req->rq_xid), copied); 805 task->tk_pid, ntohl(req->rq_xid), copied);
806 806
807 xprt->stat.recvs++; 807 xprt->stat.recvs++;
808 task->tk_rtt = ktime_sub(ktime_get(), req->rq_xtime); 808 req->rq_rtt = ktime_sub(ktime_get(), req->rq_xtime);
809 if (xprt->ops->timer != NULL) 809 if (xprt->ops->timer != NULL)
810 xprt_update_rtt(task); 810 xprt_update_rtt(task);
811 811
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 3f3b38c5642f..a85e866a77f7 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -674,7 +674,7 @@ xprt_rdma_send_request(struct rpc_task *task)
674 if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req)) 674 if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
675 goto drop_connection; 675 goto drop_connection;
676 676
677 task->tk_bytes_sent += rqst->rq_snd_buf.len; 677 rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len;
678 rqst->rq_bytes_sent = 0; 678 rqst->rq_bytes_sent = 0;
679 return 0; 679 return 0;
680 680
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index beefa7a3a90e..02fc7f04dd17 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -528,7 +528,7 @@ static int xs_udp_send_request(struct rpc_task *task)
528 xdr->len - req->rq_bytes_sent, status); 528 xdr->len - req->rq_bytes_sent, status);
529 529
530 if (status >= 0) { 530 if (status >= 0) {
531 task->tk_bytes_sent += status; 531 req->rq_xmit_bytes_sent += status;
532 if (status >= req->rq_slen) 532 if (status >= req->rq_slen)
533 return 0; 533 return 0;
534 /* Still some bytes left; set up for a retry later. */ 534 /* Still some bytes left; set up for a retry later. */
@@ -624,7 +624,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
624 /* If we've sent the entire packet, immediately 624 /* If we've sent the entire packet, immediately
625 * reset the count of bytes sent. */ 625 * reset the count of bytes sent. */
626 req->rq_bytes_sent += status; 626 req->rq_bytes_sent += status;
627 task->tk_bytes_sent += status; 627 req->rq_xmit_bytes_sent += status;
628 if (likely(req->rq_bytes_sent >= req->rq_slen)) { 628 if (likely(req->rq_bytes_sent >= req->rq_slen)) {
629 req->rq_bytes_sent = 0; 629 req->rq_bytes_sent = 0;
630 return 0; 630 return 0;