Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>,
	Marc Dionne <marc.dionne@auristor.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org,
	Jeffrey Altman <jaltman@auristor.com>,
	stable@vger.kernel.org
Subject: [PATCH net v3 07/10] rxrpc: Fix limit on packets to be transmitted in one go
Date: Tue, 24 Nov 2026 16:12:55 +0000	[thread overview]
Message-ID: <20261124161302.4044422-8-dhowells@redhat.com> (raw)
In-Reply-To: <20261124161302.4044422-1-dhowells@redhat.com>

Fix rxrpc_transmit_fresh_data() to honour the limit set on the number of
packets it can transmit in one go.  The 'limit' variable is accidentally
shadowed by another variable calculating the limit dynamically.

This was spotted by Claude-opus-5-5 run locally.

Fixes: 7c482665931b ("rxrpc: Implement RACK/TLP to deal with transmission stalls [RFC8985]")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@vger.kernel.org
---
 net/rxrpc/call_event.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index b102a055c2e0..4def732352e9 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -189,7 +189,8 @@ static void rxrpc_close_tx_phase(struct rxrpc_call *call)
 }
 
 /*
- * Transmit some as-yet untransmitted data, to a maximum of the supplied limit.
+ * Transmit some as-yet untransmitted data, to a maximum of the supplied limit
+ * (UINT_MAX for no limit).
  */
 static void rxrpc_transmit_fresh_data(struct rxrpc_call *call, unsigned int limit,
 				      enum rxrpc_txdata_trace trace)
@@ -212,7 +213,8 @@ static void rxrpc_transmit_fresh_data(struct rxrpc_call *call, unsigned int limi
 		struct rxrpc_txqueue *tq;
 		struct rxrpc_txbuf *txb;
 		rxrpc_seq_t send_top, seq;
-		int limit = min(space, max(call->peer->pmtud_jumbo, 1));
+		int jlimit = umin(umin(space, max(call->peer->pmtud_jumbo, 1)),
+				  limit);
 
 		/* Order send_top before the contents of the new txbufs and
 		 * txqueue pointers
@@ -242,7 +244,7 @@ static void rxrpc_transmit_fresh_data(struct rxrpc_call *call, unsigned int limi
 			req.n++;
 			if (!txb->jumboable)
 				break;
-		} while (req.n < limit && before(seq, send_top));
+		} while (req.n < jlimit && before(seq, send_top));
 
 		if (__rxrpc_call_state(call) == RXRPC_CALL_CLIENT_PRE_SEND)
 			rxrpc_set_call_state(call, RXRPC_CALL_CLIENT_SEND_REQUEST);
@@ -255,6 +257,11 @@ static void rxrpc_transmit_fresh_data(struct rxrpc_call *call, unsigned int limi
 
 		space -= req.n;
 		rxrpc_send_data_packet(call, &req);
+		if (limit < UINT_MAX) {
+			limit -= req.n;
+			if (limit == 0)
+				break;
+		}
 	}
 }
 


  parent reply	other threads:[~2026-11-24 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261124161302.4044422-1-dhowells@redhat.com>
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-24 16:12 ` [PATCH net v3 03/10] rxrpc: Fix carrying of in-flight calc over retransmission David Howells
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-24 16:12 ` [PATCH net v3 05/10] rxrpc: Fix RTT processing for a presumed lost packet getting ACK'd David Howells
2026-11-24 16:12 ` [PATCH net v3 06/10] rxrpc: Fix lost driving of congestion management retransmission timeout David Howells
2026-11-24 16:12 ` David Howells [this message]
2026-11-24 16:12 ` [PATCH net v3 08/10] rxrpc: Fix detection of TLP probe response David Howells
2026-11-24 16:12 ` [PATCH net v3 09/10] rxrpc: Fix counting of in-flight transmitted packets David Howells
2026-11-24 16:12 ` [PATCH net v3 10/10] rxrpc: Fix RACK-TLP implementation David Howells

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=20261124161302.4044422-8-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=davem@davemloft.net \
    --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