Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: dhowells@redhat.com
Cc: netdev@vger.kernel.org, marc.dionne@auristor.com,
	kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, horms@kernel.org,
	linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org,
	jaltman@auristor.com, stable@vger.kernel.org
Subject: Re: [PATCH net v3 08/10] rxrpc: Fix detection of TLP probe response
Date: Fri, 27 Nov 2026 10:13:39 +0000	[thread overview]
Message-ID: <179577441933.3135.16643898652433850053@kernel.org> (raw)
In-Reply-To: <20261124161302.4044422-9-dhowells@redhat.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The probe-completion test in rxrpc_input_ack(), `if
  (after_eq(summary.acked_serial, call->tlp_serial)) call->tlp_serial =…
- [Low] The first paragraph of the commit message says the patch fixes a
  bug: without a ->tlp_serial check, an ACK of a packet matching a stale…

--

rxrpc: Fix detection of TLP probe response

This commit adds a ->tlp_serial check before setting
summary->tlp_probe_acked in rxrpc_rotate_tx_window(), and moves the
->tlp_serial check out of rxrpc_tlp_process_ack() into its caller. It also
makes rxrpc_input_ack() check for a TLP probe response on ACKs that
rxrpc_is_ack_valid() discards as out of order or duplicate.

> diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
> index 63a0feae2081d..d01a8d95dc6db 100644
> --- a/net/rxrpc/input.c
> +++ b/net/rxrpc/input.c
> @@ -275,7 +275,8 @@ static bool rxrpc_rotate_tx_window(struct rxrpc_call *call, rxrpc_seq_t to,
>  			/* Packet directly hard ACK'd. */
>  			tq->nr_reported_acks++;
>  			rxrpc_input_rack_one(call, summary, tq, ix);
> -			if (seq == call->tlp_seq)
> +			if (call->tlp_serial &&
> +			    seq == call->tlp_seq)
>  				summary->tlp_probe_acked = true;

[Severity: Low]

The commit message says:

  Fix detection of the TLP probe response to include a check that
  ->tlp_serial is valid, otherwise it's possible to see an ACK of a packet
  that matches an old value of ->tlp_seq as a probe response.

Does this part of the patch change behaviour at this commit?

Only rxrpc_tlp_process_ack() reads summary->tlp_probe_acked. Before this
patch, that function already returned early when no probe was
outstanding:

    if (!call->tlp_serial || after(call->tlp_seq, call->acks_hard_ack))
        return;

Within one rxrpc_input_ack() call, call->tlp_serial can't go from zero to
non-zero between the rotation and rxrpc_tlp_process_ack(). Only
rxrpc_tlp_send_probe() and rxrpc_prepare_data_packet() set it, and both
run from the rack timer path. The summary is local to each ACK, and no
tracepoint records tlp_probe_acked.

So a stale tlp_probe_acked was already being ignored. The new guards here
and in the soft NAK branch look like they only move the existing check
into the callers.

The guard starts to matter with the later commit "rxrpc: Fix counting of
in-flight transmitted packets", which adds rxrpc_tlp_end_probe() to this
block. Could the commit message describe this part as preparation for that
change? Otherwise stable backporters may think they are getting two fixes.

[ ... ]

> @@ -1139,7 +1141,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
>  	/* Discard any out-of-order or duplicate ACKs (outside lock). */
>  	if (!rxrpc_is_ack_valid(call, hard_ack, prev_pkt)) {
>  		trace_rxrpc_rx_discard_ack(call, summary.ack_serial, hard_ack, prev_pkt);
> -		goto send_response; /* Still respond if requested. */
> +		goto check_for_tlp_probe; /* Still respond if requested. */
>  	}
>  
>  	trailer.maxMTU = 0;
> @@ -1217,9 +1219,16 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
>  	 */
>  	rxrpc_congestion_management(call, &summary);
>  	rxrpc_rack_detect_loss_and_arm_timer(call, &summary);
> -	rxrpc_tlp_process_ack(call, &summary);
> -	if (call->tlp_serial && after_eq(summary.acked_serial, call->tlp_serial))
> -		call->tlp_serial = 0;
> +
> +check_for_tlp_probe:
> +	if (call->tlp_serial) {
> +		/* Need to check to see if the ACK is a TLP probe response,
> +		 * even if the ACKs may have come out of order.
> +		 */
> +		rxrpc_tlp_process_ack(call, &summary);
> +		if (after_eq(summary.acked_serial, call->tlp_serial))
> +			call->tlp_serial = 0;
                    ^^^^

[Severity: Medium]

Can this end an outstanding TLP probe because of an ACK that doesn't
respond to any packet?

An acked_serial of 0 means the ACK wasn't sent in reply to a particular
packet. Elsewhere, rxrpc_input_ack() checks if (summary.acked_serial)
before it uses the value, but after_eq() here treats 0 as a normal serial.

rxrpc_get_next_serial() hands out connection serials starting at 1 and
skips only 0:

    serial = conn->tx_serial;
    if (serial == 0)
        serial = 1;
    conn->tx_serial = serial + 1;

After a long-lived connection has used more than 2^31 serials, tlp_serial
will be above 0x80000000. At that point after_eq(0, tlp_serial) is true,
and any ACK with acked_serial == 0 clears tlp_serial.

Linux peers send these ACKs routinely. For example,
rxrpc_input_call_event() does:

    rxrpc_send_ACK(call, RXRPC_ACK_DELAY, 0,
                   rxrpc_propose_ack_delayed_ack);

and it sends IDLE and PING ACKs with serial 0 as well.

The in-order ACK path had this problem before this patch. The new goto
check_for_tlp_probe on the rxrpc_is_ack_valid() failure path means that
discarded out-of-order and duplicate ACKs, including serial-0 ones, now
reach the same comparison.

If tlp_serial is cleared early, a later ACK that really covers tlp_seq
fails the call->tlp_serial tests in rxrpc_rotate_tx_window(). It also
skips rxrpc_tlp_process_ack(), so the RFC 8985 section 7.4 handling never
runs. rxrpc_tlp_send_probe() only checks !call->tlp_serial, so it can send
another probe on the next PTO.

The problem is still there at the end of the series. After the later
commit "rxrpc: Fix counting of in-flight transmitted packets", this line
calls rxrpc_tlp_end_probe(). That also clears tlp_in_flight and
decrements tx_in_flight while the probe packet is still unacknowledged.

Would requiring a non-zero acked_serial here help, something like:

    if (summary.acked_serial &&
        after_eq(summary.acked_serial, call->tlp_serial))

> +	}
>  
>  send_response:
>  	if (summary.ack_reason == RXRPC_ACK_PING)

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124161302.4044422-1-dhowells%40redhat.com

  reply	other threads:[~2026-11-27 10:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 16:12 [PATCH net v3 00/10] rxrpc: RACK-TLP fixes David Howells
2026-11-24 16:12 ` [PATCH net v3 01/10] rxrpc: Fix incorrect unit conversion David Howells
2026-11-24 16:12 ` [PATCH net v3 02/10] rxrpc: Fix time unit conversion truncation David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 03/10] rxrpc: Fix carrying of in-flight calc over retransmission David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 04/10] rxrpc: Fix ack parsing to mark reneged ACKs as lost for RACK-TLP David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 05/10] rxrpc: Fix RTT processing for a presumed lost packet getting ACK'd David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 06/10] rxrpc: Fix lost driving of congestion management retransmission timeout David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 07/10] rxrpc: Fix limit on packets to be transmitted in one go David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 08/10] rxrpc: Fix detection of TLP probe response David Howells
2026-11-27 10:13   ` netdev-bot+sashiko [this message]
2026-11-24 16:12 ` [PATCH net v3 09/10] rxrpc: Fix counting of in-flight transmitted packets David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 10/10] rxrpc: Fix RACK-TLP implementation David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:18 ` [PATCH net v3 00/10] rxrpc: RACK-TLP fixes netdev-bot+sinfo

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=179577441933.3135.16643898652433850053@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jaltman@auristor.com \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /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