BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tim Fuechsel" <t.fuechsel@gmx.de>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCHv9 net-next] tcp: Add TCP ROCCET congestion control module.
Date: Tue, 29 Sep 2026 15:12:18 +0000	[thread overview]
Message-ID: <20260929151219.5F0A81F00893@smtp.kernel.org> (raw)
In-Reply-To: <arqDuiD4Q4GWOFBc@volt-roccet-vm>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] tcp: ROCCET stalls Fast Retransmit by bypassing PRR in TCP_CA_Recovery
- [High] tcp: integer promotion bug falsely triggers congestion events on ROCCET
- [Low] build: struct roccettcp exceeds ICSK_CA_PRIV_SIZE limit
--

commit 1022dd98954ad71bd010ccb13665b66dd4141109
Author: Tim Fuechsel <t.fuechsel@gmx.de>

tcp: Add TCP ROCCET congestion control module.

TCP ROCCET is a new congestion control algorithm based on TCP CUBIC that
improves overall performance in cellular networks. It introduces additional
metrics like relative increase in RTT and acknowledgment arrival rate to
address bufferbloat and manage window scaling.

> diff --git a/net/ipv4/tcp_roccet.c b/net/ipv4/tcp_roccet.c
> new file mode 100644
> --- /dev/null
> +++ b/net/ipv4/tcp_roccet.c
> @@ -0,0 +1,1400 @@
[ ... ]
> +struct roccettcp {
> +	u32 cnt;	/* increase cwnd by 1 after ACKs */
[ ... ]
> +	u16 ack_rate_cnt;	/* Used for counting acks */
> +
> +	enum roccet_state state : 3; /* Current operating state of roccet */

[Severity: Low]
Will this bitfield layout cause a compile-time failure?

Because the preceding field is u16 (which ends at offset 102), the compiler
inserts 2 bytes of padding to align the enum allocation unit, which needs
4-byte alignment, at offset 104. This expands the total struct size to 108
bytes.

> +	bool initial_limit_reached: 1;	/* Set to true after the connection
[ ... ]
> +static int __init roccet_register(void)
> +{
> +	int param_err;
> +
> +	BUILD_BUG_ON(sizeof(struct roccettcp) > ICSK_CA_PRIV_SIZE);

Since ICSK_CA_PRIV_SIZE is statically defined as 104 bytes in
include/net/inet_connection_sock.h, it seems this check will unconditionally
fail and break the module build.

[ ... ]
> +static void roccet_orbiter_update(struct sock *sk, u32 acked)
> +{
[ ... ]
> +	/* Check sent and received bytes from the previous interval.
> +	 * Here we use a guard space of 1% of the current cwnd.
> +	 * We do this to avoid a false positive evaluation due
> +	 * to delays caused by jitter or scheduling.
> +	 */
> +	sent_more_than_acked = (s32)(sent - received) >
> +			       div_u64((u64)tcp_snd_cwnd(tp) *
> +			       (u64)tp->mss_cache, 100);

[Severity: High]
Does this comparison trigger false congestion events when ACKs outpace outgoing
data?

If received exceeds sent, sent - received wraps to a very large u32. When
cast to s32, it correctly represents a negative difference.

However, because div_u64() returns a u64, standard C arithmetic conversions
cause the negative s32 to be sign-extended and promoted to u64.

This results in a huge positive number, making the condition incorrectly
evaluate to true, which freezes congestion window growth.

[ ... ]
> +	/* Terminates this function if cwnd is not fully utilized.
> +	 * In mobile networks like 5G, this termination causes the
> +	 * cwnd to be frozen at an excessively high value. This is
> +	 * because slow start or HyStart massively exceed the available
> +	 * bandwidth and leave the cwnd at an excessively high value.
> +	 * The cwnd cannot therefore be fully utilized because it is
> +	 * limited by the connection capacity.
> +	 *
> +	 * Also avoid cwnd-growth if we are in cwnd reduction phase.
> +	 */
> +	if (!tcp_is_cwnd_limited(sk) || sent_more_than_acked ||
> +	    tcp_in_cwnd_reduction(sk))
> +		return;

[Severity: High]
Can returning early here during TCP_CA_Recovery stall Fast Retransmit?

When a socket enters loss recovery, the TCP core delegates all congestion
control processing to the cong_control callback, bypassing the standard
tcp_cwnd_reduction() PRR routine.

If roccet_orbiter_update() always returns early without inflating snd_cwnd
for incoming dupACKs:

[ ... ]
> +static void roccet_state(struct sock *sk, u8 new_state)
> +{
[ ... ]
> +	} else if (new_state == TCP_CA_Recovery) {
> +		/* Directly reduce cwnd and rely on pacing */
> +		cwnd = roccet_handle_recovery(sk);
> +		tcp_snd_cwnd_set(tp, cwnd);
> +	}

The snd_cwnd is statically reduced upon entering recovery. Because it is
never inflated by dupACKs, tcp_packets_in_flight() will remain above the
reduced snd_cwnd.

When tcp_xmit_retransmit_queue() attempts to fast retransmit, it calculates
available segments as tcp_snd_cwnd(tp) - tcp_packets_in_flight(tp) which
evaluates to <= 0, completely preventing retransmissions until an RTO fires.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/arqDuiD4Q4GWOFBc@volt-roccet-vm?part=1

  reply	other threads:[~2026-09-29 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 15:11 [PATCHv9 net-next] tcp: Add TCP ROCCET congestion control module Tim Fuechsel
2026-09-29 15:12 ` sashiko-bot [this message]
2026-10-01 18:14 ` 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=20260929151219.5F0A81F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=t.fuechsel@gmx.de \
    /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