diff options
author | David Howells <dhowells@redhat.com> | 2014-02-07 13:58:44 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2014-02-26 12:25:06 -0500 |
commit | 5873c0834f8896aa9da338b941035a2f8b29e99b (patch) | |
tree | 4faf1ab1a7f95be86c5d9d775b82b6d01012c9a5 /net/rxrpc/ar-ack.c | |
parent | 6c9a2d3202973a0266beabc5274c3e67dad5db96 (diff) |
af_rxrpc: Add sysctls for configuring RxRPC parameters
Add sysctls for configuring RxRPC protocol handling, specifically controls on
delays before ack generation, the delay before resending a packet, the maximum
lifetime of a call and the expiration times of calls, connections and
transports that haven't been recently used.
More info added in Documentation/networking/rxrpc.txt.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/ar-ack.c')
-rw-r--r-- | net/rxrpc/ar-ack.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c index cd97a0ce48d8..732b82f540c5 100644 --- a/net/rxrpc/ar-ack.c +++ b/net/rxrpc/ar-ack.c | |||
@@ -19,7 +19,29 @@ | |||
19 | #include <net/af_rxrpc.h> | 19 | #include <net/af_rxrpc.h> |
20 | #include "ar-internal.h" | 20 | #include "ar-internal.h" |
21 | 21 | ||
22 | static unsigned int rxrpc_ack_defer = 1; | 22 | /* |
23 | * How long to wait before scheduling ACK generation after seeing a | ||
24 | * packet with RXRPC_REQUEST_ACK set (in jiffies). | ||
25 | */ | ||
26 | unsigned rxrpc_requested_ack_delay = 1; | ||
27 | |||
28 | /* | ||
29 | * How long to wait before scheduling an ACK with subtype DELAY (in jiffies). | ||
30 | * | ||
31 | * We use this when we've received new data packets. If those packets aren't | ||
32 | * all consumed within this time we will send a DELAY ACK if an ACK was not | ||
33 | * requested to let the sender know it doesn't need to resend. | ||
34 | */ | ||
35 | unsigned rxrpc_soft_ack_delay = 1 * HZ; | ||
36 | |||
37 | /* | ||
38 | * How long to wait before scheduling an ACK with subtype IDLE (in jiffies). | ||
39 | * | ||
40 | * We use this when we've consumed some previously soft-ACK'd packets when | ||
41 | * further packets aren't immediately received to decide when to send an IDLE | ||
42 | * ACK let the other end know that it can free up its Tx buffer space. | ||
43 | */ | ||
44 | unsigned rxrpc_idle_ack_delay = 1; | ||
23 | 45 | ||
24 | static const char *rxrpc_acks(u8 reason) | 46 | static const char *rxrpc_acks(u8 reason) |
25 | { | 47 | { |
@@ -82,24 +104,23 @@ void __rxrpc_propose_ACK(struct rxrpc_call *call, u8 ack_reason, | |||
82 | switch (ack_reason) { | 104 | switch (ack_reason) { |
83 | case RXRPC_ACK_DELAY: | 105 | case RXRPC_ACK_DELAY: |
84 | _debug("run delay timer"); | 106 | _debug("run delay timer"); |
85 | call->ack_timer.expires = jiffies + rxrpc_ack_timeout * HZ; | 107 | expiry = rxrpc_soft_ack_delay; |
86 | add_timer(&call->ack_timer); | 108 | goto run_timer; |
87 | return; | ||
88 | 109 | ||
89 | case RXRPC_ACK_IDLE: | 110 | case RXRPC_ACK_IDLE: |
90 | if (!immediate) { | 111 | if (!immediate) { |
91 | _debug("run defer timer"); | 112 | _debug("run defer timer"); |
92 | expiry = 1; | 113 | expiry = rxrpc_idle_ack_delay; |
93 | goto run_timer; | 114 | goto run_timer; |
94 | } | 115 | } |
95 | goto cancel_timer; | 116 | goto cancel_timer; |
96 | 117 | ||
97 | case RXRPC_ACK_REQUESTED: | 118 | case RXRPC_ACK_REQUESTED: |
98 | if (!rxrpc_ack_defer) | 119 | expiry = rxrpc_requested_ack_delay; |
120 | if (!expiry) | ||
99 | goto cancel_timer; | 121 | goto cancel_timer; |
100 | if (!immediate || serial == cpu_to_be32(1)) { | 122 | if (!immediate || serial == cpu_to_be32(1)) { |
101 | _debug("run defer timer"); | 123 | _debug("run defer timer"); |
102 | expiry = rxrpc_ack_defer; | ||
103 | goto run_timer; | 124 | goto run_timer; |
104 | } | 125 | } |
105 | 126 | ||