aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc/conn_client.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-06-14 17:56:50 +0100
committerDavid S. Miller <davem@davemloft.net>2017-06-14 15:42:45 -0400
commitf7aec129a356ad049edddcb7e77b04a474fcf41f (patch)
tree103d3fb8a7c99b6c9ebaeaf20d2c891174d72f48 /net/rxrpc/conn_client.c
parentliquidio: fix VF driver off-by-one bug when setting ethtool -C ethX rx-frames (diff)
downloadlinux-dev-f7aec129a356ad049edddcb7e77b04a474fcf41f.tar.xz
linux-dev-f7aec129a356ad049edddcb7e77b04a474fcf41f.zip
rxrpc: Cache the congestion window setting
Cache the congestion window setting that was determined during a call's transmission phase when it finishes so that it can be used by the next call to the same peer, thereby shortcutting the slow-start algorithm. The value is stored in the rxrpc_peer struct and is accessed without locking. Each call takes the value that happens to be there when it starts and just overwrites the value when it finishes. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc/conn_client.c')
-rw-r--r--net/rxrpc/conn_client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index dd8bb919c15a..eb2157680399 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -292,6 +292,12 @@ static int rxrpc_get_client_conn(struct rxrpc_call *call,
if (!cp->peer)
goto error;
+ call->cong_cwnd = cp->peer->cong_cwnd;
+ if (call->cong_cwnd >= call->cong_ssthresh)
+ call->cong_mode = RXRPC_CALL_CONGEST_AVOIDANCE;
+ else
+ call->cong_mode = RXRPC_CALL_SLOW_START;
+
/* If the connection is not meant to be exclusive, search the available
* connections to see if the connection we want to use already exists.
*/