1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-or-later 2*4882a593Smuzhiyun /* Miscellaneous bits 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved. 5*4882a593Smuzhiyun * Written by David Howells (dhowells@redhat.com) 6*4882a593Smuzhiyun */ 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun #include <linux/kernel.h> 9*4882a593Smuzhiyun #include <net/sock.h> 10*4882a593Smuzhiyun #include <net/af_rxrpc.h> 11*4882a593Smuzhiyun #include "ar-internal.h" 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun /* 14*4882a593Smuzhiyun * The maximum listening backlog queue size that may be set on a socket by 15*4882a593Smuzhiyun * listen(). 16*4882a593Smuzhiyun */ 17*4882a593Smuzhiyun unsigned int rxrpc_max_backlog __read_mostly = 10; 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun /* 20*4882a593Smuzhiyun * How long to wait before scheduling ACK generation after seeing a 21*4882a593Smuzhiyun * packet with RXRPC_REQUEST_ACK set (in jiffies). 22*4882a593Smuzhiyun */ 23*4882a593Smuzhiyun unsigned long rxrpc_requested_ack_delay = 1; 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun /* 26*4882a593Smuzhiyun * How long to wait before scheduling an ACK with subtype DELAY (in jiffies). 27*4882a593Smuzhiyun * 28*4882a593Smuzhiyun * We use this when we've received new data packets. If those packets aren't 29*4882a593Smuzhiyun * all consumed within this time we will send a DELAY ACK if an ACK was not 30*4882a593Smuzhiyun * requested to let the sender know it doesn't need to resend. 31*4882a593Smuzhiyun */ 32*4882a593Smuzhiyun unsigned long rxrpc_soft_ack_delay = HZ; 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun /* 35*4882a593Smuzhiyun * How long to wait before scheduling an ACK with subtype IDLE (in jiffies). 36*4882a593Smuzhiyun * 37*4882a593Smuzhiyun * We use this when we've consumed some previously soft-ACK'd packets when 38*4882a593Smuzhiyun * further packets aren't immediately received to decide when to send an IDLE 39*4882a593Smuzhiyun * ACK let the other end know that it can free up its Tx buffer space. 40*4882a593Smuzhiyun */ 41*4882a593Smuzhiyun unsigned long rxrpc_idle_ack_delay = HZ / 2; 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun /* 44*4882a593Smuzhiyun * Receive window size in packets. This indicates the maximum number of 45*4882a593Smuzhiyun * unconsumed received packets we're willing to retain in memory. Once this 46*4882a593Smuzhiyun * limit is hit, we should generate an EXCEEDS_WINDOW ACK and discard further 47*4882a593Smuzhiyun * packets. 48*4882a593Smuzhiyun */ 49*4882a593Smuzhiyun unsigned int rxrpc_rx_window_size = RXRPC_INIT_RX_WINDOW_SIZE; 50*4882a593Smuzhiyun #if (RXRPC_RXTX_BUFF_SIZE - 1) < RXRPC_INIT_RX_WINDOW_SIZE 51*4882a593Smuzhiyun #error Need to reduce RXRPC_INIT_RX_WINDOW_SIZE 52*4882a593Smuzhiyun #endif 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun /* 55*4882a593Smuzhiyun * Maximum Rx MTU size. This indicates to the sender the size of jumbo packet 56*4882a593Smuzhiyun * made by gluing normal packets together that we're willing to handle. 57*4882a593Smuzhiyun */ 58*4882a593Smuzhiyun unsigned int rxrpc_rx_mtu = 5692; 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun /* 61*4882a593Smuzhiyun * The maximum number of fragments in a received jumbo packet that we tell the 62*4882a593Smuzhiyun * sender that we're willing to handle. 63*4882a593Smuzhiyun */ 64*4882a593Smuzhiyun unsigned int rxrpc_rx_jumbo_max = 4; 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun const s8 rxrpc_ack_priority[] = { 67*4882a593Smuzhiyun [0] = 0, 68*4882a593Smuzhiyun [RXRPC_ACK_DELAY] = 1, 69*4882a593Smuzhiyun [RXRPC_ACK_REQUESTED] = 2, 70*4882a593Smuzhiyun [RXRPC_ACK_IDLE] = 3, 71*4882a593Smuzhiyun [RXRPC_ACK_DUPLICATE] = 4, 72*4882a593Smuzhiyun [RXRPC_ACK_OUT_OF_SEQUENCE] = 5, 73*4882a593Smuzhiyun [RXRPC_ACK_EXCEEDS_WINDOW] = 6, 74*4882a593Smuzhiyun [RXRPC_ACK_NOSPACE] = 7, 75*4882a593Smuzhiyun [RXRPC_ACK_PING_RESPONSE] = 8, 76*4882a593Smuzhiyun }; 77