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.
#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 */
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;