Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@fys.uio.no>2003-08-21 04:42:05 -0700
committerTrond Myklebust <trond.myklebust@fys.uio.no>2003-08-21 04:42:05 -0700
commit5579cbd6894d83f81517c6b790c4f511f94e7976 (patch)
treee9e8efb2c831ceaf179446db0215e658d4065380
parent4bdeac8fa5d5c6a4408ef42ec66a715c36fd27a6 (diff)
A request cannot be used as part of the RTO estimation if it gets
resent since you don't know whether the server is replying to the first or the second transmission. However we're currently setting the cutoff point to be the timeout of the first transmission. This patch moves the cutoff point to the actual start of the retransmission.
-rw-r--r--include/linux/sunrpc/xprt.h2
-rw-r--r--net/sunrpc/xprt.c14
2 files changed, 10 insertions, 6 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 2687ba7b9f13..e29381edeaea 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -115,7 +115,7 @@ struct rpc_rqst {
unsigned long rq_xtime; /* when transmitted */
int rq_ntimeo;
- int rq_nresend;
+ int rq_ntrans;
};
#define rq_svec rq_snd_buf.head
#define rq_slen rq_snd_buf.len
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 7c8678157d09..858337425e84 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -143,15 +143,17 @@ __xprt_lock_write(struct rpc_xprt *xprt, struct rpc_task *task)
if (!xprt->snd_task) {
if (xprt->nocong || __xprt_get_cong(xprt, task)) {
xprt->snd_task = task;
- if (req)
+ if (req) {
req->rq_bytes_sent = 0;
+ req->rq_ntrans++;
+ }
}
}
if (xprt->snd_task != task) {
dprintk("RPC: %4d TCP write queue full\n", task->tk_pid);
task->tk_timeout = 0;
task->tk_status = -EAGAIN;
- if (req && req->rq_nresend)
+ if (req && req->rq_ntrans)
rpc_sleep_on(&xprt->resend, task, NULL, NULL);
else
rpc_sleep_on(&xprt->sending, task, NULL, NULL);
@@ -189,8 +191,10 @@ __xprt_lock_write_next(struct rpc_xprt *xprt)
if (xprt->nocong || __xprt_get_cong(xprt, task)) {
struct rpc_rqst *req = task->tk_rqstp;
xprt->snd_task = task;
- if (req)
+ if (req) {
req->rq_bytes_sent = 0;
+ req->rq_ntrans++;
+ }
}
}
@@ -578,7 +582,7 @@ xprt_complete_rqst(struct rpc_xprt *xprt, struct rpc_rqst *req, int copied)
if (!xprt->nocong) {
xprt_adjust_cwnd(xprt, copied);
__xprt_put_cong(xprt, req);
- if (!req->rq_nresend) {
+ if (req->rq_ntrans == 1) {
unsigned timer =
task->tk_msg.rpc_proc->p_timer;
if (timer)
@@ -1064,7 +1068,7 @@ xprt_timer(struct rpc_task *task)
goto out;
xprt_adjust_cwnd(req->rq_xprt, -ETIMEDOUT);
- req->rq_nresend++;
+ __xprt_put_cong(xprt, req);
dprintk("RPC: %4d xprt_timer (%s request)\n",
task->tk_pid, req ? "pending" : "backlogged");