diff options
-rw-r--r-- | net/rxrpc/ar-internal.h | 2 | ||||
-rw-r--r-- | net/rxrpc/call_accept.c | 1 | ||||
-rw-r--r-- | net/rxrpc/call_object.c | 7 | ||||
-rw-r--r-- | net/rxrpc/conn_client.c | 6 | ||||
-rw-r--r-- | net/rxrpc/conn_object.c | 2 | ||||
-rw-r--r-- | net/rxrpc/peer_object.c | 7 |
6 files changed, 19 insertions, 6 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h index adbf37946450..69b97339ff9d 100644 --- a/net/rxrpc/ar-internal.h +++ b/net/rxrpc/ar-internal.h | |||
@@ -300,6 +300,8 @@ struct rxrpc_peer { | |||
300 | u64 rtt_cache[RXRPC_RTT_CACHE_SIZE]; /* Determined RTT cache */ | 300 | u64 rtt_cache[RXRPC_RTT_CACHE_SIZE]; /* Determined RTT cache */ |
301 | u8 rtt_cursor; /* next entry at which to insert */ | 301 | u8 rtt_cursor; /* next entry at which to insert */ |
302 | u8 rtt_usage; /* amount of cache actually used */ | 302 | u8 rtt_usage; /* amount of cache actually used */ |
303 | |||
304 | u8 cong_cwnd; /* Congestion window size */ | ||
303 | }; | 305 | }; |
304 | 306 | ||
305 | /* | 307 | /* |
diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c index 0d4d84e8c074..dd30d74824b0 100644 --- a/net/rxrpc/call_accept.c +++ b/net/rxrpc/call_accept.c | |||
@@ -310,6 +310,7 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx, | |||
310 | rxrpc_see_call(call); | 310 | rxrpc_see_call(call); |
311 | call->conn = conn; | 311 | call->conn = conn; |
312 | call->peer = rxrpc_get_peer(conn->params.peer); | 312 | call->peer = rxrpc_get_peer(conn->params.peer); |
313 | call->cong_cwnd = call->peer->cong_cwnd; | ||
313 | return call; | 314 | return call; |
314 | } | 315 | } |
315 | 316 | ||
diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c index 423030fd93be..d7809a0620b4 100644 --- a/net/rxrpc/call_object.c +++ b/net/rxrpc/call_object.c | |||
@@ -136,12 +136,7 @@ struct rxrpc_call *rxrpc_alloc_call(gfp_t gfp) | |||
136 | call->tx_winsize = 16; | 136 | call->tx_winsize = 16; |
137 | call->rx_expect_next = 1; | 137 | call->rx_expect_next = 1; |
138 | 138 | ||
139 | if (RXRPC_TX_SMSS > 2190) | 139 | call->cong_cwnd = 2; |
140 | call->cong_cwnd = 2; | ||
141 | else if (RXRPC_TX_SMSS > 1095) | ||
142 | call->cong_cwnd = 3; | ||
143 | else | ||
144 | call->cong_cwnd = 4; | ||
145 | call->cong_ssthresh = RXRPC_RXTX_BUFF_SIZE - 1; | 140 | call->cong_ssthresh = RXRPC_RXTX_BUFF_SIZE - 1; |
146 | return call; | 141 | return call; |
147 | 142 | ||
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, | |||
292 | if (!cp->peer) | 292 | if (!cp->peer) |
293 | goto error; | 293 | goto error; |
294 | 294 | ||
295 | call->cong_cwnd = cp->peer->cong_cwnd; | ||
296 | if (call->cong_cwnd >= call->cong_ssthresh) | ||
297 | call->cong_mode = RXRPC_CALL_CONGEST_AVOIDANCE; | ||
298 | else | ||
299 | call->cong_mode = RXRPC_CALL_SLOW_START; | ||
300 | |||
295 | /* If the connection is not meant to be exclusive, search the available | 301 | /* If the connection is not meant to be exclusive, search the available |
296 | * connections to see if the connection we want to use already exists. | 302 | * connections to see if the connection we want to use already exists. |
297 | */ | 303 | */ |
diff --git a/net/rxrpc/conn_object.c b/net/rxrpc/conn_object.c index 5bb255107427..929b50d5afe8 100644 --- a/net/rxrpc/conn_object.c +++ b/net/rxrpc/conn_object.c | |||
@@ -193,6 +193,8 @@ void rxrpc_disconnect_call(struct rxrpc_call *call) | |||
193 | { | 193 | { |
194 | struct rxrpc_connection *conn = call->conn; | 194 | struct rxrpc_connection *conn = call->conn; |
195 | 195 | ||
196 | call->peer->cong_cwnd = call->cong_cwnd; | ||
197 | |||
196 | spin_lock_bh(&conn->params.peer->lock); | 198 | spin_lock_bh(&conn->params.peer->lock); |
197 | hlist_del_init(&call->error_link); | 199 | hlist_del_init(&call->error_link); |
198 | spin_unlock_bh(&conn->params.peer->lock); | 200 | spin_unlock_bh(&conn->params.peer->lock); |
diff --git a/net/rxrpc/peer_object.c b/net/rxrpc/peer_object.c index cfed3b27adf0..5787f97f5330 100644 --- a/net/rxrpc/peer_object.c +++ b/net/rxrpc/peer_object.c | |||
@@ -228,6 +228,13 @@ struct rxrpc_peer *rxrpc_alloc_peer(struct rxrpc_local *local, gfp_t gfp) | |||
228 | seqlock_init(&peer->service_conn_lock); | 228 | seqlock_init(&peer->service_conn_lock); |
229 | spin_lock_init(&peer->lock); | 229 | spin_lock_init(&peer->lock); |
230 | peer->debug_id = atomic_inc_return(&rxrpc_debug_id); | 230 | peer->debug_id = atomic_inc_return(&rxrpc_debug_id); |
231 | |||
232 | if (RXRPC_TX_SMSS > 2190) | ||
233 | peer->cong_cwnd = 2; | ||
234 | else if (RXRPC_TX_SMSS > 1095) | ||
235 | peer->cong_cwnd = 3; | ||
236 | else | ||
237 | peer->cong_cwnd = 4; | ||
231 | } | 238 | } |
232 | 239 | ||
233 | _leave(" = %p", peer); | 240 | _leave(" = %p", peer); |