KVM: x86: fix empty-body warnings
[linux/fpc-iii.git] / net / rxrpc / sysctl.c
blobd75bd15151e6e30429cf842dfe3a74a17192d33f
1 /* sysctls for configuring RxRPC operating parameters
3 * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
12 #include <linux/sysctl.h>
13 #include <net/sock.h>
14 #include <net/af_rxrpc.h>
15 #include "ar-internal.h"
17 static struct ctl_table_header *rxrpc_sysctl_reg_table;
18 static const unsigned int one = 1;
19 static const unsigned int four = 4;
20 static const unsigned int thirtytwo = 32;
21 static const unsigned int n_65535 = 65535;
22 static const unsigned int n_max_acks = RXRPC_RXTX_BUFF_SIZE - 1;
23 static const unsigned long one_jiffy = 1;
24 static const unsigned long max_jiffies = MAX_JIFFY_OFFSET;
27 * RxRPC operating parameters.
29 * See Documentation/networking/rxrpc.txt and the variable definitions for more
30 * information on the individual parameters.
32 static struct ctl_table rxrpc_sysctl_table[] = {
33 /* Values measured in milliseconds but used in jiffies */
35 .procname = "req_ack_delay",
36 .data = &rxrpc_requested_ack_delay,
37 .maxlen = sizeof(unsigned long),
38 .mode = 0644,
39 .proc_handler = proc_doulongvec_ms_jiffies_minmax,
40 .extra1 = (void *)&one_jiffy,
41 .extra2 = (void *)&max_jiffies,
44 .procname = "soft_ack_delay",
45 .data = &rxrpc_soft_ack_delay,
46 .maxlen = sizeof(unsigned long),
47 .mode = 0644,
48 .proc_handler = proc_doulongvec_ms_jiffies_minmax,
49 .extra1 = (void *)&one_jiffy,
50 .extra2 = (void *)&max_jiffies,
53 .procname = "idle_ack_delay",
54 .data = &rxrpc_idle_ack_delay,
55 .maxlen = sizeof(unsigned long),
56 .mode = 0644,
57 .proc_handler = proc_doulongvec_ms_jiffies_minmax,
58 .extra1 = (void *)&one_jiffy,
59 .extra2 = (void *)&max_jiffies,
62 .procname = "idle_conn_expiry",
63 .data = &rxrpc_conn_idle_client_expiry,
64 .maxlen = sizeof(unsigned long),
65 .mode = 0644,
66 .proc_handler = proc_doulongvec_ms_jiffies_minmax,
67 .extra1 = (void *)&one_jiffy,
68 .extra2 = (void *)&max_jiffies,
71 .procname = "idle_conn_fast_expiry",
72 .data = &rxrpc_conn_idle_client_fast_expiry,
73 .maxlen = sizeof(unsigned long),
74 .mode = 0644,
75 .proc_handler = proc_doulongvec_ms_jiffies_minmax,
76 .extra1 = (void *)&one_jiffy,
77 .extra2 = (void *)&max_jiffies,
80 .procname = "resend_timeout",
81 .data = &rxrpc_resend_timeout,
82 .maxlen = sizeof(unsigned long),
83 .mode = 0644,
84 .proc_handler = proc_doulongvec_ms_jiffies_minmax,
85 .extra1 = (void *)&one_jiffy,
86 .extra2 = (void *)&max_jiffies,
89 /* Non-time values */
91 .procname = "max_client_conns",
92 .data = &rxrpc_max_client_connections,
93 .maxlen = sizeof(unsigned int),
94 .mode = 0644,
95 .proc_handler = proc_dointvec_minmax,
96 .extra1 = (void *)&rxrpc_reap_client_connections,
99 .procname = "reap_client_conns",
100 .data = &rxrpc_reap_client_connections,
101 .maxlen = sizeof(unsigned int),
102 .mode = 0644,
103 .proc_handler = proc_dointvec_minmax,
104 .extra1 = (void *)&one,
105 .extra2 = (void *)&rxrpc_max_client_connections,
108 .procname = "max_backlog",
109 .data = &rxrpc_max_backlog,
110 .maxlen = sizeof(unsigned int),
111 .mode = 0644,
112 .proc_handler = proc_dointvec_minmax,
113 .extra1 = (void *)&four,
114 .extra2 = (void *)&thirtytwo,
117 .procname = "rx_window_size",
118 .data = &rxrpc_rx_window_size,
119 .maxlen = sizeof(unsigned int),
120 .mode = 0644,
121 .proc_handler = proc_dointvec_minmax,
122 .extra1 = (void *)&one,
123 .extra2 = (void *)&n_max_acks,
126 .procname = "rx_mtu",
127 .data = &rxrpc_rx_mtu,
128 .maxlen = sizeof(unsigned int),
129 .mode = 0644,
130 .proc_handler = proc_dointvec_minmax,
131 .extra1 = (void *)&one,
132 .extra2 = (void *)&n_65535,
135 .procname = "rx_jumbo_max",
136 .data = &rxrpc_rx_jumbo_max,
137 .maxlen = sizeof(unsigned int),
138 .mode = 0644,
139 .proc_handler = proc_dointvec_minmax,
140 .extra1 = (void *)&one,
141 .extra2 = (void *)&four,
147 int __init rxrpc_sysctl_init(void)
149 rxrpc_sysctl_reg_table = register_net_sysctl(&init_net, "net/rxrpc",
150 rxrpc_sysctl_table);
151 if (!rxrpc_sysctl_reg_table)
152 return -ENOMEM;
153 return 0;
156 void rxrpc_sysctl_exit(void)
158 if (rxrpc_sysctl_reg_table)
159 unregister_net_sysctl_table(rxrpc_sysctl_reg_table);