Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: kuniyu@google.com
Cc: edumazet@kernel.org, ncardwell@google.com, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, matttbe@kernel.org,
	martineau@kernel.org, horms@kernel.org, kuni1840@gmail.com,
	netdev@vger.kernel.org, mptcp@lists.linux.dev
Subject: Re: [PATCH v2 net-next 3/7] tcp: Stop collapsing if not bloated.
Date: Tue, 17 Nov 2026 23:13:39 +0000	[thread overview]
Message-ID: <179495721972.3136.4014039511718024400@kernel.org> (raw)
In-Reply-To: <20261116230555.2305867-4-kuniyu@google.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The header comment of tcp_collapse() in net/ipv4/tcp_input.c now
  reads "Collapse contiguous sequence of skbs head..tail with sequence…

--

tcp: Stop collapsing if not bloated.

With this change, tcp_collapse() starts collapsing only at a bloated skb.
It extends the range over consecutive collapsible skbs that are bloated
or overlapping, copies that sub-range, and then restarts to look for the
next one. The end parameter is dropped from tcp_collapse(), and both
callers are updated.

> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 598d4ff3e1f4b..d2d4796984f39 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -5839,7 +5839,7 @@ static struct sk_buff *tcp_collapse_one(struct sock *sk, struct sk_buff *skb,
>  }
>  
>  /* Collapse contiguous sequence of skbs head..tail with
> - * sequence numbers start..end.
> + * sequence numbers start..sub_end.

[Severity: Low]
This isn't a bug, but could the header comment of tcp_collapse() be
reworded?

sub_end is not a parameter. It is a local variable that the second loop
recomputes for each sub-range, so callers never see it.

The comment also still describes collapsing a single contiguous range.
After this patch, one call can collapse several separate sub-ranges
between head and tail, with uncollapsed skbs left between them:

	/* Second, find consecutive collapsible skb. */
	sub_end = TCP_SKB_CB(skb)->end_seq;
	...
	goto restart;

The comment stays the same through the rest of the series, up to
"selftest: packetdrill: Add test for tcp_collapse()."

>   *
>   * If tail is NULL, this means until the end of the queue.
>   *

[ ... ]

> +	/* Second, find consecutive collapsible skb. */
> +	sub_end = TCP_SKB_CB(skb)->end_seq;
> +
> +	for (n = tcp_skb_next(skb, list); n && n != tail; n = tcp_skb_next(n, list)) {

[ ... ]

> +		sub_end = TCP_SKB_CB(n)->end_seq;
> +	}

[ ... ]

> +
> +	goto restart;
>  end:
>  	skb_queue_walk_safe(&tmp, skb, n)
>  		tcp_rbtree_insert(root, skb);

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116230555.2305867-1-kuniyu%40google.com

  reply	other threads:[~2026-11-17 23:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 23:05 [PATCH v2 net-next 0/7] tcp: Prevent tcp_collapse() from bloating queue Kuniyuki Iwashima
2026-11-16 23:05 ` [PATCH v2 net-next 1/7] tcp: Refactor the first loop in tcp_collapse() Kuniyuki Iwashima
2026-11-16 23:05 ` [PATCH v2 net-next 2/7] tcp: Don't collapse high density skb Kuniyuki Iwashima
2026-11-17 23:13   ` netdev-bot+sashiko
2026-11-16 23:05 ` [PATCH v2 net-next 3/7] tcp: Stop collapsing if not bloated Kuniyuki Iwashima
2026-11-17 23:13   ` netdev-bot+sashiko [this message]
2026-11-16 23:05 ` [PATCH v2 net-next 4/7] tcp: Skip collapsing if collapsed skb is less-dense Kuniyuki Iwashima
2026-11-17 23:13   ` netdev-bot+sashiko
2026-11-16 23:05 ` [PATCH v2 net-next 5/7] tcp: Allocate all new skb before collapsing Kuniyuki Iwashima
2026-11-17 23:13   ` netdev-bot+sashiko
2026-11-16 23:05 ` [PATCH v2 net-next 6/7] tcp: Batch memory accounting in tcp_collapse() Kuniyuki Iwashima
2026-11-16 23:05 ` [PATCH v2 net-next 7/7] selftest: packetdrill: Add test for tcp_collapse() Kuniyuki Iwashima
2026-11-17 23:13   ` netdev-bot+sashiko

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=179495721972.3136.4014039511718024400@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@google.com \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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