Skip to content

Commit ba4e103

Browse files
dhowellskuba-moo
authored andcommitted
rxrpc: Fix congestion control algorithm
Make the following fixes to the congestion control algorithm: (1) Don't vary the cwnd starting value by the size of RXRPC_TX_SMSS since that's currently held constant - set to the size of a jumbo subpacket payload so that we can create jumbo packets on the fly. The current code invariably picks 3 as the starting value. Further, the starting cwnd needs to be an even number because we ack every other packet, so set it to 4. (2) Don't cut ssthresh when we see an ACK come from the peer with a receive window (rwind) less than ssthresh. ssthresh keeps track of characteristics of the connection whereas rwind may be reduced by the peer for any reason - and may be reduced to 0. Fixes: 1fc4fa2 ("rxrpc: Fix congestion management") Fixes: 0851115 ("rxrpc: Reduce ssthresh to peer's receive window") Signed-off-by: David Howells <[email protected]> Suggested-by: Simon Wilkinson <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected] Reviewed-by: Jeffrey Altman <[email protected] <mailto:[email protected]>> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9a169c2 commit ba4e103

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

net/rxrpc/ar-internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ struct rxrpc_call {
697697
* packets) rather than bytes.
698698
*/
699699
#define RXRPC_TX_SMSS RXRPC_JUMBO_DATALEN
700-
#define RXRPC_MIN_CWND (RXRPC_TX_SMSS > 2190 ? 2 : RXRPC_TX_SMSS > 1095 ? 3 : 4)
700+
#define RXRPC_MIN_CWND 4
701701
u8 cong_cwnd; /* Congestion window size */
702702
u8 cong_extra; /* Extra to send for congestion management */
703703
u8 cong_ssthresh; /* Slow-start threshold */

net/rxrpc/call_object.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,7 @@ struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *rx, gfp_t gfp,
174174
call->rx_winsize = rxrpc_rx_window_size;
175175
call->tx_winsize = 16;
176176

177-
if (RXRPC_TX_SMSS > 2190)
178-
call->cong_cwnd = 2;
179-
else if (RXRPC_TX_SMSS > 1095)
180-
call->cong_cwnd = 3;
181-
else
182-
call->cong_cwnd = 4;
177+
call->cong_cwnd = RXRPC_MIN_CWND;
183178
call->cong_ssthresh = RXRPC_TX_MAX_WINDOW;
184179

185180
call->rxnet = rxnet;

net/rxrpc/input.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,6 @@ static void rxrpc_input_ack_trailer(struct rxrpc_call *call, struct sk_buff *skb
685685
call->tx_winsize = rwind;
686686
}
687687

688-
if (call->cong_ssthresh > rwind)
689-
call->cong_ssthresh = rwind;
690-
691688
mtu = min(ntohl(trailer->maxMTU), ntohl(trailer->ifMTU));
692689

693690
peer = call->peer;

0 commit comments

Comments
 (0)