🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Tue, 17 Nov 2026 23:13
Re: [PATCH v2 net-next 3/7] tcp: Stop collapsing if not bloated.
#18170
Author: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 23:13
76 lines
10118 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads