Commit 389a5884 authored by Trond Myklebust's avatar Trond Myklebust

[PATCH] Fix typo in net/sunrpc/xprt.c

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.
parent df458c00
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define RPC_MAXREQS RPC_MAXCONG #define RPC_MAXREQS RPC_MAXCONG
#define RPC_CWNDSCALE (256) #define RPC_CWNDSCALE (256)
#define RPC_MAXCWND (RPC_MAXCONG * RPC_CWNDSCALE) #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) #define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd)
/* Default timeout values */ /* Default timeout values */
......
...@@ -309,7 +309,7 @@ xprt_adjust_cwnd(struct rpc_xprt *xprt, int result) ...@@ -309,7 +309,7 @@ xprt_adjust_cwnd(struct rpc_xprt *xprt, int result)
unsigned long cwnd; unsigned long cwnd;
cwnd = xprt->cwnd; cwnd = xprt->cwnd;
if (result >= 0 && xprt->cong <= cwnd) { if (result >= 0 && cwnd <= xprt->cong) {
/* The (cwnd >> 1) term makes sure /* The (cwnd >> 1) term makes sure
* the result gets rounded properly. */ * the result gets rounded properly. */
cwnd += (RPC_CWNDSCALE * RPC_CWNDSCALE + (cwnd >> 1)) / cwnd; cwnd += (RPC_CWNDSCALE * RPC_CWNDSCALE + (cwnd >> 1)) / cwnd;
......
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