rxrpc: Send jumbo DATA packets
authorDavid Howells <dhowells@redhat.com>
Wed, 4 Dec 2024 07:46:59 +0000 (07:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 9 Dec 2024 21:48:31 +0000 (13:48 -0800)
Send jumbo DATA packets if the path-MTU probing using padded PING ACK
packets shows up sufficient capacity to do so.  This allows larger chunks
of data to be sent without reducing the retryability as the subpackets in a
jumbo packet can also be retransmitted individually.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/rxrpc/ar-internal.h
net/rxrpc/call_event.c
net/rxrpc/call_object.c
net/rxrpc/input.c

index d0d0ab45390959a67a6f4757fe35e46b6e4f0e1d..1307749a1a7405bf01f4d039d66000d3f0e3b646 100644 (file)
@@ -710,6 +710,7 @@ struct rxrpc_call {
        u16                     tx_backoff;     /* Delay to insert due to Tx failure (ms) */
        u8                      tx_winsize;     /* Maximum size of Tx window */
 #define RXRPC_TX_MAX_WINDOW    128
+       u8                      tx_jumbo_max;   /* Maximum subpkts peer will accept */
        ktime_t                 tx_last_sent;   /* Last time a transmission occurred */
 
        /* Received data tracking */
index 4390c97e3ba60fa83d9d2c1f55d990f3d2c1229a..39772459426ba648ccd727eb367aaa2ad0570c3b 100644 (file)
@@ -288,7 +288,7 @@ static void rxrpc_transmit_fresh_data(struct rxrpc_call *call)
                struct rxrpc_txqueue *tq;
                struct rxrpc_txbuf *txb;
                rxrpc_seq_t send_top, seq;
-               int limit = min(space, 1);
+               int limit = min(space, max(call->peer->pmtud_jumbo, 1));
 
                /* Order send_top before the contents of the new txbufs and
                 * txqueue pointers
index bba058055c97f8ea9e6b4a97a51db68085069c1a..e0644e9a8d218fe5b94f6cf908e1727a0fdbdccc 100644 (file)
@@ -155,6 +155,7 @@ struct rxrpc_call *rxrpc_alloc_call(struct rxrpc_sock *rx, gfp_t gfp,
        refcount_set(&call->ref, 1);
        call->debug_id          = debug_id;
        call->tx_total_len      = -1;
+       call->tx_jumbo_max      = 1;
        call->next_rx_timo      = 20 * HZ;
        call->next_req_timo     = 1 * HZ;
        call->ackr_window       = 1;
index 1eb9c22aba51631d068bdd3ed565fd61122b59f2..a7a249872a541d3a590a3ad143ea2351dc60957c 100644 (file)
@@ -796,8 +796,11 @@ static void rxrpc_input_ack_trailer(struct rxrpc_call *call, struct sk_buff *skb
                peer->ackr_adv_pmtud = true;
        } else {
                peer->ackr_adv_pmtud = false;
+               capacity = clamp(capacity, 1, jumbo_max);
        }
 
+       call->tx_jumbo_max = capacity;
+
        if (wake)
                wake_up(&call->waitq);
 }