]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rxrpc: Fix to request an ack if window is limited
authorMarc Dionne <marc.c.dionne@gmail.com>
Wed, 8 Apr 2026 12:12:37 +0000 (13:12 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 Apr 2026 01:44:33 +0000 (18:44 -0700)
Peers may only send immediate acks for every 2 UDP packets received.
When sending a jumbogram, it is important to check that there is
sufficient window space to send another same sized jumbogram following
the current one, and request an ack if there isn't.  Failure to do so may
cause the call to stall waiting for an ack until the resend timer fires.

Where jumbograms are in use this causes a very significant drop in
performance.

Fixes: fe24a5494390 ("rxrpc: Send jumbo DATA packets")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
Link: https://patch.msgid.link/20260408121252.2249051-10-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/trace/events/rxrpc.h
net/rxrpc/ar-internal.h
net/rxrpc/output.c
net/rxrpc/proc.c

index f7f559204b8733206545b91df26208d5d57c7e56..578b8038b21178479f81d0013e1ae9e4a99f9d45 100644 (file)
 #define rxrpc_req_ack_traces \
        EM(rxrpc_reqack_ack_lost,               "ACK-LOST  ")   \
        EM(rxrpc_reqack_app_stall,              "APP-STALL ")   \
+       EM(rxrpc_reqack_jumbo_win,              "JUMBO-WIN ")   \
        EM(rxrpc_reqack_more_rtt,               "MORE-RTT  ")   \
        EM(rxrpc_reqack_no_srv_last,            "NO-SRVLAST")   \
        EM(rxrpc_reqack_old_rtt,                "OLD-RTT   ")   \
index 36d6ca0d1089e11791bf11a3a7c58b8d959b5786..96ecb83c90715352e687fa7ba953c21d7b26cee5 100644 (file)
@@ -117,7 +117,7 @@ struct rxrpc_net {
        atomic_t                stat_tx_jumbo[10];
        atomic_t                stat_rx_jumbo[10];
 
-       atomic_t                stat_why_req_ack[8];
+       atomic_t                stat_why_req_ack[9];
 
        atomic_t                stat_io_loop;
 };
index d70db367e358db2b00922b747ae14a471e899c1d..870e59bf06af2b234134faf5ae45c2ed206ed06a 100644 (file)
@@ -479,6 +479,8 @@ static size_t rxrpc_prepare_data_subpacket(struct rxrpc_call *call,
                why = rxrpc_reqack_old_rtt;
        else if (!last && !after(READ_ONCE(call->send_top), txb->seq))
                why = rxrpc_reqack_app_stall;
+       else if (call->tx_winsize <= (2 * req->n) || call->cong_cwnd <= (2 * req->n))
+               why = rxrpc_reqack_jumbo_win;
        else
                goto dont_set_request_ack;
 
index 59292f7f9205e7d34972acaed0a99ea86e3f7660..7755fca5beb86adb848fbc3b7855d17d24651a83 100644 (file)
@@ -518,11 +518,12 @@ int rxrpc_stats_show(struct seq_file *seq, void *v)
                   atomic_read(&rxnet->stat_rx_acks[RXRPC_ACK_IDLE]),
                   atomic_read(&rxnet->stat_rx_acks[0]));
        seq_printf(seq,
-                  "Why-Req-A: acklost=%u mrtt=%u ortt=%u stall=%u\n",
+                  "Why-Req-A: acklost=%u mrtt=%u ortt=%u stall=%u jwin=%u\n",
                   atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_ack_lost]),
                   atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_more_rtt]),
                   atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_old_rtt]),
-                  atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_app_stall]));
+                  atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_app_stall]),
+                  atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_jumbo_win]));
        seq_printf(seq,
                   "Why-Req-A: nolast=%u retx=%u slows=%u smtxw=%u\n",
                   atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_no_srv_last]),