linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: chia-yu.chang@nokia-bell-labs.com, linux-doc@vger.kernel.org,
	corbet@lwn.net, horms@kernel.org, dsahern@kernel.org,
	kuniyu@amazon.com, bpf@vger.kernel.org, netdev@vger.kernel.org,
	dave.taht@gmail.com, jhs@mojatatu.com, kuba@kernel.org,
	stephen@networkplumber.org, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, davem@davemloft.net, edumazet@google.com,
	andrew+netdev@lunn.ch, donald.hunter@gmail.com, ast@fiberby.net,
	liuhangbin@gmail.com, shuah@kernel.org,
	linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com,
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com,
	rs.ietf@gmx.at, Jason_Livingood@comcast.com,
	vidhi_goel@apple.com
Subject: Re: [PATCH v7 net-next 14/15] tcp: accecn: try to fit AccECN option with SACK
Date: Tue, 20 May 2025 12:03:47 +0200	[thread overview]
Message-ID: <5cd44751-19df-4356-a485-a7ba18a05482@redhat.com> (raw)
In-Reply-To: <20250514135642.11203-15-chia-yu.chang@nokia-bell-labs.com>

On 5/14/25 3:56 PM, chia-yu.chang@nokia-bell-labs.com wrote:
> From: Ilpo Järvinen <ij@kernel.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@kernel.org>
> Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
> ---
>  net/ipv4/tcp_output.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index b630923c4cef..d9d3cc8dbb5b 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -982,8 +982,21 @@ 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);

How deep is the recursion level, worst case? In any case please try to
avoid recursion entirely. Possibly a 'goto' statement would help.

/P


  reply	other threads:[~2025-05-20 10:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14 13:56 [PATCH v7 net-next 00/15] AccECN protocol patch series chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 01/15] tcp: reorganize SYN ECN code chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 02/15] tcp: fast path functions later chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 03/15] tcp: reorganize tcp_sock_write_txrx group for variables later chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 04/15] tcp: AccECN core chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 05/15] tcp: accecn: AccECN negotiation chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 06/15] tcp: accecn: add AccECN rx byte counters chia-yu.chang
2025-05-20  9:44   ` Paolo Abeni
2025-05-14 13:56 ` [PATCH v7 net-next 07/15] tcp: accecn: AccECN needs to know delivered bytes chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 08/15] tcp: sack option handling improvements chia-yu.chang
2025-05-20  9:34   ` Paolo Abeni
2025-05-14 13:56 ` [PATCH v7 net-next 09/15] tcp: accecn: AccECN option chia-yu.chang
2025-05-20  9:31   ` Paolo Abeni
2025-05-20 10:32     ` Eric Dumazet
2025-05-20 13:37       ` Paolo Abeni
2025-05-28  7:26         ` Chia-Yu Chang (Nokia)
2025-05-14 13:56 ` [PATCH v7 net-next 10/15] tcp: accecn: AccECN option send control chia-yu.chang
2025-05-20  9:49   ` Paolo Abeni
2025-05-14 13:56 ` [PATCH v7 net-next 11/15] tcp: accecn: AccECN option failure handling chia-yu.chang
2025-05-20 10:00   ` Paolo Abeni
2025-05-14 13:56 ` [PATCH v7 net-next 12/15] tcp: accecn: AccECN option ceb/cep heuristic chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 13/15] tcp: accecn: AccECN ACE field multi-wrap heuristic chia-yu.chang
2025-05-14 13:56 ` [PATCH v7 net-next 14/15] tcp: accecn: try to fit AccECN option with SACK chia-yu.chang
2025-05-20 10:03   ` Paolo Abeni [this message]
2025-05-23 17:50     ` Chia-Yu Chang (Nokia)
2025-05-14 13:56 ` [PATCH v7 net-next 15/15] tcp: try to avoid safer when ACKs are thinned chia-yu.chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5cd44751-19df-4356-a485-a7ba18a05482@redhat.com \
    --to=pabeni@redhat.com \
    --cc=Jason_Livingood@comcast.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@fiberby.net \
    --cc=bpf@vger.kernel.org \
    --cc=cheshire@apple.com \
    --cc=chia-yu.chang@nokia-bell-labs.com \
    --cc=corbet@lwn.net \
    --cc=dave.taht@gmail.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=g.white@cablelabs.com \
    --cc=horms@kernel.org \
    --cc=ij@kernel.org \
    --cc=ingemar.s.johansson@ericsson.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=koen.de_schepper@nokia-bell-labs.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=mirja.kuehlewind@ericsson.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=rs.ietf@gmx.at \
    --cc=shuah@kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vidhi_goel@apple.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).