]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Fix typo in net/sunrpc/xprt.c
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Thu, 18 Jul 2002 13:11:48 +0000 (06:11 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Thu, 18 Jul 2002 13:11:48 +0000 (06:11 -0700)
The appended patch fixes a typo in net/sunrpc/xprt.c: We want to
ensure that we play safe, and only increment the UDP congestion window
when we have successfully transmitted a full frame of data.

In addition, we should perhaps still 'slow start' the UDP congestion
code rather than assuming that we can immediately fire off 8
requests. IOW revert the value of RPC_INITCWND.

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

index 0a247f460ff775ac551c06d54c0607dffd8fa082..eca42599039f597c60bda5f0ba293e5cbd4bd2d8 100644 (file)
@@ -37,7 +37,7 @@
 #define RPC_MAXREQS            RPC_MAXCONG
 #define RPC_CWNDSCALE          (256)
 #define RPC_MAXCWND            (RPC_MAXCONG * RPC_CWNDSCALE)
-#define RPC_INITCWND           (RPC_MAXCWND >> 1)
+#define RPC_INITCWND           RPC_CWNDSCALE
 #define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd)
 
 /* Default timeout values */
index fc3bb3841329963ea83e90d29f5bbbb3a6ae6798..40f0e0f6df327f61a2fe098a7c8e5170c27c5591 100644 (file)
@@ -309,7 +309,7 @@ xprt_adjust_cwnd(struct rpc_xprt *xprt, int result)
        unsigned long   cwnd;
 
        cwnd = xprt->cwnd;
-       if (result >= 0 && xprt->cong <= cwnd) {
+       if (result >= 0 && cwnd <= xprt->cong) {
                /* The (cwnd >> 1) term makes sure
                 * the result gets rounded properly. */
                cwnd += (RPC_CWNDSCALE * RPC_CWNDSCALE + (cwnd >> 1)) / cwnd;