Blame view
net/rxrpc/sysctl.c
3.6 KB
b4d0d230c treewide: Replace... |
1 |
// SPDX-License-Identifier: GPL-2.0-or-later |
5873c0834 af_rxrpc: Add sys... |
2 3 4 5 |
/* sysctls for configuring RxRPC operating parameters * * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) |
5873c0834 af_rxrpc: Add sys... |
6 7 8 9 10 11 12 13 |
*/ #include <linux/sysctl.h> #include <net/sock.h> #include <net/af_rxrpc.h> #include "ar-internal.h" static struct ctl_table_header *rxrpc_sysctl_reg_table; |
dad8aff75 rxrpc: Replace al... |
14 |
static const unsigned int four = 4; |
0e119b41b rxrpc: Limit the ... |
15 |
static const unsigned int thirtytwo = 32; |
dad8aff75 rxrpc: Replace al... |
16 |
static const unsigned int n_65535 = 65535; |
75e421263 rxrpc: Correctly ... |
17 |
static const unsigned int n_max_acks = RXRPC_RXTX_BUFF_SIZE - 1; |
a158bdd32 rxrpc: Fix call t... |
18 19 |
static const unsigned long one_jiffy = 1; static const unsigned long max_jiffies = MAX_JIFFY_OFFSET; |
5873c0834 af_rxrpc: Add sys... |
20 21 22 23 |
/* * RxRPC operating parameters. * |
9f72374cb docs: networking:... |
24 |
* See Documentation/networking/rxrpc.rst and the variable definitions for more |
5873c0834 af_rxrpc: Add sys... |
25 26 27 |
* information on the individual parameters. */ static struct ctl_table rxrpc_sysctl_table[] = { |
a158bdd32 rxrpc: Fix call t... |
28 |
/* Values measured in milliseconds but used in jiffies */ |
5873c0834 af_rxrpc: Add sys... |
29 30 31 |
{ .procname = "req_ack_delay", .data = &rxrpc_requested_ack_delay, |
a158bdd32 rxrpc: Fix call t... |
32 |
.maxlen = sizeof(unsigned long), |
5873c0834 af_rxrpc: Add sys... |
33 |
.mode = 0644, |
a158bdd32 rxrpc: Fix call t... |
34 35 36 |
.proc_handler = proc_doulongvec_ms_jiffies_minmax, .extra1 = (void *)&one_jiffy, .extra2 = (void *)&max_jiffies, |
5873c0834 af_rxrpc: Add sys... |
37 38 39 40 |
}, { .procname = "soft_ack_delay", .data = &rxrpc_soft_ack_delay, |
a158bdd32 rxrpc: Fix call t... |
41 |
.maxlen = sizeof(unsigned long), |
5873c0834 af_rxrpc: Add sys... |
42 |
.mode = 0644, |
a158bdd32 rxrpc: Fix call t... |
43 44 45 |
.proc_handler = proc_doulongvec_ms_jiffies_minmax, .extra1 = (void *)&one_jiffy, .extra2 = (void *)&max_jiffies, |
5873c0834 af_rxrpc: Add sys... |
46 47 48 49 |
}, { .procname = "idle_ack_delay", .data = &rxrpc_idle_ack_delay, |
a158bdd32 rxrpc: Fix call t... |
50 |
.maxlen = sizeof(unsigned long), |
5873c0834 af_rxrpc: Add sys... |
51 |
.mode = 0644, |
a158bdd32 rxrpc: Fix call t... |
52 53 54 |
.proc_handler = proc_doulongvec_ms_jiffies_minmax, .extra1 = (void *)&one_jiffy, .extra2 = (void *)&max_jiffies, |
5873c0834 af_rxrpc: Add sys... |
55 |
}, |
45025bcee rxrpc: Improve ma... |
56 57 58 |
{ .procname = "idle_conn_expiry", .data = &rxrpc_conn_idle_client_expiry, |
a158bdd32 rxrpc: Fix call t... |
59 |
.maxlen = sizeof(unsigned long), |
45025bcee rxrpc: Improve ma... |
60 |
.mode = 0644, |
a158bdd32 rxrpc: Fix call t... |
61 62 63 |
.proc_handler = proc_doulongvec_ms_jiffies_minmax, .extra1 = (void *)&one_jiffy, .extra2 = (void *)&max_jiffies, |
45025bcee rxrpc: Improve ma... |
64 65 66 67 |
}, { .procname = "idle_conn_fast_expiry", .data = &rxrpc_conn_idle_client_fast_expiry, |
a158bdd32 rxrpc: Fix call t... |
68 |
.maxlen = sizeof(unsigned long), |
45025bcee rxrpc: Improve ma... |
69 |
.mode = 0644, |
a158bdd32 rxrpc: Fix call t... |
70 71 72 |
.proc_handler = proc_doulongvec_ms_jiffies_minmax, .extra1 = (void *)&one_jiffy, .extra2 = (void *)&max_jiffies, |
45025bcee rxrpc: Improve ma... |
73 |
}, |
5873c0834 af_rxrpc: Add sys... |
74 |
|
45025bcee rxrpc: Improve ma... |
75 76 |
/* Non-time values */ { |
45025bcee rxrpc: Improve ma... |
77 78 |
.procname = "reap_client_conns", .data = &rxrpc_reap_client_connections, |
dad8aff75 rxrpc: Replace al... |
79 |
.maxlen = sizeof(unsigned int), |
5873c0834 af_rxrpc: Add sys... |
80 81 |
.mode = 0644, .proc_handler = proc_dointvec_minmax, |
eec4844fa proc/sysctl: add ... |
82 |
.extra1 = (void *)SYSCTL_ONE, |
245500d85 rxrpc: Rewrite th... |
83 |
.extra2 = (void *)&n_65535, |
5873c0834 af_rxrpc: Add sys... |
84 |
}, |
817913d8c af_rxrpc: Expose ... |
85 |
{ |
0e119b41b rxrpc: Limit the ... |
86 87 88 89 90 91 92 93 94 |
.procname = "max_backlog", .data = &rxrpc_max_backlog, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = proc_dointvec_minmax, .extra1 = (void *)&four, .extra2 = (void *)&thirtytwo, }, { |
817913d8c af_rxrpc: Expose ... |
95 96 |
.procname = "rx_window_size", .data = &rxrpc_rx_window_size, |
dad8aff75 rxrpc: Replace al... |
97 |
.maxlen = sizeof(unsigned int), |
817913d8c af_rxrpc: Expose ... |
98 99 |
.mode = 0644, .proc_handler = proc_dointvec_minmax, |
eec4844fa proc/sysctl: add ... |
100 |
.extra1 = (void *)SYSCTL_ONE, |
817913d8c af_rxrpc: Expose ... |
101 102 103 104 105 |
.extra2 = (void *)&n_max_acks, }, { .procname = "rx_mtu", .data = &rxrpc_rx_mtu, |
dad8aff75 rxrpc: Replace al... |
106 |
.maxlen = sizeof(unsigned int), |
817913d8c af_rxrpc: Expose ... |
107 108 |
.mode = 0644, .proc_handler = proc_dointvec_minmax, |
eec4844fa proc/sysctl: add ... |
109 |
.extra1 = (void *)SYSCTL_ONE, |
ee6fe085a rxrpc: Fix define... |
110 |
.extra2 = (void *)&n_65535, |
817913d8c af_rxrpc: Expose ... |
111 112 113 114 |
}, { .procname = "rx_jumbo_max", .data = &rxrpc_rx_jumbo_max, |
dad8aff75 rxrpc: Replace al... |
115 |
.maxlen = sizeof(unsigned int), |
817913d8c af_rxrpc: Expose ... |
116 117 |
.mode = 0644, .proc_handler = proc_dointvec_minmax, |
eec4844fa proc/sysctl: add ... |
118 |
.extra1 = (void *)SYSCTL_ONE, |
817913d8c af_rxrpc: Expose ... |
119 120 |
.extra2 = (void *)&four, }, |
5873c0834 af_rxrpc: Add sys... |
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
{ } }; int __init rxrpc_sysctl_init(void) { rxrpc_sysctl_reg_table = register_net_sysctl(&init_net, "net/rxrpc", rxrpc_sysctl_table); if (!rxrpc_sysctl_reg_table) return -ENOMEM; return 0; } void rxrpc_sysctl_exit(void) { if (rxrpc_sysctl_reg_table) unregister_net_sysctl_table(rxrpc_sysctl_reg_table); } |