aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/ar-ack.c26
-rw-r--r--net/rxrpc/ar-call.c2
-rw-r--r--net/rxrpc/ar-internal.h3
-rw-r--r--net/rxrpc/sysctl.c33
4 files changed, 60 insertions, 4 deletions
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c
index 1a490d976e7e..c6be17a959a6 100644
--- a/net/rxrpc/ar-ack.c
+++ b/net/rxrpc/ar-ack.c
@@ -43,6 +43,26 @@ unsigned rxrpc_soft_ack_delay = 1 * HZ;
43 */ 43 */
44unsigned rxrpc_idle_ack_delay = 0.5 * HZ; 44unsigned rxrpc_idle_ack_delay = 0.5 * HZ;
45 45
46/*
47 * Receive window size in packets. This indicates the maximum number of
48 * unconsumed received packets we're willing to retain in memory. Once this
49 * limit is hit, we should generate an EXCEEDS_WINDOW ACK and discard further
50 * packets.
51 */
52unsigned rxrpc_rx_window_size = 32;
53
54/*
55 * Maximum Rx MTU size. This indicates to the sender the size of jumbo packet
56 * made by gluing normal packets together that we're willing to handle.
57 */
58unsigned rxrpc_rx_mtu = 5692;
59
60/*
61 * The maximum number of fragments in a received jumbo packet that we tell the
62 * sender that we're willing to handle.
63 */
64unsigned rxrpc_rx_jumbo_max = 4;
65
46static const char *rxrpc_acks(u8 reason) 66static const char *rxrpc_acks(u8 reason)
47{ 67{
48 static const char *const str[] = { 68 static const char *const str[] = {
@@ -1195,11 +1215,11 @@ send_ACK:
1195 mtu = call->conn->trans->peer->if_mtu; 1215 mtu = call->conn->trans->peer->if_mtu;
1196 mtu -= call->conn->trans->peer->hdrsize; 1216 mtu -= call->conn->trans->peer->hdrsize;
1197 ackinfo.maxMTU = htonl(mtu); 1217 ackinfo.maxMTU = htonl(mtu);
1198 ackinfo.rwind = htonl(32); 1218 ackinfo.rwind = htonl(rxrpc_rx_window_size);
1199 1219
1200 /* permit the peer to send us jumbo packets if it wants to */ 1220 /* permit the peer to send us jumbo packets if it wants to */
1201 ackinfo.rxMTU = htonl(5692); 1221 ackinfo.rxMTU = htonl(rxrpc_rx_mtu);
1202 ackinfo.jumbo_max = htonl(4); 1222 ackinfo.jumbo_max = htonl(rxrpc_rx_jumbo_max);
1203 1223
1204 hdr.serial = htonl(atomic_inc_return(&call->conn->serial)); 1224 hdr.serial = htonl(atomic_inc_return(&call->conn->serial));
1205 _proto("Tx ACK %%%u { m=%hu f=#%u p=#%u s=%%%u r=%s n=%u }", 1225 _proto("Tx ACK %%%u { m=%hu f=#%u p=#%u s=%%%u r=%s n=%u }",
diff --git a/net/rxrpc/ar-call.c b/net/rxrpc/ar-call.c
index 1e0903a2a0db..6e4d58c9b042 100644
--- a/net/rxrpc/ar-call.c
+++ b/net/rxrpc/ar-call.c
@@ -99,7 +99,7 @@ static struct rxrpc_call *rxrpc_alloc_call(gfp_t gfp)
99 call->rx_data_expect = 1; 99 call->rx_data_expect = 1;
100 call->rx_data_eaten = 0; 100 call->rx_data_eaten = 0;
101 call->rx_first_oos = 0; 101 call->rx_first_oos = 0;
102 call->ackr_win_top = call->rx_data_eaten + 1 + RXRPC_MAXACKS; 102 call->ackr_win_top = call->rx_data_eaten + 1 + rxrpc_rx_window_size;
103 call->creation_jif = jiffies; 103 call->creation_jif = jiffies;
104 return call; 104 return call;
105} 105}
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index 036e1dd84223..1ecd070e9149 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -436,6 +436,9 @@ int rxrpc_reject_call(struct rxrpc_sock *);
436extern unsigned rxrpc_requested_ack_delay; 436extern unsigned rxrpc_requested_ack_delay;
437extern unsigned rxrpc_soft_ack_delay; 437extern unsigned rxrpc_soft_ack_delay;
438extern unsigned rxrpc_idle_ack_delay; 438extern unsigned rxrpc_idle_ack_delay;
439extern unsigned rxrpc_rx_window_size;
440extern unsigned rxrpc_rx_mtu;
441extern unsigned rxrpc_rx_jumbo_max;
439 442
440void __rxrpc_propose_ACK(struct rxrpc_call *, u8, __be32, bool); 443void __rxrpc_propose_ACK(struct rxrpc_call *, u8, __be32, bool);
441void rxrpc_propose_ACK(struct rxrpc_call *, u8, __be32, bool); 444void rxrpc_propose_ACK(struct rxrpc_call *, u8, __be32, bool);
diff --git a/net/rxrpc/sysctl.c b/net/rxrpc/sysctl.c
index cdc85e72af5d..50a98a910eb1 100644
--- a/net/rxrpc/sysctl.c
+++ b/net/rxrpc/sysctl.c
@@ -17,6 +17,9 @@
17static struct ctl_table_header *rxrpc_sysctl_reg_table; 17static struct ctl_table_header *rxrpc_sysctl_reg_table;
18static const unsigned zero = 0; 18static const unsigned zero = 0;
19static const unsigned one = 1; 19static const unsigned one = 1;
20static const unsigned four = 4;
21static const unsigned n_65535 = 65535;
22static const unsigned n_max_acks = RXRPC_MAXACKS;
20 23
21/* 24/*
22 * RxRPC operating parameters. 25 * RxRPC operating parameters.
@@ -94,6 +97,36 @@ static struct ctl_table rxrpc_sysctl_table[] = {
94 .proc_handler = proc_dointvec_minmax, 97 .proc_handler = proc_dointvec_minmax,
95 .extra1 = (void *)&one, 98 .extra1 = (void *)&one,
96 }, 99 },
100
101 /* Non-time values */
102 {
103 .procname = "rx_window_size",
104 .data = &rxrpc_rx_window_size,
105 .maxlen = sizeof(unsigned),
106 .mode = 0644,
107 .proc_handler = proc_dointvec_minmax,
108 .extra1 = (void *)&one,
109 .extra2 = (void *)&n_max_acks,
110 },
111 {
112 .procname = "rx_mtu",
113 .data = &rxrpc_rx_mtu,
114 .maxlen = sizeof(unsigned),
115 .mode = 0644,
116 .proc_handler = proc_dointvec_minmax,
117 .extra1 = (void *)&one,
118 .extra1 = (void *)&n_65535,
119 },
120 {
121 .procname = "rx_jumbo_max",
122 .data = &rxrpc_rx_jumbo_max,
123 .maxlen = sizeof(unsigned),
124 .mode = 0644,
125 .proc_handler = proc_dointvec_minmax,
126 .extra1 = (void *)&one,
127 .extra2 = (void *)&four,
128 },
129
97 { } 130 { }
98}; 131};
99 132