[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241015102940.26157-28-chia-yu.chang@nokia-bell-labs.com>
Date: Tue, 15 Oct 2024 12:29:23 +0200
From: chia-yu.chang@...ia-bell-labs.com
To: netdev@...r.kernel.org, ij@...nel.org, ncardwell@...gle.com,
koen.de_schepper@...ia-bell-labs.com, g.white@...leLabs.com,
ingemar.s.johansson@...csson.com, mirja.kuehlewind@...csson.com,
cheshire@...le.com, rs.ietf@....at, Jason_Livingood@...cast.com,
vidhi_goel@...le.com
Cc: Chia-Yu Chang <chia-yu.chang@...ia-bell-labs.com>
Subject: [PATCH net-next 27/44] tcp: accecn: try to fit AccECN option with SACK
From: Ilpo Järvinen <ij@...nel.org>
As SACK blocks tend to eat all option space when there are
many holes, it is useful to compromise on sending many SACK
blocks in every ACK and try to fit AccECN option there
by reduction the number of SACK blocks. But never go below
two SACK blocks because of AccECN option.
As AccECN option is often not put to every ACK, the space
hijack is usually only temporary.
Signed-off-by: Ilpo Järvinen <ij@...nel.org>
Signed-off-by: Chia-Yu Chang <chia-yu.chang@...ia-bell-labs.com>
---
net/ipv4/tcp_output.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index ee23b08bd750..663cdea1b87b 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -968,8 +968,20 @@ static int tcp_options_fit_accecn(struct tcp_out_options *opts, int required,
opts->num_accecn_fields--;
size -= TCPOLEN_ACCECN_PERFIELD;
}
- if (opts->num_accecn_fields < required)
+ if (opts->num_accecn_fields < required) {
+ if (opts->num_sack_blocks > 2) {
+ /* Try to fit the option by removing one SACK block */
+ opts->num_sack_blocks--;
+ size = tcp_options_fit_accecn(opts, required,
+ remaining + TCPOLEN_SACK_PERBLOCK,
+ max_combine_saving);
+ if (opts->options & OPTION_ACCECN)
+ return size - TCPOLEN_SACK_PERBLOCK;
+
+ opts->num_sack_blocks++;
+ }
return 0;
+ }
opts->options |= OPTION_ACCECN;
return size;
--
2.34.1
Powered by blists - more mailing lists