]> git.hungrycats.org Git - linux/commitdiff
A request cannot be used as part of the RTO estimation if it gets
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Thu, 21 Aug 2003 11:42:05 +0000 (04:42 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Thu, 21 Aug 2003 11:42:05 +0000 (04:42 -0700)
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.

include/linux/sunrpc/xprt.h
net/sunrpc/xprt.c

index 2687ba7b9f139da97afd6f3a00b6a649c042afa8..e29381edeaeafefd82706c8bb457766d9fbda96e 100644 (file)
@@ -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
index 7c8678157d09befb92ba89f53be1630d3fbec0ec..858337425e847ac33a7dff7e53bb62d0119182ce 100644 (file)
@@ -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");